/* ==========================================================================
   Gelatiamo — foglio di stile unico
   Struttura: 1. Token  2. Base  3. Layout  4. Header/Footer  5. Componenti
              6. Sezioni home  7. Pagine interne  8. Utilità e movimento
   Mobile-first: le media query aggiungono regole da 48em (768px) e 64em (1024px).
   ========================================================================== */

/* 1. Design token ---------------------------------------------------------- */
:root {
  /* Colori presi dal logo (sfumatura prugna → lilla) */
  --plum-900: #2f0f27;
  --plum-800: #431a39;
  --plum-700: #5a2550;
  --plum-500: #774272;
  --lilac-400: #8d6195;
  /* Viola storico del marchio: colore d'azione */
  --violet: #55328b;
  --violet-dark: #42256f;
  /* Sfondi tenui */
  --cream: #faf3e3;
  --rose: #f9f1f2;
  --lavender: #f0edf5;
  --white: #ffffff;
  /* Testo (contrasto AA su tutti gli sfondi chiari) */
  --ink: #2a2230;
  --text: #4d4756;
  --line: #e4dce8;

  /* Tipografia: font di sistema, nessun download */
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "URW Palladio L", P052, "Book Antiqua", Georgia, serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-sm: 0.9rem;
  --fs-base: 1.0625rem;
  --fs-lg: clamp(1.125rem, 1.05rem + 0.35vw, 1.3rem);
  --fs-h3: clamp(1.3rem, 1.15rem + 0.6vw, 1.6rem);
  --fs-h2: clamp(1.9rem, 1.45rem + 2vw, 3rem);
  --fs-h1: clamp(2.3rem, 1.6rem + 3.2vw, 4.1rem);

  /* Spaziature */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: clamp(3.5rem, 2.5rem + 4vw, 6.5rem);
  --gutter: 1rem;
  --container: 72rem;

  --radius: 1.25rem;
  --radius-sm: 0.75rem;
  --shadow: 0 0.75rem 2rem -1rem rgb(47 15 39 / 0.35);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (min-width: 48em) {
  :root { --gutter: 2rem; }
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--text);
  background: var(--white);
  overflow-x: clip;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.12;
  color: var(--plum-800);
  margin: 0 0 var(--space-2);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); letter-spacing: -0.01em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

p, ul, ol { margin: 0 0 var(--space-2); }
p { text-wrap: pretty; }

img { display: block; max-width: 100%; height: auto; }

a { color: var(--violet); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--plum-700); text-decoration-thickness: 2px; }

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

address { font-style: normal; }

/* 3. Layout ---------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--space-6); position: relative; }
.section--cream { background: var(--cream); }
.section--rose { background: var(--rose); }
.section--lavender { background: var(--lavender); }

.section-head { max-width: 40rem; margin-bottom: var(--space-5); }
.section-head--center { margin-inline: auto; text-align: center; }

.lead { font-size: var(--fs-lg); }

/* Separatore a "colata": la sezione cola nella successiva */
.drip { z-index: 1; }
.drip::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 1px);
  height: 64px;
  background: inherit;
  pointer-events: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='64'%3E%3Cpath d='M0 0H1200V14H1100a8 8 0 0 0-8 8V44a12 12 0 0 1-24 0V22a8 8 0 0 0-8-8H860a8 8 0 0 0-8 8V28a12 12 0 0 1-24 0V22a8 8 0 0 0-8-8H600a8 8 0 0 0-8 8V50a12 12 0 0 1-24 0V22a8 8 0 0 0-8-8H340a8 8 0 0 0-8 8V34a12 12 0 0 1-24 0V22a8 8 0 0 0-8-8H160a8 8 0 0 0-8 8V24a12 12 0 0 1-24 0V22a8 8 0 0 0-8-8H0Z'/%3E%3C/svg%3E") 0 0 / 1200px 64px repeat-x;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='64'%3E%3Cpath d='M0 0H1200V14H1100a8 8 0 0 0-8 8V44a12 12 0 0 1-24 0V22a8 8 0 0 0-8-8H860a8 8 0 0 0-8 8V28a12 12 0 0 1-24 0V22a8 8 0 0 0-8-8H600a8 8 0 0 0-8 8V50a12 12 0 0 1-24 0V22a8 8 0 0 0-8-8H340a8 8 0 0 0-8 8V34a12 12 0 0 1-24 0V22a8 8 0 0 0-8-8H160a8 8 0 0 0-8 8V24a12 12 0 0 1-24 0V22a8 8 0 0 0-8-8H0Z'/%3E%3C/svg%3E") 0 0 / 1200px 64px repeat-x;
}

/* 4. Header e footer ------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: var(--space-2);
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--plum-800);
  color: var(--white);
  border-radius: var(--radius-sm);
}
.skip-link:focus { top: var(--space-2); color: var(--white); }

.site-header {
  background: rgb(255 255 255 / 0.96);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 20;
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.6rem var(--space-2);
  padding-block: 0.75rem 0.4rem;
}

.brand { display: inline-flex; padding-block: 0.25rem; }
.brand img { width: 160px; }

.site-nav { grid-column: 1 / -1; grid-row: 2; }
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
}
.site-nav a {
  display: inline-block;
  padding: 0.5rem 0.1rem;
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--plum-800);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--violet); border-bottom-color: currentColor; }
.site-nav a[aria-current="page"] { color: var(--violet); border-bottom-color: var(--lilac-400); }

@media (min-width: 48em) {
  .site-header { position: sticky; top: 0; backdrop-filter: blur(8px); }
  .header-inner {
    grid-template-columns: auto 1fr auto;
    padding-block: 0.9rem;
  }
  .brand img { width: 200px; }
  .site-nav { grid-column: auto; grid-row: auto; justify-self: end; }
  .site-nav ul { gap: var(--space-4); }
}

.site-footer { background: var(--lavender); color: var(--text); font-size: 0.97rem; }
.footer-grid {
  display: grid;
  gap: var(--space-4);
  padding-block: var(--space-5) var(--space-4);
}
.footer-brand img { width: 180px; margin-bottom: var(--space-2); }
.footer-title {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--plum-700);
  margin-bottom: var(--space-2);
}
.footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.footer-list strong { color: var(--plum-800); }
.footer-legal {
  background: var(--plum-900);
  color: #e9dbe6;
  font-size: var(--fs-sm);
  padding-block: var(--space-3);
}
.footer-legal p { margin: 0; }
.footer-legal a { color: var(--white); }
.footer-legal .sep { opacity: 0.55; padding-inline: 0.35em; }

@media (min-width: 48em) {
  .footer-grid { grid-template-columns: 1.2fr 1fr 1fr; }
}

/* 5. Componenti ------------------------------------------------------------ */
.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--plum-500);
  margin-bottom: var(--space-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 2.9rem;
  padding: 0.7rem 1.35rem;
  border: 2px solid var(--violet);
  border-radius: 999px;
  background: var(--violet);
  color: var(--white);
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 0.2s var(--ease), background-color 0.2s, box-shadow 0.2s;
}
.btn:hover {
  color: var(--white);
  background: var(--violet-dark);
  border-color: var(--violet-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.btn--ghost { background: transparent; color: var(--violet); }
.btn--ghost:hover { background: var(--violet); }
.btn--light { background: var(--white); border-color: var(--white); color: var(--plum-800); }
.btn--light:hover { background: var(--cream); border-color: var(--cream); color: var(--plum-900); }
.btn--sm { min-height: 2.5rem; padding: 0.5rem 1.05rem; font-size: 0.92rem; }
.btn svg { width: 1.05em; height: 1.05em; flex: none; }

.actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }

/* Elenco a "pillole" (comuni, specialità) */
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.55rem; }
.chips li {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--white);
  color: var(--plum-800);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--line);
}

/* Card dei locali */
.stores { display: grid; gap: var(--space-4); }
.store {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.store img { width: 100%; aspect-ratio: 800 / 530; object-fit: cover; }
.store-body { padding: var(--space-3); display: flex; flex-direction: column; flex: 1; }
.store-tag { font-size: var(--fs-sm); font-weight: 700; color: var(--plum-500); letter-spacing: 0.04em; margin-bottom: 0.35rem; }
.store dl { margin: var(--space-2) 0 0; display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; }
.store dt { font-weight: 700; color: var(--plum-800); }
.store dd { margin: 0; }
.store .actions { margin-top: auto; padding-top: var(--space-3); }

@media (min-width: 48em) {
  .stores { grid-template-columns: 1fr 1fr; }
}

/* Media con angoli morbidi e leggera rotazione al passaggio */
.media-round { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.media-round img { width: 100%; height: 100%; object-fit: cover; }

/* Icone inline */
.icon { width: 1.25em; height: 1.25em; flex: none; fill: currentColor; }

.social { display: flex; gap: 0.6rem; margin-top: var(--space-2); }
.social a {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--white);
  color: var(--plum-800);
  transition: background-color 0.2s, color 0.2s;
}
.social a:hover { background: var(--violet); color: var(--white); }

/* 6. Sezioni della home ---------------------------------------------------- */

/* Hero: fino a 64em testo sopra e foto ritagliata sotto; da 64em foto a tutta larghezza */
.hero { background: var(--cream); position: relative; display: flex; flex-direction: column; }
.hero-content { order: -1; }
.hero-content { padding-block: var(--space-5) var(--space-4); }
.hero-content p { font-size: var(--fs-lg); max-width: 32rem; }
.hero-media img { width: 100%; aspect-ratio: 820 / 569; object-fit: cover; }

@media (min-width: 64em) {
  .hero { display: grid; min-height: clamp(30rem, 72vh, 44rem); overflow: hidden; }
  .hero > * { grid-area: 1 / 1; }
  .hero-media img { height: 100%; aspect-ratio: auto; object-position: 70% 50%; }
  .hero::before {
    content: "";
    grid-area: 1 / 1;
    z-index: 1;
    background: linear-gradient(90deg, rgb(250 243 227 / 0.95) 0%, rgb(250 243 227 / 0.82) 38%, rgb(250 243 227 / 0) 66%);
  }
  .hero-content { z-index: 2; align-self: center; padding-block: var(--space-6); }
  .hero-content > div { max-width: 34rem; }
}

/* Qualità */
.split { display: grid; gap: var(--space-5); align-items: center; }
.split-media { position: relative; }
.split-media .media-round { aspect-ratio: 4 / 3; }
.badge-float {
  position: absolute;
  right: -0.5rem;
  bottom: -1.25rem;
  background: var(--violet);
  color: var(--white);
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.2;
  box-shadow: var(--shadow);
}
.badge-float small { display: block; font-family: var(--font-sans); font-weight: 500; font-size: 0.82rem; opacity: 0.9; }

@media (min-width: 48em) {
  .split { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
  .split--reverse .split-media { order: 2; }
}

/* Torte */
.cakes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}
.cake { margin: 0; }
.cake-img {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  aspect-ratio: 600 / 766;
}
.cake-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.cake:hover .cake-img img { transform: scale(1.04); }
.cake figcaption {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--plum-800);
  text-align: center;
  padding-top: 0.7rem;
}
.cakes-cta { text-align: center; margin-top: var(--space-4); }

@media (min-width: 48em) {
  .cakes { grid-template-columns: repeat(4, 1fr); gap: var(--space-3); }
  .cake:nth-child(even) { transform: translateY(2rem); }
  .cakes-cta { margin-top: var(--space-6); }
}

/* 7. Pagine interne -------------------------------------------------------- */
.page-hero { background: var(--cream); padding-block: var(--space-5) var(--space-6); }
.page-hero .split-media .media-round { aspect-ratio: 1; max-width: 28rem; margin-inline: auto; }

/* Ingredienti e punti di forza */
.features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}
.features li {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.95rem 1.1rem;
  background: var(--white);
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--plum-800);
  border: 1px solid var(--line);
}
.features .icon { width: 1.6rem; height: 1.6rem; color: var(--lilac-400); }
@media (min-width: 36em) {
  .features { grid-template-columns: 1fr 1fr; }
}

.mosaic { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.mosaic .media-round:first-child { grid-column: 1 / -1; aspect-ratio: 3 / 2; }
.mosaic .media-round { aspect-ratio: 1; }

.award {
  display: grid;
  gap: var(--space-3);
  align-items: center;
  background: var(--white);
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: var(--shadow);
  margin-top: var(--space-5);
}
.award-mark {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--cream);
  color: var(--plum-700);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.9rem;
  border: 3px solid var(--lilac-400);
}
.award p { margin: 0; }
.award h3 { margin-bottom: 0.35rem; }
@media (min-width: 48em) {
  .award { grid-template-columns: auto 1fr; padding: var(--space-4) var(--space-5); }
}

/* Contatti */
.contact-cards { display: grid; gap: var(--space-3); }
.contact-card {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--plum-800);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease);
}
.contact-card:hover { border-color: var(--violet); box-shadow: var(--shadow); transform: translateY(-2px); color: var(--plum-800); }
.contact-card .icon-wrap {
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: var(--lavender);
  color: var(--violet);
  flex: none;
}
.contact-card span { display: block; }
.contact-card .label { font-size: var(--fs-sm); color: var(--text); }
.contact-card .value { font-weight: 700; font-size: 1.12rem; overflow-wrap: anywhere; }
@media (min-width: 48em) {
  .contact-cards { grid-template-columns: 1fr 1fr; }
}

.callout {
  background: var(--rose);
  border-radius: var(--radius);
  padding: var(--space-4);
  border-left: 6px solid var(--lilac-400);
}
.callout > :last-child { margin-bottom: 0; }

/* Testi lunghi (privacy) */
.prose { max-width: 46rem; }
.prose h2 { font-size: var(--fs-h3); margin-top: var(--space-5); }
.prose ul { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.4rem; }
.draft-note {
  background: var(--cream);
  border: 1px dashed var(--plum-500);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-size: var(--fs-sm);
}

/* 404 */
.notfound { text-align: center; padding-block: var(--space-6); }
.notfound .big { font-family: var(--font-serif); font-weight: 700; font-size: clamp(5rem, 3rem + 10vw, 9rem); line-height: 1; color: var(--lilac-400); margin-bottom: var(--space-2); }
.notfound .actions { justify-content: center; }

/* 8. Utilità e movimento --------------------------------------------------- */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.center { text-align: center; }
.mt-4 { margin-top: var(--space-4); }

/* Entrata morbida del testo hero, solo CSS */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.rise > * { animation: rise 0.7s var(--ease) both; }
.rise > :nth-child(2) { animation-delay: 0.08s; }
.rise > :nth-child(3) { animation-delay: 0.16s; }
.rise > :nth-child(4) { animation-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
  .btn:hover, .contact-card:hover { transform: none; }
  .cake:hover .cake-img img { transform: none; }
}

/* Varianti centrate (pagina Chi siamo) */
.chips--center { justify-content: center; }
.actions--center { justify-content: center; margin-top: var(--space-4); }

/* Un solo locale: card orizzontale da 48em */
@media (min-width: 48em) {
  .stores--single { grid-template-columns: 1fr; }
  .stores--single .store { flex-direction: row; }
  .stores--single .store img { width: 55%; aspect-ratio: auto; min-height: 100%; }
  .stores--single .store-body { padding: var(--space-4); justify-content: center; }
}
