/* ============================================================================
   Digital Invites — site styles (landing page, Terms, Privacy)
   ----------------------------------------------------------------------------
   Layout, grid, buttons, nav, footer, forms and motion come from the design kit
   in /assets/kit (system.css, layout.css, motion.css — do not edit those). This
   file sits on top of it and does two jobs:

     1. Brand layer — the Digital Invites Brand Guidelines, which win over the
        kit's own type and colour: Soft Ivory + Ink Black only, Cormorant Garamond
        Medium UPPERCASE 0.16em for headings, Jost Light UPPERCASE 0.42em for
        labels and buttons, Jost Regular for body text.
     2. Page CSS — the few things the kit has no class for (the design tiles'
        filter, the request form's grid, the legal pages' long text).

   Load order matters: this file comes after the kit's stylesheets.
   nginx caches CSS for a week: bump ?v= on the <link> when this file changes.
   ========================================================================== */

/* ── 1. Brand tokens ──────────────────────────────────────────────────────── */
:root {
  /* The two brand colours, and one deeper Soft Ivory of the same hue (42 degrees) for the page's one
     band and the ground under a picture. Text is Ink Black on ivory and Soft Ivory on Ink Black, never
     grey: the kit's "muted" tone is the ink itself. Hex only, because the kit's scripts read them. */
  --ivory: #f7f3ea; --ivory-deep: #f0eadd; --ink-black: #141414;
  --p-bg: #f7f3ea; --p-surface: #f0eadd; --p-ink: #141414; --p-muted: #141414;
  --p-accent: #141414; --p-accent-ink: #f7f3ea; --p-action: #141414; --p-action-ink: #f7f3ea;
  --p-inv-bg: #141414; --p-inv-surface: #141414; --p-inv-ink: #f7f3ea; --p-inv-muted: #f7f3ea;
  --p-inv-accent: #f7f3ea; --p-inv-accent-ink: #141414; --p-inv-action: #f7f3ea; --p-inv-action-ink: #141414;
  /* The ground behind a picture in a frame or a card: the deeper ivory, never a third hue. */
  --ground-bg: #f0eadd; --ground-surface: #f0eadd; --ground-ink: #141414; --ground-muted: #141414; --ground-accent: #141414;

  /* Type: the brand's two families and its letter spacing */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-text: 'Jost', system-ui, sans-serif;
  --display-weight: 500;
  --display-tracking: .16em;
  --display-tracking-xl: .16em;
  --label-tracking: .42em;
  --ly-scale: 1;

  /* Body text keeps to the brand's 14 to 18px: the kit's lead (20px on a desktop) stops at 18. */
  --t-lead: 18px;
  --t-card: 18px;
  --ly-lead: clamp(16px, .19vw + 15.26px, 18px);

  /* Heading sizes. Capitals at 0.16em run about 1.6 times wider than the kit's sentence-case
     headings, so each level is set smaller than the kit's: the h1 keeps to three lines beside
     the hero picture (its size follows the column's width), and each level sits under the last. */
  --t-h1: clamp(24px, .95vw + 20.3px, 30px);
  --t-h2: clamp(20px, 1.52vw + 14.1px, 36px);
  --t-h3: clamp(17px, .29vw + 15.9px, 20px);
  --ly-h1: var(--t-h1);
}
/* From 1024px the hero's words stand beside its picture: the h1 grows with that column. */
@media (min-width: 1024px) {
  :root { --t-h1: clamp(30px, 2.764vw + 2.2px, 42px); }
}
/* Rules: a fine rule is the ink itself, thinned; a control's outline is the full ink. */
:root, .ground-base, .ground-surface, .ground-inverse {
  --line: color-mix(in oklab, var(--ink) 16%, transparent);
  --line-strong: var(--ink);
}

/* ── 2. Brand type ────────────────────────────────────────────────────────── */
/* Headings and names: Cormorant Garamond Medium, uppercase, 0.16em, lining figures. */
h1, h2, h3, .t-h1, .t-h2, .t-h3, .t-stat, .footer__lede, .btn--xl {
  text-transform: uppercase;
  letter-spacing: var(--display-tracking);
  font-variant-numeric: lining-nums;
}
h1, .hero h1 { line-height: 1.16; }
h2 { line-height: 1.25; }
h3 { line-height: 1.35; }

/* Labels, buttons and small details: Jost Light, uppercase, 0.42em. */
.t-label, .hero__kicker, .nav__link, .btn:not(.btn--xl), .chip, .field > label,
.footer :is(h3, h4):not(.closing__cta *), .legal-toc__title, .prose .updated {
  font-family: var(--font-text);
  font-size: var(--t-label);
  font-weight: 300;
  letter-spacing: var(--label-tracking);
  line-height: 1.6;
  text-transform: uppercase;
}
/* A section's label above its heading, the same size as the hero's (the kit's .section-head p rule
   would set it at the 18px lead). The footer's small print stays at the brand's 14px floor. */
.section-head > .t-label { font-size: var(--t-label); line-height: 1.6; }
.footer__legal { font-size: var(--t-small); }
/* A tracked label carries spare space after its last letter; trim it where the label sits in a box. */
.btn:not(.btn--xl), .chip { padding-right: calc(var(--s-5) - var(--label-tracking) / 2); }

/* The narrowest phones (under 360px): a tracked label is wider than the screen, so buttons
   take a little less tracking and may wrap onto two lines. */
@media (max-width: 359px) {
  .btn:not(.btn--xl), .btn--xl, .btn--xl.btn--wide {
    letter-spacing: .28em; padding-inline: var(--s-3); white-space: normal; text-align: center; height: auto; min-height: 48px;
  }
}

/* On a phone the close's wide button reads like every other button. */
@media (max-width: 639px) {
  .btn--xl, .btn--xl.btn--wide { font: 300 var(--t-label)/1.6 var(--font-text); letter-spacing: var(--label-tracking); height: 48px; padding-inline: var(--s-4); }
}

/* Errors are told by a mark and a heavier border, not by red: the palette has two colours. */
form { --error: var(--ink); }

/* ── 3. Header logo ───────────────────────────────────────────────────────── */
/* The supplied lockup. Clear space on every side is at least the envelope's own height,
   which the bar's height and gaps give at both sizes; never under 180px wide. */
.nav__logo img, .footer .nav__logo img { display: block; width: 184px; height: auto; }
@media (min-width: 1024px) {
  .nav__logo img, .footer .nav__logo img { width: 216px; }
}


/* Between 1024 and 1119px the four tracked nav words and the button do not fit one bar.
   The words stay; the button steps aside (the hero and the close carry the same action). */
@media (min-width: 1024px) and (max-width: 1119px) {
  .nav .nav__actions { display: none; }
}

/* ── 3a. Short laptop screens ─────────────────────────────────────────────── */
/* From 1280px wide the kit makes every section exactly one screen tall, sized for a 900px-tall
   screen. On a shorter laptop (1366x768, 1536x864) a full section would run into the next one, so
   there each section is at least one screen and grows with what it holds, as the kit already
   does on tablets. */
@media (min-width: 1280px) and (max-height: 859px) {
  main > :is(section, .section):not(.hero, .section--hero), footer.closing {
    height: auto; min-height: calc(var(--h, 1) * 100svh);
    display: flex; flex-direction: column;
  }
  main > :is(section, .section):not(.hero, .section--hero) > :is(.wrap, .container), footer.closing > .wrap { flex: 1 0 auto; height: auto; min-height: 0; }
}

/* ── 3c. Phones and tablets: each section as tall as what it holds ────────── */
/* Under 1024px the kit gave every section one or two whole screens, which left up to 550px of empty
   ivory under a short section. Here a section is as tall as its content, with one even gap between
   sections (80px on a phone, 96px on a tablet); anchors still land below the fixed header. The hero
   keeps its full first screen. */
@media (max-width: 1023px) {
  main > :is(section, .section):not(.hero, .section--hero), footer.closing {
    min-height: 0; padding: 40px 0; scroll-margin-top: var(--nav);
  }
  /* the close keeps clear of the phone's action bar at the foot of the screen */
  footer.closing { padding: 56px 0 calc(40px + var(--bar)); }
  main > :is(section, .section) > .wrap > .fill { flex: 0 0 auto; min-height: auto; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  main > :is(section, .section):not(.hero, .section--hero) { padding-block: 48px; }
}

/* ── 3b. The second action ────────────────────────────────────────────────── */
/* Beside the one filled button, the second action is an underlined text link, the look the kit
   already gives it on a phone. A grey box read as a switched-off button. */
html[data-buttons] .btn.btn--secondary {
  background: none; border-color: transparent; padding-inline: var(--s-2);
  text-decoration: underline; text-underline-offset: 6px; text-decoration-color: var(--line-strong);
}
html[data-buttons] .btn.btn--secondary:hover { background: none; border-color: transparent; text-decoration-color: currentColor; }

/* ── 4. Designs: the occasion filter ─────────────────────────────────────── */
/* A row of words, like a catalogue's index. The chosen one is underlined in ink; none is a filled
   box, so the page's one filled button stays the main action. The cards are in css/home.css. */
.chips { display: flex; flex-wrap: wrap; gap: 0 var(--s-6); margin-bottom: var(--s-5); }
.chip {
  min-height: 44px; padding: 0;
  background: none; color: var(--ink); border: 0; border-radius: 0;
  text-decoration: underline 1px transparent; text-underline-offset: 10px;
  cursor: pointer; transition: text-decoration-color var(--dur) var(--ease);
}
.chip:hover { text-decoration-color: var(--line); }
.chip[aria-pressed="true"] { text-decoration-color: var(--ink); }
.chip:focus-visible { outline-offset: 4px; }
@media (max-width: 639px) { .chips { gap: 0 var(--s-5); } }

/* The closing line reads as one phrase: the kit's 20ch cap broke "for" onto a line of its own. */
.closing__cta h2 { max-width: none; }


/* ── 5. Request form ──────────────────────────────────────────────────────── */
/* The kit's field styles with the page's own grid. It is not the kit's form.form, because
   that posts form-encoded data and this API takes JSON (see the script in index.html). */
.request-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); }
.request-form > :is(.field--full, .btn-row, p) { grid-column: 1 / -1; }
.request-form textarea { min-height: 96px; }
@media (max-width: 639px) {
  .request-form { grid-template-columns: minmax(0, 1fr); }
}
.request-form .form__status[data-state] { font-weight: 400; padding-left: var(--s-3); border-left: 2px solid var(--ink); }
@media (min-width: 1024px) and (max-height: 820px), (min-width: 640px) and (max-width: 1023px) {
  #request .section-head { margin-bottom: var(--s-5); }
  .request-form { gap: var(--s-3); }
  .request-form textarea { min-height: 56px; height: 56px; }
  .request-form .field :is(input, select) { height: 44px; }
}
.request-pic { min-height: 240px; }
/* A map set in the admin panel, in the page's warm tone rather than a cold grey. */
.request-pic iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--r-sm); filter: grayscale(1) sepia(.2) contrast(1.02); }
/* Fields as on fine stationery: one ink rule to write on, with no box and no grey ground. A field
   in focus or at fault takes a second rule under the first, so nothing moves. */
.request-form .field :is(input, select, textarea) {
  border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; background: transparent; padding-inline: 0;
}
.request-form .field :is(input, select, textarea):focus-visible { outline: none; box-shadow: 0 1px 0 var(--ink); }
.request-form .field :is(input, select, textarea)[aria-invalid="true"] { border: 0; border-bottom: 1px solid var(--ink); box-shadow: 0 1px 0 var(--ink); }
.request-form .field select {
  appearance: none; padding-right: 28px; cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23141414' stroke-width='1.2'/%3E%3C/svg%3E") no-repeat right 4px center / 12px 8px;
}
.request-form .field textarea { padding-block: var(--s-2); }
.request-form ::placeholder { color: var(--ink); opacity: .5; }

/* Links inside small print are underlined so they read as links without colour. */
.t-small a { text-decoration: underline; text-underline-offset: 3px; }

/* ── 6. Footer contact ────────────────────────────────────────────────────── */
/* Filled from Admin → Landing Page Contact Details; the column is hidden while empty. */
@media (max-width: 1023px) {
  .closing__links .grid > .span-6, .footer > .wrap > .grid > .span-6 { grid-column: 1 / -1; }
  .footer .grid > .footer__col.span-3 { grid-column: auto / span 6; }
}
.footer__contact { display: grid; gap: var(--s-2); font-size: var(--t-small); }
.footer .socials a { display: grid; place-items: center; }
.footer .socials svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }

/* ── 7. Legal pages (Terms, Privacy) ──────────────────────────────────────── */
/* Long reading pages: one column of text beside a table of contents. They are not built from
   one-screen sections, so they take the kit's header, footer, type and tokens only. */
.legal { padding-block: calc(var(--nav) + var(--s-8)) var(--s-9); }
.legal__grid { display: grid; gap: var(--s-7); }
.legal-toc ol { display: grid; gap: var(--s-2); margin-top: var(--s-4); padding: 0; list-style: none; counter-reset: toc; }
.legal-toc li { counter-increment: toc; }
.legal-toc a { display: inline-flex; gap: var(--s-3); min-height: 32px; align-items: baseline; text-decoration: none; }
.legal-toc a::before { content: counter(toc, decimal-leading-zero); color: var(--muted); font-variant-numeric: tabular-nums; }
.legal-toc a:hover { text-decoration: underline; text-underline-offset: 3px; }
.prose { max-width: 68ch; }
.prose .updated { margin-top: var(--s-4); color: var(--muted); }
.prose .lede { margin-top: var(--s-5); font-size: var(--t-lead); line-height: 1.6; }
.prose h2 { margin-top: var(--s-8); scroll-margin-top: calc(var(--nav) + var(--s-5)); }
.prose h3 { margin-top: var(--s-6); }
.prose :is(p, ul, ol, table) { margin-top: var(--s-4); line-height: 1.7; }
.prose ul { padding-left: 1.25em; list-style: disc; }
.prose li + li { margin-top: var(--s-2); }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--t-small); }
.prose :is(th, td) { padding: var(--s-3) var(--s-4) var(--s-3) 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { font-weight: 400; color: var(--muted); }
.prose .table-wrap { overflow-x: auto; }
/* A detail only the company can supply. Marked so it cannot be missed before launch. */
.todo { padding: 0 .3em; background: var(--ink); color: var(--bg); font-weight: 400; white-space: nowrap; }
.prose [data-placeholder] { outline: none; }
.legal-note { margin-top: var(--s-6); padding: var(--s-4) var(--s-5); border: 1px solid var(--ink); }
@media (min-width: 1024px) {
  .legal__grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); column-gap: var(--gutter); }
  .legal-toc { position: sticky; top: calc(var(--nav) + var(--s-6)); align-self: start; }
}

/* ── 8. Entrance ──────────────────────────────────────────────────────────── */
/* The steps and the showcase pictures fade up once as they reach the screen (the small script before
   the kit's in index.html). Without it, with reduced motion or with motion off, they simply stand. */
html.rise-js [data-rise] { transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0ms); }
html.rise-js [data-rise]:not(.is-in) { opacity: 0; transform: translateY(18px); }
@media print { html.rise-js [data-rise] { opacity: 1 !important; transform: none !important; } }

/* ── 9. Chrome shared by every page: header, buttons, phone action bar, footer ── */
/* A warm, soft frame around the page: the header floats as an inset ivory bar, buttons are pills, and
   the shadows are long and faint. Still only Soft Ivory and Ink Black (and ivories of the same hue). */
:root {
  --iv-0: #fbf8f1;            /* lightest ivory: cards, the header, notes */
  --iv-3: #e9e1d1;            /* deepest ivory: rings and the stage behind a picture */
  --r-btn: 999px;
  --shadow-soft: 0 1px 2px rgba(20, 20, 20, .04), 0 18px 40px -26px rgba(20, 20, 20, .28);
  --shadow-lift: 0 2px 6px rgba(20, 20, 20, .05), 0 34px 64px -30px rgba(20, 20, 20, .36);
}
html[data-radius] { --r-btn: 999px; }
.btn:not(.btn--xl) { padding-inline: 28px calc(28px - var(--label-tracking) / 2); }

.nav { background: none; border-bottom: 0; pointer-events: none; }
.nav > .nav__bar {
  pointer-events: auto; position: relative; margin-top: 10px; height: calc(100% - 10px);
  width: min(100% - 24px, var(--container) + 48px); padding-inline: 24px 12px;
  background: var(--iv-0);
  border: 1px solid rgba(20, 20, 20, .06); border-radius: 999px; box-shadow: var(--shadow-soft);
}
@media (max-width: 1023px) {
  .nav > .nav__bar { padding-inline: 18px 8px; }
  .nav__toggle { border-color: rgba(20, 20, 20, .14); }
}
.nav.is-open > .nav__bar { background: var(--iv-0); }

@media (max-width: 639px) {
  .actionbar { background: none; border-top: 0; padding-inline: 16px; pointer-events: none; }
  .actionbar .btn { pointer-events: auto; box-shadow: 0 16px 34px -14px rgba(20, 20, 20, .55); }
}

.footer .grid > .footer__col.span-2 { grid-column: auto / span 2; }
@media (max-width: 1023px) {
  .footer .grid > .footer__col:is(.span-2, .span-3) { grid-column: auto / span 6; }
  .footer .grid > .span-4 { grid-column: 1 / -1; }
}
.footer__col button.linklike { all: unset; cursor: pointer; }
.footer__col button.linklike:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer__col button.linklike:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
/* On a phone the kit gives each footer link a 44px row; the occasion buttons take the same row, so the
   Occasions and Invitations columns keep one rhythm. */
@media (max-width: 639px) {
  .footer ul:has(> li > button.linklike) { gap: 0; }
  .footer__col button.linklike { display: inline-flex; align-items: center; min-height: 44px; }
}
