/* SolutionTee Edu Academy - layout
   =========================================================================
   Containers, the grid, and section rhythm. Every page draws its
   alignment from here, so left edges line up across unrelated sections.

   Grid foundation: 12 columns on desktop, 8 on tablet, 4 on mobile, with
   one shared gutter. A component picks a span; it does not pick a width.
   ====================================================================== */

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

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

.container--text {
  max-width: calc(var(--container-text) + (var(--gutter) * 2));
}

/* Full-bleed: escapes the container to the viewport edge without causing
   a horizontal scrollbar. Used for photography and the dark band. */
.bleed {
  width: 100vw;
  margin-inline: calc(50% - 50vw);
}

/* ---- Grid --------------------------------------------------------------
   Mobile is 4 columns; the media queries widen it. Children default to
   full width so an unspanned child is never accidentally narrow. */
.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--grid-gap);
}

.grid > * {
  grid-column: 1 / -1;
}

/* Explicit spans, mobile-first. Numbered to the 12-column desktop
   foundation; below the breakpoints they collapse to full width.

   Spans set grid-column-END only, and reset the start to auto. The
   shorthand `grid-column: span N` would set the START to a span, and a
   later `grid-column-start` would then override it and leave the item
   one column wide - which silently breaks every offset composition. */
.col-1  { grid-column-start: auto; grid-column-end: span 1; }
.col-2  { grid-column-start: auto; grid-column-end: span 2; }
.col-3  { grid-column-start: auto; grid-column-end: span 3; }
.col-4  { grid-column-start: auto; grid-column-end: span 4; }
.col-full { grid-column: 1 / -1; }

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

  .md-2 { grid-column-start: auto; grid-column-end: span 2; }
  .md-3 { grid-column-start: auto; grid-column-end: span 3; }
  .md-4 { grid-column-start: auto; grid-column-end: span 4; }
  .md-5 { grid-column-start: auto; grid-column-end: span 5; }
  .md-6 { grid-column-start: auto; grid-column-end: span 6; }
  .md-8 { grid-column-start: auto; grid-column-end: span 8; }

  /* Centres a 6-wide block in the 8-column grid: 2..7 leaves one column
     either side. Paired with .lg-start-4, which does the same in 12. */
  .md-start-2 { grid-column-start: 2; }
}

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

  .lg-2 { grid-column-start: auto; grid-column-end: span 2; }
  .lg-3 { grid-column-start: auto; grid-column-end: span 3; }
  .lg-4 { grid-column-start: auto; grid-column-end: span 4; }
  .lg-5 { grid-column-start: auto; grid-column-end: span 5; }
  .lg-6 { grid-column-start: auto; grid-column-end: span 6; }
  .lg-7 { grid-column-start: auto; grid-column-end: span 7; }
  .lg-8 { grid-column-start: auto; grid-column-end: span 8; }
  .lg-9 { grid-column-start: auto; grid-column-end: span 9; }
  .lg-10 { grid-column-start: auto; grid-column-end: span 10; }
  .lg-12 { grid-column: 1 / -1; }

  /* Start positions, for asymmetric compositions that need to sit off
     the left edge without an empty spacer element. */
  .lg-start-2 { grid-column-start: 2; }
  .lg-start-3 { grid-column-start: 3; }
  /* With .lg-6 this is the centred column: 4..9 in a 12-column grid. */
  .lg-start-4 { grid-column-start: 4; }
  .lg-start-6 { grid-column-start: 6; }
  .lg-start-7 { grid-column-start: 7; }
}

/* ---- Sections ---------------------------------------------------------- */
.section {
  padding-block: var(--section-y);
}

.section--tight {
  padding-block: var(--section-y-tight);
}

.section--flush-top {
  padding-block-start: 0;
}

/* A rule above the section that fades out at both ends instead of
   stopping dead at the container edge. Drawn as a pseudo-element because
   a border cannot carry a gradient. */
.section--ruled {
  position: relative;
}

.section--ruled::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 1px;
  background: var(--grad-rule);
}

/* A tint of the brand rather than a separate grey, so the band sits on
   whatever is above and below it without a visible seam. */
.section--surface {
  background: var(--glass-1);
}

/* The dark band.
   ------------------------------------------------------------------------
   This used to re-declare the whole ink scale itself, in legacy token
   names, with its own hand-picked blue and gold. That is the same job the
   lifted-context rule in tokens.css does for .on-band and .on-aurora —
   and doing it in two places is how it ended up being done correctly in
   one of them and not the other.

   tokens.css now lists .section--dark alongside them, so everything
   inside inherits the measured lifted scale. All that is left here is the
   GROUND: a wash across the band rather than a flat fill, so the block
   has a direction to it. */
.section--dark {
  background:
    radial-gradient(90% 120% at 8% 0%, rgba(37, 99, 179, 0.22) 0%,
                    rgba(11, 31, 68, 0) 62%),
    var(--band);
  color: var(--ink-muted);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--ink);
}

/* ---- Stacks and clusters ----------------------------------------------
   Two primitives that remove most one-off margin rules. */
.stack > * + * {
  margin-block-start: var(--stack-gap, var(--space-4));
}

.stack--2 { --stack-gap: var(--space-2); }
.stack--3 { --stack-gap: var(--space-3); }
.stack--5 { --stack-gap: var(--space-5); }
.stack--6 { --stack-gap: var(--space-6); }
.stack--7 { --stack-gap: var(--space-7); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cluster-gap, var(--space-3));
}

.cluster--between {
  justify-content: space-between;
}

.cluster--5 { --cluster-gap: var(--space-5); }

/* ---- Split -------------------------------------------------------------
   Image beside text. The ratio is deliberate rather than 50/50, and the
   order is set per instance so sections do not mechanically alternate. */
.split {
  display: grid;
  gap: var(--grid-gap);
  align-items: center;
}

@media (min-width: 1024px) {
  .split {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: clamp(var(--space-6), 4vw, var(--space-9));
  }

  .split--text-first {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }

  .split--align-start {
    align-items: start;
  }
}

/* ---- Scroll containers -------------------------------------------------
   Wide content scrolls inside its own box. The page body never scrolls
   sideways. */
.scroll-x {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

/* ---- Page shell -------------------------------------------------------- */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.page__main {
  flex: 1 0 auto;
}

/* ---- Spacing utilities -------------------------------------------------
   A small set, drawn from the same scale as everything else. These exist
   so a template can adjust the gap above one element without reaching
   for an inline style attribute - which is both harder to keep
   consistent and, for a var(), unreliable across browsers. */

.mt-4 { margin-block-start: var(--space-4); }
.mt-5 { margin-block-start: var(--space-5); }
.mt-6 { margin-block-start: var(--space-6); }
.mt-7 { margin-block-start: var(--space-7); }

.pt-0 { padding-block-start: 0; }
.pt-7 { padding-block-start: var(--space-7); }

/* The header must never push its container wider than the viewport. A
   flex item will not shrink below its min-content width unless told it
   may, and a long navigation row is exactly that case. */
.nav {
  min-width: 0;
}
