/* ==========================================================================
   crudo.net — foglio di stile principale
   Concetto: lo schedario. Ogni ricetta è una scheda numerata, come nel sito
   storico ("Ricetta numero: 389"). Porcellana e verde pino, giallo zafferano
   solo dove serve richiamare l'attenzione.
   ========================================================================== */

:root {
    /* Colore */
    --paper:      #f1f3ef;
    --paper-deep: #e6eae3;
    --card:       #ffffff;
    --ink:        #16211c;
    --ink-soft:   #5c6762;
    --ink-faint:  #8a938e;
    --pine:       #1d4b3a;
    --pine-deep:  #12301f;
    --pine-tint:  #e7efe9;
    --saffron:    #d9971f;
    --saffron-tint:#fbf1dc;
    --lake:       #3a6e8f;
    --rule:       #dbe1d8;
    --rule-soft:  #ecefe9;
    --danger:     #9d2c1f;
    --danger-tint:#fbeae7;

    /* Tipografia */
    --display: "Fraunces", "Iowan Old Style", Georgia, serif;
    --body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

    /* Ritmo */
    --gap:    1rem;
    --gutter: clamp(1rem, 4vw, 2.5rem);
    --radius: 10px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 2px rgb(22 33 28 / 6%), 0 2px 8px rgb(22 33 28 / 4%);
    --shadow-md: 0 2px 6px rgb(22 33 28 / 8%), 0 12px 28px rgb(22 33 28 / 8%);

    --tab-height: 62px;
}

/* -- Reset mirato ---------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.6;
    font-feature-settings: "cv05" 1, "ss01" 1;
    -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--pine); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--pine-deep); }

h1, h2, h3, h4 {
    font-family: var(--display);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.015em;
    margin: 0 0 0.5em;
    font-variation-settings: "SOFT" 20, "WONK" 1, "opsz" 40;
}

h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3.2vw, 2rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

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

.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 999;
    background: var(--pine); color: #fff; padding: 0.75rem 1.25rem;
}
.skip-link:focus { left: 0; }

/* -- Impalcatura ----------------------------------------------------------- */

.shell {
    max-width: 1180px;
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.page {
    padding-block: clamp(1.5rem, 4vw, 3rem);
    padding-bottom: calc(var(--tab-height) + 2rem);
}

@media (min-width: 860px) {
    .page { padding-bottom: 4rem; }
}

/* -- Intestazione ---------------------------------------------------------- */

.masthead {
    background: var(--card);
    border-bottom: 1px solid var(--rule);
    position: sticky;
    top: 0;
    z-index: 40;
}

.masthead__inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 64px;
}

.wordmark {
    font-family: var(--display);
    font-size: 1.35rem;
    font-weight: 700;
    font-variation-settings: "SOFT" 0, "WONK" 1, "opsz" 20;
    letter-spacing: -0.03em;
    color: var(--ink);
    text-decoration: none;
    display: flex;
    align-items: baseline;
    gap: 0.15rem;
}
.wordmark__dot { color: var(--saffron); }
.wordmark small {
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-left: 0.6rem;
    font-weight: 400;
}

.masthead__nav {
    margin-left: auto;
    display: none;
    gap: 0.35rem;
    align-items: center;
}

@media (min-width: 860px) {
    .masthead__nav { display: flex; }
}

.navlink {
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    text-decoration: none;
    color: var(--ink-soft);
    font-size: 0.92rem;
    font-weight: 500;
}
.navlink:hover { background: var(--pine-tint); color: var(--pine-deep); }
.navlink[aria-current="page"] { background: var(--pine); color: #fff; }

/* -- Elemento firma: numero di scheda -------------------------------------- */

.catalog-no {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.catalog-no::before {
    content: "№ ";
    color: var(--saffron);
}

/* -- Ricerca in evidenza --------------------------------------------------- */

.hero {
    padding-block: clamp(2rem, 6vw, 4.5rem) clamp(1.5rem, 4vw, 3rem);
    border-bottom: 1px solid var(--rule);
    background:
        radial-gradient(120% 80% at 50% 0%, #fff 0%, var(--paper) 70%);
}

.hero__eyebrow {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--ink-faint);
    margin-bottom: 0.9rem;
}

.hero h1 {
    max-width: 16ch;
    margin-bottom: 0.4em;
}
.hero h1 em {
    font-style: italic;
    color: var(--pine);
    font-variation-settings: "SOFT" 60, "WONK" 1;
}

.hero__lede {
    max-width: 52ch;
    color: var(--ink-soft);
    font-size: 1.05rem;
}

.searchbar {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--card);
    border: 1.5px solid var(--rule);
    border-radius: 999px;
    padding: 0.35rem 0.35rem 0.35rem 1.1rem;
    box-shadow: var(--shadow-sm);
    max-width: 620px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.searchbar:focus-within {
    border-color: var(--pine);
    box-shadow: var(--shadow-md);
}
.searchbar__icon { color: var(--ink-faint); flex: none; }
.searchbar input {
    flex: 1;
    border: 0;
    background: none;
    padding: 0.7rem 0.6rem;
    font-size: 1rem;
    min-width: 0;
}
.searchbar input:focus { outline: none; }
.searchbar__submit {
    flex: none;
    border: 0;
    background: var(--pine);
    color: #fff;
    border-radius: 999px;
    padding: 0.7rem 1.35rem;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
}
.searchbar__submit:hover { background: var(--pine-deep); }

/* Suggerimenti live */
.suggestions {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 0.5rem);
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    z-index: 50;
    display: none;
}
.suggestions[data-open="true"] { display: block; }
.suggestions a {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.7rem 1.1rem;
    text-decoration: none;
    color: var(--ink);
    border-bottom: 1px solid var(--rule-soft);
}
.suggestions a:last-child { border-bottom: 0; }
.suggestions a:hover,
.suggestions a[aria-selected="true"] { background: var(--pine-tint); }
.suggestions__title { font-weight: 500; }
.suggestions__meta { margin-left: auto; font-size: 0.78rem; color: var(--ink-faint); }

/* -- Filtri a pastiglia ---------------------------------------------------- */

.chips {
    display: flex;
    gap: 0.45rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-block: 0.25rem;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    scroll-snap-type: x proximity;
}
.chips::-webkit-scrollbar { display: none; }

@media (min-width: 860px) {
    .chips { flex-wrap: wrap; margin-inline: 0; padding-inline: 0; }
}

.chip {
    flex: none;
    scroll-snap-align: start;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--rule);
    border-radius: 999px;
    background: var(--card);
    color: var(--ink-soft);
    font-size: 0.86rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}
.chip:hover { border-color: var(--pine); color: var(--pine); }
.chip[aria-pressed="true"], .chip.is-active {
    background: var(--pine);
    border-color: var(--pine);
    color: #fff;
}
.chip__count {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--ink-faint);
}
.chip.is-active .chip__count { color: rgb(255 255 255 / 70%); }

/* -- Griglia delle schede -------------------------------------------------- */

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-block: clamp(2rem, 5vw, 3.25rem) 1.25rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--rule);
}
.section-head h2 { margin: 0; }
.section-head a { font-size: 0.9rem; font-weight: 500; white-space: nowrap; }

.grid {
    display: grid;
    gap: clamp(0.85rem, 2vw, 1.35rem);
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
@media (max-width: 520px) {
    .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

.card {
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: #c9d2c6;
    color: inherit;
}

.card__figure {
    aspect-ratio: 4 / 3;
    background: var(--paper-deep);
    position: relative;
    overflow: hidden;
}
.card__figure img { width: 100%; height: 100%; object-fit: cover; }

.card__no {
    position: absolute;
    top: 0.55rem;
    left: 0.55rem;
    background: rgb(255 255 255 / 92%);
    backdrop-filter: blur(4px);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

.card__body { padding: 0.85rem 0.9rem 1rem; display: flex; flex-direction: column; flex: 1; }
.card__kicker {
    font-family: var(--mono);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: var(--pine);
    margin-bottom: 0.35rem;
}
.card__title {
    font-family: var(--display);
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.25;
    margin: 0 0 0.5rem;
    font-variation-settings: "SOFT" 20, "opsz" 20;
}
.card__meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--ink-faint);
    padding-top: 0.5rem;
    border-top: 1px solid var(--rule-soft);
}

/* -- Segnaposto fotografia ------------------------------------------------- */

.photo-slot {
    display: grid;
    place-items: center;
    height: 100%;
    background:
        repeating-linear-gradient(45deg,
            var(--paper-deep) 0 10px,
            #e1e6dd 10px 20px);
    color: var(--ink-faint);
    text-align: center;
    padding: 1rem;
}
.photo-slot__label {
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 0.5rem;
}
.photo-slot svg { opacity: 0.45; }

/* -- Indicatore difficoltà (pip) ------------------------------------------- */

.pips { display: inline-flex; gap: 3px; align-items: center; }
.pip {
    width: 7px; height: 7px;
    border-radius: 2px;
    background: var(--rule);
}
.pip.is-on { background: var(--saffron); }

/* -- Scheda ricetta -------------------------------------------------------- */

.scheda {
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Striscia superiore in stile cartellino da schedario */
.scheda__strip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.1rem;
    background: var(--pine-deep);
    color: rgb(255 255 255 / 78%);
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    overflow-x: auto;
    scrollbar-width: none;
}
.scheda__strip::-webkit-scrollbar { display: none; }
.scheda__strip .catalog-no { color: #fff; font-size: 0.72rem; }
.scheda__strip span { white-space: nowrap; }
.scheda__strip .sep { opacity: 0.35; }

.scheda__head { padding: clamp(1.25rem, 4vw, 2.25rem); }

/* Pagine di solo testo del CMS: stesso riquadro della scheda ricetta, ma
   senza il layout a due colonne — qui c'è solo prosa da leggere. */
.scheda__body-plain {
    padding: 0 clamp(1.25rem, 4vw, 2.25rem) clamp(1.5rem, 4vw, 2.5rem);
    max-width: 70ch;
}
.scheda__body-plain .scheda__head { padding: clamp(1.25rem, 4vw, 2.25rem) 0 0; }
.scheda__head h1 { margin-bottom: 0.35rem; }
.scheda__byline { color: var(--ink-soft); font-size: 0.95rem; margin: 0; }

.factbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    background: var(--paper);
}
.fact {
    padding: 0.85rem 1.1rem;
    border-right: 1px solid var(--rule);
}
.fact:last-child { border-right: 0; }
.fact__label {
    font-family: var(--mono);
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--ink-faint);
    margin-bottom: 0.2rem;
}
.fact__value { font-weight: 600; font-size: 0.98rem; }

/* Fotografia di copertina: una sola, a piena larghezza della scheda */
.scheda__photo {
    margin: 0;
    padding: clamp(1rem, 3vw, 1.5rem);
}
.scheda__photo figure {
    margin: 0;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--paper-deep);
    border: 1px solid var(--rule);
}
.scheda__photo img { width: 100%; height: 100%; object-fit: cover; }

@media (min-width: 900px) {
    /* Su schermi larghi una foto a tutta pagina è sproporzionata. */
    .scheda__photo figure { max-width: 620px; }
}

.scheda__body {
    display: grid;
    gap: clamp(1.5rem, 4vw, 2.5rem);
    padding: clamp(1.25rem, 4vw, 2.25rem);
}
@media (min-width: 900px) {
    .scheda__body { grid-template-columns: 320px 1fr; align-items: start; }
}

/* Ingredienti come registro a due colonne */
.ledger { margin: 0; }
.ledger__title {
    font-family: var(--mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--ink-faint);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--ink);
    margin-bottom: 0.25rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
/* La griglia sta sull'ELENCO, non sulle singole righe.
   Al primo tentativo era su ogni riga: con «max-content» ciascuna misurava
   il proprio contenuto e la colonna cambiava larghezza da una riga all'altra,
   così «Olio d'oliva» partiva quindici pixel più a destra degli altri.
   Una griglia sola per tutto l'elenco allinea davvero le colonne.
   Gli elenchi però sono due — «Ingredienti» e «Altri ingredienti» — e due
   griglie separate non si parlano: con «max-content» il secondo risultava
   più largo del primo e i nomi partivano da due punti diversi. Serve quindi
   una larghezza uguale per entrambi, non calcolata sul contenuto.

   8,5rem è la misura di «1/2 Bicchierino/i», la quantità più lunga
   dell'archivio, nel carattere a spaziatura fissa usato qui. */
.ledger__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 8.5rem 1fr;
    column-gap: 0.75rem;
}

.ledger__row {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px dotted var(--rule);
    align-items: baseline;
}
.ledger__qty {
    font-family: var(--mono);
    font-size: 0.82rem;
    text-align: right;
    color: var(--pine);
    font-variant-numeric: tabular-nums;
    /* Nessuna andata a capo: la quantità è un dato unico, spezzarla fra due
       righe la rende più difficile da leggere di quanto sia larga. */
    white-space: nowrap;
}

/* Su schermi molto stretti la riga unica non ci sta: meglio impilare
   quantità e nome che spezzare le parole a metà. */
@media (max-width: 380px) {
    .ledger__row { grid-template-columns: 1fr; gap: 0.1rem; }
    .ledger__qty { text-align: left; }
}
.ledger__name { font-size: 0.95rem; }
.ledger__sub {
    margin-top: 1.5rem;
}

.servings-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--ink-soft);
}
.servings-control button {
    width: 30px; height: 30px;
    border: 1px solid var(--rule);
    background: var(--card);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    line-height: 1;
}
.servings-control button:hover { border-color: var(--pine); color: var(--pine); }
.servings-control output {
    font-family: var(--mono);
    font-weight: 600;
    color: var(--ink);
    min-width: 1.5rem;
    text-align: center;
}

/* Preparazione */
.prose { font-size: 1.02rem; line-height: 1.75; max-width: 68ch; }
.prose p { margin-bottom: 1.1em; }
.prose h3 {
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--ink-faint);
    margin-top: 2rem;
}
.prose mark { background: var(--saffron-tint); padding: 0 0.15em; }

.note-box {
    background: var(--saffron-tint);
    border-left: 3px solid var(--saffron);
    padding: 1rem 1.15rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.95rem;
    margin-top: 1.5rem;
}
.note-box p:last-child { margin-bottom: 0; }

/* -- Elenco risultati ------------------------------------------------------ */

.results-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.results-count {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--ink-faint);
}

.sort-select {
    border: 1px solid var(--rule);
    background: var(--card);
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
}

.empty {
    text-align: center;
    padding: clamp(2.5rem, 8vw, 5rem) 1rem;
    border: 1px dashed var(--rule);
    border-radius: var(--radius-lg);
    background: var(--card);
}
.empty h3 { font-size: 1.3rem; }
.empty p { color: var(--ink-soft); max-width: 44ch; margin-inline: auto; }

/* -- Paginazione ----------------------------------------------------------- */

.pagination {
    display: flex;
    gap: 0.35rem;
    justify-content: center;
    align-items: center;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    min-width: 40px;
    padding: 0.5rem 0.7rem;
    text-align: center;
    border: 1px solid var(--rule);
    border-radius: 8px;
    background: var(--card);
    text-decoration: none;
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--ink-soft);
}
.pagination a:hover { border-color: var(--pine); color: var(--pine); }
.pagination [aria-current="page"] {
    background: var(--pine); border-color: var(--pine); color: #fff;
}
.pagination .is-disabled { opacity: 0.4; }

/* -- Barra di navigazione mobile ------------------------------------------- */

.tabbar {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: rgb(255 255 255 / 94%);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--rule);
    padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 860px) { .tabbar { display: none; } }

.tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: var(--tab-height);
    text-decoration: none;
    color: var(--ink-faint);
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}
.tabbar a[aria-current="page"] { color: var(--pine); }
.tabbar svg { width: 22px; height: 22px; }

/* -- Messaggi -------------------------------------------------------------- */

.flash-stack {
    position: fixed;
    top: 76px;
    right: var(--gutter);
    left: var(--gutter);
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}
@media (min-width: 640px) {
    .flash-stack { left: auto; max-width: 380px; }
}
.flash {
    pointer-events: auto;
    background: var(--card);
    border: 1px solid var(--rule);
    border-left: 3px solid var(--pine);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow-md);
    font-size: 0.9rem;
    animation: flash-in 0.24s ease-out;
}
.flash--error { border-left-color: var(--danger); }
.flash--warning { border-left-color: var(--saffron); }

@keyframes flash-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: none; }
}

/* -- Pulsanti -------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.62rem 1.15rem;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.3;
}
.btn--primary { background: var(--pine); color: #fff; }
.btn--primary:hover { background: var(--pine-deep); color: #fff; }
.btn--ghost { background: var(--card); border-color: var(--rule); color: var(--ink); }
.btn--ghost:hover { border-color: var(--pine); color: var(--pine); }
.btn--danger { background: var(--danger-tint); color: var(--danger); border-color: #eccbc5; }
.btn--danger:hover { background: var(--danger); color: #fff; }
.btn--sm { padding: 0.38rem 0.75rem; font-size: 0.82rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* -- Piè di pagina --------------------------------------------------------- */

.footer {
    border-top: 1px solid var(--rule);
    background: var(--card);
    margin-top: clamp(3rem, 8vw, 6rem);
    padding-block: 2.5rem;
    padding-bottom: calc(var(--tab-height) + 2.5rem);
    font-size: 0.88rem;
    color: var(--ink-soft);
}
@media (min-width: 860px) { .footer { padding-bottom: 2.5rem; } }
.footer__grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.footer h4 {
    font-family: var(--mono);
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--ink-faint);
    margin-bottom: 0.6rem;
}
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 0.35rem; }
.footer a { text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer__legal {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rule-soft);
    font-size: 0.8rem;
    color: var(--ink-faint);
}

/* -- Stampa ---------------------------------------------------------------- */

@media print {
    .masthead, .tabbar, .footer, .flash-stack, .no-print { display: none !important; }
    .scheda__photo { padding: 0 0 1rem; }
    .scheda__photo figure { max-width: 70mm; border: 0; }
    body { background: #fff; font-size: 11pt; }
    .scheda { border: 0; }
    .scheda__strip { background: none; color: #000; border-bottom: 1px solid #000; }
    .scheda__body { display: block; }
    .ledger { margin-bottom: 1.5rem; }
    a[href]::after { content: ""; }
}

/* -- Movimento ridotto ----------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* L'attributo hidden deve vincere su display: inline-flex, altrimenti un
   elemento nascosto resta visibile. È lo stesso inciampo già incontrato sul
   selettore delle ricette collegate: qui vale per tutti i pulsanti. */
.btn[hidden] { display: none; }

/* -- Condivisione della ricetta --------------------------------------------- */

/* Sotto la fotografia, allineato a sinistra come il resto della colonna. */
.condividi { margin: 0.9rem 0 0; }

.condividi__scelte {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}
.condividi__scelte[hidden] { display: none; }

/* Pieni, non in tono tenue: al primo tentativo erano pastiglie chiare col
   bordo sottile e sparivano accanto alla fotografia. Ognuno porta il colore
   del proprio servizio, che si riconosce prima di leggere l'etichetta. */
.condividi__voce {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.95rem;
    border: 0;
    border-radius: 999px;
    font-family: var(--body);
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: filter .12s, transform .12s;
}
.condividi__voce:hover { filter: brightness(1.08); transform: translateY(-1px); }
.condividi__voce svg { flex: none; }

.condividi__voce[data-social="whatsapp"] { background: #25d366; color: #06331a; }
/* Il blu ufficiale di Facebook dà 4,2:1 con il testo bianco, sotto la soglia
   leggibile: si scurisce quel tanto che basta restando riconoscibile. */
.condividi__voce[data-social="facebook"] { background: #0b5ed7; }

.condividi__voce--neutro {
    background: var(--card);
    color: var(--pine-deep);
    border: 1px solid var(--rule);
}
.condividi__voce--neutro:hover { border-color: var(--pine); }

/* Il pulsante unico del telefono: è la sola cosa visibile, quindi pieno. */
.condividi__apri {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1.2rem;
    border: 0;
    border-radius: 999px;
    background: var(--pine);
    color: #fff;
    font-family: var(--body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}
.condividi__apri:hover { background: var(--pine-deep); }

/* «display: inline-flex» prevale sull'attributo hidden: senza questa riga il
   pulsante resta visibile sul computer, dove non serve, accanto alle tre
   scelte. È lo stesso inciampo già incontrato altrove. */
.condividi__apri[hidden] { display: none; }
.condividi__voce[hidden] { display: none; }

@media print { .condividi { display: none; } }

/* -- Contenuto delle pagine scritte dall'area riservata --------------------- */

/* I colori restano quelli del tema: il contenuto usa le variabili come il
   resto del sito, quindi cambiando tema cambia anche lui. Fanno eccezione i
   colori scelti a mano nell'editor, che sono scritti nel testo e restano
   quelli — è il prezzo di poterli scegliere. */
.prosa { font-size: 1.02rem; line-height: 1.8; color: var(--ink-soft); }
.prosa h2 {
    font-family: var(--display);
    font-size: 1.5rem;
    color: var(--ink);
    margin: 2rem 0 0.7rem;
}
.prosa h3 {
    font-family: var(--display);
    font-size: 1.2rem;
    color: var(--ink);
    margin: 1.5rem 0 0.5rem;
}
.prosa p { margin: 0 0 1.1rem; }
.prosa ul, .prosa ol { margin: 0 0 1.1rem 1.4rem; }
.prosa li { margin-bottom: 0.35rem; }
.prosa a { color: var(--lake); }
.prosa blockquote {
    margin: 1.3rem 0;
    padding: 0.2rem 0 0.2rem 1.1rem;
    border-left: 3px solid var(--saffron);
    color: var(--ink-faint);
}
.prosa img { max-width: 100%; height: auto; border-radius: var(--radius); }
.prosa hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }
.prosa table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; }
.prosa th, .prosa td { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--rule); text-align: left; }

/* -- Statistiche in griglia (pagina «Il sito» e affini) ---------------------- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.9rem;
}
.stat {
    padding: 0.9rem 1rem;
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
}
.stat__label {
    font-family: var(--mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-faint);
}
.stat__value {
    font-family: var(--display);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--ink);
    margin-top: 0.15rem;
}

/* -- Intestazione della scheda di un autore ---------------------------------- */

.autore__intestazione {
    display: flex;
    align-items: center;
    gap: 1.3rem;
    margin-bottom: 1.4rem;
}
.autore__foto {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--card);
    box-shadow: var(--shadow-sm);
    flex: none;
}

@media (max-width: 520px) {
    .autore__intestazione { gap: 0.9rem; }
    .autore__foto { width: 72px; height: 72px; }
}
