/* ============================================================================
   Purpose: Container, 12 / 8 / 4 grid, section rhythm and the shared
   "eyebrow → heading → lead" text stack. Mobile-first. Tokens only.
   ========================================================================= */

/* --- Container ---------------------------------------------------------- */

.czf-container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.czf-container--rig  { max-width: var(--container-rig); }
.czf-container--wide { max-width: none; }

/* --- Grid: 4 columns mobile → 8 tablet → 12 desktop --------------------- */

.czf-grid {
  display: grid;
  gap: var(--grid-gap);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (min-width: 768px)  { .czf-grid { grid-template-columns: repeat(8,  minmax(0, 1fr)); } }
@media (min-width: 1024px) { .czf-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); } }

/* Column spans are authored against the 12-col desktop and collapse down. */
.czf-col-12 { grid-column: span 4; }
.czf-col-8  { grid-column: span 4; }
.czf-col-7  { grid-column: span 4; }
.czf-col-6  { grid-column: span 4; }
.czf-col-5  { grid-column: span 4; }
.czf-col-4  { grid-column: span 4; }
.czf-col-3  { grid-column: span 2; }

@media (min-width: 768px) {
  .czf-col-12 { grid-column: span 8; }
  .czf-col-8  { grid-column: span 8; }
  .czf-col-7  { grid-column: span 8; }
  .czf-col-6  { grid-column: span 4; }
  .czf-col-5  { grid-column: span 8; }
  .czf-col-4  { grid-column: span 4; }
  .czf-col-3  { grid-column: span 2; }
}

@media (min-width: 1024px) {
  .czf-col-12 { grid-column: span 12; }
  .czf-col-8  { grid-column: span 8;  }
  .czf-col-7  { grid-column: span 7;  }
  .czf-col-6  { grid-column: span 6;  }
  .czf-col-5  { grid-column: span 5;  }
  .czf-col-4  { grid-column: span 4;  }
  .czf-col-3  { grid-column: span 3;  }
}

/* --- Section rhythm ----------------------------------------------------- */

.czf-section {
  position: relative;
  padding-block: var(--section-pad);
}

/* A single hairline between sections. The rule is drawn inside the container
   so it never runs edge to edge - that reads as a document, not an instrument. */
.czf-section--ruled::before {
  content: "";
  position: absolute;
  inset-inline: var(--container-pad);
  top: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--c-line-2) 12%,
    var(--c-line-2) 88%,
    transparent 100%);
}

.czf-section--tight { padding-block: var(--space-64); }
.czf-section--flush { padding-block: 0; }

/* --- Shared text stack -------------------------------------------------- */

.czf-stack        { display: flex; flex-direction: column; gap: var(--space-16); }
.czf-stack--sm    { gap: var(--space-8);  }
.czf-stack--lg    { gap: var(--space-24); }
.czf-stack--xl    { gap: var(--space-32); }

.czf-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--c-ink-3);
}

/* The eyebrow carries a short lit rule - the "bay light" motif at small scale. */
.czf-eyebrow::before {
  content: "";
  width: var(--space-24);
  height: 1px;
  background: var(--c-shield);
  box-shadow: var(--glow-shield);
}

.czf-eyebrow--weather::before { background: var(--c-weather); box-shadow: var(--glow-weather); }
.czf-eyebrow--bare::before    { display: none; }

.czf-h2 { font-size: var(--fs-sec); max-width: 20ch; }

.czf-lead {
  font-size: var(--fs-lead);
  line-height: var(--lh-heading);
  color: var(--c-ink);
  max-width: var(--measure-tight);
}

.czf-body   { color: var(--c-ink-2); }
.czf-muted  { color: var(--c-ink-3); }
.czf-fine   { font-size: var(--fs-caption); color: var(--c-ink-3); line-height: var(--lh-normal); }
.czf-mono   { font-family: var(--font-mono); }

.czf-shield  { color: var(--c-shield);  }
.czf-weather { color: var(--c-weather); }
.czf-clear   { color: var(--c-clear);   }

/* --- Utility ------------------------------------------------------------ */

.czf-center      { text-align: center; }
.czf-center-x    { margin-inline: auto; }
.czf-hide        { display: none !important; }

@media (max-width: 767px)  { .czf-hide-mobile  { display: none !important; } }
@media (min-width: 768px)  { .czf-hide-desktop { display: none !important; } }

/* Horizontal escape hatch for wide data (tables, matrix) on small screens. */
.czf-scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--c-line-3) transparent;
}

.czf-scroll-x::-webkit-scrollbar        { height: var(--space-4); }
.czf-scroll-x::-webkit-scrollbar-track  { background: var(--c-line); }
.czf-scroll-x::-webkit-scrollbar-thumb  { background: var(--c-line-3); }
