/* ==================================================================
   Recensisci — Sistema di design "Osteria di Pregio"
   Base condivisa: token, reset, tipografia, componenti comuni.
   Editoriale + premium: Fraunces (display) + Archivo (testo).
   ================================================================== */

:root {
    /* ---- Colore (ruoli precisi) ---- */
    --carta:    #FAF4EA;   /* sfondo, carta avorio */
    --carta-2:  #F4ECDD;   /* sezioni alternate */
    --panna:    #FFFFFF;   /* superfici/targhe */
    --verde:    #1B3A2F;   /* marchio, superfici scure */
    --verde-2:  #16302A;
    --verde-300:#3F6B5B;   /* verde chiaro per accenti su scuro */
    --cotto:    #C24B33;   /* azione / CTA */
    --cotto-2:  #A83C28;
    --zaff:     #E0A12E;   /* accento, motivo "tap" */
    --zaff-2:   #C9881C;
    --ink:      #1A201B;   /* testo */
    --muted:    #6E6256;   /* testo secondario */
    --muted-2:  #8A7B6B;
    --sand:     #E7D9C6;   /* bordi/superfici tenui */
    --linea:    #DED0BC;   /* filetto sottile */

    /* ---- Tipografia ---- */
    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --font-sans: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    /* scala tipografica fluida */
    --fs-300: .8125rem;
    --fs-350: .9rem;
    --fs-400: 1rem;
    --fs-500: 1.125rem;
    --fs-600: clamp(1.35rem, 1.12rem + 1.05vw, 1.85rem);
    --fs-700: clamp(1.8rem, 1.35rem + 2.1vw, 2.75rem);
    --fs-800: clamp(2.5rem, 1.75rem + 3.6vw, 4.25rem);
    --fs-900: clamp(3rem, 1.9rem + 5.2vw, 5.75rem);

    /* ---- Spazio, raggi, ombre, moto ---- */
    --maxw: 1140px;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-lg: 22px;
    --radius-pill: 999px;
    --shadow-sm: 0 1px 2px rgba(26, 32, 27, .05);
    --shadow: 0 1px 2px rgba(26, 32, 27, .04), 0 18px 40px -26px rgba(26, 32, 27, .22);
    --shadow-lg: 0 2px 4px rgba(26, 32, 27, .05), 0 40px 70px -38px rgba(26, 32, 27, .32);
    --ease: cubic-bezier(.2, .7, .2, 1);
    --t-fast: .16s var(--ease);
    --t: .28s var(--ease);
}

/* ---- Reset essenziale ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
body {
    font-family: var(--font-sans);
    font-size: var(--fs-400);
    line-height: 1.62;
    color: var(--ink);
    background: var(--carta);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-synthesis-weight: none;
    overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--zaff); color: var(--verde-2); }
:focus-visible { outline: 2.5px solid var(--zaff); outline-offset: 2px; border-radius: 4px; }

/* ---- Tipografia ---- */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-optical-sizing: auto;
    font-weight: 560;
    line-height: 1.08;
    letter-spacing: -.018em;
    color: var(--verde);
    text-wrap: balance;
}
h1 { font-size: var(--fs-800); }
h2 { font-size: var(--fs-700); }
h3 { font-size: var(--fs-600); font-weight: 540; }
h4 { font-size: var(--fs-500); font-weight: 600; color: var(--ink); }
p { text-wrap: pretty; }

/* ---- Layout ---- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(20px, 5vw, 40px); }
.wrap--narrow { max-width: 760px; }
.section { padding-block: clamp(54px, 8vw, 110px); position: relative; }
.section--tight { padding-block: clamp(40px, 5vw, 64px); }
.section--alt { background: var(--carta-2); }
.section--green { background: var(--verde); color: #E9EFE9; }
.section--green h1, .section--green h2, .section--green h3 { color: var(--carta); }

.rule { height: 1px; background: var(--linea); border: 0; }
.stack > * + * { margin-top: 1rem; }

/* etichetta editoriale (eyebrow) */
.eyebrow {
    display: inline-flex; align-items: center; gap: .55em;
    font-family: var(--font-sans); font-weight: 600;
    font-size: var(--fs-300); letter-spacing: .14em; text-transform: uppercase;
    color: var(--cotto);
}
.eyebrow svg { width: 16px; height: 16px; }
.section--green .eyebrow { color: var(--zaff); }

.lede { font-size: var(--fs-500); color: var(--muted); max-width: 60ch; }
.section--green .lede { color: #C7D4C8; }
.text-muted { color: var(--muted); }
.text-cotto { color: var(--cotto); }

/* Display in corsivo Fraunces per enfasi editoriale */
.accento-corsivo { font-family: var(--font-display); font-style: italic; font-weight: 500; color: var(--cotto); }

/* ==================================================================
   Targa — il componente-firma (insegna smaltata / sticker NFC)
   ================================================================== */
.targa {
    position: relative;
    background: var(--panna);
    border: 1px solid var(--sand);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.targa--quadro { padding: clamp(20px, 3vw, 30px); }
/* cornice interna sottile, come una targa smaltata */
.targa--smalto::before {
    content: ""; position: absolute; inset: 6px; border: 1px solid var(--linea);
    border-radius: calc(var(--radius) - 6px); pointer-events: none;
}
/* filetto d'accento a sinistra */
.targa--cotto { border-left: 4px solid var(--cotto); }
.targa--verde { border-left: 4px solid var(--verde); }
.targa--zaff { border-left: 4px solid var(--zaff); }

/* numero gigante editoriale */
.numerone {
    font-family: var(--font-display); font-weight: 600; line-height: .92;
    letter-spacing: -.03em; color: var(--verde); font-size: var(--fs-900);
    font-variant-numeric: lining-nums tabular-nums;
}

/* ==================================================================
   Bottoni
   ================================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .55em;
    font-family: var(--font-sans); font-weight: 600; font-size: var(--fs-400);
    line-height: 1; text-align: center; white-space: nowrap;
    padding: .92em 1.4em; border-radius: var(--radius-pill);
    border: 1.5px solid transparent; cursor: pointer;
    transition: transform var(--t-fast), background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), color var(--t-fast);
}
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--cotto); color: #fff; box-shadow: 0 10px 22px -12px rgba(194, 75, 51, .7); }
.btn--primary:hover { background: var(--cotto-2); transform: translateY(-2px); }
.btn--green { background: var(--verde); color: var(--carta); }
.btn--green:hover { background: var(--verde-2); transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--verde); border-color: var(--sand); }
.btn--ghost:hover { background: var(--carta-2); border-color: var(--linea); }
.btn--on-green { background: var(--carta); color: var(--verde); }
.btn--on-green:hover { background: #fff; transform: translateY(-2px); }
.btn--lg { font-size: var(--fs-500); padding: 1.05em 1.7em; }
.btn--block { display: flex; width: 100%; }
.btn--sm { padding: .6em .95em; font-size: var(--fs-350); }

/* link di testo con sottolineatura zafferano animata */
.link-zaff {
    color: var(--verde); font-weight: 600;
    background-image: linear-gradient(var(--zaff), var(--zaff));
    background-size: 100% 2px; background-repeat: no-repeat; background-position: 0 100%;
    padding-bottom: 2px; transition: background-size var(--t);
}
.link-zaff:hover { background-size: 0% 2px; }

/* ==================================================================
   Form (condivisi: admin + pagine pubbliche)
   ================================================================== */
.field { display: block; margin-bottom: 1.1rem; }
.field > label, .label {
    display: block; font-weight: 600; font-size: var(--fs-350);
    color: var(--ink); margin-bottom: .4rem;
}
.field .hint { display: block; font-size: var(--fs-300); color: var(--muted); margin-top: .35rem; }
.input, .select, .textarea {
    display: block; width: 100%;
    padding: .72em .85em; font-size: var(--fs-400);
    background: var(--panna); color: var(--ink);
    border: 1.5px solid var(--sand); border-radius: var(--radius-sm);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--linea); }
.input:focus, .select:focus, .textarea:focus {
    outline: none; border-color: var(--verde-300);
    box-shadow: 0 0 0 3px rgba(63, 107, 91, .16);
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.field--error .input, .field--error .select, .field--error .textarea { border-color: var(--cotto); }
.field--error .hint { color: var(--cotto); }

.check { display: inline-flex; align-items: center; gap: .55em; cursor: pointer; font-size: var(--fs-400); }
.check input { width: 18px; height: 18px; accent-color: var(--verde); }

/* ==================================================================
   Badge / pill
   ================================================================== */
.badge {
    display: inline-flex; align-items: center; gap: .4em;
    font-size: var(--fs-300); font-weight: 600; letter-spacing: .02em;
    padding: .28em .7em; border-radius: var(--radius-pill);
    border: 1px solid transparent;
}
.badge--ok { background: rgba(27, 58, 47, .1); color: var(--verde); border-color: rgba(27, 58, 47, .18); }
.badge--off { background: rgba(110, 98, 86, .12); color: var(--muted); border-color: rgba(110, 98, 86, .2); }
.badge--warn { background: rgba(224, 161, 46, .16); color: var(--zaff-2); border-color: rgba(224, 161, 46, .3); }

/* ==================================================================
   Avviso "bozza" (documenti legali) + note
   ================================================================== */
.nota {
    border-radius: var(--radius-sm); padding: 1rem 1.15rem;
    font-size: var(--fs-350); line-height: 1.55;
    border: 1px solid var(--sand); background: var(--panna);
}
.nota--bozza { border-color: rgba(224, 161, 46, .45); background: rgba(224, 161, 46, .09); color: #6b4f16; }
.nota--bozza strong { color: var(--cotto-2); }

/* ==================================================================
   Motivo "onda di tap" (segno ricorrente)
   ================================================================== */
.ripple-mark { display: inline-block; vertical-align: middle; }

/* prose per testi lunghi (legali, articoli) */
.prose { max-width: 72ch; }
.prose h2 { font-size: var(--fs-600); margin-top: 2.4rem; margin-bottom: .6rem; }
.prose h3 { font-size: var(--fs-500); margin-top: 1.8rem; margin-bottom: .4rem; color: var(--ink); }
.prose p { margin-bottom: 1rem; color: #34302a; }
.prose ul, .prose ol { margin: 0 0 1rem 1.2rem; }
.prose li { margin-bottom: .4rem; }
.prose a { color: var(--cotto); text-decoration: underline; text-underline-offset: 2px; }
.prose strong { color: var(--ink); }

/* utilità responsive di visibilità */
.only-desktop { display: none; }
@media (min-width: 880px) { .only-desktop { display: initial; } .only-mobile { display: none; } }
