/* Mobile-first, no framework. Palette: Alentejo fields (whitewash, wheat, clay, cork oak). */
:root {
  color-scheme: light;
  --bg: #f6f1e7;
  --surface: #fffdf8;
  --surface-now: #f1e6cc;
  --text: #2e2a22;
  --muted: #6f6754;
  --line: #e4d9c3;
  --accent: #ad4f28;
  --accent-2: #5b6b3a;
  --on-accent: #ffffff;
  --radius: 14px;
}
/* Dark tokens twice on purpose: light-dark() would say it once, but Safari only
   has it from 17.5 and iOS 16 visitors get broken colours. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1b1d16;
    --surface: #24271d;
    --surface-now: #343b24;
    --text: #efe8d8;
    --muted: #a9a28c;
    --line: #363a2b;
    --accent: #d98a4e;
    --accent-2: #9fae76;
    --on-accent: #1b1d16;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1b1d16;
  --surface: #24271d;
  --surface-now: #343b24;
  --text: #efe8d8;
  --muted: #a9a28c;
  --line: #363a2b;
  --accent: #d98a4e;
  --accent-2: #9fae76;
  --on-accent: #1b1d16;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; }
img { max-width: 100%; display: block; }

.container { max-width: 760px; margin: 0 auto; padding: 0 16px; }

.site-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--accent);
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--on-accent); font-weight: 800; font-size: 1.15rem; text-decoration: none;
}
/* The icon's clay tile matches the light header: a thin ring keeps its edge visible. */
.brand__icon { border-radius: 7px; box-shadow: 0 0 0 1.5px var(--on-accent); }
.site-header__actions { display: flex; align-items: center; gap: 4px; }
/* Inverted pill so it reads as the one call to action in the bar; 44px tap area via ::before. */
.support-link {
  position: relative;
  padding: 5px 12px; border-radius: 999px;
  background: var(--on-accent); color: var(--accent);
  font-size: .85rem; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.support-link::before { content: ""; position: absolute; inset: -7px 0; }
.theme-toggle {
  min-width: 44px; min-height: 44px; margin: -10px -10px -10px 0;
  border: 0; background: none; cursor: pointer;
  color: var(--on-accent); font-size: 1.25rem; line-height: 1;
}

/* Wrapped, not scrolled: a hidden scrollbar can't be dragged on desktop
   and resets on every navigation, hiding the active pill. */
.headline { margin: 20px 0 0; font-size: 1.5rem; line-height: 1.2; font-weight: 800; }
/* Named so only this phrase animates when the period changes (Turbo view transitions). */
.headline__when { display: block; color: var(--accent); view-transition-name: headline-when; }
/* Same line once the longest phrase fits (~480px); below that it stays on its
   own line so the headline height doesn't jump between periods. */
@media (min-width: 520px) { .headline__when { display: inline-block; } }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
/* No size morph and no stretching: "hoje?" and the long phrases differ a lot in
   width, so the default group animation would squash the text. */
::view-transition-group(headline-when) { animation: none; }
::view-transition-old(headline-when), ::view-transition-new(headline-when) {
  width: auto; height: 100%; object-fit: none; object-position: left top;
}
::view-transition-old(headline-when) { animation: headline-out 160ms ease-in both; }
::view-transition-new(headline-when) { animation: headline-in 240ms ease-out both; }
@keyframes headline-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes headline-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation-duration: 0.01ms; }
}

.pills { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 0 4px; }
/* Tap target ≥ 44px without making the pills look bigger. */
.pill { position: relative; }
.pill::before { content: ""; position: absolute; inset: -5px 0; }
.pill {
  flex: none;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  text-decoration: none;
  font-size: .9rem;
  white-space: nowrap;
}
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-top: 10px; }
.clear-filters { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: .9rem; }
.filters__selects { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: 1 1 100%; }
.select {
  width: 100%; min-width: 0;
  min-height: 44px; padding: 0 28px 0 12px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text);
  font: inherit; font-size: 1rem;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.pill.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }

.day h2 { font-size: 1rem; margin: 24px 0 10px; color: var(--muted); }

.card {
  display: flex; gap: 12px;
  margin-bottom: 10px;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
}
.card--now { background: var(--surface-now); }
.card-wrap { position: relative; }
.card-wrap .card__body { padding-right: 32px; }
.card__share {
  position: absolute; top: 2px; right: 2px;
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; background: none; color: var(--muted); cursor: pointer;
}
.card__share[hidden] { display: none; }

.card__share[data-copied]::after {
  content: attr(data-copied);
  position: absolute; top: 100%; right: 6px; padding: 4px 8px; border-radius: 6px;
  background: var(--text); color: var(--bg); font-size: .75rem; white-space: nowrap;
}
.card__img { width: 88px; height: 88px; object-fit: cover; border-radius: 10px; flex: none; }
.card__body { min-width: 0; }
.card__meta { margin: 0; font-size: .85rem; color: var(--accent-2); font-weight: 600; }
.card__title { margin: 2px 0 6px; font-size: 1rem; line-height: 1.3; }
.tag { font-size: .75rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 6px; padding: 0; list-style: none; }
.chip {
  padding: 2px 8px; border-radius: 999px;
  background: var(--line); color: var(--text);
  font-size: .75rem; font-weight: 600; line-height: 1.5;
}
.event .chips { margin: -4px 0 14px; }

.event { padding: 16px 0 32px; }
.back { display: inline-block; margin-bottom: 12px; color: var(--muted); text-decoration: none; }
/* Whole photo, never cropped: shrinks to the height cap keeping its ratio,
   on a full-width surface that fills the sides of portraits. */
.event__media {
  display: flex; justify-content: center;
  margin-bottom: 16px; overflow: hidden;
  border-radius: var(--radius); background: var(--surface-now);
}
.event__img { width: auto; height: auto; max-width: 100%; max-height: min(45vh, 360px); }
.event h1 { font-size: 1.5rem; line-height: 1.2; margin: 0 0 12px; }
.event__facts {
  display: grid; gap: 14px;
  margin: 0 0 16px; padding: 14px 16px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface-now);
}
.event__facts dt { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.event__facts dd { margin: 2px 0 0; font-size: 1.1rem; font-weight: 600; line-height: 1.3; }
.event__facts .fact__sub { font-size: .9rem; font-weight: 400; color: var(--muted); }
.event__facts .fact__sub a { display: inline-block; padding: 12px 0; margin: -12px 0; }
.event__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.button {
  padding: 10px 16px; border: 1px solid transparent; border-radius: 10px;
  background: var(--accent); color: var(--on-accent); text-decoration: none;
  font: inherit; font-weight: 600; cursor: pointer;
}
.button--ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.event__description { overflow-wrap: anywhere; }

.empty, .sync { color: var(--muted); }
.sync { font-size: .8rem; margin-top: 24px; }
.site-footer { padding: 24px 16px 40px; font-size: .8rem; color: var(--muted); }
.site-footer p { margin: 0; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 0 16px; margin-top: 4px; }
.site-footer__links a { display: inline-flex; align-items: center; min-height: 44px; }

.page { padding: 16px 0 32px; max-width: 65ch; }
.page h1 { font-size: 1.5rem; line-height: 1.2; margin: 0 0 16px; }
.page h2 { font-size: 1.05rem; margin: 24px 0 8px; }
.page p, .page li { line-height: 1.6; }
.page .updated { color: var(--muted); font-size: .85rem; }
