/*
Theme Name: Hengji Guangsha
Description: English-language building envelope catalog.
Version: 1.0.0
Requires PHP: 8.1
Text Domain: hj-build
*/

@font-face { font-family: Inter; src: url('assets/fonts/inter-normal-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('assets/fonts/instrument-serif-normal-latin.woff2') format('woff2'); font-display: swap; }

:root {
    --ink: #132335;
    --muted: #506074;
    --blue: #1a53b4;
    --blue-deep: #143f89;
    --gold: #d8ac55;
    --paper: #fbfaf8;
    --stone: #f1f0ec;
    --line: #dce2e7;
    --serif: 'Instrument Serif', Georgia, serif;
    --sans: Inter, 'Segoe UI', system-ui, sans-serif;
    color: var(--ink);
    font: 16px/1.65 var(--sans);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); }
img { display: block; max-width: 100%; }
a { color: var(--blue); text-underline-offset: 4px; }
button, input, textarea, select { font: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid #bb7c0e; outline-offset: 4px; }
h1, h2, h3, p, dd, dl { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 400; line-height: 1; }
h1 { font-size: 76px; }
h2 { font-size: 52px; }
h3 { font-size: 19px; line-height: 1.3; }
ul { padding-inline-start: 1.15em; }
.wrap { width: min(1216px, calc(100% - 80px)); margin-inline: auto; }
.section { padding-block: 76px; }
.band { background: var(--stone); }
.muted, .wp-copy p, .wp-copy li { color: var(--muted); }
.eyebrow { font-size: 13px; font-weight: 700; text-transform: uppercase; }
.skip-link { position: fixed; top: 10px; left: 12px; z-index: 100; background: #fff; padding: 9px 14px; transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }

.site-header { position: relative; z-index: 5; background: #fff; border-bottom: 1px solid var(--line); }
.header-row { min-height: 83px; display: flex; align-items: center; justify-content: space-between; gap: 26px; }
.wordmark { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-size: 17px; font-weight: 750; line-height: 1.15; text-decoration: none; }
.wordmark img { width: 48px; height: 48px; object-fit: contain; border-radius: 3px; }
.site-nav { display: flex; gap: 22px; align-items: center; font-size: 14px; font-weight: 600; }
.site-nav > a:not(.button), .site-nav summary { color: var(--ink); text-decoration: none; white-space: nowrap; }
.site-nav .language-switch { padding: 4px 9px; border-radius: 4px; border: 1px solid var(--line); }
.site-nav .language-switch span { font-size: 11px; }
.site-nav > a:hover:not(.button), .site-nav > a[aria-current], .site-nav summary:hover, .site-nav summary.active { color: var(--blue); }
.product-nav { position: relative; }
.product-nav summary { list-style: none; }
.product-nav summary::-webkit-details-marker { display: none; }
.product-nav summary span { display: inline-block; margin-inline-start: 4px; }
.product-nav[open] summary span { transform: rotate(180deg); }
.product-drop { position: absolute; top: calc(100% + 24px); left: -17px; min-width: 252px; padding: 8px; border: 1px solid var(--line); border-radius: 5px; background: #fff; box-shadow: 0 12px 28px #13233519; }
.product-nav[open] .product-drop { animation: panel-enter 200ms ease-out; }
.product-drop a { display: flex; justify-content: space-between; padding: 8px 10px; color: var(--ink); text-decoration: none; }
.product-drop a:hover { color: var(--blue); background: #edf3fd; }
.menu-toggle { display: none; }

.button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 13px; border: 1px solid var(--blue); border-radius: 5px; padding: 10px 17px; background: var(--blue); color: #fff; text-align: center; font-size: 14px; font-weight: 700; line-height: 1.45; text-decoration: none; transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease; }
.button:hover { background: var(--blue-deep); border-color: var(--blue-deep); color: #fff; }
.button:active { transform: translateY(1px); }
.button-outline { background: transparent; color: var(--blue); }
.button-on-dark { border-color: #ffffffa6; background: #10253873; }
.button-on-dark:hover { border-color: #fff; background: #102538; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.text-link { display: inline-flex; gap: 9px; align-items: baseline; font-size: 14px; font-weight: 700; white-space: nowrap; }

.hero { position: relative; display: grid; align-items: center; isolation: isolate; overflow: clip; min-height: min(590px, max(480px, calc(100svh - 169px))); color: #fff; background: #203447; }
.hero-frame, .hero-shade { position: absolute; inset: 0; z-index: -1; }
.hero-frame { opacity: 0; visibility: hidden; transition: opacity 1050ms ease-in-out, visibility 0s linear 1050ms; }
.hero-frame.is-active { opacity: 1; visibility: visible; transition-delay: 0s; }
.hero-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 55%; }
.hero-frame[data-scene='1'] img { object-position: center 55%; }
.hero-frame[data-scene='2'] img { object-position: center 58%; }
.hero-frame.is-active img, .hero-frame.is-leaving img { animation: hero-photo-focus 8s ease-out both paused; }
.hero.is-playing .hero-frame.is-active img { animation-play-state: running; }
.hero-shade { background: linear-gradient(90deg, #08192ce8 0%, #08192cb8 28%, #10213952 67%, #0b172b24 100%), linear-gradient(0deg, #0a182bb3 0%, transparent 34%); }
.hero-copy { padding-block: 53px 115px; animation: panel-enter 600ms ease-out; }
.hero-copy .eyebrow { display: flex; align-items: center; gap: 10px; color: #fff1d6; }
.hero-copy .eyebrow::before { content: ''; width: 25px; height: 2px; background: var(--gold); }
.hero h1 { margin: 15px 0 18px; font-size: 94px; line-height: .9; }
html[lang='zh-CN'] :is(h1,h2,.company-metrics dd,.building-copy h3) { font-family: var(--sans); font-weight: 700; line-height: 1.15; }
html[lang='zh-CN'] .hero h1 { font-size: clamp(45px, 6.2vw, 85px); letter-spacing: .045em; }
html[lang='zh-CN'] .detail-intro h1 { font-size: clamp(38px, 5.5vw, 61px); }
.hero-copy > p:not(.eyebrow) { max-width: 490px; color: #fff; font-size: 17px; line-height: 1.55; }
.hero-copy .button-row { margin-top: 24px; }
.hero-controls { position: absolute; inset-inline: 0; bottom: 21px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.slide-dots, .slide-arrows { display: flex; align-items: center; gap: 6px; }
.slide-dots { gap: 12px; }
.slide-dots button { display: grid; gap: 4px; align-content: center; justify-items: start; padding: 0; width: clamp(36px, 6vw, 72px); min-height: 42px; border: 0; background: transparent; color: #e5eaf3; font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }
.slide-dots button[aria-pressed='true'] { color: #ffe1a6; }
.slide-meter { position: relative; width: 100%; height: 2px; border-radius: 1px; background: #ffffff66; }
.slide-meter::after { content: ''; position: absolute; inset: 0; transform: scaleX(0); transform-origin: left; background: #f9cf83; border-radius: 1px; }
.slide-dots button[aria-pressed='true'] .slide-meter::after { transform: scaleX(1); }
.hero.is-playing .slide-dots button[aria-pressed='true'] .slide-meter::after { animation: slide-progress var(--hero-interval, 6000ms) linear both; }
.slide-arrows button, .reel-toolbar button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid #ffffff91; border-radius: 4px; background: #132335b0; color: #fff; transition: background-color 160ms ease; }
.slide-arrows button:hover { background: var(--ink); }
[data-playback] span { font-size: 14px; }

@keyframes hero-photo-focus { from { transform: scale(1.01); } to { transform: scale(1.095); } }
@keyframes slide-progress { from { transform: scaleX(.06); } to { transform: scaleX(1); } }
@keyframes panel-enter { from { transform: translateY(8px); opacity: .65; } to { transform: translateY(0); opacity: 1; } }
[data-reveal].has-entered { animation: panel-enter 480ms ease-out; }

.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 26px; }
.section-heading p, .about-copy > p { margin-top: 11px; color: var(--muted); }
.families { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--line); }
.family-link { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; min-height: 132px; padding: 18px; text-decoration: none; color: var(--ink); }
.family-link + .family-link { border-inline-start: 1px solid var(--line); }
.family-link:hover { background: #edf3fd; }
.family-link, .family-arrow { transition: background-color 160ms ease, transform 160ms ease; }
.family-link:hover .family-arrow, .family-link:focus-visible .family-arrow { transform: translate(2px, -2px); }
.family-link strong, .family-link small { display: block; }
.family-link strong { font-size: 17px; line-height: 1.35; }
.family-link small { margin-top: 7px; line-height: 1.45; color: var(--muted); }
.family-arrow { color: var(--blue); }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 55px; }
.about-feature { align-items: center; }
.feature-photo { overflow: hidden; border-radius: 5px; background: var(--line); }
.feature-photo img { aspect-ratio: 5 / 3.45; width: 100%; height: auto; object-fit: cover; }
.company-metrics { display: flex; flex-wrap: wrap; gap: 16px 34px; margin-block: 23px; padding-block: 16px; border-block: 1px solid #ced6de; }
.company-metrics div { display: flex; flex-direction: column-reverse; }
.company-metrics dt { color: var(--muted); font-size: 13px; }
.company-metrics dd { font-family: var(--serif); font-size: 39px; line-height: 1.1; }
.gallery, .product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.gallery-photo { display: block; position: relative; overflow: hidden; border-radius: 5px; background: var(--line); }
.gallery-photo img { aspect-ratio: 4 / 3; width: 100%; height: auto; object-fit: cover; }
.gallery-photo img { transition: transform 360ms ease; }
.gallery-photo:hover img { transform: scale(1.035); }
.gallery-photo span { position: absolute; display: grid; place-items: center; bottom: 10px; right: 10px; width: 36px; height: 36px; border: 1px solid #ffffff70; border-radius: 4px; background: #132335d9; color: #fff; transition: background-color 160ms ease; }
.gallery-photo:hover span { background: var(--blue); }
.project-reel .gallery { position: relative; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: calc((100% - 34px) / 3); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; padding: 5px 5px 10px; }
.project-reel .gallery-photo { scroll-snap-align: start; }
.project-reel .gallery { scroll-padding-inline: 5px; }
.reel-toolbar { display: flex; justify-content: flex-end; gap: 6px; margin-bottom: 7px; }
.reel-toolbar button { color: var(--ink); border-color: #b4c4d6; background: #fff; }
.reel-toolbar button:hover { background: #eaf1fb; }
.image-viewer { position: fixed; width: min(940px, calc(100% - 30px)); max-height: calc(100dvh - 32px); border: 0; border-radius: 5px; padding: 14px; background: #fff; color: var(--ink); }
.image-viewer::backdrop { background: #101c2bd9; }
.image-viewer img { width: 100%; max-height: 77dvh; object-fit: contain; }
.image-viewer p { padding: 9px 5px 0; }
.image-viewer button { position: absolute; right: 22px; top: 22px; width: 40px; height: 40px; border: 1px solid #fff; border-radius: 4px; background: var(--ink); color: #fff; font-size: 25px; line-height: 1; }

.quote-band { padding-block: 43px; background: #eaf1fb; border-top: 1px solid #dde7f4; }
.quote-inner { display: flex; justify-content: space-between; align-items: center; gap: 19px; }
.quote-inner h2 { font-size: 44px; }
.quote-inner p { margin-top: 8px; color: var(--muted); }
.quote-inner .button { flex-shrink: 0; }
.site-footer { padding-top: 35px; background: #132335; color: #fff; }
.footer-grid { display: flex; gap: 22px; justify-content: space-between; align-items: start; padding-bottom: 27px; }
.footer-grid .wordmark { color: #fff; }
.footer-grid p { max-width: 26rem; margin-top: 9px; color: #c9d2de; font-size: 13px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 17px; padding-top: 8px; }
.footer-links a { color: #fff; font-size: 13px; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-base { display: flex; justify-content: space-between; gap: 12px; padding-block: 14px; border-top: 1px solid #ffffff38; color: #c9d2de; font-size: 12px; }

.subhead { padding-block: 26px 38px; background: #edf2f8; border-bottom: 1px solid #dce4ee; }
.subhead p { margin-top: 12px; color: var(--muted); }
.crumb { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 20px; color: var(--muted); font-size: 13px; }
.crumb a { color: inherit; }
.catalog { padding-top: 32px; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 27px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.filters a { padding: 7px 11px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); font-size: 14px; font-weight: 650; text-decoration: none; }
.filters a:hover { border-color: var(--blue); }
.filters a[aria-current='page'] { background: var(--blue); border-color: var(--blue); color: #fff; }
.product-card { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.product-card > a { display: flex; flex: 1; flex-direction: column; color: inherit; text-decoration: none; }
.product-card:hover, .product-card:focus-within { border-color: var(--blue); }
.product-card:focus-within { outline: 2px solid var(--blue); outline-offset: 3px; }
.card-photo, .detail-photo { position: relative; background: #e9edf1; }
.card-photo img, .detail-photo img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.photo-label { position: absolute; right: 9px; bottom: 9px; padding: 3px 8px; border-radius: 3px; background: #fff; color: var(--ink); font-size: 11px; font-weight: 700; }
.card-copy { display: flex; flex: 1; flex-direction: column; padding: 16px; }
.card-copy p { flex: 1; margin: 8px 0 14px; color: var(--muted); font-size: 14px; }
.card-link { color: var(--blue); font-weight: 700; font-size: 13px; }
.card-link span { margin-inline-start: 4px; }
.detail-top { padding-block: 26px 52px; }
.detail-grid { gap: 44px; }
.detail-photo { overflow: hidden; border-radius: 5px; }
.detail-photo img { object-fit: contain; }
.detail-intro h1 { margin-block: 9px 12px; font-size: 66px; overflow-wrap: break-word; }
.detail-intro .eyebrow { color: var(--blue); }
.original { margin-bottom: 11px; color: var(--muted); font-size: 14px; }
.lead { margin-bottom: 18px; color: var(--muted); font-size: 17px; }
.draft-note { margin-top: 16px; color: var(--muted); font-size: 13px; }
.wp-copy h2 + p, .wp-copy p + p { margin-top: 14px; }
.wp-copy p + h2, .reference { margin-top: 18px; }
.quote-details { border-left: 2px solid #c5d1df; padding-left: 23px; }
.details-body h2 { font-size: 43px; }
.details-body ul { margin-bottom: 0; color: var(--muted); }
.details-body li + li { margin-top: 5px; }
.detail-grid + .section { margin-top: 10px; }
.section > h2 + .product-grid { margin-top: 22px; }

.document-status { display: flex; align-items: center; gap: 19px; padding-block: 17px; }
.document-status p { margin-top: 8px; color: var(--muted); }
.document-symbol { display: grid; flex: 0 0 52px; align-content: center; justify-items: center; gap: 6px; height: 68px; border: 2px solid #9eb6cf; border-radius: 4px; background: #edf2f8; }
.document-symbol i { width: 25px; height: 2px; background: #9eb6cf; }
.contact-grid { grid-template-columns: minmax(230px, .72fr) minmax(0, 1fr); }
.contact-grid h2 + p { margin-top: 8px; }
.contact-list { margin-top: 17px; overflow-wrap: anywhere; }
.contact-list > div { padding-block: 11px; border-block-end: 1px solid var(--line); }
.contact-list dt, .quote-form label { font-size: 14px; font-weight: 700; }
.quote-form, .quote-result { display: grid; gap: 8px; }
.quote-form { margin-top: 18px; }
.quote-form :is(input, textarea, select) { width: 100%; min-height: 43px; padding: 8px 10px; border: 1px solid #aebccc; border-radius: 4px; background: #fff; color: var(--ink); }
.quote-form .button { justify-self: start; margin-top: 7px; }
.quote-result { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 13px; }
.copy-status { font-size: 13px; color: var(--muted); }

@media (max-width: 1100px) {
    .site-nav { gap: 15px; }
    .split { gap: 32px; }
    .families .family-link { padding-inline: 12px; }
}

@media (max-width: 1010px) {
    .wrap { width: calc(100% - 44px); }
    .header-row { flex-wrap: wrap; min-height: 68px; gap: 0 15px; padding-block: 8px; }
    .is-interactive .menu-toggle { display: grid; align-content: center; justify-items: center; gap: 4px; width: 43px; height: 40px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
    .menu-toggle span { width: 18px; height: 2px; background: var(--ink); }
    .site-nav { display: flex; flex-direction: column; align-items: stretch; flex-basis: 100%; gap: 0; padding-block: 8px; }
    .is-interactive .site-nav:not(.is-open) { display: none; }
    .site-nav > a:not(.button), .product-nav summary { display: block; padding: 9px 4px; border-block-end: 1px solid var(--line); }
    .site-nav .nav-quote { align-self: flex-start; margin-top: 10px; }
    .site-nav .language-switch { align-self: flex-start; margin-top: 9px; padding-inline: 9px; }
    .product-drop { position: static; box-shadow: none; border: 0; padding: 4px 0 5px 9px; }
    .hero h1 { font-size: 76px; }
    .section { padding-block: 54px; }
    .catalog { padding-top: 26px; }
    .families { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .family-link:nth-child(odd) { border-inline-start: 0; }
    .family-link:nth-child(n+3) { border-top: 1px solid var(--line); }
    .detail-intro h1 { font-size: 52px; }
}

@media (max-width: 660px) {
    .wrap { width: calc(100% - 36px); }
    h1 { font-size: 51px; }
    h2 { font-size: 38px; }
    .header-row { min-height: 62px; }
    .wordmark img { width: 43px; height: 43px; }
    .wordmark { font-size: 15px; }
    .hero { min-height: min(462px, max(388px, calc(100svh - 148px))); }
    .hero h1 { font-size: 56px; margin-block: 12px 14px; }
    .hero-shade { background: linear-gradient(90deg, #0a192cc9, #0d1c31a0 66%, #0a192c63), linear-gradient(0deg, #0a182b9e, transparent 33%); }
    .hero-copy { padding-block: 27px 67px; }
    .hero-copy > p:not(.eyebrow) { font-size: 15px; }
    .hero-copy .button-row { margin-top: 17px; }
    .hero-copy .button { padding-inline: 11px; font-size: 13px; }
    .hero-controls { bottom: 12px; }
    .section { padding-block: 40px; }
    .section-heading { flex-wrap: wrap; align-items: start; margin-bottom: 16px; gap: 7px; }
    .split, .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .family-link { min-height: 115px; }
    .family-link strong { font-size: 15px; }
    .family-link small { font-size: 12px; }
    .gallery, .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .project-reel .gallery { grid-template-columns: none; grid-auto-columns: 84%; }
    .product-grid { grid-template-columns: minmax(0, 1fr); }
    .card-photo img { aspect-ratio: 16 / 8; object-fit: contain; }
    .quote-band { padding-block: 29px; }
    .quote-inner { flex-wrap: wrap; }
    .quote-inner h2 { font-size: 38px; }
    .footer-grid { flex-direction: column; }
    .footer-grid p { margin-top: 7px; }
    .subhead { padding-block: 21px 27px; }
    .detail-top { padding-block: 19px 30px; }
    .detail-intro h1 { font-size: 51px; }
    .details-body h2 { font-size: 37px; }
    .quote-details { padding-left: 12px; }
}

@media (max-width: 360px) {
    .hero h1 { font-size: 47px; }
    .hero-break { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-frame, .button, .slide-arrows button, .reel-toolbar button, .family-link, .family-arrow, .gallery-photo img, .gallery-photo span { transition: none; }
    .hero-frame.is-active img, .hero-frame.is-leaving img, .hero-copy, .product-nav[open] .product-drop, [data-reveal].has-entered, .hero.is-playing .slide-dots button[aria-pressed='true'] .slide-meter::after { animation: none; }
    .gallery-photo:hover img, .family-link:hover .family-arrow, .family-link:focus-visible .family-arrow, .button:active { transform: none; }
}
