/* ============================================================
   CARATTERI (gli stessi del sito pubblico, incorporati: nessun servizio esterno)
   ============================================================ */
@font-face {
  font-family: 'Fraunces Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(font/fraunces-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(font/atkinson-hyperlegible-next-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* ============================================================
   COLORI, CARATTERI E BASE (stessa palette del sito pubblico)
   ============================================================ */
:root {
  --sipario-scuro: #340202;
  --velluto: #6a0708;
  --rosso: #a91714;
  --carta: #fbf5e8;
  --avorio: #fffaf0;
  --oro: #bb9f77;
  --inchiostro: #2a1512;
  --tenue: #6b5a52;
  --filetto: #e3d6b9;
  --font-titoli: "Fraunces Variable", Georgia, "Times New Roman", serif;
  --font-testo: "Atkinson Hyperlegible Next Variable", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pieghe: repeating-linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.3) 0,
    rgba(255, 255, 255, 0.06) 40px,
    rgba(0, 0, 0, 0.3) 80px
  );
  --velluto-fondo: linear-gradient(180deg, var(--sipario-scuro), var(--velluto));
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html {
  font-size: 118.75%;
}
body {
  margin: 0;
  background: var(--carta);
  color: var(--inchiostro);
  font-family: var(--font-testo);
  line-height: 1.5;
}
h2 {
  margin: 2rem 0 0.5rem;
  color: var(--velluto);
  font-family: var(--font-titoli);
  font-size: 1.5rem;
  font-weight: 650;
  line-height: 1.2;
}
a {
  color: var(--rosso);
  text-underline-offset: 0.2em;
}
p {
  margin: 0.5rem 0;
}
:focus-visible {
  outline: 3px solid var(--rosso);
  outline-offset: 2px;
}
img {
  max-width: 100%;
  border-radius: 4px;
}

/* ============================================================
   STRUTTURA DELLA PAGINA
   ============================================================ */
header.sito {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 60px;
  padding: 0.4rem 1rem;
  border-bottom: 2px solid var(--oro);
  background-image: var(--pieghe), var(--velluto-fondo);
  color: var(--carta);
}
header.sito .marchio {
  display: block;
  line-height: 0;
}
header.sito .marchio img {
  height: 44px;
  width: auto;
  border-radius: 6px;
}
#top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
#top a {
  padding: 0.25rem 0.6rem;
  color: var(--carta);
  font-size: 1.5rem;
  text-decoration: none;
}
#top h1 {
  margin: 0;
  color: var(--carta);
  font-family: var(--font-titoli);
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.2;
}
main {
  max-width: 640px;
  margin: 0 auto;
  padding: 1rem 1rem 4rem;
}
.links {
  margin-top: 2rem;
  text-align: center;
}
.hidden {
  display: none;
}

/* ============================================================
   SCHEDE, RIGHE E ETICHETTE
   ============================================================ */
.muted {
  color: var(--tenue);
  font-size: 0.9rem;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.card {
  display: block;
  margin: 0.5rem 0;
  padding: 0.8rem 1rem;
  border: 1px solid var(--filetto);
  border-radius: 10px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}
.card strong {
  font-family: var(--font-titoli);
  font-size: 1.1rem;
  font-weight: 650;
  color: var(--velluto);
}
.scheda {
  display: block;
  margin-bottom: 0.6rem;
  color: inherit;
  text-decoration: none;
}
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}
.b {
  display: inline-block;
  padding: 0.05rem 0.65rem;
  border-radius: 999px;
  background: #e8e0d0;
  color: #4a3a30;
  font-size: 0.8rem;
  font-weight: 700;
}
.b.annullato {
  background: #f5c9c6;
  color: #7a0c0c;
}
.b.rinviato {
  background: #fde7b0;
  color: #6b4700;
}
.b.nascosta {
  background: var(--inchiostro);
  color: #fff;
}

/* ============================================================
   MODULI
   ============================================================ */
.f {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-weight: 700;
}
input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.6rem 0.7rem;
  border: 2px solid var(--oro);
  border-radius: 8px;
  background: #fff;
  color: var(--inchiostro);
  font: inherit;
  font-weight: 400;
}

/* ============================================================
   BOTTONI
   ============================================================ */
.btn {
  margin-top: 0.5rem; 
  display: inline-block;
  min-height: 48px;
  padding: 0.65rem 1.4rem;
  border: 2px solid var(--rosso);
  border-radius: 999px;
  background: var(--rosso);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover {
  background: var(--velluto);
  border-color: var(--velluto);
}
.btn.sec {
  background: transparent;
  border-color: var(--velluto);
  color: var(--velluto);
}
.btn.sec:hover {
  background: var(--velluto);
  color: #fff;
}
.btn.on {
  background: var(--velluto);
  border-color: var(--velluto);
  color: #fff;
}
.btn.del {
  background: transparent;
  border-color: #a00;
  color: #a00;
}
.btn.del:hover {
  background: #a00;
  color: #fff;
}
.btn.mini {
  min-height: 40px;
  padding: 0.3rem 1rem;
}

/* ============================================================
   IMMAGINI
   ============================================================ */
.imgs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.7rem;
}
figure {
  margin: 0;
  padding: 0.5rem;
  border: 1px solid var(--filetto);
  border-radius: 10px;
  background: #fff;
  text-align: center;
}
figure img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}
figcaption {
  margin: 0.25rem 0;
  font-size: 0.85rem;
}

/* ============================================================
   AVVISI
   ============================================================ */
#toast {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  max-width: 600px;
  margin: auto;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  background: #2e6b3a;
  color: #fff;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
#toast.show {
  opacity: 1;
}
#toast.err {
  background: #a00;
}
