/*
Theme Name: Yuhua 2026
Theme URI: https://yuhua.com.tw/
Author: Yuhua
Description: 堉華生技食品專用的輕量、無頁面編輯器依賴主題，內建語意化版型及 WooCommerce 相容樣式。
Version: 1.1.0
Requires at least: 6.6
Requires PHP: 8.0
Text Domain: yuhua
*/

:root {
  --yh-ink: #111111;
  --yh-muted: #595959;
  --yh-green: #d51627;
  --yh-green-dark: #090909;
  --yh-red: #d51627;
  --yh-red-dark: #a70b18;
  --yh-cream: #f4f4f2;
  --yh-gold: #d51627;
  --yh-white: #fff;
  --yh-line: #dedede;
  --yh-shadow: 0 24px 70px rgba(0, 0, 0, .12);
  --yh-radius: 8px;
  --yh-content: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--yh-ink);
  background: var(--yh-white);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.8;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--yh-green); text-underline-offset: .2em; }
a:hover { color: var(--yh-green-dark); }
h1, h2, h3, h4 { color: var(--yh-green-dark); line-height: 1.25; letter-spacing: -.025em; }
h1 { font-size: clamp(2.2rem, 5vw, 4.6rem); }
h2 { font-size: clamp(1.65rem, 3vw, 2.65rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.55rem); }
p { margin: 0 0 1.25rem; }
:focus-visible { outline: 3px solid var(--yh-gold); outline-offset: 4px; }

.screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus { position: fixed; top: 1rem; left: 1rem; width: auto; height: auto; clip: auto; z-index: 9999; padding: .8rem 1rem; background: #fff; }
.yh-container { width: min(calc(100% - 40px), var(--yh-content)); margin-inline: auto; }

.site-header { position: sticky; top: 0; z-index: 100; border-bottom: 1px solid var(--yh-line); background: rgba(255,255,255,.97); backdrop-filter: blur(16px); }
.site-topbar { background: #090909; color: rgba(255,255,255,.72); font-size: .78rem; }
.site-topbar__inner { display: flex; min-height: 32px; align-items: center; justify-content: flex-end; gap: 1.4rem; }
.site-topbar a { color: #fff; text-decoration: none; }
.site-header__inner { display: flex; min-height: 82px; align-items: center; justify-content: space-between; gap: 2rem; }
.site-brand { display: flex; align-items: center; gap: .8rem; color: var(--yh-green-dark); text-decoration: none; font-weight: 800; letter-spacing: .08em; }
.site-brand img { width: auto; height: 58px; object-fit: contain; }
.site-brand span { white-space: nowrap; }
.custom-logo { width: auto; max-height: 54px; }
.site-nav ul { display: flex; align-items: center; gap: 1.4rem; margin: 0; padding: 0; list-style: none; }
.site-nav a { color: var(--yh-ink); font-weight: 650; text-decoration: none; }
.site-nav a { position: relative; }
.site-nav a:hover, .site-nav .current-menu-item > a { color: var(--yh-red); }
.site-nav a::after { position: absolute; right: 0; bottom: -.55rem; left: 0; height: 2px; background: var(--yh-red); content: ""; transform: scaleX(0); transition: transform .2s ease; }
.site-nav a:hover::after, .site-nav .current-menu-item > a::after { transform: scaleX(1); }
.menu-toggle { display: none; border: 1px solid var(--yh-line); border-radius: 10px; background: #fff; color: var(--yh-green-dark); padding: .55rem .8rem; font: inherit; }

.yh-hero { position: relative; overflow: hidden; padding: clamp(5rem, 10vw, 9rem) 0; background: #111; }
.yh-hero--photo { min-height: min(760px, 80vh); display: grid; align-items: center; background-image: linear-gradient(90deg, rgba(0,0,0,.92) 0%, rgba(0,0,0,.78) 48%, rgba(0,0,0,.32) 100%), var(--yh-hero-image); background-position: center; background-size: cover; }
.yh-hero::after { content: ""; position: absolute; right: 4vw; bottom: -8rem; width: 19rem; height: 19rem; border: 42px solid rgba(213,22,39,.75); border-radius: 50%; }
.yh-hero__inner { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); align-items: center; gap: clamp(2rem, 7vw, 6rem); }
.yh-eyebrow { color: var(--yh-gold); font-size: .88rem; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; }
.yh-hero h1 { max-width: 11ch; margin: .5rem 0 1.5rem; color: #fff; font-size: clamp(3rem, 7vw, 6rem); letter-spacing: -.06em; }
.yh-hero__lead { max-width: 42rem; color: rgba(255,255,255,.78); font-size: 1.2rem; }
.yh-hero__lead strong { color: #fff; }
.yh-actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 2rem; }
.yh-button, button, input[type="submit"], .wp-element-button, .woocommerce a.button, .woocommerce button.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .7rem 1.2rem;
  border: 1px solid var(--yh-green); border-radius: 999px; background: var(--yh-green); color: #fff;
  font: inherit; font-weight: 750; line-height: 1; text-decoration: none; cursor: pointer;
}
.yh-button:hover, button:hover, input[type="submit"]:hover { background: var(--yh-green-dark); color: #fff; }
.yh-button--ghost { border-color: rgba(255,255,255,.65); background: transparent; color: #fff; }
.yh-button--ghost:hover { border-color: #fff; background: #fff; color: #111; }
.yh-hero__card { padding: 2rem; border: 1px solid rgba(255,255,255,.22); border-radius: var(--yh-radius); background: rgba(0,0,0,.58); box-shadow: var(--yh-shadow); color: rgba(255,255,255,.7); backdrop-filter: blur(12px); }
.yh-hero__card span { float: left; margin: .15rem .9rem 2.5rem 0; color: var(--yh-red); font-weight: 900; }
.yh-hero__card strong { display: block; margin-bottom: .2rem; color: #fff; font-size: 1.12rem; }
.yh-hero__card p:last-child { margin-bottom: 0; }

.site-main { min-height: 60vh; }
.yh-section { padding: clamp(4rem, 8vw, 7rem) 0; }
.yh-section--cream { background: var(--yh-cream); }
.yh-section__head { max-width: 760px; margin-bottom: 2.5rem; }
.yh-section__head h2 { margin: 0 0 .8rem; }
.yh-section__head p { color: var(--yh-muted); }
.yh-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem; }
.yh-card { overflow: hidden; padding: clamp(1.4rem, 3vw, 2.2rem); border: 1px solid var(--yh-line); border-radius: var(--yh-radius); background: #fff; box-shadow: 0 8px 30px rgba(36,40,33,.05); }
.yh-card h2, .yh-card h3 { margin-top: 0; }
.yh-card--link { position: relative; transition: transform .2s ease, box-shadow .2s ease; }
.yh-card--link:hover { transform: translateY(-4px); box-shadow: var(--yh-shadow); }
.yh-card--link > a { position: absolute; inset: 0; border-radius: inherit; }
.yh-card__link { font-weight: 750; }
.yh-product-card { overflow: hidden; padding: 0; }
.yh-product-card__image { aspect-ratio: 4 / 3; overflow: hidden; background: var(--yh-cream); }
.yh-product-card__image img { width: 100%; height: 100%; object-fit: cover; }
.yh-product-card__body { padding: 1.35rem; }
.yh-product-card__body h2, .yh-product-card__body h3 { margin-bottom: .6rem; }
.yh-product-meta { color: var(--yh-gold); font-size: .85rem; font-weight: 750; letter-spacing: .08em; }
.yh-product-single { display: grid; grid-template-columns: minmax(280px,.85fr) minmax(0,1.15fr); gap: clamp(2rem,6vw,5rem); align-items: start; }
.yh-product-single__image { overflow: hidden; border-radius: var(--yh-radius); background: var(--yh-cream); }
.yh-product-single__content h1 { margin-top: .2rem; }
.yh-contact-grid { display: grid; grid-template-columns: minmax(260px,.8fr) minmax(0,1.2fr); gap: clamp(2rem,6vw,5rem); align-items: start; }
.yh-contact-list { margin: 1.5rem 0 0; padding: 0; list-style: none; }
.yh-contact-list li { padding: .7rem 0; border-bottom: 1px solid var(--yh-line); }
.yh-form { padding: clamp(1.4rem,4vw,2.4rem); border: 1px solid var(--yh-line); border-radius: var(--yh-radius); background: #fff; box-shadow: var(--yh-shadow); }
.yh-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.yh-field { margin-bottom: 1rem; }
.yh-field label { display: block; margin-bottom: .35rem; color: var(--yh-green-dark); font-weight: 700; }
.yh-field input, .yh-field textarea { width: 100%; padding: .75rem .9rem; border: 1px solid var(--yh-line); border-radius: 10px; background: #fff; color: var(--yh-ink); font: inherit; }
.yh-field textarea { min-height: 170px; resize: vertical; }
.yh-honeypot { position: absolute; left: -9999px; }
.yh-notice { margin-bottom: 1rem; padding: .85rem 1rem; border-radius: 10px; background: var(--yh-cream); }

.entry-header, .archive-header { padding: clamp(3.5rem, 7vw, 6rem) 0 2rem; background: linear-gradient(180deg, var(--yh-cream), #fff); }
.entry-header h1, .archive-header h1 { max-width: 18ch; margin: 0; font-size: clamp(2.2rem, 5vw, 3.8rem); }
.entry-meta { margin-top: .8rem; color: var(--yh-muted); font-size: .95rem; }
.entry-content { width: min(calc(100% - 40px), 860px); margin-inline: auto; padding: 3rem 0 6rem; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2 { margin-top: 2.4rem; }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { padding: .8rem; border: 1px solid var(--yh-line); text-align: left; }
.entry-content blockquote { margin-inline: 0; padding: 1rem 1.5rem; border-left: 4px solid var(--yh-gold); background: var(--yh-cream); }
.entry-content .alignwide { width: min(1100px, calc(100vw - 40px)); max-width: none; margin-left: 50%; transform: translateX(-50%); }

.breadcrumbs { padding-top: 1.2rem; color: var(--yh-muted); font-size: .9rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: .45rem; color: #a3a99f; }

.site-footer { padding: 4rem 0 2rem; background: var(--yh-green-dark); color: rgba(255,255,255,.78); }
.site-footer a { color: #fff; }
.site-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.site-footer h2, .site-footer h3 { color: #fff; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer__bottom { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.15); font-size: .88rem; }

.woocommerce ul.products { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1.4rem; }
.woocommerce ul.products::before, .woocommerce ul.products::after { display: none; }
.woocommerce ul.products li.product { width: auto; margin: 0; padding: 1rem; border: 1px solid var(--yh-line); border-radius: var(--yh-radius); }
.woocommerce div.product { padding: 3rem 0 6rem; }
.woocommerce .woocommerce-breadcrumb { display: none; }
.woocommerce div.product div.images img { border-radius: var(--yh-radius); }
.woocommerce div.product .product_title { font-size: clamp(2.2rem,5vw,3.8rem); }
.woocommerce div.product p.price, .woocommerce div.product span.price { color: var(--yh-green); }
.woocommerce form .form-row input.input-text, .woocommerce form .form-row textarea, .woocommerce select {
  padding: .7rem .8rem; border: 1px solid var(--yh-line); border-radius: 9px; font: inherit;
}
.woocommerce-message, .woocommerce-info, .woocommerce-error { border-top-color: var(--yh-green); background: var(--yh-cream); }
.woocommerce table.shop_table { border-color: var(--yh-line); border-radius: 12px; }

.yh-proof { border-bottom: 1px solid var(--yh-line); background: #fff; }
.yh-proof__inner { display: flex; min-height: 74px; align-items: center; justify-content: center; gap: clamp(1rem, 3vw, 3rem); color: #444; font-size: .92rem; }
.yh-proof__inner strong { color: var(--yh-red); }
.yh-proof__inner span { position: relative; }
.yh-proof__inner span::before { margin-right: clamp(1rem, 3vw, 3rem); color: #c4c4c4; content: "/"; }
.yh-section--soft { background: #f4f4f2; }
.yh-section--dark { background: #0b0b0b; color: rgba(255,255,255,.7); }
.yh-section--dark h2, .yh-section--dark h3 { color: #fff; }
.yh-section__head--split { display: grid; max-width: none; grid-template-columns: minmax(0,1fr) minmax(280px,.7fr); align-items: end; gap: 3rem; }
.yh-section__head--split p { margin: 0; }
.yh-section__head--split h2 { max-width: 16ch; }
.yh-grid--solutions { gap: 0; border-top: 1px solid var(--yh-line); border-bottom: 1px solid var(--yh-line); }
.yh-solution-card { min-height: 360px; padding: clamp(1.7rem,4vw,3rem); border-right: 1px solid var(--yh-line); background: #fff; }
.yh-solution-card:first-child { border-left: 1px solid var(--yh-line); }
.yh-solution-card > span { color: var(--yh-red); font-size: .8rem; font-weight: 800; letter-spacing: .12em; }
.yh-solution-card h3 { max-width: 8ch; margin: 4rem 0 1.2rem; font-size: clamp(1.8rem,3vw,2.5rem); }
.yh-solution-card p { min-height: 6.6rem; color: var(--yh-muted); }
.yh-solution-card a, .yh-text-link { color: #111; font-weight: 800; text-decoration: none; }
.yh-solution-card a:hover, .yh-text-link:hover { color: var(--yh-red); }
.yh-solution-card b { color: var(--yh-red); }
.yh-audience { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); gap: clamp(3rem,8vw,8rem); }
.yh-audience > div:first-child { position: sticky; top: 150px; align-self: start; }
.yh-audience h2 { margin-bottom: 1.4rem; font-size: clamp(2.2rem,5vw,4.2rem); }
.yh-audience__list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.yh-audience__list article { min-height: 220px; padding: 1.8rem; border-top: 1px solid rgba(255,255,255,.2); }
.yh-audience__list article:nth-child(odd) { border-right: 1px solid rgba(255,255,255,.2); }
.yh-audience__list b { color: var(--yh-red); }
.yh-audience__list h3 { margin: 2.4rem 0 .6rem; }
.yh-grid--products { grid-template-columns: repeat(4,minmax(0,1fr)); }
.yh-product-card--feature { border: 0; background: #fff; box-shadow: none; }
.yh-product-card--feature .yh-product-card__image { aspect-ratio: 1 / 1; }
.yh-product-card--feature .yh-product-card__body { border-top: 3px solid var(--yh-red); }
.yh-product-card--feature h3 a { color: #111; text-decoration: none; }
.yh-faq { display: grid; grid-template-columns: minmax(0,.75fr) minmax(0,1.25fr); gap: clamp(3rem,8vw,8rem); }
.yh-faq__list details { border-top: 1px solid var(--yh-line); }
.yh-faq__list details:last-child { border-bottom: 1px solid var(--yh-line); }
.yh-faq__list summary { position: relative; padding: 1.4rem 3rem 1.4rem 0; color: #111; font-size: 1.08rem; font-weight: 800; cursor: pointer; list-style: none; }
.yh-faq__list summary::-webkit-details-marker { display: none; }
.yh-faq__list summary::after { position: absolute; right: .5rem; color: var(--yh-red); content: "+"; font-size: 1.6rem; font-weight: 400; }
.yh-faq__list details[open] summary::after { content: "−"; }
.yh-faq__list p { padding-right: 3rem; color: var(--yh-muted); }
.yh-cta { padding: clamp(3.5rem,7vw,6rem) 0; background: var(--yh-red); color: rgba(255,255,255,.82); }
.yh-cta h2 { margin: .2rem 0 .8rem; color: #fff; font-size: clamp(2.2rem,5vw,4rem); }
.yh-cta .yh-eyebrow { color: #fff; }
.yh-cta__inner { display: flex; align-items: center; justify-content: space-between; gap: 3rem; }
.yh-cta__inner p { margin: 0; }
.yh-button--light { flex: 0 0 auto; border-color: #fff; background: #fff; color: #111; }
.yh-button--light:hover { border-color: #111; background: #111; }

.yh-solution-hero { padding: clamp(4rem,8vw,8rem) 0; background: #f4f4f2; }
.yh-solution-hero__grid { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(340px,.9fr); align-items: center; gap: clamp(3rem,8vw,8rem); }
.yh-solution-hero h1 { max-width: 13ch; margin: .6rem 0 1.5rem; font-size: clamp(2.8rem,6vw,5.4rem); }
.yh-solution-hero p { max-width: 42rem; color: var(--yh-muted); font-size: 1.15rem; }
.yh-solution-hero figure { position: relative; margin: 0; }
.yh-solution-hero figure::before { position: absolute; top: -1rem; right: -1rem; width: 45%; height: 45%; background: var(--yh-red); content: ""; }
.yh-solution-hero img { position: relative; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; filter: saturate(.92) contrast(1.04); }
.yh-two-column { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); gap: clamp(3rem,8vw,8rem); }
.yh-two-column h2 { max-width: 14ch; margin-top: .3rem; font-size: clamp(2.1rem,4vw,3.6rem); }
.yh-lead-copy { color: #333; font-size: clamp(1.15rem,2vw,1.45rem); line-height: 1.9; }
.yh-check-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; background: rgba(255,255,255,.15); }
.yh-check-grid div { min-height: 140px; padding: 2rem; background: #0b0b0b; color: #fff; }
.yh-check-grid span { display: block; margin-bottom: 1.4rem; color: var(--yh-red); font-weight: 900; }
.yh-grid--four { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 0; border-top: 1px solid var(--yh-line); border-bottom: 1px solid var(--yh-line); }
.yh-number-card { min-height: 230px; padding: 2rem; border-right: 1px solid var(--yh-line); }
.yh-number-card:first-child { border-left: 1px solid var(--yh-line); }
.yh-number-card b { color: var(--yh-red); font-size: 1.5rem; }
.yh-number-card p { margin-top: 4rem; color: #222; font-weight: 750; }

.entry-header, .archive-header { background: linear-gradient(180deg, #f4f4f2, #fff); }
.site-footer { background: #080808; }
.site-footer h2::after { display: block; width: 48px; height: 4px; margin-top: 1rem; background: var(--yh-red); content: ""; }
.woocommerce-message, .woocommerce-info, .woocommerce-error { border-top-color: var(--yh-red); background: #f4f4f2; }
.woocommerce div.product p.price, .woocommerce div.product span.price { color: var(--yh-red); }

@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }
  .site-nav { position: absolute; top: 100%; left: 0; right: 0; display: none; padding: 1rem 20px 1.4rem; border-bottom: 1px solid var(--yh-line); background: #fff; }
  .site-nav.is-open { display: block; }
  .site-nav ul { align-items: flex-start; flex-direction: column; gap: .75rem; }
  .site-topbar__inner { justify-content: center; }
  .site-topbar__inner span, .site-topbar__inner a:last-child { display: none; }
  .yh-hero__inner, .site-footer__grid, .yh-section__head--split, .yh-audience, .yh-faq, .yh-solution-hero__grid, .yh-two-column { grid-template-columns: 1fr; }
  .yh-audience > div:first-child { position: static; }
  .yh-grid--products, .yh-grid--four { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .yh-solution-card:nth-child(2) { border-left: 1px solid var(--yh-line); }
  .yh-cta__inner { align-items: flex-start; flex-direction: column; }
  .yh-product-single { grid-template-columns: 1fr; }
  .yh-contact-grid { grid-template-columns: 1fr; }
  .yh-grid, .woocommerce ul.products { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .yh-container { width: min(calc(100% - 28px), var(--yh-content)); }
  .site-brand span { display: none; }
  .site-brand img { height: 50px; }
  .yh-grid, .woocommerce ul.products, .yh-audience__list, .yh-grid--products, .yh-grid--four, .yh-check-grid { grid-template-columns: 1fr; }
  .yh-proof__inner { flex-wrap: wrap; justify-content: flex-start; padding-block: 1rem; gap: .5rem 1rem; }
  .yh-proof__inner span::before { margin-right: 1rem; }
  .yh-solution-card, .yh-solution-card:nth-child(2) { min-height: auto; border-right: 1px solid var(--yh-line); border-bottom: 1px solid var(--yh-line); border-left: 1px solid var(--yh-line); }
  .yh-solution-card h3 { margin-top: 2.5rem; }
  .yh-solution-card p { min-height: 0; }
  .yh-audience__list article:nth-child(odd) { border-right: 0; }
  .yh-number-card { min-height: 180px; border-left: 1px solid var(--yh-line); border-bottom: 1px solid var(--yh-line); }
  .yh-form-grid { grid-template-columns: 1fr; }
  .site-header__inner { min-height: 70px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
