/* ASFOTOS — one stylesheet, three locales. No webfonts, no framework. */

:root {
  --bg: #0b0b0d;
  --bg-soft: #101014;
  --panel: #14141a;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.18);
  --fg: #f4f2ee;
  --muted: #a09c96;
  /* Gold, not orange: it is the metal already in the logo - the most saturated pixels of
     assets/img/logo-480.jpg are #946724 and #af8843 - so the accent agrees with the mark instead
     of arguing with it. The ink on top is near-black on purpose: white on gold measures about
     2.5:1, this is about 9:1. */
  --accent: #d4ac52;
  --accent-soft: rgba(212, 172, 82, 0.15);
  --accent-ink: #1a1206;
  --radius: 14px;
  --wrap: 1140px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3 { margin: 0 0 .5em; line-height: 1.1; letter-spacing: -0.02em; font-weight: 650; }

h1 { font-size: clamp(2.2rem, 5.4vw, 3.9rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.1rem; }

p { margin: 0 0 1em; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.kicker {
  margin: 0 0 .7em;
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.lede { font-size: 1.06rem; color: var(--muted); max-width: 62ch; }
.note { font-size: .85rem; color: var(--muted); margin: 0; }
.subhead { margin: 3.4rem 0 1.3rem; font-size: 1.25rem; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 11, 13, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex; align-items: center; gap: 18px;
  min-height: 60px; flex-wrap: wrap;
}

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .08em; }
.brand-logo {
  width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 9px; object-fit: cover;
  background: #191919;                 /* the logo's own background, so the tile edge blends */
  box-shadow: 0 0 0 1px var(--line);
}
.brand-name { font-size: .95rem; }

.site-nav { display: flex; gap: 18px; margin-left: auto; }
.site-nav a {
  font-size: .92rem; color: var(--muted); padding: 4px 0;
  border-bottom: 1px solid transparent; transition: color .2s, border-color .2s;
}

/* Desktop: pin the menu, so changing the language moves nothing.
   Every locale's labels are a different length - the nav runs 251px (en) / 275px (pt) /
   281.4px (uk), so the whole right-hand group slid up to 30px sideways on a language change,
   and the switcher moved ~1.5px further as the bold active label moved. Measured, not guessed;
   README has the table. min-width rather than width so a future longer label widens the menu
   instead of overflowing it (nowrap keeps it on one line). Applies above the mobile breakpoint
   only: below it the nav becomes its own full-width row of short language codes. */
@media (min-width: 881px) {
  .site-nav { min-width: 288px; justify-content: space-between; }
  .site-nav a { white-space: nowrap; }
  /* One fixed slot per language, wide enough for the label at the BOLD weight it takes when
     active (83.1 / 64.5 / 90.3px measured), so all three are identical in every locale. */
  .lang-link { text-align: center; }
  .lang-link:nth-child(1) { width: 86px; }
  .lang-link:nth-child(2) { width: 68px; }
  .lang-link:nth-child(3) { width: 94px; }
}
.site-nav a.is-current { color: var(--fg); border-bottom-color: var(--accent); }

/* Anchor jumps must clear the sticky header. --header-h is written by app.js from the
   header's real height, so this cannot drift when the nav wraps or the labels get longer. */
main section[id] { scroll-margin-top: calc(var(--header-h, 100px) + 12px); }

.lang-switch { display: flex; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang-link {
  font-size: .78rem; padding: 4px 10px; border-radius: 999px; color: var(--muted);
  transition: background .2s, color .2s;
}
.lang-link.is-active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* Full language name on wide screens, short code on narrow ones. The anchor carries the
   full name in aria-label, so the code is purely presentational. */
.lang-link .lang-short { display: none; }

/* ---------- hero ---------- */

.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem); }
/* Flex, not a fixed two-column grid: with no hero photograph the copy simply takes the
   full width instead of sitting in the left half of an empty grid. */
.hero-inner { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.hero-copy { flex: 1 1 26rem; min-width: 0; }
.hero-visual { flex: 1 1 20rem; min-width: 0; }
.hero-copy h1 { margin-bottom: .45em; }
/* The heading is the positioning line, so its first half carries the accent and the rest stays
   white: "Fotógrafo Desportivo" in gold, "em Portugal | Ginástica e Outras Modalidades" in the
   body colour. The two halves are separate keys in i18n, so no markup ever has to live in JSON. */
.hero-copy h1 .hl { color: var(--accent); }
.actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 1.6rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 12px 22px; border-radius: 999px;
  font-size: .94rem; font-weight: 600; font-family: inherit; cursor: pointer;
  border: 1px solid transparent; transition: transform .16s, background .2s, border-color .2s;
}
.btn-primary {
  position: relative; overflow: hidden;
  background: var(--accent); color: var(--accent-ink);
}

/* The sweep on the order button, ported from the reference at
   en.muzychenko.photos/sport-photo: a white bar, rotated 10deg and taller than the button, that
   crosses it in the first fifth of a five second cycle and then waits. overflow: hidden keeps it
   inside the pill. The reduced-motion block at the end of this file switches it off - a sweeping
   highlight is motion even though it moves no layout. */
.btn-primary::before {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 200%;
  opacity: .5; transform: translate(-100%, -25%) rotate(10deg);
  background: linear-gradient(to left, transparent 0%, #fff 40%, #fff 60%, transparent 100%);
  animation: btn-shine 5s ease 0s infinite;
}
@keyframes btn-shine {
  0%   { transform: translate(-100%, -25%) rotate(10deg); }
  20%  { transform: translate(100%, -25%) rotate(10deg); }
  100% { transform: translate(100%, -25%) rotate(10deg); }
}
.btn-ghost { border-color: var(--line-strong); color: var(--fg); }
.btn-disabled { border-color: var(--line); color: var(--muted); cursor: not-allowed; }

/* ---------- placeholders (no network images) ---------- */

.ph {
  position: relative; overflow: hidden; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.ph::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 26% 18%, rgba(212, 172, 82, .30), transparent 58%),
    radial-gradient(circle at 78% 82%, rgba(90, 130, 200, .22), transparent 60%);
}
.ph::after {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 34px 34px;
}
.tile-2::before { background: radial-gradient(circle at 70% 25%, rgba(212, 172, 82, .26), transparent 60%), radial-gradient(circle at 20% 80%, rgba(150, 90, 200, .22), transparent 62%); }
.tile-3::before { background: radial-gradient(circle at 40% 70%, rgba(90, 200, 180, .22), transparent 60%), radial-gradient(circle at 80% 20%, rgba(212, 172, 82, .26), transparent 58%); }
.tile-4::before { background: radial-gradient(circle at 55% 35%, rgba(200, 90, 130, .24), transparent 62%), radial-gradient(circle at 15% 85%, rgba(212, 172, 82, .20), transparent 60%); }
.tile-5::before { background: radial-gradient(circle at 30% 55%, rgba(255, 200, 90, .22), transparent 60%), radial-gradient(circle at 85% 15%, rgba(80, 140, 220, .22), transparent 58%); }
.tile-6::before { background: radial-gradient(circle at 65% 60%, rgba(212, 172, 82, .24), transparent 58%), radial-gradient(circle at 25% 20%, rgba(120, 200, 140, .18), transparent 60%); }

/* ---------- sections ---------- */

.section { padding: clamp(3rem, 7vw, 5.5rem) 0; border-top: 1px solid var(--line); }
.section-head { max-width: 68ch; margin-bottom: 2.4rem; }
.section-events { background: var(--bg-soft); }

/* ---------- events ---------- */

.events { display: grid; gap: 12px; }

.event {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 28px; align-items: center;
  padding: 24px 26px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .2s, transform .2s;
}

/* The photo is optional and none exists yet: an event renders one when its data names a file,
   and the box collapses to nothing when it does not, so the card is complete either way. It sits
   above the text as a banner - the usual shape for an event - and the name stays the first thing
   read, because it is what a reader is scanning for. */
.event-media { grid-column: 1 / -1; border-radius: calc(var(--radius) - 6px); overflow: hidden; background: var(--bg-soft); }
.event-media img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 7; object-fit: cover; }
.event-media:empty { display: none; }

.event-name { margin: 0 0 .4em; font-size: clamp(1.22rem, 2.3vw, 1.6rem); line-height: 1.15; letter-spacing: -0.01em; }
/* The event name is the internal link to that event's page: the anchor text is the query, and the
   card keeps its order button separate - reading and buying stay two different actions. */
.event-name-link { color: inherit; text-decoration: none; }
.event-name-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.events-all { margin: 20px 0 0; }
/* The link to the federation's own record. Quiet by design: it is the next step for the reader who
   wants to verify, not a competing call to action. */
.event-meta { display: flex; flex-wrap: wrap; gap: 2px 16px; align-items: baseline; margin: 0; font-size: .95rem; color: var(--muted); }
.event-dates { font-weight: 650; color: var(--fg); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.event-venue { color: var(--accent); }
.event-note { margin: .5em 0 0; font-size: .88rem; color: var(--muted); }
.event-cta { justify-self: end; }

/* ---- event page: one event per URL ---------------------------------------------------------- */
/* Everything here reuses the home page's tokens, so the two cannot drift apart visually. The only
   new shapes are the breadcrumb, the poster figure and the sibling links. */
.breadcrumbs { margin: 0 0 18px; font-size: .84rem; color: var(--muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li { display: flex; align-items: center; gap: 6px; }
.breadcrumbs li + li::before { content: "/"; color: var(--line); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover, .breadcrumbs a:focus-visible { color: var(--fg); }
.breadcrumbs [aria-current] { color: var(--fg); }

.event-page { padding: clamp(26px, 5vw, 54px) 0 clamp(40px, 6vw, 80px); }
.event-head { margin: 0 0 clamp(20px, 3vw, 30px); }
.event-head h1 { margin: 0 0 .35em; font-size: clamp(1.85rem, 5vw, 3rem); line-height: 1.05; letter-spacing: -0.02em; }
.event-head .event-meta { font-size: 1rem; }
.event-discipline { margin: .6em 0 0; font-size: .9rem; color: var(--muted); }

.event-poster { margin: 0 0 clamp(20px, 3vw, 30px); }
.event-poster img { display: block; width: 100%; height: auto; border-radius: var(--radius); background: var(--bg-soft); }
.event-poster figcaption { margin-top: 8px; font-size: .82rem; }

.event-body { max-width: 62ch; }
.event-body .actions { margin: 22px 0 18px; }
.event-links { display: grid; gap: 10px; margin-top: 14px; }
.event-link { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: calc(var(--radius) - 6px); text-decoration: none; transition: border-color .16s ease; }
.event-link:hover, .event-link:focus-visible { border-color: var(--accent); }
.event-link .event-name { font-size: 1.02rem; font-weight: 650; color: var(--fg); }
.archive-back { margin-top: 28px; }

.event-facts { display: grid; gap: 1px; margin: 6px 0 26px; padding: 0; }
.event-facts .fact { display: grid; grid-template-columns: minmax(96px, 26%) 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.event-facts dt { margin: 0; color: var(--muted); font-size: .86rem; }
.event-facts dd { margin: 0; font-size: .95rem; }
.event-block { margin: 0 0 22px; }
.event-block .subhead { margin: 0 0 .4em; }
.event-block p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.6; }
.actions-repeat { margin: 26px 0 18px; padding-top: 22px; border-top: 1px solid var(--line); }

.empty-state {
  padding: 34px 28px; background: var(--panel);
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: flex-start; gap: 16px;
}
.empty-state p { margin: 0; color: var(--muted); }

/* ---------- cards ---------- */
.tile figcaption {
  position: absolute; left: 12px; bottom: 10px; z-index: 2;
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
/* The denser four-across row. Nothing uses it since the trust block went to three cards - and a
   three-card block on this class leaves a fourth column empty, which is how it looks cramped
   rather than wrong. Match the class to the number of cards. */
.cards-2 { grid-template-columns: repeat(4, 1fr); }

.card {
  padding: 22px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.card h3 { margin-bottom: .4em; }
.card p { margin: 0; color: var(--muted); font-size: .93rem; }

/* ---------- about ---------- */

/* Text only now that the placeholder portrait is gone. Full width, but capped to a
   readable measure. */
.about-grid { display: block; }
.about-copy { max-width: 70ch; }
.about-copy p:last-child { color: var(--muted); }

/* ---------- contact & footer ---------- */

.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 1.8rem; }
.contact-card {
  display: flex; flex-direction: column; gap: 4px; padding: 22px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .2s, transform .2s;
}
.contact-label { font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.contact-value { font-size: 1.06rem; font-weight: 600; }

.site-footer { border-top: 1px solid var(--line); padding: 3rem 0 2.4rem; background: var(--bg-soft); }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 24px; align-items: start; }
.footer-brand p { margin: .5rem 0 0; }
.footer-social, .footer-legal { display: flex; flex-direction: column; gap: 7px; font-size: .9rem; }
.footer-copy { grid-column: 1 / -1; padding-top: 1.4rem; border-top: 1px solid var(--line); }

/* ---------- instagram posts ---------- */

/* Desktop: one row. Mobile keeps the vertical list (see the 880px block), because a
   horizontal track competes with Instagram's own swipe inside the embeds.

   align-items: stretch is what makes the three placeholders one uniform size. Each post
   reserves its own embed height (they differ: 634, 658 and 500 at desktop width), the row is
   only ever as tall as the tallest of them, and stretching the shorter two to match leaves the
   grid looking identical before and after the posts arrive - and means it is the same size on
   every load, not one that depends on which post loaded first. */
.ig-posts {
  display: flex; flex-wrap: nowrap; align-items: stretch; gap: 20px;
  margin: 0; padding: 0; list-style: none;
}
.ig-post {
  display: flex; flex-direction: column;   /* so the tile can fill the row height */
  flex: 1 1 0; min-width: 0; max-width: 540px;  /* Instagram's own embed maximum */
  /* A containing block for anything Instagram positions absolutely. */
  position: relative;
  /* A container, so the placeholder below can size itself from this post's own width on
     either layout: a column of the row on desktop, a full-width row on mobile. */
  container-type: inline-size;
}

/* The placeholder holds the exact height its embed will take, so nothing below the posts
   moves when they arrive. Instagram's embed is a fixed header/footer plus the media, which
   makes its height linear in the embed width above Instagram's own 326px minimum - so a
   calc() of the post's own width reproduces it exactly, where a plain aspect-ratio was
   ~220px short by the time the posts loaded. The numbers live beside their URLs in
   site.json because they describe a specific post; aspect-ratio is the fallback when a
   post has no measurement. */
.ig-post .tile {
  /* height, not min-height: the aspect ratio must not be able to override the measurement.
     At a 540px column post 3's 4:5 ratio wants 675px while its embed is 651px, so a min-height
     left the placeholder 24px taller than the content replacing it. aspect-ratio is only the
     fallback for a post with no measurement. */
  aspect-ratio: 4 / 5; height: var(--ig-media-h, auto); position: relative;
  /* Its own reserved height, deliberately NOT stretched to the tallest post. The embeds are
     622/646/488px tall, so stretching made the two shorter placeholders stand 36px and 170px
     bigger than the content that replaces them - which reads as the placeholder being wider
     than the embed. The ROW height still comes from the tallest post (align-items: stretch on
     .ig-posts), so nothing below the posts moves either way. aspect-ratio is the fallback for
     a post with no measurement. */
  flex: 0 0 auto;
  /* The default <figure> margin is 1em top and bottom, which would add that much to every
     row - the reservation would overshoot by exactly 2em and the page would still jump. */
  margin: 0;
}

/* A desktop row is 1096px of content (the 1140px wrap less 22px either side, less two 20px
   gaps), so its three columns are exactly 352px whatever the window does. Pin that, because
   the width is what fixes the embed height the placeholders reserve. flex-shrink stays on so a
   fourth post narrows the row instead of overflowing it. */
@media (min-width: 1180px) {
  .ig-post { flex: 0 1 352px; }
}

/* Instagram's embed is inserted unconstrained, and its own rules are the problem. embed.js
   REPLACES the blockquote (so pinning that alone achieves nothing - it is the one element that
   does not survive the swap) with an <iframe class="instagram-media"> carrying
   `position: absolute; width: 100%; min-width: 326px` inline. Absolutely positioned, its
   containing block is not the column, so that 100% resolved against the VIEWPORT: measured at
   1440px inside a 352px column, 916px past the edge, with the page scrolling sideways for about
   a second until something narrowed it. A percentage cannot be trusted here, and min-width: 0 is
   needed because 326px alone is wider than a narrow column. Pinning the frame to the container's
   own inline size - the same unit the height reservation uses - settles it whatever Instagram
   does with positioning. */
.ig-post .instagram-media,
.ig-post .instagram-media-rendered,
.ig-post iframe {
  margin: 0 !important; min-width: 0 !important;
  width: 100cqw !important; max-width: 100cqw !important;
}

/* The placeholder says it is working instead of just sitting there. Hidden when scripting is
   off - the .no-js class is dropped by the inline script in the head - because without JS
   nothing will ever replace these tiles, and a permanent "loading" would be a lie. */
.ig-loading {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  font-size: .84rem; color: var(--muted);
}
.no-js .ig-loading { display: none; }
.ig-spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--line-strong); border-top-color: var(--accent);
  animation: ig-spin 900ms linear infinite;
}
@keyframes ig-spin { to { transform: rotate(360deg); } }

/* ---------- 404 ---------- */

/* One page for every unmatched URL. It renders the real header (see src/partials/header.html),
   so the menu, the language switcher and the brand are all on it rather than a dead end. The body
   speaks the primary locale and offers the other two, because a 404 has no locale in the URL to
   read - app.js only narrows that down when the path itself says so (/en/typo). */
.nf-wrap { max-width: 640px; margin: 0 auto; padding: 9vh 0 13vh; text-align: center; }
.nf-wrap .kicker { margin: 0 0 .2rem; }
.nf-wrap h1 { margin: .2rem 0 .7rem; font-size: clamp(1.7rem, 5vw, 2.5rem); }
.nf-lead { margin: 0 0 .9rem; font-size: clamp(1.06rem, 2.4vw, 1.28rem); color: var(--fg); }
.nf-wrap .lede { margin: 0 auto 1.9rem; max-width: 46ch; }

/* The menu, offered as destinations - the same pill buttons as the rest of the page. */
.nf-actions {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 0 0 2.6rem;
}

/* The other languages, each in its own words, so nobody has to hunt for the switcher. */
.nf-langs { border-top: 1px solid var(--line); padding-top: 1.6rem; margin: 0 0 1.6rem; }
.nf-langs-title {
  margin: 0 0 .9rem; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.nf-langs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nf-lang {
  display: flex; flex-direction: column; gap: 2px; padding: .6rem .8rem; border-radius: 10px;
  text-decoration: none; border: 1px solid transparent;
}
.nf-lang-name { font-weight: 600; }
.nf-lang-lead { font-size: .9rem; color: var(--muted); }
.nf-mail { margin: 0; font-size: .9rem; color: var(--muted); }
.nf-mail a { color: var(--accent); }

/* ---------- reveal ---------- */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-in { opacity: 1; transform: none; }
/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .hero-visual { order: -1; }
  .cards, .cards-2 { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

/* The header gets its own, wider breakpoint than the rest of the page. The full language
   names plus the nav need roughly 840px; below that the switcher would wrap onto a second
   row and the sticky header would double in height. Here the nav becomes a compact
   horizontal row that scrolls sideways only if it has to. */
/* Instagram's iframe carries `min-width: 326px`, so three columns only work while each one is
   at least that wide: (viewport - 44px padding - 40px of gaps) / 3 >= 326 needs ~1062px. Below
   1100 the embeds used to overrun their columns by up to 60px and the page scrolled sideways,
   which is a placeholder and an embed that disagree about their width. Vertical below this, so
   every post gets the full column and the two always agree. */
@media (max-width: 1099px) {
  .ig-posts { display: grid; grid-template-columns: 1fr; gap: 26px; }
  /* width + auto margins rather than justify-items: center - a centred grid item is
     shrink-to-fit, and .ig-post is an inline-size container, so its content gives it nothing to
     fit and the column collapses to a couple of pixels. This centres the post where max-width
     (Instagram's own 540px ceiling) bites without collapsing it. */
  .ig-post { width: 100%; margin-inline: auto; }
}

@media (max-width: 880px) {
  /* The header had no padding at all, so the brand and the language pill sat flush against its
     top edge - the pill's own border touching the header's border, which is what read as
     cramped. Space above the first row, so the languages have room; the brand moves with them
     rather than sitting half a row higher. */
  .header-inner { min-height: 56px; gap: 8px 12px; padding-top: 10px; }

  /* Same treatment as the desktop menu: the four links are spread across the full width, so the
     first starts at the nav's left edge and the last ends at its right edge in every locale.
     Left-aligned they ended at 242px (en) / 265px (pt) / 271px (uk) of a 346px row, so every
     link's position moved with the language. */
  .site-nav {
    order: 3; width: 100%; margin: 0 0 10px;
    gap: 10px; justify-content: space-between;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  /* Four items fit comfortably at 390px in every locale; narrower than that it scrolls,
     which is why overflow-x stays auto. */
  /* 36px was too small to tap reliably, so the links keep a 44px touch target even
     though the row is only one line tall. */
  .site-nav a {
    display: inline-flex; align-items: center; min-height: 44px;
    white-space: nowrap; font-size: .88rem;
  }
  .lang-switch { margin-left: auto; }
  /* One fixed slot per language here too, sized on the bold weight the active code takes. The
     two-letter codes are within a pixel of each other, so one slot width covers all three and
     keeps every slot's edges identical in every locale. */
  .lang-link { min-width: 38px; text-align: center; }

  .brand-logo { width: 30px; height: 30px; border-radius: 8px; }
  .brand-name { font-size: .9rem; }
  .lang-link .lang-full { display: none; }
  .lang-link .lang-short { display: inline; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }

  .event { grid-template-columns: 1fr; gap: 14px; padding: 20px; }
  .event-cta { justify-self: stretch; }
  .event-cta .btn { width: 100%; }

  .cards, .cards-2 { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 20px; }
  .actions .btn { width: 100%; }
}

/* ---------- real photographs ---------- */

/* .shot replaces .ph when a real file is configured: the placeholder draws its own
   background, a photograph must fill the frame without distortion. */
.hero-visual.shot {
  position: relative; overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.hero-visual.shot img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.hero-visual.shot { aspect-ratio: 4 / 3; }

/* ---------- footer extras ---------- */

.handle { margin-left: 7px; color: var(--muted); font-size: .8rem; }

.link-btn {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; font-size: .9rem; color: inherit; text-align: left;
  cursor: pointer;
}

/* the contact grid holds the live channels — e-mail and Instagram — and however many cards
   are configured; auto-fit keeps it honest if one is removed or a phone is added back */
.contact-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ---------- legal documents (separate views, reached by hash) ---------- */

/* The terms are long, and a scrolled <dialog> was the wrong shape for them; a legal
   document also has to be readable and quotable. So both documents are built into the
   page and the hash picks one: #terms or #privacy makes that document the whole view and
   the site's own sections stand aside. CSS only, so it works with JavaScript off - which
   is exactly when someone may be reading the terms to check them. */
.legal-page { display: none; }
.legal-page:target {
  display: block;
  padding: 2.2rem 0 3.5rem;
  scroll-margin-top: calc(var(--header-h, 61px) + 12px);
}
body:has(.legal-page:target) main,
body:has(.legal-page:target) .site-footer { display: none; }

.legal-doc { max-width: 74ch; }
.legal-back {
  display: inline-block; margin-bottom: 1.5rem;
  color: var(--accent); font-size: .95rem; text-decoration: none;
}
.legal-title { margin: 0 0 1.5rem; font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.2; }
.legal-body h2 { margin: 2rem 0 .8rem; font-size: 1.15rem; }
.legal-body p,
.legal-body li { color: var(--muted); font-size: .95rem; line-height: 1.65; }
.legal-body ul,
.legal-body ol { margin: 0 0 1.2rem; padding-left: 1.3rem; }
.legal-body li { margin-bottom: .5rem; }
.legal-body li:last-child,
.legal-body p:last-child { margin-bottom: 0; }

/* ---------- hover states, only where a pointer can actually hover ----------
   A tap on a touch screen leaves :hover stuck on the last thing touched, so an unguarded
   hover rule keeps painting that element for the rest of the visit. On this site that read
   as a second current menu item: tap a nav entry, scroll, and both it and the section you
   scrolled to carried the accent underline. Every hover rule lives here, behind one guard,
   so that class of bug cannot come back one rule at a time. */
@media (hover: hover) {
  /* Hover brightens on purpose: the accent underline is what marks the current section, so a
     hovered entry that draws it reads as a second current one - the desktop twin of the stuck
     :hover bug this block exists for. Only one item can ever carry it. */
  .site-nav a:hover { color: var(--fg); }
  .lang-link:hover { color: var(--fg); }
  .btn:hover { transform: translateY(-1px); }
  .btn-primary:hover { background: #e3c072; }
  .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
  .btn-disabled:hover { transform: none; }
  .event:hover { border-color: var(--line-strong); transform: translateY(-2px); }
  .contact-card:hover { border-color: var(--accent); transform: translateY(-2px); }
  .footer-social a:hover, .footer-legal a:hover { color: var(--accent); }
  .nf-lang:hover { border-color: var(--line-strong); }
  .nf-lang:hover .nf-lang-name { color: var(--accent); }
  .link-btn:hover { color: var(--accent); }
  .legal-back:hover { text-decoration: underline; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .event:hover, .contact-card:hover { transform: none; }
  /* A sweeping highlight is motion even when it moves no layout. */
  .btn-primary::before { animation: none; opacity: 0; }
  /* A still ring still reads as "working", a spinning one is the thing to stop. */
  .ig-spinner { animation: none; }
}

/* The live chip. Two traps in two lines: the element ships with the `hidden` attribute, and a
   plain `display` rule would beat it and show the chip all year, so the visible state is the
   :not([hidden]) one; and the gold accent on the site is used for emphasis, not for state, so
   the chip carries a small red dot rather than a coloured background. */
.event-live, .chip-live { display: none; }
.event-live:not([hidden]), .chip-live:not([hidden]) {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .74rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  /* red letters on a dark pill: the accent gold is the site's emphasis colour, and a live state is
     not emphasis, it is a fact with a clock on it - the same red as the dot. */
  color: #d93a2b; background: rgba(12, 12, 12, .55);
  border: 1px solid rgba(217, 58, 43, .55); border-radius: 999px; padding: 4px 11px;
}
.event-live:not([hidden])::before, .chip-live:not([hidden])::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: #b3261e;
  box-shadow: 0 0 0 3px rgba(179, 38, 30, .18);
}
.event-live { margin: 2px 0 14px; }
.chip-live { margin: 0 0 9px; }
