/* Migrato da snippet WPCode 65 il 02/08/2026 — URL font corretti in percorsi relativi (erano hardcoded con dominio dev) */

/* ===== PED - Design semplificato: bianco/nero con interruttore ===== */
:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #666666;
  --border: #e5e5e5;
}
html.dark-mode {
  --bg: #111111;
  --text: #f2f2f2;
  --muted: #aaaaaa;
  --border: #333333;
  /* --accent (#1e73be, tema GeneratePress) da' 3.82:1 su sfondo scuro: sotto la soglia AA 4.5:1 per il testo dei link. Variante piu' chiara solo per i link nel corpo del testo, il bottone primario resta su --ped-ocra/--accent invariato. */
  --accent-link-dark: #4a9eda;
}
html body {
  background-color: var(--bg) !important;
  color: var(--text) !important;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.dark-mode [style*="background-color:#fef7e1"],
.dark-mode [style*="background-color:#f5f5f5"],
.dark-mode [style*="background-image"] {
  background-color: var(--bg) !important;
  background-image: none !important;
}
html body .is-style-outline .wp-block-button__link {
  background-color: transparent !important;
  color: var(--text) !important;
  border: 1px solid var(--text) !important;
}
.site-header, .main-navigation, footer, .ped-footer-widgets {
  background-color: var(--bg) !important;
  color: var(--text) !important;
}
.ped-footer-widgets a, .ped-footer-widgets h3 {
  color: var(--text) !important;
}
nav a, .main-navigation a {
  color: var(--text) !important;
}

/* Tipografia */
html body h1 { font-size: clamp(28px, 6vw, 48px) !important; line-height: 1.15 !important; }
html body h2 { font-size: clamp(22px, 4.5vw, 32px) !important; line-height: 1.2 !important; }
html body h3 { font-size: clamp(18px, 3.5vw, 24px) !important; }
html body p { font-size: clamp(14px, 2.2vw, 18px); }
html body, html body p, html body li, html body span, html body input, html body button, html body div { font-family: 'Lato', sans-serif !important; }
html body h1, html body h2, html body h3, html body h4, html body .site-title { font-family: 'Playfair Display', Georgia, serif !important; }

@font-face { font-family: 'Lato'; src: url('/wp-content/uploads/2026/07/lato-light-300.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Lato'; src: url('/wp-content/uploads/2026/07/lato-regular-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Lato'; src: url('/wp-content/uploads/2026/07/lato-bold-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Playfair Display'; src: url('/wp-content/uploads/2026/07/playfair-display.woff2') format('woff2'); font-weight: 400 700; font-style: normal; font-display: swap; }

/* Full width e responsive */
html body .alignfull { width: 100vw !important; max-width: 100vw !important; margin-left: calc(50% - 50vw) !important; margin-right: calc(50% - 50vw) !important; }
html body { overflow-x: hidden; }
@media (max-width: 782px) { html body .alignfull { padding-left: 20px !important; padding-right: 20px !important; } }
@media (max-width: 600px) { html body .alignfull { padding-top: 64px !important; padding-bottom: 64px !important; } }
@media (max-width: 782px) { html body [style*="background-attachment:fixed"] { background-attachment: scroll !important; } }

/* Interruttore chiaro/scuro */
#ped-theme-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Stile form MailerLite: coerente col resto del sito */
.ml-embedded { font-family: 'Lato', sans-serif !important; }
.ml-embedded h1, .ml-embedded h2, .ml-embedded h3 { font-family: 'Playfair Display', Georgia, serif !important; color: var(--text) !important; }
.ml-embedded p, .ml-embedded label { color: var(--text) !important; font-family: 'Lato', sans-serif !important; }
.ml-embedded input[type="text"], .ml-embedded input[type="email"] {
  border: 1px solid var(--border) !important;
  border-radius: 2px !important;
  background-color: var(--bg) !important;
  color: var(--text) !important;
  font-family: 'Lato', sans-serif !important;
  padding: 12px !important;
}
.ml-embedded button, .ml-embedded input[type="submit"] {
  background-color: var(--text) !important;
  color: var(--bg) !important;
  border: none !important;
  border-radius: 2px !important;
  font-weight: 700 !important;
  font-family: 'Lato', sans-serif !important;
}

.dark-mode .wp-block-column[style*="background-color:#005f73"] {
  border: 1px solid var(--border) !important;
  background-color: var(--bg) !important;
}
html body .alignfull + .alignfull {
  border-top: 1px solid var(--border);
}
.dark-mode [style*="background-color:#005f73;text-align:center"],
.dark-mode [style*="background-color:#fef7e1;text-align:center"] {
  border-top: 1px solid var(--border) !important;
  border-bottom: 1px solid var(--border) !important;
  background-color: var(--bg) !important;
}

/* Bottoni outline (bordo+testo teal, sfondo trasparente: "Il Giardino dei Libri",
   "Ascolta tutti gli episodi"): #005f73 su sfondo quasi nero in dark mode da 2.59:1
   di contrasto, sotto la soglia AA 4.5:1. Fix: stesso --accent-link-dark già usato
   per i link di testo in dark mode (contrasto verificato: 6.47:1). */
.dark-mode a[style*="border:1px solid #005f73"] {
  border-color: var(--accent-link-dark) !important;
  color: var(--accent-link-dark) !important;
}

/* ===== Correzioni: modalita' scura, footer, logo, ricerca, bottoni, griglie ===== */

.ped-footer-widgets, .footer-widgets, .site-info, footer.site-info {
  background-color: #0f0f0f !important;
  color: #f2f2f2 !important;
  border: none !important;
  box-shadow: none !important;
}
.ped-footer-widgets a, .ped-footer-widgets h3, .footer-widgets a, .footer-widgets h3,
.site-info, .site-info a {
  color: #f2f2f2 !important;
}
.copyright-bar { border: none !important; }

/* Contrasto AA (>=4.5:1) per i link nel corpo del testo in modalita' scura. Non tocca i bottoni (.ped-btn*, .wp-block-button__link) che restano su --ped-ocra/--accent. */
html.dark-mode .entry-content a:not(.ped-btn):not(.wp-block-button__link),
html.dark-mode .page-content a:not(.ped-btn):not(.wp-block-button__link),
html.dark-mode .ped-section a:not(.ped-btn):not(.wp-block-button__link),
html.dark-mode .ped-section-alt a:not(.ped-btn):not(.wp-block-button__link),
html.dark-mode .ped-col a:not(.ped-btn):not(.wp-block-button__link),
html.dark-mode .comment-content a:not(.ped-btn):not(.wp-block-button__link) {
  color: var(--accent-link-dark) !important;
}

.site-logo, .custom-logo-link, .site-logo a {
  border: none !important;
  background: transparent !important;
}

body:not(.search-results):not(.search) form[role="search"],
body:not(.search-results):not(.search) .search-form,
body:not(.search-results):not(.search) .no-results {
  display: none !important;
}

html body .wp-block-button__link,
html body .ped-cta-button a {
  background-color: #005f73 !important;
  color: #ffffff !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  font-weight: 700 !important;
}
html body .is-style-outline .wp-block-button__link {
  background-color: transparent !important;
  color: #005f73 !important;
  border: 1px solid #005f73 !important;
}

/* ===== Griglie eleganti per archivi Libri/Autori/Podcast/Eventi ===== */

.post-type-archive .page-header, .post-type-archive .entry-header {
  text-align: center;
  padding: 80px 24px 40px 24px !important;
  border: none !important;
  margin: 0 !important;
}
.post-type-archive .page-header .page-title, .post-type-archive h1 {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: clamp(32px, 5vw, 48px) !important;
  color: var(--text) !important;
}

.post-type-archive-libro .site-main,
.post-type-archive-autore .site-main,
.post-type-archive-podcast .site-main,
.post-type-archive-evento .site-main,
body.tax-collana .site-main,
body.tax-genere .site-main,
body.tax-serie .site-main {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
  gap: 32px !important;
  padding: 0 24px 80px 24px !important;
  max-width: 1200px;
  margin: 0 auto !important;
}


/* Card base: nessuna cornice WordPress di default, stile pulito */
.post-type-archive article {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  margin: 0 !important;
  transition: transform 0.2s ease;
}
.post-type-archive article:hover { transform: translateY(-4px); }

.post-type-archive .entry-header,
body.tax-collana .entry-header,
body.tax-genere .entry-header,
body.tax-serie .entry-header {
  padding: 0 !important;
  text-align: left !important;
}
.post-type-archive article .entry-title,
body.tax-collana article .entry-title,
body.tax-genere article .entry-title,
body.tax-serie article .entry-title {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  margin: 0 0 4px 0 !important;
}
.post-type-archive article .entry-title a,
body.tax-collana article .entry-title a,
body.tax-genere article .entry-title a,
body.tax-serie article .entry-title a {
  color: var(--text) !important;
}
.post-type-archive article .entry-content,
.post-type-archive article .entry-summary,
body.tax-collana article .entry-content,
body.tax-collana article .entry-summary,
body.tax-genere article .entry-content,
body.tax-genere article .entry-summary,
body.tax-serie article .entry-content,
body.tax-serie article .entry-summary {
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden !important;
  font-size: 14px !important;
  color: var(--muted) !important;
  max-height: none !important;
}
.post-type-archive article .entry-content p,
.post-type-archive article .entry-summary p,
body.tax-collana article .entry-content p,
body.tax-collana article .entry-summary p,
body.tax-genere article .entry-content p,
body.tax-genere article .entry-summary p,
body.tax-serie article .entry-content p,
body.tax-serie article .entry-summary p {
  font-size: 14px !important;
}
.post-type-archive article table,
body.tax-collana article table,
body.tax-genere article table,
body.tax-serie article table { display: none !important; }
.post-type-archive article .wp-block-button, .post-type-archive article a[style*="border-radius"],
body.tax-collana article .wp-block-button, body.tax-collana article a[style*="border-radius"],
body.tax-genere article .wp-block-button, body.tax-genere article a[style*="border-radius"],
body.tax-serie article .wp-block-button, body.tax-serie article a[style*="border-radius"] { display: none !important; }

.post-type-archive-evento .site-main {
  grid-template-columns: 1fr !important;
  max-width: 800px !important;
}

/* Sezione "Eventi passati" collassabile nell'archivio /eventi/ */
.ped-eventi-passati {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 8px;
}
.ped-eventi-passati summary {
  cursor: pointer;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: #005f73;
  list-style: none;
  padding: 8px 0;
  user-select: none;
}
.ped-eventi-passati summary::-webkit-details-marker { display: none; }
.ped-eventi-passati summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 10px;
  transition: transform 0.2s ease;
}
.ped-eventi-passati[open] summary::before {
  transform: rotate(90deg);
}
.ped-eventi-passati-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  margin-top: 24px;
}
.ped-eventi-passati-grid article {
  /* opacity tenuta sopra 0.9: a 0.55 il testo (--muted su --bg) scendeva a un
     contrasto di ~2.3:1, ben sotto la soglia WCAG AA di 4.5:1 per testo normale.
     Il grayscale non incide sul contrasto del testo (colori già acromatici),
     quindi resta la leva principale per la desaturazione visibile della foto. */
  opacity: 0.92;
  filter: grayscale(60%);
}
/* "Mostra altri": i primi 10 sono visibili, il resto è già nel DOM ma nascosto
   finché il bottone non aggiunge .ped-mostra-tutti al contenitore (nessuna AJAX). */
.ped-eventi-passati-grid:not(.ped-mostra-tutti) article:nth-child(n+11) {
  display: none;
}
.ped-eventi-passati-mostra-altri {
  display: block;
  margin: 32px auto 0;
  background-color: #005f73;
  color: #ffffff;
  border: none;
  border-radius: 2px;
  padding: 14px 32px;
  font-family: 'Lato', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s ease;
}
.ped-eventi-passati-mostra-altri:hover {
  filter: brightness(0.88);
}

.footer-widgets a, .ped-footer-widgets a {
  text-decoration: none !important;
}

.post-type-archive article,
body.tax-collana article,
body.tax-genere article,
body.tax-serie article {
  display: flex;
  flex-direction: column;
}
.post-type-archive .ped-card-image,
body.tax-collana .ped-card-image,
body.tax-genere .ped-card-image,
body.tax-serie .ped-card-image {
  background-color: var(--border);
  border-radius: 4px;
  margin-bottom: 16px;
  overflow: hidden;
  position: relative;
}
.type-libro .ped-card-image, .type-autore .ped-card-image { aspect-ratio: 2 / 3; }
.type-podcast .ped-card-image { aspect-ratio: 1 / 1; }
.post-type-archive .ped-card-image img,
body.tax-collana .ped-card-image img,
body.tax-genere .ped-card-image img,
body.tax-serie .ped-card-image img {
  width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0;
}
.post-type-archive .entry-header, .post-type-archive .entry-content, .post-type-archive .entry-summary,
body.tax-collana .entry-header, body.tax-collana .entry-content, body.tax-collana .entry-summary,
body.tax-genere .entry-header, body.tax-genere .entry-content, body.tax-genere .entry-summary,
body.tax-serie .entry-header, body.tax-serie .entry-content, body.tax-serie .entry-summary {
  position: static !important;
}

.post-type-archive .entry-title a,
body.tax-collana .entry-title a,
body.tax-genere .entry-title a,
body.tax-serie .entry-title a {
  display: flex !important;
  flex-direction: column !important;
  text-decoration: none !important;
}
.post-type-archive .entry-title .ped-card-image,
body.tax-collana .entry-title .ped-card-image,
body.tax-genere .entry-title .ped-card-image,
body.tax-serie .entry-title .ped-card-image {
  display: block;
  width: 100%;
}
.post-type-archive .entry-title .ped-card-image img,
body.tax-collana .entry-title .ped-card-image img,
body.tax-genere .entry-title .ped-card-image img,
body.tax-serie .entry-title .ped-card-image img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.post-type-archive .entry-title .ped-card-title-text,
body.tax-collana .entry-title .ped-card-title-text,
body.tax-genere .entry-title .ped-card-title-text,
body.tax-serie .entry-title .ped-card-title-text {
  display: block;
  margin-top: 12px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 18px;
}

#ped-cc {
  display: none !important;
  visibility: hidden !important;
}

.site-footer {
  background-color: #0f0f0f !important;
}

.post-type-archive .site-main {
  padding-bottom: 100px !important;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0 !important;
}

.site-info .copyright-bar {
  display: none !important;
}

.site-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 9998 !important;
  box-shadow: 0 1px 0 var(--border);
}

#ped-nl-submit {
  background-color: #005f73 !important;
  color: #ffffff !important;
}

.wp-block-buttons:has(.wp-block-button__link[href*="/diventa-socio/"]) {
  margin-top: 40px !important;
}

.footer-bar p, .footer-bar a, .copyright-bar, .copyright-bar a {
  color: #f2f2f2 !important;
}

#ped-nl-submit {
  padding: 16px 40px !important;
  margin-top: 8px !important;
}
#ped-newsletter-form label {
  margin-bottom: 24px !important;
}

.footer-widgets {
  padding-top: 80px !important;
  padding-bottom: 60px !important;
}
.footer-widgets h3 {
  font-size: 18px !important;
  margin-bottom: 20px !important;
}
.footer-widgets p, .footer-widgets a {
  font-size: 14px !important;
  line-height: 2 !important;
}
.footer-widgets .widget {
  margin-bottom: 8px !important;
}

.ped-newsletter-block { max-width:960px; margin:0 auto; padding:48px 24px 48px 40px; position:relative; text-align:left; }
.ped-newsletter-block::before { content:""; position:absolute; left:0; top:48px; bottom:48px; width:3px; background:#005f73; }
.dark-mode .ped-newsletter-block::before { background:var(--text); }
.ped-nl-eyebrow { font-size:12px; letter-spacing:2px; text-transform:uppercase; color:#005f73; margin-bottom:12px; }
.dark-mode .ped-nl-eyebrow { color:var(--text); }

/* Eyebrow sopra il titolo negli archivi tassonomia (Collana/Genere/Serie), stessi
   valori di .ped-nl-eyebrow riusati per coerenza. */
.ped-archive-eyebrow { display:block; font-size:12px; letter-spacing:2px; text-transform:uppercase; color:#005f73; margin-bottom:8px; }
.dark-mode .ped-archive-eyebrow { color:var(--text); }

.dark-mode .inside-article, .dark-mode .inside-page-header, .dark-mode .page-header { background-color: var(--bg) !important; }
.dark-mode .entry-title a { color: var(--text) !important; }
.dark-mode .paging-navigation { background-color: var(--bg) !important; }
.post-type-archive-libro .site-main > .page-header,
.post-type-archive-autore .site-main > .page-header,
.post-type-archive-podcast .site-main > .page-header,
.post-type-archive-evento .site-main > .page-header,
body.tax-collana .site-main > .page-header,
body.tax-genere .site-main > .page-header,
body.tax-serie .site-main > .page-header {
  grid-column: 1 / -1 !important;
}

@media (min-width: 769px) {
  .inside-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
  }
  .inside-header .site-logo {
    flex: 0 0 auto;
  }
  .inside-header #mobile-menu-control-wrapper {
    display: none;
  }
  #site-navigation {
    flex: 1 1 auto;
    float: none;
  }
  #site-navigation .main-nav {
    width: 100%;
  }
  #site-navigation .main-nav > ul {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
  }
  #site-navigation .main-nav > ul > li.ped-cta-button {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
  }
}
.ped-evento-desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Layout evento in evidenza: breakpoint esplicito invece dell'avvolgimento flex
   implicito basato su min-width, che creava una fascia (628-688px) in cui il
   testo restava incastrato a 280px di larghezza mentre l'immagine continuava a
   restringersi. Sopra i 1000px la colonna testo scende in modo lineare e
   prevedibile da 732px a 552px; sotto i 1000px il layout passa a colonna unica. */
.ped-evento-slide {
  max-width: 1100px;
  margin: 0 auto;
  gap: 48px;
  align-items: flex-start;
  flex-wrap: nowrap;
}
.ped-evento-img {
  flex: 1;
  min-width: 220px;
  max-width: 320px;
}
.ped-evento-text {
  flex: 1;
  min-width: 0;
}
@media (max-width: 1000px) {
  .ped-evento-slide {
    flex-wrap: wrap;
  }
  .ped-evento-img {
    flex: 0 0 100%;
    max-width: 320px;
    min-width: 0;
  }
  .ped-evento-text {
    flex: 1 1 100%;
    min-width: 0;
  }
}

.ped-carousel-wrap { position: relative; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.ped-carousel-track { display: flex; gap: 24px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: thin; padding-bottom: 8px; }
.ped-carousel-track::-webkit-scrollbar { height: 6px; }
.ped-carousel-track::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.ped-carousel-item { flex: 0 0 auto; scroll-snap-align: start; }
.ped-carousel-arrow { position: absolute; top: 40%; transform: translateY(-50%); background: #005f73; color: #fff; border: none; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; z-index: 2; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.ped-carousel-arrow.prev { left: -8px; }
.ped-carousel-arrow.next { right: -8px; }
@media (max-width: 768px) { .ped-carousel-arrow { display: none; } }

.blog .page-header, .blog .entry-header {
  text-align: center;
  padding: 80px 24px 40px 24px !important;
  border: none !important;
  margin: 0 !important;
}
.blog .page-header .page-title {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: clamp(32px, 5vw, 48px) !important;
  color: var(--text) !important;
}

/* Pagina "Le nostre collane": copertina piccola (90px) accanto al testo, non una
   griglia di copertine come /collana/ o /genere/ — dimensione volutamente diversa. */
.ped-collane-showcase {
  display: flex;
  flex-direction: column;
  gap: 40px;
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.ped-collana-showcase-item {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.ped-collana-showcase-cover {
  flex-shrink: 0;
}
.ped-collana-cover-link {
  display: block;
}
.ped-collana-cover-img {
  display: block;
  width: 90px;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  background-color: var(--border);
}
.ped-collana-showcase-text {
  flex: 1;
  min-width: 0;
}
.ped-collana-showcase-name {
  font-size: 24px;
  margin: 0 0 8px;
}
.ped-collana-showcase-desc {
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 12px;
}
.ped-collana-showcase-link {
  color: #005f73;
  font-weight: 700;
  text-decoration: none;
}
@media (max-width: 480px) {
  .ped-collana-showcase-item { gap: 16px; }
  .ped-collana-cover-img { width: 72px; }
}
