/* ==========================================================================
   Layout: 12-column grid, section shell, grid lines, horizontal rails
   The page is one 12-column grid that always spans the full width, edge to
   edge (Figma: 12 × 92px columns + 11 × 16px gutters = 1280px).
   Breakpoints: mobile < 768px, tablet/desktop >= 768px (same structure, fluid)
   ========================================================================== */

:root {
  --gutter: 16px;
  /* Column pitch = column + gutter. 100cqw resolves against .page (the size
     container), so the grid ignores the scrollbar. */
  --pitch: calc((100cqw + var(--gutter)) / 12);
}

/* Grid helpers (use inside .page):
   start of column i      -> calc(i * var(--pitch))
   width of n columns     -> calc(n * var(--pitch) - var(--gutter)) */

.page {
  container-type: inline-size;
  overflow-x: clip;
}

.container {
  position: relative;
  z-index: 0; /* own stacking context so grid lines can sit under content */
}

/* Section shell ------------------------------------------------------------ */
.section__inner {
  padding-top: var(--section-pad-top);
  padding-bottom: var(--section-pad-bottom);
}

.section__title {
  padding-left: var(--pitch);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: var(--tracking-label);
}

/* Buttons live on the last columns and touch the right page edge, like Figma */
.section__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--footer-gap, 48px);
}

.section--dark {
  background: var(--color-dark);
  color: var(--color-on-dark);
}

.section--dark .section__title { font-weight: 400; }

/* Grid lines: mark the columns a section's content touches -------------- */
.grid-lines {
  --line-color: var(--color-line);
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.section--dark .grid-lines,
.site-footer .grid-lines { --line-color: var(--color-line-dark); }

.grid-lines__line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--i) * var(--pitch));
  width: 1px;
  background: var(--line-color);
  transform: scaleX(0.5); /* 0.5px stroke, as in Figma */
  transform-origin: left;
}

.grid-lines__line--mobile { display: none; }

@media (max-width: 767px) {
  .grid-lines__line { display: none; }
  .grid-lines__line--mobile { display: block; }
}

/* Horizontal rail: rows of cards that overflow the page on purpose ------- */
.h-scroll {
  display: flex;
  gap: var(--gutter);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-left: var(--rail-start, 0px);
  padding-left: var(--rail-start, 0px);
  scrollbar-width: none;
}
.h-scroll::-webkit-scrollbar { display: none; }
.h-scroll > * {
  flex: none;
  scroll-snap-align: start;
}
