/* Native sticky positioning keeps the header's space in document flow. */
.site-header { position: sticky; top: 0; z-index: 30; isolation: isolate; background: var(--color-paper); }
.site-header::before { content: ""; position: absolute; inset: 0 calc((100vw - 100%) / -2); background: var(--color-paper); z-index: -1; }
:where([id], h1, h2, h3, h4, h5, h6) { scroll-margin-top: calc(var(--sticky-header-height, 104px) + 16px); }

/* Adjacent half paddings share one 64px (40px mobile) section interval. */
.home { --home-section-space: 64px; }
.home main > section { padding-block: calc(var(--home-section-space) / 2); min-height: 0; }
.home .cotton-map-hero { padding-block: 0; }
.home .cotton-map-copy { padding-block: 32px; }
.home .cotton-map-visual { min-height: 0; }
.home .hero-deck { margin-block: 16px; }
.home .cotton-map { margin-top: 24px; }
.home .cotton-map li { padding-block: 12px; }
.home .promise-strip { padding-block: 0; }
.home .promise-strip .wrap { min-height: 0; padding-block: 16px; }
.home .section-heading { gap: 24px; }
.home .entry-grid, .home .latest-grid { margin-top: 24px; }
.home .library-heading { margin-bottom: 24px; }
.home .decoder-section { gap: 32px; align-items: start; }
.home .decoder-panel { padding: 24px; align-self: start; }
.home .decoder-number { margin-bottom: 16px; }
.home .decoder-panel label { margin-bottom: 12px; }
.home .decoder-panel output { margin-top: 16px; }
.home .editor-note { margin-top: 24px; padding-top: 16px; }
.home .quality-intro > p:not(.eyebrow) { margin-block: 16px; }
.home .library-grid > a { min-height: 0; padding-block: 12px; }
.home .journey-section { gap: 24px 32px; align-items: start; }
.home .journey-track li { padding-block: 8px; }
.home .evidence-band > .wrap { gap: 24px; align-items: start; }
.home .site-footer { padding-block: 32px; gap: 24px; align-items: start; }
.home .entry-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; align-items: stretch; }
.home .entry-card:nth-child(n) { grid-column: auto; display: flex; flex-direction: column; min-width: 0; margin: 0; }
.home .entry-card .fabric-swatch { width: 100%; height: auto; min-height: 0; aspect-ratio: 16 / 10; object-fit: cover; margin-block: 16px 24px; flex: none; }
.home .entry-card > div:last-child { display: flex; flex-direction: column; flex: 1; }
.home .entry-card .arrow { margin-top: auto; }
@media (min-width: 768px) and (max-width: 1023px) { .home .entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .home { --home-section-space: 40px; }
  .home .entry-grid { grid-template-columns: minmax(0, 1fr); }
  .home .cotton-map-copy { padding-block: 20px; }
  .home .cotton-map-visual { height: auto; aspect-ratio: 16 / 10; }
  .home .site-footer { padding-block: 20px; }
  .home .library-heading .button { margin-top: 0; }
}

.home .entry-card:hover, .home .entry-card:focus-visible, .home .entry-card:hover .fabric-swatch { transform: none; }

/* Retain the expanded header's flow space while its visible surface compacts. */
.header-slot { display: contents; }
@media (min-width: 1001px) {
  .header-slot { display: block; position: sticky; top: 0; z-index: 30; height: var(--expanded-header-height, 192px); pointer-events: none; }
  .header-slot > .site-header { position: relative; height: var(--expanded-header-height, 192px); pointer-events: auto; transition: height 180ms ease; }
  .site-header.is-stuck { height: 72px; overflow: hidden; }
  .site-header.is-stuck .header-main { height: 68px; min-height: 68px; display: flex; align-items: center; justify-content: flex-start; }
  .site-header.is-stuck .brand-lockup { gap: 9px; }
  .site-header.is-stuck .brand-mark { width: 32px; height: 32px; font-size: .8rem; }
  .site-header.is-stuck .brand-lockup b { font-size: .75rem; }
  .site-header.is-stuck .brand-lockup small,
  .site-header.is-stuck .header-actions,
  .site-header.is-stuck .topic-nav { display: none; }
  .site-header.is-stuck .navigation { position: absolute; top: 0; right: max(32px, calc((100vw - 1280px) / 2)); height: 68px; }
  .site-header.is-stuck .navigation > .wrap { width: auto; margin: 0; padding: 0; min-height: 68px; display: flex; align-items: center; }
  .site-header.is-stuck .main-nav { flex-wrap: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  .header-slot > .site-header { transition: none; }
}

/* Center breadcrumb trails, including wrapped article titles on phones. */
.article-breadcrumb{justify-content:center;text-align:center;flex-wrap:wrap}

/* Five-column navigation keeps About separate and the existing sticky slot. */
.navigation > .wrap { justify-content: center; }
.navigation .main-nav { flex-wrap: wrap; }
.hub-group { margin-block: 48px; }
.hub-group-heading { border-bottom: 1px solid var(--color-ink); padding-bottom: 20px; }
.hub-group-heading h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.5rem); }
.hub-group-heading p { max-width: 48rem; margin: 12px 0 0; color: var(--muted); }
.hub-group-link { margin-top: 24px; }
.related-guide-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; }

/* Main column introductions follow the centered article title band. */
.listing-hero--column { padding: 28px 24px 24px; }
.listing-heading--column { display: block; max-width: 1040px; margin-inline: auto; text-align: center; }
.listing-heading--column h1 { font-size: clamp(2.25rem, 4.4vw, 3.75rem); line-height: 1.08; margin: 0 0 14px; text-wrap: balance; }
.listing-heading--column .listing-intro { max-width: 900px; margin: 0 auto; font-family: var(--font-body); font-size: 1.08rem; line-height: 1.55; }
.column-image { width: min(1160px, calc(100% - 48px)); margin: 24px auto 0; }
.column-image img { display: block; width: 100%; height: clamp(220px, 23vw, 320px); object-fit: cover; }
@media (max-width: 760px) {
  .listing-hero--column { padding: 20px 14px 18px; }
  .listing-heading--column h1 { font-size: clamp(2rem, 8vw, 3rem); line-height: 1.1; margin-bottom: 12px; text-wrap: pretty; }
  .listing-heading--column .listing-intro { font-size: 1rem; line-height: 1.5; }
  .column-image { width: calc(100% - 28px); margin-top: 18px; }
  .column-image img { height: auto; aspect-ratio: 16 / 9; }
}

/* Cotton boll mark and a single-line wordmark across all brand placements. */
.brand-lockup { gap: 12px; }
.brand-lockup img.brand-mark { display: block; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 0; flex: none; }
.brand-lockup b { white-space: nowrap; font-size: .95rem; line-height: 1.15; letter-spacing: .13em; }
.brand-lockup small { margin-top: 6px; line-height: 1.3; }
.evidence-mark--cotton { border: 0; border-radius: 0; }
.site-header.is-stuck .brand-lockup img.brand-mark { width: 32px; height: 32px; }
.site-header.is-stuck .brand-lockup b { font-size: .75rem; }
@media (max-width: 1000px) {
  .site-header .brand-lockup { gap: 8px; }
  .site-header .brand-lockup img.brand-mark { width: 36px; height: 36px; }
  .site-header .brand-lockup b { font-size: .75rem; letter-spacing: .075em; }
  .site-header .brand-lockup small { display: none; }
}
@media (max-width: 360px) {
  .site-header .brand-lockup { gap: 6px; }
  .site-header .brand-lockup img.brand-mark { width: 32px; height: 32px; }
  .site-header .brand-lockup b { font-size: .7rem; letter-spacing: .05em; }
  .site-header .header-main:has(.auth-slot) .nav-toggle { margin-right: 5rem; }
}
@media (min-width: 1001px) {
  .navigation .main-nav { gap: 24px; }
  .site-header.is-stuck .navigation > .wrap { gap: 24px; }
  .site-header.is-stuck .main-nav { gap: 20px; }
}
@media (max-width: 1000px) {
  .navigation .main-nav { gap: 18px 24px; }
  .navigation .about-nav { border-top: 1px solid var(--line); padding-top: 16px; }
}
