/* =====================================================================
   SCHÜCO PRODUCT ROLLOUT — prototype-only additions
   ---------------------------------------------------------------------
   Loaded after base.css, style.css, pages/test-as-fd-75.css and
   pages/schuco-rollout-base.css. Everything here is scoped to
   .tp-page-listing / .tp-page-detail so it cannot reach a production page.

   Contains only components the approved AS FD 75 pattern did not need:
     · product-group headers on the two overview pages
     · the marked imagery-gap tile (used where no verified Schüco image exists)
     · the discreet "to be confirmed" and "related system" notes
     · the plain charcoal hero for products with no verified imagery
     · raster capability glyphs (access-control, bullet-resistance)
     · the comparison bar + comparison panel
   ===================================================================== */

/* ── Product groups ─────────────────────────────────────────────────── */
.tp-page-listing .tp-group { padding-block: var(--space-10) var(--space-4); }
.tp-page-listing .tp-group + .tp-group { padding-top: var(--space-6); }
.tp-page-listing .tp-group-head { margin-bottom: var(--space-6); }
.tp-page-listing .tp-group-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.55rem, 2.6vw, 2.15rem);
  line-height: 1.15;
  color: var(--color-text);
  letter-spacing: -0.005em;
}
.tp-page-listing .tp-group-rule {
  margin-top: var(--space-3);
  max-width: 96px;
  background: var(--color-accent);
  height: 2px;
}
.tp-page-listing .tp-card + .tp-card { margin-top: var(--space-10); }

/* ── Marked imagery gap ─────────────────────────────────────────────── */
.tp-page-listing .tp-shot--gap img { display: none; }
.tp-gap-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  aspect-ratio: 1 / 1;
  width: 100%;
  padding: var(--space-5);
  text-align: center;
  background:
    repeating-linear-gradient(135deg,
      transparent 0 11px,
      color-mix(in srgb, var(--color-border) 45%, transparent) 11px 12px),
    var(--color-surface-offset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.tp-gap-mark {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  color: color-mix(in srgb, var(--color-accent) 70%, transparent);
}
.tp-gap-text {
  max-width: 22ch;
  font-size: var(--text-sm, 0.875rem);
  line-height: 1.45;
  color: var(--color-text-muted);
}

/* ── Confirmation + related-system notes ───────────────────────────── */
.tp-page-listing .tp-confirm,
.tp-page-detail .tp-confirm {
  margin: var(--space-3) 0 0;
  padding-left: var(--space-3);
  border-left: 2px solid var(--color-border);
  font-size: var(--text-sm, 0.875rem);
  line-height: 1.5;
  color: var(--color-text-muted);
}
.tp-page-detail .tp-confirm--head { max-width: 74ch; }

.tp-page-detail .tp-related {
  margin: var(--space-6) 0 0;
  max-width: 78ch;
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface-offset);
  border-left: 2px solid var(--color-border);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text);
}
.tp-related-tag {
  display: inline-block;
  margin-right: var(--space-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-text-muted);
}

/* ── Plain hero (no verified product imagery) ──────────────────────── */
.tp-page-detail .tp-prod-hero--plain { background: #2A2520; }
[data-theme='dark'] .tp-page-detail .tp-prod-hero--plain { background: #1C1916; }
.tp-prod-hero-plain {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 12% 12%,
      rgba(140, 110, 69, 0.30) 0%, rgba(140, 110, 69, 0) 62%),
    linear-gradient(160deg, #322b24 0%, #221e1a 100%);
}
/* White-background product renders need a stronger wash so cream hero type
   keeps its contrast ratio. Flagged automatically at build time. */
.tp-page-detail .tp-prod-hero--light .tp-prod-hero-wash {
  background: linear-gradient(180deg,
    rgba(20, 18, 16, 0.30) 0%,
    rgba(20, 18, 16, 0.58) 46%,
    rgba(20, 18, 16, 0.88) 100%);
}

/* ── Raster capability glyphs (traced icons too dense to inline) ───── */
.tp-cap-raster { display: block; width: 20px; height: 20px; }
.tp-cap-raster--dark { display: none; }
[data-theme='dark'] .tp-cap-raster--light { display: none; }
[data-theme='dark'] .tp-cap-raster--dark { display: block; }

/* ── Spotlight without media ───────────────────────────────────────── */
.tp-page-detail .tp-spotlight-inner--nomedia { grid-template-columns: minmax(0, 1fr); }
.tp-page-detail .tp-spotlight-inner--nomedia .tp-spot-panel { max-width: 78ch; }

/* ── Plain benefit / highlight lists (no numbered decoration) ──────── */
.tp-page-detail .tp-benefits--plain,
.tp-page-detail .tp-highlights--plain {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: var(--space-4) var(--space-6);
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
}
.tp-page-detail .tp-benefits--plain > li,
.tp-page-detail .tp-highlights--plain > li {
  position: relative;
  padding-left: var(--space-5);
  counter-increment: none;
}
.tp-page-detail .tp-benefits--plain > li::before,
.tp-page-detail .tp-highlights--plain > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 10px;
  height: 1px;
  background: var(--color-accent);
}
.tp-page-detail .tp-benefits--plain p,
.tp-page-detail .tp-highlights--plain p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
}

/* ── Technical information: grouped tables ─────────────────────────── */
.tp-page-detail .tp-tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: var(--space-8);
  margin-top: var(--space-6);
}
.tp-page-detail .tp-tech-group { min-width: 0; }

/* ── Capability band on detail pages ──────────────────────────────── */
.tp-page-detail .tp-capsband {
  padding-block: var(--space-8);
  background: var(--color-bg);
}
/* The band reuses the approved .tp-panel cell rhythm so the icon row reads
   identically to the summary card. */
.tp-page-detail .tp-capsband .tp-panel--caps { margin-top: 0; }
.tp-page-detail .tp-capsband .tp-panel--caps {
  display: block;                 /* full-width icon grid, note beneath */
  padding: var(--space-5) var(--space-6);
}
.tp-page-detail .tp-capsband .tp-caps-grid {
  margin: 0; padding-top: 0; border-top: 0;
}
.tp-page-detail .tp-capsband .tp-caps-note { margin-top: var(--space-4); }

/* ── Comparison bar ───────────────────────────────────────────────── */
.tp-comparebar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 60;
  background: #2A2520;
  border-top: 1px solid rgba(232, 228, 220, 0.16);
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.18);
}
.tp-comparebar[hidden] { display: none; }
.tp-comparebar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
  padding-block: var(--space-3);
}
.tp-comparebar-text {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: #E8E4DC;
}
.tp-comparebar-text [data-compare-count] { font-weight: 600; color: #E8E4DC; }
.tp-comparebar-actions { display: flex; align-items: center; gap: var(--space-4); }
.tp-comparebar .btn { min-height: 40px; }
.tp-comparebar .tp-textlink {
  background: none;
  border: 0;
  padding: 0 2px;
  min-height: 40px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: rgba(232, 228, 220, 0.72);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.tp-comparebar .tp-textlink:hover { color: #E8E4DC; }
.tp-comparebar .btn:focus-visible,
.tp-comparebar .tp-textlink:focus-visible {
  outline: 2px solid #F8F7F4;
  outline-offset: 3px;
}

/* ── Comparison panel ─────────────────────────────────────────────── */
.tp-comparepanel {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(20, 18, 16, 0.55);
  padding: 0;
}
.tp-comparepanel[hidden] { display: none; }
.tp-comparepanel-inner {
  width: min(1280px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  padding: var(--space-6) clamp(20px, 5vw, 48px) var(--space-8);
  background: var(--color-bg);
  border-top: 2px solid var(--color-accent);
  border-radius: var(--radius-lg, 8px) var(--radius-lg, 8px) 0 0;
}
.tp-comparepanel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}
.tp-comparepanel-head .tp-sec-title { margin: 0; }
.tp-comparepanel-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--color-text-muted);
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 4px);
  cursor: pointer;
}
.tp-comparepanel-close:hover { color: var(--color-text); border-color: var(--color-text-muted); }
.tp-comparepanel-note {
  margin: var(--space-3) 0 var(--space-5);
  max-width: 82ch;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}
.tp-comparepanel-body { overflow: auto; }
.tp-cmp-scroll { overflow-x: auto; }
.tp-cmp-family + .tp-cmp-family { margin-top: var(--space-8); }
.tp-cmp-family-title {
  margin: 0 0 var(--space-3);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-text-muted);
}
.tp-cmp-table {
  width: 100%;
  font-variant-numeric: lining-nums;
  font-feature-settings: "lnum" 1, "onum" 0;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.tp-cmp-table th,
.tp-cmp-table td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--color-divider);
  line-height: 1.5;
}
.tp-cmp-table thead th {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.0625rem;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}
.tp-cmp-table thead th a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--color-accent); }
.tp-cmp-table thead th a:hover { color: var(--color-accent); }
.tp-cmp-table tbody th {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  width: 26%;
  min-width: 160px;
}
.tp-cmp-table td { color: var(--color-text); }
.tp-cmp-na { color: var(--color-text-faint, var(--color-text-muted)); font-style: italic; }
.tp-cmp-confirm {
  display: block;
  margin-top: var(--space-2);
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--color-text-muted);
}
.tp-cmp-empty { margin: 0; color: var(--color-text-muted); }
.tp-cmp-remove {
  display: block;
  width: fit-content;
  margin-top: var(--space-2);
  padding: 0;
  background: none;
  border: 0;
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.tp-cmp-remove:hover { color: var(--color-accent); }

/* ── Active toggle state ──────────────────────────────────────────── */
.tp-page-listing .tp-act[aria-pressed='true'],
.tp-page-detail .tp-act[aria-pressed='true'] {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #F8F7F4;
}
[data-theme='dark'] .tp-page-listing .tp-act[aria-pressed='true'],
[data-theme='dark'] .tp-page-detail .tp-act[aria-pressed='true'] {
  background: #8C6E45;
  border-color: #8C6E45;
  color: #141210;
}

/* ── Narrow viewports ─────────────────────────────────────────────── */
@media (max-width: 700px) {
  .tp-page-listing .tp-group { padding-block: var(--space-8) var(--space-2); }
  .tp-comparebar-inner { justify-content: flex-start; }
  .tp-comparepanel-inner { max-height: 92vh; padding-bottom: var(--space-6); }
  .tp-cmp-table thead th { font-size: 0.9375rem; }
  .tp-cmp-table th, .tp-cmp-table td { padding: var(--space-2) var(--space-3); }
}
@media (max-width: 380px) {
  .tp-gap-text { max-width: 18ch; font-size: 0.8125rem; }
  .tp-comparebar-actions { gap: var(--space-3); }
  .tp-cmp-table { font-size: 0.875rem; }
  .tp-cmp-table tbody th { min-width: 108px; }
}

/* ── Capability grid: variable item counts ──────────────────────────────
   The approved card was tuned for exactly seven data points (a fixed
   repeat(7) track set). Across 18 systems the verified count varies, so the
   rollout uses auto-fit tracks of the same width — a five- or six-item strip
   fills the card instead of leaving an orphan track. */
@media (min-width: 1101px) {
  .tp-page-listing .tp-panel--caps > .tp-caps-grid,
  .tp-page-detail .tp-capsband .tp-caps-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(148px, 100%), 1fr));
    gap: var(--space-2);
  }
  .tp-page-detail .tp-capsband .tp-caps-grid > .tp-cap {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 8px;
  }
  .tp-page-detail .tp-capsband .tp-cap-name { font-size: 0.53rem; letter-spacing: 0.05em; }
}
@media (max-width: 1100px) {
  .tp-page-detail .tp-capsband .tp-caps-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
    gap: var(--space-2);
  }
}

/* ── Review banner: the rollout flag text is longer than the AS FD 75 one and
   must wrap rather than push the page wider than 320px. ─────────────────── */
.tp-page-listing .tp-flag,
.tp-page-detail .tp-flag {
  flex-wrap: wrap;
  max-width: 100%;
}
@media (max-width: 520px) {
  .tp-page-listing .tp-flag,
  .tp-page-detail .tp-flag { letter-spacing: 0.1em; font-size: 0.6rem; }
}

/* ── Round-16 QA fix: slash-joined compound terms from the evidence copy
   (e.g. "Corner/structural/symmetrical/asymmetrical mullions") carry no break
   opportunity in Chromium and pushed the AWS 90.SI+ page 32 px past a 320 px
   viewport. Allow long unbreakable tokens to break inside rollout body copy. ── */
.tp-page-listing p,
.tp-page-listing li,
.tp-page-listing td,
.tp-page-listing th,
.tp-page-detail p,
.tp-page-detail li,
.tp-page-detail td,
.tp-page-detail th {
  overflow-wrap: break-word;
}

/* ── Round-16 QA fix: the confirmation note, gap-tile caption and related-system
   tag sit on --color-surface-offset (#ECEAE5), where --color-text-muted
   (#6B6B6B) is only 4.43:1 — under the 4.5:1 AA floor for 16 px text. Deepen
   the muted tone toward the primary charcoal in light mode; dark mode already
   clears AA at 5.8:1 and is restored to the plain muted token. ───────────── */
.tp-page-listing .tp-confirm,
.tp-page-detail .tp-confirm,
.tp-gap-text,
.tp-related-tag {
  color: color-mix(in srgb, var(--color-text-muted) 72%, var(--color-primary));
}
[data-theme='dark'] .tp-page-listing .tp-confirm,
[data-theme='dark'] .tp-page-detail .tp-confirm,
[data-theme='dark'] .tp-gap-text,
[data-theme='dark'] .tp-related-tag {
  color: var(--color-text-muted);
}

/* ── Full-image plate treatment (no-crop) ─────────────────────────────────
   Some product photos and technical drawings are not natively square/4:3 and
   would lose meaningful content under the default `.tp-shot`/`.tp-gal-fig`
   `object-fit: cover` rule (which crops to fill the box). The `--dwg` modifier
   shows the whole asset uncropped on a light plate in both themes. This is
   the same treatment already used on the Sosoares product pages; duplicated
   here so individual Schüco product pages (which don't load the Sosoares
   stylesheet) can use it too. */
.tp-shots .tp-shot--dwg img,
.tp-gal-fig--dwg img {
  object-fit: contain;
  padding: var(--space-4);
  background: #FFFFFF;
  border: 1px solid var(--color-divider);
}
[data-theme='dark'] .tp-shots .tp-shot--dwg img,
[data-theme='dark'] .tp-gal-fig--dwg img {
  background: #F2F0EC;
}
