/*
Theme Name: Guglielmo da Volpiano
Description: Tema FSE per "Sulle tracce di Guglielmo da Volpiano"
Version: 2.13.2 - EMERGENZA: Fix completo card colorate
Text Domain: gdv-theme
Author: Fondazione Canavese2030
*/

/* =========================
   HEADER (slim + sticky)
   ========================= */
.gdv-header{
  position: sticky; top: 0; z-index: 1000;
  background:#fff;
  border-bottom:1px solid rgba(0,0,0,.06);
}
.gdv-header-wrap{ max-width:1200px; margin:0 auto; padding:0 12px; }
.gdv-logo-img img{ width:130px; height:auto; display:block; }

/* Navigazione + hover mockup */
.gdv-nav{ font-size:clamp(12px,1.1vw,14px); }
.gdv-nav .wp-block-navigation__container{ gap:12px; align-items:center; }
.gdv-nav .wp-block-navigation-item a{
  padding:6px 2px;
  border-bottom:3px solid transparent;
  text-decoration:none;
  color:inherit;
  transition:color .2s ease, border-color .2s ease;
}
.gdv-nav .wp-block-navigation-item a:hover,
.gdv-nav .wp-block-navigation-item a:focus{
  color:var(--wp--preset--color--rosso-vivo,#e73143);
  border-bottom-color:var(--wp--preset--color--rosso-vivo,#e73143);
}

/* Hamburger: voci centrate */
.gdv-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container{
  display:flex; flex-direction:column; align-items:center; text-align:center;
}
.gdv-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item a{ padding:10px 8px; }

/* Accessibilità focus */
.gdv-nav .wp-block-navigation-item a:focus{
  outline:2px dashed var(--wp--preset--color--rosso-vivo,#e73143); outline-offset:3px;
}

/* Language switcher (shortcode) */
.gdv-lang{ display:inline-flex; gap:8px; margin-left:6px; font-size:12px; }
.gdv-lang a, .gdv-lang span{ color:inherit; text-decoration:none; cursor:pointer; }
.gdv-lang a:hover, .gdv-lang span:hover{
  color:var(--wp--preset--color--rosso-vivo,#e73143);
  text-decoration:underline; text-underline-offset:2px;
}

/* Responsive header */
@media (max-width:1024px){ .gdv-logo-img img{ width:120px; } }
@media (max-width:640px){
  .gdv-logo-img img{ width:110px; }
  .gdv-header-wrap{ padding:6px 12px; }
}

/* =========================
   HERO
   ========================= */
.gdv-hero{
  min-height:460px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}

/* Box del titolo hero (trasparente + blur tipo "vetro") */
.gdv-hero-box{
  background:rgba(255,255,255,.86);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  padding:22px 28px;
  border-radius:12px;
  box-shadow:0 4px 14px rgba(0,0,0,.14);
  max-width:980px;
  display:inline-block;
}

/* Sottotitolo hero – riga "2031 · Verso il Millenario" in rosso tema */
.gdv-subtitle .label{
  color: var(--wp--preset--color--rosso-vivo, #e73143);
  font-weight: 800;
}

/* =========================
   COUNTDOWN – layout orizzontale robusto
   ========================= */
#gdv-countdown{
  display:flex !important;
  align-items:baseline !important;
  justify-content:center !important;
  gap:.8rem !important;
  flex-wrap:wrap;
  margin-top:.8em;
  letter-spacing:.02em;
}

/* nasconde eventuali <br> generati dallo shortcode */
#gdv-countdown br{ display:none !important; }

/* Qualunque wrapper interno (div, p, span, li, strong, em…) diventa inline-flex */
#gdv-countdown > *{
  display:inline-flex !important;
  align-items:baseline !important;
  gap:.25rem;
  margin:0 !important; padding:0 !important;
  white-space:nowrap !important;
}
#gdv-countdown *{
  margin:0 !important; padding:0 !important;
}

/* Se il plugin usa <ul><li> o <p> per ogni valore, rendili orizzontali */
#gdv-countdown ul{ display:flex !important; gap:.8rem !important; margin:0 !important; padding:0 !important; }
#gdv-countdown li{ list-style:none !important; display:inline-flex !important; align-items:baseline !important; gap:.25rem; white-space:nowrap !important; }
#gdv-countdown p{ display:inline-flex !important; align-items:baseline !important; white-space:nowrap !important; }

/* Stile valori/etichette coerente con il tema */
#gdv-countdown .num,
#gdv-countdown .values{
  font-variant-numeric:tabular-nums;
  font-weight:800;
  font-size:clamp(18px,2.2vw,22px);
  color:var(--wp--preset--color--ink,#222);
}
#gdv-countdown .lab,
#gdv-countdown .label{
  opacity:.85;
  font-weight:700;
  font-size:clamp(11px,1.2vw,13px);
  color:var(--wp--preset--color--rosso,#ad3835);
}

/* Se il separatore è stampato su una riga propria, comprimilo */
#gdv-countdown .sep{
  display:inline !important;
  opacity:.45;
  margin:0 .2rem !important;
}

/* =========================
   BREADCRUMB
   ========================= */
.gdv-breadcrumb-nav{
  background:#fff;
  border-bottom:1px solid rgba(0,0,0,.06);
  padding:10px 0;
  font-size:14px;
}
.gdv-breadcrumb-list{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  max-width:1200px;
  margin:0 auto;
  padding:0 18px;
}
.gdv-breadcrumb-item{
  display:inline;
  margin:0;
  padding:0;
}
.gdv-breadcrumb-item a{
  color:#555;
  text-decoration:none;
  border-bottom:1px dotted #bbb;
  transition:color .2s ease, border-color .2s ease;
}
.gdv-breadcrumb-item a:hover{
  color:var(--wp--preset--color--rosso-vivo,#e73143);
  border-bottom-color:var(--wp--preset--color--rosso-vivo,#e73143);
}
.gdv-breadcrumb-current{
  color:#222;
  font-weight:600;
}
.gdv-breadcrumb-sep{
  color:#999;
  opacity:.6;
  margin:0;
  user-select:none;
}
@media (max-width:640px){
  .gdv-breadcrumb-nav{ font-size:13px; padding:8px 0; }
  .gdv-breadcrumb-list{ gap:6px; }
}

/* =========================
   CARD BASE + KILL BORDER WORDPRESS
   ========================= */

/* KILL tutti i bordi generati da WordPress */
.gdv-card,
.gdv-card.wp-block-group,
.wp-block-group.gdv-card {
  border: 1px solid var(--wp--preset--color--line, #e8e1d8) !important;
  box-shadow: none !important;
}

.gdv-card{
  position:relative; 
  overflow:hidden; 
  background:#fff !important;
  border:1px solid var(--wp--preset--color--line, #e8e1d8) !important;
  border-radius:14px !important; 
  padding:18px !important;
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.gdv-card:hover{ 
  transform:translateY(-2px); 
  box-shadow:0 6px 20px rgba(0,0,0,.06) !important; 
  border-color:#e4ded4 !important; 
}
.gdv-card:focus-within{ 
  outline:2px solid var(--wp--preset--color--rosso-vivo,#e73143); 
  outline-offset:2px; 
}

.gdv-micro{ font-size:13px; color:#777; margin-top:4px; }

/* =========================
   CARD COLORS - BARRA COLORATA SOLO IN ALTO
   CRITICAL: Specificità massima per sovrascrivere WordPress
   ========================= */

/* ROSSO - Per "Il Progetto" e post blog */
.gdv-card.gdv-accent-rosso::before,
.wp-block-group.gdv-card.gdv-accent-rosso::before,
.gdv-accent-rosso.gdv-card::before{
  content:"" !important; 
  position:absolute !important; 
  left:0 !important; 
  top:0 !important; 
  width:100% !important; 
  height:4px !important;
  background:#ad3835 !important;
  border-radius:14px 14px 0 0 !important;
  z-index:10 !important;
}

/* TERRA - Per "Guglielmo da Volpiano" */
.gdv-card.gdv-accent-terra::before,
.wp-block-group.gdv-card.gdv-accent-terra::before,
.gdv-accent-terra.gdv-card::before{
  content:"" !important; 
  position:absolute !important; 
  left:0 !important; 
  top:0 !important; 
  width:100% !important; 
  height:4px !important;
  background:#b86023 !important;
  border-radius:14px 14px 0 0 !important;
  z-index:10 !important;
}

/* ARANCIO - Per Eventi */
.gdv-card.gdv-accent-arancio::before,
.wp-block-group.gdv-card.gdv-accent-arancio::before,
.gdv-accent-arancio.gdv-card::before{
  content:"" !important; 
  position:absolute !important; 
  left:0 !important; 
  top:0 !important; 
  width:100% !important; 
  height:4px !important;
  background:#ef7d0f !important;
  border-radius:14px 14px 0 0 !important;
  z-index:10 !important;
}

/* BLU - Per Rassegna Stampa - SOLO BARRA IN ALTO */
.gdv-card.gdv-accent-blu::before,
.wp-block-group.gdv-card.gdv-accent-blu::before,
.gdv-accent-blu.gdv-card::before{
  content:"" !important; 
  position:absolute !important; 
  left:0 !important; 
  top:0 !important; 
  width:100% !important; 
  height:4px !important;
  background:#2563eb !important;
  border-radius:14px 14px 0 0 !important;
  z-index:10 !important;
}

/* STILI EXTRA PER RASSEGNA STAMPA - NO border-left */
.gdv-card.gdv-accent-blu,
.wp-block-group.gdv-card.gdv-accent-blu{
  border: 1px solid var(--wp--preset--color--line, #e8e1d8) !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08) !important;
}

.gdv-card.gdv-accent-blu:hover,
.wp-block-group.gdv-card.gdv-accent-blu:hover{
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12) !important;
}

.gdv-card.gdv-accent-blu h3 a,
.gdv-accent-blu.gdv-card h3 a{
  color: #1e40af !important;
}

.gdv-card.gdv-accent-blu h3 a:hover,
.gdv-accent-blu.gdv-card h3 a:hover{
  color: #2563eb !important;
}

/* =========================
   FOOTER
   ========================= */
.gdv-footer{ background:#fff; }
.gdv-footer-wrap{ max-width:1200px; margin:0 auto; padding:10px 12px; }
.gdv-footer-row{ display:flex; justify-content:center; align-items:center; gap:12px; flex-wrap:wrap; margin:10px 0; }
.gdv-footer-note{ opacity:.85; font-size:13px; }

/* Loghi partner nel footer: altezza uniforme e riga fluida */
.gdv-footer-logos{
  display:flex; flex-wrap:wrap; gap:16px; align-items:center; justify-content:center;
}
.gdv-footer-logos img{
  height:46px; width:auto; display:block; object-fit:contain;
}
@media (max-width:640px){
  .gdv-footer-logos img{ height:40px; }
}

.gdv-legal{ opacity:.9; font-size:12px; text-align:center; }
.gdv-legal a{ color:inherit; text-decoration:none; border-bottom:1px dotted #999; }
.gdv-legal a:hover{ color:var(--wp--preset--color--rosso-vivo,#e73143); border-bottom-color:var(--wp--preset--color--rosso-vivo,#e73143); }

.gdv-sep{ border:0; border-top:1px solid var(--wp--preset--color--line,#e8e1d8); margin:10px 0; }

/* =========================
   LINK / FOCUS GLOBALI
   ========================= */
a{ text-decoration:none; border-bottom:2px solid transparent; text-underline-offset:4px; transition:color .2s; }
a:hover{ color:var(--wp--preset--color--rosso-vivo,#e73143); border-bottom-color:var(--wp--preset--color--rosso-vivo,#e73143); }

a:focus, button:focus, input:focus, textarea:focus{
  outline:2px dashed var(--wp--preset--color--rosso-vivo,#e73143); outline-offset:3px;
}

/* =========================
   KILL BORDERS dai blocchi FSE - AGGRESSIVO
   ========================= */
:where(.wp-site-blocks) :where(
  .wp-block-group:not(.gdv-card), 
  .wp-block-columns, 
  .wp-block-column,
  .wp-block-cover, 
  .wp-block-query .wp-block-group:not(.gdv-card),
  .wp-block-post-template > li
){
  border:0 !important; 
  box-shadow:none !important; 
  outline:0 !important;
}

/* Mantieni il bordo dell'header */
.gdv-header{ border-bottom:1px solid rgba(0,0,0,.06) !important; }

/* Safety: la cover non deve sovrapporsi all'header */
.wp-block-cover{ position:relative; z-index:1; }

/* Fix hero box: sempre centrato */
.gdv-hero .wp-block-cover__inner-container{
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100%;
}

.gdv-hero-box{
  margin: 0 auto !important;
  text-align: center;
}

/* =========================
   FIX GRIGLIA 2 COLONNE
   ========================= */

/* Forza griglia 2 colonne per eventi */
.wp-block-query .wp-block-post-template {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: var(--wp--preset--spacing--m, 24px) !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Ogni card evento occupa 1 colonna */
.wp-block-query .wp-block-post-template > li {
  width: 100% !important;
  margin: 0 !important;
}

/* Forza colonne 50/50 per "Ultime novità" */
.wp-block-columns {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: var(--wp--preset--spacing--m, 24px) !important;
}

.wp-block-column {
  width: 100% !important;
  margin: 0 !important;
  flex-basis: auto !important;
}

/* Card con altezza uniforme */
.gdv-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Estratto prende lo spazio rimanente */
.wp-block-post-excerpt {
  margin-top: auto;
}

/* Immagini in evidenza: ratio uniforme */
.wp-block-post-featured-image {
  aspect-ratio: 16/9;
  overflow: hidden;
}

.wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =========================
   RESPONSIVE
   ========================= */

/* Mobile: stack verticale */
@media (max-width: 768px) {
  .wp-block-query .wp-block-post-template {
    grid-template-columns: 1fr !important;
  }
  
  .wp-block-columns {
    grid-template-columns: 1fr !important;
  }
}

/* Tablet: gap ridotto */
@media (min-width: 769px) and (max-width: 1024px) {
  .wp-block-query .wp-block-post-template {
    gap: 20px !important;
  }
  
  .wp-block-columns {
    gap: 20px !important;
  }
}