/* Anime di Creta — Showroom
   Palette e font dal brand kit (30_Design/brand-kit.md §3-§4). Nessun colore fuori kit.
   Contrasti misurati su crema #F7F1E6: bruno 9,9:1 · bruno chiaro 4,0:1 · terracotta 3,3:1.
   Per questo terracotta e bruno chiaro stanno solo su testo grande (≥ 19 px in grassetto). */

@font-face { font-family: "EB Garamond"; src: url("fonts/eb-garamond-500.woff2") format("woff2"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("fonts/eb-garamond-700.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "Dancing Script"; src: url("fonts/dancing-script-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Amatic SC"; src: url("fonts/amatic-sc-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --crema: #F7F1E6;
  --sabbia: #EDE3D0;
  --terracotta: #B5764F;
  --ocra: #D4A45E;
  --salvia: #808C6B;
  --mattone: #BE5A4D;
  --bruno: #4A382A;
  --bruno-chiaro: #8B7355;
  --bordo: #E4D8C1;

  --f-nome: "Dancing Script", cursive;
  --f-accento: "Amatic SC", cursive;
  --f-testo: "EB Garamond", Georgia, serif;

  --gutter: 16px;
  --larghezza: 1180px;
  --raggio: 14px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--crema);
  color: var(--bruno);
  font-family: var(--f-testo);
  font-weight: 500;
  font-size: 1.125rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 500; line-height: 1.15; }
p { margin: 0 0 1em; text-wrap: pretty; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

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

.contenitore { width: 100%; max-width: var(--larghezza); margin: 0 auto; padding: 0 var(--gutter); }

.salta { position: absolute; left: -9999px; top: 0; }
.salta:focus { left: var(--gutter); top: 8px; z-index: 50; background: var(--bruno); color: var(--crema); padding: .5rem 1rem; border-radius: 8px; }

/* ── Testi ricorrenti ─────────────────────────────────── */
.occhiello {
  font-family: var(--f-accento);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: .04em;
  line-height: 1.1;
  color: var(--terracotta);
  margin: 0 0 .4rem;
}
.corsivo { font-family: var(--f-nome); font-weight: 700; color: var(--terracotta); }

.bottone {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: .7rem 1.5rem;
  background: var(--bruno); color: var(--crema);
  border: 1.5px solid var(--bruno); border-radius: 999px;
  font-family: var(--f-testo); font-weight: 600; font-size: 1.05rem;
  text-decoration: none; text-align: center; cursor: pointer;
  transition: background-color .2s, color .2s;
}
.bottone:hover { box-shadow: 0 0 0 4px var(--bordo); }
.bottone-chiaro { background: transparent; color: var(--bruno); }
.bottone-chiaro:hover { background: var(--sabbia); }

/* Icona WhatsApp (Tabler, a tratto): un solo simbolo in cima alla pagina, richiamato con <use>. */
.icone { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 1.25em; height: 1.25em; flex: none; margin-right: .5em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Testata ──────────────────────────────────────────── */
.testata {
  position: sticky; top: 0; z-index: 20;
  background: rgba(247, 241, 230, .94);
  border-bottom: 1px solid var(--bordo);
}
@supports (backdrop-filter: blur(6px)) {
  .testata { background: rgba(247, 241, 230, .82); backdrop-filter: blur(6px); }
}
.testata-riga { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 1rem; }
.logo { font-family: var(--f-nome); font-weight: 700; font-size: 1.85rem; line-height: 1; text-decoration: none; color: var(--bruno); white-space: nowrap; }
.menu { display: flex; align-items: center; gap: 1.6rem; }
.menu a { text-decoration: none; font-size: 1.05rem; }
.menu a:hover { text-decoration: underline; text-underline-offset: 4px; }
.menu-wa { border: 1.5px solid var(--bruno); border-radius: 999px; padding: .35rem 1rem; display: inline-flex; align-items: center; }
.menu-wa:hover { background: var(--sabbia); text-decoration: none !important; }

/* ── Hero ─────────────────────────────────────────────── */
.hero { padding: 3.5rem 0 4rem; }
.hero-griglia { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3.5rem; align-items: center; }
.hero-titolo { font-size: clamp(2.6rem, 5.4vw, 4.4rem); letter-spacing: -.01em; margin-bottom: 1.2rem; }
.hero-titolo .corsivo { display: block; font-size: 1.12em; line-height: 1.05; margin-top: .1em; }
.hero-sotto { font-size: 1.25rem; max-width: 34ch; margin-bottom: 2rem; }
.hero-azioni { display: flex; flex-wrap: wrap; gap: .8rem; }
.hero-foto { margin: 0; justify-self: center; width: 100%; max-width: 460px; }
.hero-foto img {
  width: 100%; aspect-ratio: 6 / 7; object-fit: cover;
  border-radius: 999px 999px var(--raggio) var(--raggio);
  border: 6px solid var(--sabbia);
}

/* ── Sezioni ──────────────────────────────────────────── */
.sezione { padding: 4.5rem 0; }
.sezione-sabbia { background: var(--sabbia); }
.sezione-testa { max-width: 640px; margin: 0 auto 2.2rem; text-align: center; }
.sezione-titolo { font-size: clamp(2.1rem, 4vw, 3rem); margin-bottom: .9rem; }
.sezione-sotto { font-size: 1.15rem; }

/* ── Filtri ───────────────────────────────────────────── */
.filtri {
  display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap;
  margin: 0 auto 2.4rem;
}
.filtro {
  min-height: 44px; padding: .35rem 1.1rem;
  background: transparent; border: 1.5px solid var(--bordo); border-radius: 999px;
  font-family: var(--f-accento); font-weight: 700; font-size: 1.35rem; letter-spacing: .03em; line-height: 1;
  cursor: pointer; white-space: nowrap;
  transition: background-color .2s, border-color .2s;
}
.filtro:hover { border-color: var(--bruno-chiaro); }
.filtro[aria-pressed="true"] { background: var(--bruno); border-color: var(--bruno); color: var(--crema); }
.filtro-conta { font-family: var(--f-testo); font-size: .8rem; font-weight: 600; margin-left: .35rem; vertical-align: .15em; }

/* ── Griglia e carte ──────────────────────────────────── */
.griglia { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.2rem 1.6rem; }
.carta { position: relative; }
.carta[hidden] { display: none; }
.carta-foto {
  overflow: hidden; border-radius: var(--raggio);
  background: var(--sabbia); aspect-ratio: 6 / 7;
}
.carta-foto img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.carta:hover .carta-foto img { transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) { .carta-foto img { transition: none; } .carta:hover .carta-foto img { transform: none; } }
.carta-collezione {
  font-family: var(--f-accento); font-weight: 700; font-size: 1.25rem; letter-spacing: .03em; line-height: 1;
  color: var(--terracotta); margin: .9rem 0 .25rem;
}
.carta-nome { font-size: 1.3rem; font-weight: 600; line-height: 1.2; margin-bottom: .35rem; }
.carta-apri {
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; text-align: left; cursor: pointer;
}
.carta-apri::after { content: ""; position: absolute; inset: 0; border-radius: var(--raggio); }
.carta-apri:focus-visible { outline: none; }
.carta-apri:focus-visible::after { outline: 2px solid var(--bruno); outline-offset: 4px; }
.carta-frase { font-size: 1.02rem; line-height: 1.45; margin: 0; }

/* ── Atelier ──────────────────────────────────────────── */
.atelier-griglia { display: grid; grid-template-columns: 1.1fr .9fr; gap: 3.5rem; align-items: center; }
.atelier-testo p { font-size: 1.2rem; }
.atelier-testo p:last-child { margin: 0; }
.atelier-foto { margin: 0; justify-self: center; width: 100%; max-width: 400px; }
.atelier-foto img { width: 100%; aspect-ratio: 6 / 7; object-fit: cover; border-radius: var(--raggio); border: 6px solid var(--crema); }

/* ── Contatti ─────────────────────────────────────────── */
.contatti { max-width: 640px; text-align: center; }
.rametto { width: 120px; height: 24px; margin: 0 auto 1.2rem; fill: none; stroke: var(--salvia); stroke-width: 1.5; stroke-linecap: round; display: block; }
.contatti .bottone { margin-top: .6rem; }
.contatti-numero { margin: 1rem 0 0; font-size: 1.1rem; letter-spacing: .02em; }

/* ── Piede ────────────────────────────────────────────── */
.piede { border-top: 1px solid var(--bordo); padding: 3rem 0 2.5rem; font-size: 1rem; }
.logo-piede { font-size: 2rem; margin-bottom: .6rem; }
.piede-nota { max-width: 70ch; }
.piede-venditore { margin: 1.4rem 0 0; padding-top: 1.2rem; border-top: 1px solid var(--bordo); font-size: .95rem; }

/* ── Scheda del pezzo (dialog) ────────────────────────── */
.scheda {
  width: min(980px, calc(100% - 2 * var(--gutter)));
  max-height: calc(100dvh - 2 * var(--gutter));
  padding: 0; border: 0; border-radius: 20px;
  background: var(--crema); color: var(--bruno);
  box-shadow: 0 24px 60px rgba(74, 56, 42, .28);
  overflow: auto; overscroll-behavior: contain;
}
.scheda::backdrop { background: rgba(74, 56, 42, .55); }
.scheda-corpo { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; padding: 1.6rem; }
.scheda-chiudi {
  position: absolute; top: .8rem; right: .8rem; z-index: 2;
  width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--crema); border: 1.5px solid var(--bordo); border-radius: 50%; cursor: pointer;
}
.scheda-chiudi svg { width: 20px; height: 20px; fill: none; stroke: var(--bruno); stroke-width: 2; stroke-linecap: round; }
.scheda-chiudi:hover { border-color: var(--bruno); }
.scheda-foto { width: 100%; aspect-ratio: 6 / 7; object-fit: cover; border-radius: var(--raggio); background: var(--sabbia); }
.scheda-miniature { display: flex; gap: .6rem; margin-top: .7rem; }
.miniatura {
  flex: 0 0 auto; width: 72px; padding: 0; border: 2px solid transparent; border-radius: 10px;
  background: var(--sabbia); overflow: hidden; cursor: pointer;
}
.miniatura img { width: 100%; aspect-ratio: 6 / 7; object-fit: cover; }
.miniatura[aria-current="true"] { border-color: var(--bruno); }
.scheda-testo { display: flex; flex-direction: column; padding: 1.4rem .4rem .4rem 0; }
.scheda-nome { font-size: clamp(1.9rem, 3vw, 2.5rem); margin-bottom: 1rem; padding-right: 3rem; }
.scheda-racconto { font-size: 1.2rem; }
.scheda-etichetta {
  font-family: var(--f-accento); font-weight: 700; font-size: 1.35rem; letter-spacing: .03em; line-height: 1;
  color: var(--salvia); margin: .6rem 0 .5rem; padding-top: 1rem; border-top: 1px solid var(--bordo);
}
.scheda-lavorazione { margin-bottom: .8rem; }
.scheda-tratti { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.6rem; }
.scheda-tratti li { background: var(--sabbia); border-radius: 999px; padding: .2rem .85rem; font-size: 1rem; }
.scheda-tratti:empty { display: none; }
.scheda-testo .bottone { align-self: flex-start; }
.scheda-scorri { display: flex; justify-content: space-between; gap: 1rem; margin-top: auto; padding-top: 1.6rem; }
.scheda-freccia {
  min-height: 44px; padding: .3rem .2rem; background: none; border: 0; cursor: pointer;
  font-size: 1.05rem; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--bordo);
}
.scheda-freccia:hover { text-decoration-color: var(--bruno); }
body.scheda-aperta { overflow: hidden; }

/* ── Larghezze ────────────────────────────────────────── */
@media (max-width: 1020px) {
  .griglia { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .hero { padding: 2rem 0 3rem; }
  .hero-griglia { grid-template-columns: 1fr; gap: 2.2rem; }
  .hero-foto { max-width: 340px; }
  .atelier-griglia { grid-template-columns: 1fr; gap: 2.4rem; }
  .atelier-foto { max-width: 340px; }
  .griglia { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.8rem 1rem; }
  .scheda-corpo { grid-template-columns: 1fr; gap: 1rem; padding: 1rem; }
  .scheda-testo { padding: .4rem 0 0; }
  .scheda-chiudi { top: 1.5rem; right: 1.5rem; }
  .scheda-nome { padding-right: 0; }
}
@media (max-width: 640px) {
  .menu-voce-larga { display: none; }
  .sezione { padding: 3.2rem 0; }
  .filtri { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)) 1.8rem; padding: 0 var(--gutter) .3rem; scrollbar-width: none; }
  .filtri::-webkit-scrollbar { display: none; }
  .carta-nome { font-size: 1.12rem; }
  .carta-frase { font-size: .98rem; }
  .carta-collezione { font-size: 1.2rem; }
  .scheda { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .scheda-testo .bottone { align-self: stretch; }
}
