/*
Theme Name:   Scuola Santa Bakhita — Astra Child
Theme URI:    https://www.santabakhita.it/
Description:  Child theme di Astra per la Scuola Primaria e Secondaria "Santa Bakhita" (Arzignano). Ricostruzione modernizzata da YOOtheme (palette blu navy, font Poppins/Open Sans). Parte del progetto di standardizzazione del parco siti su Astra.
Author:       Emanuele Zamboni / valuenet
Template:     astra
Version:      1.2.3
Text Domain:  scuolasantabakhita-astra
*/

/* =========================================================
   1. TOKENS
   ========================================================= */
:root{
  --sb-navy:   #11528a;   /* blu brand (reale dal legacy): titoli, menu, fascia-titolo */
  --sb-blue:   #11528a;   /* link, accenti */
  --sb-blue2:  #0d3f6c;   /* hover scuro */
  --sb-footer: #1a537e;   /* sfondo footer (reale dal legacy) */
  --sb-red:    #9f252a;   /* bottone Registro Elettronico */
  --sb-text:   #1d1f24;
  --sb-muted:  #5c6570;
  --sb-line:   #e4e7ec;
  --sb-soft:   #f3f6fa;
}

/* =========================================================
   2. BASE
   ========================================================= */
body,.ast-container,button,input,select,textarea{
  font-family:"Open Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  color:var(--sb-text);font-size:17px;line-height:1.7;}
h1,h2,h3,h4,h5,h6,.entry-title{font-family:"Poppins","Open Sans",sans-serif;color:var(--sb-navy);font-weight:600;line-height:1.28;}
h1,.entry-title{font-size:38px;} h2{font-size:28px;} h3{font-size:22px;} h4{font-size:19px;}
/* heading di contenuto: colore brand (il default Astra lo sovrascriveva) e misura come il legacy */
.entry-content h1,.entry-content h2,.entry-content h3,.entry-content h4,.entry-content h5,.entry-content h6,
.sb-rich h1,.sb-rich h2,.sb-rich h3,.sb-rich h4,.sb-rich h5,.sb-rich h6{color:var(--sb-navy)!important;}
.entry-content h2,.sb-rich h2{font-size:36px!important;}
/* mobile: h2 ridotti da 36px a 32px */
@media (max-width:782px){ h2,.entry-content h2,.sb-rich h2{font-size:32px!important;} }
a{color:var(--sb-blue);text-decoration:none;}
a:hover,a:focus{color:var(--sb-blue2);}
.sb-rich a,.entry-content a{color:var(--sb-blue);}
.sb-rich a:hover,.entry-content a:hover{color:var(--sb-blue2);}
/* link di contenuto senza sottolineatura (come il legacy) */
.entry-content a:not(.wp-block-button__link),.sb-rich a{text-decoration:none!important;}
img{height:auto;}

/* =========================================================
   3. HEADER / MENU
   ========================================================= */
.site-header,.ast-primary-header-bar{background:#fff;}
.custom-logo,.ast-site-identity .custom-logo{max-height:92px!important;width:auto!important;max-width:330px!important;}
.ast-primary-header-bar{min-height:112px!important;}
.site-title{display:none!important;}
.main-header-menu .menu-link,.main-navigation a{
  font-family:"Poppins","Open Sans",sans-serif;font-weight:600!important;text-transform:uppercase!important;
  letter-spacing:.02em;font-size:14px!important;color:var(--sb-navy)!important;}
.main-header-menu .menu-link:hover,
.main-header-menu .current-menu-item>.menu-link,
.main-header-menu .current-menu-ancestor>.menu-link{color:var(--sb-blue)!important;}
.main-header-menu .current-menu-item>.menu-link{box-shadow:inset 0 -3px 0 0 var(--sb-blue);}

/* --- Sottomenu (tendine) desktop: sfondo BIANCO, testo BLU, hover tinta chiara --- */
.main-header-menu .sub-menu,
.ast-desktop .main-header-menu .sub-menu{background:#ffffff!important;border:1px solid var(--sb-line)!important;box-shadow:0 8px 22px rgba(0,0,0,.10)!important;}
.main-header-menu .sub-menu .menu-link{color:var(--sb-blue)!important;text-transform:none!important;font-weight:500!important;}
.main-header-menu .sub-menu .menu-item .menu-link:hover,
.main-header-menu .sub-menu .menu-item:hover>.menu-link,
.main-header-menu .sub-menu .current-menu-item>.menu-link{color:var(--sb-navy)!important;background-color:var(--sb-soft)!important;}

/* --- Menu mobile (off-canvas): hamburger visibile, link navy, sottomenu bianco+blu --- */
.ast-mobile-svg,.ast-button-wrap .ast-mobile-svg{fill:var(--sb-navy)!important;}
.ast-mobile-popup-drawer .menu-link,
#ast-mobile-header .menu-link{color:var(--sb-navy)!important;}
.ast-mobile-popup-drawer .sub-menu,
#ast-mobile-header .sub-menu{background:#ffffff!important;}
.ast-mobile-popup-drawer .sub-menu .menu-link,
#ast-mobile-header .sub-menu .menu-link{color:var(--sb-blue)!important;}
@media (max-width:921px){
  .main-header-menu .menu-link,
  .main-header-menu .current-menu-item>.menu-link{color:var(--sb-navy)!important;}
  .main-header-menu .sub-menu{background:#ffffff!important;}
  .main-header-menu .sub-menu .menu-link{color:var(--sb-blue)!important;}
  .main-header-menu .sub-menu .menu-link:hover,
  .main-header-menu .sub-menu .menu-item:hover>.menu-link{color:var(--sb-navy)!important;background-color:var(--sb-soft)!important;}
}

/* =========================================================
   4. CONTENUTO PAGINA
   ========================================================= */
.sb-page-body{padding-top:28px;padding-bottom:48px;}
.sb-page-body .sb-rich{margin:0 0 14px;}
.sb-rich h2,.sb-rich h3,.sb-rich h4{margin:18px 0 10px;}
.sb-rich p{margin:0 0 12px;}
.sb-rich ul,.sb-rich ol{margin:0 0 12px 1.2em;}
.entry-content .wp-block-image{margin:14px 0;}
.wp-block-columns{gap:28px!important;}
/* un titolo di sezione (h2) o un separatore chiude le immagini flottate:
   il blocco successivo (es. "Open Day 2025") va SOTTO, non affiancato */
.sb-rich h2,.entry-content .wp-block-separator,.sb-rich hr{clear:both;}
/* separatori orizzontali larghi come il corpo vincolato (non la linea corta di default) */
.entry-content .wp-block-separator,.sb-rich hr{
  width:100%!important;max-width:1200px!important;
  margin-left:auto!important;margin-right:auto!important;
  border:0!important;border-top:1px solid var(--sb-line)!important;height:0!important;background:none!important;}

/* Fascia-titolo (hero) delle pagine interne */
.sb-page-hero{padding:34px 20px!important;margin-bottom:0!important;background-color:var(--sb-navy)!important;}
.sb-page-hero h1{color:#fff!important;margin:0;font-size:34px;}

/* Contatori homepage: come il legacy (testo normale 17px nero, centrato sotto l'icona) */
.NumberColor{color:#111111;font-weight:400;font-size:17px;}
.TextColor{color:#111111;font-weight:400;font-size:17px;}
/* centra le colonne dei contatori sotto le icone */
body.home .wp-block-columns .wp-block-column{text-align:center;}
body.home .wp-block-columns .wp-block-column .wp-block-image{text-align:center;}

/* Tabelle (orari, monte ore) */
.sb-rich table,.entry-content table{width:100%;border-collapse:collapse;margin:14px 0;}
.sb-rich table td,.sb-rich table th,.entry-content table td,.entry-content table th{
  border:1px solid var(--sb-line);padding:8px 12px;}
.sb-rich table tr:nth-child(odd) td{background:var(--sb-soft);}

/* iframe mappe/video responsive */
.sb-rich iframe,.entry-content iframe{max-width:100%;}

/* Slider Smart Slider 3 (home): slide "fit" allineate in alto, sotto l'header */
.n2-ss-slide-background-image img,
.n2-ss-slide-background img{object-position:center top!important;}
/* Home + pagine: contenuto a filo con l'header (azzero la spaziatura standard di Astra) */
body.home .content-area,body.page .content-area{margin-top:0!important;}
/* Pagine interne: foto hero a tutta larghezza (full-bleed centrato), a filo con l'header */
.sb-page-hero-img{line-height:0;width:100vw;max-width:100vw;
  margin-top:0!important;margin-bottom:0!important;
  margin-left:calc(50% - 50vw)!important;margin-right:calc(50% - 50vw)!important;}
/* hero = banner WIDE come il legacy (cover 2.64:1, ritaglio centrato, a filo con l'header) */
.sb-page-hero-img img{display:block;width:100%;aspect-ratio:2.64/1;height:auto;object-fit:cover;object-position:center;}
@media (max-width:782px){ .sb-page-hero-img img{aspect-ratio:2/1;} }

/* Contatti: mappa Leaflet WIDE (full-bleed) e a filo col footer, senza margini */
.leaflet-map,.sb-rich .leaflet-map,.leaflet-container{
  width:100vw!important;max-width:100vw!important;
  margin-left:calc(50% - 50vw)!important;margin-right:calc(50% - 50vw)!important;margin-bottom:0!important;}
body:has(.leaflet-map) .content-area{margin-bottom:0!important;}
body:has(.leaflet-map) .sb-page-body{padding-bottom:0!important;}
body:has(.leaflet-map) .sb-page-body .sb-rich:last-child{margin-bottom:0!important;}
body:has(.leaflet-map) .sb-page-body .sb-rich:last-child > *:last-child{margin-bottom:0!important;}

/* =========================================================
   5. BOTTONI
   ========================================================= */
.wp-block-button__link,.ast-button,.ast-custom-button{
  background:var(--sb-blue)!important;color:#fff!important;border-radius:4px!important;
  font-family:"Poppins",sans-serif;font-weight:600;}
.wp-block-button__link:hover,.ast-button:hover{background:var(--sb-navy)!important;color:#fff!important;}

/* =========================================================
   6. SOCIAL NELL'HEADER
   ========================================================= */
.main-header-menu .sbk-social-item{display:inline-flex;align-items:center;}
.main-header-menu .sbk-social-item>a{display:inline-flex;align-items:center;justify-content:center;padding:0 7px!important;}
.main-header-menu .sbk-social-item svg{width:18px;height:18px;fill:var(--sb-navy);transition:fill .15s;}
.main-header-menu .sbk-social-item>a:hover svg{fill:var(--sb-blue);}
.main-header-menu .sbk-social-item>a{box-shadow:none!important;background:none!important;}

/* =========================================================
   7. FOOTER (fedele all'originale)
   ========================================================= */
/* nascondo il footer di default di Astra */
.site-footer,.ast-small-footer,.site-primary-footer-wrap,.site-below-footer-wrap{display:none!important;}

.sb-footer{background:var(--sb-footer);color:#eef2f8;padding:40px 20px 34px;}
.sb-footer-inner{max-width:1200px;margin:0 auto;}
.sb-footer a{color:#fff;}
.sb-footer a:hover{color:#cdd8ee;}

.sb-footer-top{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:24px;padding-bottom:26px;border-bottom:1px solid rgba(255,255,255,.18);}
.sb-foot-logo img{max-height:96px;width:auto;}
.sb-foot-cta{text-align:center;}
.sb-registro-btn{display:inline-block;background:var(--sb-red);color:#fff!important;font-family:"Poppins",sans-serif;font-weight:600;letter-spacing:.03em;text-transform:uppercase;font-size:14px;padding:14px 30px;border-radius:4px;}
.sb-registro-btn:hover{background:#82151c;color:#fff!important;}
.sb-foot-coop{text-align:right;}
.sb-coop-label{display:block;font-size:12px;color:#c4cfe4;margin-bottom:8px;}
.sb-foot-coop img{max-height:92px;width:auto;}

.sb-footer-bottom{display:grid;grid-template-columns:1fr 1fr;gap:24px;padding-top:24px;font-size:14px;line-height:1.7;}
.sb-foot-coopinfo{text-align:right;}
.sb-foot-social{margin-top:12px;display:flex;gap:12px;}
.sb-foot-social a{display:inline-flex;}
.sb-foot-social svg{width:24px;height:24px;fill:#fff;}
.sb-foot-social a:hover svg{fill:#cdd8ee;}

@media (max-width:782px){
  .sb-footer-top{grid-template-columns:1fr;text-align:center;gap:20px;}
  .sb-foot-coop{text-align:center;}
  .sb-footer-bottom{grid-template-columns:1fr;text-align:center;}
  .sb-foot-coopinfo{text-align:center;}
  .sb-foot-social{justify-content:center;}
  .main-header-menu .sbk-social-item{justify-content:center;}
}
