/*
Theme Name: SIGENP Family
Theme URI:
Author:
Description: Tema istituzionale per la federazione SIGENP Family. Basato sul mockup Bootstrap 5.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sigenp-family
*/

/* ============================================================
   Brand variables
   ============================================================ */
:root {
  --brand-primary: #0076bc;
  --brand-dark:    #0d1b2a;
  --brand-accent:  #eaf2ff;

  /* Override Bootstrap primary with brand */
  --bs-primary:        var(--brand-primary);
  --bs-primary-rgb:    0, 118, 188;
  --bs-link-color:     var(--brand-primary);
  --bs-link-hover-color: #0064a0;
}

.btn-primary {
  --bs-btn-bg:                var(--brand-primary);
  --bs-btn-border-color:      var(--brand-primary);
  --bs-btn-hover-bg:          #0064a0;
  --bs-btn-hover-border-color:#0064a0;
  --bs-btn-active-bg:         #00528a;
  --bs-btn-active-border-color:#00528a;
  --bs-btn-disabled-bg:       var(--brand-primary);
  --bs-btn-disabled-border-color: var(--brand-primary);
}
.btn-outline-primary {
  --bs-btn-color:              var(--brand-primary);
  --bs-btn-border-color:       var(--brand-primary);
  --bs-btn-hover-bg:           var(--brand-primary);
  --bs-btn-hover-border-color: var(--brand-primary);
  --bs-btn-active-bg:          var(--brand-primary);
  --bs-btn-active-border-color:var(--brand-primary);
  --bs-btn-active-color:       #fff;
}

/* ============================================================
   Base
   ============================================================ */
body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1f2937;
}

.py-lg-6,
.py-6 {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

/* WordPress admin bar offset */
.admin-bar .site-header {
  top: 32px;
}
@media screen and (max-width: 782px) {
  .admin-bar .site-header {
    top: 46px;
  }
}

/* ============================================================
   Navigation
   ============================================================ */
.site-header .navbar {
  backdrop-filter: saturate(180%) blur(12px);
}

/* Custom logo */
.custom-logo {
  max-height: 80px;
  width: auto;
}

/* ============================================================
   Brand mark (fallback when no logo)
   ============================================================ */
.brand-mark {
  width: 3rem;
  height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--brand-primary), #5aa3ff);
  color: #fff;
  font-weight: 800;
  font-size: 1.4rem;
  box-shadow: 0 .75rem 1.5rem rgba(12, 95, 213, .22);
  flex-shrink: 0;
  text-decoration: none;
}

.brand-title {
  font-size: 1rem;
  line-height: 1.1;
  font-weight: 800;
}

/* ============================================================
   Hero
   ============================================================ */
.hero-section {
  background:
    radial-gradient(circle at top left, rgba(89, 164, 255, .18), transparent 30%),
    linear-gradient(135deg, #0d1b2a 0%, #132d4f 55%, #123f7d 100%);
  color: white;
}

.hero-card {
  border-radius: 1.75rem;
  overflow: hidden;
}

.hero-image {
  min-height: 28rem;
  object-fit: cover;
}

.hero-overlay-content {
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  padding: 1.5rem;
}

.mini-stat {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 1rem;
  padding: 1rem;
  text-align: center;
}

.mini-stat strong {
  display: block;
  font-size: 1.4rem;
}

.mini-stat span {
  color: rgba(255, 255, 255, .75);
  font-size: .9rem;
}

/* ============================================================
   Stats bar
   ============================================================ */
.stat-card,
.cta-panel,
.info-card,
.contact-card {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .06);
  border-radius: 1.5rem;
  padding: 1.5rem;
}

.stat-number {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  font-weight: 800;
  color: var(--brand-primary);
  margin-bottom: .5rem;
}

/* ============================================================
   Reusable components
   ============================================================ */
.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .78rem;
  font-weight: 700;
  color: var(--brand-primary);
  margin-bottom: .5rem;
}

.news-card,
.agenda-table,
.list-group {
  border-radius: 1.5rem;
}

.card-thumb,
.feature-image,
.portfolio-image,
.map-image {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  width: 100%;
}

.news-meta,
.portfolio-meta {
  display: inline-block;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--brand-primary);
  font-weight: 700;
}

.agenda-table th,
.agenda-table td {
  padding: 1rem 1.25rem;
}

/* ============================================================
   Portfolio / Associazioni listing
   ============================================================ */
.page-hero {
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
  border-bottom: 1px solid #e8eef6;
}

.portfolio-card {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 1.5rem;
  box-shadow: 0 1rem 2rem rgba(13, 27, 42, .06);
  height: 100%;
  transition: transform .2s ease, box-shadow .2s ease;
  overflow: hidden;
}

.portfolio-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 1.25rem 2.5rem rgba(13, 27, 42, .12);
}

.portfolio-desc {
  color: #5b6472;
  min-height: 2.75rem;
}

.breadcrumb-wrap {
  font-size: .95rem;
}
.breadcrumb-wrap a {
  text-decoration: none;
  color: var(--brand-primary);
}
.breadcrumb-wrap .breadcrumb_last {
  color: var(--bs-secondary-color);
}

/* ============================================================
   Association detail page
   ============================================================ */
.detail-hero-card {
  border-radius: 1.5rem;
  overflow: hidden;
}

.map-card {
  border-radius: 1.5rem;
  overflow: hidden;
}
#sigenp-map {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.fake-map {
  position: relative;
}

.map-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -85%);
  width: 26px;
  height: 26px;
  background: var(--brand-primary);
  border: 4px solid white;
  border-radius: 50%;
  box-shadow: 0 .5rem 1rem rgba(12, 95, 213, .35);
}

.map-pin::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 18px;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 18px solid var(--brand-primary);
}

.contact-card .btn,
.info-card .btn {
  width: 100%;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--brand-dark);
  color: #fff;
}

.footer-list li,
.footer-list a {
  color: rgba(255, 255, 255, .75);
  text-decoration: none;
  margin-bottom: .5rem;
}

.footer-list a:hover {
  color: #fff;
}

/* Footer nav generated by wp_nav_menu */
.footer-list .menu-item a {
  color: rgba(255, 255, 255, .75);
  text-decoration: none;
  display: block;
  margin-bottom: .5rem;
}

.footer-list .menu-item a:hover {
  color: #fff;
}

/* ============================================================
   Mappa Associazioni – Leaflet geografica
   ============================================================ */
.italy-map-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;            /* formato richiesto */
  max-height: 78vh;
  background: #f0f6fc;
  border: 1px solid #dbe6f2;
  border-radius: 1.5rem;
  overflow: hidden;
}

#italy-map-leaflet {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #f0f6fc;              /* niente tile di sfondo */
}

/* Poligoni regione: transizione morbida al cambio stile */
#italy-map-leaflet .leaflet-interactive {
  transition: fill .18s ease-out, stroke-width .18s ease-out, filter .18s ease-out;
  outline: none;
}
#italy-map-leaflet .leaflet-interactive:focus-visible {
  filter: drop-shadow(0 0 .25rem rgba(0, 118, 188, .6));
}

/* Il tooltip native di Leaflet stilizzato col brand */
.leaflet-tooltip.italy-map-tooltip {
  background: var(--brand-dark);
  color: #fff;
  border: 0;
  border-radius: .4rem;
  padding: .35rem .65rem;
  font-size: .85rem;
  font-weight: 600;
  box-shadow: 0 .5rem 1.25rem rgba(13, 27, 42, .18);
}
.leaflet-tooltip.italy-map-tooltip::before {
  display: none; /* rimuovi la freccina */
}

/* Overlay di caricamento centrato sulla mappa */
.italy-map-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(240, 246, 252, .8);
  z-index: 2;
  pointer-events: none;
}

/* ============================================================
   Archivio Regione – lista associazioni con mini mappa
   ============================================================ */
.assoc-row {
  border-radius: 1.5rem;
}

.assoc-mini-map,
.assoc-map-placeholder {
  min-height: 220px;
  height: 100%;
  width: 100%;
}

.assoc-mini-map {
  display: block;
}

.assoc-map-placeholder {
  min-height: 220px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 991.98px) {
  .hero-image {
    min-height: 20rem;
  }

  .assoc-mini-map,
  .assoc-map-placeholder {
    min-height: 200px;
    height: 200px;
  }
}
