/* ==========================================================================
   Gruppo Naturalistico Micologico Silano — Foglio di stile
   ========================================================================== */

:root {
  --green-900: #1b3a1a;
  --green-800: #244d22;
  --green-700: #2f6a2b;
  --green-600: #3c8438;
  --green-500: #4ca048;
  --amber-600: #b5651d;
  --amber-500: #d98b2b;
  --cream: #f7f4ec;
  --cream-dark: #efe9da;
  --ink: #22251f;
  --ink-soft: #4a4f45;
  --white: #ffffff;
  --shadow-sm: 0 2px 8px rgba(27, 58, 26, 0.08);
  --shadow-md: 0 8px 28px rgba(27, 58, 26, 0.14);
  --radius: 14px;
  --radius-lg: 22px;
  --maxw: 1180px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  line-height: 1.15;
  color: var(--green-900);
  margin: 0 0 .5em;
  font-weight: 600;
}

a { color: var(--green-700); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--amber-600); }

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

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: var(--green-800); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--green-900);
  color: #e9f0e4;
  font-size: .85rem;
}
.topbar .container {
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  align-items: center; justify-content: center;
  padding-block: 8px; text-align: center;
}
.topbar a { color: #e9f0e4; display: inline-flex; align-items: center; gap: 6px; }
.topbar a:hover { color: #fff; }
.topbar .sep { opacity: .4; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247, 244, 236, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--cream-dark);
  box-shadow: var(--shadow-sm);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-block: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 52px; width: auto; }
.brand .brand-text strong { display: block; font-family: "Fraunces", serif; color: var(--green-900); font-size: 1.02rem; line-height: 1.1; }
.brand .brand-text span { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--amber-600); }

.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: 10px 16px; border-radius: 10px;
  color: var(--ink); font-weight: 500; font-size: .98rem;
}
.nav-links a:hover, .nav-links a.active { background: var(--green-700); color: #fff; }

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  width: 44px; height: 44px; padding: 8px; border-radius: 10px;
}
.nav-toggle span { display: block; height: 2.5px; background: var(--green-900); border-radius: 2px; margin: 5px 0; transition: .3s var(--ease); }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--amber-500); color: #fff; font-weight: 600;
  padding: 13px 26px; border-radius: 999px; border: 0; cursor: pointer;
  font-size: 1rem; transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--amber-600); color: #fff; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.8); box-shadow: none; }
.btn-outline:hover { background: #fff; color: var(--green-900); }
.btn-green { background: var(--green-700); }
.btn-green:hover { background: var(--green-800); }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; text-align: center;
  display: grid; place-items: center;
  min-height: min(82vh, 720px);
  padding: 90px 0;
  background: linear-gradient(rgba(16,32,15,.55), rgba(16,32,15,.72)), url("../assets/img/funghi-raccolta-bosco-AdobeStock_303623154-scaled-1.jpeg") center/cover fixed;
}
.hero h1 { color: #fff; font-size: clamp(2.2rem, 5vw, 4rem); max-width: 16ch; margin-inline: auto; }
.hero p.lead { font-size: clamp(1.05rem, 2vw, 1.4rem); max-width: 40ch; margin: 0 auto 2rem; color: #f2efe4; }
.hero .eyebrow {
  display: inline-block; letter-spacing: .22em; text-transform: uppercase;
  font-size: .8rem; font-weight: 600; color: var(--amber-500); margin-bottom: 1rem;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* Page hero (smaller, for subpages) */
.page-hero {
  color: #fff; text-align: center; padding: 72px 0 60px;
  background: linear-gradient(rgba(16,32,15,.6), rgba(16,32,15,.72)), var(--hero-img, var(--green-800)) center/cover;
}
.page-hero h1 { color: #fff; font-size: clamp(2rem, 4.5vw, 3.2rem); }
.page-hero p { color: #eef0e7; max-width: 46ch; margin: .5rem auto 0; font-size: 1.1rem; }

/* ---------- Sections ---------- */
section { padding: 72px 0; }
.section-head { text-align: center; max-width: 60ch; margin: 0 auto 48px; }
.section-head .eyebrow { color: var(--amber-600); letter-spacing: .18em; text-transform: uppercase; font-size: .8rem; font-weight: 700; }
.section-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); margin-top: .35rem; }
.section-head p { color: var(--ink-soft); font-size: 1.08rem; }

.bg-cream-dark { background: var(--cream-dark); }
.bg-green { background: var(--green-900); color: #e8eee3; }
.bg-green h2, .bg-green h3 { color: #fff; }

/* ---------- Intro / feature cards ---------- */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; }
.feature {
  background: var(--white); border-radius: var(--radius); padding: 30px 26px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--cream-dark);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.feature:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.feature .ico { font-size: 2rem; display: block; margin-bottom: .5rem; }
.feature h3 { font-size: 1.25rem; }
.feature p { color: var(--ink-soft); margin: 0; }

/* ---------- About split ---------- */
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.split img { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); width: 100%; height: 100%; object-fit: cover; max-height: 460px; }
.split .prose p { color: var(--ink-soft); }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.gallery figure { margin: 0; overflow: hidden; border-radius: var(--radius); cursor: zoom-in; position: relative; background: #ddd; aspect-ratio: 4/3; box-shadow: var(--shadow-sm); }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.gallery figure:hover img { transform: scale(1.08); }
.gallery figure::after {
  content: "⤢"; position: absolute; right: 10px; bottom: 8px;
  background: rgba(27,58,26,.78); color: #fff; width: 32px; height: 32px;
  display: grid; place-items: center; border-radius: 50%; font-size: .9rem;
  opacity: 0; transition: opacity .25s var(--ease);
}
.gallery figure:hover::after { opacity: 1; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 2000; display: none;
  background: rgba(10, 20, 9, .92); align-items: center; justify-content: center; padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox button {
  position: absolute; background: rgba(255,255,255,.15); border: 0; color: #fff;
  width: 54px; height: 54px; border-radius: 50%; font-size: 1.6rem; cursor: pointer; transition: background .2s;
}
.lightbox button:hover { background: rgba(255,255,255,.3); }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* ---------- Board / organigramma ---------- */
.board-group-title { text-align: center; color: var(--amber-600); letter-spacing: .14em; text-transform: uppercase; font-size: .85rem; font-weight: 700; margin: 10px 0 24px; }
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 20px; margin-bottom: 20px; }
.member {
  background: var(--white); border-radius: var(--radius); text-align: center;
  padding: 26px 18px; box-shadow: var(--shadow-sm); border: 1px solid var(--cream-dark);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.member:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.member .avatar {
  width: 78px; height: 78px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; background: linear-gradient(135deg, var(--green-600), var(--green-800));
  color: #fff; font-family: "Fraunces", serif; font-size: 1.5rem; font-weight: 600;
}
.member .role { display: block; color: var(--amber-600); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; font-weight: 600; }
.member .name { font-family: "Fraunces", serif; color: var(--green-900); font-size: 1.12rem; }
.president .avatar { background: linear-gradient(135deg, var(--amber-500), var(--amber-600)); width: 92px; height: 92px; font-size: 1.8rem; }

/* founders */
.founders { columns: 3 220px; column-gap: 30px; max-width: 820px; margin: 0 auto; }
.founders li { break-inside: avoid; padding: 5px 0; color: var(--ink-soft); list-style: none; position: relative; padding-left: 20px; }
.founders li::before { content: "🍄"; position: absolute; left: 0; font-size: .85rem; }
.founders { padding: 0; }

/* ---------- Newsletter / CTA ---------- */
.cta { text-align: center; }
.cta h2 { color: #fff; }
.cta p { color: #d6e0d0; max-width: 46ch; margin-inline: auto; }
.newsletter-form { display: flex; gap: 10px; max-width: 480px; margin: 26px auto 0; flex-wrap: wrap; justify-content: center; }
.newsletter-form input {
  flex: 1 1 240px; padding: 14px 18px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.1); color: #fff; font-size: 1rem;
}
.newsletter-form input::placeholder { color: #c3cdbd; }
.newsletter-form input:focus { outline: 2px solid var(--amber-500); }
.form-note { font-size: .82rem; color: #aebba6; margin-top: 12px; }

/* ---------- Membership / docs ---------- */
.docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.doc-card {
  display: flex; gap: 16px; align-items: flex-start; background: var(--white);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--cream-dark); transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.doc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.doc-card .pdf-ico { flex: none; width: 46px; height: 46px; border-radius: 10px; background: var(--amber-500); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .72rem; }
.doc-card h3 { font-size: 1.12rem; margin-bottom: 4px; }
.doc-card p { margin: 0 0 10px; color: var(--ink-soft); font-size: .92rem; }

/* ---------- Contact grid ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; }
.contact-card { background: var(--white); border-radius: var(--radius); padding: 28px; text-align: center; box-shadow: var(--shadow-sm); border: 1px solid var(--cream-dark); }
.contact-card .ico { font-size: 1.8rem; display: block; margin-bottom: 10px; }
.contact-card h3 { font-size: 1.1rem; }
.contact-card a, .contact-card p { color: var(--ink-soft); margin: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-900); color: #c6d2bf; padding: 60px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 46px; }
.site-footer h4 { color: #fff; font-family: "Inter", sans-serif; font-size: .9rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 18px; }
.site-footer a { color: #c6d2bf; }
.site-footer a:hover { color: #fff; }
.footer-brand img { height: 56px; margin-bottom: 14px; }
.footer-brand p { max-width: 36ch; font-size: .95rem; }
.footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer-list li { display: flex; gap: 8px; align-items: flex-start; }
.socials { display: flex; gap: 12px; margin-top: 8px; }
.socials a { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.1); display: grid; place-items: center; }
.socials a:hover { background: var(--amber-500); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 20px 0; text-align: center; font-size: .85rem; color: #9fb097; }

/* ---------- Quiz ---------- */
.quiz-alert {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff7e8; border: 1px solid #f0d9a8; border-left: 5px solid var(--amber-500);
  border-radius: var(--radius); padding: 16px 20px; max-width: 760px; margin: 0 auto 36px;
  color: #6a4a12; font-size: .95rem;
}
.quiz-alert strong { color: var(--amber-600); }
.quiz-alert .ico { font-size: 1.4rem; line-height: 1; }

.quiz-score {
  text-align: center; font-family: "Fraunces", serif; color: var(--green-900);
  font-size: 1.15rem; margin: 0 auto 26px; background: var(--white);
  border: 1px solid var(--cream-dark); border-radius: 999px; padding: 10px 24px;
  width: max-content; box-shadow: var(--shadow-sm);
}
.quiz-score b { color: var(--amber-600); }

.quiz { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.quiz-card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid var(--cream-dark); display: flex; flex-direction: column;
  transition: box-shadow .25s var(--ease);
}
.quiz-card:hover { box-shadow: var(--shadow-md); }
.quiz-photo { aspect-ratio: 4/3; overflow: hidden; background: #e6e1d5; }
.quiz-photo img { width: 100%; height: 100%; object-fit: cover; }
.quiz-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.quiz-q { font-family: "Fraunces", serif; color: var(--green-900); font-size: 1.15rem; text-align: center; margin: 0; }
.quiz-actions { display: flex; flex-direction: column; gap: 8px; }
.quiz-btn {
  cursor: pointer; border: 2px solid var(--cream-dark); background: var(--cream);
  color: var(--ink); font-weight: 600; font-size: .95rem; padding: 11px 10px; border-radius: 10px;
  transition: all .2s var(--ease); font-family: inherit; text-align: center;
}
.quiz-btn[data-choice="commestibile"]:hover { border-color: var(--green-600); background: #e8f3e6; color: var(--green-800); }
.quiz-btn[data-choice="noncommestibile"]:hover { border-color: #8a8f82; background: #eef0ea; color: #4a4f45; }
.quiz-btn[data-choice="tossico"]:hover { border-color: #c0392b; background: #fbeae8; color: #a5281c; }

.quiz-reveal {
  display: none; border-radius: 10px; padding: 14px 16px; font-size: .92rem; margin-top: auto;
}
.quiz-reveal.show { display: block; animation: quizIn .35s var(--ease); }
.quiz-reveal .verdict { font-family: "Fraunces", serif; font-size: 1.05rem; display: block; margin-bottom: 4px; }
.quiz-reveal .species { font-style: italic; }
.quiz-card.answered .quiz-actions { opacity: .55; pointer-events: none; }
.quiz-card.correct .quiz-reveal { background: #e8f3e6; border: 1px solid #b9ddb2; color: var(--green-800); }
.quiz-card.correct .verdict::before { content: "✅ "; }
.quiz-card.wrong .quiz-reveal { background: #fbeae8; border: 1px solid #e8b7b0; color: #a5281c; }
.quiz-card.wrong .verdict::before { content: "❌ "; }
.quiz-badge { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 10px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.quiz-badge.edi { background: var(--green-600); color: #fff; }
.quiz-badge.non { background: #8a8f82; color: #fff; }
.quiz-badge.tox { background: #c0392b; color: #fff; }

.quiz-reset { display: block; margin: 32px auto 0; }

@keyframes quizIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column;
    background: var(--cream); padding: 12px 22px 22px; gap: 4px;
    box-shadow: var(--shadow-md); align-items: stretch;
    max-height: 0; overflow: hidden; transition: max-height .35s var(--ease), padding .35s var(--ease);
    padding-top: 0; padding-bottom: 0;
  }
  .nav-links.open { max-height: 420px; padding-top: 12px; padding-bottom: 22px; }
  .nav-links a { padding: 13px 16px; }
  .split { grid-template-columns: 1fr; gap: 28px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero { background-attachment: scroll; }
  .founders { columns: 2 150px; }
}
@media (max-width: 480px) {
  section { padding: 54px 0; }
  .founders { columns: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .gallery figure:hover img { transform: none; }
}
