/* Alder: utility pages. Error pages (error-404/403/429/500/503), the match
   "request sent" screen (match-sent) and the legal pages (/privacy, /terms,
   page--legal). Linked from each template's body; page.tpl.php hoists it
   into the head. Mobile first; one breakpoint at 921px, as alder.css.
   No gradients, glows, hover lift or horizontal rules. */

/* ---------- Shared head band ---------- */
.al-util__head { padding: 36px 0 40px; }
.al-util__h {
  font: 800 clamp(2rem, 6.4vw, 3.4rem)/1.04 var(--al-display);
  letter-spacing: -.03em; color: var(--al-ink); text-wrap: balance; max-width: 18em;
}
/* 32em of this italic is about 70 characters a line (36em ran to 79) */
.al-util__lede { margin-top: 14px; max-width: 32em; font: italic 400 18px/1.55 var(--al-serif); color: var(--al-body); }
.al-util__small { margin-top: 12px; font-size: 14px; line-height: 1.5; color: var(--al-muted); }
.al-util__head .al-actions { margin-top: 26px; }
@media (max-width: 479px) {
  .al-util__head .al-actions .al-pill { flex: 1 1 100%; }
}
@media (min-width: 921px) {
  .al-util__head { padding: 64px 0 72px; }
  .al-util__lede { font-size: 20px; }
}

/* ---------- Error pages ---------- */
.al-err__grid { display: grid; gap: 8px; }
.al-err__art { position: relative; display: flex; align-items: center; justify-content: flex-start; }
.al-err__code {
  font: 800 clamp(5.5rem, 26vw, 11rem)/.9 var(--al-display);
  letter-spacing: -.05em; color: var(--al-sage); user-select: none;
}
.al-err__mark {
  position: absolute; left: clamp(2.2rem, 10vw, 4.4rem); top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 72px; height: 72px;
  border: 1px solid var(--al-line); border-radius: 50%; background: var(--al-page); color: var(--al-moss);
}
.al-err__mark svg { width: 34px; height: 34px; }
.al-err__path {
  display: inline-block; max-width: 100%; padding: 1px 8px; border-radius: 8px;
  background: var(--al-page); color: var(--al-ink);
  font: 400 14px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; font-style: normal;
  overflow-wrap: anywhere;
}
@media (min-width: 921px) {
  .al-err__grid { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 48px; }
  .al-err__art { order: 2; justify-content: center; }
  .al-err__mark { left: 50%; transform: translate(-50%, -50%); width: 96px; height: 96px; }
  .al-err__mark svg { width: 44px; height: 44px; }
}

/* 404 recovery body */
.al-err__body { padding: 40px 0 72px; }
.al-err__search { display: flex; gap: 8px; max-width: 640px; }
.al-scope .al-err__search input[type="search"] {
  flex: 1 1 auto; min-width: 0; min-height: 48px; margin: 0; padding: 0 18px;
  border: 1px solid var(--al-line); border-radius: 999px; background: #fff; box-shadow: none;
  font: 400 16px/1.2 var(--al-sans); color: var(--al-ink);
  -webkit-appearance: none; appearance: none;
}
.al-scope .al-err__search input[type="search"]::placeholder { color: var(--al-muted); opacity: 1; }
.al-scope .al-err__search input[type="search"]:focus { outline: 2px solid var(--al-brand); outline-offset: 2px; border-color: var(--al-line); }
.al-err__search .al-pill { min-height: 48px; flex: none; }

.al-err__tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 28px; }
.al-err__tile {
  display: flex; flex-direction: column; gap: 10px; min-height: 44px; padding: 16px;
  border: 1px solid var(--al-line); border-radius: var(--al-r); background: var(--al-page);
  transition: border-color .18s, background-color .18s;
}
.al-err__tile svg { width: 22px; height: 22px; color: var(--al-moss); }
.al-err__tile b { display: block; font: 700 16px/1.2 var(--al-display); letter-spacing: -.01em; color: var(--al-ink); }
.al-err__tile b + span { display: block; margin-top: 2px; font-size: 13px; line-height: 1.35; color: var(--al-muted); }
@media (hover: hover) { .al-err__tile:hover { border-color: var(--al-ink); background: #fff; } }
@media (min-width: 640px) { .al-err__tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.al-err__group { margin-top: 40px; }
.al-err__group .al-label { margin-bottom: 12px; }
.al-err__group .al-chip { gap: 6px; font-size: 14px; }
.al-err__group .al-chip small { font-size: 12px; color: var(--al-muted); }
.al-err__group .al-chip--all { background: var(--al-pill); color: #fff; font-weight: 600; }
.al-err__group .al-chip--all .al-ico { width: 15px; height: 15px; }
@media (hover: hover) { .al-err__group .al-chip--all:hover { background: var(--al-moss); } }
.al-err__foot { margin-top: 48px; font-size: 15px; color: var(--al-muted); }
.al-err__foot a { color: var(--al-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* 500, dev only */
.al-err__debug { margin-top: 32px; padding: 18px; border-radius: var(--al-r); background: var(--al-ink); color: #E6F5EC; font: 400 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.al-err__debug summary { font-weight: 600; color: var(--al-sage); }
.al-err__debug pre { margin-top: 10px; white-space: pre-wrap; max-height: 16rem; overflow: auto; }

/* ---------- Match: request sent ---------- */
.al-sent { padding: 48px 0 72px; min-height: 56vh; display: grid; align-items: center; }
.al-sent__box { max-width: 34em; }
.al-sent__mark {
  display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 20px;
  border-radius: 50%; background: var(--al-paper); color: var(--al-moss);
}
.al-sent__mark svg { width: 30px; height: 30px; stroke-width: 2.2; }
.al-sent__count {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 24px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; background: var(--al-sand);
  font-size: 14px; color: var(--al-body);
}
.al-sent__spin { width: 16px; height: 16px; animation: al-sent-spin 1s linear infinite; }
@keyframes al-sent-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .al-sent__spin { animation: none; } }
.al-sent .al-more { margin-top: 18px; }

/* ---------- Legal pages ---------- */
.al-legal .al-util__h { max-width: none; }
.al-legal__body { padding: 36px 0 72px; }
/* The prose is the container; the measure (30em of its own type, about 72
   real characters; 70ch ran to 98) sits on each text block, so the sheet
   below can use the width. */
.al-legal .al-prose { max-width: none; }
.al-legal .al-prose :where(p, ul, ol, blockquote, h2, h3) { max-width: 30em; }
.al-legal .al-prose h2 {
  margin: 2em 0 .5em; font: 700 22px/1.2 var(--al-display); letter-spacing: -.015em; color: var(--al-ink);
  scroll-margin-top: calc(var(--al-hdr-h) + 24px);
}
/* The h2 sections (page--legal wraps each in .al-legal__sec) set two across
   from 1024px, like the contact sheet: a page of numbered clauses reads row
   by row and fills the container instead of leaving its right half empty.
   17px type below 1280px keeps a 448px column above 60 characters. */
.al-legal__sec > h2:first-child { margin-top: 0; }
.al-legal__sec + .al-legal__sec { margin-top: 2.4em; }
@media (min-width: 1024px) {
  .al-legal__sheet { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }
  .al-legal__sec + .al-legal__sec { margin-top: 0; }
  /* A section with a table (the privacy cookie list) runs across both
     columns: four columns of table in half a container scrolled sideways,
     and its length left the section beside it over a long blank. */
  .al-legal__sec:has(table) { grid-column: 1 / -1; }
  .al-legal__intro + .al-legal__sheet { margin-top: 48px; }
}
@media (min-width: 1024px) and (max-width: 1279px) { .al-legal .al-prose { font-size: 17px; } }
/* Section index above the sheet from 768px: the jump list that was a rail,
   now a wrapping row of pills on the logo's line. Phones skip it (the
   sections are one column, a scroll away). */
.al-legal__index { display: none; }
@media (min-width: 768px) {
  .al-legal__index { display: block; margin-bottom: 40px; }
  .al-legal__indexlbl { margin: 0 0 10px; font: italic 400 17px/1.3 var(--al-serif); color: var(--al-moss); }
  .al-legal__toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
  .al-legal__toc a {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px;
    border: 1px solid var(--al-line); background: var(--al-page); font: 400 14px/1.3 var(--al-sans); color: var(--al-body); text-decoration: none;
  }
}
@media (hover: hover) { .al-legal__toc a:hover { color: var(--al-ink); border-color: var(--al-ink); } }
.al-legal .al-prose h2:first-child { margin-top: 0; }
.al-legal .al-prose h3 { margin: 1.5em 0 .4em; font: 700 18px/1.25 var(--al-display); color: var(--al-ink); }
.al-legal .al-prose p, .al-legal .al-prose ul, .al-legal .al-prose ol, .al-legal .al-prose table { margin-top: 1em; }
.al-legal .al-prose h2 + p, .al-legal .al-prose h3 + p { margin-top: 0; }
.al-legal .al-prose ol { list-style: decimal; padding-left: 1.3em; }
.al-legal .al-prose li + li { margin-top: .35em; }
.al-legal .al-prose strong { color: var(--al-ink); font-weight: 600; }
.al-legal .al-prose code { padding: 1px 6px; border-radius: 6px; background: var(--al-sand); font-size: .9em; }
.al-legal .al-prose a { overflow-wrap: anywhere; }
/* The summary callout the terms open with: a sand panel */
.al-legal .al-prose .bg-amber-50 {
  margin: 0 0 1.6em; padding: 18px 20px; border: 0; border-radius: var(--al-r);
  background: var(--al-sand); color: var(--al-body); font-size: 15px; line-height: 1.6;
}
/* Tables scroll inside themselves; zebra rows, no rules */
.al-legal__table { margin-top: 1em; overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* The cookie table's section spans both columns from 1024px; the table
   itself stops at 46rem so its rows do not stretch across the container. */
.al-legal__sec:has(table) .al-legal__table { max-width: 46rem; }
.al-legal .al-prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.45; }
.al-legal .al-prose th { padding: 10px 12px; text-align: left; font: 600 13px/1.3 var(--al-sans); color: var(--al-ink); background: var(--al-sand); }
.al-legal .al-prose td { padding: 10px 12px; vertical-align: top; border: 0; }
.al-legal .al-prose tbody tr:nth-child(even) td { background: var(--al-paper); }
.al-legal .al-prose :is(th, td) { border: 0; }
/* Under 768px the cells' side padding drops to 8px: the cookie table's narrowest
   layout (each column's longest word plus 24px of padding) came to 598px, 6px over
   the 592px scroller at 640, so it scrolled for 6px. A phone still scrolls it. */
@media (max-width: 767px) { .al-legal .al-prose :is(th, td) { padding-left: 8px; padding-right: 8px; } }
@media (min-width: 921px) { .al-legal__body { padding: 56px 0 120px; } }
