/* =========================================================
   Marek & Paulo — wedding site
   The village picture is 1926 × 817 px. Inside .picture every
   element is placed with --x / --y / --w / --h in those pixels;
   negative --y reaches into the sky band (360 px) above it.
   ========================================================= */

:root {
  --bg: #fcfafa;            /* = the paper colour of village.webp */
  --sky: #fcfafa;
  --surface: #ffffff;
  --text: #171a21;
  --muted: #6b7180;
  --line: rgba(23, 26, 33, .09);
  --accent: #2f5fb5;        /* blue house */
  --olive: #4b4b31;         /* logo ink */
  --yellow: #f2b705;
  --coral: #e8664a;
  --shadow: 0 1px 2px rgba(16, 20, 36, .04), 0 8px 24px rgba(16, 20, 36, .08);
  --night: 0;

  --fade: 1.2s ease;
  --ease: cubic-bezier(.3, .75, .2, 1);
  --radius: 16px;

  /* Type: three families, one job each (see DESIGN.md)
     serif  = everything you read, and the controls (--sans points here)
     sc     = every label, the brand name and the hero title
     script = titles */
  --serif: "Lora", Georgia, serif;
  --sc: "Cormorant SC", "Cormorant Garamond", Georgia, serif;
  --script: "Beth Ellen", "Brush Script MT", cursive;
  --sans: var(--serif);     /* controls and fine print: no separate sans */
  /* Size scale, built around 17 px Lora body text */
  --fs-xs: 12px;     /* credits, fine print */
  --fs-s: 14px;      /* controls, tooltips, captions */
  --fs-m: 15px;      /* secondary reading text: card bodies, details */
  --fs-base: 17px;   /* reading text */
  --fs-label: 16px;  /* Cormorant SC labels (small x-height, so a step up) */
  --fs-l: 20px;      /* lead values */
  --fs-xl: 24px;     /* small headings inside a section */
  --fs-xxl: 28px;    /* figures */
  color-scheme: light;
}

:root[data-theme="night"] {
  --bg: #0f1426;
  --sky: rgb(60, 73, 120);  /* = night(paper), see tools/make_layers.py */
  --olive: #ece4c6;
  --surface: #182038;
  --text: #eef0f7;
  --muted: #9aa2bd;
  --line: rgba(238, 240, 247, .1);
  --accent: #8fb0ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 8px 24px rgba(0, 0, 0, .3);
  --night: 1;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: var(--fs-base);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--fade), color var(--fade);
}
a { color: inherit; }
img { max-width: 100%; }

/* Controls and fine print stay in the sans */
button, .nav, .tip, .swipe-hint, .map-credit, .dish-credit, .map-btn, .viewer .v-count, .places-map, .venue-map, .place-popup {
  font-family: var(--sans);
}

/* Labels: true small caps, never tracked-out uppercase */
.eyebrow, .sc {
  margin: 0;
  font-family: var(--sc);
  font-weight: 700;
  font-size: var(--fs-label);
  letter-spacing: .08em;
  line-height: 1.3;
  color: var(--olive);
  transition: color var(--fade);
}

/* ---------- Navigation ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 60px;
  padding: 0 clamp(16px, 3vw, 32px);
  border-bottom: 1px solid transparent;
  transition: background-color .3s, border-color .3s, backdrop-filter .3s;
}
.nav.scrolled, body:not(.home) .nav {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-color: var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  font-family: var(--sc);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--olive);
  text-decoration: none;
  transition: color var(--fade);
}
.brand .mark { width: 22px; }

/* Logo emblem (the orange), recoloured with the theme */
.mark {
  display: inline-block;
  aspect-ratio: 166 / 160;
  background: var(--olive);
  -webkit-mask: url("../assets/logo-mark.png") center / contain no-repeat;
  mask: url("../assets/logo-mark.png") center / contain no-repeat;
  transition: background-color var(--fade);
}
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: var(--fs-s);
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s, background-color .2s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); background: var(--line); }
.nav-links .nav-cta { margin-left: 6px; color: #fff; background: var(--text); }
.nav-links .nav-cta:hover { color: #fff; background: var(--text); opacity: .85; }
/* On the RSVP page the button stays a button, with a ring to say "you are here" */
.nav-links .nav-cta[aria-current="page"] { color: #fff; background: var(--text); box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--text); }
:root[data-theme="night"] .nav-links .nav-cta, :root[data-theme="night"] .nav-links .nav-cta:hover { color: var(--bg); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color .2s;
}
.icon-btn:hover { background: var(--line); }
.icon-btn:focus-visible, .nav-links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; grid-area: 1 / 1; transition: opacity .3s, transform .4s var(--ease); }
.i-moon { fill: currentColor !important; stroke: none !important; }
.i-sun circle { fill: currentColor; stroke: none; }
:root[data-theme="day"] .i-sun, :root[data-theme="night"] .i-moon { opacity: 0; transform: rotate(-60deg) scale(.6); }
.menu-toggle { display: none; }

@media (max-width: 1080px) {
  .menu-toggle { display: grid; }
  .nav-links {
    position: absolute;
    top: 64px;
    right: 12px;
    left: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 8px;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity .2s, transform .25s var(--ease);
  }
  .nav-links.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { padding: 12px 14px; border-radius: 10px; font-size: 16px; }
  .nav-links .nav-cta { margin: 4px 0 0; text-align: center; }
}

/* ---------- Hero / village ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow-x: clip;
  background: var(--sky);
  container-type: inline-size;
  transition: background-color var(--fade), transform .5s cubic-bezier(.5, 0, .3, 1);   /* walking in / out: short */
  transform-origin: var(--ox, 50%) var(--oy, 70%);
  /* picture width: fill the screen width, but keep the doors above the fold */
  --pw: max(860px, min(100cqw, calc((100svh - 8px) * 1926 / 1177)));
  --u: calc(var(--pw) / 1926);   /* one picture pixel */
}

/* Night sky: deepen the top of the sky band (full width) */
.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: calc(var(--u) * 330);
  z-index: 2;
  background: linear-gradient(#0c1124, rgba(12, 17, 36, 0));
  opacity: calc(var(--night) * .9);
  transition: opacity var(--fade);
  pointer-events: none;
}
/* Soft hand-off from the picture to the page below */
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: calc(var(--u) * 60);
  z-index: 2;
  background: linear-gradient(rgba(0, 0, 0, 0), var(--bg));
  pointer-events: none;
  transition: background var(--fade);
}

.hero-scroll { position: relative; }

.picture {
  position: relative;
  width: var(--pw);
  aspect-ratio: 1926 / 1177;
  margin: 0 auto;
}

.layer {
  position: absolute;
  left: 0;
  top: calc(360 / 1177 * 100%);
  width: 100%;
  height: calc(817 / 1177 * 100%);
  display: block;
  max-width: none;
  pointer-events: none;
  user-select: none;
}
.layer.day { z-index: 0; opacity: calc(1 - var(--night)); transition: opacity var(--fade); }
.layer.night { z-index: 1; opacity: var(--night); transition: opacity var(--fade); }
.layer.lit { z-index: 3; opacity: var(--night); transition: opacity .8s ease; }
:root[data-theme="night"] .layer.lit { transition-delay: .6s; }

.spot, .door, .tree, .glow {
  position: absolute;
  left: calc(var(--x) / 1926 * 100%);
  top: calc((var(--y) + 360) / 1177 * 100%);
  width: calc(var(--w) / 1926 * 100%);
  height: calc(var(--h) / 1177 * 100%);
}

.glow { z-index: 3; pointer-events: none; }
.glow::before {
  content: "";
  position: absolute;
  inset: -50% -90%;
  background: radial-gradient(closest-side, rgba(255, 196, 102, .5), rgba(255, 170, 70, .14) 55%, transparent);
  mix-blend-mode: screen;
  opacity: var(--night);
  transition: opacity .8s ease;
}
:root[data-theme="night"] .glow::before { transition-delay: .8s; }

/* Hero text */
.hero-text {
  position: absolute;
  z-index: 20;
  left: 50%;
  top: calc(76px + var(--u) * 40);
  transform: translateX(-50%) translateY(calc(var(--leave, 0) * -30px));
  opacity: calc(1 - var(--leave, 0) * 1.6);
  width: min(92vw, 720px);
  text-align: center;
  pointer-events: none;
}
.hero-mark { width: clamp(44px, calc(var(--u) * 84), 92px); background: var(--title); }
/* the names, the tagline and the orange above them: terracotta from the roofs */
:root { --title: #b66238; }

.hero-text h1, .hero-text .tagline {
  font-family: var(--sc);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--title);
  transition: color var(--fade);
}
.hero-text h1 {
  margin: .25em 0 0;
  padding-left: .14em;             /* balance the trailing letter-spacing */
  font-size: clamp(22px, calc(var(--u) * 40), 44px);
  letter-spacing: .14em;
  line-height: 1.05;
}
.hero-text .amp { font-weight: 500; }
.hero-text .tagline {
  margin: .45em 0 0;
  padding-left: .24em;
  font-size: clamp(10px, calc(var(--u) * 15.5), 17px);
  letter-spacing: .24em;
  line-height: 1.2;
}

/* Night sky: small soft stars over the sky band, fading in with the night */
.stars { position: absolute; left: 0; top: 0; z-index: 3; width: 100%; height: calc(440 / 1177 * 100%); overflow: visible; pointer-events: none; opacity: var(--night); transition: opacity var(--fade); }
:root[data-theme="night"] .stars { transition-delay: .4s; }
.stars circle, .stars .sparkle { fill: #fff3d6; }
.stars circle { opacity: .75; }
.stars .sparkle { opacity: .95; }

/* ---------- Tooltips ---------- */

.tip {
  position: absolute;
  z-index: 40;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translate(var(--tx, -50%), 4px);
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: var(--fs-s);
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .25s var(--ease);
}
.tip.below { bottom: auto; top: calc(100% + 10px); transform: translate(var(--tx, -50%), -4px); }
:is(.spot, .door):is(:hover, :focus-visible, .open) .tip { opacity: 1; transform: translate(var(--tx, -50%), 0); }
.vane .tip { left: auto; right: 0; --tx: 0; }

.spot, .door { display: block; z-index: 6; cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; text-decoration: none; }
.spot:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 10px; }

/* ---------- Weathervane ---------- */

.vane { color: #2c3140; }
:root[data-theme="night"] .vane { color: #aeb7d6; }
.vane-base { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.vane-base path { stroke: currentColor; fill: none; stroke-linecap: round; }
.vane-base circle { fill: currentColor; }
.vane-base text { fill: currentColor; font-size: 12px; font-weight: 600; font-family: var(--sans); }
.vane-arrow {
  position: absolute;
  left: 0;
  top: calc(18 / 130 * 100%);
  width: 100%;
  aspect-ratio: 96 / 20;
  transform: perspective(calc(var(--u) * 400)) rotateY(var(--turn, 0deg));
  animation: sway 7s ease-in-out infinite;
}
.vane-arrow svg { display: block; width: 100%; height: 100%; overflow: visible; }
.vane-arrow path { stroke: currentColor; fill: currentColor; stroke-linecap: round; }
@keyframes sway { 0%, 100% { --turn: -18deg; } 50% { --turn: 22deg; } }
@property --turn { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.vane:is(:hover, :focus-visible, .open) .vane-arrow { animation: spin 1.4s var(--ease); }
@keyframes spin { from { --turn: 0deg; } to { --turn: 360deg; } }

/* ---------- House-name tile ---------- */

/* Painted signs: the house tile (Algarve) and the lamp-post sign (Faro).
   Drawn in SVG and passed through the #paint filter (index.html) for soft,
   wobbly watercolour edges and a little grain; lettering in the script,
   in azulejo blue, slightly wobbled (#paint-ink). */
.paint-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.tile-sign { z-index: 5; }
.signpost { z-index: 9; }
.plaque { display: block; width: 100%; height: 100%; overflow: visible; transition: transform .3s var(--ease), filter var(--fade); filter: drop-shadow(calc(var(--u) * 1) calc(var(--u) * 2) calc(var(--u) * 3) rgba(70, 55, 40, .18)); }
.plaque .tile { fill: url(#tile-wash); }
.plaque .frame { fill: none; stroke: #2e5aa8; stroke-width: 2.4; stroke-linejoin: round; opacity: .82; }
.plaque .hair { fill: none; stroke: #2e5aa8; stroke-width: .9; opacity: .4; }
.plaque .corner { fill: none; stroke: #2e5aa8; stroke-width: 1.1; stroke-linecap: round; opacity: .55; }
.plaque .bracket { stroke: #3b3e46; stroke-width: 3; stroke-linecap: round; }
.plaque text { fill: #24499a; font-family: var(--script); font-size: 18px; }
.signpost .plaque { transform-origin: 96% 50%; }
:root[data-theme="night"] .plaque { filter: brightness(.72) saturate(.85); }
.tile-sign:is(:hover, :focus-visible, .open) .plaque { transform: translateY(calc(var(--u) * -3)); }
.signpost:is(:hover, :focus-visible, .open) .plaque { transform: rotate(-4deg); }
.signpost .tip { left: 40%; }


/* ---------- Doors ---------- */

.door { perspective: calc(var(--u) * 800); }
.door .interior {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(to top, rgba(120, 80, 50, .5), transparent 22%), radial-gradient(ellipse at 50% 35%, #6b4a32, #2a1b12 78%);
  box-shadow: inset 0 0 calc(var(--u) * 20) rgba(0, 0, 0, .55);
}
.door .interior::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(255, 170, 70, .6), transparent 30%), radial-gradient(ellipse at 50% 40%, #fff1c4, #ffc35e 45%, #e98a2c);
  opacity: var(--night);
  transition: opacity var(--fade);
}
.door .leaf {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transition: transform .75s var(--ease), filter .75s var(--ease);
}
.leaf::before, .leaf::after {
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-size: calc(1926 / var(--w) * 100%) calc(817 / var(--h) * 100%);
  background-position: calc(var(--x) / (1926 - var(--w)) * 100%) calc(var(--y) / (817 - var(--h)) * 100%);
}
.leaf::before { background-image: url("../assets/village-day.webp"); }
.leaf::after { background-image: url("../assets/village-night.webp"); opacity: var(--night); transition: opacity var(--fade); }
.door:is(:hover, :focus-visible, .open) .leaf { transform: rotateY(70deg); filter: brightness(.85); }
.door:focus-visible .interior { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- Street lamp (day / night switch) ---------- */

.lamp {
  position: absolute;
  z-index: 7;
  left: calc(var(--x) / 1926 * 100%);
  top: calc((var(--y) + 360) / 1177 * 100%);
  width: calc(var(--w) / 1926 * 100%);
  height: calc(var(--h) / 1177 * 100%);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.lamp img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; pointer-events: none; }
.lamp .l-day   { opacity: calc(1 - var(--night)); transition: opacity var(--fade); }
.lamp .l-night { opacity: var(--night); transition: opacity var(--fade); }
.lamp .l-lit   { opacity: var(--night); transition: opacity .3s; }
.lamp:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 10px; }
.lamp .tip { top: auto; bottom: calc(100% + 6px); }
.lamp:is(:hover, :focus-visible) .tip { opacity: 1; transform: translate(-50%, 0); }

.lamp-glow, .lamp-pool {
  position: absolute;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: var(--night);
  transition: opacity .5s ease;
}
.lamp-glow {                       /* light around the lantern */
  z-index: 8;
  left: calc((1387 - 260) / 1926 * 100%);
  top: calc((299 - 260 + 360) / 1177 * 100%);
  width: calc(520 / 1926 * 100%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 214, 140, .75), rgba(255, 180, 90, .24) 28%, rgba(255, 170, 80, .07) 60%, transparent);
}
.lamp-pool {                       /* light on the wall and pavement */
  z-index: 2;
  left: calc((1387 - 260) / 1926 * 100%);
  top: calc((712 - 300 + 360) / 1177 * 100%);
  width: calc(520 / 1926 * 100%);
  height: calc(380 / 1177 * 100%);
  background: radial-gradient(closest-side, rgba(255, 196, 120, .38), rgba(255, 180, 90, .12) 55%, transparent);
}
:root[data-theme="night"] :is(.lamp .l-lit, .lamp-glow, .lamp-pool) { animation: flicker-on 1s steps(1, end) both; }
@keyframes flicker-on {
  0% { opacity: 0; } 12% { opacity: 1; } 20% { opacity: .1; } 32% { opacity: .9; } 40% { opacity: .2; } 55%, 100% { opacity: 1; }
}
/* Daytime: hovering the lamp warms it up a little */
:root[data-theme="day"] .picture:has(.lamp:hover, .lamp:focus-visible) .lamp-glow { opacity: .35; }

/* ---------- Orange tree ---------- */

.tree { z-index: 4; padding: 0; border: 0; background: transparent; cursor: pointer; border-radius: 50%; -webkit-tap-highlight-color: transparent; }
.tree:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.orange {
  position: absolute;
  z-index: 7;
  width: calc(var(--u) * 24);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #ffc06a, #f28a1e 55%, #c75f0e);
  pointer-events: none;
  animation: fall var(--dur, 1s) cubic-bezier(.45, 0, .9, .55) forwards, roll 2.2s ease-out var(--dur, 1s) forwards;
}
@keyframes fall { to { top: var(--floor); } }
@keyframes roll {
  70%  { transform: translateX(var(--roll)) rotate(calc(var(--roll) * 6)); opacity: 1; }
  100% { transform: translateX(var(--roll)) rotate(calc(var(--roll) * 6)); opacity: 0; }
}

/* ---------- Walking in ---------- */

body.entering .hero { transform: scale(2); }
body.entering .hero-text { opacity: 0; }
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease .2s;
}
body.entering::after { opacity: 1; }

/* Walking back from a page's footer: the street steps back and the page
   fades to paper... */
body.leaving::after { opacity: 1; transition: opacity .28s ease; }
body.leaving .street-view .foot-mark { transform: scale(.9); transition: transform .5s var(--ease); }
/* ...and the village opens close up on the street, then zooms out */
html.returning .hero { transform: scale(1.8); transition: none; }
html.returning .hero-text { opacity: 0; }
html.returning body::after { opacity: 1; transition: none; }
html.zooming-out body::after { transition: opacity .3s ease; }
html.zooming-out .hero-text { transition: opacity .35s ease .3s; }

/* ---------- Details ---------- */

/* The terracotta strip under the village, full width: first the weekend at
   a glance (title, then when / where / getting there), a little air, then
   the six pages. White on #B66238 is 4.4 : 1; at night a deep terracotta. */
.strip {
  position: relative;
  z-index: 3;
  margin: 0 0 clamp(40px, 6vw, 72px);
  padding: clamp(56px, 8vw, 96px) clamp(16px, 3vw, 32px) clamp(44px, 6vw, 80px);
  background: #b66238;
  color: #fff;
  text-align: center;
  transition: background-color var(--fade), color var(--fade);
}
/* the same terracotta day and night */
.strip .sc { color: inherit; }
.strip-title { margin: 0 0 clamp(20px, 3vw, 28px); font-size: var(--fs-l); letter-spacing: .1em; opacity: .9; }
.strip-glance {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.strip-glance li { display: grid; justify-items: center; gap: 4px; }
.strip-glance .ico { margin-bottom: 6px; }
.strip-glance .sc { opacity: .85; }
.strip-glance b { font: 600 var(--fs-l) var(--serif); line-height: 1.3; }
.strip-nav { margin-top: clamp(32px, 5vw, 48px); }
/* a short separator between the glance and the pages */
.strip-nav::before { content: ""; display: block; width: 56px; height: 1px; margin: 0 auto clamp(18px, 3vw, 28px); background: rgba(255, 255, 255, .55); }
.strip-nav ul {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  max-width: 1080px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.strip a {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 10px 4px;
  border-radius: 10px;
  font: 500 var(--fs-base) var(--sans);
  letter-spacing: .01em;
  color: inherit;
  text-decoration: none;
  transition: background-color .2s;
}
.strip .ico { color: inherit; }
.strip a:hover { background: rgba(0, 0, 0, .1); }
.strip a:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; }
/* Under the village: one quiet line inviting people to play */
.hint { position: relative; z-index: 3; margin: 0 auto clamp(18px, 3vw, 28px); padding: 0 20px; max-width: 920px; text-align: center; font-size: var(--fs-m); font-style: italic; color: var(--muted); }


/* ---------- Our story ---------- */

.story { --p: 0; padding: clamp(24px, 5vw, 56px) 0 clamp(40px, 6vw, 80px); }
.story-intro {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px 28px;
  text-align: center;
  transform: translateY(calc((1 - min(1, var(--p) * 2)) * 24px));
}
.story-frame {
  position: relative;
  width: calc(100% - (1 - var(--p)) * min(24vw, 320px));
  max-width: 100%;
  height: 90svh;
  margin: 0 auto;
  border-radius: calc((1 - var(--p)) * 24px);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  transform: translateY(calc((1 - var(--p)) * 32px));
}
.story-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
/* No StoryMap link yet: the section stays hidden */
.story[data-storymap=""] { display: none; }

.foot { padding: 32px 16px 40px; text-align: center; font-size: var(--fs-s); color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- Small screens ---------- */

.swipe-hint { display: none; }

@media (max-width: 860px) {
  .hero-scroll { overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
  .hero-scroll::-webkit-scrollbar { display: none; }
  .hero-text { top: 66px; }
  .swipe-hint {
    display: block;
    position: absolute;
    z-index: 20;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    margin: 0;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--surface);
    box-shadow: var(--shadow);
    font-size: var(--fs-xs);
    color: var(--muted);
    white-space: nowrap;
    pointer-events: none;
    transition: opacity .5s;
  }
  .swipe-hint.gone { opacity: 0; }
  .strip-nav ul { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 4px; }
  .strip a { font-size: var(--fs-m); }
  .strip-glance { gap: 8px; }
  .strip-glance b { font-size: var(--fs-m); }
  .story-frame { height: 78svh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Inner pages ---------- */

.page { max-width: 720px; margin: 0 auto; padding: 108px 20px 96px; }
.page ul:not([class]) { padding-left: 1.2em; }   /* plain lists only: grids like .tips set their own padding */
.page li { margin: .3em 0; }
/* Content still to come: one quiet line, no box */
.tbc { margin: 0 0 1em; font-style: italic; color: var(--muted); }

.map-page main { display: flex; flex-direction: column; min-height: 100svh; padding-top: 60px; }
.map-head { padding: 24px 20px 14px; text-align: center; }
/* The map is the page: nearly the full screen, edge to edge on phones */
.map-embed { flex: 1; display: flex; min-height: calc(100svh - 72px); margin: 0 clamp(0px, 1.2vw, 16px); border-radius: clamp(0px, 1.2vw, 16px); overflow: hidden; border: 1px solid var(--line); }
.map-embed iframe { flex: 1; width: 100%; min-height: calc(100svh - 72px); border: 0; }

/* Door labels sit inside the open doorway, clear of the wall signs */
.door .tip { bottom: auto; top: 10%; }

/* =========================================================
   Invitation styling for inner pages (from the Tavira invitation)
   Beth Ellen = handwritten titles, Cormorant SC = small caps,
   Lora = text. Each topic sets --topic (its invitation colour).
   ========================================================= */

/* --topic-c: the ink itself (script titles, art, accents).
   --ink: the same ink pulled 20 % towards the text colour, for small text
   and links, so every ink passes 4.5 : 1 on the paper (olive and coral
   alone are only ~3.9 : 1). */
[style*="--topic"] {
  --topic-c: var(--topic);
  --ink: color-mix(in srgb, var(--topic-c) 80%, var(--text));
}
:root[data-theme="night"] [style*="--topic"] {
  --topic-c: color-mix(in srgb, var(--topic) 50%, #fff);
  --ink: color-mix(in srgb, var(--topic-c) 80%, var(--text));
}

.inv { max-width: 1000px; }
.script {
  margin: 0;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(48px, 7vw, 76px);
  line-height: 1.35;
  letter-spacing: 0;
  color: var(--topic-c, var(--olive));
  transition: color var(--fade);
}
h2.script { font-size: clamp(40px, 5.5vw, 58px); }
.inv-head { margin-bottom: 28px; }
/* Label above a title: tucked in close. Label below: it sits just under the
   baseline, clear of the long descenders (g, f, y), like a printed byline. */
.sc + .script { margin-top: -.12em; }
.script + .sc { margin-top: .3em; }
h2.script { line-height: 1.45; }

.prose { font-size: var(--fs-base); line-height: 1.75; }
.prose p { margin: 0 0 1em; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose a { color: var(--ink); text-underline-offset: 3px; }
.prose ul { margin: 0 0 1em; padding-left: 1.2em; }
.prose li { margin: .25em 0; }
.prose .ps { font-size: var(--fs-m); color: var(--muted); }

.inv-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, 320px);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.art { margin: 0; }
.art img { display: block; width: 100%; height: auto; }

.inv-section { margin-top: clamp(48px, 7vw, 80px); padding-top: clamp(32px, 5vw, 48px); border-top: 1px solid var(--line); }

/* Key facts: "Dates", "Wedding venue", … */
.facts-list { margin: 0 0 1.6em; display: grid; gap: 18px; }
.facts-list > div { display: grid; grid-template-columns: 150px 1fr; gap: 4px 20px; }
.facts-list dt { padding-top: 2px; }
.facts-list dd { margin: 0; }
.facts-list dd span { display: block; font-size: var(--fs-m); color: var(--muted); }

/* Weather numbers */
/* Weather numbers: an open row on the paper, no cards */
.wx { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 8px; padding: 22px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.wx div { text-align: center; }
.wx .ico { color: var(--ink); }
.wx b { display: block; margin: 6px 0 2px; font-size: var(--fs-xxl); font-weight: 400; color: var(--ink); }
.wx span { font-size: var(--fs-s); color: var(--muted); line-height: 1.4; display: block; }

/* Travel: a piece torn out of an old paper map (tools/make_iberia.py).
   A paper object like the polaroids and notes: same paper by day and night,
   labels in fixed map inks. The SVG shares the image's 723 x 922 canvas. */
.map-grid { grid-template-columns: minmax(0, 1fr) minmax(240px, 400px); }
.map-art {
  position: relative;
  max-width: 400px;
  margin-left: auto;
  rotate: 1.2deg;
  filter: drop-shadow(0 1px 2px rgba(30, 25, 20, .12)) drop-shadow(0 12px 22px rgba(30, 25, 20, .16));
}
:root[data-theme="night"] .map-art { filter: brightness(.9) drop-shadow(0 14px 30px rgba(0, 0, 0, .5)); }
.map-labels { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.map-labels .route { fill: none; stroke: #b66238; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 0 12; opacity: .8; }
.map-labels .plane { fill: #1f4fa0; }
.map-labels .country { font-family: var(--sc); font-weight: 700; font-size: 30px; letter-spacing: .32em; fill: #12386e; opacity: .72; text-anchor: middle; }
.map-labels .country.es { fill: #8a6a3e; opacity: .8; }
.map-labels .sea { font-family: var(--serif); font-style: italic; font-size: 24px; letter-spacing: .12em; fill: #4f7686; text-anchor: middle; }
.map-labels .town { fill: #23314f; stroke: #fdfaf2; stroke-width: 2; }
.map-labels .town-name { font-family: var(--sc); font-weight: 700; font-size: 24px; letter-spacing: .06em; fill: #23314f; text-anchor: end; }
.map-labels .tavira { font-family: var(--script); font-size: 46px; fill: #1f4fa0; }

/* Location: the cover's sardine on its azulejo tile */
.tile-art { position: relative; max-width: 320px; margin-left: auto; }
.tile-art .tile { opacity: .6; }
.tile-art .sardine { position: absolute; left: -12%; top: 33%; width: 124%; }
:root[data-theme="night"] .tile-art .tile { opacity: .35; }

.wide-art { margin: 8px 0 28px; }
.wide-art img { display: block; width: 100%; height: auto; }

.contact { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; font-size: var(--fs-m); }
/* Stay: check in and check out side by side on one line, centred */
.times { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 40px; margin: 0 0 1.6em; }
.times > div { display: flex; align-items: baseline; gap: 12px; }
.times dd { margin: 0; }

.map-frame { aspect-ratio: 16 / 10; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.map-frame iframe { display: block; width: 100%; height: 100%; border: 0; }

/* Program days */
.day { display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, 260px); gap: clamp(24px, 4vw, 56px); align-items: center; }
.day + .day { margin-top: clamp(40px, 6vw, 72px); padding-top: clamp(32px, 5vw, 48px); border-top: 1px solid var(--line); }
.day .sc { margin-bottom: 12px; }
.day.full { grid-template-columns: 1fr; }
.day-art { max-width: var(--art, 260px); justify-self: end; }
.art img[style*="--art"] { max-width: var(--art); }

@media (max-width: 760px) {
  .inv-grid, .day { grid-template-columns: 1fr; }
  /* Phones: the watercolour objects are small accents, not a screen each */
  .inv-grid .art:not(.map-art), .day-art, .art img[style*="--art"] { max-width: min(var(--art, 150px), 150px); justify-self: center; margin: 0 auto; }
  .map-art, .tile-art { margin: 0 auto; }
  .facts-list > div { grid-template-columns: 1fr; }
}
/* Phones: weather numbers as three short rows instead of three cramped columns */
@media (max-width: 560px) {
  .wx { grid-template-columns: 1fr; gap: 0; padding: 4px 0; }
  .wx div { display: grid; grid-template-columns: 28px 5.2em 1fr; align-items: center; gap: 14px; padding: 10px 2px; text-align: left; }
  .wx div + div { border-top: 1px solid var(--line); }
  .wx b { margin: 0; font-size: var(--fs-xl); }
}
.map-head.inv { margin: 0 auto; }
.day-art { height: auto; width: 100%; }

/* Link to live weather on yr.no */
.wx-link { margin: 4px 0 0; text-align: center; font-size: var(--fs-s); }
.wx-link a { color: var(--ink); text-underline-offset: 3px; }


/* =========================================================
   Easter eggs
   ========================================================= */

html, body { overflow-x: clip; }

/* Small message at the bottom of the screen */
.toast {
  position: fixed;
  z-index: 120;
  left: 50%;
  bottom: 24px;
  max-width: min(90vw, 420px);
  padding: 12px 20px;
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--fs-base);
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity .35s ease, transform .45s var(--ease);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* A school of sardines swimming across the screen */
.school { position: fixed; inset: 0; z-index: 110; pointer-events: none; overflow: hidden; }
.school img {
  position: absolute;
  left: 0;
  height: auto;
  max-width: none;
  transform: translateX(-30vw);
  animation-name: swim, bob;
  animation-timing-function: linear, ease-in-out;
  animation-iteration-count: 1, infinite;
  animation-fill-mode: both, none;
  filter: drop-shadow(0 4px 6px rgba(20, 40, 80, .15));
}
@keyframes swim { from { transform: translateX(-30vw); } to { transform: translateX(130vw); } }
@keyframes bob { 50% { margin-top: 14px; } }

/* Disco lights */
.disco { cursor: pointer; transform-origin: 50% 0; }
.disco:focus-visible { outline: 2px dashed var(--topic-c); outline-offset: 6px; border-radius: 50%; }
.disco:hover { animation: swing 1.6s ease-in-out infinite; }
.disco.spinning { animation: swing .5s ease-in-out infinite; }
@keyframes swing { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }

.disco-room {
  position: fixed;
  inset: 0;
  z-index: 110;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(circle at var(--cx, 70%) var(--cy, 20%), rgba(40, 30, 70, .35), rgba(10, 12, 30, .72));
  opacity: 0;
  transition: opacity .6s ease;
}
.disco-room.on { opacity: 1; }
.disco-room i {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  opacity: .85;
  box-shadow: 0 0 12px 3px currentColor;
  animation: sweep 2s linear infinite;
}
@keyframes sweep {
  from { transform: translate(-12vw, -6vh) rotate(0deg); }
  to   { transform: translate(12vw, 6vh) rotate(90deg); }
}
/* the flecks pulse on the beat while the music plays */
.disco-room.beat i { animation: sweep 2s linear infinite, pulse var(--beat, .45s) ease-out infinite; }
@keyframes pulse { 0% { opacity: 1; scale: 1.5; } 100% { opacity: .55; scale: 1; } }
.disco-words {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  font-family: "Beth Ellen", cursive;
  font-size: clamp(56px, 11vw, 140px);
  color: #ff8a80;
  text-shadow: 0 0 30px rgba(255, 138, 128, .6);
  transform: scale(.9);
  transition: transform 1s var(--ease);
}
.disco-room.on .disco-words { transform: scale(1); }
.disco-mute {
  position: absolute;
  right: 20px;
  bottom: 20px;
  pointer-events: auto;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font: 500 13px var(--sans);
  cursor: pointer;
}
.disco-mute:hover { background: rgba(255, 255, 255, .22); }

/* Crabs walk away sideways (crab gait) and come back the same way */
.crabs { cursor: pointer; }
.crabs:focus-visible { outline: 2px dashed var(--topic-c); outline-offset: 6px; }
.crabs.scuttling { animation: crab-walk 7s both, crab-gait .32s ease-in-out infinite; }
@keyframes crab-walk {
  0%   { translate: 0 0; animation-timing-function: cubic-bezier(.5, 0, .9, .6); }
  38%  { translate: 110vw 0; }
  60%  { translate: 110vw 0; animation-timing-function: cubic-bezier(.1, .4, .5, 1); }
  100% { translate: 0 0; }
}
@keyframes crab-gait { 0%, 100% { rotate: -3deg; margin-top: 0; } 50% { rotate: 3deg; margin-top: 3px; } }

/* Location: the sardine swims off and comes back */
.tile-art .sardine { cursor: pointer; }
.tile-art .sardine:focus-visible { outline: 2px dashed var(--topic-c); outline-offset: 4px; }
.tile-art .sardine.swimming { animation: fish-away 5s both, fish-wiggle .45s ease-in-out infinite; }
@keyframes fish-away {
  0%    { translate: 0 0; animation-timing-function: cubic-bezier(.5, 0, .9, .5); }
  35%   { translate: 110vw -20px; }
  35.1% { translate: -110vw 20px; }
  55%   { translate: -110vw 20px; animation-timing-function: cubic-bezier(.1, .5, .4, 1); }
  100%  { translate: 0 0; }
}
@keyframes fish-wiggle { 0%, 100% { rotate: -2.5deg; } 50% { rotate: 2.5deg; } }

/* Wedding weekend: bunting between the chimneys, windows lit all day */
.bunting { position: absolute; inset: 0; z-index: 5; width: 100%; height: 100%; pointer-events: none; overflow: visible; display: none; }
.party .bunting { display: block; }
.bunting path.string { fill: none; stroke: #6b5a48; stroke-width: 1.6; }
:root[data-theme="night"] .bunting { filter: brightness(.7); }
.party .layer.lit { opacity: calc(.55 + .45 * var(--night)); }
.party .glow::before { opacity: calc(.4 + .6 * var(--night)); }
@media (max-width: 760px) {
  .map-grid { grid-template-columns: 1fr; }
  .map-art { max-width: 330px; margin: 8px auto 0; }
}

/* Location: keep the tile + sardine clear of the map */
.inv-grid + .map-frame { margin-top: 36px; }
.tile-art .sardine { max-width: none; }
@media (max-width: 760px) {
  .tile-art { max-width: 190px; margin: 8px auto 12px; }
  .inv-grid + .map-frame { margin-top: 40px; }
}

/* Weathervane: press and hold → points to where the visitor is */
.vane { -webkit-touch-callout: none; user-select: none; }
.vane.holding .vane-arrow { animation: spin .65s linear infinite; }
.vane-arrow.pointing { animation: none; transition: --turn 2.4s cubic-bezier(.2, .7, .2, 1); }

/* =========================================================
   Stay: photo mosaic + full-screen viewer
   One large photo and four small ones, no frames, no captions; the
   rest open in the viewer ("See all 17 photos").
   ========================================================= */

.gallery { margin: 8px 0 0; }
.mosaic {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 6px;
  aspect-ratio: 2 / 1;
  border-radius: 14px;
  overflow: hidden;
}
.ph { display: block; min-width: 0; min-height: 0; padding: 0; border: 0; overflow: hidden; background: var(--line); cursor: zoom-in; }
.ph:first-child { grid-row: span 2; }
.ph img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease), filter .3s; }
.ph:hover img { transform: scale(1.03); }
.ph:focus-visible { outline: 2px solid var(--topic-c, var(--accent)); outline-offset: -4px; }
.ph:focus-visible img { filter: brightness(.92); }
.ph.more { display: none; }
:root[data-theme="night"] .ph img { filter: brightness(.88); }
.gallery-all {
  display: block;
  min-height: 44px;
  margin: 4px 0 0 auto;
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--ink);
  font: 500 var(--fs-s) var(--sans);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.gallery-all:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (max-width: 560px) {
  .mosaic { grid-template-columns: 1fr 1fr; grid-template-rows: none; aspect-ratio: auto; gap: 4px; border-radius: 10px; }
  .ph { aspect-ratio: 3 / 2; }
  .ph:first-child { grid-row: auto; grid-column: span 2; }
}

.c-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  color: #171a21;
  box-shadow: 0 4px 14px rgba(16, 20, 36, .18);
  cursor: pointer;
  transition: opacity .2s, transform .2s;
}
.c-btn:hover { transform: scale(1.06); }
.c-btn:disabled { opacity: 0; pointer-events: none; }
.c-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.c-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.viewer {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(10, 12, 20, .94);
  color: #fff;
}
.viewer::backdrop { background: rgba(10, 12, 20, .6); }
.viewer[open] { display: grid; place-items: center; }
.viewer figure { margin: 0; display: grid; justify-items: center; gap: 12px; padding: 56px 16px 40px; }
.viewer img { max-width: min(92vw, 1400px); max-height: 78vh; border-radius: 10px; }
.viewer figcaption:empty { display: none; }
.viewer figcaption { font-family: "Beth Ellen", cursive; font-size: 22px; color: rgba(255, 255, 255, .9); }
.viewer .v-close { position: fixed; top: 16px; right: 16px; }
.viewer .v-prev { position: fixed; left: 16px; top: calc(50% - 21px); }
.viewer .v-next { position: fixed; right: 16px; top: calc(50% - 21px); }
.viewer .v-count { position: fixed; top: 26px; left: 50%; transform: translateX(-50%); font: 500 13px var(--sans); color: rgba(255, 255, 255, .75); }

/* Travel: good to know – one icon and one short line each, no cards */
.tips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px clamp(20px, 4vw, 48px);
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.tips li { display: grid; justify-items: center; align-content: start; gap: 10px; max-width: 280px; margin: 0 auto; text-align: center; font-size: var(--fs-m); line-height: 1.5; color: var(--text); }
.tips b { font-weight: 600; color: var(--ink); }
.tips .ico { color: var(--ink); }
@media (max-width: 560px) {
  .tips { grid-template-columns: 1fr; gap: 0; }
  .tips li { grid-template-columns: 30px 1fr; justify-items: start; align-items: center; gap: 16px; max-width: none; margin: 0; padding: 12px 0; text-align: left; }
  .tips li + li { border-top: 1px solid var(--line); }
}

/* Guests page intro */
.guests-intro { max-width: 560px; margin: 0 auto 20px; padding: 0 20px; text-align: center; }
.guests-intro p { margin: 0; }

/* =========================================================
   Tavira page: "our favourites" map (ArcGIS Maps SDK)
   ========================================================= */

.place-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.place-chips button {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: 500 14px var(--sans);
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.place-chips button:hover { border-color: var(--topic-c); }
.place-chips button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
:root[data-theme="night"] .place-chips button[aria-pressed="true"] { color: var(--bg); }
.place-chips button:focus-visible { outline: 2px solid var(--topic-c); outline-offset: 2px; }

.places-map {
  height: 460px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}
.places-map.failed { display: grid; place-items: center; padding: 20px; text-align: center; color: var(--muted); }
.places-map .esri-view-surface--inset-outline:focus::after { outline: 2px solid var(--topic-c) !important; }
.place-popup p { margin: 0 0 8px; font-family: "Lora", Georgia, serif; font-size: 15px; line-height: 1.5; color: #23314f; }
.place-popup a { font: 600 13px var(--sans); color: #1f4fa0; }

.places-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.place {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s;
}
.place:hover, .place:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow); outline: none; }
.place img { justify-self: center; margin-top: 4px; width: auto; max-width: 44px; height: auto; max-height: 34px; }
.place-cat { display: block; font-family: var(--sc); font-weight: 700; font-size: 13px; letter-spacing: .06em; color: var(--muted); }
.place b { display: block; font-size: var(--fs-base); font-weight: 600; color: var(--ink); }
.place p { margin: 2px 0 6px; font-size: var(--fs-s); line-height: 1.5; color: var(--muted); }
.place a { font: 600 13px var(--sans); color: var(--ink); text-decoration: none; }
.place a:hover { text-decoration: underline; }
.place-venue { border-color: color-mix(in srgb, var(--olive) 40%, transparent); }
@media (max-width: 760px) { .places-map { height: 380px; } }
/* Stay: what the Quinta has, as a row of line icons */
.facilities {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px 16px;
  margin: 4px 0 28px;
  padding: 0;
  list-style: none;
}
.facilities li { display: grid; justify-items: center; gap: 8px; text-align: center; font: 500 var(--fs-s) var(--sans); color: var(--muted); }
.facilities .ico { color: var(--ink); }

/* The one icon family (tools/icons.py): a thin line and a faint tint of the
   same colour inside closed shapes, like the weather icons */
.ico { width: 36px; height: 36px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
/* wash: the closed shapes, a pixel off the line, roughened like watercolour */
.ico .wash { fill: currentColor; stroke: none; opacity: .3; filter: url(#wash); }
:root[data-theme="night"] .ico .wash { opacity: .38; }
/* line: the pen, with a very slight wobble */
.ico .line { filter: url(#ink); }
.ico .line .f { fill: none; }
.ico .line .bg { fill: color-mix(in srgb, currentColor 18%, var(--bg)); }   /* a coin on a card: opaque, so the card stays behind */
.ico-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
@media (max-width: 560px) { .facilities { gap: 20px 8px; } .facilities li { font-size: 13px; } }

/* Azulejo Atlas overview inset in the corner of the favourites map */
.places-map-wrap { position: relative; }
.places-overview {
  position: absolute;
  right: 12px;
  bottom: 28px;              /* sits just above the attribution line */
  width: 130px;
  height: 165px;
  border-radius: 12px;
  overflow: hidden;
  border: 3px solid #fffdf8;
  box-shadow: 0 6px 18px rgba(20, 30, 60, .22);
  background: #e8eef7;
  pointer-events: none;
}
.places-overview .esri-view-surface::after { display: none; }
.map-credit { margin: 8px 0 0; font-size: var(--fs-xs); color: var(--muted); }
@media (max-width: 760px) { .places-overview { width: 84px; height: 106px; border-width: 2px; } }

/* Algarve page: west-coast road trip, a short plain note */
.road-trip { max-width: 640px; margin-top: 32px; }
.road-trip h3 { margin: 2px 0 6px; font-size: var(--fs-l); font-weight: 600; color: var(--ink); }
.road-trip p:last-child { margin: 0; }

/* Secondary sections fold away: the title is the toggle, a thin + / – on the right */
.more > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  list-style: none;
  cursor: pointer;
}
.more > summary::-webkit-details-marker { display: none; }
.more > summary .inv-head { display: block; margin-bottom: 0; }
.more > summary .sc { display: block; }
.more > summary::after {
  content: "";
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background:
    linear-gradient(var(--ink), var(--ink)) center / 16px 1.5px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 1.5px 16px no-repeat;
  transition: background-color .2s, background-size .2s;
}
.more[open] > summary::after { background-size: 16px 1.5px, 1.5px 0; }
.more > summary:hover::after { background-color: var(--line); }
.more > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.more[open] > summary { margin-bottom: 20px; }

/* Dishes to try: a plain two-column list, name and what it is */
.dishes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(24px, 5vw, 56px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.dishes li { display: grid; gap: 2px; padding: 12px 0; border-top: 1px solid var(--line); }
.dishes b { font-weight: 600; color: var(--ink); }
.dishes span { font-size: var(--fs-m); font-style: italic; color: var(--muted); }
@media (max-width: 560px) { .dishes { grid-template-columns: 1fr; } }

/* =========================================================
   Favourites as one app: side list + map with rich popups
   ========================================================= */

.places-app {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  height: 560px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}
.places-side { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); }
.places-side .place-chips { margin: 0; padding: 12px; gap: 6px; border-bottom: 1px solid var(--line); }
.places-side .place-chips button { padding: 5px 11px; font-size: 13px; }
.places-app .places-map-wrap { min-height: 0; }
.places-app .places-map { height: 100%; border: 0; border-radius: 0; }

.places-list {
  flex: 1;
  overflow-y: auto;
  display: block;
  margin: 0;
  padding: 6px;
  list-style: none;
  scrollbar-width: thin;
}
.place {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  cursor: pointer;
  transition: background-color .15s;
}
.place:hover { transform: none; box-shadow: none; background: var(--line); }
.place:focus-visible { outline: 2px solid var(--topic-c); outline-offset: -2px; box-shadow: none; transform: none; }
.place[aria-current="true"] { background: color-mix(in srgb, var(--topic-c) 12%, transparent); }
.place-icon { display: grid; place-items: center; width: 36px; height: 30px; }
.place-icon img { width: 26px; height: 26px; margin: 0; }
.place-text { min-width: 0; }
.place-text b { display: block; font-size: var(--fs-m); font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place[aria-current="true"] .place-text b { color: var(--ink); }
.place .place-cat { font-size: 13px; }
.place-tip { display: none; grid-column: 1 / -1; font-size: var(--fs-s); line-height: 1.5; color: var(--muted); }
.place.show-tip .place-tip { display: block; }
.place-tip a { color: var(--ink); font-weight: 600; }

/* Esri popup in the site's style */
.places-map .esri-popup__main-container, .places-map .esri-popup calcite-panel { border-radius: 14px; }
.place-popup { font-family: var(--sans); }
.place-popup .pp-cat { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; font-family: var(--sc); font-size: 14px; font-weight: 700; letter-spacing: .06em; color: #6b7180; }
.place-popup .pp-cat img { width: auto; height: 18px; }
/* where it is and how far from the Quinta */
.place-popup .pp-where { display: block; margin: -2px 0 8px; font-size: 13px; color: #6b7180; }
.place-popup p { margin: 0 0 12px; font-family: "Lora", Georgia, serif; font-size: 15px; line-height: 1.55; color: #23314f; }
.place-popup .pp-go {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  background: #1f4fa0;
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.place-popup .pp-go:hover { opacity: .88; }

@media (max-width: 760px) {
  .places-app { grid-template-columns: 1fr; grid-template-rows: 340px auto; height: auto; }
  .places-app .places-map-wrap { order: -1; height: 340px; }
  .places-side { border-right: 0; border-top: 1px solid var(--line); }
  .places-list { max-height: 300px; }
  .places-side .place-chips { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .places-side .place-chips button { flex: none; }
}

/* Stay page: "find us" venue map + visible Google Maps button */
.venue-map-wrap { position: relative; }
.venue-map {
  height: 420px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}
.venue-map.failed { display: grid; place-items: center; padding: 20px; text-align: center; color: var(--muted); }
.map-btn {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: #1f4fa0;
  color: #fff;
  font: 600 14px var(--sans);
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(20, 30, 60, .25);
  transition: transform .2s var(--ease), box-shadow .2s;
}
.map-btn:hover { transform: translate(-50%, -2px); box-shadow: 0 10px 24px rgba(20, 30, 60, .3); }
.map-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.map-btn svg { width: 16px; height: 16px; fill: currentColor; }
@media (max-width: 760px) { .venue-map { height: 340px; } }

/* Algarve map: full-screen mode for the whole app (list + map) */
.places-fs svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.places-app.is-full {
  position: fixed;
  inset: 0;
  z-index: 200;
  height: 100vh;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  grid-template-columns: 340px minmax(0, 1fr);
}
html.map-full, html.map-full body { overflow: hidden; }
.places-app:fullscreen { width: 100%; height: 100%; }

/* Phones: minimap to the top-right so it never covers a popup */
@media (max-width: 760px) {
  .places-overview { top: 12px; bottom: auto; }
  .places-app.is-full { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .places-app.is-full .places-map-wrap { height: auto; }
  .places-app.is-full .places-list { max-height: 34vh; }
}
/* SDK 5.x adds an attribution line to every view; the main map shows it, the tiny inset doesn't need its own */
.places-overview .esri-attribution { display: none; }

/* =========================================================
   Footer on inner pages: previous and next page, and a line drawing
   of the village that leads home
   ========================================================= */

.street {
  max-width: 1000px;
  margin: clamp(16px, 3vw, 40px) auto 0;
  padding: 0 20px;
}
.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding-top: clamp(24px, 4vw, 36px);
  border-top: 1px solid var(--line);
}
.pager a { color: var(--muted); text-decoration: none; transition: color .2s; }
.pager :is(.prev, .next) {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 2px;
  font: 500 var(--fs-s) var(--sans);
}
.pager .next { justify-self: end; }
.pager .prev { justify-self: start; }
.pager :is(.prev, .next) svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pager a:hover { color: var(--text); }
.pager a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.street-view { display: grid; place-items: center; min-width: 48px; min-height: 48px; }
/* the village from the home page, tiny: day, or night with the windows lit */
.mini-village { position: relative; display: block; width: 112px; aspect-ratio: 640 / 271; transition: transform .3s var(--ease); }
.mini-village img { position: absolute; inset: 0; width: 100%; height: 100%; }
.mini-village .night { opacity: var(--night); transition: opacity var(--fade); }
.street-view:hover .mini-village { transform: translateY(-2px); }
.street .foot { margin: 0; padding: 14px 0 32px; border-top: 0; font-size: var(--fs-xs); }
.map-page .street { max-width: none; }

@media (max-width: 560px) {
  .pager { gap: 8px; }
}

/* =========================================================
   Touch: every control is at least 44 × 44 px (the visible
   shape can stay smaller; the hit area grows around it)
   ========================================================= */

.brand { min-height: 44px; }
.nav-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; }
.icon-btn { width: 44px; height: 44px; }
.pager :is(.prev, .next) { min-height: 44px; padding: 0 4px; }
.contact a, .wx-link a { display: inline-block; padding: 10px 0; }
.map-btn { min-height: 44px; }
.place-chips button, .places-side .place-chips button { min-height: 44px; }
@media (max-width: 1080px) {
  .nav-links a { display: flex; padding: 0 14px; }
}

/* Phones: script titles one size down, so "the Wedding Day" fits on a
   line, and a clear gap between a page title and its first section */
@media (max-width: 560px) {
  .script { font-size: 44px; }
  h2.script { font-size: 36px; }
}
.inv-head + .day { padding-top: clamp(20px, 4vw, 36px); }   /* padding: a margin would collapse into the header's */

/* Mirrored rows: the picture on the left, so the pages don't all lean the
   same way. On phones the picture leads the text. */
.inv-grid.flip { grid-template-columns: minmax(200px, 320px) minmax(0, 1fr); }
.inv-grid.flip > .art { order: -1; margin-left: 0; margin-right: auto; }
.day.flip { grid-template-columns: minmax(160px, 260px) minmax(0, 1fr); }
.day.flip > .day-art { order: -1; justify-self: start; }
@media (max-width: 760px) {
  .inv-grid.flip, .day.flip { grid-template-columns: 1fr; }
  .inv-grid.flip > .art, .day.flip > .day-art { justify-self: center; margin: 0 auto; }
}
/* Algarve: with the tile on the left, the sardine stays clear of the title */
.inv-grid.flip .tile-art .sardine { left: -10%; width: 110%; }

/* Rows with a small picture (Travel's shrimp, Weather's crabs): the picture
   column is exactly as wide as the picture (--side), the text sits right
   beside it, both centred vertically */
.inv-grid[style*="--side"] { grid-template-columns: minmax(0, 1fr) var(--side); align-items: center; }
.inv-grid.flip[style*="--side"] { grid-template-columns: var(--side) minmax(0, 1fr); }
.inv-grid[style*="--side"] > div { max-width: 600px; }
@media (max-width: 760px) {
  .inv-grid[style*="--side"], .inv-grid.flip[style*="--side"] { grid-template-columns: 1fr; }
}
/* "Faro": the script's tall capital F needs a smaller size to stay on the board */
.plaque text.small { font-size: 14.5px; }

/* Program: add the weekend to your calendar - a quiet row of three pill links */
.add-cal { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: -8px 0 clamp(28px, 5vw, 44px); }
.add-cal-label { display: inline-flex; align-items: center; gap: 10px; }
.add-cal .ico { width: 30px; height: 30px; color: var(--ink); }
/* the three buttons never wrap apart: one row, sharing the width on phones */
.add-cal-links { display: flex; flex-wrap: nowrap; gap: 8px; }
.add-cal a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent);
  border-radius: 999px;
  color: var(--ink);
  font: 500 var(--fs-s) var(--sans);
  text-decoration: none;
  transition: background-color .2s, border-color .2s;
}
.add-cal a:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); border-color: var(--ink); }
.add-cal a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Language: EN / CZ / DE, three small text buttons after RSVP; in the phone
   menu they sit in a row at the bottom. Only English exists so far. */
.lang { display: flex; align-items: center; margin-left: 8px; }
.lang button {
  min-width: 34px;
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--muted);
  font: 500 13px var(--sans);
  letter-spacing: .06em;
  cursor: pointer;
  transition: color .2s;
}
.lang button + button { border-left: 1px solid var(--line); }
.lang button:hover { color: var(--text); }
.lang button[aria-pressed="true"] { color: var(--text); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.lang button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
@media (max-width: 1080px) {
  .lang { justify-content: center; margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--line); }
  .lang button { min-width: 64px; font-size: 14px; }
}

/* Phones: in every row the text comes first and the picture follows it
   (the shrimp under "transfer", Sunday's oysters under its list, …) */
@media (max-width: 760px) {
  .inv-grid.flip > .art, .day.flip > .day-art { order: 0; }
}
@media (max-width: 560px) {
  .add-cal-links { width: 100%; }
  .add-cal-links a { flex: 1 1 0; justify-content: center; padding: 0 8px; }
}

/* Travel: the map sits level with the title and a little smaller, so the
   first screen is title, facts and map side by side */
.map-grid { grid-template-columns: minmax(0, 1fr) minmax(220px, 340px); align-items: start; }
.map-grid .map-art { max-width: 340px; margin-top: 6px; }
/* text-only sections keep a readable measure */
.prose.narrow { max-width: 600px; }
@media (max-width: 760px) {
  .map-grid { grid-template-columns: 1fr; }
  .map-grid .map-art { max-width: 330px; margin: 8px auto 0; }
}

/* A small watercolour beside a section title, like a doodle in the margin
   of the invitation: Travel's shrimp next to "transfer" */
.inv-head.with-doodle { display: flex; align-items: flex-end; gap: clamp(12px, 3vw, 28px); }
.inv-head.with-doodle .doodle { width: clamp(96px, 14vw, 150px); height: auto; margin-bottom: .2em; transform: rotate(-6deg); }

/* =========================================================
   Centred design: page and section titles sit in the middle; a title that
   shares a row with a picture keeps to its column. Text that stands alone
   under a centred title is centred too (.prose.center, 600 px).
   ========================================================= */
.inv-head { text-align: center; }
.day .prose { text-align: left; }
.add-cal { justify-content: center; }
.prose.center { max-width: 600px; margin-inline: auto; text-align: center; }
.facilities { margin-inline: auto; max-width: 760px; }
/* folded sections: the title in the middle, the + / – on the right */
.more > summary { position: relative; justify-content: center; padding: 0 52px; }
.more > summary::after { position: absolute; right: 0; top: 50%; translate: 0 -50%; }
/* a small watercolour on its own line above a centred title */
.vignette { display: block; width: clamp(100px, 13vw, 140px); height: auto; margin: 0 auto 4px; transform: rotate(-6deg); }
/* the Algarve: title on top, then the tile beside the text */
.algarve-intro { align-items: center; }
/* rows with a small picture sit as a centred group, not spread to the edges */
.inv-grid[style*="--side"] { max-width: 760px; margin-inline: auto; }
.inv-grid[style*="--side"] + .wx { margin-top: clamp(24px, 4vw, 40px); }
/* blocks under a centred title: centred as a block */
.inv-section > .prose > .facts-list { max-width: 620px; margin-inline: auto; }
.road-trip { margin-inline: auto; text-align: center; }
.gallery-all { margin: 8px auto 0; }
.algarve-intro { margin-top: 8px; }

/* =========================================================
   Footers in terracotta #B66238, full width, white text
   (inner pages: ‹ previous · tiny village · next ›; home: the names line)
   ========================================================= */
.street {
  max-width: none;
  margin: clamp(16px, 3vw, 40px) 0 0;
  padding: 0 max(20px, calc((100% - 960px) / 2));
  background: #b66238;
  color: #fff;
}
.street .pager { border-top: 0; padding-top: clamp(20px, 3vw, 28px); }
.street .pager a { color: rgba(255, 255, 255, .88); }
.street .pager a:hover { color: #fff; }
.street .pager a:focus-visible { outline-color: #fff; }
.street .foot { color: rgba(255, 255, 255, .8); }
.foot { background: #b66238; color: rgba(255, 255, 255, .85); border-top: 0; }
/* home: with no story section yet, the strip runs straight into the footer */
.strip:has(+ .story[data-storymap=""]) { margin-bottom: 0; }
.strip:has(+ .story[data-storymap=""]) ~ .foot { padding-top: 0; }

/* Program: the calendar label on top, the three buttons centred under it */
.add-cal { flex-direction: column; gap: 12px; }
/* Stay: the hotel's name in small caps above check in / check out */
.stay-name { margin: 0 0 10px; text-align: center; }

/* Intros with the title in the text column (Travel, Weather): the title is
   centred within that column, the picture sits beside the whole column */
.inv-grid > div > .inv-head { text-align: center; }

/* Travel: the torn map is exactly as tall as the title + facts beside it */
.map-grid { grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); align-items: stretch; }
.map-slot { position: relative; min-height: 320px; }
.map-slot .map-art { position: absolute; top: 0; bottom: 0; right: 0; width: auto; max-width: none; margin: 0; aspect-ratio: 723 / 922; }
.map-slot .map-art img { width: 100%; height: 100%; }

/* Weather: the sun on the left, as tall as the title and text beside it */
.weather-intro { grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); align-items: center; }
.weather-intro .prose { max-width: 600px; margin-inline: auto; }
.weather-intro + .wx { margin-top: clamp(24px, 4vw, 40px); }

@media (max-width: 760px) {
  .map-grid { grid-template-columns: 1fr; }
  .map-slot { min-height: 0; }
  .map-slot .map-art { position: static; max-width: 330px; margin: 8px auto 0; aspect-ratio: auto; }
  .map-slot .map-art img { height: auto; }
  .weather-intro { grid-template-columns: 1fr; }
  .weather-intro .art { max-width: 170px; margin: 0 auto; }
}

/* =========================================================
   Night: four special stars for our loved ones. They glow softly; hover,
   focus or a tap shows the name. Hidden (and not focusable) by day.
   ========================================================= */
.night-note {
  margin: .9em 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(13px, calc(var(--u) * 16), 17px);
  color: #f3e6cf;
  opacity: var(--night);
  transition: opacity var(--fade);
}
.memory-star {
  position: absolute;
  z-index: 9;
  left: calc(var(--x) / 1926 * 100%);
  top: calc((var(--y) + 360) / 1177 * 100%);
  width: max(32px, calc(var(--w) / 1926 * 100%));
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--fade), visibility 0s linear 1.2s;
  -webkit-tap-highlight-color: transparent;
}
:root[data-theme="night"] .memory-star { visibility: visible; opacity: 1; transition: opacity var(--fade) .5s, visibility 0s; }
.memory-star::before {                       /* the glow */
  content: "";
  position: absolute;
  inset: -55%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 232, 178, .55), rgba(255, 214, 150, .16) 55%, transparent);
  animation: memory-glow 4.5s ease-in-out infinite;
}
.memory-star:nth-of-type(2n)::before { animation-delay: -2.2s; }
@keyframes memory-glow { 50% { opacity: .55; transform: scale(.88); } }
.memory-star svg { position: relative; display: block; width: 100%; height: 100%; fill: #fff6df; filter: drop-shadow(0 0 3px rgba(255, 236, 190, .9)); transition: transform .3s var(--ease); }
.memory-star:is(:hover, :focus-visible, .open) svg { transform: scale(1.25) rotate(12deg); }
.memory-star:focus-visible { outline: 2px solid #fff6df; outline-offset: 4px; }
.tip.memory {
  display: grid;
  gap: 2px;
  padding: 9px 14px;
  border-radius: 12px;
  text-align: center;
  white-space: nowrap;
}
.tip.memory b { font: 600 14px var(--serif); }
.tip.memory span { font: italic 13px var(--serif); color: var(--muted); }
.memory-star:is(:hover, :focus-visible, .open) .tip { opacity: 1; transform: translate(var(--tx, -50%), 0); }

/* Subheadings take the colour of the title above them */
.script + .sc, .more > summary .script + .sc { color: var(--topic-c, var(--olive)); }
/* Stay: the hotel's name in the page's green, a size up */
.stay-name { color: var(--topic-c); font-size: var(--fs-l); }
/* Footer: the logo orange in white */
.foot-mark { width: 40px; background: #fff; transition: transform .3s var(--ease); }
.street-view:hover .foot-mark { transform: translateY(-2px) rotate(-4deg); }

/* =========================================================
   Night: the terracotta, as it looks after sunset
   - the names over the village: a warm peach, like lamplight (4.9 : 1 on the sky)
   - the strip and footers: a dusk terracotta with cream text
   ========================================================= */
:root[data-theme="night"] { --title: #f0b48c; }
:root[data-theme="night"] :is(.strip, .street, .foot) { background: #7d4128; color: #f7ebdc; }
:root[data-theme="night"] .street .pager a { color: rgba(247, 235, 220, .85); }
:root[data-theme="night"] .foot-mark { background: #f7ebdc; }
/* the script's long descenders (g, y, f) need room above the subheading */
.script + .sc { margin-top: .55em; }
h1.script + .sc { margin-top: 1em; }
h2.script + .sc { margin-top: .75em; }

/* Stay: the hotel's name as large as the check-in line beneath it */
.stay-name { font-size: 26px; letter-spacing: .06em; margin-bottom: 6px; }
/* Weather: a smaller sun (20 % less), and no line under the numbers */
.inv-grid.flip.weather-intro { grid-template-columns: minmax(160px, 256px) minmax(0, 1fr); }   /* 20 % smaller than the 320 px it was */
.wx { border-bottom: 0; }
@media (max-width: 760px) { .weather-intro .art { max-width: 136px; } }

/* The village's labels sit above everything else in the hero (the names,
   the logo, other hotspots) while they are showing */
.picture :is(.spot, .door, .lamp, .memory-star, .tree):is(:hover, :focus-visible, .open) { z-index: 30; }

/* Nav: RSVP in the terracotta (a warm peach at night) */
.nav-links .nav-cta, .nav-links .nav-cta:hover, .nav-links .nav-cta[aria-current="page"] { color: #fff; background: var(--title); }
.nav-links .nav-cta[aria-current="page"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--title); }
:root[data-theme="night"] .nav-links .nav-cta, :root[data-theme="night"] .nav-links .nav-cta:hover { color: #1d1f2e; }

/* Home strip: the glance is information (plain text); the pages are buttons -
   outlined tiles with a soft fill that lifts on hover, under their own title */
.strip-nav-title { margin-bottom: clamp(16px, 2.4vw, 22px); }
.strip-nav ul { gap: 12px; max-width: 980px; }
.strip-nav a {
  padding: 16px 6px 14px;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: 14px;
  background: rgba(255, 255, 255, .08);
  transition: background-color .2s, border-color .2s, transform .2s var(--ease);
}
.strip-nav a:hover { background: rgba(255, 255, 255, .2); border-color: #fff; transform: translateY(-2px); }
@media (max-width: 860px) { .strip-nav ul { gap: 8px; } }

/* =========================================================
   Phones: text centred. Facts, lists and day notes sit in the middle;
   bulleted lists lose their bullets so the centred lines read cleanly.
   ========================================================= */
@media (max-width: 760px) {
  .prose, .inv-grid > div, .day .prose, .day.full .prose { text-align: center; }
  .prose ul, .page .prose ul:not([class]) { padding-left: 0; list-style: none; }
  .facts-list > div { justify-items: center; text-align: center; }
  .facts-list dd span { display: block; }
  .inv-section > .prose > .facts-list { margin-inline: auto; }
  /* Weather: title, then the sun, then the text */
  .weather-intro > div { display: contents; }
  .weather-intro .inv-head { order: 1; }
  .weather-intro .art { order: 2; justify-self: center; margin: 0 auto; }
  .weather-intro .prose { order: 3; }
}
@media (max-width: 760px) { .inv-grid.flip.weather-intro { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .inv-grid.flip.weather-intro .inv-head { order: 1; }
  .inv-grid.flip.weather-intro > .art { order: 2; }
  .inv-grid.flip.weather-intro .prose { order: 3; }
}

/* the brand never wraps */
.brand { white-space: nowrap; }

/* =========================================================
   The Portuguese guitar (js/radio.js): a watercolour painting
   (assets/art/fado-guitar.webp, cut out of its paper), set down right of
   the yellow house's door as if someone had just gone inside. Click to play
   fado; while it plays it sways a little and notes drift up.
   ========================================================= */
.fado-guitar { z-index: 7; padding: 0; border: 0; background: none; }
.fado-guitar img { display: block; width: 100%; height: 100%; object-fit: contain; transform-origin: 50% 100%; filter: drop-shadow(calc(var(--u) * 2) calc(var(--u) * 3) calc(var(--u) * 3) rgba(70, 45, 20, .3)); transition: transform .3s var(--ease), filter var(--fade); }
:root[data-theme="night"] .fado-guitar img { filter: brightness(.72) saturate(.85); }
:root[data-theme="night"] .fado-guitar.playing img { filter: brightness(.92) drop-shadow(0 0 calc(var(--u) * 10) rgba(255, 200, 110, .5)); }
.fado-guitar:is(:hover, :focus-visible) img { transform: rotate(-3deg); }
.fado-guitar.playing img { animation: guitar-sway 1.66s ease-in-out infinite; }
@keyframes guitar-sway { 50% { transform: rotate(-2.5deg); } }
.fado-guitar:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.fado-guitar:is(:hover, :focus-visible) .tip, .fado-guitar.playing:hover .tip { opacity: 1; transform: translate(-50%, 0); }
.radio-note {
  position: absolute;
  left: 30%;
  top: 0;
  font: 400 max(13px, calc(var(--u) * 22)) var(--serif);
  color: #5a3420;
  pointer-events: none;
  animation: radio-note 2.6s ease-out forwards;
}
:root[data-theme="night"] .radio-note { color: #ffe3a8; }
@keyframes radio-note {
  0% { opacity: 0; transform: translate(0, 0) rotate(-8deg); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--drift), calc(var(--u) * -110)) rotate(10deg); }
}

/* The guitar stands on the pavement and casts a shadow: a soft one on the
   wall behind (light from the upper left) and a darker contact shadow where
   it touches the ground */
.fado-guitar img { filter: drop-shadow(calc(var(--u) * 7) calc(var(--u) * 3) calc(var(--u) * 4) rgba(80, 55, 25, .32)); }
.fado-guitar::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 8%;
  right: -12%;
  bottom: -2.5%;
  height: 7%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(70, 45, 20, .45), rgba(70, 45, 20, .15) 60%, transparent);
  pointer-events: none;
}
:root[data-theme="night"] .fado-guitar img { filter: brightness(.72) saturate(.85) drop-shadow(calc(var(--u) * 6) calc(var(--u) * 3) calc(var(--u) * 4) rgba(0, 0, 0, .35)); }
.fado-guitar img { filter: drop-shadow(calc(var(--u) * 9) calc(var(--u) * 4) calc(var(--u) * 5) rgba(80, 55, 25, .42)); }
.fado-guitar::after { left: 4%; right: -22%; bottom: -3.5%; height: 9%; background: radial-gradient(closest-side, rgba(70, 45, 20, .55), rgba(70, 45, 20, .2) 60%, transparent); }
.fado-guitar img { filter: drop-shadow(calc(var(--u) * 10) calc(var(--u) * 5) calc(var(--u) * 4) rgba(80, 55, 25, .5)); }
.fado-guitar::after { left: 25%; right: -55%; bottom: -4%; height: 10%; background: radial-gradient(closest-side, rgba(70, 45, 20, .5), rgba(70, 45, 20, .18) 65%, transparent); }
/* The painting's sun comes from the right (see the flower pot and the tree):
   the guitar's shadow falls to its left, on the wall and on the ground */
.fado-guitar img { filter: drop-shadow(calc(var(--u) * -10) calc(var(--u) * 5) calc(var(--u) * 4) rgba(80, 55, 25, .5)); }
.fado-guitar::after { left: -55%; right: 25%; }
:root[data-theme="night"] .fado-guitar img { filter: brightness(.72) saturate(.85) drop-shadow(calc(var(--u) * -6) calc(var(--u) * 3) calc(var(--u) * 4) rgba(0, 0, 0, .35)); }
