/* Stili del sito pubblico: home, /free, 404 e pagine di download (functions/utils/page.js).
 *
 * Idea: un album da ritagli su carta da disegno. Il logo e la cornice sono a matita; ogni
 * prodotto è un cartoncino bianco (verde chiaro se gratis), appoggiato un filo storto e fermato
 * da un pezzo di washi tape nei colori delle matite della cornice; il titolo è una didascalia
 * scritta a mano.
 * Le immagini dei prodotti portano il colore: il resto è grafite su carta, con il verde solo
 * per le cose gratis e il rosso (--sale) solo per i prezzi scontati di una promozione.
 * Niente Bootstrap né Mobirise: impaginazione con grid e flex.
 */

:root {
    --paper: #fcf7f0;
    --ink: #3b3935;
    --ink-2: #6b675f;
    --ink-strong: #24221f;
    --green: #2f7f68;
    --green-2: #43aa8b;
    --print-shadow: 0 1px 2px rgba(60, 50, 40, 0.12), 0 12px 26px -10px rgba(60, 50, 40, 0.28);
    --tape-pink: rgba(238, 152, 174, 0.62);
    --tape-green: rgba(150, 200, 128, 0.62);
    --tape-blue: rgba(140, 184, 228, 0.62);
    --tape-yellow: rgba(244, 202, 102, 0.66);
    --sale: #b3402f;
    --hand: "Indie Flower", cursive;
    --text: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

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

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--text);
    font-size: 1rem;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: var(--green); }
:focus-visible { outline: 2px dashed var(--ink); outline-offset: 4px; }

[hidden] { display: none !important; }

/* testo solo per i lettori di schermo (es. "Was" davanti al prezzo barrato) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Foglio con la cornice ------------------------------------------------------------ */

.paper {
    position: relative;
    z-index: 0;
    min-height: 100vh;
    padding: 3rem clamp(1.75rem, 6vw, 5rem) 4rem; /* il logo non deve toccare la cornice */
}

/* Sfondo fisso fatto solo in CSS: resta fermo e sempre alto quanto la finestra,
   qualunque sia la lunghezza della pagina. Con jarallax (classe mbr-parallax-background)
   l'immagine veniva ingrandita in proporzione alla pagina e, per via di
   body { overflow-x: hidden }, riposizionata via JS ad ogni scroll: vibrava.
   La cornice a matita è quadrata: con border-image (9-slice) gli angoli colorati
   restano intatti e solo i lati si allungano, qualunque sia il formato della finestra.
   ::before è lo sfondo, dietro al contenuto. ::after ridisegna la stessa cornice
   sopra al contenuto ma mascherata a una fascia esterna larga quanto le linee
   (45px su 320 nell'immagine, cioè 28px su 160 a schermo): le card che scorrono
   spariscono sotto il bordo disegnato invece di passarci sopra. */
.paper::before,
.paper::after {
    content: "";
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
    box-sizing: border-box;
    background-color: var(--paper);
    border-style: solid;
    border-width: min(160px, 22vw);
    border-image: url("../images/SfondoCornice.webp") 320 fill stretch;
}

.paper::after {
    --frame-band: min(28px, 3.85vw); /* stessa proporzione di border-width: 28/160 */
    z-index: 1;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(#000, #000), linear-gradient(#000, #000);
    mask-image: linear-gradient(#000, #000), linear-gradient(#000, #000);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: 100% 100%, calc(100% - 2 * var(--frame-band)) calc(100% - 2 * var(--frame-band));
    mask-size: 100% 100%, calc(100% - 2 * var(--frame-band)) calc(100% - 2 * var(--frame-band));
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

/* --- Testata --------------------------------------------------------------------------- */

.masthead {
    max-width: 46rem;
    margin: 0 auto 4rem;
    text-align: center;
}

.masthead h1 { margin: 0; }

/* Logo disegnato a matita: grafite su sfondo trasparente */
.logo {
    width: 100%;
    max-width: 640px;
    height: auto;
    margin: 0 auto;
}

.logo-small { max-width: 340px; }

.tagline {
    margin: 0.75rem 0 0;
    font-size: clamp(1.2rem, 2.6vw, 1.5rem);
    font-weight: 500;
    color: var(--ink);
}

.intro {
    max-width: 34rem;
    margin: 0.4rem auto 0;
    color: var(--ink-2);
}

.page-title {
    margin: 1.25rem 0 0.5rem;
    font-family: var(--hand);
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: bold;
    line-height: 1.05;
    color: var(--green);
}

/* titolo delle pagine che non riguardano le cose gratis (verde = gratis) */
.page-title-ink { color: var(--ink); }

/* Rimando alla sezione free nella home: compare solo se c'è almeno un item free */
.free-teaser-wrap { margin-top: 2rem; }

.free-teaser {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    max-width: 100%;
    padding: 0.75rem 1.5rem 0.75rem 1.25rem;
    border: 2px dashed var(--green-2);
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 2px 12px rgba(60, 50, 40, 0.08);
    color: var(--ink);
    text-align: left;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.free-teaser:hover,
.free-teaser:focus-visible {
    transform: translateY(-2px) rotate(-0.5deg);
    box-shadow: 0 6px 18px rgba(60, 50, 40, 0.14);
}

.free-teaser-icon { flex: none; width: 2.5rem; height: 2.5rem; color: var(--green-2); }

.free-teaser-title {
    display: block;
    font-family: var(--hand);
    font-size: 1.6rem;
    font-weight: bold;
    line-height: 1.1;
    color: var(--green);
}

.free-teaser-text { display: block; font-size: 0.95rem; color: var(--ink-2); }

.free-teaser-arrow { flex: none; font-size: 1.5rem; color: var(--green-2); transition: transform 0.15s ease; }
.free-teaser:hover .free-teaser-arrow { transform: translateX(4px); }

/* --- Galleria: stampe fermate con il nastro -------------------------------------------- */

/* flex e non grid: l'ultima riga, se incompleta, resta centrata come le stampe sopra */
.gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4rem 3rem;
    max-width: 1120px;
    margin: 0 auto;
}

/* ogni prodotto è un cartoncino bianco appoggiato sulla carta, un filo storto e fermato dal
   nastro: immagine, didascalia, prezzo e pulsante stanno tutti sullo stesso cartoncino */
.product {
    --tilt: -0.6deg;
    --tape: var(--tape-yellow);
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 0 1 330px;
    min-width: 0;
    padding: 14px 16px 18px;
    background: #fffefb;
    border: 1px solid rgba(59, 57, 53, 0.1);
    border-radius: 3px;
    box-shadow: var(--print-shadow);
    transform: rotate(var(--tilt));
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* il pezzo di nastro, con i bordi strappati */
.product::before {
    content: "";
    position: absolute;
    z-index: 2;
    top: -14px;
    left: 50%;
    width: 104px;
    height: 28px;
    background: var(--tape);
    transform: translateX(-50%) rotate(-3deg);
    clip-path: polygon(3% 0, 97% 0, 100% 17%, 97% 33%, 100% 50%, 97% 67%, 100% 83%, 97% 100%, 3% 100%, 0 83%, 3% 67%, 0 50%, 3% 33%, 0 17%);
}

.product:nth-child(3n + 2) { --tilt: 0.5deg; }
.product:nth-child(3n + 3) { --tilt: -0.3deg; }
.product:nth-child(4n + 1) { --tape: var(--tape-pink); }
.product:nth-child(4n + 2) { --tape: var(--tape-blue); }
.product:nth-child(4n + 3) { --tape: var(--tape-green); }
.product:nth-child(3n + 2)::before { transform: translateX(-50%) rotate(2deg); }

/* avvicinandosi il cartoncino si raddrizza e si stacca un poco dal foglio */
.product:hover,
.product:focus-within {
    transform: rotate(0deg) translateY(-4px);
    box-shadow: 0 2px 4px rgba(60, 50, 40, 0.12), 0 18px 34px -12px rgba(60, 50, 40, 0.34);
}

/* le cose gratis su cartoncino verde chiaro */
.product-free {
    background: #f3faf6;
    border-color: rgba(47, 127, 104, 0.28);
}

.print { position: relative; display: block; }

.print img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #fff;
    border: 1px solid rgba(59, 57, 53, 0.08);
}

.product-title {
    margin: 1.1rem 0 0.35rem;
    font-family: var(--hand);
    font-size: 1.65rem;
    font-weight: bold;
    line-height: 1.15;
    color: var(--ink);
}

.product-text {
    margin: 0;
    color: var(--ink-2);
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-buy {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-top: auto;
    padding-top: 1.1rem;
}

.price { font-size: 1.1rem; font-weight: 700; white-space: nowrap; color: var(--ink-strong); }
.price small { font-size: 0.8rem; font-weight: 400; color: var(--ink-2); }

/* prezzo durante una promozione con sconto (init.js): quello pieno barrato, quello scontato in
   rosso; le tasse vanno a capo, così prezzo e pulsante restano sulla stessa riga */
.price s { margin-right: 0.3rem; font-weight: 500; color: var(--ink-2); text-decoration-thickness: 1.5px; }
.price-sale { color: var(--sale); }
.price-on-sale small { display: block; }

/* timbro "-40%": un bollino attaccato sull'angolo della stampa, che sporge sul bordo del
   cartoncino per non coprire il titolo scritto in cima alle immagini dei prodotti */
.sale-stamp {
    position: absolute;
    z-index: 2;
    top: -9px;
    left: -11px;
    padding: 0 0.7rem;
    border-radius: 999px;
    background: var(--sale);
    color: #fff;
    font-family: var(--hand);
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1.6;
    transform: rotate(-5deg);
}

.btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.35rem;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--ink);
    color: var(--paper);
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:hover { background: var(--ink-strong); border-color: var(--ink-strong); color: #fff; }
.btn small { margin-top: 0.15rem; font-size: 0.8rem; font-weight: 500; opacity: 0.9; }

.btn-free { background: var(--green); border-color: var(--green); color: #fff; }
.btn-free:hover { background: #256552; border-color: #256552; }
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover { background: rgba(59, 57, 53, 0.06); color: var(--ink-strong); }
.btn-free.btn-line { background: transparent; color: var(--green); }
.btn-free.btn-line:hover { background: rgba(67, 170, 139, 0.08); }
.btn-wide { width: 100%; }

/* timbro "free" sulla stampa */
.free-stamp {
    position: absolute;
    z-index: 2;
    top: 10px;
    right: 10px;
    padding: 0 0.7rem;
    border-radius: 999px;
    background: var(--green-2);
    color: #fff;
    font-family: var(--hand);
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1.6;
    transform: rotate(5deg);
}

/* Rimando alla versione completa di un item free che ne è la demo */
.free-full {
    display: block;
    margin: 1rem 0 0;
    padding: 0.6rem 0.9rem;
    border: 2px dashed var(--green-2);
    border-radius: 14px;
    background-color: rgba(67, 170, 139, 0.08);
    color: var(--ink);
    text-align: left;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.free-full:hover,
.free-full:focus-visible {
    transform: translateY(-2px) rotate(-0.5deg);
    box-shadow: 0 6px 18px rgba(60, 50, 40, 0.14);
}

.free-full-label {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-2);
}

.free-full-title { display: block; font-weight: 700; line-height: 1.25; }

.free-full-cta {
    display: block;
    margin-top: 0.2rem;
    font-family: var(--hand);
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--green);
}

.product .btn-wide { margin-top: auto; }
.product .free-full + .btn-wide,
.product .product-text + .btn-wide { margin-top: 1.1rem; }
.product-free .product-text { margin-bottom: auto; }

/* nota sulle tasse, sotto la galleria (occupa tutta la riga) */
.tax-note {
    flex: 1 1 100%;
    margin: -1rem 0 0;
    color: var(--ink-2);
    font-size: 0.875rem;
    text-align: center;
}

.gallery-empty {
    margin: 1rem auto 3rem;
    font-family: var(--hand);
    font-size: 1.6rem;
    color: var(--ink-2);
    text-align: center;
}

/* --- Promozione ------------------------------------------------------------------------- */

/* Banner della promozione in corso: lo mette functions/utils/promo.js (dal middleware) al posto di
   <div data-promo-slot>, in tutte le pagine. Tre stili: nastro washi (.promo-tape), cartellino
   appeso (.promo-tag) e foglietto fermato dal nastro (.promo-note); colore .promo--<colore> e
   carattere del testo principale .promo-font-<carattere>, scelti nell'admin.
   Il pulsante .promo-cta è il link e con ::after copre tutto il banner (si clicca ovunque); il
   codice sconto ci sta sopra, per poterlo selezionare e copiare. */

.promo-wrap { margin-top: 2.25rem; }
.note-page .promo-wrap { margin-top: 3rem; }

.promo {
    --promo-tape: rgba(238, 152, 174, 0.62);
    --promo-paper: #f8d3dd;
    --promo-ink: var(--ink-strong);
    --promo-ink-2: var(--ink);
    --promo-bit: var(--tape-blue);
    --promo-font: var(--hand);
    --promo-weight: bold;
    --promo-scale: 1;
    position: relative;
    color: var(--promo-ink);
    text-align: left;
}

/* il nastro è trasparente come quello delle card, cartellino e foglietto sono carta piena;
   --promo-bit è il pezzo di nastro che ferma cartellino e foglietto */
.promo--pink { --promo-tape: rgba(238, 152, 174, 0.62); --promo-paper: #f8d3dd; }
.promo--yellow { --promo-tape: rgba(244, 202, 102, 0.66); --promo-paper: #fdeca6; }
.promo--blue { --promo-tape: rgba(140, 184, 228, 0.62); --promo-paper: #d3e5f7; --promo-bit: var(--tape-pink); }
.promo--red { --promo-tape: rgba(228, 106, 106, 0.62); --promo-paper: #f5bcb5; }
.promo--lavender { --promo-tape: rgba(186, 160, 222, 0.62); --promo-paper: #e2d6f2; }
.promo--kraft { --promo-tape: rgba(206, 170, 118, 0.7); --promo-paper: #e3c9a0; }
.promo--graphite { --promo-tape: rgba(59, 57, 53, 0.92); --promo-paper: #4a4743; --promo-ink: #fdf7f0; --promo-ink-2: #ece6dc; }

/* --promo-scale porta i quattro caratteri a una misura simile */
.promo-font-indie { --promo-font: var(--hand); --promo-weight: bold; --promo-scale: 1; }
.promo-font-marker { --promo-font: "Permanent Marker", var(--hand); --promo-weight: normal; --promo-scale: 0.84; }
.promo-font-caveat { --promo-font: "Caveat", var(--hand); --promo-weight: bold; --promo-scale: 1.14; }
.promo-font-figtree { --promo-font: var(--text); --promo-weight: 700; --promo-scale: 0.84; }

/* .promo-text senza z-index: il codice sconto (z-index 2) deve stare sopra il ::after del link */
.promo-body { position: relative; }
.promo-text { position: relative; display: flex; flex-direction: column; min-width: 0; }

.promo-kicker {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--promo-ink-2);
}

.promo-title {
    font-family: var(--promo-font);
    font-size: calc(var(--promo-size, 2.85rem) * var(--promo-scale));
    font-weight: var(--promo-weight);
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.promo-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem 0.9rem;
    margin-top: 0.35rem;
    font-size: 0.95rem;
    color: var(--promo-ink-2);
}

.promo-deadline-countdown { font-weight: 700; }

.promo-code { position: relative; z-index: 2; }
.promo-code b {
    padding: 0 0.5rem;
    border: 2px dashed currentColor;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.45);
    color: var(--promo-ink);
    letter-spacing: 0.08em;
    cursor: text;
    -webkit-user-select: all;
    user-select: all;
}
.promo--graphite .promo-code b { background: rgba(255, 255, 255, 0.08); }

.promo-cta { color: inherit; font-weight: 700; text-decoration: none; white-space: nowrap; }
.promo-cta::after { content: ""; position: absolute; z-index: 1; top: 0; right: 0; bottom: 0; left: 0; }
.promo-cta:focus-visible { outline: none; }
.promo-cta:focus-visible::after { outline: 2px dashed currentColor; outline-offset: -8px; }

/* pezzo di nastro che ferma cartellino e foglietto */
.promo-tag::before,
.promo-note::before {
    content: "";
    position: absolute;
    z-index: 2;
    top: -0.85rem;
    left: 50%;
    width: 6.5rem;
    height: 1.75rem;
    background: var(--promo-bit);
    transform: translateX(-50%) rotate(-4deg);
    clip-path: polygon(3% 0, 97% 0, 100% 17%, 97% 33%, 100% 50%, 97% 67%, 100% 83%, 97% 100%, 3% 100%, 0 83%, 3% 67%, 0 50%, 3% 33%, 0 17%);
}

/* Nastro: una striscia larga quanto la testata, bordi strappati e righe in trasparenza */
.promo-tape {
    filter: drop-shadow(0 1px 1px rgba(60, 50, 40, 0.14)) drop-shadow(0 8px 14px rgba(60, 50, 40, 0.1));
    transform: rotate(-1.2deg);
    transition: transform 0.2s ease;
}

.promo-tape:hover,
.promo-tape:focus-within { transform: rotate(0deg) translateY(-2px); }

.promo-tape .promo-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem 1.75rem;
    padding: 1.25rem 2.5rem 1.35rem 2.9rem;
    background-color: var(--promo-tape);
    isolation: isolate; /* le righe (::before, z-index -1) stanno sopra il colore e sotto testo e pulsante */
    clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 13%, calc(100% - 10px) 27%, 100% 41%, calc(100% - 12px) 56%, 100% 71%, calc(100% - 9px) 86%, calc(100% - 15px) 100%, 15px 100%, 0 87%, 11px 73%, 0 58%, 10px 43%, 0 29%, 12px 14%);
}

.promo-tape .promo-body::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
    background-image: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.24) 0 7px, rgba(255, 255, 255, 0) 7px 17px);
    pointer-events: none;
}

.promo-tape.promo--graphite .promo-body::before {
    background-image: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.07) 0 7px, rgba(255, 255, 255, 0) 7px 17px);
}

.promo-tape .promo-text { flex: 1 1 16rem; align-items: flex-start; }
.promo-tape .promo-title-long { --promo-size: 2.2rem; }

.promo-tape .promo-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1.35rem;
    border-radius: 999px;
    background: var(--ink);
    color: var(--paper);
    line-height: 1.2;
}

.promo-tape.promo--graphite .promo-cta { background: var(--paper); color: var(--ink-strong); }

/* Cartellino: carta da pacchi con il foro e gli angoli tagliati. Nella colonna (schermi fino a
   1259px) è fermato dal nastro; più larghi pende da uno spago accanto alla testata. */
.promo-wrap-tag { position: relative; text-align: center; }
.promo-string { display: none; }

.promo-tag {
    display: inline-block;
    width: 12rem;
    margin-top: 0.5rem;
    filter: drop-shadow(0 1px 1px rgba(60, 50, 40, 0.18)) drop-shadow(0 10px 14px rgba(60, 50, 40, 0.16));
    transform: rotate(3deg);
    transform-origin: 50% 1.5rem; /* il foro */
    transition: transform 0.3s ease;
}

.promo-tag:hover,
.promo-tag:focus-within { transform: rotate(0deg); }

.promo-tag .promo-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem 1rem 1.4rem;
    background-color: var(--promo-paper);
    background-image: radial-gradient(rgba(110, 80, 40, 0.1) 1px, transparent 1.5px), radial-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1.5px);
    background-position: 0 0, 3px 5px;
    background-size: 7px 9px, 11px 13px;
    text-align: center;
    clip-path: polygon(24% 0, 76% 0, 100% 42px, 100% 100%, 0 100%, 0 42px);
    -webkit-mask-image: radial-gradient(circle 9px at 50% 1.5rem, transparent 96%, #000 100%);
    mask-image: radial-gradient(circle 9px at 50% 1.5rem, transparent 96%, #000 100%);
}

.promo-tag .promo-text { align-items: center; }
.promo-tag .promo-kicker { font-size: 0.75rem; letter-spacing: 0.12em; }
.promo-tag .promo-title { --promo-size: 2.3rem; margin-top: 0.15rem; line-height: 1.05; }
.promo-tag .promo-title-short { --promo-size: 3.4rem; }
.promo-tag .promo-title-long { --promo-size: 1.75rem; }

.promo-tag .promo-meta {
    flex-direction: column;
    gap: 0.35rem;
    align-self: stretch;
    margin: 0.8rem 0.25rem 0;
    padding-top: 0.7rem;
    border-top: 2px dashed rgba(59, 57, 53, 0.35);
    font-size: 0.875rem;
}

.promo-tag.promo--graphite .promo-meta { border-top-color: rgba(253, 247, 240, 0.4); }

.promo-tag .promo-cta {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    white-space: normal;
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

/* Foglietto: carta a righe fermata dal nastro, testo scritto a mano e sottolineato a matita rossa */
.promo-wrap-note { text-align: center; }

.promo-note {
    display: inline-block;
    width: min(100%, 27rem);
    margin-top: 0.5rem;
    transform: rotate(1.6deg);
    transition: transform 0.25s ease;
}

.promo-note:hover,
.promo-note:focus-within { transform: rotate(0deg) translateY(-2px); }

.promo-note .promo-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.9rem 2rem 1.5rem;
    background-color: var(--promo-paper);
    background-image: repeating-linear-gradient(180deg, rgba(70, 110, 170, 0) 0 31px, rgba(70, 110, 170, 0.16) 31px 32px);
    background-position: 0 14px;
    border-radius: 2px 2px 3px 16px;
    box-shadow: 0 1px 2px rgba(60, 50, 40, 0.14), 0 14px 22px -12px rgba(60, 50, 40, 0.32);
    text-align: center;
}

.promo-note.promo--graphite .promo-body {
    background-image: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0) 0 31px, rgba(255, 255, 255, 0.1) 31px 32px);
}

.promo-note .promo-text { align-items: center; }

.promo-note .promo-kicker {
    font-family: var(--promo-font);
    font-size: calc(1.55rem * var(--promo-scale));
    font-weight: var(--promo-weight);
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: none;
    color: var(--promo-ink);
}

.promo-note .promo-title {
    --promo-size: 2.6rem;
    padding-bottom: 0.55rem;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M3 7C40 3 80 10 120 5S180 4 197 7' fill='none' stroke='%23c0433a' stroke-opacity='.8' stroke-width='2.5' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center bottom / 100% 10px no-repeat;
}

.promo-note .promo-title-long { --promo-size: 2rem; }

.promo-note .promo-meta {
    justify-content: center;
    font-family: var(--hand);
    font-size: 1.3rem;
    font-weight: bold;
}

.promo-note .promo-code b { font-family: var(--text); font-size: 0.95rem; }

.promo-note .promo-cta {
    margin-top: 0.6rem;
    text-decoration: underline;
    text-decoration-color: rgba(59, 57, 53, 0.45);
    text-underline-offset: 4px;
}

.promo-note.promo--graphite .promo-cta { text-decoration-color: rgba(253, 247, 240, 0.5); }

/* schermi larghi: il cartellino pende da uno spago a destra della testata (o della pagina breve),
   che scende da sotto la cornice; lo spago non ruota, il cartellino dondola attorno al foro */
@media (min-width: 1260px) {
    .masthead,
    .note-page { position: relative; }

    .masthead:has(> .promo-wrap-tag) { min-height: 19rem; }

    .promo-wrap-tag {
        position: absolute;
        top: 1.5rem;
        left: calc(100% + 2.5rem);
        margin: 0;
    }

    .promo-tag { margin-top: 0; transform: rotate(6deg); }
    .promo-tag::before { display: none; }

    .promo-string {
        display: block;
        position: absolute;
        bottom: calc(100% - 1.5rem);
        left: calc(6rem - 1px);
        width: 2px;
        height: 40rem;
        border-radius: 1px;
        background: #8a6a45;
    }
}

/* --- Piede ------------------------------------------------------------------------------ */

.site-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 2rem;
    max-width: 1120px;
    margin: 5rem auto 0;
    padding-top: 1.75rem;
    /* riga a matita, un po' tremolante */
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='6' viewBox='0 0 240 6'%3E%3Cpath d='M0 3.2C20 2.4 40 3.9 60 3.1S100 2.2 120 3.3 160 3.9 180 2.9 220 2.6 240 3.2' fill='none' stroke='%233b3935' stroke-opacity='.35' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E") top left / 240px 6px repeat-x;
    color: var(--ink-2);
    font-size: 0.95rem;
}

.site-foot a { color: var(--ink); font-weight: 600; text-decoration-color: rgba(59, 57, 53, 0.35); text-underline-offset: 3px; }
.site-foot a:hover { color: var(--ink-strong); text-decoration-color: currentColor; }

.back-link { margin: 3rem 0 0; text-align: center; }
.back-link a { font-weight: 700; }

/* --- Pagine brevi: 404 e download ------------------------------------------------------ */

.note-page {
    max-width: 34rem;
    margin: 0 auto;
    padding-top: 4vh;
    text-align: center;
}

.note-page p { margin: 0 0 1rem; }
.note-page .lead { font-size: 1.1rem; color: var(--ink); }
.note-page .small { color: var(--ink-2); font-size: 0.95rem; }

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 2rem; }

/* riquadro "tieni questo link" o "versione completa" nelle pagine di download */
.note-card {
    margin-top: 2rem;
    padding: 1.25rem 1.25rem 1.4rem;
    border: 2px dashed rgba(59, 57, 53, 0.3);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.6);
}

.note-card p { margin: 0 0 0.35rem; }
.note-card .label { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-2); }
.note-card .title { font-size: 1.15rem; font-weight: 700; }
.note-card .btn { margin-top: 0.85rem; }
.note-card-free { border-color: var(--green-2); background: rgba(67, 170, 139, 0.08); }

/* --- Schermi stretti ------------------------------------------------------------------- */

@media (max-width: 640px) {
    .paper { padding-top: 2.25rem; }
    .masthead { margin-bottom: 3rem; }
    .gallery { gap: 3.25rem; }
    .free-teaser { border-radius: 24px; padding: 0.75rem 1rem; gap: 0.75rem; }
    .free-teaser-title { font-size: 1.4rem; }
    .promo-wrap { margin-top: 1.75rem; }
    .promo-tape .promo-body { padding: 1.1rem 1.6rem 1.25rem 1.8rem; }
    .promo-tape .promo-title { --promo-size: 2.3rem; }
    .promo-tape .promo-title-long { --promo-size: 1.9rem; }
    .site-foot { flex-direction: column; gap: 0.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    .product, .free-teaser, .free-full, .free-teaser-arrow, .promo-tape, .promo-tag, .promo-note { transition: none; }
    .product:hover, .product:focus-within { transform: rotate(var(--tilt)); }
}
