/* ==========================================================================
   Ali & Robert — gold on midnight, under string lights.

   Tokens below are taken verbatim from the design system's tokens.json.
   Rule of the system: one background, one ink, no exceptions. Every word is
   gold-invite on indigo-invite. Never text on a light ground.
   ========================================================================== */

/* Fonts are self-hosted rather than pulled from Google. Guests open this on
   venue wifi and hotel data; removing a third-party origin removes a point of
   failure and a round trip. IM Fell Double Pica is not included — it belongs
   to the seating list and banner, neither of which appear on this site. */
@import url("fonts.css");

:root {
  /* Colour — the only two that carry text */
  --indigo-invite: #0a0935;
  --gold-invite:   #f7e7a7;

  /* Artwork inks. Never text. */
  --gold-signage:  #f3e996;
  --gold-confetti: #e0b787;

  --surface:     var(--indigo-invite);
  --ink:         var(--gold-invite);
  --button-fill: var(--indigo-invite);
  --button-ink:  var(--gold-invite);
  --button-hover:var(--gold-invite);

  /* Type */
  --font-serif:    "Alice", Georgia, "Times New Roman", serif;
  --font-caps:     "Cardo", Georgia, serif;
  --font-script:   "Belina", "Cardo", Georgia, serif;
  --font-oldstyle: "IM Fell Double Pica", Georgia, serif;

  /* Spacing */
  --space-1:  8px;
  --space-2: 16px;
  --space-3: 32px;
  --space-4: 64px;

  /* Radius */
  --radius-none:   0;
  --radius-button: 4px;
  --radius-dot:    50%;
}

*, *::before, *::after { box-sizing: border-box; }

/* Author `display` rules (.btn, .lightbox) outrank the UA sheet's
   [hidden]{display:none}, so state it explicitly or hidden elements show. */
[hidden] { display: none !important; }

html { background: var(--surface); }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: 0.03em;
  text-align: center;
  -webkit-font-smoothing: antialiased;
  /* Confetti scatters in from the corners and must not spill a scrollbar. */
  overflow-x: hidden;
}

a { color: var(--ink); }

/* --- Page shell ---------------------------------------------------------- */

/* The garland used to hang in open space on a wide screen, with nothing for
   it to be strung between. The frame gives it two walls: it is clipped at the
   frame's edges, so it reads as strung across the room rather than floating. */
.frame {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  min-height: 100vh;
  overflow: hidden;
}

@media (min-width: 900px) {
  .frame {
    margin: var(--space-3) auto;
    min-height: calc(100vh - (var(--space-3) * 2));
    border: 1px solid rgba(247, 231, 167, 0.55);
  }
}

/* Laptop screens are wide but short. The garland's height follows the frame's
   width, so a narrower frame on a short screen keeps the upload button on the
   first screen without making a tall desktop feel cramped. */
@media (min-width: 900px) and (max-height: 820px) {
  .frame { max-width: 700px; }
  .divider { margin: var(--space-1) auto; }
  .masthead__barn { width: 96px; }
}

.wrap {
  position: relative;
  z-index: 2;
  max-width: 34rem;
  margin: 0 auto;
  padding: 0 var(--space-3) var(--space-4);
}

.wrap--wide { max-width: 72rem; }

/* String lights bleed off the top edge — the system's one source of glow.
   Kept in normal flow (rather than absolutely positioned) so the garland's
   own height pushes the names clear of it, with the space-4 drop the system
   asks for. Absolute positioning here overlapped the names on narrow phones. */
.lights {
  display: block;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  /* Slightly wider than the frame so its ends are cut off by the border,
     rather than stopping short and dangling in mid-air. */
  width: 112%;
  max-width: none;
  height: auto;
  margin-bottom: var(--space-2);
  pointer-events: none;
  z-index: 1;
}

/* Gold dot confetti, two opposite corners as the website does. Decoration
   only — it is kept clear of text by sitting behind the content layer. */
.confetti {
  position: absolute;
  width: var(--confetti-size, 320px);
  height: var(--confetti-size, 320px);
  /* The supplied SVG is already inked in gold-confetti, so it is used as-is
     rather than masked — one fewer thing to go wrong on an old browser. */
  background: url("brand/confetti-corner.svg") no-repeat 0 0 / 100% 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
}

.confetti.tl { top: 0; left: 0; }
.confetti.br { bottom: 0; right: 0; transform: scale(-1, -1); }

/* The pipe separator, the only glyph-like mark the system allows besides the
   ampersand and the d20. */
.bar { margin: 0 var(--space-1); }

/* --- Type ---------------------------------------------------------------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  text-align: left;
}

.masthead__barn {
  flex: 0 0 auto;
  width: clamp(76px, 13vw, 132px);
  height: auto;
}

.masthead__text > * + * { margin-top: var(--space-1); }

.names {
  font-family: var(--font-serif);
  /* One line, per Ali's direction. The invitation stacks the names with the
     ampersand on its own row; across reads better here and keeps the upload
     button on the first screen. */
  font-size: clamp(1.75rem, 6.2vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 400;
  margin: 0;
  white-space: nowrap;
}

.names .amp { font-size: 0.78em; }

.lead {
  font-size: clamp(1rem, 4vw, 1.25rem);
  letter-spacing: 0.02em;
  margin: 0;
}

.title {
  font-size: clamp(1.5rem, 6vw, 2.125rem);
  letter-spacing: 0.03em;
  font-weight: 400;
  margin: 0;
}

.dateline {
  font-size: clamp(1.125rem, 5vw, 1.5rem);
  letter-spacing: 0.12em;
  display: inline-flex;
  gap: var(--space-2);
  align-items: center;
  margin: 0;
}

.label {
  font-size: clamp(0.875rem, 3.5vw, 1.25rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
}

.body { font-size: 17px; line-height: 1.5; letter-spacing: 0.03em; margin: 0; }

.caps-spaced {
  font-family: var(--font-caps);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0;
}

/* --- Ornament ------------------------------------------------------------ */

/* One scroll flourish per section; never stack two. */
.divider {
  display: block;
  margin: var(--space-2) auto;
  width: min(200px, 52%);
  height: auto;
}

.stack   > * + * { margin-top: var(--space-2); }
.blocks  > * + * { margin-top: var(--space-3); }

/* --- Buttons ------------------------------------------------------------- */

.btn {
  display: inline-block;
  width: 100%;
  max-width: 22rem;
  min-height: 52px;               /* comfortably tappable, one-handed */
  padding: 14px 24px;
  background: var(--button-fill);
  color: var(--button-ink);
  border: 1px solid var(--button-ink);
  border-radius: var(--radius-button);
  font: 400 18px/1.2 var(--font-serif);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

/* Hover styles are gated on a real pointer. On a touchscreen :hover sticks
   after a tap, which would leave a button looking stuck in its inverted
   state until you tapped elsewhere. */
@media (hover: hover) {
  .btn:hover { background: var(--button-hover); color: var(--indigo-invite); }
  .btn[disabled]:hover { background: var(--button-fill); color: var(--button-ink); }
}
.btn:focus-visible { outline: 2px solid var(--gold-invite); outline-offset: 3px; }
.btn[disabled] { opacity: 0.4; cursor: default; }

.btn--spaced { margin-top: var(--space-3); }

.btn--small {
  width: auto;
  min-height: 0;
  padding: 9px 16px;
  font-size: 15px;
}

.btn--danger { border-color: var(--gold-confetti); color: var(--gold-confetti); }
@media (hover: hover) {
  .btn--danger:hover { background: var(--gold-confetti); color: var(--indigo-invite); }
}

.linkrow {
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* --- Form ---------------------------------------------------------------- */

/* Cards are square-cornered and unbordered per the system; inputs carry the
   same 1px gold rule the button does, so they read as one family. */
.card { border-radius: var(--radius-none); }

.field { text-align: left; }

.field label {
  display: block;
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--font-caps);
  margin-bottom: var(--space-1);
}

.field input[type=text],
.field input[type=password],
.field textarea {
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(247, 231, 167, 0.45);
  border-radius: var(--radius-button);
  font: 400 17px/1.5 var(--font-serif);
  letter-spacing: 0.03em;
}

.field textarea { resize: vertical; min-height: 76px; }

.field input::placeholder,
.field textarea::placeholder { color: rgba(247, 231, 167, 0.45); }

.field input:focus, .field textarea:focus {
  outline: 2px solid var(--gold-invite);
  outline-offset: 2px;
  border-color: var(--gold-invite);
}

/* --- Upload queue -------------------------------------------------------- */

.up-list { list-style: none; margin: var(--space-3) 0 0; padding: 0; text-align: left; }

.up-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px var(--space-2);
  padding: 12px 0;
  border-top: 1px solid rgba(247, 231, 167, 0.25);
  font-size: 15px;
}

.up-item__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.up-item__meta {
  font-family: var(--font-caps);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.up-item__bar {
  grid-column: 1 / -1;
  height: 2px;
  background: rgba(247, 231, 167, 0.25);
  overflow: hidden;
}

.up-item__bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold-invite);
  transition: width 0.25s ease;
}

.up-item.is-error .up-item__meta { color: var(--gold-confetti); }

.status {
  margin-top: var(--space-3);
  font-size: 15px;
  letter-spacing: 0.04em;
  min-height: 1.5em;
}

.status[data-tone=error] { color: var(--gold-confetti); }

.help {
  margin-top: var(--space-3);
  font-size: 14px;
  line-height: 1.6;
  opacity: 0.8;
}

/* --- Gallery ------------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-3);
  text-align: left;
}

.tile {
  /* A <button> does not size to its content reliably when a child uses
     aspect-ratio — the frame filled the whole button and pushed the caption
     out into the grid gap. Flex column forces correct intrinsic sizing. */
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  padding: 0;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tile__frame {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-none);   /* square corners, per the system */
  overflow: hidden;
  background: rgba(247, 231, 167, 0.08);
}

.tile__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* The uploader's name sits BELOW the picture on indigo, never over the photo:
   the system forbids text on a light ground, and a snapshot is a light ground. */
.tile__from {
  display: block;
  margin-top: var(--space-1);
  font-family: var(--font-caps);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Video marker: a gold rule on an indigo disc, so it stays gold-on-indigo
   even sitting on top of a photograph. No icon set is used. */
.tile__play {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px;
  border: 1px solid var(--gold-invite);
  border-radius: var(--radius-dot);
  background: rgba(10, 9, 53, 0.72);
  pointer-events: none;
}

.tile__play::after {
  content: "";
  position: absolute;
  left: 52%; top: 50%;
  transform: translate(-50%, -50%);
  border-left: 12px solid var(--gold-invite);
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
}

.tile:focus-visible .tile__frame { outline: 2px solid var(--gold-invite); outline-offset: 2px; }

.empty {
  padding: var(--space-4) 0;
  font-size: 17px;
  opacity: 0.85;
}

/* --- Lightbox ------------------------------------------------------------ */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 9, 53, 0.97);
  display: grid;
  place-items: center;
  padding: var(--space-3);
  z-index: 50;
}

.lightbox[hidden] { display: none; }

.lightbox img, .lightbox video {
  max-width: 100%;
  max-height: 82vh;
  border-radius: var(--radius-none);
}

.lightbox__close {
  position: absolute;
  top: var(--space-2); right: var(--space-2);
  min-width: 44px; min-height: 44px;
  background: transparent;
  color: var(--gold-invite);
  border: 1px solid var(--gold-invite);
  border-radius: var(--radius-button);
  font: 400 14px/1 var(--font-caps);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

@media (hover: hover) {
  .lightbox__close:hover { background: var(--gold-invite); color: var(--indigo-invite); }
}

/* --- Admin --------------------------------------------------------------- */

.admin-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  align-items: center;
  justify-content: center;
  margin: var(--space-3) 0;
  padding-top: var(--space-2);
  border-top: 1px solid rgba(247, 231, 167, 0.25);
}

.admin-bar__count {
  margin-right: auto;
  font-family: var(--font-caps);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tile--selectable.is-selected .tile__frame {
  outline: 2px solid var(--gold-invite);
  outline-offset: -2px;
}

.tile--selectable.is-selected .tile__frame img { opacity: 0.55; }

/* Selection is shown with a gold dot, not a tick glyph — the system has no
   icon set. */
.tile__tick {
  position: absolute;
  top: var(--space-1); left: var(--space-1);
  width: 14px; height: 14px;
  border-radius: var(--radius-dot);
  background: var(--gold-invite);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  justify-content: center;
  margin-top: var(--space-3);
}

.tabs a {
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  text-decoration: none;
  font-family: var(--font-caps);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tabs a[aria-current=page] {
  border-color: var(--gold-invite);
}

/* --- Responsive & motion ------------------------------------------------- */

@media (max-width: 480px) {
  .wrap { padding: 0 var(--space-2) var(--space-4); }
  .confetti { --confetti-size: 170px; }
  .lights { width: 128%; margin-bottom: var(--space-2); }
  .masthead { gap: var(--space-2); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
