:root{
  --page: #f0f2f5;          /* sfondo pagina grigio molto chiaro */
  --card: #2a2f38;          /* card grigio scuro */
  --text: #f7f8fb;
  --muted: rgba(247,248,251,.72);
  --border: rgba(255,255,255,.12);
  --shadow: 0 18px 50px rgba(0,0,0,.22);
  --radius: 22px;
  --maxw: 980px;
  --accent: #d7b56d;
  --focus: 0 0 0 3px rgba(215,181,109,.35);
}

*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Helvetica Neue", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 800px at 20% 0%, rgba(215,181,109,.10), transparent 55%),
    radial-gradient(1000px 700px at 100% 100%, rgba(120,150,220,.10), transparent 55%),
    var(--page);
  overflow: hidden;
}

/* Deck */
.deck{
  height: 100svh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}
.slide{
  scroll-snap-align: start;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  position: relative;
}
.panel{
  width: min(var(--maxw), 100%);
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(18px, 3vw, 34px);
}

/* --- HOME: logo a sinistra, TUTTO il testo a destra --- */
.homePanel{
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 32px;
  align-items: center;
}

.homeLogo{
  grid-column: 1;
  grid-row: 1 / span 2; /* affiancato a titolo + testo + hint */
  display: flex;
  align-items: center;
}

.homeLogo img{
  max-width: 220px;
  height: auto;
  opacity: 0.95;
}

.homeText{
  grid-column: 2;
  min-width: 0;
}

/* la hint fa parte visiva del testo */
.homePanel .hint{
  grid-column: 2;
}


/* Header slide */
.brand{
  display:flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}
.brand img{
  /* LOGO PIÙ GRANDE */
  width: 140px;
  height: 140px;
  object-fit: contain;
  border-radius: 20px;
  background: rgba(0,0,0,.18);
  border: 1px solid var(--border);
  padding: 12px;
}

/* --- Crediti sito (Nota informativa) --- */
.siteCredit{
  margin-top: 140%; /* spinge il credito in basso */
  padding-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.siteCreditLink{
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-size: 13px;
  color: var(--muted);
  opacity: 0.85;
}

.siteCreditLink:hover{
  opacity: 1;
}

.siteCreditLogo{
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.25);
  background: #fff;
}

.brand h1{
  margin:0;
  letter-spacing: .06em;
  text-transform: uppercase;
  font-weight: 800;
  line-height: 1.05;
  font-size: clamp(28px, 4vw, 46px);
}
.brand p{
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 70ch;
  line-height: 1.5;
}

.hint{
  margin-top: 18px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  color: var(--muted);
  font-size: 14px;
  flex-wrap: wrap;
}
.kbd{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  border: 1px solid var(--border);
  border-bottom-color: rgba(255,255,255,.20);
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(0,0,0,.20);
  color: var(--text);
}

/* Titles & body */
.titleRow{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.titleRow h2{
  margin:0;
  font-size: clamp(20px, 2.4vw, 28px);
  letter-spacing: .02em;
}
.chip{
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: rgba(0,0,0,.18);
  border-radius: 999px;
  padding: 6px 10px;
  white-space: nowrap;
}
.splitText p{
  margin:1em 0;
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
  max-width: 80ch;
  /* white-space: pre-line; */
}
.splitText hr{
  border: 0;
  height: 1px;
  background: rgba(255,255,255,.55);
  margin: clamp(10px, 2.2vh, 18px) 0;
}

/* Liste cultivar */
.splitText ul{
  list-style: none;
  padding-left: 0;
  margin: 0.6em 0 1em;
}
.splitText li{
  position: relative;
  padding-left: 1.6em;
  margin: 0.35em 0;
}

/* Uva 🍇 */
#grapes li::before{
  content: "🍇";
  position: absolute;
  left: 0;
  top: 0.05em;
}

/* Ulivo 🫒 */
#olives li::before{
  content: "🫒";
  position: absolute;
  left: 0;
  top: 0.05em;
}

/* Split layout (testo a sinistra, immagini a destra) */
.split{
  display: grid;
  grid-template-columns: 1fr 12px 170px;
  gap: 18px;
  align-items: start;
}
.splitText{ min-width: 0; }

/* Linea bianca verticale tra testo e immagini */
.splitDivider{
  width: 2px;
  justify-self: center;
  align-self: stretch;
  background: rgba(255,255,255,.85);
  border-radius: 99px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.06);
}

.splitMedia{ min-width: 0; }
.thumbStack{
  display: grid;
  gap: 12px;
  justify-items: start;
}

/* Thumbnail: piccola, non croppata, larghezza uniforme */
.thumbImg{
  width: 150px;
  height: auto;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.18);
  box-shadow: 0 10px 25px rgba(0,0,0,.18);
  cursor: zoom-in;
}

/* --- Menu sezioni (bottom → top on scroll) --- */
.sectionNav{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  padding: 10px 12px 14px;
  pointer-events: none; /* cliccabile solo l’interno */
}
.sectionNav.isTop{
  top: 0;
  bottom: auto;
  padding: 10px 12px;
}
.sectionNavInner{
  width: min(var(--maxw), 100%);
  margin: 0 auto;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.10);
  background: rgba(255,255,255,.78);
  box-shadow: 0 12px 28px rgba(0,0,0,.12);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  pointer-events: auto;
}

.navLinks{
  display: flex;
  flex: 1;          /* prende tutta la larghezza rimanente */
  width: 100%;
  gap: 10px;
  align-items: stretch;
  justify-content: space-between; /* più “a barra piena” rispetto a flex-end */
}
.navLink{
  display: inline-flex;
  flex: 1 1 0;
  text-align: center;
  justify-content: center;
  align-items: center;
  padding: 14px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(0,0,0,.06);
  color: rgba(0,0,0,.78);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1;
  user-select: none;
  transition: transform .08s ease, background .18s ease;
}
.navLink.navHome{
  flex: 0 0 auto;
  min-width: 48px;
  padding: 14px 0;
  font-size: 18px;
  font-weight: 600;
}
.navLink:hover{ background: rgba(0,0,0,.10); transform: translateY(-1px); }
.navLink[aria-current="true"]{
  background: linear-gradient(
    180deg,
    rgba(215,181,109,.42),
    rgba(215,181,109,.22)
  );
  color: #2a2f38;
  border-color: rgba(0,0,0,.14);
  box-shadow:
    0 6px 16px rgba(0,0,0,.18),
    0 0 0 6px rgba(215,181,109,.22);
}
.navLink:focus{ outline: none; box-shadow: var(--focus); }

/* Toggle (mobile) */
.navToggle{
  display: none;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(0,0,0,.06);
  color: rgba(0,0,0,.80);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
}
.navToggle:focus{ outline:none; box-shadow: var(--focus); }
.navToggleIcon{
  width: 14px;
  height: 10px;
  position: relative;
  display: inline-block;
}
.navToggleIcon::before{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 1px;
  height: 2px;
  background: rgba(0,0,0,.55);
  border-radius: 99px;
  box-shadow: 0 4px 0 rgba(0,0,0,.55), 0 8px 0 rgba(0,0,0,.55);
}

/* PASSIONE */
.quoteBig{
  margin: 14px 0 0;
  line-height: 1.32;
  font-family: inherit;
  font-weight: 750;
  letter-spacing: -0.01em;
  font-size: clamp(18px, 2.2vw, 24px);
  white-space: pre-line;
}
.byline{
  text-align: right;
  margin-top: 1.2em;
  color: var(--muted);
  line-height: 1.6;
}

.byline small{
  font-family: "Pacifico", "Dancing Script", "Segoe Script",
               "Brush Script MT", cursive;
  font-size: clamp(14px, 2.4vw, 20px);
  font-weight: 400;
  letter-spacing: 0.03em;
  display: inline-block;
}

a.linkpanel {
  color: var(--accent);
  text-decoration: none;
  opacity: 80%;
}
a.linkpanel:hover {opacity: 100%;}

/* Media “incorporata nel testo” + thumbnail */
.media{
  margin-top: 16px;
  display: grid;
  gap: 10px;
  justify-items: start;
}
.thumb{
  width: 100%;
  max-width: 720px;  /* dentro la card, ma non enorme */
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.18);
  box-shadow: 0 10px 25px rgba(0,0,0,.18);
}
.thumb img{
  width: 100%;
  height: 240px;      /* thumbnail incorporata */
  display:block;
  object-fit: cover;  /* croppata */
  cursor: zoom-in;
}
/* Se non vuoi crop: usa class contain sul wrapper */
.thumb.contain img{
  object-fit: contain;
  background: rgba(0,0,0,.25);
}
.caption{
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  padding: 0 2px;
}

/* Floating actions */
.fabRow{
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 10px;
  z-index: 50;
}
.fab{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
  background: rgba(35,40,50,.92);
  color: var(--text);
  box-shadow: 0 14px 32px rgba(0,0,0,.18);
  cursor: pointer;
  user-select:none;
  transition: transform .08s ease, background .2s ease;
}
.fab:hover{ transform: translateY(-1px); background: rgba(35,40,50,.98); }
.fab:active{ transform: translateY(0px); }
.fab:focus{ outline: none; box-shadow: 0 14px 32px rgba(0,0,0,.18), var(--focus); }
.fab .dot{
  width: 10px;
  height: 10px;
  border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(215,181,109,.12);
}

/* Modal */
.modalBackdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.62);
  display:none;
  place-items: center;
  padding: 18px;
  z-index: 60;
}
.modalBackdrop[aria-hidden="false"]{ display:grid; }
.modal{
  width: min(860px, 100%);
  background: rgba(35,40,50,.98);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.modalHeader{
  display:flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  gap: 10px;
}
.modalHeader h3{
  margin:0;
  font-size: 16px;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--muted);
}
.closeBtn{
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px;
  cursor:pointer;
}
.closeBtn:focus{ outline:none; box-shadow: var(--focus); }

.modalBody{ padding: 16px; }
.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label{ display:block; font-size: 13px; color: var(--muted); margin: 6px 0 6px; }
input, textarea{
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.18);
  color: var(--text);
  padding: 12px 12px;
  font-size: 15px;
}
textarea{ min-height: 120px; resize: vertical; }
input:focus, textarea:focus{ outline:none; box-shadow: var(--focus); }

.actions{
  margin-top: 12px;
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}
.btn{
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(180deg, rgba(215,181,109,.18), rgba(215,181,109,.10));
  color: var(--text);
  border-radius: 14px;
  padding: 10px 12px;
  cursor:pointer;
  font-weight: 700;
}
.btn.secondary{
  background: rgba(0,0,0,.18);
  color: var(--muted);
  font-weight: 600;
}
.tinyNote{
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  max-width: 70ch;
  display: none!important;
}

/* Lightbox */
.lightbox{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.82);
  display: none;
  z-index: 80;
  padding: 18px;
}
.lightbox[aria-hidden="false"]{ display: grid; }
.lightboxInner{
  place-self: center;
  width: min(1100px, 100%);
  max-height: calc(100svh - 36px);
  display: grid;
  gap: 10px;
}
.lightboxTop{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
  color: rgba(255,255,255,.88);
  font-size: 13px;
}
.lightboxImgWrap{
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.16);
  overflow: hidden;
  background: rgba(0,0,0,.30);
  box-shadow: 0 22px 65px rgba(0,0,0,.45);
}
.lightbox img{
  width: 100%;
  height: auto;
  max-height: calc(100svh - 140px);
  object-fit: contain;
  display:block;
  cursor: zoom-out;
  background: rgba(0,0,0,.25);
}

/* Scrollbar */
.deck::-webkit-scrollbar{ width: 10px; }
.deck::-webkit-scrollbar-thumb{
  background: rgba(0,0,0,.18);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}

@media (max-width: 760px){
  .sectionNavInner{ border-radius: 22px; flex-wrap: wrap; }
  .navToggle{ display: inline-flex; }
  .navLinks{
    display: none;
    width: 100%;
    justify-content: flex-start;
    padding-top: 8px;
    border-top: 1px solid rgba(0,0,0,.10);
    margin-top: 8px;
    gap: 8px;
  }
  .navLink{
    flex: 1 1 100%;
    font-size: 14px;
  }
  .navLink.navHome{
    align-self: flex-start;
  }
  .sectionNav.isOpen .navLinks{ display: flex; }
  .split{
    grid-template-columns: 1fr;
    gap: 14px;
  }
  /* su mobile la linea diventa orizzontale */
  .splitDivider{
    width: 100%;
    height: 2px;
  }
  .thumbStack{ justify-items: start; }
  .thumbImg{ width: 140px; }
  .thumb img{ height: 220px; }
  .grid2{ grid-template-columns: 1fr; }

  .homePanel{
    flex-direction: column;
    text-align: center;
  }
  .homeLogo img{
    max-width: 180px;
  }
  .siteCredit{ margin-top: 20% };
}

@media (max-width: 520px){
  .brand img{ width: 120px; height: 120px; }
}

@media (max-width: 420px){
  .thumbImg{ width: 130px; }
}
