/* Nyår på Madeira: the paper.
   This file sets the whole static look: colours, letters, cards, forms, buttons, lists,
   photo rows and the cover page before an invite link is opened. It also defines the
   glazed tile (.tile) that the lively parts put on their own elements.
   The parts with a life of their own live in parts.css instead, and are never styled here:
   the countdown, the bottom bar with the three pages, the day plan and its date strip,
   the boarding pass, the people circles, the enlarged photo and the sunburst.
   The look is described in DESIGN.md; every colour is a named value just below. */

/* ── Colours and sizes ─────────────────────────────────────────────────────── */

:root {
  --paper: #f6f3ea;        /* warm cream page */
  --card: #fffdf8;
  --ink: #1b1e1c;
  --muted: #5c635d;
  --line: #e4dfd1;
  --accent: #1f5b46;       /* the green kitchen tiles */
  --accent-ink: #ffffff;
  --accent-soft: #e3efe8;
  --gold: #8a6718;         /* gold text */
  --gold-bright: #c8a13f;  /* gold ornament */
  --terra: #b5532f;
  --good: #1d7148;
  --bad: #b03e2a;
  --tile: #fffefa;         /* a tile's face */
  --tile-ink: #1f5b46;     /* numbers and frame on a tile */
  --tabs-h: 64px;          /* the bottom bar's height (parts.css makes the bar this tall) */

  /* Our own additions */
  --tile-low: #f3eee0;     /* the bottom of a tile's face, a shade warmer than the top */
  --tile-drop: 0 1px 1px rgba(70, 55, 20, .10), 0 6px 14px -6px rgba(70, 55, 20, .28);
  --tile-drop-small: 0 1px 2px rgba(70, 55, 20, .14); /* the lighter shadow of a small tile */
  --field: #faf8f1;        /* the inside of a form field, a touch darker than the card */
  --field-line: #d8d1bf;   /* a field's border: clearer than a hairline, still quiet */
  --ring: rgba(31, 91, 70, .28);   /* the soft glow around a focused field */
  --print: #fffdf8;        /* the white edge round the terrace photo, like a printed photo */
  --good-soft: rgba(29, 113, 72, .10);
  --bad-soft: rgba(176, 62, 42, .09);
  --glow: rgba(200, 161, 63, .13); /* the faint warm light at the top of the page */
  /* The page's top light as one layer, shared by the body and its night moments below. */
  --glow-layer: radial-gradient(1100px 520px at 50% -140px, var(--glow), transparent 72%) no-repeat;
  /* The paper as it looks under the fireworks' dark veil: 85% of rgb(6, 12, 11) over --paper.
     Work it out again if --paper or VEIL_RGB / VEIL_LIGHT / VEIL_DARK at the top of fx.js change.
     A plain value on purpose: an old browser that does not know color-mix() would drop the whole background. */
  --night-paper: #2a2f2c;
  /* How fast that colour falls and lifts: must follow VEIL_IN_S and VEIL_OUT_S at the top of fx.js. */
  --night-in: .5s;
  --night-out: 1s;
  --shadow: 0 1px 2px rgba(60, 48, 20, .04), 0 10px 28px -16px rgba(60, 48, 20, .16);
  --shadow-photo: 0 1px 2px rgba(40, 30, 10, .08), 0 16px 34px -16px rgba(40, 30, 10, .40);
  /* The main button: a glazed green tile, lighter along the top, darker at the bottom. */
  --btn-top: #2b6e56;
  --btn-mid: #1f5b46;
  --btn-low: #194b3a;
  --btn-edge: #17463a;
  --btn-glow: 0 2px 6px -2px rgba(31, 91, 70, .55);
  --r-card: 18px;
  --r: 12px;               /* buttons, fields, photos */
  --serif: "Didot", "Bodoni 72", "Bodoni MT", "Hoefler Text", Georgia, "Noto Serif", serif;
  --sans: "Avenir Next", "Avenir", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  /* A small grey arrow for the day lists: grey enough to read on both light and dark fields. */
  --chevron: 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.2 1.5 6 6.3l4.8-4.8' fill='none' stroke='%23878f88' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1412;      /* bottle-green night */
    --night-paper: #080e0d; /* 70% of rgb(6, 12, 11) over the dark --paper (see the light value) */
    --card: #151e1b;
    --ink: #eef1ec;
    --muted: #a4aea7;
    --line: #27342f;
    --accent: #6cc09c;
    --accent-ink: #08110e;
    --accent-soft: #17302a;
    --gold: #dcb968;
    --gold-bright: #e8c977;
    --terra: #e58a66;
    --good: #6fcf98;
    --bad: #f08a74;
    --tile: #f3efe2;       /* stays light: glazed ceramic catching the light */
    --tile-ink: #1f5b46;

    --tile-low: #ddd5c1;   /* darker at the bottom, so the light face does not glare at night */
    --tile-drop: 0 1px 1px rgba(0, 0, 0, .35), 0 8px 18px -8px rgba(0, 0, 0, .7);
    --tile-drop-small: 0 1px 3px rgba(0, 0, 0, .5);
    --field: #101916;
    --field-line: #34443e;
    --ring: rgba(108, 192, 156, .32);
    --print: #d4cdb9;      /* the photo's edge, dimmed so it does not shine at night */
    --good-soft: rgba(111, 207, 152, .12);
    --bad-soft: rgba(240, 138, 116, .12);
    --glow: rgba(108, 192, 156, .07);
    /* A shadow hardly shows on a dark page: the border and the lighter card do the work. */
    --shadow: 0 1px 0 rgba(255, 255, 255, .025) inset, 0 12px 30px -20px rgba(0, 0, 0, .8);
    --shadow-photo: 0 18px 36px -18px rgba(0, 0, 0, .85);
    --btn-top: #84d2ae;
    --btn-mid: #6cc09c;
    --btn-low: #5aac88;
    --btn-edge: #57a684;
    --btn-glow: 0 2px 8px -3px rgba(0, 0, 0, .6);
  }
}

/* ── The page ──────────────────────────────────────────────────────────────── */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body {
  margin: 0;
  /* a faint warm light falling on the top of the page (green-ish at night), over the paper.
     The paper is painted as a full layer, so the colour underneath is seen only by Safari
     on iPhone (see "Safari's own strip" further down). */
  background: var(--glow-layer), linear-gradient(var(--paper), var(--paper)), var(--paper);
  transition: background-color var(--night-out) ease-in-out; /* night lifting */
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: calc(var(--tabs-h) + 24px + env(safe-area-inset-bottom)); /* room for the bottom bar */
}
main {
  max-width: calc(820px + 32px); margin: 0 auto; padding: 24px 16px 32px;
  /* a phone held sideways: keep clear of the notch */
  padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right));
}
@media (min-width: 600px) { main { padding-top: 40px; } }

::selection { background: rgba(200, 161, 63, .32); color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a, button, summary, .btn { -webkit-tap-highlight-color: transparent; }

/* ── Letters ───────────────────────────────────────────────────────────────── */

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; scroll-margin-top: 16px; }
h2 {
  font-family: var(--serif); font-weight: 400; font-size: 1.5rem; letter-spacing: -.005em;
  line-height: 1.15; text-wrap: balance;
}
h3 { font-size: 1rem; font-weight: 600; margin-top: 1.2em; }
p { margin: 0 0 .75em; }
a {
  color: var(--accent);
  text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  transition: color .15s ease, text-decoration-color .15s ease;
}
@media (hover: hover) { a:hover { text-decoration-color: currentColor; } }
.pre { white-space: pre-line; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 5px 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The small gold label over a title ("ÅR 0") */
.kicker {
  font-family: var(--sans); font-size: .72rem; font-weight: 700; letter-spacing: .22em;
  text-transform: uppercase; color: var(--gold); margin: 0 0 10px;
}
/* The big italic page title */
.title {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(2.6rem, 10.5vw, 4.6rem); letter-spacing: -.02em; line-height: .98;
  margin: 0 0 14px; text-wrap: balance;
}
.meta { color: var(--muted); margin: 0 0 22px; text-wrap: pretty; }
.page-head { padding: 8px 0 6px; }
.page-head .meta { max-width: 36em; }

/* ── Cards ─────────────────────────────────────────────────────────────────── */

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 20px; margin: 16px 0;
}
@media (min-width: 600px) { .card { padding: 24px; margin: 20px 0; } }
.card > h2:first-child { margin-top: -2px; }

/* The intro on the first page reads like the opening of a letter: a little larger, in the serif,
   under a short gold line. (The two paragraphs share one element, so they cannot differ.) */
.card.intro { padding-top: 24px; padding-bottom: 22px; }
.card.intro::before {
  content: ""; display: block; width: 36px; height: 2px; border-radius: 2px;
  background: var(--gold-bright); margin: 0 0 16px;
}
.card.intro p {
  font-family: var(--serif); font-size: 1.1rem; line-height: 1.55; margin: 0;
  text-wrap: pretty;
}
@media (min-width: 600px) { .card.intro { padding: 30px 32px 28px; } .card.intro p { font-size: 1.28rem; line-height: 1.6; } }

/* ── The glazed tile (shared: parts.css puts it on countdown numbers, dates and more) ──
   A light ceramic face with a shine from the top-left and a thin double frame: a line,
   a gap in the face colour, then a fainter line. It sets no size, spacing or letter size. */
.tile {
  color: var(--tile-ink);
  background:
    radial-gradient(120% 85% at 15% 0%, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 55%),
    linear-gradient(165deg, var(--tile) 40%, var(--tile-low));
  border-radius: 12px;
  box-shadow:
    inset 0 0 0 1.5px var(--tile-ink),         /* the outer line */
    inset 0 0 0 4px var(--tile),               /* the gap */
    inset 0 0 0 5px rgba(31, 91, 70, .32),     /* the second, fainter line */
    var(--tile-drop);
}
/* New Year's Eve: the same tile, framed in gold */
.tile.gold {
  box-shadow:
    inset 0 0 0 1.5px #8a6718,
    inset 0 0 0 4px var(--tile),
    inset 0 0 0 5px rgba(138, 103, 24, .45),
    var(--tile-drop);
}
/* Today: filled with the tile green, light letters */
.tile.on {
  color: #ffffff;
  background:
    radial-gradient(120% 85% at 15% 0%, rgba(255, 255, 255, .20), rgba(255, 255, 255, 0) 55%),
    linear-gradient(165deg, #246a52 30%, #1a4e3c);
  box-shadow:
    inset 0 0 0 1.5px #143d2f,
    inset 0 0 0 4px #1f5b46,
    inset 0 0 0 5px rgba(255, 255, 255, .38),
    var(--tile-drop);
}
/* Today and New Year's Eve at once: green, with the inner line in gold */
.tile.on.gold {
  box-shadow:
    inset 0 0 0 1.5px #143d2f,
    inset 0 0 0 4px #1f5b46,
    inset 0 0 0 5px #e8c977,
    var(--tile-drop);
}

/* Small tiles (the date strip, about 40px wide): one thin line, a small gap, a barely-there
   second line and a lighter shadow, or the double frame reads as a heavy dark ring. */
.tile.small {
  border-radius: 9px;
  box-shadow:
    inset 0 0 0 1px var(--tile-ink),
    inset 0 0 0 3px var(--tile),
    inset 0 0 0 3.5px rgba(31, 91, 70, .14),
    var(--tile-drop-small);
}
.tile.small.gold {
  box-shadow:
    inset 0 0 0 1px #8a6718,
    inset 0 0 0 3px var(--tile),
    inset 0 0 0 3.5px rgba(138, 103, 24, .22),
    var(--tile-drop-small);
}
.tile.small.on {
  box-shadow:
    inset 0 0 0 1px #143d2f,
    inset 0 0 0 3px #1f5b46,
    inset 0 0 0 3.5px rgba(255, 255, 255, .22),
    var(--tile-drop-small);
}
.tile.small.on.gold {
  box-shadow:
    inset 0 0 0 1px #143d2f,
    inset 0 0 0 3px #1f5b46,
    inset 0 0 0 3.5px rgba(232, 201, 119, .8),
    var(--tile-drop-small);
}
/* ── Top of the first page ─────────────────────────────────────────────────── */

.hero { display: grid; gap: 28px; align-items: center; padding: 8px 0 4px; }
@media (min-width: 760px) { .hero { grid-template-columns: 1.1fr 1fr; gap: 40px; } }
/* The terrace photo as a print: a thin cream edge and a soft shadow. */
.hero-photo {
  position: relative; margin: 0; overflow: hidden;
  aspect-ratio: 4 / 3; background: var(--line);
  border: 6px solid var(--print); border-radius: 16px;
  box-shadow: var(--shadow-photo);
}
@media (min-width: 760px) { .hero-photo { transform: rotate(1deg); } } /* tilted a little, wide screens only */
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 10px; }

/* The labels on photos ("Välkommen Anna", "Huset i 3D"). Paper, so light in dark mode too.
   Their spacing, letter sizes, place and breakpoints are measured: see rule 7 in DESIGN.md. */
.chip {
  position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column;
  background: rgba(255, 253, 248, .94); color: #1b1e1c; border-radius: 12px; padding: 6px 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 6px 16px -6px rgba(0, 0, 0, .25);
}
.chip-k { font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: #8a6718; font-weight: 600; }
.chip-v { font-family: var(--serif); font-style: italic; font-size: 1.15rem; }

/* ── Forms ─────────────────────────────────────────────────────────────────── */

.field { display: flex; flex-direction: column; gap: 7px; margin: 0 0 16px; min-width: 0; }
.label { font-weight: 600; font-size: .92rem; }
.hint { color: var(--muted); font-size: .85rem; }
input[type=text], input[type=date], input[type=time], select, textarea {
  font: inherit; font-size: 16px; /* 16px or more, or the iPhone zooms in on tap */
  color: inherit; background-color: var(--field);
  border: 1px solid var(--field-line); border-radius: var(--r);
  padding: 12px 14px; width: 100%; min-height: 48px; min-width: 0;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
textarea { resize: vertical; line-height: 1.5; min-height: 76px; }
::placeholder { color: var(--muted); opacity: 1; font-style: italic; }
select {
  -webkit-appearance: none; appearance: none;
  background-image: var(--chevron); background-repeat: no-repeat;
  background-position: right 16px center; background-size: 12px 8px;
  padding-right: 42px; /* room for the arrow */
  cursor: pointer;
}
@media (hover: hover) {
  input[type=text]:hover, input[type=date]:hover, input[type=time]:hover, select:hover, textarea:hover {
    border-color: color-mix(in srgb, var(--accent) 40%, var(--field-line));
  }
}
input[type=text]:focus, input[type=date]:focus, input[type=time]:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring);
  background-color: var(--card);
}
fieldset { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.row2, .row3 { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 560px) {
  .row2 { grid-template-columns: 1fr 1fr; }
  .row3 { grid-template-columns: 1fr 1fr 1fr; }
}
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-right: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.checks { display: flex; flex-wrap: wrap; }
.hint.fine { margin: -4px 0 18px; }
.copy-travel { margin: 0 0 16px; }
.tiny-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.actions:last-child { margin-bottom: 0; }

/* "Sparar…" and "Senast sparat …" are quiet; "Sparat ✓ Tack!" (.ok) is a small green pill that
   pops in once; an error (.bad) is a red pill. The text is there whether or not the pop runs. */
.status { color: var(--muted); font-size: .875rem; }
.status.ok, .status.bad { display: inline-block; font-weight: 600; border-radius: 999px; padding: 4px 11px; }
.status.ok { color: var(--good); background: var(--good-soft); animation: status-pop .26s cubic-bezier(.2, .9, .3, 1.4); }
.status.bad { color: var(--bad); background: var(--bad-soft); }
@keyframes status-pop { from { transform: scale(.85); } to { transform: scale(1); } }

/* ── Buttons ───────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; line-height: 1.2; cursor: pointer; text-align: center;
  border: 1px solid var(--field-line); background: var(--card); color: var(--ink);
  border-radius: var(--r); padding: 10px 18px; min-height: 44px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .03);
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .12s ease, filter .15s ease;
}
@media (hover: hover) { .btn:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--field-line)); } }
.btn:active { transform: translateY(1px); }
/* The main button: a glazed green tile */
.btn.primary {
  background: linear-gradient(180deg, var(--btn-top), var(--btn-mid) 55%, var(--btn-low));
  border-color: var(--btn-edge); color: var(--accent-ink);
  padding: 10px 24px; min-width: 112px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), inset 0 -2px 0 rgba(0, 0, 0, .10), var(--btn-glow);
}
@media (hover: hover) { .btn.primary:hover { filter: brightness(1.07); border-color: var(--btn-edge); } }
.btn.primary:active { box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18); filter: none; }
.btn.small { min-height: 44px; padding: 6px 14px; font-size: .875rem; border-radius: 10px; } /* smaller letters, full-size tap area */
.btn.quiet { color: var(--muted); background: transparent; box-shadow: none; }
.btn:disabled { opacity: .55; cursor: default; transform: none; filter: none; }
a.btn { text-decoration: none; }
.link {
  background: none; border: 0; color: var(--accent); font: inherit; padding: 4px 2px; cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; border-radius: 4px;
}
.link.small { font-size: .875rem; font-weight: 600; }
/* A link-style button gets a 44px tall tap area; the negative margin keeps it from making
   the line of text it sits in any taller. */
button.link {
  display: inline-flex; align-items: center; min-height: 44px; margin-block: -10px;
  padding: 0 4px; vertical-align: middle;
}

/* ── Fold-outs: "Bra att veta" and the hosts' boxes ────────────────────────── */

details > summary {
  cursor: pointer; font-weight: 600; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 44px; border-radius: 8px;
}
details > summary::-webkit-details-marker { display: none; }
/* a small arrow on the right that turns when open */
details > summary::after {
  content: ""; flex: none; width: 8px; height: 8px; margin: 0 6px 0 0;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
  transition: transform .18s ease;
}
details[open] > summary::after { transform: translateY(2px) rotate(225deg); }
details.card > summary { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; }
details.card[open] > summary, details.admin[open] > summary { margin-bottom: 12px; }
.faq h2 { margin-bottom: 8px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:first-of-type { border-top: 0; }
.faq summary { padding: 10px 0; line-height: 1.35; }
.faq details p { margin: 0 0 14px; color: var(--muted); max-width: 40em; }
.faq details:last-child p { margin-bottom: 4px; }
.admin { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 6px; }

/* ── Lists ─────────────────────────────────────────────────────────────────── */

.rows { list-style: none; margin: 0; padding: 0; }
.row {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.row:first-child { border-top: 0; }
.row-main { display: flex; flex-direction: column; min-width: 0; }
.row-side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.row-main { flex: 1 1 auto; }
.row-main > b { display: block; text-wrap: balance; } /* "Sovrummet på / våning 0", not a lone "0" */
.room-who { text-align: right; flex: 0 1 38%; } /* names wrap before the room's name does */
/* Your own room: a soft green band, rounded, set in a little from the card's edge */
.mine { margin-bottom: 14px; }
.mine-row {
  background: var(--accent-soft); border-radius: var(--r); border-top-color: transparent;
  padding: 12px 14px; margin: 2px -6px;
}
.mine-row + .row { border-top-color: transparent; }
.mine-row .row-main b, .mine-row .room-who { color: var(--accent); }
.amount { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

/* ── Small pieces inside a day and elsewhere ───────────────────────────────── */

/* "kl 20" beside a title */
.time {
  display: inline-block; margin-left: 8px; font-family: var(--sans); font-style: normal; font-weight: 700;
  font-size: .74rem; letter-spacing: .03em; line-height: 1.5; color: var(--accent);
  background: var(--accent-soft); border-radius: 999px; padding: 1px 9px;
  vertical-align: 3px; white-space: nowrap;
}
.dress { font-size: .92rem; margin: 8px 0 0; }
/* "KLÄDSEL" */
.tag {
  display: inline-block; font-size: .64rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid currentColor; color: var(--gold); border-radius: 6px; padding: 1px 7px; vertical-align: 1px;
}
/* A line with an emoji in a 22px left margin */
.extra { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 4px; margin-top: 10px; font-size: .92rem; }
.extra p { margin: 0; }
.extra .ico { line-height: 1.55; }
.place { font-size: .92rem; margin: 2px 0 6px; }
.house-link { margin: 16px 0 0; }
.links li { padding: 6px 0; }
.tips-list { list-style: none; padding: 0; margin: 0; }
.tips-list li { padding: 14px 0; border-top: 1px solid var(--line); }
.tips-list li:first-child { border-top: 0; padding-top: 0; }
.tips-list p { margin: 4px 0 0; }

/* "Bra att ha" on Huset: address, door code, Wi-Fi, numbers, getting here */
.practical .extra { margin-top: 16px; font-size: .95rem; }
.practical h2 + .extra { margin-top: 8px; }
.practical .row-label { margin: 0 0 2px; }
.secret {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 600; letter-spacing: .04em;
  overflow-wrap: anywhere; background: var(--field); border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 6px;
}
.tel { white-space: nowrap; }
.host-note { margin: 18px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }

/* ── The 3D house ──────────────────────────────────────────────────────────── */

.model-link { margin: 12px 0 0; }
/* #eeeade is the model's own background, so the picture and the live model meet without a seam. */
.model3d .model-shot {
  display: block; margin: 6px 0 14px; border-radius: var(--r); overflow: hidden;
  border: 1px solid var(--line); background: #eeeade;
  transition: transform .18s ease, box-shadow .18s ease;
}
.model3d .model-shot img { display: block; width: 100%; height: auto; max-height: 360px; object-fit: contain; background: #eeeade; }
@media (hover: hover) { .model3d .model-shot:hover { transform: translateY(-2px); box-shadow: var(--shadow-photo); } }
.model3d .actions { margin-bottom: 0; }

/* The small turning house on the first page. Measured: only colours and corners may change here
   (rule 7 in DESIGN.md). */
.mini-card { padding: 0; overflow: hidden; border-radius: var(--r-card); }
.mini-house { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 320px; background: #eeeade; }
.mini-house img, .mini-house iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
/* The picture's house is as big as the 3D house when it appears (19% to 77% of the height), so the swap doesn't jump. */
.mini-house img { top: 16%; height: 64%; object-fit: contain; transition: opacity .8s ease; }
.mini-house iframe { opacity: 0; pointer-events: none; transition: opacity .8s ease; }
.mini-house.live iframe { opacity: 1; }
.mini-house.live img { opacity: 0; }
.mini-chip { top: auto; right: auto; left: 12px; bottom: 12px; pointer-events: none; }
@media (max-width: 560px) { /* one short line, so it sits under the house instead of over it */
  .mini-chip { left: 8px; bottom: 8px; padding: 3px 10px; }
  .mini-chip .chip-k { display: none; }
  .mini-chip .chip-v { font-size: .95rem; }
}
@media (max-width: 400px) { /* narrow phones: a little smaller and further into the corner, or the turning house runs under it */
  .mini-chip { left: 6px; bottom: 6px; padding: 2px 8px; }
  .mini-chip .chip-v { font-size: .85rem; }
}
.mini-link { position: absolute; inset: 0; }
.mini-link:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; border-radius: var(--r-card); }

/* ── Photos and drawings ───────────────────────────────────────────────────── */

.gallery { margin-top: 28px; }
.gallery .group { margin: 28px 0; }
/* group headings: calmer than a card's heading */
.gallery h2 { font-style: italic; font-size: 1.3rem; margin-bottom: 12px; }
/* A row of photos you swipe through; each stops at the left edge. The scrollbar is hidden,
   but the row still scrolls by touch and trackpad. On phones it runs to the screen's edges. */
.strip {
  display: flex; gap: 10px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  padding: 2px 0 10px; scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }
.gallery .strip { margin: 0 -16px; padding-left: 16px; padding-right: 16px; scroll-padding: 0 16px; }
.card .strip { margin: 0 -20px; padding-left: 20px; padding-right: 20px; scroll-padding: 0 20px; }
@media (min-width: 600px) { .card .strip { margin: 0 -24px; padding-left: 24px; padding-right: 24px; scroll-padding: 0 24px; } }
@media (min-width: 852px) { .gallery .strip { margin: 0; padding-left: 0; padding-right: 0; scroll-padding: 0; } }
.shot {
  flex: none; padding: 0; border: 0; background: var(--line); border-radius: var(--r); overflow: hidden;
  cursor: zoom-in; scroll-snap-align: start;
  box-shadow: 0 1px 2px rgba(40, 30, 10, .08), 0 6px 14px -8px rgba(40, 30, 10, .3);
  transition: transform .18s ease, box-shadow .18s ease;
}
.shot img { display: block; height: 200px; width: auto; }
@media (hover: hover) {
  .shot:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(40, 30, 10, .1), 0 12px 22px -10px rgba(40, 30, 10, .4); }
}
.shot:active { transform: scale(.985); }
.drawing { padding: 14px; }
.drawing figcaption, .plan figcaption { margin-top: 8px; text-align: center; }
.plan { flex: none; width: 200px; margin: 0; scroll-snap-align: start; }
@media (min-width: 760px) { .plan { width: 240px; } }
/* Drawings stay on white, also at night */
.zoomable {
  display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; background: #fff; cursor: zoom-in;
  transition: transform .18s ease, box-shadow .18s ease;
}
.zoomable img { display: block; width: 100%; height: auto; }
/* Keyboard focus on a photo or drawing: the ring is drawn just inside its edge, so a scrolling row cannot cut it off. */
.shot:focus-visible, .zoomable:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
@media (hover: hover) { .zoomable:hover { box-shadow: var(--shadow-photo); } }

/* ── The hosts' boxes (answers, invite links, rooms) ───────────────────────── */

.answer { border-top: 1px solid var(--line); padding: 14px 0; }
.answer:last-child { padding-bottom: 0; }
.answer-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 10px 0 0; font-size: .95rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.link-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.link-row:last-child { padding-bottom: 0; }
.link-row code {
  grid-column: 1; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .78rem;
  color: var(--muted); word-break: break-all;
}
.link-row .btn { grid-row: 1 / span 2; grid-column: 2; }
.place-grid { display: grid; gap: 10px 18px; grid-template-columns: 1fr; margin-bottom: 14px; }
@media (min-width: 560px) { .place-grid { grid-template-columns: 1fr 1fr; } }
/* The name sits above its list of rooms, so the list gets the full width and the floor number
   ("Sovrummet på våning 2") is never cut off. */
.place-row { display: grid; grid-template-columns: 1fr; gap: 4px; font-size: .95rem; }
.place-row > span { font-weight: 600; }

/* ── Costs (switched off for now; kept so it looks right when it returns) ──── */

.summary .big { font-family: var(--serif); font-size: 1.6rem; font-weight: 400; margin: 0 0 4px; }
.seg {
  display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.seg button {
  font: inherit; font-weight: 600; border: 0; background: none; color: var(--muted);
  padding: 8px 14px; border-radius: 10px; min-height: 40px; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* ── Foot of the page ──────────────────────────────────────────────────────── */

.foot { text-align: center; margin: 16px 0 0; } /* sits close under the small gold sun above it, as one sign-off */

/* ── Safari's own strip on iPhone during the fireworks ────────────────────────
   On iPhone (iOS 26 and later) Safari has a strip of its own above the page, behind the clock.
   It gives that strip the body's background colour, live, even where something covers the
   colour completely. So the body's colour is kept for Safari alone (the paper is painted as a
   layer over it, above) and turns to night, fading with the fireworks' veil, while fx.js has
   data-fx-night on <html>. Nothing on the page itself changes.
   The strip below the page, behind the address bar, keeps the colour the page had when it was
   loaded and cannot be changed while the page is open (tried four ways and filmed, 11 Nov 2026,
   simulator, iOS 26.5), so it stays cream. With the enlarged photo open, Safari takes the top
   strip from the photo viewer's own dark layer by itself, so that needs nothing here.
   The cover (body.locked) keeps its own colour under the coast photo. */
html[data-fx-night] body:not(.locked) {
  background-color: var(--night-paper);
  transition-duration: var(--night-in); /* night falling */
}

/* ── The cover, before the invite link has been opened ─────────────────────── */

body.locked {
  padding-bottom: 0;
  transition: none; /* the cover's colour never fades */
  /* the coast photo, darkened towards the bottom where the panel sits */
  background:
    linear-gradient(to top, rgba(4, 12, 10, .55), rgba(4, 12, 10, 0) 60%),
    #0d1a22 url("/kusten.jpg") center / cover no-repeat;
  min-height: 100vh; min-height: 100svh;
  color-scheme: dark;
}
body.locked main { min-height: 100vh; min-height: 100svh; display: grid; align-items: end; }
/* Frosted glass over the photo. The fill alone is dark enough for white text where blur is missing. */
.locked-card {
  background: rgba(8, 18, 15, .62); color: #fff;
  border: 1px solid rgba(255, 255, 255, .20); border-radius: 22px;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .10);
  padding: 24px; max-width: 620px;
  margin-bottom: calc(24px + env(safe-area-inset-bottom));
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .locked-card {
    background: rgba(8, 18, 15, .42);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    backdrop-filter: blur(20px) saturate(140%);
  }
}
@media (min-width: 600px) { .locked-card { padding: 32px; margin-bottom: 48px; } }
.locked-card .kicker { color: #e8c977; }
.locked-card .title { color: #fff; }
.locked-card .meta, .locked-card .note { color: rgba(255, 255, 255, .86); }
.locked-card .note { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .16); font-size: .95rem; }

/* ── Less movement for people who asked for it ─────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  a, .btn, .link, .seg button, .shot, .zoomable, .model3d .model-shot,
  input, select, textarea, details > summary::after,
  .mini-house img, .mini-house iframe { transition: none; }
  .status.ok { animation: none; }
  .btn:active, .btn.primary:active, .shot:hover, .shot:active, .model3d .model-shot:hover { transform: none; }
}
