/*
Theme Name: Tianhui Hardware
Description: Tianhui WordPress catalog and sourcing journal preview.
Version: 0.1.0
Text Domain: tianhui
*/

:root {
  --navy: #12344d;
  --ink: #173549;
  --muted: #516678;
  --gold: #d3ae69;
  --paper: #fff;
  --surface: #f4f7f9;
  --line: #dce5ea;
  --wrap: 1190px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 system-ui, sans-serif; }
img { display: block; max-width: 100%; height: auto; }
a { color: #174f76; text-underline-offset: .21em; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #377fb2; outline-offset: 3px; }
h1, h2, h3 { color: var(--navy); line-height: 1.13; margin: 0 0 .66em; }
h1, h2 { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; }
h1 { font-size: clamp(2.15rem, 4vw, 3.65rem); letter-spacing: -.035em; overflow-wrap: anywhere; }
h2 { font-size: clamp(1.62rem, 2.5vw, 2.45rem); letter-spacing: -.022em; }
p { margin: 0 0 1em; }
.th-wrap { width: min(calc(100% - 48px), var(--wrap)); margin-inline: auto; }
.th-section { padding-block: clamp(32px, 6vw, 72px); }
.th-label { color: #7c5a26; font-size: .72rem; font-weight: 800; letter-spacing: .125em; text-transform: uppercase; margin-bottom: .8rem; }
.th-small { color: var(--muted); font-size: .87rem; }
.th-deck { color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.2rem); max-width: 60ch; }
.th-skip { position: absolute; left: 12px; top: -200px; z-index: 100; background: white; padding: 12px; }
.th-skip:focus { top: 12px; }
.th-top { background: var(--navy); color: #e2ecf2; font-size: .77rem; }
.th-top .th-wrap { display: flex; justify-content: space-between; gap: 12px; padding-block: 6px; }
.th-brandbar { display: grid; grid-template-columns: auto 1fr auto; gap: 34px; align-items: center; min-height: 94px; }
.th-brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); }
.th-brand img { flex: 0 0 54px; }
.th-brand strong { display: block; font-size: .98rem; font-weight: 850; letter-spacing: .1em; }
.th-brand small { display: block; color: var(--muted); font-size: .72rem; }
.th-search { display: flex; min-width: 0; }
.th-search input { flex: 1; min-width: 0; }
.th-search button { background: var(--navy); border: 1px solid var(--navy); color: white; padding-inline: 18px; font-weight: 700; }
.th-nav { background: #153650; color: white; }
.th-nav .th-wrap { display: flex; flex-wrap: wrap; gap: 30px; }
.th-nav a { color: white; text-decoration: none; font-weight: 650; font-size: .9rem; padding-block: 13px; }
.th-nav a:hover { color: var(--gold); }
.th-button { display: inline-flex; gap: .75em; align-items: center; justify-content: center; background: var(--navy); color: #fff; border: 1px solid transparent; padding: 10px 16px; font: 700 .9rem/1.4 system-ui, sans-serif; text-decoration: none; border-radius: 3px; cursor: pointer; }
.th-button:hover { background: #214e70; }
.th-button-gold { background: var(--gold); color: #203344; }
.th-button-gold:hover { background: #e7c688; }
.th-button-outline { border-color: #7792a4; background: transparent; }
.th-home-hero { background: #112f46; color: #e8eff3; }
.th-home-grid { display: grid; grid-template-columns: minmax(0, .93fr) minmax(0, 1.07fr); align-items: center; gap: 54px; padding-block: clamp(38px, 6vw, 82px); }
.th-home-grid h1 { color: white; font-size: clamp(2.55rem, 5.8vw, 5rem); margin-bottom: 18px; }
.th-home-grid .th-label { color: var(--gold); }
.th-home-grid > img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid #527083; border-radius: 4px; }
.th-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 25px; }
.th-category-grid, .th-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-block: 24px 6px; }
.th-category-card { display: block; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--navy); }
.th-category-card > img { width: 100%; aspect-ratio: 2.6 / 1; object-fit: cover; }
.th-category-card > span { display: flex; justify-content: space-between; padding: 12px 16px; font-weight: 720; }
.th-section-head { display: flex; justify-content: space-between; gap: 12px; align-items: end; }
.th-section-head h2 { margin-bottom: 0; }
.th-card { border: 1px solid var(--line); min-width: 0; background: #fff; }
.th-card-image { display: block; background: var(--surface); aspect-ratio: 1.88; overflow: hidden; }
.th-card-image img { width: 100%; height: 100%; object-fit: cover; }
.th-card-image-product img { object-fit: contain; background: white; }
.th-card-body { padding: 16px 18px 20px; }
.th-card-body h2 { font: 750 clamp(1rem, 1.55vw, 1.24rem)/1.3 system-ui, sans-serif; letter-spacing: -.015em; }
.th-card-body h2 a { color: var(--navy); text-decoration: none; }
.th-card-body h2 a:hover { text-decoration: underline; }
.th-card-body > :last-child { margin-bottom: 0; }
.th-card-body p:not(.th-label) { font-size: .9rem; color: var(--muted); }
.th-category-list { max-width: 700px; background: var(--surface); padding: 14px 16px; border: 1px solid var(--line); }
.th-category-list summary { cursor: pointer; font-weight: 720; }
.th-category-list ul { columns: 2; padding-inline-start: 22px; }
.th-crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: .85rem; margin-bottom: 24px; }
.th-product-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: start; gap: clamp(24px, 4.5vw, 58px); }
.th-product-grid h1 { font-size: clamp(1.9rem, 3.4vw, 3.1rem); }
.th-product-image { width: 100%; aspect-ratio: 1; object-fit: contain; border: 1px solid var(--line); background: #fff; }
.th-gallery { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.th-gallery button { padding: 4px; background: white; border: 1px solid var(--line); cursor: pointer; }
.th-gallery img { width: 58px; height: 58px; object-fit: contain; }
.th-pricing { border-top: 1px solid var(--line); padding-top: 18px; }
.th-pricing .th-button { margin-top: 18px; }
.th-pricing table caption { text-align: left; color: var(--muted); padding: 8px 0; font-size: .86rem; }
.th-pricing label, .th-quote label { display: block; font-weight: 650; }
input, textarea, select { font: inherit; color: var(--ink); width: 100%; border: 1px solid #bacbd6; border-radius: 3px; background: #fff; padding: 8px 10px; }
.th-pricing select, .th-quote :is(input, textarea) { display: block; margin-top: 5px; font-weight: 400; }
table { width: 100%; border-collapse: collapse; overflow-wrap: anywhere; }
th, td { text-align: left; border: 1px solid var(--line); padding: 9px 12px; }
th { background: var(--surface); font-weight: 700; }
.th-product-grid + .th-prose, .th-article-cover + .th-prose { margin-top: 38px; }
.th-article-head, .th-article-cover, .th-prose, .th-quote, .th-page-head { max-width: 790px; margin-inline: auto; }
.th-article-cover { margin-block: 25px; }
.th-article-cover img { width: 100%; max-height: 550px; object-fit: cover; }
figcaption { color: var(--muted); font-size: .83rem; padding-top: 7px; }
.th-prose :is(h2, h3) { margin-top: 1.4em; }
.th-prose figure { margin-inline: 0; }
.th-product-video video { display: block; width: 100%; max-height: 520px; background: var(--surface); }
.th-prose :is(input, textarea) { width: auto; }
.th-prose li { margin-bottom: .36em; }
.th-quote { margin-top: 38px; background: var(--surface); border: 1px solid var(--line); padding: clamp(18px, 3vw, 32px); }
.th-quote label { margin-bottom: 16px; }
.th-form-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 15px; }
.th-notice { padding: 10px 14px; background: #e1f5e9; color: #174934; }
.navigation.pagination { margin-top: 24px; }
.nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.page-numbers { padding: 6px 11px; border: 1px solid var(--line); }
.page-numbers.current { background: var(--navy); color: #fff; }
.th-footer { background: var(--navy); color: #e7eff4; padding-block: 27px; }
.th-footer .th-wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.th-footer a { color: white; display: inline-block; margin-right: 14px; }
.th-footer p { margin: .3em 0; font-size: .86rem; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }

@media (max-width: 850px) {
  .th-brandbar { gap: 18px; }
  .th-brand small { display: none; }
  .th-grid, .th-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .th-home-grid { gap: 28px; }
}
@media (max-width: 620px) {
  .th-wrap { width: calc(100% - 28px); }
  .th-brandbar { grid-template-columns: 1fr auto; padding-block: 12px; }
  .th-search { grid-column: 1 / -1; grid-row: 2; }
  .th-brand img { width: 42px; flex-basis: 42px; }
  .th-nav .th-wrap { gap: 17px; }
  .th-home-grid, .th-product-grid, .th-form-row { grid-template-columns: minmax(0, 1fr); }
  .th-home-grid > img { aspect-ratio: 1.8; }
  .th-grid, .th-category-grid { gap: 12px; }
  .th-card-body { padding: 12px; }
  .th-card-body p:not(.th-label) { display: none; }
  .th-footer .th-wrap { align-items: start; flex-direction: column; }
}
