/* ============================================================
   Apicoltura Paganini — personalizzazione di Idonea Base
   Caricato dal campo «Codice nell'head» dello stile del template,
   DOPO le variabili generate dal template: qui vincono questi valori.
   ============================================================ */

/* Font ospitati sul sito (nessuna richiesta a Google: più veloce e GDPR-friendly). Licenza OFL. */
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(../fonts/fraunces-latin-opsz-normal.woff2) format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 100 900; font-display: swap; src: url(../fonts/fraunces-latin-opsz-italic.woff2) format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-style: normal; font-weight: 200 900; font-display: swap; src: url(../fonts/source-sans-3-latin-wght-normal.woff2) format('woff2'); }

:root {
  --c-primary: #2E3A1E;          /* verde oliva scuro: la campagna della Bassa */
  --c-accent: #E3A12F;           /* miele */
  --c-dark: #1F2614;
  --c-text: #2A2619;
  --c-steel: #5E5A4C;
  --c-line: #E7DFCC;
  --c-bg: #F8F4EA;
  --c-white: #FFFDF8;
  --c-honey-ink: #8F5A06;        /* miele scuro: testo su fondo chiaro (contrasto AA) */
  --c-cream: #F3EBD6;
  --on-accent: #21180D;
  --radius: 16px;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

body.site { font-size: 17px; }
h1, h2, h3, h4, .tpl-module-title { letter-spacing: -0.01em; font-weight: 600; }
a:hover { color: var(--c-honey-ink); }
:focus-visible { outline-color: var(--c-honey-ink); }

/* ---------- Header ---------- */
.tpl-header { background: var(--c-white); }
.tpl-header .wrap { min-height: 84px; }
.tpl-logo { flex: none; display: grid; grid-template-columns: auto auto; column-gap: 12px; row-gap: 2px; align-items: center; }
.tpl-logo::before {
  content: ""; width: 38px; height: 42px; grid-row: 1 / span 2;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 44'%3E%3Cpath d='M20 2 L37 12 L37 32 L20 42 L3 32 L3 12 Z' fill='%23E3A12F'/%3E%3Cpath d='M20 12 L28 17 L28 27 L20 32 L12 27 L12 17 Z' fill='none' stroke='%232E3A1E' stroke-width='2.4'/%3E%3C/svg%3E");
}
.tpl-logo:has(img)::before { display: none; }
/* Logo immagine (ape + scritta): più alto del default del template, payoff già nel disegno */
.tpl-logo:has(img) { display: flex; align-items: center; }
.tpl-logo img { max-height: 64px; width: auto; }
.tpl-logo:has(img) .tag { display: none; }
.tpl-footer .footer-logo { max-height: 64px; }
.tpl-logo .wordmark { font-size: 24px; line-height: 1.1; }
.tpl-logo .wordmark i { display: none; }
.tpl-logo .wordmark { grid-column: 2; align-self: end; }
.tpl-logo .tag { grid-column: 2; align-self: start; font-size: 11px; letter-spacing: .14em; font-weight: 600; }
.tpl-logo:not(:has(.tag)) .wordmark { align-self: center; }
.tpl-logo:not(:has(.tag))::before { grid-row: 1; }
@media (max-width: 1180px) { .tpl-header-cta { display: none; } }
/* A negozio attivo (mini-carrello nel menu) il pulsante dell'header lascia spazio a «Negozio» */
.tpl-header:has(.ids-minicart) .tpl-header-cta { display: none; }
.tpl-logo .wordmark { white-space: nowrap; }
.tpl-topbar { background: var(--c-dark); }

/* megamenu e mini-carrello nella posizione «menu» */
@media (min-width: 961px) {
  .tpl-nav { display: flex; align-items: center; gap: 10px; }
}
.tpl-nav .ids-minicart { margin-left: 6px; }
.megamenu .mm-top { font-size: 15.5px; white-space: nowrap; padding: 10px 11px; }
.megamenu .mm-toggle { padding-left: 0; }
.megamenu .mm-is-button > .mm-top { background: var(--c-accent); color: var(--on-accent); }

/* ---------- Bottoni ---------- */
.btn-accent, .btn-accent:hover, .tpl-content .btn-accent { background: var(--c-accent); color: var(--on-accent); }
.tpl-content .btn-primary { background: var(--c-primary); color: #fff; }
.btn-ghost:hover { color: var(--c-accent); border-color: var(--c-accent); }
.btn-dark { background: var(--on-accent); color: #fff; }
.btn-dark:hover { color: #fff; filter: brightness(1.3); }
.btn-line { border-color: var(--on-accent); color: var(--on-accent); }
.btn-line:hover { background: var(--on-accent); color: #fff; }

/* Occhielli: miele scuro su fondo chiaro, miele pieno sul fondo scuro */
.kicker { color: var(--c-honey-ink); margin-bottom: 12px; }
.kicker::before { background: var(--c-accent); }
.band-dark .kicker, .panel.alt .kicker, .hero .eyebrow { color: var(--c-accent); }
.kicker:only-child { margin-bottom: 0; }

/* ---------- Hero diviso con immagine ---------- */
.band-hero .hero.hero-split { background: var(--c-primary); padding: 84px 0 124px; overflow: hidden; }
.band-hero .hero.hero-split .wrap { max-width: var(--wrap); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 56px; align-items: center; }
.hero-split h1 { font-size: clamp(38px, 5vw, 62px); line-height: 1.05; max-width: 16ch; font-weight: 600; }
.hero-split h1 em { font-style: italic; color: var(--c-accent); filter: none; }
.hero-split p.lead { color: rgba(255,255,255,.84); font-size: 19px; }
.hero-media img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 4; object-fit: cover; border-radius: 22px; }

/* ---------- Fascia numeri ---------- */
.band-numeri { margin-top: -62px; }
.band-numeri .numbers-box { background: var(--c-white); box-shadow: 0 24px 60px rgba(46,58,30,.14); }
.numbers-box .num { font-size: clamp(30px, 3vw, 38px); }

/* ---------- Fasce e moduli ---------- */
.tpl-band.band-section { padding: 96px 0; }
.band-section .tpl-module + .tpl-module { margin-top: 88px; }
.tpl-main .tpl-module + .tpl-module { margin-top: 64px; }
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px 48px; flex-wrap: wrap; margin-bottom: 40px; }
.sec-head h2.sec { max-width: 18ch; margin-bottom: 0; }
.sec-head p.sub { margin: 0; max-width: 46ch; }
h2.sec, .tpl-module-title { font-size: clamp(30px, 3.4vw, 42px); line-height: 1.1; }

/* ---------- Schede miele ---------- */
.honey-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; margin: 8px 0 40px; }
.honey-card {
  background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--radius);
  padding: 24px; text-decoration: none; color: var(--c-text);
  display: flex; flex-direction: column; gap: 12px;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.honey-card:hover { color: var(--c-text); transform: translateY(-3px); border-color: color-mix(in srgb, var(--c-accent) 50%, var(--c-line)); box-shadow: 0 14px 32px rgba(46,58,30,.10); }
.honey-card h3 { font-size: 22px; margin: 0; }
.honey-card p { color: var(--c-steel); font-size: 15.5px; flex: 1; margin: 0; }
.honey-card .go { font-weight: 700; font-size: 15px; color: var(--c-honey-ink); }
.honey-card .go::after { content: " →"; }
.honey-card .badge, .card .badge { background: var(--c-cream); color: #6A4A0C; }
.jar {
  --honey: #E3A73A;
  display: block; height: 120px; border-radius: 12px;
  background: color-mix(in srgb, var(--honey) 28%, #FFFDF8);
  position: relative;
}
.jar::before, .jar::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); }
/* coperchio */
.jar::before { top: 18px; width: 36px; height: 12px; border-radius: 3px; background: var(--c-primary); }
/* vasetto con etichetta */
.jar::after {
  top: 32px; width: 52px; height: 62px; border-radius: 12px;
  background: linear-gradient(#FFFDF8, #FFFDF8) center 20px / 36px 20px no-repeat, var(--honey);
  border-radius: 12px;
}

/* ---------- Fascia scura con immagine ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.split .sub { margin-bottom: 28px; }
.split-media img { display: block; width: 100%; height: auto; border-radius: 22px; }
ul.hex-list { list-style: none; margin: 0 0 34px; padding: 0; display: grid; gap: 14px; }
ul.hex-list li { position: relative; padding-left: 32px; }
ul.hex-list li::before {
  content: ""; position: absolute; left: 0; top: 5px; width: 17px; height: 19px; background: var(--c-accent);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.band-dark ul.hex-list strong { color: #fff; }

/* ---------- Pannelli ---------- */
.panel { background: var(--c-white); border-radius: calc(var(--radius) + 2px); }
.panel h3 { font-size: 28px; margin: 0; }
.panel p { margin: 0; }
.panel.alt p { color: rgba(255,255,255,.82); }

/* ---------- Vieni a trovarci ---------- */
.visit {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center;
  background: var(--c-white); border: 1px solid var(--c-line); border-radius: 22px; padding: 48px;
}
.visit p { color: var(--c-steel); margin: 0 0 22px; }
.visit dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 0 0 28px; }
.visit dt { font-weight: 700; color: var(--c-primary); }
.visit dd { margin: 0; }
.visit-media img { display: block; width: 100%; height: auto; border-radius: 16px; }

/* ---------- CTA ---------- */
.band-cta .cta.cta-honey { background: var(--c-accent); color: var(--on-accent); }
.band-cta .cta.cta-honey::before { border-color: rgba(33,24,13,.18); }
.band-cta .cta.cta-honey h2 { color: var(--on-accent); }
.band-cta .cta.cta-honey p { color: var(--on-accent); font-size: 18px; }

/* ---------- Articoli e pagine ---------- */
.tpl-content .item-page, .tpl-content .com-content-article { max-width: 820px; }
.tpl-content p.lead { font-size: 20px; color: var(--c-text); line-height: 1.55; }
.tpl-content .item-page ul, .tpl-content .com-content-article ul { padding-left: 1.2em; margin-bottom: 1em; }
.tpl-content .item-page li { margin-bottom: .45em; }
.tpl-content .item-page .honey-grid, .tpl-content .item-page .grid, .tpl-content .item-page .cols2 { margin: 28px 0 36px; padding: 0; }
.tpl-content .item-page .honey-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.tpl-content .item-page .card h3, .tpl-content .item-page .panel h3 { margin: 0; }
.tpl-content .item-page .card p { margin: 0; }
.tpl-content .item-page .panel h3 { font-size: 22px; }
.tpl-content .item-page .panel .btn { color: var(--on-accent); text-decoration: none; }

dl.honey-facts {
  display: grid; grid-template-columns: max-content 1fr; gap: 0; margin: 28px 0 32px;
  background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--radius); overflow: hidden;
}
dl.honey-facts dt, dl.honey-facts dd { padding: 13px 20px; border-top: 1px solid var(--c-line); margin: 0; }
dl.honey-facts dt:first-of-type, dl.honey-facts dt:first-of-type + dd { border-top: 0; }
dl.honey-facts dt { font-weight: 700; color: var(--c-primary); background: var(--c-cream); }

ul.checks-light { list-style: none; padding: 0 !important; display: grid; gap: 14px; }
ul.checks-light li { position: relative; padding-left: 32px; }
ul.checks-light li::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 17px; height: 19px; background: var(--c-accent);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.product-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin: 28px 0; }
.product-rows section { background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 26px 26px 10px; }
.tpl-content .item-page .product-rows h2 { margin-top: 0; font-size: 23px; }
.note { background: var(--c-cream); border-radius: calc(var(--radius) - 4px); padding: 16px 20px 2px; margin: 24px 0; border: 1px solid #E5D7B0; }
.note.warn { background: #FCF4E3; border-color: #F0DCA8; color: #6A4A0C; }
.cta-inline { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; background: var(--c-primary); border-radius: 20px; padding: 36px 40px; margin: 36px 0; }
.tpl-content .item-page .cta-inline h2 { color: #fff; margin: 0 0 6px; font-size: 26px; }
.cta-inline p { color: rgba(255,255,255,.82); margin: 0 !important; }
.cta-inline .btn { color: var(--on-accent); text-decoration: none; }
.tpl-content p.small { font-size: 14.5px; color: var(--c-steel); }

/* Navigazione articolo precedente/successivo */
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.tpl-content .pagenavigation .pagination { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; }
.tpl-content .pagenavigation .btn { display: inline-flex; background: var(--c-white); color: var(--c-primary); border: 1px solid var(--c-line); padding: 10px 18px; font-weight: 600; }
.tpl-content .pagenavigation .btn:hover { border-color: var(--c-accent); }
.tpl-content .pagenavigation .btn span { display: inline; padding: 0; border: 0; background: none; color: inherit; }
.tpl-content .pagenavigation .next { margin-left: auto; }

/* Blog «Api e salute» */
.tpl-content .category-desc { margin-bottom: 32px; color: var(--c-steel); font-size: 18px; max-width: 62ch; }
.tpl-content .blog-items .blog-item { background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 28px 28px 24px; }
.tpl-content .blog-items .blog-item p { color: var(--c-steel); margin-bottom: 12px; }
.tpl-content .blog-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.tpl-content .blog-items .blog-item { margin: 0; }
.tpl-content .blog .com-content-article, .tpl-content .blog .blog-item { display: flex; flex-direction: column; }
.tpl-content .blog .item-title, .tpl-content .blog h2 { font-size: 23px; line-height: 1.2; }
.tpl-content .blog h2 a { text-decoration: none; color: var(--c-primary); }
.tpl-content .readmore a, .tpl-content a.readmore, .tpl-content .readmore .btn {
  background: none; color: var(--c-honey-ink); padding: 0; font-weight: 700; border: 0;
}
.tpl-content .article-info { display: none; }

/* Modulo «Dal nostro quaderno» (articoli in home) */
.ap-news .mod-articlesnews, .ap-news .mod-articles-items, .ap-news ul {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 22px;
}
.ap-news .mod-articlesnews__item, .ap-news .mod-articles-item, .ap-news ul > li {
  background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 26px 26px 22px;
  display: flex; flex-direction: column; gap: 6px;
}
.ap-news h3, .ap-news h4, .ap-news .newsflash-title { font-size: 21px; margin: 0 0 4px; font-family: var(--font-display); }
.ap-news h3 a, .ap-news h4 a, .ap-news .newsflash-title a { color: var(--c-primary); text-decoration: none; }
.ap-news p { color: var(--c-steel); font-size: 15.5px; margin: 0; }
.ap-news .readmore, .ap-news a.mod-articles-link, .ap-news .mod-articles-readmore a { margin-top: auto; padding-top: 10px; font-weight: 700; color: var(--c-honey-ink); text-decoration: none; }
.ap-news .readmore a { color: var(--c-honey-ink); text-decoration: none; font-weight: 700; }
.ap-news-more { margin-top: 22px; }
.ap-news-more a { font-weight: 700; color: var(--c-primary); text-decoration: none; border-bottom: 2px solid var(--c-accent); }

/* ---------- Form contatti ---------- */
.com-mailform { max-width: 760px; }
.tpl-content .com-mailform .btn-accent { background: var(--c-accent); color: var(--on-accent); }

/* ---------- Negozio (IdoShop) ---------- */
.ids-shop { --ids-accent: var(--c-honey-ink); --ids-soft: var(--c-cream); --ids-muted: var(--c-steel); }
.ids-shop .ids-btn-primary { background: var(--c-primary); }
/* Vetrina in home: 4 colonne nella larghezza del template (il modulo calcola su 1100px senza i gap) */
.band-section .ids-mod-products .ids-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)) !important; }

/* ---------- Home: nessun contenuto componente ---------- */
body.is-home .tpl-content > .blog-featured { display: none; }
body.is-home .tpl-main { padding-top: 96px; }

/* ---------- Footer ---------- */
.tpl-footer { color: rgba(255,255,255,.72); }
.tpl-footer a { color: rgba(255,255,255,.78); }
.tpl-footer h4 { font-size: 17px; }
.tpl-footer .legal { color: rgba(255,255,255,.6); }
.tpl-footer .legal a { margin-right: 4px; }
.tpl-footer .legal span:last-child a:last-of-type { margin-right: 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .band-hero .hero.hero-split .wrap, .split, .visit { grid-template-columns: minmax(0, 1fr); }
  .band-hero .hero.hero-split { padding: 64px 0 110px; }
  .visit { padding: 32px 24px; }
  .tpl-nav.open .ids-minicart { margin: 16px 0 0; }
}
@media (max-width: 620px) {
  .tpl-band.band-section { padding: 64px 0; }
  .tpl-logo .wordmark { font-size: 20px; }
  .tpl-logo img { max-height: 46px; }
  .tpl-logo .tag { display: none; }
  .tpl-logo .wordmark { grid-row: 1 / span 2; align-self: center; }
  .cta-inline { padding: 28px 24px; }
}
