@import url('tokens.css');

/* ==========================================================================
   1. Reset / Base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  /* The root scrolling element controls horizontal scroll (not body) — the
     off-canvas nav drawer's translateX(100%) was making the page actually
     horizontally scrollable in real-browser testing without this. */
  overflow-x: hidden;
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
ul,
ol,
dl,
dd,
blockquote {
  margin: 0;
}

body {
  font-family: var(--font-body);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: var(--lh-body);
  font-size: var(--fs-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Defends against the off-canvas nav drawer's translateX(100%) contributing to
     the page's scrollable width (observed in real-browser testing, not just a
     precaution) — nothing on this site intentionally needs horizontal scroll. */
  overflow-x: hidden;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--c-primary);
  text-decoration: none;
}

a:hover {
  color: var(--c-primary-dark);
  text-decoration: underline;
}

ul,
ol {
  list-style: none;
  padding: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  margin: 0;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* ==========================================================================
   2. Typography
   ========================================================================== */

h1 {
  font-family: var(--font-heading);
  font-size: var(--fs-h1);
  font-weight: var(--fw-bold);
  line-height: var(--lh-h1);
}

h2 {
  font-family: var(--font-heading);
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  line-height: var(--lh-h2);
}

h3 {
  font-family: var(--font-heading);
  font-size: var(--fs-h3);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-h3);
}

h4 {
  font-family: var(--font-heading);
  font-size: var(--fs-h4);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-h4);
}

@media (max-width: 767px) {
  h1 {
    font-size: var(--fs-h1-m);
  }

  h2 {
    font-size: var(--fs-h2-m);
  }

  h3 {
    font-size: var(--fs-h3-m);
  }

  h4 {
    font-size: var(--fs-h4-m);
  }
}

/* Longform / article body */
.longform {
  max-width: 800px;
  line-height: var(--lh-longform);
}

.longform p {
  margin-bottom: var(--space-6);
}

.longform h2,
.longform h3 {
  padding-left: var(--space-4);
  border-left: 4px solid var(--c-primary);
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
}

.longform .article-inline-figure {
  margin: var(--space-8) 0;
  max-width: 480px;
}

.longform .article-inline-figure figcaption {
  color: var(--c-text-muted);
  font-size: var(--fs-small);
  margin-top: var(--space-2);
}

.longform pre,
.longform code {
  background: var(--c-bg-alt);
  border-radius: var(--r-base);
  padding: .2em .4em;
  font-size: var(--fs-small);
}

.longform pre {
  padding: var(--space-4);
  overflow-x: auto;
}

.longform pre code {
  padding: 0;
  background: none;
}

.longform blockquote {
  border-left: 4px solid var(--c-border);
  padding-left: var(--space-6);
  color: var(--c-text-muted);
  margin-block: var(--space-6);
}

/* ==========================================================================
   3. Container / 12-col Grid
   ========================================================================== */

.container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 768px) {
  .container {
    padding-inline: var(--space-6);
  }
}

@media (min-width: 1200px) {
  .container {
    padding-inline: var(--space-8);
  }
}

/* Section spacing */
.section {
  padding-block: var(--space-12);
}

@media (min-width: 1200px) {
  .section {
    padding-block: var(--space-16);
  }
}

/* 12-column grid base */
.grid {
  display: grid;
  gap: var(--space-6);
}

/* Column utilities — desktop/tablet/mobile responsive */
.cols-4 {
  grid-template-columns: 1fr;
}

.cols-3 {
  grid-template-columns: 1fr;
}

.cols-2 {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .cols-4,
  .cols-3,
  .cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   4. Buttons (§4.6) — CTA uses dark text, never white
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .6em 1.2em;
  border-radius: var(--r-base);
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: background-color .2s, box-shadow .2s;
  border: 2px solid transparent;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

/* CTA — orange background, DARK text (never white) */
.btn--cta {
  background: var(--c-cta);
  color: var(--c-text);
}

.btn--cta:hover {
  background: var(--c-cta-dark);
  box-shadow: var(--sh-hover);
  color: var(--c-text);
  text-decoration: none;
}

/* Secondary — outlined */
.btn--secondary {
  border-color: var(--c-primary);
  color: var(--c-primary);
  background: transparent;
}

.btn--secondary:hover {
  background: var(--c-primary-tint);
  color: var(--c-primary-dark);
  text-decoration: none;
}

/* Ghost */
.btn--ghost {
  color: var(--c-primary);
  background: none;
  border: none;
}

.btn--ghost:hover {
  color: var(--c-primary-dark);
  text-decoration: underline;
}

/* Focus visible for all interactive elements */
:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* ==========================================================================
   5. Card (§4.7)
   ========================================================================== */

.card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  box-shadow: var(--sh-card);
  padding: var(--space-6);
  transition: transform .2s, box-shadow .2s;
  min-width: 0;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-hover);
}

/* ==========================================================================
   6. Badge (§4.8)
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--r-pill);
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  padding: .2em .6em;
  line-height: var(--lh-caption);
}

.badge--instock {
  color: var(--c-success-dark);
  background: var(--c-success-tint);
}

.badge--rfq {
  color: var(--c-warn-dark);
  background: var(--c-warn-tint);
}

.badge--tag {
  color: var(--c-primary-dark);
  background: var(--c-primary-tint);
}

/* ==========================================================================
   7. Form Base (§4.11)
   ========================================================================== */

label {
  display: block;
  font-weight: var(--fw-medium);
  margin-bottom: var(--space-1);
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: .5em .75em;
  border: 1px solid var(--c-border);
  border-radius: var(--r-base);
  font: inherit;
  font-size: var(--fs-body);
  background: var(--c-bg);
  color: var(--c-text);
  transition: border-color .15s, box-shadow .15s;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
  border-color: var(--c-primary);
}

/* Error state */
input.is-invalid,
textarea.is-invalid,
select.is-invalid {
  border-color: #C0392B;
}

[data-error-for] {
  color: #C0392B;
  font-size: var(--fs-small);
  margin-top: var(--space-1);
  display: block;
}

.is-submitted > *:not([data-success]) {
  display: none;
}

.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-left: .5em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: -0.125em;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   8. Accessibility / Reduced-motion (§6/§8)
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   9. Site Nav — T2.4 (sticky / mega menu / mobile drawer)
   DO NOT modify sections 1–8 above. Nav-specific rules only below.
   ========================================================================== */

/* ── 9.1 Nav shell ─────────────────────────────────────────────────────── */

.site-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  transition: background-color 0.2s, box-shadow 0.2s;
}

.site-nav.is-scrolled {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--sh-nav);
}

/* ── 9.2 Inner flex row ────────────────────────────────────────────────── */

.site-nav__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: 72px;
}

/* ── 9.3 Logo + slogan ─────────────────────────────────────────────────── */

.site-nav__logo-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}

.site-nav__logo-link:hover {
  text-decoration: none;
}

.site-nav__logo-img {
  height: 40px;
  width: auto;
  display: block;
}

.site-nav__slogan {
  font-size: var(--fs-small);
  color: var(--c-text-muted);
  white-space: nowrap;
  line-height: 1.3;
}

/* ── 9.4 Desktop nav links ─────────────────────────────────────────────── */

.site-nav__links {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.site-nav__item {
  position: relative;
}

/* [Fix 1] .has-megamenu overrides position:relative so that [data-megamenu]
   (a child of this <li>) uses <header class="site-nav"> (sticky) as its
   containing block. This gives position:absolute; top:100%; left:0; right:0
   the correct full-width below-header placement. */
.has-megamenu {
  position: static;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-2);
  font-family: var(--font-heading);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  color: var(--c-text);
  text-decoration: none;
  border-radius: var(--r-base);
  transition: color 0.15s, background-color 0.15s;
  white-space: nowrap;
}

.site-nav__link:hover {
  color: var(--c-primary-dark);
  background: var(--c-primary-tint);
  text-decoration: none;
}

/* ── 9.5 Desktop CTA ───────────────────────────────────────────────────── */

.site-nav__cta {
  flex-shrink: 0;
}

/* ── 9.6 Hamburger button (mobile only) ────────────────────────────────── */

.site-nav__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: var(--r-base);
}

.site-nav__hamburger:hover {
  background: var(--c-bg-alt);
}

.site-nav__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-text);
  border-radius: 2px;
  transition: opacity 0.2s;
}

/* ── 9.7 Products Mega Menu ────────────────────────────────────────────── */

.mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: var(--z-menu);
  background: var(--c-bg);
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--sh-hover);
  display: none;
  padding-block: var(--space-6);
}

.mega-menu.is-open {
  display: block;
}

.mega-menu__categories {
  display: flex;
  gap: var(--space-8);
  flex-wrap: wrap;
}

.mega-menu__category {
  min-width: 160px;
}

.mega-menu__cat-link {
  display: block;
  font-family: var(--font-heading);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-body);
  color: var(--c-primary);
  text-decoration: none;
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--c-primary-tint);
  margin-bottom: var(--space-3);
}

.mega-menu__cat-link:hover {
  color: var(--c-primary-dark);
  text-decoration: none;
}

.mega-menu__models {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mega-menu__model-link {
  font-size: var(--fs-small);
  color: var(--c-text);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding-inline: var(--space-2);
  border-radius: var(--r-base);
  transition: color 0.15s, background-color 0.15s;
}

.mega-menu__model-link:hover {
  color: var(--c-primary-dark);
  background: var(--c-primary-tint);
  text-decoration: none;
}

/* ── 9.8 Mobile Drawer ─────────────────────────────────────────────────── */

.site-nav__drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(320px, 85vw);
  z-index: var(--z-modal);
  background: var(--c-bg);
  box-shadow: var(--sh-hover);
  padding: var(--space-6);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.site-nav__drawer.is-open {
  transform: translateX(0);
}

.site-nav__drawer-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  flex: 1;
}

.site-nav__drawer-item {
  display: block;
}

.site-nav__drawer-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--space-3);
  font-family: var(--font-heading);
  font-weight: var(--fw-medium);
  font-size: var(--fs-body);
  color: var(--c-text);
  text-decoration: none;
  border-radius: var(--r-base);
  transition: color 0.15s, background-color 0.15s;
}

.site-nav__drawer-link:hover {
  color: var(--c-primary-dark);
  background: var(--c-primary-tint);
  text-decoration: none;
}

.site-nav__drawer-cta {
  margin-top: var(--space-6);
  width: 100%;
  justify-content: center;
}

/* Body lock while drawer is open */
body.nav-drawer-open {
  overflow: hidden;
}

/* ── 9.9 Responsive: mobile ≤767px ────────────────────────────────────── */

@media (max-width: 767px) {
  .site-nav__inner {
    height: 60px;
  }

  /* Hide desktop-only elements */
  .site-nav__links,
  .site-nav__cta {
    display: none;
  }

  /* Show hamburger on mobile */
  .site-nav__hamburger {
    display: flex;
    margin-left: auto;
  }

  /* Hide tagline on mobile */
  .site-nav__slogan {
    display: none;
  }
}

/* ── 9.10 Responsive: desktop ≥768px ──────────────────────────────────── */

@media (min-width: 768px) {
  /* Hamburger hidden on desktop */
  .site-nav__hamburger {
    display: none;
  }

  /* Drawer hidden on desktop (visual) */
  .site-nav__drawer {
    display: none;
  }
}

/* ── 9.11 Responsive: tablet 768–1199px (design.md §7 "横向（精简）") ────
   All 7 nav.items + logo + CTA don't fit at full desktop sizing below
   1200px — condense to avoid horizontal overflow (design.md §7's explicit
   "无横向溢出" requirement). Verified empirically at 768px/900px via a
   headless-browser scrollWidth check, not just estimated from token math. */

@media (min-width: 768px) and (max-width: 1199px) {
  .site-nav__slogan {
    display: none;
  }

  .site-nav__list {
    gap: 0;
  }

  .site-nav__link {
    padding: 0 var(--space-1);
    font-size: var(--fs-caption);
  }

  .site-nav__cta {
    padding: 0.5em 0.8em;
    font-size: var(--fs-caption);
  }
}

/* ==========================================================================
   10. Site Footer — T2.5 (4-col grid, contact, sitemap/robots)
   ========================================================================== */

.site-footer {
  background: var(--c-ink-banner);
  color: var(--c-footer-text);
  padding-block: var(--space-12);
}

.site-footer a {
  color: var(--c-footer-text);
  text-decoration: none;
  transition: color 0.15s;
}

.site-footer a:hover {
  color: var(--c-footer-heading);
}

.site-footer__grid {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: 1fr;
  margin-bottom: var(--space-8);
}

@media (min-width: 768px) {
  .site-footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .site-footer__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.site-footer__column {
  display: flex;
  flex-direction: column;
}

.site-footer__heading {
  font-family: var(--font-heading);
  font-size: var(--fs-h4);
  font-weight: var(--fw-semibold);
  color: var(--c-footer-heading);
  margin-bottom: var(--space-4);
}

.site-footer__tagline {
  font-size: var(--fs-small);
  color: var(--c-footer-text);
  margin-bottom: var(--space-2);
  line-height: var(--lh-body);
}

.site-footer__intro {
  font-size: var(--fs-small);
  color: var(--c-footer-text);
  line-height: var(--lh-body);
}

.site-footer__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  list-style: none;
}

.site-footer__item {
  display: flex;
  align-items: center;
}

.site-footer__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5em 0;
  font-size: var(--fs-body);
  color: var(--c-footer-text);
  text-decoration: none;
  transition: color 0.15s;
}

.site-footer__link:hover {
  color: var(--c-footer-heading);
  text-decoration: underline;
}

.site-footer__label {
  font-size: var(--fs-body);
  color: var(--c-footer-text);
}

.site-footer__bottom {
  border-top: 1px solid var(--c-footer-border);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: flex-start;
}

@media (min-width: 768px) {
  .site-footer__bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.site-footer__copyright {
  font-size: var(--fs-small);
  color: var(--c-footer-text);
  margin: 0;
}

.site-footer__meta-links {
  display: flex;
  gap: var(--space-6);
}

.site-footer__meta-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5em 0;
  font-size: var(--fs-small);
  color: var(--c-footer-text);
  text-decoration: none;
  transition: color 0.15s;
}

.site-footer__meta-link:hover {
  color: var(--c-footer-heading);
  text-decoration: underline;
}

/* ── Breadcrumb (T2.6) ───────────────────────────────────────────────────── */

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--fs-small);
}

.breadcrumb__item {
  display: flex;
  align-items: center;
}

.breadcrumb__item + .breadcrumb__item::before {
  content: '/' / ''; /* decorative: empty alt-text so screen readers skip the separator */
  margin-right: var(--space-2);
  color: var(--c-text-muted);
}

.breadcrumb__link {
  color: var(--c-primary);
  text-decoration: none;
}

.breadcrumb__link:hover {
  text-decoration: underline;
}

.breadcrumb__current {
  color: var(--c-text-muted);
}

/* ==========================================================================
   11. Contact Float — T2.7 (right-side fixed quick contact)
   ========================================================================== */

.contact-float {
  position: fixed;
  right: var(--space-4);
  top: 40%;
  z-index: var(--z-float);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transform: translateY(-50%);
}

.contact-float__btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: var(--space-2);
  border-radius: var(--r-card);
  background: var(--c-bg);
  box-shadow: var(--sh-card);
  color: var(--c-text);
  text-decoration: none;
  border: 1px solid var(--c-border);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
  gap: var(--space-1);
}

.contact-float__btn:hover {
  box-shadow: var(--sh-hover);
  transform: translateX(-2px);
  color: var(--c-text);
  text-decoration: none;
}

.contact-float__icon {
  flex-shrink: 0;
}

.contact-float__label {
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  line-height: var(--lh-caption);
  white-space: nowrap;
}

.contact-float__popover {
  position: absolute;
  top: 50%;
  right: calc(100% + var(--space-3));
  transform: translateY(-50%);
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  box-shadow: var(--sh-hover);
  width: max-content;
  max-width: 200px;
}

.contact-float__popover:not([hidden]) {
  display: flex;
}

.contact-float__popover-close {
  position: absolute;
  top: var(--space-1);
  right: var(--space-1);
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--c-text-muted);
  font-size: var(--fs-h4);
  line-height: 1;
  cursor: pointer;
}

.contact-float__popover-qr {
  border-radius: var(--r-base);
}

.contact-float__popover-id {
  font-size: var(--fs-small);
  color: var(--c-text-muted);
  text-align: center;
  margin: 0;
}

@media (max-width: 767px) {
  .contact-float__popover {
    top: auto;
    bottom: calc(100% + var(--space-3));
    right: 0;
    transform: none;
  }

  .contact-float {
    top: auto;
    bottom: var(--space-4);
    transform: none;
    flex-direction: row;
    right: var(--space-4);
  }

  .contact-float__label {
    display: none;
  }
}

/* ==========================================================================
   12. CTA Block — T2.7 (detail-page distributor call-to-action)
   ========================================================================== */

.cta-block {
  background: var(--c-primary);
  padding-block: var(--space-12);
}

.cta-block__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-6);
}

.cta-block__title {
  color: var(--c-footer-heading);
}

.cta-block__text {
  /* var(--c-footer-text) only reaches 3.29:1 against this block's solid
     --c-primary background (fails WCAG AA's 4.5:1) -- that muted gray-blue
     is calibrated for the much darker --c-ink-banner footer background, not
     this brighter blue. --c-footer-heading (white, already used by the
     sibling .cta-block__title above) clears 4.89:1 here (found via
     real-browser contrast testing, not visually obvious from the CSS alone). */
  color: var(--c-footer-heading);
  max-width: 640px;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

/* .btn--cta (dark text on orange) is reused from section 4 — no override needed */

/* ==========================================================================
   13. Card Teaser — T2.7 (generic content card: category / article teaser)
   ========================================================================== */

/* .card base is already defined in section 5 — only modifiers added here */

.card--teaser {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

.card__icon {
  display: flex;
  align-items: center;
  color: var(--c-primary);
  flex-shrink: 0;
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.card__image {
  width: 100%;
  height: auto;
  border-radius: var(--r-base);
  object-fit: cover;
}

.card__title {
  font-family: var(--font-heading);
  font-size: var(--fs-h3);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-h3);
  margin: 0;
}

.card__title a {
  color: var(--c-text);
  text-decoration: none;
}

.card__title a:hover {
  color: var(--c-primary);
  text-decoration: none;
}

.card__summary,
.card__text {
  color: var(--c-text-muted);
  font-size: var(--fs-small);
  line-height: var(--lh-body);
  margin: 0;
  flex: 1;
}

.card__summary {
  /* Clamp so cards in the same grid row stay a uniform height regardless of
     how many words a given summary happens to run. Deliberately scoped to
     .card__summary only, NOT .card__text: news-card.html/support-card.html
     use .card__summary and always pair it with a "Read more →" link, so
     clamped text stays reachable; .card__text is reused on home.html's
     teaser grids and about.html's feature/case/team cards, which have no
     such link -- clamping those would hide content with no way to recover
     it (caught by review before this shipped). `flex: 1` stretches this
     element to fill whatever space the flex row allocates, which is rarely
     an exact multiple of line-height -- observed via real-browser
     measurement to let a partial 4th line peek through -webkit-line-clamp
     on some cards. The explicit max-height (in em, so it tracks this
     element's own font-size) is a hard ceiling so the box can never exceed
     3 lines' worth regardless of what flex hands it. */
  max-height: calc(var(--lh-body) * 1em * 3);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__date {
  color: var(--c-text-muted);
  font-size: var(--fs-caption);
}

.card__more {
  color: var(--c-primary);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  text-decoration: none;
  margin-top: auto;
}

.card__more:hover {
  color: var(--c-primary-dark);
  text-decoration: underline;
}

/* ==========================================================================
   14. Sidebar — T2.7 (navigation sidebar: categories / related entries)
   ========================================================================== */

.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.sidebar-bom-cta {
  margin-bottom: var(--space-6);
}

.sidebar-bom-cta .btn {
  width: 100%;
  text-align: center;
}

.sidebar__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.sidebar__heading {
  font-family: var(--font-heading);
  font-size: var(--fs-h4);
  font-weight: var(--fw-semibold);
  color: var(--c-text);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--c-border);
}

.sidebar__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.sidebar__item {
  display: block;
}

.sidebar__link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--space-3);
  font-size: var(--fs-small);
  color: var(--c-text);
  text-decoration: none;
  border-radius: var(--r-base);
  transition: color 0.15s, background-color 0.15s;
}

.sidebar__link:hover {
  color: var(--c-primary-dark);
  background: var(--c-primary-tint);
  text-decoration: none;
}

.sidebar-nav__icon {
  flex-shrink: 0;
  margin-right: var(--space-2);
}

.sidebar__link.is-active {
  color: var(--c-primary-dark);
  background: var(--c-primary-tint);
  font-weight: var(--fw-semibold);
  border-left: 3px solid var(--c-primary);
  padding-left: calc(var(--space-3) - 3px);
}

/* ==========================================================================
   15. Section Title utility (shared across many templates)
   ========================================================================== */

.section__title {
  margin-bottom: var(--space-8);
}

/* ==========================================================================
   16. Layout With Sidebar (§3, §7) — shared by products-list, product-category,
   solutions-list, solution-detail, support-list, news-list
   ========================================================================== */

.layout-with-sidebar {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  padding-block: var(--space-8);
}

.layout-with-sidebar__main,
.layout-with-sidebar__sidebar {
  min-width: 0;
}

.layout-with-sidebar__sidebar {
  order: 2;
}

@media (min-width: 768px) {
  .layout-with-sidebar {
    grid-template-columns: 1fr 240px;
    align-items: start;
  }

  .layout-with-sidebar__sidebar {
    order: 0;
    position: sticky;
    top: calc(72px + var(--space-6));
  }
}

@media (min-width: 1200px) {
  .layout-with-sidebar {
    grid-template-columns: 1fr 300px;
  }
}

/* ==========================================================================
   17. Page Hero — shared list-page header (products-list, solutions-list,
   support-list ×3 variants, news-list, contact)
   ========================================================================== */

.page-hero {
  padding-block-start: var(--space-8);
  margin-bottom: var(--space-8);
}

.page-hero__desc {
  color: var(--c-text-muted);
  max-width: 760px;
  margin-top: var(--space-4);
}

/* ==========================================================================
   18. Tab Container (§4.10) — shared by product-detail, support-list
   ========================================================================== */

.tab-container {
  margin-block: var(--space-8);
}

.tab-list,
[role="tablist"] {
  display: flex;
  gap: var(--space-2);
  border-bottom: 2px solid var(--c-border);
  overflow-x: auto;
  max-width: 100%;
  margin-bottom: var(--space-6);
}

.tab-btn,
[role="tab"] {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--space-4);
  font-family: var(--font-heading);
  font-weight: var(--fw-medium);
  font-size: var(--fs-body);
  color: var(--c-text-muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover,
[role="tab"]:hover {
  color: var(--c-primary);
}

.tab-btn--active,
.tab-btn[aria-selected="true"],
[role="tab"][aria-selected="true"] {
  color: var(--c-primary);
  border-bottom-color: var(--c-primary);
  font-weight: var(--fw-semibold);
}

.tab-panel {
  animation: tab-fade-in 0.2s ease;
}

.tab-panel[hidden] {
  display: none;
}

@keyframes tab-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.tabpanel__view-all {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: var(--space-4);
  color: var(--c-primary);
  font-weight: var(--fw-medium);
}

.tabpanel__view-all:hover {
  color: var(--c-primary-dark);
}

/* ==========================================================================
   19. Button size modifier
   ========================================================================== */

.btn--sm {
  min-height: 44px;
  padding: 0.4em 0.9em;
  font-size: var(--fs-small);
}

/* ==========================================================================
   20. Badge — category modifier (tech-detail's category link badge)
   ========================================================================== */

.badge--category {
  color: var(--c-primary-dark);
  background: var(--c-primary-tint);
  display: inline-flex;
  margin-bottom: var(--space-4);
}

/* ==========================================================================
   21. Stock Badge — product-category / product-detail stock indicator
   (template-emitted class names; same visual design as the unused
   .badge--instock/.badge--rfq rules in section 6, kept separate because the
   template emits the raw products.json "inStock"/"rfq" casing as a modifier)
   ========================================================================== */

.stock-badge {
  display: inline-flex;
  align-items: center;
  border-radius: var(--r-pill);
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  padding: 0.2em 0.6em;
  line-height: var(--lh-caption);
}

.stock-badge--inStock {
  color: var(--c-success-dark);
  background: var(--c-success-tint);
}

.stock-badge--rfq {
  color: var(--c-warn-dark);
  background: var(--c-warn-tint);
}

.stock-qty {
  font-size: var(--fs-small);
  color: var(--c-text-muted);
  margin-left: var(--space-2);
}

/* ==========================================================================
   22. Home — Hero (§5.1)
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--space-16);
}

.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0.5;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.hero__subtext {
  color: var(--c-text-muted);
  margin-top: var(--space-4);
  font-size: var(--fs-h4);
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-8);
}

.hero__trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  margin-top: var(--space-12);
}

.hero__badge {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.hero__badge-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.hero__badge-label {
  font-size: var(--fs-small);
  color: var(--c-text-muted);
  font-weight: var(--fw-medium);
}

/* ==========================================================================
   23. Home — Trust Bar (§5.1 "信任条")
   ========================================================================== */

.trust-bar {
  background: var(--c-bg-alt);
}

.trust-bar__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  text-align: center;
}

@media (min-width: 768px) {
  .trust-bar__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.trust-bar__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.trust-bar__value {
  font-family: var(--font-heading);
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  color: var(--c-primary);
}

.trust-bar__label {
  color: var(--c-text-muted);
  font-size: var(--fs-small);
}

/* ==========================================================================
   24. Why Choose Us — Feature Grid (shared: home.html + about.html)
   ========================================================================== */

.why-choose {
  background: var(--c-bg-alt);
}

.why-choose__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .why-choose__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .why-choose__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.why-choose__card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

.why-choose__icon {
  width: 40px;
  height: 40px;
  color: var(--c-primary);
}

/* ==========================================================================
   25. Home — Products / Solutions / Support / News Teasers
   ========================================================================== */

.products-teaser {
  background: var(--c-bg-alt);
}

.products-teaser__sub {
  color: var(--c-text-muted);
  margin-top: var(--space-2);
  margin-bottom: var(--space-8);
}

.products-teaser__grid,
.solutions-teaser__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .products-teaser__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .solutions-teaser__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .products-teaser__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .solutions-teaser__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.products-teaser__card,
.solutions-teaser__card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  text-align: center;
  align-items: center;
  min-width: 0;
}

.products-teaser__icon {
  width: 40px;
  height: 40px;
  color: var(--c-primary);
}

.products-teaser__cta,
.solutions-teaser__cta,
.support-teaser__cta,
.news-teaser__cta {
  display: flex;
  justify-content: center;
  margin-top: var(--space-8);
}

.support-teaser__list {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 768px) {
  .support-teaser__list {
    grid-template-columns: repeat(3, 1fr);
  }
}

.news-teaser__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .news-teaser__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Home's inline news card (distinct markup from the news-card.html partial) */
.news-card__tag {
  display: inline-flex;
  color: var(--c-primary-dark);
  background: var(--c-primary-tint);
  border-radius: var(--r-pill);
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  padding: 0.2em 0.6em;
  margin-bottom: var(--space-2);
  align-self: flex-start;
}

.news-card__date {
  display: block;
  color: var(--c-text-muted);
  font-size: var(--fs-caption);
  margin-top: var(--space-2);
}

/* Final CTA (shared: home.html + about.html) */
.final-cta {
  background: var(--c-ink-banner);
  color: var(--c-footer-heading);
  padding-block: var(--space-16);
  text-align: center;
}

.final-cta h2 {
  color: var(--c-footer-heading);
}

.final-cta p {
  color: var(--c-footer-text);
  max-width: 640px;
  margin-inline: auto;
  margin-top: var(--space-4);
}

.final-cta .btn {
  margin-top: var(--space-8);
}

/* ==========================================================================
   26. Products List — category cards + intro (§5.2)
   ========================================================================== */

.category-card__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

@media (min-width: 768px) {
  .category-card__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .category-card__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.category-card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  box-shadow: var(--sh-card);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: transform 0.2s, box-shadow 0.2s;
  min-width: 0;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-hover);
}

.category-card__icon {
  width: 40px;
  height: 40px;
  color: var(--c-primary);
}

.category-card__desc {
  color: var(--c-text-muted);
  font-size: var(--fs-small);
  line-height: var(--lh-body);
  margin: 0;
  /* category.description is 200-300 words of detail-page copy (design §5.3) —
     this card is a teaser (design §5.2 "icon + intro + View Models"), not the
     full text, so clamp to a short preview instead of showing the whole thing.
     Explicit max-height (see .card__summary for why) is a hard ceiling so
     flex-column auto-height can't let a partial 4th line show through. */
  max-height: calc(var(--lh-body) * 1em * 3);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.category-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

.products-intro {
  max-width: 800px;
  margin-bottom: var(--space-8);
}

.products-intro p {
  color: var(--c-text-muted);
  margin-top: var(--space-4);
}

/* ==========================================================================
   27. Product Category (§5.3, core) — hero / FAE note / spec table / CTA
   ========================================================================== */

.cat-hero {
  margin-bottom: var(--space-8);
}

.cat-hero__icon {
  width: 48px;
  height: 48px;
  color: var(--c-primary);
  margin-bottom: var(--space-4);
}

.cat-hero__desc {
  color: var(--c-text-muted);
  max-width: 760px;
  margin-top: var(--space-4);
  white-space: pre-line;
}

.cat-hero__guide-ctas {
  display: flex;
  gap: var(--space-6);
  margin-top: var(--space-4);
}

.fae-note {
  background: var(--c-primary-tint);
  border-radius: var(--r-card);
  padding: var(--space-6);
  margin-bottom: var(--space-8);
}

.fae-note__title {
  margin-bottom: var(--space-3);
}

.fae-note p {
  color: var(--c-text);
  margin-bottom: var(--space-4);
}

.cat-features {
  margin-bottom: var(--space-8);
}

.cat-features__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .cat-features__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .cat-features__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.cat-features__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  color: var(--c-text-muted);
}

.cat-features__advantage {
  color: var(--c-text-muted);
}

.spec-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  margin-bottom: var(--space-8);
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
}

.spec-table th,
.spec-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  white-space: nowrap;
}

.spec-table thead th {
  background: var(--c-bg-alt);
  font-weight: var(--fw-semibold);
  position: sticky;
  top: 0;
}

.spec-table__row {
  border-top: 1px solid var(--c-border);
}

.spec-table__row:nth-child(even) {
  background: var(--c-bg-alt);
}

.spec-table__row:hover {
  background: var(--c-primary-tint);
}

.spec-table__row td a {
  font-weight: var(--fw-medium);
}

.col-sticky {
  position: sticky;
  left: 0;
  background: inherit;
  z-index: 1;
}

.cat-cta {
  background: var(--c-bg-alt);
  border-radius: var(--r-card);
  padding: var(--space-8);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  justify-content: space-between;
}

.cat-cta p {
  margin: 0;
  font-weight: var(--fw-medium);
}

/* ==========================================================================
   28. Product Detail (§5.4) — hero / thumbs / lists / parts / CTA
   ========================================================================== */

.product-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  padding-block: var(--space-8);
}

@media (min-width: 768px) {
  .product-hero {
    grid-template-columns: 1fr 1fr;
  }
}

.product-img {
  margin: 0;
}

.product-img__main {
  width: 100%;
  height: auto;
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  background: var(--c-bg-alt);
}

.product-img__thumbs {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.product-hero__brand {
  color: var(--c-text-muted);
  font-size: var(--fs-small);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.product-hero__series,
.product-hero__package {
  color: var(--c-text-muted);
  margin-top: var(--space-1);
}

.product-hero__short-desc {
  margin-top: var(--space-4);
}

.product-hero__stock {
  display: flex;
  align-items: center;
  margin-top: var(--space-4);
}

.product-hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-8);
}

.applications-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.applications-list li {
  padding: var(--space-2) var(--space-4);
  background: var(--c-bg-alt);
  border-radius: var(--r-base);
}

.documents-list__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--c-border);
}

.documents-list__size {
  color: var(--c-text-muted);
  font-size: var(--fs-small);
}

.faq-item {
  border-bottom: 1px solid var(--c-border);
  padding-block: var(--space-4);
}

.faq-item__question {
  cursor: pointer;
  font-weight: var(--fw-semibold);
  list-style: none;
}

.faq-item__question::-webkit-details-marker {
  display: none;
}

.faq-item__question::before {
  content: '+';
  display: inline-block;
  width: 1.2em;
  color: var(--c-primary);
  font-weight: var(--fw-bold);
}

.faq-item[open] .faq-item__question::before {
  content: '−';
}

.faq-item__answer {
  color: var(--c-text-muted);
  margin-top: var(--space-3);
  padding-left: 1.2em;
}

.alt-parts,
.companion-parts {
  padding-block: var(--space-8);
  border-top: 1px solid var(--c-border);
}

.alt-parts__grid,
.companion-parts__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

@media (min-width: 768px) {
  .alt-parts__grid,
  .companion-parts__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.alt-parts__card,
.companion-parts__card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.alt-parts__icon,
.companion-parts__icon {
  width: 32px;
  height: 32px;
  color: var(--c-primary);
}

.alt-parts__summary,
.companion-parts__summary {
  color: var(--c-text-muted);
  font-size: var(--fs-small);
  flex: 1;
}

.product-cta {
  background: var(--c-primary-tint);
  border-radius: var(--r-card);
  padding: var(--space-8);
  text-align: center;
  margin-block: var(--space-8);
}

/* .btn--secondary's default --c-primary text only reaches 4.27:1 against this
   tinted background (fails WCAG AA's 4.5:1 for normal text) — darken just
   here rather than globally, since .btn--secondary is AA-safe everywhere
   else it's used against a plain white background. */
.product-cta .btn--secondary {
  color: var(--c-primary-dark);
  border-color: var(--c-primary-dark);
}

.product-cta p {
  color: var(--c-text-muted);
  margin-block: var(--space-4);
}

.product-cta .btn {
  margin-inline: var(--space-2);
}

/* ==========================================================================
   29. Solutions List (§5.5)
   ========================================================================== */

.solutions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .solutions-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .solutions-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.solution-card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  box-shadow: var(--sh-card);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: transform 0.2s, box-shadow 0.2s;
  min-width: 0;
}

.solution-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-hover);
}

.solution-card__icon {
  width: 32px;
  height: 32px;
  color: var(--c-primary);
}

.solution-card__title a {
  color: var(--c-text);
}

.solution-card__title a:hover {
  color: var(--c-primary);
}

.solution-card__industry {
  display: inline-flex;
  align-self: flex-start;
  color: var(--c-primary-dark);
  background: var(--c-primary-tint);
  border-radius: var(--r-pill);
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  padding: 0.2em 0.6em;
}

.solution-card__summary {
  color: var(--c-text-muted);
  flex: 1;
  /* Clamp so all 6 solution cards stay a uniform height in the grid
     regardless of how many words a given summary happens to run. Explicit
     max-height (see .card__summary above for why) keeps flex's auto-height
     from letting a partial 4th line show through the clamp. */
  max-height: calc(var(--lh-body) * 1em * 3);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   30. Solution Detail (§5.6)
   ========================================================================== */

.solution-hero {
  margin-bottom: var(--space-8);
}

.solution-hero__industry {
  display: inline-flex;
  color: var(--c-primary-dark);
  background: var(--c-primary-tint);
  border-radius: var(--r-pill);
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  padding: 0.2em 0.6em;
  margin-top: var(--space-3);
}

.solution-hero__summary {
  color: var(--c-text-muted);
  margin-top: var(--space-4);
  max-width: 800px;
}

.solution-diagram {
  margin: var(--space-8) 0;
  padding: var(--space-6);
  background: var(--c-bg-alt);
  border-radius: var(--r-card);
  text-align: center;
}

.solution-diagram__img {
  margin-inline: auto;
  max-width: 100%;
}

.solution-advantages {
  margin-bottom: var(--space-8);
}

.solution-advantages ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.solution-advantages li {
  padding-left: var(--space-6);
  position: relative;
}

.solution-advantages li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-cta);
}

.solution-bom {
  margin-block: var(--space-8);
}

.bom-table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--space-4);
  font-size: var(--fs-small);
}

.bom-table th,
.bom-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--c-border);
}

.bom-table thead th {
  background: var(--c-bg-alt);
  font-weight: var(--fw-semibold);
}

.solution-cta {
  background: var(--c-primary-tint);
  border-radius: var(--r-card);
  padding: var(--space-8);
  text-align: center;
  margin-top: var(--space-8);
}

.solution-cta p {
  color: var(--c-text-muted);
  margin-block: var(--space-4);
}

/* ==========================================================================
   31. Support List / Category / Tag pages (§5.7–5.9)
   ========================================================================== */

.support-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .support-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .support-card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================================================
   32. Tech Detail (§5.10) — immersive article + sticky sidebar
   ========================================================================== */

.tech-detail-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  padding-block: var(--space-8);
}

.tech-detail-layout > * {
  min-width: 0;
}

@media (min-width: 768px) {
  .tech-detail-layout {
    grid-template-columns: 1fr 240px;
    align-items: start;
  }
}

@media (min-width: 1200px) {
  .tech-detail-layout {
    grid-template-columns: 1fr 300px;
  }
}

.article-content__title {
  margin-bottom: var(--space-6);
}

.article-author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.article-author__photo {
  border-radius: 50%;
  object-fit: cover;
}

.article-author__meta {
  display: flex;
  flex-direction: column;
}

.article-author__name {
  font-weight: var(--fw-semibold);
  color: var(--c-text);
}

.article-author__name:hover {
  color: var(--c-primary);
}

.article-author__date {
  color: var(--c-text-muted);
  font-size: var(--fs-small);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-8);
}

.related-articles {
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  border-top: 1px solid var(--c-border);
  /* .related-articles is a 3rd sibling in .tech-detail-layout's 2-column grid
     (article-content / related-articles / sticky-sidebar) — without this it
     falls into the 300px sidebar column instead of spanning full width,
     crushing the support-card-grid inside it and overflowing (found via
     real-browser testing, not visible from the CSS alone). */
  grid-column: 1 / -1;
}

.related-articles__title {
  margin-bottom: var(--space-6);
}

.sticky-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

@media (min-width: 768px) {
  .sticky-sidebar {
    position: sticky;
    top: 100px;
    z-index: var(--z-sticky);
    /* .tech-detail-layout has 3 direct children (article-content / related-articles
       [grid-column:1/-1] / sticky-sidebar) in a 2-column grid — without an explicit
       placement here, auto-placement leaves row 1 col 2 empty (skipped because
       related-articles couldn't fit in row 1) and pushes this aside down into row 3,
       full-width, below related-articles instead of beside the article. */
    grid-column: 2;
    grid-row: 1;
  }
}

.sidebar-pdf__title,
.sidebar-ask__title {
  font-size: var(--fs-h4);
  margin-bottom: var(--space-3);
}

.sidebar-pdf__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.sidebar-pdf__item a {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.sidebar-ask__text {
  color: var(--c-text-muted);
  font-size: var(--fs-small);
  margin-bottom: var(--space-4);
}

/* ==========================================================================
   33. News List (§5.11)
   ========================================================================== */

.news-list__section {
  margin-bottom: var(--space-12);
}

.news-list__section-title {
  margin-bottom: var(--space-6);
}

.news-list__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .news-list__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .news-list__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================================================
   34. News Detail (§5.12) — banner / article / share bar / latest news
   ========================================================================== */

.news-banner {
  position: relative;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.news-banner__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-banner__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--c-ink-banner), rgba(11, 27, 43, 0.3));
}

/* banner-overlay-light: for banner images that are already dark (pages.js
   sets this modifier when bannerImage.overlayStyle === "light") */
.banner-overlay-light .news-banner__overlay {
  background: linear-gradient(to top, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.15));
}

.banner-overlay-light .news-banner__title,
.banner-overlay-light .news-banner__meta {
  color: var(--c-text);
  text-shadow: none;
}

.news-banner__inner {
  position: relative;
  z-index: 1;
  padding-block: var(--space-12);
  color: var(--c-footer-heading);
}

.news-banner__tag {
  margin-bottom: var(--space-4);
}

.news-banner__title {
  color: var(--c-footer-heading);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.news-banner__meta {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-4);
  color: var(--c-footer-text);
  font-size: var(--fs-small);
}

.news-article {
  max-width: 800px;
  margin-inline: auto;
  padding-block: var(--space-8);
}

.share-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--c-border);
}

.share-bar__label {
  color: var(--c-text-muted);
  font-weight: var(--fw-medium);
}

.share-bar__link {
  color: var(--c-primary);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
}

.news-latest {
  border-top: 1px solid var(--c-border);
  padding-top: var(--space-12);
}

.news-latest__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .news-latest__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================================================
   35. About (§5.13) — hero / timeline / client cases / customs / team
   ========================================================================== */

.about-hero__img {
  max-width: 320px;
  margin-bottom: var(--space-6);
}

.about-hero__body {
  color: var(--c-text-muted);
  max-width: 800px;
  margin-top: var(--space-4);
}

.timeline__figure {
  max-width: 500px;
  margin: 0 0 var(--space-8);
}

.timeline__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.timeline__item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: var(--space-6);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--c-border);
}

.timeline__year {
  grid-column: 1;
  grid-row: 1 / 3;
  font-family: var(--font-heading);
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  color: var(--c-primary);
}

.timeline__event {
  grid-column: 2;
}

.timeline__desc {
  grid-column: 2;
  color: var(--c-text-muted);
  margin-top: var(--space-2);
}

.client-cases {
  background: var(--c-bg-alt);
}

.client-cases__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .client-cases__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.client-cases__card {
  text-align: center;
  min-width: 0;
}

.client-cases__logo {
  height: 48px;
  width: auto;
  margin-inline: auto;
  margin-bottom: var(--space-3);
}

.customs__intro {
  color: var(--c-text-muted);
  max-width: 800px;
  margin-bottom: var(--space-8);
}

.customs__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .customs__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.customs__img {
  width: 100%;
  border-radius: var(--r-base);
  border: 1px solid var(--c-border);
  margin-bottom: var(--space-3);
}

.customs__date,
.customs__category {
  display: inline-block;
  color: var(--c-text-muted);
  font-size: var(--fs-small);
  margin-right: var(--space-3);
}

.team__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 768px) {
  .team__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .team__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.team__card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.team__photo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
}

.team__role {
  color: var(--c-primary);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
}

.team .btn {
  margin-top: var(--space-3);
}

/* ==========================================================================
   36. Author Profile Page (§5.15, reuses `about` template)
   ========================================================================== */

.author-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  padding: var(--space-8);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  box-shadow: var(--sh-card);
}

@media (min-width: 768px) {
  .author-hero {
    grid-template-columns: 160px 1fr;
  }
}

.author-hero__photo {
  border-radius: 50%;
  object-fit: cover;
}

.author-hero__role {
  display: block;
  color: var(--c-primary);
  font-weight: var(--fw-medium);
  margin-top: var(--space-2);
}

.author-hero__expertise,
.author-hero__experience {
  margin-top: var(--space-3);
}

.author-hero__bio {
  color: var(--c-text-muted);
  margin-top: var(--space-3);
}

.author-articles__empty {
  color: var(--c-text-muted);
}

/* ==========================================================================
   37. Contact (§5.14) — independent template
   ========================================================================== */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-12);
}

@media (min-width: 1200px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.contact-card {
  background: var(--c-bg-alt);
  border-radius: var(--r-card);
  box-shadow: var(--sh-card);
  padding: var(--space-8);
}

.contact-card__title {
  margin-bottom: var(--space-6);
}

.contact-card__channel {
  padding-block: var(--space-4);
  border-bottom: 1px solid var(--c-border);
}

.contact-card__channel:last-child {
  border-bottom: none;
}

.contact-card__label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--fw-semibold);
  color: var(--c-text-muted);
  font-size: var(--fs-small);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.contact-card__icon {
  flex-shrink: 0;
}

.contact-card__value {
  display: block;
  font-size: var(--fs-h4);
  margin-top: var(--space-1);
}

.contact-card__note {
  color: var(--c-text-muted);
  font-size: var(--fs-small);
  margin-top: var(--space-2);
}

.contact-card__qr {
  margin-top: var(--space-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-base);
}

.contact-form {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-card);
  box-shadow: var(--sh-card);
  padding: var(--space-8);
}

.contact-form__title {
  margin-bottom: var(--space-6);
}

.form-group {
  margin-bottom: var(--space-4);
}

.contact-location {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

@media (min-width: 768px) {
  .contact-location {
    grid-template-columns: 1fr 1fr;
  }
}

.contact-map {
  background: var(--c-bg-alt);
  border-radius: var(--r-card);
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  text-align: center;
}

.contact-map__label {
  color: var(--c-text-muted);
  font-weight: var(--fw-medium);
}

.contact-hours__title {
  margin-bottom: var(--space-3);
}

.contact-hours__text {
  color: var(--c-text-muted);
}
