/* ==========================================================================
   AURELLE — Layout
   Container, grid and section-rhythm primitives shared by every section.
   ========================================================================== */

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

.container--narrow { max-width: 900px; }
.container--wide { max-width: 1680px; }

section { position: relative; }

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

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

.section-pad-top {
  padding-top: var(--section-pad-y);
}

.section-pad-bottom {
  padding-bottom: var(--section-pad-y);
}

.bg-primary { background: var(--bg-primary); }
.bg-secondary { background: var(--bg-secondary); }
.bg-inverse { background: var(--bg-inverse); color: var(--text-inverse); }
/* these used to hard-code ivory text — correct only on the black inverse
   background (light theme). bg-inverse flips to ivory in dark mode, so use
   the semantic inverse text tokens, which resolve to dark-on-ivory there. */
.bg-inverse .text-secondary { color: var(--text-inverse-muted); }
.bg-inverse p { color: var(--text-inverse-muted); }
.bg-inverse .eyebrow { color: var(--accent-light); }
[data-theme="dark"] .bg-inverse .eyebrow { color: var(--accent-deep); }
.bg-inverse .divider { background: var(--border-hair-inverse); }

.grid {
  display: grid;
  gap: clamp(1.25rem, 1rem + 1.2vw, 2.5rem);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: 0.75rem; }
.gap-md { gap: 1.5rem; }

.section-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-bottom: clamp(2.5rem, 2rem + 2vw, 4.5rem);
}

.section-head-row .actions { flex-shrink: 0; padding-bottom: 0.4rem; }

.divider {
  height: 1px;
  width: 100%;
  background: var(--border-hair);
  border: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--c-black);
  color: var(--c-ivory);
  padding: 0.9rem 1.5rem;
  z-index: 1200;
  transition: top var(--dur-fast) var(--ease-out-soft);
  font-size: var(--fs-sm);
  letter-spacing: var(--ls-wide);
}

.skip-link:focus { top: 1rem; }

/* ---------- Responsive breakpoints ----------
   Desktop-first authoring across component files; these are the shared
   checkpoints referenced everywhere (documented for consistency):
   1200px → small desktop / laptop
   960px  → tablet landscape
   680px  → tablet portrait / large phone
   440px  → phone
*/

@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 960px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .section-head-row { flex-direction: column; align-items: flex-start; gap: 1.25rem; }
}

@media (max-width: 680px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-6 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 440px) {
  .grid-2 { grid-template-columns: 1fr; }
}
