/* The header menu of every page (index, roadmap, download, news, philosophy) and the text rules they share.
   From 1180 px: «Funzioni ▾» (a disclosure with the sections of the home page, in the order they
   appear on it, so a click never jumps back up), Roadmap, Filosofia,
   Manuale, Scarica, Novità. The call to action shows its short label below 1340 px. Below 1180 px the ☰
   button opens the drawer with every item and the full call to action. i18n/misura_header.py
   checks, headless, that nothing wraps or overflows in the six languages from 320 to 1920 px. */
nav.links { display: none; align-items: center; gap: 20px; margin-inline-start: auto; }
nav.links > a, .dd-btn { color: var(--ink-soft); text-decoration: none; font-size: 15px; white-space: nowrap; }
nav.links > a:hover { color: var(--accent-text); }
nav.links a[aria-current="page"] { color: var(--accent-text); font-weight: 600; }
@media (min-width: 1180px) { nav.links { display: flex; } .bar-right { margin-inline-start: 0; } }
.bar .btn { padding: 8px 14px; line-height: 1.2; white-space: nowrap; }
.cta-top .cta-short, .menu-btn { display: none; }
@media (max-width: 1339.98px) { .cta-top .cta-long { display: none; } .cta-top .cta-short { display: inline; } }
@media (max-width: 1179.98px) { .menu-btn { display: grid; } }
.menu-btn svg { width: 20px; height: 20px; }
.menu-btn:focus-visible, .dd-btn:focus-visible, .dd-menu a:focus-visible, .drawer a:focus-visible, .drawer button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* «Funzioni ▾» */
.dd { position: relative; }
.dd-btn { font: inherit; font-size: 15px; background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.dd-btn:hover, .dd-btn[aria-expanded="true"] { color: var(--accent-text); }
.dd-btn .chev { width: 14px; height: 14px; flex: none; transition: transform .15s; }
.dd-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.dd-menu { display: none; position: absolute; top: calc(100% + 14px); inset-inline-start: -14px; min-width: 200px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: 8; }
.dd-btn[aria-expanded="true"] + .dd-menu { display: grid; }
.dd-menu a { padding: 8px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 15px; white-space: nowrap; }
.dd-menu a:hover { background: var(--field); color: var(--accent-text); }

/* the drawer, below 1180 px */
.drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(340px, 86vw); z-index: 30; background: var(--card); border-inline-start: 1px solid var(--line); box-shadow: 0 0 40px rgba(0,0,0,.35); display: flex; flex-direction: column; padding: 14px 16px 20px; transform: translateX(105%); visibility: hidden; transition: transform .2s, visibility .2s; }
[dir="rtl"] .drawer { transform: translateX(-105%); }
:root.drawer-open .drawer { transform: none; visibility: visible; }
:root.drawer-open, :root.drawer-open body { overflow: hidden; }
.drawer-veil { position: fixed; inset: 0; z-index: 29; background: rgba(8,14,20,.55); }
.drawer-veil[hidden] { display: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; height: 44px; margin-bottom: 10px; flex: none; }
.drawer-head .brand { font-size: 19px; }
.drawer-head .theme-toggle { font-size: 24px; line-height: 1; }
.drawer-nav { display: grid; align-content: start; gap: 2px; overflow-y: auto; min-height: 0; }
.drawer-nav a { color: var(--ink); text-decoration: none; font-size: 17px; line-height: 1.35; padding: 10px 12px; border-radius: 8px; }
.drawer-nav a:hover { background: var(--field); }
.drawer-nav a[aria-current="page"] { color: var(--accent-text); font-weight: 600; background: color-mix(in srgb, var(--accent) 12%, transparent); }
/* the sections of the home page, in the order they appear on it, then the other pages */
.drawer-sub { display: grid; gap: 2px; padding-bottom: 8px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.drawer-cta { margin-top: auto; justify-content: center; flex: none; }
.drawer-cta svg { flex: none; }
@media (min-width: 1180px) { .drawer, .drawer-veil { display: none; } }
/* the narrowest phones: logo, language, theme and ☰ still on one row */
@media (max-width: 400px) { .bar { gap: 8px; } .bar-right { gap: 6px; } .brand { gap: 8px; } .lang-pick select { padding: 6px 4px; } }
@media (max-width: 360px) { .bar .brand { font-size: 18px; gap: 6px; } .bar .brand svg { width: 20px; height: 27px; } }
@media (prefers-reduced-motion: reduce) { .drawer, .dd-btn .chev { transition: none; } }
@media print { .menu-btn, .drawer, .drawer-veil { display: none !important; } }

/* text never wraps awkwardly: paragraphs avoid orphans, centred texts balance their lines, a
   button never breaks its label */
h1, h2, h3, p, li, summary, .sub, .lead { text-wrap: pretty; }
.final h2, .final .sub, .fin-card h2, .fin-card .sub, .lightbox .lb-cap, .coming { text-wrap: balance; }
.btn { white-space: nowrap; }

/* the footer's Italian flag: three thin bars, not the official mark */
.made { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 18px 0 0; font-size: 13.5px; color: var(--muted); }
.made b { font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.made [data-i18n] { white-space: nowrap; }
.tric { display: inline-flex; gap: 2px; flex: none; height: 12px; }
.tric i { width: 4px; border-radius: 1px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); }
.tric i:nth-child(1) { background: #009246; } .tric i:nth-child(2) { background: #F4F5F0; } .tric i:nth-child(3) { background: #CE2B37; }
