/*
Theme Name: YAZI Textile
Description: Editable textile catalog shell for TTCH B2B Catalog Core.
Version: 0.2.0
Requires at least: 6.8
Requires PHP: 7.4
Text Domain: yazi-textile
*/

:root {
    --paper: #f7f6f2;
    --surface: #ffffff;
    --ink: #202522;
    --muted: #555d57;
    --line: #d8ddd6;
    --accent: #3f5548;
    --shell: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 16px/1.6 "Segoe UI", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: inherit; text-underline-offset: 4px; }
img { display: block; max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 4px;
}
h1, h2, h3 { color: var(--ink); line-height: 1.12; font-weight: 600; letter-spacing: -.025em; }
h1 { margin: 0 0 24px; font-size: clamp(2.75rem, 4.5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 3vw, 2.25rem); }
h3 { font-size: 1.35rem; }
p { max-width: 65ch; }
figure { margin: 0; }

.shell, .site-shell { width: min(var(--shell), calc(100% - 64px)); margin-inline: auto; }
.skip-link { position: absolute; top: -100px; left: 20px; z-index: 100; padding: 12px; background: var(--surface); }
.skip-link:focus { top: 10px; }
.site-header { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 94%, transparent); }
.header-inner { display: flex; min-height: 92px; align-items: center; justify-content: space-between; gap: 32px; }
.brand { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; text-decoration: none; }
.brand strong { font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -.06em; }
.brand span { color: var(--muted); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; }
.custom-logo { max-width: 140px; max-height: 68px; object-fit: contain; }
.nav-list { display: flex; align-items: center; gap: 28px; margin: 0; padding: 0; list-style: none; }
.nav-list a { font-size: 14px; font-weight: 550; text-decoration: none; }
.nav-list a:hover, .current-menu-item a { color: var(--accent); text-decoration: underline; }
.nav-list li:last-child a { display: inline-block; padding: 10px 16px; border: 1px solid var(--ink); background: var(--ink); color: var(--surface); }
.nav-list li:last-child a:hover { background: var(--accent); color: var(--surface); text-decoration: none; }
.menu-toggle { display: none; }

.button, .wp-element-button, .ttch-button {
    display: inline-block;
    padding: 13px 22px;
    border: 1px solid var(--ink);
    border-radius: 0;
    background: var(--ink);
    color: var(--surface);
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    cursor: pointer;
}
.button:hover, .wp-element-button:hover, .ttch-button:hover { border-color: var(--accent); background: var(--accent); color: var(--surface); }
.button.secondary, .is-style-outline .wp-element-button { background: transparent; color: var(--ink); }
.button.secondary:hover, .is-style-outline .wp-element-button:hover { background: var(--ink); color: var(--surface); }
.eyebrow, .ttch-kicker, .step-number {
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.page-content { padding-block: 64px 96px; }
.home-content { padding-top: 0; }
.hero { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 64px; align-items: center; padding-block: 64px 72px; }
.hero h1 { max-width: 13ch; }
.hero p:not(.eyebrow) { color: var(--muted); font-size: 18px; }
.hero-image { background: var(--line); }
.hero-image img { width: 100%; height: 560px; object-fit: cover; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.section { padding-block: 64px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 40px; margin-bottom: 30px; }
.section-head h2 { max-width: 18ch; margin: 8px 0 0; }
.section-head p { max-width: 42ch; margin-bottom: 4px; color: var(--muted); }
.selection-guide { border-top: 1px solid var(--line); }
.selection-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.selection-step { min-height: 240px; padding: 28px; background: var(--surface); }
.selection-step h3 { margin: 0 0 14px; }
.selection-step p:last-child { color: var(--muted); }
.step-number { color: var(--accent); }
.section-action { margin-top: 24px; font-weight: 600; }
.brand-glance { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 64px; border-top: 1px solid var(--line); }
.brand-glance h2 { max-width: 18ch; margin-bottom: 0; }
.brand-glance p { color: var(--muted); }
.brand-glance a, .section-action a { color: var(--accent); }
.sourcing-note { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; margin-top: 16px; padding: 52px; background: var(--accent); color: var(--surface); }
.sourcing-note h2 { max-width: 18ch; margin: 0; color: var(--surface); }
.sourcing-note .eyebrow, .sourcing-note p { color: #e6ebe7; }
.sourcing-note .button { border-color: var(--surface); background: var(--surface); color: var(--ink); }
.sourcing-note .button:hover { background: transparent; color: var(--surface); }
.page-lead { color: var(--muted); font-size: 18px; }
.about-panel { max-width: 760px; margin-top: 48px; padding: 36px; border: 1px solid var(--line); background: var(--surface); }

.site-footer { padding: 50px 0; background: var(--ink); color: var(--paper); }
.site-footer .brand span { color: #cbd1cc; }
.footer-inner { display: flex; justify-content: space-between; gap: 40px; }
.footer-inner p { color: #cbd1cc; font-size: 14px; }
.footer-links { display: flex; flex-wrap: wrap; align-items: start; gap: 24px; font-size: 14px; }
.breadcrumbs { margin-bottom: 30px; color: var(--muted); font-size: 13px; }
.product-content { max-width: 960px; margin-inline: auto; }
.product-content h1 { font-size: clamp(2.5rem, 4.5vw, 3.5rem); }
.product-content > .entry-content > p { color: var(--muted); font-size: 18px; }
.empty-state { padding: 55px 0; }
.error-content { min-height: 50vh; padding-block: 80px; }

.ttch-shell { width: 100%; max-width: none; padding: 0; }
.ttch-catalog > .ttch-kicker { margin-bottom: 8px; }
.ttch-catalog > h1 { margin-bottom: 40px; }
.ttch-product-grid, .ttch-featured-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.ttch-featured-products { background: transparent; }
.ttch-featured-products .site-shell { width: 100%; }
.ttch-featured-card, .ttch-product-card { overflow: hidden; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.ttch-featured-card > a, .ttch-product-card > a { display: block; text-decoration: none; }
.ttch-product-visual { aspect-ratio: 4 / 5; overflow: hidden; background: var(--line); }
.ttch-product-visual img { width: 100%; height: 100%; object-fit: cover; }
.ttch-card-body { padding: 20px 0; }
.ttch-card-body h3 { margin: 0 0 10px; }
.ttch-card-body p { color: var(--muted); font-size: 14px; }
.ttch-card-link { display: inline-block; margin-top: 12px; border-bottom: 1px solid; color: var(--accent); font-size: 13px; font-weight: 600; }
.featured-products-footer { margin-top: 28px; }
.ttch-product-gallery { margin-bottom: 35px; }
.ttch-gallery-main { display: block; background: #e9ebe7; }
.ttch-gallery-main img { width: 100%; height: 560px; object-fit: contain; }
.ttch-gallery-thumbs { display: flex; gap: 12px; margin-top: 12px; }
.ttch-gallery-thumbs img { width: 90px; height: 90px; object-fit: cover; }
.ttch-rfq { margin-top: 45px; padding: 40px; border: 1px solid var(--line); border-radius: 0; background: var(--surface); }
.ttch-rfq h2 { margin-top: 10px; }
.ttch-form { display: grid; gap: 20px; }
.ttch-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ttch-field { display: grid; gap: 7px; font-size: 14px; }
.ttch-field input, .ttch-field textarea { width: 100%; padding: 12px; border: 1px solid #89958d; border-radius: 0; background: var(--surface); }
.ttch-consent { display: flex; align-items: start; gap: 10px; font-size: 14px; }
.ttch-consent input { margin-top: 7px; }
.ttch-honeypot { position: absolute; left: -9999px; }
.ttch-notice { padding: 20px; border: 1px solid var(--accent); }
.entry-content .wp-block-image img { height: auto; }
.page-template-page-catalog .page-content > h1 { display: none; }

.hero > .wp-block-group__inner-container,
.section-head > .wp-block-group__inner-container,
.selection-guide > .wp-block-group__inner-container,
.selection-steps > .wp-block-group__inner-container,
.selection-step > .wp-block-group__inner-container,
.brand-glance > .wp-block-group__inner-container,
.sourcing-note > .wp-block-group__inner-container,
.about-panel > .wp-block-group__inner-container { display: contents; }

@media (max-width: 800px) {
    .shell, .site-shell { width: calc(100% - 40px); }
    .header-inner { min-height: 78px; flex-wrap: wrap; gap: 0; }
    .brand strong { font-size: 27px; }
    .brand span { font-size: 9px; }
    .menu-toggle { display: block; padding: 9px 13px; border: 1px solid var(--line); background: transparent; color: var(--ink); }
    .site-nav { width: 100%; }
    .js .site-nav:not(.is-open) { display: none; }
    .nav-list { flex-direction: column; align-items: stretch; gap: 0; padding: 12px 0 20px; }
    .nav-list a { display: block; padding: 11px 0; }
    .nav-list li:last-child a { margin-top: 8px; text-align: center; }
    h1 { font-size: clamp(1.875rem, 9vw, 2.25rem); }
    h2 { font-size: clamp(1.75rem, 7vw, 2rem); }
    .page-content { padding-block: 40px 64px; }
    .home-content { padding-top: 0; }
    .hero { grid-template-columns: 1fr; gap: 30px; padding-block: 40px 52px; }
    .hero p:not(.eyebrow), .page-lead { font-size: 16px; }
    .hero-image img { height: 390px; }
    .section { padding-block: 50px; }
    .section-head, .brand-glance, .sourcing-note { display: grid; grid-template-columns: 1fr; gap: 18px; }
    .selection-steps, .ttch-product-grid, .ttch-featured-grid { grid-template-columns: 1fr; }
    .selection-step { min-height: 0; }
    .sourcing-note { margin-top: 0; padding: 32px 24px; }
    .ttch-rfq { padding: 26px 20px; }
    .ttch-two { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; }
    .footer-links { flex-direction: column; gap: 14px; }
    .ttch-gallery-main img { height: 360px; }
    .ttch-card-body h3 { font-size: 1.25rem; }
    .ttch-card-body p { font-size: 13px; }
    .about-panel { padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}
