/* Sabido (sabido.pt) — «Tudo o que vale a pena saber.»
   Editorial, suíço, preto e branco com uma única cor de destaque. */

/* The two main fonts are preloaded (layout.php) and use font-display: optional, so the text never
   jumps when a font arrives late (CLS); on a very slow first visit the fallback font is kept. */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-var-latin.woff2") format("woff2");
  font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: optional;
}
@font-face {
  font-family: "Atkinson";
  src: url("../fonts/atkinson-next-latin.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: optional;
}
@font-face {
  font-family: "Atkinson";
  src: url("../fonts/atkinson-next-italic-latin.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}

:root {
  /* ── Palettes: 5 functional roles (all text pairs WCAG AAA, ≥ 7:1) ──────────────────
     Evolution (default). [data-theme="modern"] and [data-theme="dark"] override the roles;
     without a saved choice the page follows the system (light → Evolution, dark → Dark Mode). */
  --bg-main: #FFFFFF;
  --text-main: #121212;
  --bg-secondary: #F3F4F6;
  --accent: #990000;
  --interactive: #121212;            /* Clássico: black and white + one red — links are black, underlined */
  --link-hover: #990000;             /* links turn red on hover (8.9:1) */
  /* Derived roles, per palette */
  --on-accent: #FFFFFF;              /* text on --accent (8.9:1) */
  --on-interactive: #FFFFFF;         /* text on --interactive (18.7:1) */
  --text-muted: #505050;             /* secondary text: 8.1 on main, 7.3 on secondary */
  --accent-on-secondary: #990000;    /* accent used as text on --bg-secondary (8.1) */
  --interactive-on-secondary: #121212; /* links on --bg-secondary (17.0) */
  --line-soft: #DADAD6;              /* hairlines (not text) */
  --band-bg: #0D0D0D;                /* black bands: moon card, footer, call to action */
  --band-text: #F2F2F2;              /* 17.4 */
  --band-muted: #A3A3A3;             /* 7.7 */
  --band-line: #333333;
  --sun-yellow: #F2C94C;
  --moon-gold: #F1E6BF;
  /* Weather pictogram tones (decorative) */
  --wx-line: #121212; --wx-sun: #F2C94C; --wx-cloud: #E5E7EB; --wx-rain: #3B82C4; --wx-bolt: #F29A2E; --wx-snow: #7FB3E0; --wx-fog: #8A8F98;

  /* Aliases used by the components (kept so every rule reads the roles above) */
  --bg: var(--bg-main);
  --bg-2: var(--bg-secondary);
  --ink: var(--text-main);
  --ink-2: var(--text-muted);
  --line: var(--text-main);
  --accent-bg: var(--accent);
  --invert-bg: var(--band-bg);
  --invert-ink: var(--band-text);
  --invert-ink-2: var(--band-muted);
  --invert-line: var(--band-line);

  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-text: "Atkinson", "Atkinson Hyperlegible", Verdana, sans-serif;
  --gutter: 16px;
  --gap: 24px;
  --max: 1280px;
  color-scheme: light;
}

/* Modern Tech */
:root[data-theme="modern"] {
  --bg-main: #F8FAFC; --text-main: #0F172A; --bg-secondary: #E2E8F0; --accent: #005C4B; --interactive: #5B21B6; --link-hover: #0F172A;
  --on-accent: #FFFFFF; --on-interactive: #FFFFFF;
  --text-muted: #334155;               /* 9.8 on main, 8.4 on secondary */
  --accent-on-secondary: #0F172A;      /* #005C4B on #E2E8F0 is only 6.5: use the text colour */
  --interactive-on-secondary: #5B21B6; /* 7.3 */
  --line-soft: #CBD5E1;
  --band-bg: #0F172A; --band-text: #F1F5F9; --band-muted: #A9B6C8; --band-line: #1E293B;
  --wx-line: #0F172A; --wx-cloud: #CBD5E1; --wx-rain: #2563EB; --wx-fog: #64748B;
  color-scheme: light;
}

/* Dark Mode — applied when chosen, or by the system when nothing was chosen */
:root[data-theme="dark"] {
  --bg-main: #18181B; --text-main: #F4F4F5; --bg-secondary: #27272A; --accent: #FACC15; --interactive: #38BDF8; --link-hover: #F4F4F5;
  --on-accent: #18181B;                /* 11.6 (white on #FACC15 fails) */
  --on-interactive: #18181B;           /* 8.3 (white on #38BDF8 is 2.1) */
  --text-muted: #B4B4BC;               /* 8.9 on main, 7.2 on secondary */
  --accent-on-secondary: #FACC15;      /* 9.7 */
  --interactive-on-secondary: #F4F4F5; /* #38BDF8 on #27272A is only 7.0 → text colour, links stay underlined */
  --line-soft: #3F3F46;
  --band-bg: #09090B; --band-text: #F4F4F5; --band-muted: #A1A1AA; --band-line: #27272A;
  --wx-line: #F4F4F5; --wx-sun: #FACC15; --wx-cloud: #52525B; --wx-rain: #38BDF8; --wx-bolt: #FB923C; --wx-snow: #BAE6FD; --wx-fog: #A1A1AA;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg-main: #18181B; --text-main: #F4F4F5; --bg-secondary: #27272A; --accent: #FACC15; --interactive: #38BDF8; --link-hover: #F4F4F5;
    --on-accent: #18181B; --on-interactive: #18181B; --text-muted: #B4B4BC;
    --accent-on-secondary: #FACC15; --interactive-on-secondary: #F4F4F5; --line-soft: #3F3F46;
    --band-bg: #09090B; --band-text: #F4F4F5; --band-muted: #A1A1AA; --band-line: #27272A;
    --wx-line: #F4F4F5; --wx-sun: #FACC15; --wx-cloud: #52525B; --wx-rain: #38BDF8; --wx-bolt: #FB923C; --wx-snow: #BAE6FD; --wx-fog: #A1A1AA;
    color-scheme: dark;
  }
}

/* On secondary surfaces the accent and link colours switch to their AAA-safe variants. */
.tradition, .data tr.is-today > *, .ex, .halm__place, [data-surface="secondary"] {
  --accent: var(--accent-on-secondary);
  --interactive: var(--interactive-on-secondary);
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }
html.text-lg { font-size: 137.5%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-text); font-size: 1rem; line-height: 1.5;
  display: flex; flex-direction: column; min-height: 100vh;
}
.num, time, td, dd { font-variant-numeric: tabular-nums lining-nums; }
img, svg { max-width: 100%; }
a { color: var(--interactive); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; box-shadow: 0 0 0 7px var(--sun-yellow); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 800; line-height: 1.05; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 7vw, 3.6rem); font-stretch: 105%; }
p { margin: 0 0 0.9rem; }

.sr-only, .place__panel label {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -9999px; z-index: 40; }
.skip:focus { left: var(--gutter); top: 12px; background: var(--bg); padding: 10px 16px; border: 2px solid var(--ink); }

/* Small labels ("etiquetas") */
.tag-label, .secno, .kicker {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  font-family: var(--font-display); font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink);
}
.tag-label::before { content: ""; width: 10px; height: 10px; background: var(--accent); flex-shrink: 0; }

/* ---- Brand + header ------------------------------------------------- */
.header { position: relative; }
.header__inner { border-bottom: 2px solid var(--line); }
.header__inner { max-width: none; margin: 0; padding: 10px max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; min-height: 68px; }
.logo {
  font-family: var(--font-display); font-weight: 900; font-stretch: 108%; font-size: 2.1rem;
  letter-spacing: -0.035em; line-height: 1; text-decoration: none; color: var(--ink);
  display: inline-flex; align-items: flex-end; padding-top: 0.2em;
}
.logo:hover { color: var(--ink); }
.logo__i { position: relative; display: inline-block; }
/* The dot of the i is the brand's graphic element: a square in the accent colour. */
.logo__i::after {
  content: ""; position: absolute; left: 50%; top: 0.01em; width: 0.21em; height: 0.21em;
  background: var(--accent); transform: translateX(-50%);
}
.tagline { font-size: 0.86rem; color: var(--ink-2); margin: 0; }
.nav { margin-left: auto; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 18px; }
.nav a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; text-decoration: none; }
.nav a:hover { text-decoration: underline; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--accent); }
.nav__toggle { display: none; }
@media (max-width: 899px) {
  .js .nav__toggle { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 2px solid var(--ink); background: transparent; color: var(--ink); font-weight: 700; }
  .js .nav__toggle[aria-expanded="true"] { background: var(--ink); color: var(--bg); }
  .js .nav ul { display: none; }
  .js .nav.is-open ul { display: flex; position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: var(--bg); border-bottom: 2px solid var(--line); flex-direction: column; padding: 8px var(--gutter) 16px; }
}

/* Almanaque sub-bar (concelho picker, text size) */
.subbar { border-bottom: 1px solid var(--line-soft); }
.subbar__inner { max-width: var(--max); margin: 0 auto; padding: 10px var(--gutter); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.masthead { display: flex; flex-direction: column; gap: 18px; padding-top: 4px; }
.place { position: relative; flex: 1 1 100%; }
@media (min-width: 700px) { .place { flex: 0 1 380px; } }
.place > summary {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 14px;
  border: 2px solid var(--ink); background: var(--bg); color: var(--ink); cursor: pointer; list-style: none;
}
.place > summary::-webkit-details-marker { display: none; }
.place__pin { flex-shrink: 0; stroke: var(--accent); }
.place__text { display: flex; flex-direction: column; flex-grow: 1; line-height: 1.2; min-width: 0; }
.place__name { font-size: 1.05rem; font-weight: 800; }
.place__sub { font-size: 0.83rem; color: var(--ink-2); }
.place__action { font-size: 0.89rem; font-weight: 700; text-decoration: underline; }
.place[open] .place__chev { transform: rotate(180deg); }
.place__panel { position: absolute; z-index: 25; top: calc(100% + 6px); left: 0; right: 0; display: flex; gap: 8px; padding: 12px; background: var(--bg); border: 2px solid var(--ink); }
.place__panel input, .search input, .field {
  flex: 1 1 auto; min-width: 0; min-height: 52px; padding: 8px 12px; font: inherit; color: var(--ink);
  background: var(--bg); border: 2px solid var(--ink);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px;
  border: 2px solid var(--ink); background: var(--ink); color: var(--bg); font: inherit; font-weight: 700; text-decoration: none;
}
.btn:hover { background: var(--accent-bg); border-color: var(--accent-bg); color: var(--on-accent); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--small { min-height: 44px; padding: 0 14px; font-size: 0.89rem; }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.textsize { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; min-height: 44px; padding: 0 14px; border: 2px solid var(--ink); background: transparent; color: var(--ink); font-size: 0.89rem; font-weight: 700; }
.textsize[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.theme { display: inline-flex; align-items: center; gap: 6px; }
.theme__label { font-size: 0.89rem; font-weight: 700; }
.theme__select { min-height: 44px; padding: 0 30px 0 10px; font: inherit; font-size: 0.89rem; font-weight: 700; color: var(--ink); background-color: var(--bg); border: 2px solid var(--ink); border-radius: 0;
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.textsize__icon { display: flex; align-items: baseline; gap: 1px; font-family: var(--font-display); font-weight: 800; }
.textsize__icon span:first-child { font-size: 14px; } .textsize__icon span:last-child { font-size: 21px; }

/* ---- Main ----------------------------------------------------------- */
main { width: 100%; max-width: var(--max); margin: 0 auto; padding: 16px var(--gutter) 56px; display: flex; flex-direction: column; gap: var(--gap); flex-grow: 1; }
.lede { font-size: 1.15rem; line-height: 1.5; max-width: 46rem; margin: 0; }
.page-title { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.page-title p { margin: 0; color: var(--ink-2); max-width: 46rem; }
.page-title .lede { color: var(--ink); }
.crumbs { font-size: 0.83rem; color: var(--ink-2); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs li + li::before { content: "/"; margin-right: 4px; }
.crumbs a, .crumbs span { display: inline-block; padding-block: 6px; }
.note { font-size: 0.86rem; color: var(--ink-2); }
.pill { display: inline-flex; align-items: center; padding: 1px 7px; border: 1px solid currentColor; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.is-holiday { color: var(--accent); }

/* ---- Edition (homepage) --------------------------------------------- */
.edition-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: end; padding: 6px 0 10px; border-bottom: 2px solid var(--line); }
.edition-head__day { font-family: var(--font-display); font-weight: 900; font-size: clamp(3.6rem, 16vw, 6.5rem); line-height: 0.78; letter-spacing: -0.045em; }
.edition-head__month { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.15rem, 4.6vw, 2rem); line-height: 0.92; text-transform: uppercase; font-stretch: 112%; }
.edition-head__meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; font-size: 0.89rem; color: var(--ink-2); padding-top: 8px; }
.edition-head__meta strong { color: var(--ink); }

.edition-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px var(--gap); }
.module { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 2px solid var(--line); min-width: 0; }
.module > h2 { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.module > h2::before { content: ""; width: 10px; height: 10px; background: var(--accent); }
.module__title { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.5rem, 4vw, 2rem); line-height: 1.08; margin: 0; }
.module__title a { text-decoration: none; }
.module__title a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.module__lead { margin: 0; color: var(--ink-2); }
.module--big .module__title { font-size: clamp(2.1rem, 6vw, 3.6rem); font-stretch: 105%; }
.module--statement .module__title { font-size: clamp(2rem, 5.5vw, 3rem); }
.bignum { font-family: var(--font-display); font-weight: 900; font-size: clamp(2.8rem, 9vw, 5rem); line-height: 0.9; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.feature { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.feature__text { display: flex; flex-direction: column; gap: 12px; }
.media { margin: 0; }
.media svg, .media img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background: var(--bg-2); }
.media figcaption { font-size: 0.78rem; color: var(--ink-2); padding-top: 6px; }
.card-svg__bg { fill: var(--ink); } .card-svg__accent { fill: var(--accent); }
.card-svg__big { fill: var(--bg); font-family: var(--font-display); font-weight: 900; letter-spacing: -0.03em; }
.card-svg__cap { fill: var(--bg); font-family: var(--font-display); font-weight: 700; font-size: 44px; letter-spacing: 0.06em; }

.history { list-style: none; margin: 0; padding: 0; }
.history li { display: grid; grid-template-columns: 5.4rem minmax(0, 1fr); gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.history li:last-child { border-bottom: 0; }
.history__year { font-family: var(--font-display); font-weight: 900; font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.history__title { font-weight: 800; font-size: 1.1rem; line-height: 1.25; margin: 0 0 4px; }
.history__title a { text-decoration: none; }
.history__title a:hover { text-decoration: underline; }
.history p { margin: 0; color: var(--ink-2); font-size: 0.95rem; }

.explore { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0 var(--gap); }
.explore li { border-top: 1px solid var(--line-soft); padding: 12px 0; }
.explore a { text-decoration: none; font-weight: 800; }
.explore a:hover { text-decoration: underline; }
.explore .note { display: block; font-weight: 400; margin-top: 2px; }

.almanac-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); border: 2px solid var(--line); }
.almanac-strip > * { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.almanac-strip .big { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; line-height: 1.1; display: block; }
.almanac-strip a { text-decoration: none; }
.almanac-strip a:hover .big { text-decoration: underline; }
@media (min-width: 700px) { .almanac-strip > * { border-bottom: 0; border-right: 1px solid var(--line-soft); } .almanac-strip > *:last-child { border-right: 0; } }

.cta { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 22px; background: var(--invert-bg); color: var(--invert-ink); }
.cta h2 { color: var(--invert-ink); font-size: clamp(1.5rem, 4vw, 2.2rem); }
.cta p { margin: 0; color: var(--invert-ink-2); }
.cta .btn { background: var(--invert-ink); color: var(--invert-bg); border-color: var(--invert-ink); justify-self: start; }
.cta .btn:hover { background: var(--accent-bg); border-color: var(--accent-bg); color: var(--on-accent); }

/* ---- Article -------------------------------------------------------- */
.article { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.article__head { display: flex; flex-direction: column; gap: 12px; }
.article__meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.86rem; color: var(--ink-2); }
.article__title { font-size: clamp(2.3rem, 7vw, 4.2rem); font-stretch: 105%; }
.article__lead { font-size: 1.25rem; line-height: 1.4; margin: 0; max-width: 42rem; }
.article__body { max-width: 40rem; font-size: 1.08rem; line-height: 1.65; }
.article__body p { margin-bottom: 1.1rem; }
.article__main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.article__aside { display: flex; flex-direction: column; gap: 20px; }
.cite { font-size: 0.72em; vertical-align: super; line-height: 0; margin-left: 1px; }
.cite a { text-decoration: none; font-weight: 700; color: var(--accent); padding: 0 1px; }
.sources { list-style: decimal; margin: 0; padding-left: 1.4rem; max-width: 52rem; }
.sources > li { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.sources blockquote { margin: 6px 0 0; padding-left: 12px; border-left: 3px solid var(--accent); color: var(--ink-2); font-size: 0.92rem; }
.sources blockquote + blockquote { margin-top: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 10px; border: 1px solid var(--ink); text-decoration: none; font-size: 0.89rem; }
.tags a::before { content: "#"; color: var(--accent); margin-right: 2px; }
.banner { padding: 10px 14px; border: 2px dashed var(--accent); font-weight: 700; }

.alist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 28px var(--gap); }
.alist li { display: flex; flex-direction: column; gap: 8px; border-top: 2px solid var(--line); padding-top: 12px; }
.alist__title { font-size: 1.35rem; line-height: 1.12; }
.alist__title a { text-decoration: none; }
.alist__title a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.alist p { margin: 0; color: var(--ink-2); }
.catgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); column-gap: var(--gap); border-top: 2px solid var(--line); }
.catgrid a { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; min-height: 64px; padding: 16px 2px; border-bottom: 1px solid var(--line-soft); text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; }
.catgrid a:hover { color: var(--accent); }
.catgrid .note { font-family: var(--font-text); font-weight: 400; }
.search { display: flex; gap: 8px; max-width: 40rem; }
.daynav { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.daynav form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.daynav select { min-height: 48px; padding: 0 10px; font: inherit; border: 2px solid var(--ink); background: var(--bg); color: var(--ink); }

/* ---- Almanaque components (restyled to the Sabido system) ------------ */
.masthead__row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.masthead__day { display: flex; flex-wrap: wrap; align-items: stretch; gap: 18px 24px; }
.datecard { display: flex; align-items: stretch; border: 2px solid var(--line); flex: 0 1 auto; }
.datecard__block { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 110px; padding: 10px 0 12px; background: var(--ink); color: var(--bg); }
.datecard__block span { font-size: 0.78rem; font-weight: 700; line-height: 1; text-transform: uppercase; letter-spacing: 0.06em; }
.datecard__block .datecard__num { font-family: var(--font-display); font-weight: 900; font-size: 4.2rem; line-height: 0.95; letter-spacing: -0.03em; }
.datecard__text { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 12px 20px; min-width: 0; }
.datecard__weekday { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; line-height: 1.05; }
.datecard__date { font-size: 1rem; }
.datecard__meta { font-size: 0.89rem; color: var(--ink-2); }
.jump { display: flex; flex-direction: column; justify-content: center; gap: 8px; flex: 1 1 22rem; }
.jump__label { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.jump__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; }
.jump__grid a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 68px; border: 2px solid var(--ink); color: var(--ink); background: var(--bg); text-decoration: none; font-weight: 700; }
.jump__grid a:hover { background: var(--ink); color: var(--bg); }

.lua { display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; background: var(--invert-bg); color: var(--invert-ink); }
.lua__disc { display: flex; align-items: center; justify-content: center; padding: 24px 0; background: var(--band-bg); }
.lua__disc svg { width: min(78vw, 340px); height: auto; }
.lua__body { display: flex; flex-direction: column; gap: 18px; padding: 24px 20px; min-width: 0; }
.lua__head { display: flex; align-items: center; gap: 10px; }
.lua__head h2 { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--invert-ink); }
.lua__head .aside { margin-left: auto; font-size: 0.86rem; color: var(--invert-ink-2); }
.lua__title { display: flex; flex-direction: column; gap: 6px; }
.lua__name { font-family: var(--font-display); font-size: clamp(2.4rem, 8vw, 3.6rem); font-weight: 900; line-height: 0.95; letter-spacing: -0.02em; }
.lua__sub { font-size: 1.1rem; color: var(--invert-ink-2); }
.lua__sub strong { color: var(--moon-gold); }
.lua a { color: var(--invert-ink); }
.cells { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; background: var(--invert-line); border: 1px solid var(--invert-line); }
.cells > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; background: var(--invert-bg); }
.cells dt { font-size: 0.83rem; color: var(--invert-ink-2); }
.cells dd { margin: 0; font-family: var(--font-display); font-size: 2rem; font-weight: 800; line-height: 1.1; }
.cells dd small { font-size: 1rem; font-weight: 700; }
.lua__cycle { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.phases { display: grid; grid-template-columns: repeat(4, minmax(72px, 96px)); gap: 6px; margin: 0; padding: 0; list-style: none; text-align: center; }
.phases li { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; font-size: 0.86rem; color: var(--invert-ink-2); line-height: 1.2; }
.phases li strong { color: var(--invert-ink); }
.phases li.is-today { outline: 2px solid var(--invert-ink); outline-offset: -2px; color: var(--invert-ink); font-weight: 700; }
.phases svg { width: 30px; height: 30px; }
.next-phase { margin: 0; flex: 1 1 16rem; padding: 12px 16px; border: 1px solid var(--invert-line); font-size: 1rem; line-height: 1.4; }
.lua__body > .next-phase { flex: none; }

.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); align-items: start; }
.col { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.card { display: flex; flex-direction: column; border-top: 2px solid var(--line); min-width: 0; }
.card__head { display: flex; align-items: center; gap: 8px; padding: 12px 0 4px; color: var(--ink); }
.card__head h2 { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.card__head svg { width: 20px; height: 20px; stroke: var(--accent); flex-shrink: 0; }
.card__head .aside { margin-left: auto; font-size: 0.83rem; color: var(--ink-2); }
.card__body { display: flex; flex-direction: column; gap: 14px; padding: 8px 0 4px; }
.card__body > * { margin: 0; }
.card__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.card h3 { font-family: var(--font-text); font-size: 1.05rem; font-weight: 800; }
.headline { font-family: var(--font-display); font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 800; line-height: 1.08; }

.sun { display: grid; grid-template-columns: auto minmax(60px, 1fr) auto; align-items: end; gap: 12px; }
.sun__end { align-items: flex-end; text-align: right; }
.sun__time { display: flex; flex-direction: column; gap: 2px; }
.sun__label { display: flex; align-items: center; gap: 6px; font-size: 0.92rem; color: var(--ink-2); }
.sun__label svg { stroke: var(--accent); }
.sun__big { font-family: var(--font-display); font-size: clamp(2.2rem, 7vw, 3rem); font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.sun__arc { width: 100%; height: auto; aspect-ratio: 220 / 90; max-height: 120px; overflow: visible; }
.sun__arc .track { fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-dasharray: 4 5; }
.sun__arc .done { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.sun__arc .ground { stroke: var(--ink); stroke-width: 2; }
.sun__arc .dot { fill: var(--sun-yellow); stroke: var(--ink); stroke-width: 2.5; }
.sun__delta { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }

.kv, .data { width: 100%; border-collapse: collapse; }
.kv th, .kv td { padding: 9px 0; border-bottom: 1px solid var(--line-soft); text-align: left; }
.kv th { font-weight: 400; color: var(--ink-2); }
.kv td { text-align: right; font-weight: 700; }
.kv tr:last-child th, .kv tr:last-child td { border-bottom: 0; }
.table-scroll { overflow-x: auto; }
.data th, .data td { padding: 9px 8px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.data thead th { font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); border-bottom: 2px solid var(--line); }
.data .n { text-align: right; }
.data tr.is-today > * { background: var(--bg-2); font-weight: 800; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.list li:last-child { border-bottom: 0; }
.list .when { font-weight: 700; }
.links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 2px 20px; }
.links a { display: inline-flex; align-items: center; min-height: 44px; }
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 6px; }
.tiles a { display: flex; align-items: center; min-height: 52px; padding: 6px 12px; border: 2px solid var(--ink); text-decoration: none; font-weight: 700; color: var(--ink); }
.tiles a:hover { background: var(--ink); color: var(--bg); }
.plain-list { margin: 0; padding-left: 1.2rem; }
.plain-list li { margin-bottom: 6px; }
.with-icon { display: inline-flex; align-items: center; gap: 8px; }
.with-icon svg { width: 24px; height: 24px; flex-shrink: 0; }
a.on-color { color: inherit; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: var(--gap); }
.pager { display: flex; flex-wrap: wrap; gap: 8px; }

.wx { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: stretch; }
.wx__now { display: flex; flex-direction: column; justify-content: center; }
.wx__type { font-size: 1.1rem; font-weight: 800; line-height: 1.25; }
.wx__t { display: flex; flex-direction: column; padding: 8px 12px; min-width: 6.5rem; border: 2px solid var(--ink); }
.wx__t .label { font-size: 0.83rem; color: var(--ink-2); }
.wx__big { font-family: var(--font-display); font-size: 2.3rem; font-weight: 900; line-height: 1.05; }
.wx__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0; margin: 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.wx__facts > div { padding: 10px 12px 10px 0; }
.wx__facts dt { display: flex; align-items: center; gap: 6px; color: var(--ink-2); }
.wx__facts dd { margin: 0; font-weight: 700; }
.alert { display: flex; gap: 10px; padding: 12px 14px; border: 2px solid; }
.alert svg { flex-shrink: 0; }
.alert--yellow { background: #FFF6D6; border-color: #8A6D00; color: #0D0D0D; }
.alert--orange { background: #FFE6D2; border-color: #B45309; color: #0D0D0D; }
.alert--red { background: #FDE0DD; border-color: #A8231C; color: #0D0D0D; }
.garden { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 16px; }
.garden h3, .card--horta h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.garden p { margin: 0; }
.tradition { display: flex; gap: 12px; padding: 12px 14px; background: var(--bg-2); }
.tradition svg { flex-shrink: 0; }
.tradition p { margin: 0; }
.moon-cal { width: 100%; min-width: 34rem; border-collapse: collapse; table-layout: fixed; }
.moon-cal th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); padding: 6px 0; }
.moon-cal td { text-align: center; vertical-align: top; padding: 8px 2px 10px; border-top: 1px solid var(--line-soft); height: 6.2rem; }
.moon-cal td svg { display: block; margin: 4px auto; width: 34px; height: 34px; }
.moon-cal__d { display: block; font-weight: 800; }
.moon-cal__pct { display: block; font-size: 0.8rem; color: var(--ink-2); }
.moon-cal__p { display: block; font-size: 0.8rem; font-weight: 800; }
.moon-cal td.is-today { outline: 2px solid var(--ink); outline-offset: -2px; }

.proverb { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px 32px; align-items: center; margin: 0; padding: 22px 0; border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); }
.proverb figcaption { display: flex; align-items: center; gap: 10px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.proverb blockquote { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.7rem, 5vw, 2.5rem); line-height: 1.12; text-wrap: pretty; }
.proverb__note { grid-column: 1 / -1; margin: 0; }

.ad { display: flex; flex-direction: column; gap: 6px; }
.ad__label { font-size: 0.78rem; color: var(--ink-2); }
.ad__slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.ad__slot--box { height: 280px; } .ad__slot--band { height: 250px; }
.ad__slot--dev { border: 2px dashed var(--line-soft); color: var(--ink-2); text-align: center; }

/* Consent banner: not a modal, never blocks reading; equal-weight buttons. */
.consent { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--bg); border-top: 3px solid var(--line); box-shadow: 0 -2px 0 var(--bg); }
.consent__inner { max-width: var(--max); margin: 0 auto; padding: 14px var(--gutter); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.consent__title { font-size: 1rem; width: 100%; }
.consent p { margin: 0; flex: 1 1 28rem; }
.consent__actions { display: flex; gap: 8px; }

/* ---- Footer --------------------------------------------------------- */
.footer { background: var(--invert-bg); color: var(--invert-ink); padding: 36px 0 40px; }
.footer a { color: var(--invert-ink); }
.footer__inner { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.footer .logo { color: var(--invert-ink); font-size: 2.4rem; }
.footer__tagline { color: var(--invert-ink-2); margin: 10px 0 0; }
.footer h2 { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--invert-ink-2); margin-bottom: 10px; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li a { display: inline-flex; align-items: center; min-height: 40px; text-decoration: none; }
.footer li a:hover { text-decoration: underline; }
.footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 24px; }
.footer__data { font-size: 0.83rem; color: var(--invert-ink-2); margin: 0; }
.footer .tiles a { border-color: var(--invert-ink-2); color: var(--invert-ink); }
.footer .tiles a:hover { background: var(--invert-ink); color: var(--invert-bg); }
.footer .tiles a.is-strong { background: var(--invert-ink); color: var(--invert-bg); }
.holiday-card { display: flex; gap: 12px; padding: 16px; background: var(--accent-bg); color: var(--on-accent); }
.holiday-card div { display: flex; flex-direction: column; gap: 2px; }
.holiday-card .big { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; line-height: 1.2; }
.footer :focus-visible { outline-color: var(--band-text); }
.footer__theme { margin-top: 18px; }
.footer__theme .theme__label { color: var(--invert-ink-2); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.footer__theme .theme__select { color: var(--invert-ink); background-color: var(--invert-bg); border-color: var(--invert-ink-2); }

/* ---- Wider screens -------------------------------------------------- */
@media (min-width: 700px) {
  :root { --gutter: 28px; }
  .cells { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .proverb { grid-template-columns: 260px minmax(0, 1fr); }
  .cta { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 28px 32px; }
  .cta .btn { justify-self: end; }
  .feature { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
}
@media (min-width: 1000px) {
  :root { --gutter: 40px; --gap: 32px; }
  .edition-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; }
  .span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; }
  .lua { grid-template-columns: 420px minmax(0, 1fr); }
  .lua__body { padding: 28px 34px; }
  .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__inner { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 48px; }
  .article { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); column-gap: 48px; }
  .article__main { grid-column: 1; }
  .article__aside { grid-column: 2; grid-row: 1 / span 3; }
}

@media print {
  .nav, .subbar, .textsize, .theme, .jump, .ad, .actions { display: none; }
  body { background: #fff; color: #000; }
}

/* Admin forms */
.admin-form .field { width: 100%; }
.admin-form textarea.field { min-height: 0; line-height: 1.5; resize: vertical; }
.admin-filter { flex-wrap: wrap; }
.admin-filter__select { flex: 0 0 auto; min-height: 52px; }

/* Saved concelho (home strip, almanaque banner, save button) */
.almanac-strip__pick form { display: flex; gap: 6px; margin: 6px 0; }
.almanac-strip__pick input { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 6px 10px; font: inherit; color: var(--ink); background: var(--bg); border: 2px solid var(--ink); }
.almanac-strip__change { margin: 8px 0 0; }
.linklike { padding: 0; font: inherit; color: inherit; text-decoration: underline; background: none; border: 0; cursor: pointer; }
.save-place { margin-left: auto; white-space: nowrap; }
.your-place a { font-weight: 700; }

/* Newsletter form */
.nl-form { max-width: 40rem; }
.nl-form .field { width: 100%; }
.nl-freq { margin: 0 0 16px; padding: 0; border: 0; display: grid; gap: 10px; }
.nl-freq legend { margin-bottom: 8px; }
.nl-freq label, .nl-consent { display: flex; gap: 10px; align-items: flex-start; line-height: 1.45; }
.nl-freq input, .nl-consent input { margin-top: 4px; width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--accent); }
.nl-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Home: quick access to the almanac (sticky on phones) */
.quickbar { margin: 18px 0 8px; }
.quickbar__grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.quickbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 72px; padding: 6px 4px; border: 2px solid var(--ink); background: var(--bg); color: var(--ink); text-decoration: none; font-weight: 700; text-align: center; }
.quickbar a:hover { background: var(--ink); color: var(--bg); }
.quickbar a:hover svg { stroke: var(--bg); }
@media (max-width: 700px) {
  .quickbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; margin-inline: calc(-1 * var(--gutter)); padding: 6px var(--gutter); background: var(--bg); border-bottom: 2px solid var(--line); }
  .quickbar__grid { display: flex; gap: 4px; }
  .quickbar a { flex: 1 1 auto; min-width: 0; min-height: 50px; gap: 2px; padding: 4px 5px; border-width: 1.5px; font-size: 0.7rem; }
  .quickbar svg { width: 20px; height: 20px; }
}

/* Home: "Almanaque de hoje" as infographics */
.halm { margin: 22px 0 8px; }
.halm__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; padding-top: 10px; border-top: 2px solid var(--line); margin-bottom: 12px; }
.halm__head h2 { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.halm__head h2::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 10px; background: var(--accent); vertical-align: -1px; }
.halm__all { font-weight: 700; font-size: 0.92rem; }
.halm__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 700px) { .halm__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .halm__grid { grid-template-columns: 1.35fr 1.15fr 0.9fr 1fr; } }
.halm__grid > * { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 16px; border: 2px solid var(--line); color: var(--ink); text-decoration: none; background: var(--bg); }
.halm__grid > a:hover .halm__big { text-decoration: underline; }
.halm__kicker { display: flex; align-items: flex-start; gap: 6px; line-height: 1.35; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.halm__kicker svg { stroke: var(--accent); flex-shrink: 0; margin-top: -1px; }
.halm__big { font-family: var(--font-display); font-weight: 900; font-size: 1.7rem; line-height: 1.02; letter-spacing: -0.01em; text-wrap: balance; }
.halm__big--s { font-size: 1.45rem; }
.halm__sub { font-size: 0.92rem; color: var(--ink-2); }
/* Moon: black card with the disc */
.halm__moon { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px 16px; background: var(--invert-bg); color: var(--invert-ink); border-color: var(--invert-bg); }
.halm__disc svg { width: 112px; height: auto; display: block; }
.halm__moontext { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.halm__moon .halm__kicker, .halm__moon .halm__sub { color: var(--invert-ink-2); }
.halm__moon .halm__big { color: var(--invert-ink); }
.halm__phases { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 0; padding: 8px 0 0; list-style: none; border-top: 1px solid var(--invert-line); }
.halm__phases li { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; font-size: 0.78rem; line-height: 1.2; color: var(--invert-ink-2); text-align: center; }
.halm__phases li strong { color: var(--invert-ink); font-size: 0.8rem; }
.halm__phases li.is-today { outline: 2px solid var(--moon-gold); outline-offset: -2px; }
.halm__phases svg { width: 26px; height: 26px; }
/* Sun: arc with live position */
.halm__arc { width: 100%; height: auto; aspect-ratio: 220 / 90; max-height: 110px; margin-top: 4px; }
.halm__suntimes { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.halm__suntimes > span { display: flex; align-items: center; gap: 4px; }
.halm__suntimes strong { font-family: var(--font-display); font-size: 1.6rem; font-weight: 900; }
.halm__suntimes svg { stroke: var(--accent); }
.halm__len { margin-top: -4px; font-size: 0.86rem; color: var(--ink-2); text-align: center; }
.sun__arc .dot[hidden] { display: none; }
/* Holiday: calendar sheet */
.halm__hol { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; align-content: start; align-items: start; column-gap: 14px; }
.halm__hol .halm__kicker { grid-column: 1 / -1; }
.halm__cal { display: flex; flex-direction: column; width: 70px; border: 2px solid var(--ink); text-align: center; }
.halm__cal span { background: var(--accent); color: var(--on-accent); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 0; }
.halm__cal strong { font-family: var(--font-display); font-size: 2.3rem; font-weight: 900; line-height: 1.1; padding: 2px 0 4px; }
.halm__holtext { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
/* Place */
.halm__place form { display: flex; gap: 6px; margin: 8px 0; }
.halm__place input { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 6px 10px; font: inherit; color: var(--ink); background: var(--bg); border: 2px solid var(--ink); }
.halm__mine { display: flex; flex-direction: column; gap: 8px; color: var(--ink); text-decoration: none; }
.halm__change { margin: 0; font-size: 0.9rem; }
@media (prefers-reduced-motion: no-preference) {
  .halm__arc .dot { transition: cx 0.6s ease, cy 0.6s ease; }
}

/* Native concelho picker (grouped by district) */
.concelho-select { flex: 1 1 auto; min-width: 0; min-height: 48px; padding: 6px 36px 6px 10px; font: inherit; color: var(--ink); background: var(--bg); border: 2px solid var(--ink); border-radius: 0;
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%; background-size: 6px 6px; background-repeat: no-repeat; }
@media (pointer: coarse) { .js-touch [data-concelho-go] { display: none; } }

/* Weather pictograms */
.wx-i { display: block; flex-shrink: 0; overflow: visible; }
.wx-i path, .wx-i circle { stroke: var(--wx-line); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.wx-i__sun circle { fill: var(--wx-sun); }
.wx-i__sun path { stroke: var(--wx-sun); stroke-width: 2.6; }
.wx-i .wx-i__cloud { fill: var(--wx-cloud); }
.wx-i .wx-i__rain { stroke: var(--wx-rain); stroke-width: 2.8; }
.wx-i .wx-i__bolt { fill: var(--wx-bolt); stroke: var(--wx-line); stroke-width: 1.6; }
.wx-i .wx-i__snow { stroke: var(--wx-snow); stroke-width: 2.6; }
.wx-i .wx-i__fog { stroke: var(--wx-fog); stroke-width: 3; }

/* Home: holiday countdown */
.halm__tag { margin-left: auto; padding: 1px 7px; border: 1.5px solid var(--ink); font-size: 0.7rem; letter-spacing: 0.06em; color: var(--ink); }
.halm__hol { display: flex; flex-direction: column; gap: 8px; }
.halm__count { display: flex; align-items: baseline; gap: 6px; }
.halm__countnum { font-family: var(--font-display); font-weight: 900; font-size: 3.4rem; line-height: 0.9; letter-spacing: -0.03em; color: var(--accent); }
.halm__countlbl { font-weight: 700; font-size: 1rem; color: var(--ink-2); }
.halm__holtext { display: flex; flex-direction: column; gap: 2px; }
.halm__days { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; min-width: 7rem; }
.halm__days i { width: 10px; height: 10px; border: 1.5px solid var(--line-soft); }
.halm__days i.is-today { background: var(--ink); border-color: var(--ink); }
.halm__days i.is-hol { background: var(--accent); border-color: var(--accent); }
.halm__daysleg { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--ink-2); }
.halm__cd { display: inline-flex; flex-direction: column; gap: 3px; align-self: flex-start; max-width: 100%; }
.halm__days:empty, .halm__days:empty + .halm__daysleg { display: none; }
.halm__daysleg { gap: 12px; }

/* Home: weather today + next days */
.halm__wx { display: flex; flex-direction: column; gap: 8px; }
.halm__wxnow { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.halm__temps { display: flex; align-items: baseline; gap: 8px; }
.halm__temps strong { font-family: var(--font-display); font-weight: 900; font-size: 2.6rem; line-height: 1; }
.halm__temps span { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--ink-2); }
.halm__week { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 4px 0 0; padding: 8px 0 0; list-style: none; border-top: 1px solid var(--line-soft); }
.halm__week li { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 0.8rem; color: var(--ink-2); text-align: center; }
.halm__week strong { color: var(--ink); }
.halm__wd { font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.72rem; color: var(--ink); }
.halm__src { font-size: 0.8rem; color: var(--ink-2); }
.halm__pick form { display: flex; gap: 6px; margin: 4px 0 0; }
.halm__pick .concelho-select { min-height: 40px; font-size: 0.9rem; }

/* Admin: editions waiting for approval */
.edition-queue__state { font-weight: 700; font-size: .9rem; }
.edition-queue__state--espera { color: var(--accent); }
.edition-queue__state--ok { color: var(--text-main); }
.edition-queue__state--vazia { color: var(--text-muted); font-weight: 400; }
.edition-review { list-style: none; margin: 0; padding: 0; }
.edition-review > li { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.edition-review__title { font-weight: 700; margin: 4px 0; }
.edition-review .actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.edition-review .actions form { margin: 0; }

/* Home: photos of the articles that have one (Wikimedia Commons) */
.thumb { margin: 0 0 12px; }
.thumb img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; background: var(--bg-2); }
.thumb--contain img { object-fit: contain; padding: 8px; }
.thumb figcaption { font-size: 0.72rem; color: var(--ink-2); padding-top: 4px; }
.thumb figcaption a { color: inherit; }
.history__body { display: flex; gap: 12px; align-items: flex-start; }
.history__body > div { min-width: 0; flex: 1; }
.history__body .thumb--small { flex: 0 0 6.5rem; margin: 2px 0 0; }
@media (max-width: 480px) { .history__body .thumb--small { flex-basis: 5rem; } }
.thumb--card svg { display: block; width: 100%; height: auto; }

/* "É feriado?" and countdown pages */
.answer { font-size: clamp(1.25rem, 3vw, 1.6rem); font-weight: 800; line-height: 1.3; margin: 12px 0; padding: 14px 16px; border-left: 6px solid var(--text-main); background: var(--bg-2); }
.answer--sim { border-left-color: var(--accent); }
.cols-list { columns: 2 14rem; }
.countdown { margin: 8px 0 20px; }
.countdown__num { font-size: clamp(5rem, 22vw, 11rem); font-weight: 900; line-height: .9; margin: 0; color: var(--accent); letter-spacing: -.04em; }
.countdown__unit { font-size: 1.5rem; font-weight: 800; margin: 4px 0 0; }
.countdown__date { margin: 6px 0 0; color: var(--ink-2); }
.countdown-list { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 0 var(--gap); }
.countdown-list li { border-top: 2px solid var(--text-main); }
.countdown-list a { display: flex; gap: 14px; align-items: baseline; padding: 12px 0; text-decoration: none; }
.countdown-list__num { font-size: 2.6rem; font-weight: 900; color: var(--accent); min-width: 5.6rem; }
.countdown-list__txt { display: flex; flex-direction: column; }
.countdown-list a:hover strong { text-decoration: underline; }

/* Santo do dia */
.santo { display: grid; grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); gap: var(--gap); align-items: start; margin-bottom: 20px; }
.santo__img { margin: 0; }
.santo__img img { display: block; width: 100%; height: auto; max-height: 30rem; object-fit: contain; background: var(--bg-2); }
.santo__img figcaption { font-size: 0.75rem; color: var(--ink-2); padding-top: 4px; }
.santo__name { font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 900; line-height: 1.1; margin: 0 0 8px; }
.santo__h { font-size: 0.8rem; letter-spacing: .08em; text-transform: uppercase; margin: 20px 0 6px; }
@media (max-width: 640px) { .santo { grid-template-columns: 1fr; } .santo__img img { max-height: 22rem; } }

/* Palavra do dia */
.palavra__word { font-size: clamp(2.6rem, 9vw, 5rem); }
.palavra__afi { color: var(--ink-2); margin: 4px 0 0; }
.palavra__classe { font-size: 0.8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-on-secondary, var(--accent)); margin: 12px 0 4px; }
.palavra__defs { margin: 0 0 8px; padding-left: 1.3rem; }
.palavra__defs li { margin: 3px 0; }
.home-word { margin: 0 0 var(--gap); }
.home-word__w { font-size: clamp(1.8rem, 5vw, 2.4rem); font-weight: 900; margin: 4px 0; }

/* Home: proverb + word of the day band */
.lingua { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--gap); border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); margin: 0 0 var(--gap); }
.lingua__col { padding: 22px 0; min-width: 0; }
.lingua .proverb { grid-template-columns: minmax(0, 1fr); border: 0; padding: 0; align-content: start; }
.lingua__word { border-top: 1px solid var(--line-soft); }
.lingua__kicker { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 0; }
.lingua__w { font-family: var(--font-display); font-weight: 900; font-size: clamp(2.2rem, 5vw, 3rem); line-height: 1; margin: 10px 0 2px; }
.lingua__w a { text-decoration: none; }
.lingua__w a:hover { text-decoration: underline; }
.lingua__meta { color: var(--ink-2); font-size: 0.9rem; margin: 0 0 10px; }
.lingua__defs { margin: 0 0 10px; padding-left: 1.2rem; font-size: 1.05rem; }
.lingua__defs li { margin: 2px 0; }
.lingua__old { margin: 0 0 8px; color: var(--ink-2); }
.lingua__old span { font-weight: 700; color: var(--text-main); }
.lingua__more { margin: 12px 0 0; }
.lingua__more a { font-weight: 700; }
@media (min-width: 900px) {
  .lingua { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
  .lingua__word { border-top: 0; border-left: 1px solid var(--line-soft); padding-left: var(--gap); }
}

/* Marés */
.mares-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.mares-dia { list-style: none; margin: 0 0 8px; padding: 0; }
.mares-dia li { display: grid; grid-template-columns: 1fr auto 4.2rem; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); align-items: baseline; }
.mares-dia__h { font-weight: 800; font-size: 1.15rem; }
.mares-dia li span:last-child { text-align: right; }
.mares-dia__pm .mares-dia__t { font-weight: 700; }
.mares-linha { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.mares-linha .mares-dia__pm { font-weight: 700; }
.mares-linha abbr { text-decoration: none; color: var(--ink-2); font-size: .8rem; }
.mares__nota { border-left: 3px solid var(--accent); padding-left: 10px; }
.mares-regiao { font-size: 1.4rem; margin: 26px 0 10px; }

/* Tide charts */
.tide-figure { margin: 0 0 var(--gap); }
.tide-figure figcaption { margin-bottom: 6px; }
.tide-chart, .tide-month { display: block; width: 100%; height: auto; }
.tide-chart__night { fill: var(--bg-2); }
.tide-chart__grid { stroke: var(--line-soft); stroke-width: 1; }
.tide-chart__axis { font-size: 11px; fill: var(--ink-2); font-family: inherit; }
.tide-chart__area { fill: var(--accent); opacity: .14; }
.tide-chart__line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.tide-chart__dot { fill: var(--accent); stroke: var(--bg-main); stroke-width: 2; }
.tide-chart__dot--low { fill: var(--bg-main); stroke: var(--accent); }
.tide-chart__label { font-size: 12px; font-weight: 700; fill: var(--text-main); font-family: inherit; }
.tide-chart__label--s { font-size: 10px; font-weight: 600; }
.tide-chart__now { stroke: var(--text-main); stroke-width: 1.5; stroke-dasharray: 4 3; }
.tide-chart--spark { margin: 0 0 6px; }
.tide-week { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: 10px 14px; margin: 0 0 var(--gap); }
.tide-week figure { margin: 0; border-top: 1px solid var(--line-soft); padding-top: 4px; }
.tide-week figcaption { font-size: .8rem; font-weight: 700; }
.tide-month__bar { fill: var(--interactive, var(--text-main)); opacity: .45; }
.tide-month__bar--viva { fill: var(--accent); opacity: .9; }
.tide-month__bar--morta { opacity: .25; }
.tide-month__moon { fill: var(--bg-main); stroke: var(--text-main); stroke-width: 1.5; }
.tide-month__moon--full { fill: var(--text-main); }

/* Admin: social */
.social-list { list-style: none; margin: 0; padding: 0; }
.social-list li { display: grid; grid-template-columns: 108px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.social-list__img img { display: block; width: 108px; height: auto; background: var(--bg-2); }
.social-list__title { font-weight: 800; margin: 0 0 4px; }
.social-state--pronto, .social-state--aprovado { border-color: var(--accent); }
.social-preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.social-net { border-top: 3px solid var(--text-main); padding-top: 10px; min-width: 0; }
.social-net__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.social-net__head h2 { margin: 0; font-size: 1.2rem; }
.social-net__on { font-size: .85rem; }
.social-net__img { margin: 10px 0; }
.social-net__img img { display: block; width: 100%; height: auto; border: 1px solid var(--line-soft); }
.social-net--tiktok .social-net__img img { max-width: 60%; margin: 0 auto; }
.social-net__actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.social-net__label { display: block; font-weight: 700; font-size: .85rem; margin: 8px 0 4px; }
.social-net textarea, .social-net input.field { width: 100%; }
.social-net__final pre { white-space: pre-wrap; font: inherit; font-size: .9rem; background: var(--bg-2); padding: 10px; }
.social-warn { color: var(--accent); }
.social-accounts__row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.social-accounts__btns { display: flex; gap: 8px; flex-wrap: wrap; }
.social-accounts__btns form, .social-accounts__page { margin: 0; }
.social-results { list-style: none; padding: 0; margin: 0 0 12px; }
.social-results li { padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.social-results__erro { color: var(--accent); }
.social-stories { border-top: 3px solid var(--text-main); padding-top: 10px; margin-bottom: var(--gap); }
.social-stories h2 { font-size: 1.2rem; margin: 0 0 8px; }
.social-stories__row { display: flex; gap: 16px; align-items: flex-start; }
.social-stories__row img { width: 135px; height: auto; border: 1px solid var(--line-soft); flex: 0 0 auto; }
.social-schedule { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 0 0 16px; } .social-schedule .note { flex-basis: 100%; margin: 0; }

/* Home: "Para explorar" as a grid of equal cards */
.explore { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px var(--gap); }
@media (max-width: 900px) { .explore { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .explore { grid-template-columns: minmax(0, 1fr); } }
.explore li.explore__card { border-top: 0; padding: 0; }
.explore__link { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; height: 100%; }
.explore__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-2); border-top: 3px solid var(--text-main); }
.explore__media img, .explore__media svg { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.explore__link:hover .explore__media img, .explore__link:hover .explore__media svg { transform: scale(1.03); }
.explore__blank { display: flex; align-items: flex-end; height: 100%; padding: 14px; font-weight: 800; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.explore__kicker { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-top: 4px; }
.explore__title { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; line-height: 1.2; }
.explore__link:hover .explore__title { text-decoration: underline; }
.explore__lead { color: var(--ink-2); font-size: .95rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .explore__media img, .explore__media svg { transition: none; } }.explore .explore__link { font-weight: 400; }
@media (max-width: 560px) {
  .explore { gap: 14px; }
  .explore__link { display: grid; grid-template-columns: 38% minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 12px; row-gap: 3px; }
  .explore__media { grid-row: 1 / span 3; aspect-ratio: 1 / 1; border-top-width: 2px; }
  .explore__kicker { margin-top: 0; }
  .explore__title { font-size: 1rem; }
  .explore__lead { -webkit-line-clamp: 2; font-size: .88rem; }
}
@media (max-width: 560px) {
  .explore__media:has(svg) { display: flex; align-items: center; background: #141414; }
  .explore__media svg { height: auto; }
}
.social-tiktok { border: 1px solid var(--line-soft); padding: 10px 12px; margin: 10px 0; display: grid; gap: 6px; } .social-tiktok legend { font-weight: 700; padding: 0 4px; }

/* ---- Social links (footer) ------------------------------------------- */
.social ul { display: flex; gap: 6px; margin-top: 14px; }
.social li a { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--invert-ink-2); color: var(--invert-ink); }
.social li a:hover, .social li a:focus-visible { background: var(--invert-ink); color: var(--invert-bg); text-decoration: none; }

/* ---- Home: a destaque already read becomes a slim row, with more to read next to it ---- */
.destaque__read, .destaque__next { display: none; }
.destaque.is-read .feature { grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 14px; }
.destaque.is-read .media img, .destaque.is-read .media svg { aspect-ratio: 1 / 1; }
.destaque.is-read .media figcaption, .destaque.is-read .module__lead, .destaque.is-read .btn { display: none; }
.destaque.is-read .module__title { font-size: clamp(1.15rem, 2.4vw, 1.5rem); }
.destaque.is-read .feature__text p { margin: 0; }
.destaque.is-read .destaque__read { display: inline; color: var(--ink-2); font-size: 0.89rem; }
.destaque.is-read .destaque__read::before { content: "✓ "; color: var(--accent); }
.destaque.is-read .destaque__next { display: block; }
.destaque__next h3 { margin: 0 0 6px; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.destaque__next ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.destaque__next li:nth-child(n+4) { display: none; }
.destaque__next a { display: block; padding: 8px 0; border-top: 1px solid var(--line); color: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: 1.02rem; line-height: 1.2; text-decoration: none; }
.destaque__next a:hover { text-decoration: underline; }
.destaque__kind { display: block; margin-bottom: 2px; font-family: var(--font-text); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
@media (min-width: 900px) {
  .destaque.is-read { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 12px 32px; align-items: start; }
  .destaque.is-read > h2 { grid-column: 1 / -1; }
  .destaque.is-read .destaque__next ul { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}
.explore__card:nth-child(n+7) { display: none; }
.edition-grid + .lingua, .halm { margin-top: 28px; }

/* ---- Clickable map of the concelhos ---------------------------------------- */
.cmapfig { margin: 0; }
.cmapfig__svg { max-width: 640px; margin: 0 auto; }
.cmap { display: block; width: 100%; height: auto; max-height: 78vh; }
.cmap path { fill: var(--bg-2); stroke: var(--ink); stroke-width: 0.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; transition: fill .12s; }
.cmap a { cursor: pointer; outline: none; }
.cmap a:hover path, .cmap a:focus-visible path { fill: var(--accent); }
.cmap a:focus-visible path { stroke-width: 2; }
.cmap a.is-mine path { fill: var(--ink); }
.cmap__box { fill: none; stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; }
.cmap__label { font: 700 14px var(--font-display); fill: var(--ink-2); }
.cmapfig figcaption { max-width: 640px; margin: 8px auto 0; }
.cmapfig__name { min-height: 1.6em; margin: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(0.95rem, 2.6vw, 1.15rem); }
.cmapdlg { width: min(720px, 96vw); max-height: 96vh; padding: 16px; border: 2px solid var(--ink); background: var(--bg); color: var(--ink); }
.cmapdlg::backdrop { background: rgb(0 0 0 / .55); }
.cmapdlg__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.cmapdlg__head h2 { font-size: 1.3rem; }
.cmapdlg .cmap { max-height: 70vh; }
.halm__mapbtn { margin-top: 6px; font-weight: 700; }

/* ---- Choosing a concelho: search, location, map by district ------------------ */
.cpick { display: grid; gap: 12px; max-width: 640px; margin: 0 auto; }
.cpick__search { position: relative; }
.cpick__search label { display: block; font-weight: 700; margin-bottom: 6px; }
.cpick__field { display: flex; gap: 6px; }
.cpick__field input { flex: 1; min-width: 0; min-height: 46px; padding: 0 12px; font: inherit; font-size: 1.05rem; color: var(--ink); background: var(--bg); border: 2px solid var(--ink); border-radius: 0; }
.cpick__field input:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.cpick__results { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; max-height: 320px; overflow: auto; margin: 4px 0 0; padding: 0; list-style: none; background: var(--bg); border: 2px solid var(--ink); }
.cpick__results a { display: flex; justify-content: space-between; gap: 12px; padding: 11px 12px; color: var(--ink); font-weight: 700; text-decoration: none; }
.cpick__results a span { color: var(--ink-2); font-weight: 400; }
.cpick__results li.is-active a, .cpick__results a:hover { background: var(--ink); color: var(--bg); }
.cpick__results li.is-active a span, .cpick__results a:hover span { color: var(--bg); }
.cpick__geo { margin: 0; }
.cpick__geo .linklike { font-weight: 700; }
.cmapfig__bar { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; min-height: 1.8em; }
.cmapfig__bar .linklike { font-weight: 700; }
.cmap__d--t0 path { fill: color-mix(in srgb, var(--ink) 5%, var(--bg)); }
.cmap__d--t1 path { fill: color-mix(in srgb, var(--ink) 13%, var(--bg)); }
.cmap__d--t2 path { fill: color-mix(in srgb, var(--ink) 21%, var(--bg)); }
.cmap__d--t3 path { fill: color-mix(in srgb, var(--ink) 29%, var(--bg)); }
.cmap:not(.is-zoomed) path { stroke: color-mix(in srgb, var(--ink) 30%, var(--bg)); stroke-width: 0.4; }
.cmap:not(.is-zoomed) .cmap__d:hover path, .cmap:not(.is-zoomed) .cmap__d:focus-within path { fill: var(--accent); stroke: var(--bg); }
.cmap .cmap__d { transition: opacity .2s; }
.cmap.is-zoomed .cmap__d:not(.is-active) { opacity: 0.18; }
.cmap.is-zoomed .cmap__d.is-active path { fill: var(--bg-2); stroke: var(--ink); stroke-width: 1; }
.cmap.is-zoomed .cmap__d.is-active a:hover path, .cmap.is-zoomed .cmap__d.is-active a:focus-visible path { fill: var(--accent); }
.cmap a.is-mine path, .cmap.is-zoomed .cmap__d.is-active a.is-mine path { fill: var(--ink); }
.cmap.is-zoomed .cmap__box, .cmap.is-zoomed .cmap__label { opacity: 0; }

/* ---- Hoje na história on phones: year on top, text full width, small image on the right ---- */
@media (max-width: 599px) {
  .history li { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 16px 0; }
  .history__year { font-size: 1.5rem; color: var(--accent); }
  .history__body { display: block; }
  .history__body::after { content: ""; display: block; clear: both; }
  .history__body .thumb--small { float: right; width: 6rem; margin: 2px 0 6px 12px; }
  .history__title { font-size: 1.12rem; }
  .history p { line-height: 1.45; }
}

/* ---- Sabias que… on phones: a card, shorter photo, title at reading size ---- */
@media (max-width: 599px) {
  .module--statement { padding: 14px 14px 16px; border-top: 0; border-left: 4px solid var(--accent); background: var(--bg-2); gap: 10px; }
  .module--statement .thumb { margin: 0; }
  .module--statement .thumb img { aspect-ratio: 16 / 9; }
  .module--statement .thumb figcaption { font-size: 0.68rem; }
  .module--statement .module__title { font-size: 1.45rem; line-height: 1.12; }
  .module--statement .module__lead { font-size: 1rem; }
}


/* ---- Concelho bar (almanac pages): one slim line ---------------------------------- */
.subbar__inner { padding-top: 6px; padding-bottom: 6px; gap: 6px 16px; }
.place { flex: 0 1 auto; max-width: 100%; }
@media (min-width: 700px) { .place { flex: 0 1 auto; max-width: 560px; } }
.place > summary { gap: 8px; min-height: 38px; padding: 3px 10px; border-width: 1.5px; }
.place__pin { width: 18px; height: 18px; }
.place__text { flex-direction: row; align-items: baseline; gap: 6px; min-width: 0; overflow: hidden; }
.place__name { font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place__sub { font-size: 0.78rem; white-space: nowrap; }
.place__sub::before { content: "· "; }
.place__action { margin-left: 6px; padding-left: 10px; border-left: 1px solid var(--line-soft); font-size: 0.8rem; font-weight: 400; color: var(--ink-2); text-decoration: none; }
.place__chev { width: 16px; height: 16px; }
.save-place { min-height: 34px; padding: 0 10px; font-size: 0.78rem; }
.save-place[aria-pressed="true"] { background: transparent; color: var(--ink-2); border-color: var(--line-soft); }
@media (max-width: 699px) {
  .subbar .tag-label { display: none; }
  .place { flex: 1 1 100%; }
  .place__sub { display: none; }
  .place__name { white-space: normal; line-height: 1.2; }
  .save-place { margin-left: 0; }
  .save-place[aria-pressed="true"] { display: none; }
}

/* =====================================================================================
   Design 2 (October 2026): lighter and more fluid, AAA.
   - Every control (buttons, fields, chips, tiles) has the same corners (--r-control) and
     the same border; every card and image has --r-card. Brand squares (logo dot, section
     markers) and the big numbers stay square.
   - Surfaces instead of black frames: cards sit on --bg-2; sections are divided by hairlines.
   - Three title levels: destaque, blocks of the day, lists.
   - AAA: targets of at least 44 × 44 px, text of at least 13 px, lines up to ~70 characters.
   ===================================================================================== */
:root { --r-control: 6px; --r-card: 10px; --border-control: 1.5px; }

/* -- Controls: one shape for all -------------------------------------------------------- */
.btn, .textsize, .js .nav__toggle, .theme__select, .concelho-select, .daynav select, .field,
.place__panel input, .search input, .cpick__field input, .almanac-strip__pick input, .halm__place input,
.tags a, .tiles a, .jump__grid a, .quickbar a, .place > summary, .save-place,
.skip:focus, .social li a {
  border-radius: var(--r-control);
  border-width: var(--border-control);
}
.btn { min-height: 48px; }
.btn--small { min-height: 44px; }
.social li a { border-radius: var(--r-control); }
.pill, .halm__tag { border-radius: 4px; }
.cpick__results, .place__panel { border-radius: var(--r-control); border-width: var(--border-control); overflow: hidden; }

/* -- Cards and images ------------------------------------------------------------------------ */
.media img, .media svg, .thumb img, .thumb svg, .explore__media, .santo__img img, .social-net__img img { border-radius: var(--r-card); }
.history__body .thumb img, .history__body .thumb svg { border-radius: var(--r-control); }
.explore__media { border-top: 0; }
.halm__grid > * { border: 0; background: var(--bg-2); border-radius: var(--r-card); }
.halm__grid > .halm__moon { background: var(--invert-bg); color: var(--invert-ink); }
.datecard, .wx__t, .answer { border: 0; background: var(--bg-2); border-radius: var(--r-card); overflow: hidden; }
.alert { border-width: var(--border-control); border-radius: var(--r-card); }
.cta { border-radius: var(--r-card); }
.cmapdlg { border-width: var(--border-control); border-radius: var(--r-card); }
.lingua { border: 0; background: var(--bg-2); border-radius: var(--r-card); padding: 4px clamp(14px, 3vw, 24px); }
.lingua__word { border-color: var(--line-soft); }
@media (max-width: 699px) {
  .module--statement { border-radius: var(--r-card); }
}

/* -- Hairlines instead of black rules ------------------------------------------------------------ */
.header__inner { border-bottom: 1px solid var(--line-soft); }
.edition-head { border-bottom: 1px solid var(--line-soft); }
.module, .halm__head, .card, .alist li, .countdown-list li { border-top: 1px solid var(--line-soft); }
.module { padding-top: 16px; }
.catgrid { border-top-width: 1px; border-top-color: var(--line-soft); }
.proverb { border-top-width: 1px; border-bottom-width: 1px; border-color: var(--line-soft); }
.js .nav.is-open ul { border-bottom: 1px solid var(--line-soft); }
.destaque__next a { border-top-color: var(--line-soft); }

/* -- Title hierarchy: 1 destaque · 2 blocks of the day · 3 lists ------------------------------- */
.module__title { font-size: clamp(1.4rem, 2.6vw, 1.85rem); }
.module--statement .module__title { font-size: clamp(1.4rem, 2.6vw, 1.85rem); }
.module--big .module__title { font-size: clamp(2.1rem, 5.5vw, 3.4rem); }
.history__title, .explore__title { font-size: 1.08rem; }

/* -- AAA: readable sizes, line length, targets ---------------------------------------------- */
.module > h2, .tag-label, .secno, .kicker, .halm__kicker { font-size: 0.8125rem; }
.media figcaption, .thumb figcaption, .module--statement .thumb figcaption, .cmapfig figcaption { font-size: 0.8125rem; }
.module__lead, .history p, .explore__lead { max-width: 68ch; }
.thumb figcaption a, .media figcaption a { display: inline-block; padding: 4px 0; }

/* -- Phone header in one row: «Texto grande» shows only «AA» (the name stays for screen readers) -- */
@media (max-width: 599px) {
  .textsize { padding: 0 10px; }
  .textsize__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .header__inner { flex-wrap: nowrap; gap: 8px; }
  .nav { margin-left: auto; }
  .textsize { margin-left: 0; }
}
.lua { border-radius: var(--r-card); }
.cells { border-radius: var(--r-control); overflow: hidden; }
.next-phase { border-radius: var(--r-control); }

/* ---- The day at a glance (home): concelho, moon in today's phase, sun, weather, holiday ---- */
.astrip { margin: calc(10px - var(--gap)) 0 calc(18px - var(--gap)); }
.astrip ul { display: grid; grid-template-columns: minmax(9.5rem, auto) repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; background: var(--bg-2); border-radius: var(--r-card); overflow: hidden; }
.astrip li { min-width: 0; display: flex; }
.astrip li + li:not(:nth-child(2)) { border-left: 1px solid var(--line-soft); }
.astrip a { color: var(--ink); text-decoration: none; }
.astrip__place { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 64px; padding: 10px 14px; background: var(--ink); color: var(--bg) !important; font-weight: 800; font-size: 0.95rem; }
.astrip__place svg { stroke: var(--bg); flex-shrink: 0; }
.astrip__placename { min-width: 0; overflow-wrap: anywhere; line-height: 1.2; }
.astrip__change { margin-left: auto; padding-left: 10px; font-size: 0.8125rem; font-weight: 400; text-decoration: underline; white-space: nowrap; }
.astrip__place:hover { background: var(--accent-bg); }
.astrip__cell { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; column-gap: 10px; width: 100%; min-height: 64px; padding: 10px 14px; }
.astrip__cell:hover { background: color-mix(in srgb, var(--ink) 6%, var(--bg-2)); }
.astrip__cell:hover .astrip__v { text-decoration: underline; }
.astrip__fig { grid-row: 1 / span 2; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; }
.astrip__fig svg { width: 100%; height: 100%; }
.astrip__fig--moon svg { width: 34px; height: 34px; filter: drop-shadow(0 0 3px rgb(0 0 0 / .18)); }
.astrip__fig--sun svg { stroke: #B8860B; }
.astrip__fig--hol svg { stroke: var(--accent); }
.astrip__k { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); line-height: 1.3; }
.astrip__v { font-weight: 800; font-size: 0.95rem; line-height: 1.25; }
.astrip__v svg { stroke: var(--ink-2); vertical-align: -1px; margin-right: 2px; }
.astrip__dim { color: var(--ink-2); font-weight: 400; }
.astrip__badge { display: inline-block; margin-right: 4px; padding: 1px 6px; border-radius: 4px; background: var(--accent-bg); color: var(--on-accent); letter-spacing: 0.02em; }
@media (max-width: 1099px) {
  .astrip ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .astrip__placeli { grid-column: 1 / -1; }
  .astrip li + li:not(:nth-child(2)) { border-left: 0; }
  .astrip li:not(.astrip__placeli) { border-top: 1px solid var(--line-soft); }
  .astrip li:nth-child(odd):not(.astrip__placeli) { border-left: 1px solid var(--line-soft); }
  .astrip__place { min-height: 48px; }
}
@media (max-width: 420px) {
  .astrip__cell { grid-template-columns: 30px minmax(0, 1fr); column-gap: 8px; padding: 10px; }
  .astrip__fig { width: 30px; height: 30px; }
  .astrip__fig--moon svg { width: 28px; height: 28px; }
  .astrip__v { font-size: 0.9rem; }
}@media (max-width: 699px) { .edition-head__meta > span:last-child { display: none; } }
.astrip__fig--moon svg { width: 40px; height: 40px; }
.astrip__fig { width: 40px; height: 40px; }
.astrip__cell { grid-template-columns: 40px minmax(0, 1fr); }
.astrip__dim, .astrip__v.num { white-space: nowrap; }
.astrip__lc { text-transform: none; letter-spacing: 0; font-weight: 400; }
@media (max-width: 420px) {
  .astrip__cell { grid-template-columns: 32px minmax(0, 1fr); }
  .astrip__fig, .astrip__fig--moon svg { width: 32px; height: 32px; }
}
.astrip__v--sun { white-space: normal !important; }
.astrip__t { white-space: nowrap; }

/* ---- «Do arquivo» (Europeana) ---------------------------------------------------- */
.arquivo__fig { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin: 0; padding: 14px; background: var(--bg-2); border-radius: var(--r-card); }
@media (min-width: 700px) { .arquivo__fig { grid-template-columns: 320px minmax(0, 1fr); align-items: center; gap: 24px; } }
.arquivo__img img { display: block; width: 100%; height: auto; max-height: 360px; object-fit: contain; background: var(--bg); border-radius: var(--r-control); }
.arquivo figcaption { display: flex; flex-direction: column; gap: 8px; }
.arquivo figcaption p { margin: 0; }
.social-page-form { display: grid; gap: 6px; max-width: 34rem; }
.social-page-form label { font-weight: 700; margin-top: 6px; }
.social-page-form .btn { justify-self: start; margin-top: 10px; }
.social-page-form__choice { border: 0; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; } .social-page-form__choice legend { font-weight: 700; }
.article-new { max-width: 46rem; }
.article-new__date { display: flex; gap: 8px; }
.article-new__date .field { max-width: 9rem; }
.article-new__cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 4px 12px; }

/* ---- Editor's button (only for the signed-in editor, added by site.js) ---------------- */
.editor-btn { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 45;
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 18px; border-radius: var(--r-control); background: var(--accent-bg); color: var(--on-accent);
  font-weight: 800; text-decoration: none; box-shadow: 0 6px 20px rgb(0 0 0 / .25); }
.editor-btn:hover, .editor-btn:focus-visible { background: var(--ink); color: var(--bg); text-decoration: none; }
@media print { .editor-btn { display: none; } }
.social-form[data-formato="reel"] .only-imagens, .social-form[data-formato="imagens"] .only-reel { display: none; }
.social-format { margin: 0 0 var(--gap); padding: 12px 14px 4px; border: 1px solid var(--line-soft); border-radius: var(--r-card); }
.social-format legend, .social-step, .social-block h2 { font-weight: 800; font-size: 1.2rem; padding: 0 4px; }
.social-step { padding: 0; margin: 0 0 8px; }
.social-format__opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 8px; margin-bottom: 10px; }
.social-format__opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-control); cursor: pointer; }
.social-format__opt:has(input:checked) { border-color: var(--text-main); box-shadow: inset 0 0 0 1px var(--text-main); }
.social-format__opt.is-off { opacity: .6; cursor: default; }
.social-format__opt input { margin-top: 4px; }
.social-format__opt small { display: block; font-size: .85rem; font-weight: 400; color: var(--text-muted); }
.social-block { border-top: 3px solid var(--text-main); padding-top: 10px; margin-bottom: var(--gap); }
.social-block h2 { padding: 0; margin: 0 0 8px; }
.social-net__head h3 { margin: 0; font-size: 1.1rem; }
.social-reelnets { flex: 1 1 auto; min-width: 0; }
.social-reelnet { display: grid; gap: 4px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.social-reelnet .field { max-width: 26rem; }
.social-reelnet__story { font-size: .9rem; }
.social-phone-panel { border: 2px solid var(--accent-bg); border-radius: var(--r-card); padding: 12px 16px; }
.social-phone-panel h2 { margin-top: 0; }
.social-phone { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.social-phone h3 { margin: 0 0 6px; font-size: 1.05rem; }
.social-steps { margin: 0; padding-left: 1.4em; display: grid; gap: 10px; }
.social-steps form { margin: 0; }
.social-steps .note { display: block; margin-top: 4px; }
.social-actions { position: sticky; bottom: 0; z-index: 5; background: var(--bg-main); padding: 10px 0; border-top: 1px solid var(--line-soft); }
.social-more summary { cursor: pointer; font-weight: 700; }
@media (max-width: 40rem) {
  .social-stories__row { flex-direction: column; }
  .social-stories__row video { width: 100%; max-width: 240px; height: auto; }
}
.photo-pick { display: grid; gap: 8px; margin: 6px 0 10px; }
.photo-pick__tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.photo-pick__bar { display: flex; gap: 6px; }
.photo-pick__bar .field { flex: 1 1 auto; min-width: 0; }
.photo-pick__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.photo-pick__grid:empty { display: none; }
.photo-pick__item { display: grid; align-content: start; gap: 4px; min-width: 0; overflow: hidden; padding: 0; border: 2px solid transparent; border-radius: var(--r-control); background: none; cursor: pointer; text-align: left; color: inherit; font: inherit; }
.photo-pick__item img { width: 100%; aspect-ratio: 1; overflow: hidden; font-size: .7rem; color: transparent; object-fit: cover; border-radius: calc(var(--r-control) - 2px); display: block; background: var(--bg-2); }
.photo-pick__item span { font-size: .72rem; line-height: 1.25; color: var(--text-muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; padding: 0 2px 2px; }
.photo-pick__item[aria-pressed="true"] { border-color: var(--accent-bg); box-shadow: 0 0 0 2px var(--accent-bg); }
.photo-current { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.photo-current img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--r-control); flex: 0 0 auto; }
.photo-change summary { cursor: pointer; font-weight: 700; margin-bottom: 6px; }
.social-new .social-format { margin-bottom: var(--gap); }
.social-tiktok { display: grid; gap: 8px; margin: 10px 0; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: var(--r-control); }
.social-tiktok legend { font-weight: 800; padding: 0 4px; }
.tt-creator { display: flex; align-items: center; gap: 8px; margin: 0; }
.tt-creator img { border-radius: 50%; }
.tt-direct { display: grid; gap: 8px; padding-top: 6px; border-top: 1px solid var(--line-soft); }
.tt-direct[hidden], .tt-brand[hidden] { display: none; }
.tt-label { margin: 6px 0 0; }
.tt-toggles { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.tt-toggles .is-off { opacity: .55; }
.tt-brand { display: grid; gap: 6px; padding: 8px 12px; background: var(--bg-2); border-radius: var(--r-control); }
.tt-preview { display: flex; gap: 12px; align-items: flex-start; }
.tt-preview img, .tt-preview video { width: 135px; height: auto; border-radius: var(--r-control); flex: 0 0 auto; background: #000; }
.tt-preview .note { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.tt-consent { margin: 4px 0 0; font-size: .9rem; }
.countdown--hero { margin-bottom: var(--gap); }
.countdown__kicker { font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; margin: 0 0 4px; }
.countdown-list__tag { display: block; font-size: .8rem; color: var(--text-muted); }
.days-calc .field { max-width: 16rem; }
.days-calc__out { margin-top: 10px; min-height: 3.5em; }
.days-calc__num { font-weight: 800; font-size: 1.6rem; margin: 0; }
.faq dt { font-weight: 700; margin-top: 12px; }
.faq dd { margin: 4px 0 0; }
.stat-row { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0 0 6px; padding: 0; }
.stat-row li { display: flex; align-items: baseline; gap: 6px; }
.stat-row__num { font-size: 1.8rem; font-weight: 900; color: var(--accent); }
.day-facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.day-facts dt { font-weight: 700; }
.day-facts dd { margin: 0; }
@media (max-width: 30rem) { .day-facts { grid-template-columns: 1fr; gap: 2px; } .day-facts dd { margin-bottom: 8px; } }
.years-table { width: 100%; border-collapse: collapse; }
.years-table th, .years-table td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }

.trust__badges { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; padding: 0; }
.trust__badge { font-size: .85rem; padding: 4px 10px; border-radius: var(--r-control); background: var(--bg-2); border: 1px solid var(--line-soft); }
.trust__badge span { color: var(--accent); font-weight: 800; }
.trust__badge--info span { color: var(--text-muted); }
.trust__dates { margin: 0 0 10px; }
.tide-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.tide-list__kind { display: inline-block; min-width: 6.5rem; }
.explora__h { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; margin: 14px 0 6px; color: var(--text-muted); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line-soft); display: grid; gap: 10px; }
.timeline li { position: relative; display: grid; gap: 2px; }
.timeline li::before { content: ""; position: absolute; left: -20px; top: .45em; width: 10px; height: 10px; border-radius: 50%; background: var(--bg-main); border: 2px solid var(--accent); }
.timeline__here::before { background: var(--accent) !important; }
.timeline__when { font-size: .8rem; color: var(--text-muted); font-weight: 700; }
.timeline__here span:last-child { font-weight: 700; }
.discover { max-width: 40rem; }
.discover__card { border: 1px solid var(--line-soft); border-top: 4px solid var(--accent); border-radius: var(--r-card); padding: 20px 22px; background: var(--bg-main); min-height: 15rem; }
.discover__card.is-new { animation: discover-in .35s ease-out; }
@keyframes discover-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .discover__card.is-new { animation: none; } }
.discover__img { display: block; width: calc(100% + 44px); max-width: none; height: auto; aspect-ratio: 16 / 9; object-fit: cover; margin: -20px -22px 16px; border-radius: var(--r-card) var(--r-card) 0 0; }
.discover__label { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 800; color: var(--accent); margin: 0 0 6px; }
.discover__title { font-size: clamp(1.5rem, 5vw, 2.1rem); line-height: 1.12; margin: 0 0 10px; }
.discover__title:focus { outline: none; }
.discover__text { font-size: 1.1rem; margin: 0 0 14px; }
.discover__links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; font-weight: 700; }
.discover__actions { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.discover__actions .btn, .surprise__btn { white-space: nowrap; }
.surprise { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 16px 18px; border: 2px dashed var(--line); border-radius: var(--r-card); }
.surprise__q { font-size: 1.15rem; margin: 0; }
.surprise__btn { font-size: 1.05rem; }
.surprise__note { margin: 0; flex-basis: 100%; }

.calc__row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; }
.calc__row label, .calc > label { display: grid; gap: 4px; font-weight: 700; }
.calc__row .field { min-width: 10rem; }
.calc__check { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-weight: 400 !important; }
.calc__out { margin-top: 12px; min-height: 3.5em; }
.calc__out .note:empty { display: none; }
.countdown-list--wide .countdown-list__num { min-width: 7.5rem; font-size: 2.2rem; }
.quiz { display: grid; gap: 14px; max-width: 44rem; }
.quiz__q { border: 1px solid var(--line-soft); border-radius: var(--r-card); padding: 14px 16px; margin: 0; min-width: 0; }
.quiz__q.is-ok { border-color: #1f7a3a; }
.quiz__q.is-ko { border-color: var(--accent); }
.quiz__ask { font-weight: 800; font-size: 1.1rem; padding: 0; margin-bottom: 10px; float: left; width: 100%; }
.quiz__ask + * { clear: both; }
.quiz__n { color: var(--text-muted); font-size: .85rem; margin-right: 4px; }
.quiz__opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 8px; }
.quiz__opt { text-align: left; padding: 10px 12px; min-height: 44px; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--bg-main); color: inherit; font: inherit; cursor: pointer; }
.quiz__opt:hover:not(:disabled) { border-color: var(--text-main); }
.quiz__opt:disabled { cursor: default; opacity: .75; }
.quiz__opt.is-right { opacity: 1; border-color: #1f7a3a; background: #e6f4ea; color: #0d3d1c; font-weight: 700; }
.quiz__opt.is-wrong { opacity: 1; border-color: var(--accent); background: #fbe9e7; color: #5c0f0a; }
.quiz__after { margin-top: 10px; }
.quiz__verdict { font-weight: 800; margin: 0 0 4px; }
.quiz__score { font-size: 1.5rem; font-weight: 900; margin: 0; }
.quiz__grid { font-size: 1.6rem; letter-spacing: .1em; margin: 4px 0 8px; }
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--gap); position: sticky; top: 0; z-index: 4; background: var(--bg-main); padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.toc a { font-size: .85rem; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r-control); text-decoration: none; white-space: nowrap; }
.toc a:hover { border-color: var(--text-main); }
[id^="h-"] { scroll-margin-top: 64px; }
.year-cal { display: grid; grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: 18px 22px; }
.year-cal__name { font-weight: 800; margin: 0 0 6px; }
.year-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; font-size: .82rem; text-align: center; }
.year-cal__dow { color: var(--text-muted); font-weight: 700; font-size: .7rem; padding-bottom: 2px; }
.year-cal__d { padding: 4px 0; border-radius: 4px; font-variant-numeric: tabular-nums; }
.year-cal__d.is-we, .cal-key.is-we { background: var(--bg-2); }
.year-cal__d.is-hol, .cal-key.is-hol { background: var(--accent-bg); color: var(--on-accent); font-weight: 800; }
.year-cal__d.is-opt, .cal-key.is-opt { box-shadow: inset 0 0 0 2px var(--accent-bg); font-weight: 700; }
.year-cal__d.is-bridge, .cal-key.is-bridge { background: repeating-linear-gradient(135deg, transparent 0 3px, color-mix(in srgb, var(--accent-bg) 35%, transparent) 3px 6px); font-weight: 700; }
.cal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.cal-key { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; margin-right: -8px; border: 1px solid var(--line-soft); }
.cal-legend > span { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.cal-key { margin-right: 0; }
@media (max-width: 40rem) { .toc { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .toc::-webkit-scrollbar { display: none; } }

.cards-dlg { width: min(56rem, calc(100vw - 32px)); max-height: calc(100vh - 32px); border: 0; border-radius: var(--r-card); padding: 18px 20px; background: var(--bg-main); color: var(--text-main); }
.cards-dlg::backdrop { background: rgb(0 0 0 / .55); }
.cards-dlg__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cards-dlg__head h2 { margin: 0; font-size: 1.2rem; }
.cards-dlg__grid { display: grid; grid-template-columns: 2fr 1.2fr 1fr; gap: 14px; align-items: end; margin-top: 10px; }
.cards-dlg__item { margin: 0; display: grid; gap: 6px; }
.cards-dlg__item img { width: 100%; height: auto; border-radius: 6px; border: 1px solid var(--line-soft); background: var(--bg-2); }
.cards-dlg__item--horizontal img { aspect-ratio: 1200 / 630; }
.cards-dlg__item--feed img { aspect-ratio: 4 / 5; }
.cards-dlg__item--vertical img { aspect-ratio: 9 / 16; }
.cards-dlg__item figcaption { font-size: .8rem; color: var(--text-muted); }
.cards-dlg__btns { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
@media (max-width: 40rem) { .cards-dlg__grid { grid-template-columns: 1fr 1fr; } .cards-dlg__item--horizontal { grid-column: 1 / -1; } }

/* «Para jogar e descobrir»: tiles in the style of «Almanaque de hoje», each in its own colour. */
.tools { margin: 22px 0 8px; }
.tools__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; padding-top: 10px; border-top: 2px solid var(--line); margin-bottom: 12px; }
.tools__head h2 { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; margin: 0; }
.tools__head h2::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 10px; background: var(--accent); vertical-align: -1px; }
.tools__all { font-weight: 700; font-size: 0.92rem; }
.tools__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 560px) { .tools__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .tools__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .tools__tile--surprise { grid-column: span 2; } }
.tools__tile { position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 16px; border: 2px solid var(--line); color: var(--ink); text-decoration: none; background: var(--bg); overflow: hidden; }
.tools__tile:hover .tools__big { text-decoration: underline; }
.tools__kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.tools__big { font-family: var(--font-display); font-weight: 900; font-size: 1.45rem; line-height: 1.05; letter-spacing: -0.01em; text-wrap: balance; }
.tools__num { font-size: 2.6rem; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tools__sub { font-size: 0.92rem; color: var(--ink-2); }
.tools__go { margin-top: auto; font-weight: 800; }
.tools__new { display: inline-block; font-size: .62rem; letter-spacing: .06em; background: var(--accent-bg); color: var(--on-accent); padding: 2px 6px; border-radius: 4px; }
/* Colours: the black band (like the moon card), the accent red, and soft tints of sun, moon and rain. */
.tools__tile--surprise { background: var(--invert-bg); color: var(--invert-ink); border-color: var(--invert-bg); padding-right: 120px; min-height: 12rem; }
.tools__tile--surprise .tools__kicker, .tools__tile--surprise .tools__sub { color: var(--invert-ink-2); }
.tools__tile--surprise .tools__big { font-size: 1.9rem; }
.tools__tile--surprise .tools__go { color: var(--moon-gold); }
.tools__tile--surprise .tools__new { background: var(--moon-gold); color: #121212; }
.tools__dice { position: absolute; right: 16px; top: 50%; transform: translateY(-50%) rotate(-12deg); font-size: 5.5rem; line-height: 1; filter: drop-shadow(0 6px 10px rgb(0 0 0 / .45)); }
.tools__tile--quiz { background: var(--accent-bg); color: var(--on-accent); border-color: var(--accent-bg); }
.tools__tile--quiz .tools__kicker, .tools__tile--quiz .tools__sub { color: var(--on-accent); opacity: .9; }
.tools__tile--quiz .tools__new { background: var(--on-accent); color: var(--accent); }
.tools__dots { display: flex; gap: 5px; }
.tools__dots i { width: 22px; height: 22px; border-radius: 5px; background: rgb(255 255 255 / .22); }
.tools__dots i:nth-child(1), .tools__dots i:nth-child(2), .tools__dots i:nth-child(4) { background: #3fbf6a; }
.tools { --tint-sun: 34%; --tint-rain: 16%; --tint-moon: 60%; --tint-green: 18%; }
:root[data-theme="dark"] .tools { --tint-sun: 14%; --tint-rain: 20%; --tint-moon: 12%; --tint-green: 14%; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .tools { --tint-sun: 14%; --tint-rain: 20%; --tint-moon: 12%; --tint-green: 14%; } }
.tools__tile--countdown { background: color-mix(in srgb, var(--sun-yellow) var(--tint-sun), var(--bg-main)); }
.tools__tile--holidays { background: var(--bg-main); }
.tools__months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin-top: auto; }
.tools__months i { aspect-ratio: 1; display: grid; place-items: center; font-style: normal; font-size: .62rem; font-weight: 800; border: 1px solid var(--line-soft); border-radius: 3px; }
.tools__months i.has { background: var(--accent-bg); color: var(--on-accent); border-color: var(--accent-bg); }
.tools__months i.now { outline: 2px solid var(--text-main); outline-offset: 1px; }
.tools__tile--calc { background: color-mix(in srgb, var(--wx-rain) var(--tint-rain), var(--bg-main)); }
.tools__tile--since { background: color-mix(in srgb, var(--moon-gold) var(--tint-moon), var(--bg-main)); }
.tools__tile--life { background: color-mix(in srgb, #3fbf6a var(--tint-green), var(--bg-main)); }
.tools__tile--countdown .tools__num, .tools__tile--calc .tools__num, .tools__tile--since .tools__num, .tools__tile--life .tools__num, .tools__tile--holidays .tools__num { color: var(--accent); }

/* -- Design 2 for the October 2026 additions: surfaces and round corners, no black frames ---- */
.tools__head { border-top: 1px solid var(--line-soft); }
.tools__tile { border: 0; border-radius: var(--r-card); background: var(--bg-2); }
.tools__tile--holidays { background: var(--bg-2); }
.tools__months i { border-radius: 4px; }
.tools__dots i { border-radius: 4px; }
.discover__card { border: 0; border-top: 4px solid var(--accent); background: var(--bg-2); }
.quiz__q { border: 0; background: var(--bg-2); box-shadow: inset 0 0 0 2px transparent; }
.quiz__q.is-ok { box-shadow: inset 0 0 0 2px #1f7a3a; }
.quiz__q.is-ko { box-shadow: inset 0 0 0 2px var(--accent); }
.quiz__opt { border-width: var(--border-control); border-radius: var(--r-control); background: var(--bg-main); }
.toc a { border-width: var(--border-control); border-radius: var(--r-control); }
.calc, .days-calc { border-top: 1px solid var(--line-soft); }
.trust__badge { border-radius: var(--r-control); }
.year-cal__d { border-radius: 4px; }
.cards-dlg__item img { border-radius: var(--r-control); }
.photo-pick__item { border-radius: var(--r-control); }

/* The coloured tiles keep their colour over the surface above. */
.tools__tile--surprise { background: var(--invert-bg); }
.tools__tile--quiz { background: var(--accent-bg); }
.tools__tile--countdown { background: color-mix(in srgb, var(--sun-yellow) var(--tint-sun), var(--bg-main)); }
.tools__tile--calc { background: color-mix(in srgb, var(--wx-rain) var(--tint-rain), var(--bg-main)); }
.tools__tile--since { background: color-mix(in srgb, var(--moon-gold) var(--tint-moon), var(--bg-main)); }
.tools__tile--life { background: color-mix(in srgb, #3fbf6a var(--tint-green), var(--bg-main)); }
.quiz__opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 34rem) { .quiz__opts { grid-template-columns: minmax(0, 1fr); } }

/* Tiles are links: the text keeps its colour on hover (the red link hover is invisible on red). */
.tools__tile:hover, .tools__tile:focus-visible { color: var(--ink); }
.tools__tile--surprise:hover, .tools__tile--surprise:focus-visible { color: var(--invert-ink); }
.tools__tile--quiz:hover, .tools__tile--quiz:focus-visible { color: var(--on-accent); }
.tools__tile:hover { box-shadow: 0 0 0 2px var(--text-main); }
.tools__tile--quiz:hover { box-shadow: 0 0 0 2px var(--text-main), inset 0 0 0 2px rgb(255 255 255 / .35); }
.tools__played { font-weight: 700; font-size: .95rem; }
.tools__monthsbox { display: grid; gap: 4px; margin-top: auto; }
.tools__months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin: 0; }
.tools__months i { aspect-ratio: auto; display: grid; place-items: center; gap: 1px; padding: 3px 0; font-style: normal; border: 0; border-radius: 4px; background: var(--bg-main); }
.tools__months i b { font-size: .62rem; font-weight: 700; color: var(--text-muted); }
.tools__months i em { font-style: normal; font-size: .78rem; font-weight: 800; }
.tools__months i.has { background: var(--accent-bg); color: var(--on-accent); }
.tools__months i.has b { color: var(--on-accent); opacity: .85; }
.tools__months i.now { outline: 2px solid var(--text-main); outline-offset: 1px; }
.tools__caption { font-size: .78rem; color: var(--text-muted); }
.tools__nextlist { display: grid; gap: 2px; margin-top: auto; font-size: .9rem; }
.tools__nextlist strong { display: inline-block; min-width: 3.6rem; color: var(--accent); }
.tools__nextlist em { font-style: normal; font-weight: 700; }

/* Option letters (quiz and challenge). */
.quiz__opt { display: flex; align-items: center; gap: 10px; }
.quiz__letter { flex: 0 0 auto; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 800; font-size: .85rem; background: var(--bg-2); color: var(--text-main); }
.quiz__opt.is-right .quiz__letter { background: #1f7a3a; color: #fff; }
.quiz__opt.is-wrong .quiz__letter { background: var(--accent); color: #fff; }
.quiz__why { margin: 0; }

/* The daily challenge: a dark band (like the moon card) with a big question and a sign of its kind. */
.quiz--desafio { max-width: none; }
.quiz--desafio .quiz__q { position: relative; display: grid; gap: 14px; padding: 22px clamp(18px, 3vw, 28px); padding-right: clamp(18px, 22vw, 200px); background: var(--invert-bg); color: var(--invert-ink); border-radius: var(--r-card); box-shadow: none; overflow: hidden; }
.quiz--desafio .quiz__q.is-ok { box-shadow: inset 0 0 0 3px #3fbf6a; }
.quiz--desafio .quiz__q.is-ko { box-shadow: inset 0 0 0 3px var(--moon-gold); }
.quiz--desafio .quiz__kind { margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--moon-gold); order: -1; }
.quiz--desafio .quiz__ask { font-family: var(--font-display); font-weight: 900; font-size: clamp(1.4rem, 3.2vw, 2.1rem); line-height: 1.1; letter-spacing: -0.01em; margin: 0; text-wrap: balance; color: var(--invert-ink); }
.quiz--desafio .quiz__opt { min-height: 54px; padding: 10px 14px; background: rgb(255 255 255 / .07); color: var(--invert-ink); border-color: var(--invert-line); font-size: 1.02rem; }
.quiz--desafio .quiz__opt:hover:not(:disabled) { background: rgb(255 255 255 / .14); border-color: var(--moon-gold); }
.quiz--desafio .quiz__letter { background: var(--moon-gold); color: #121212; }
.quiz--desafio .quiz__opt.is-right { background: #e6f4ea; color: #0d3d1c; border-color: #3fbf6a; }
.quiz--desafio .quiz__opt.is-wrong { background: #fbe9e7; color: #5c0f0a; border-color: var(--accent); }
.quiz--desafio .quiz__opt:disabled:not(.is-right):not(.is-wrong) { opacity: .45; }
.quiz--desafio .quiz__after { margin: 0; padding: 14px 16px; border-radius: var(--r-control); background: rgb(255 255 255 / .08); }
.quiz--desafio .quiz__verdict { font-family: var(--font-display); font-size: 1.3rem; color: var(--invert-ink); }
.quiz--desafio .quiz__why { color: var(--invert-ink-2); }
.quiz--desafio .quiz__why a { color: var(--moon-gold); }
.quiz__sign { position: absolute; right: clamp(14px, 3vw, 34px); top: 50%; transform: translateY(-50%) rotate(-8deg); font-family: var(--font-display); font-weight: 900; line-height: 1; letter-spacing: -0.04em; color: var(--moon-gold); opacity: .9; pointer-events: none; }
.quiz__sign--ano { font-size: clamp(2.6rem, 8vw, 5.4rem); }
.quiz__sign--palavra { font-size: clamp(3rem, 10vw, 7rem); }
.quiz__sign--dia { font-size: clamp(3rem, 9vw, 6rem); filter: drop-shadow(0 6px 10px rgb(0 0 0 / .45)); }
@media (max-width: 40rem) { .quiz--desafio .quiz__q { padding-right: 18px; } .quiz__sign { top: 16px; right: 14px; transform: rotate(-8deg); font-size: 2.2rem !important; opacity: .55; } }
.quiz--desafio .quiz__end { margin-top: 10px; }
.quiz__next { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0; padding: 12px 16px; border-radius: var(--r-card); background: var(--bg-2); }
.quiz__next strong { font-family: var(--font-display); font-size: 1.2rem; }
.quiz--desafio .quiz__ask { order: 0; float: left; width: 100%; } /* floated: an ordinary grid item, not drawn on the fieldset border */
.quiz--desafio .quiz__opts, .quiz--desafio .quiz__after { order: 1; }

@media (max-width: 40rem) { .quiz__sign { display: none; } }

.passkey-login { display: grid; gap: 6px; margin: 0 0 18px; max-width: 28rem; }
.pk-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.pk-del { margin-left: auto; }
.pk-add { display: grid; gap: 6px; max-width: 26rem; margin-top: 14px; }
/* Questions are a plain group now (no fieldset/legend: Safari drew the legend on the border). */
.quiz__ask, .quiz--desafio .quiz__ask { float: none; width: auto; }
.quiz__ask { margin: 0 0 10px; }
.quiz--desafio .quiz__ask { margin: 0; }

/* Admin · TikTok captions to paste (inbox videos take no caption) */
.social-tt-inbox__list { list-style: none; margin: 0; padding: 0; }
.social-tt-inbox__list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.social-tt-inbox__list .social-list__title { margin: 0; }
.social-tt-inbox__list .note { margin: 2px 0 0; }
.social-tt-inbox__list .btn { flex: none; }
