/* =========================================================
   IIS "S. Calvino - G.B. Amico" - Trapani
   Personalizzazioni sul Modello Scuole AGID (Bootstrap Italia)
   Colori istituzionali derivati dal logo:
     - Blu petrolio   #17455F  (primario)
     - Magenta        #96257F  (accento)
     - Arancio        #F2A007  (accento caldo)
   ========================================================= */

:root {
  --scuola-blu: #17455F;
  --scuola-blu-scuro: #0f3346;
  --scuola-magenta: #96257F;
  --scuola-arancio: #F2A007;
  --scuola-grigio: #f5f6f7;
}

/* Override primario Bootstrap Italia */
:root {
  --bs-primary: #17455F;
  --bs-primary-rgb: 23, 69, 95;
}

a { color: var(--scuola-blu); }
a:hover { color: var(--scuola-blu-scuro); }

.bg-primary,
.it-header-center-wrapper,
.it-header-slim-wrapper { background-color: var(--scuola-blu) !important; }

.btn-primary {
  background-color: var(--scuola-blu);
  border-color: var(--scuola-blu);
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--scuola-blu-scuro);
  border-color: var(--scuola-blu-scuro);
}
.btn-outline-primary {
  color: var(--scuola-blu);
  border-color: var(--scuola-blu);
}
.btn-outline-primary:hover {
  background-color: var(--scuola-blu);
  border-color: var(--scuola-blu);
}

.text-primary { color: var(--scuola-blu) !important; }

/* Barra di accento tricolore del logo */
.brand-accent-bar {
  height: 5px;
  width: 100%;
  background: linear-gradient(90deg,
    var(--scuola-arancio) 0%, var(--scuola-arancio) 33%,
    var(--scuola-magenta) 33%, var(--scuola-magenta) 66%,
    var(--scuola-blu) 66%, var(--scuola-blu) 100%);
}

/* Header */
.it-header-center-wrapper .it-brand-text h2,
.it-header-center-wrapper .it-brand-text h3 { color: #fff; }
.it-header-center-wrapper a { color: #fff; }
.it-brand-logo img { max-height: 62px; width: auto; }

.navbar .navbar-collapsable .nav-link.active,
.navbar .navbar-collapsable .nav-link:hover {
  border-bottom: 3px solid var(--scuola-arancio);
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--scuola-blu) 0%, var(--scuola-blu-scuro) 100%);
  color: #fff;
  padding: 4rem 0;
}
.hero h1 { color: #fff; font-weight: 700; }
.hero .lead { color: #e9eef1; }

/* Card notizie */
.card-news .categoryicon-top .category { color: var(--scuola-magenta); font-weight:600; }
.card-news .card-title a { color: var(--scuola-blu); }
.card-wrapper .card { height: 100%; }

/* Riquadri servizi rapidi */
.quick-service {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 1.5rem 1rem; border-radius: 8px; height: 100%;
  background: #fff; border: 1px solid #e3e4e6; transition: .2s;
  text-decoration: none; color: var(--scuola-blu);
}
.quick-service:hover { box-shadow: 0 6px 20px rgba(0,0,0,.08); transform: translateY(-3px); color: var(--scuola-blu-scuro); }
.quick-service .icon-circle {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--scuola-grigio); margin-bottom: .75rem;
}
.quick-service .icon { fill: var(--scuola-blu); }
.quick-service span.label { font-weight: 600; }

/* Sezioni */
.section { padding: 3.5rem 0; }
.section-title { position: relative; margin-bottom: 2rem; font-weight: 700; color: var(--scuola-blu); }
.section-title::after {
  content:""; display:block; width:60px; height:4px; margin-top:.6rem;
  background: var(--scuola-arancio); border-radius: 2px;
}

/* Footer */
.it-footer-main { background-color: var(--scuola-blu-scuro); }
.it-footer-main a, .it-footer-main h4, .it-footer-main p, .it-footer-main .link-list a { color:#fff !important; }
.it-footer-small-prints { background-color: #0b2634; }

/* Riquadro amministrazione trasparente */
.at-item { border-left: 4px solid var(--scuola-magenta); padding-left: 1rem; }

/* Badge indirizzo */
.badge-indirizzo { background: var(--scuola-magenta); color:#fff; }

/* Barra avvisi in evidenza */
.topbar-avvisi {
  background: var(--scuola-magenta); color:#fff; font-size:.9rem;
}
.topbar-avvisi .container { display:flex; align-items:center; gap:.75rem; padding:.4rem 12px; }
.topbar-avvisi .tag {
  background:#fff; color:var(--scuola-magenta); font-weight:700;
  padding:.1rem .5rem; border-radius:4px; text-transform:uppercase; font-size:.72rem; white-space:nowrap;
}
.topbar-avvisi a { color:#fff; text-decoration:underline; }

/* Sezione numeri */
.numbers { background: var(--scuola-blu); color:#fff; }
.numbers .num { font-size:2.4rem; font-weight:700; line-height:1; color: var(--scuola-arancio); }
.numbers .num-label { font-size:.95rem; color:#e9eef1; }

/* Card sede */
.sede-card { border-top:4px solid var(--scuola-arancio); height:100%; }
.sede-card .sede-tag { color:var(--scuola-magenta); font-weight:600; font-size:.8rem; text-transform:uppercase; }

/* Chip indirizzi */
.chip-area {
  display:inline-block; font-size:.72rem; font-weight:700; text-transform:uppercase;
  padding:.15rem .55rem; border-radius:4px; margin-bottom:.5rem;
}
.chip-tecnico { background:#e3edf2; color:var(--scuola-blu); }
.chip-professionale { background:#f6e6f1; color:var(--scuola-magenta); }

/* Hero: filigrana logo */
.hero { position:relative; overflow:hidden; }
.hero .hero-watermark {
  position:absolute; right:-40px; bottom:-40px; width:320px; opacity:.08; pointer-events:none;
}

/* Copertine notizie (icona su gradiente brand) */
.news-cover {
  height:150px; display:flex; align-items:center; justify-content:center;
  border-radius:6px 6px 0 0; position:relative; overflow:hidden;
}
.news-cover::after {
  content:""; position:absolute; right:-30px; top:-30px; width:120px; height:120px;
  border-radius:50%; background:rgba(255,255,255,.12);
}
.news-cover .icon { width:56px; height:56px; fill:#fff; position:relative; z-index:1; }
.cover-sport      { background:linear-gradient(135deg,#96257F,#17455F); }
.cover-orient     { background:linear-gradient(135deg,#F2A007,#96257F); }
.cover-didattica  { background:linear-gradient(135deg,#17455F,#0f3346); }
.cover-pnrr       { background:linear-gradient(135deg,#17455F,#96257F); }
.cover-form       { background:linear-gradient(135deg,#96257F,#F2A007); }
.cover-circolari  { background:linear-gradient(135deg,#0f3346,#17455F); }
.card-news .card { overflow:hidden; }

/* Icona tonda per gli indirizzi */
.ind-ico {
  width:52px; height:52px; border-radius:50%;
  display:flex; align-items:center; justify-content:center; margin-bottom:.75rem;
}
.ind-ico svg { width:28px; height:28px; }
.ind-ico-tec { background:#e3edf2; }
.ind-ico-tec svg { fill:var(--scuola-blu); }
.ind-ico-pro { background:#f6e6f1; }
.ind-ico-pro svg { fill:var(--scuola-magenta); }

/* Illustrazioni */
.hero-illustration { max-width:100%; height:auto; }
.hero-photo {
  width:100%; border-radius:12px; display:block;
  box-shadow:0 14px 34px rgba(0,0,0,.38);
  border:3px solid rgba(255,255,255,.9);
}
.banner-scuola { width:100%; height:auto; border-radius:10px; display:block; }
.sede-card .sede-ico svg { width:26px; height:26px; fill:var(--scuola-blu); }

/* Logo header su fondo blu: pastiglia bianca per leggibilità */
.it-brand-logo {
  background:#fff; padding:6px 10px; border-radius:8px;
  margin-right:16px;               /* spazio tra logo e nome */
}
.it-header-center-content-wrapper .it-brand-text { margin-left:2px; }

/* Menu a tendina "Accedi" */
.it-access-top-wrapper .dropdown-toggle { display:flex; align-items:center; gap:.4rem; }
.it-access-top-wrapper .dropdown-menu {
  min-width:260px; padding:.5rem 0; border:none; border-radius:8px;
  box-shadow:0 8px 26px rgba(0,0,0,.18); margin-top:.4rem;
}
.it-access-top-wrapper .dropdown-menu .menu-head {
  font-size:.72rem; text-transform:uppercase; letter-spacing:.04em;
  color:var(--scuola-magenta); font-weight:700; padding:.25rem 1rem .5rem;
}
.it-access-top-wrapper .dropdown-item {
  display:flex; align-items:center; gap:.7rem; padding:.55rem 1rem; color:var(--scuola-blu);
}
.it-access-top-wrapper .dropdown-item:hover { background:var(--scuola-grigio); }
.it-access-top-wrapper .dropdown-item .icon { width:22px; height:22px; fill:var(--scuola-blu); flex:0 0 auto; }
.it-access-top-wrapper .dropdown-item.spid { color:var(--scuola-magenta); font-weight:600; }
.it-access-top-wrapper .dropdown-item.spid .icon { fill:var(--scuola-magenta); }
.it-access-top-wrapper .dropdown-divider { margin:.4rem 0; }

/* Galleria */
.gallery-item {
  display:block; border:none; padding:0; background:none; width:100%;
  border-radius:8px; overflow:hidden; position:relative; cursor:pointer; line-height:0;
}
.gallery-item img { width:100%; aspect-ratio:3/2; object-fit:cover; display:block; transition:transform .3s; }
.gallery-item:hover img { transform:scale(1.05); }
.gallery-item .gallery-caption {
  position:absolute; left:0; right:0; bottom:0; padding:.6rem .8rem;
  background:linear-gradient(transparent, rgba(15,51,70,.85));
  color:#fff; font-weight:600; font-size:.9rem; text-align:left; line-height:1.2;
}
.lightbox {
  position:fixed; inset:0; background:rgba(11,38,52,.9); display:none;
  align-items:center; justify-content:center; z-index:1080; padding:24px;
}
.lightbox.open { display:flex; }
.lightbox img { max-width:90%; max-height:85vh; border-radius:8px; box-shadow:0 10px 40px rgba(0,0,0,.5); }
.lightbox .lb-close {
  position:absolute; top:18px; right:24px; color:#fff; background:none; border:none;
  font-size:2.2rem; line-height:1; cursor:pointer;
}

/* Utility */
.bg-grigio { background: var(--scuola-grigio); }
.min-h-page { min-height: 50vh; }
.breadcrumb-bar { background: var(--scuola-grigio); padding: .5rem 0; }
