:root {
  --pi-green-dark: #0b3b2b;
  --pi-green: #12543d;
  --pi-green-light: #1e7a5a;
  --pi-green-soft: #e8f3ee;
  --pi-gold: #c9932c;
  --pi-gold-light: #f7ecd5;
  --pi-stone-dark: #1c2421;
  --pi-stone: #4a5550;
  --pi-stone-light: #f4f5f3;
  --pi-border: #dce2de;
  --pi-white: #ffffff;
  --pi-danger: #c0392b;
  --pi-info: #1d6fa5;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 8px rgba(11, 59, 43, 0.06);
  --shadow-md: 0 8px 24px rgba(11, 59, 43, 0.10);
  --shadow-lg: 0 16px 40px rgba(11, 59, 43, 0.16);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--pi-stone-dark);
  background-color: var(--pi-stone-light);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .serif-title {
  font-family: 'Merriweather', Georgia, serif;
  line-height: 1.25;
  margin-top: 0;
  color: var(--pi-green-dark);
}

a {
  color: var(--pi-green);
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

a:hover {
  color: var(--pi-gold);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Top Notice Bar (Web Informativa No Oficial) */
.topbar {
  background: var(--pi-green-dark);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.8rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.topbar a {
  color: #ffe39f;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
}

.topbar a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.badge-pill {
  background: rgba(201, 147, 44, 0.22);
  color: #ffd984;
  border: 1px solid rgba(201, 147, 44, 0.45);
  padding: 0.14rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.74rem;
  white-space: nowrap;
}

/* Main Navigation Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--pi-border);
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
  gap: 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 2px 10px rgba(11, 59, 43, 0.18);
  border: 1px solid rgba(11, 59, 43, 0.12);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: 'Merriweather', Georgia, serif;
  font-weight: 800;
  font-size: 1.28rem;
  color: var(--pi-green-dark);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--pi-stone);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}

.nav-links a {
  padding: 0.48rem 0.72rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--pi-stone-dark);
  white-space: nowrap;
}

.nav-links a:hover, .nav-links a.active {
  background: var(--pi-green-soft);
  color: var(--pi-green-dark);
}

.nav-cta {
  background: var(--pi-green) !important;
  color: var(--pi-white) !important;
  padding: 0.48rem 0.9rem !important;
  border-radius: 999px !important;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.3rem;
}

.nav-cta:hover {
  background: var(--pi-green-dark) !important;
  transform: translateY(-1px);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--pi-border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--pi-green-dark);
  cursor: pointer;
}

/* Hero Section */
.hero {
  position: relative;
  min-height: 530px;
  display: flex;
  align-items: center;
  color: var(--pi-white);
  background: linear-gradient(135deg, rgba(8, 38, 27, 0.82) 0%, rgba(18, 84, 61, 0.60) 55%, rgba(12, 32, 24, 0.80) 100%),
              url('/wp-content/uploads/2023/12/cropped-VG_bac_nefol5-1.jpg') center/cover no-repeat;
  padding: 4.25rem 0 4.75rem;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.32fr 0.88fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
  color: #ffe39f;
}

.hero h1 {
  color: var(--pi-white);
  font-size: clamp(2.05rem, 4vw, 3.25rem);
  margin-bottom: 1rem;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}

.hero-lead {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.93);
  max-width: 650px;
  margin-bottom: 1.75rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.74rem 1.3rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--pi-gold);
  color: #161209;
  box-shadow: 0 4px 16px rgba(201, 147, 44, 0.38);
}

.btn-primary:hover {
  background: #deb041;
  color: #161209;
  transform: translateY(-2px);
}

.btn-outline-light {
  background: rgba(255, 255, 255, 0.14);
  color: var(--pi-white);
  border: 1px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(6px);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.26);
  color: var(--pi-white);
  transform: translateY(-2px);
}

.btn-green {
  background: var(--pi-green);
  color: var(--pi-white);
}

.btn-green:hover {
  background: var(--pi-green-dark);
  color: var(--pi-white);
  transform: translateY(-1px);
}

.btn-wikiloc {
  background: #4b8b1b;
  color: #ffffff;
}

.btn-wikiloc:hover {
  background: #3a6e13;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.44rem 0.88rem;
  font-size: 0.8rem;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  padding-top: 1.35rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffe39f;
}

.stat-label {
  font-size: 0.77rem;
  color: rgba(255, 255, 255, 0.85);
}

/* Hero Live Card */
.hero-live-card {
  background: rgba(14, 41, 31, 0.84);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow-lg);
}

.hero-live-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.live-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.25);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(46, 204, 113, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

.hero-weather-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.95rem;
}

.hero-wx-box {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 0.75rem;
}

.hero-wx-place {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
}

.hero-wx-temp {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin: 0.2rem 0;
}

.hero-wx-desc {
  font-size: 0.75rem;
  color: #ffe39f;
}

.hero-cam-preview {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: block;
}

.hero-cam-preview img {
  width: 100%;
  height: 155px;
  object-fit: cover;
}

.hero-cam-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.88));
  padding: 0.6rem 0.75rem 0.45rem;
  font-size: 0.76rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Sections */
.section {
  padding: 4.5rem 0;
}

.section-alt {
  background: var(--pi-white);
  border-top: 1px solid var(--pi-border);
  border-bottom: 1px solid var(--pi-border);
}

.section-dark {
  background: var(--pi-green-dark);
  color: var(--pi-white);
}

.section-dark h2, .section-dark h3, .section-dark h4 {
  color: var(--pi-white);
}

.section-header {
  max-width: 800px;
  margin-bottom: 2.5rem;
}

.section-kicker {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pi-green);
  background: var(--pi-green-soft);
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 0.65rem;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  margin-bottom: 0.75rem;
}

.section-subtitle {
  color: var(--pi-stone);
  font-size: 1.02rem;
  margin: 0;
}

/* Grid Helpers */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

/* Cards */
.card {
  background: var(--pi-white);
  border: 1px solid var(--pi-border);
  border-radius: var(--radius-lg);
  padding: 1.55rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card-img-top {
  margin: -1.55rem -1.55rem 1.2rem -1.55rem;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
  height: 205px;
  position: relative;
}

.card-img-top img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.card:hover .card-img-top img {
  transform: scale(1.04);
}

.card-tag {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  background: rgba(11, 59, 43, 0.90);
  color: #fff;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

/* Weather & Webcams Section */
.wx-card {
  background: var(--pi-white);
  border: 1px solid var(--pi-border);
  border-radius: var(--radius-lg);
  padding: 1.45rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.wx-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--pi-border);
  padding-bottom: 0.9rem;
  margin-bottom: 0.9rem;
}

.wx-temp-big {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 2.35rem;
  font-weight: 800;
  color: var(--pi-green-dark);
  line-height: 1;
}

.wx-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  background: var(--pi-stone-light);
  padding: 0.8rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.9rem;
  font-size: 0.82rem;
}

.wx-metric-item {
  display: flex;
  flex-direction: column;
}

.wx-metric-label {
  color: var(--pi-stone);
  font-size: 0.73rem;
}

.wx-metric-val {
  font-weight: 700;
  color: var(--pi-stone-dark);
}

.wx-forecast-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  text-align: center;
  margin-bottom: 0.85rem;
}

.wx-day {
  background: var(--pi-stone-light);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.2rem;
  font-size: 0.75rem;
}

.wx-day-name {
  font-weight: 700;
  color: var(--pi-green-dark);
  margin-bottom: 0.15rem;
}

.wx-day-temps {
  font-weight: 600;
  margin-top: 0.15rem;
}

.wx-day-min {
  color: var(--pi-stone);
  font-weight: 400;
}

.wx-source-footer {
  margin-top: auto;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--pi-border);
  font-size: 0.75rem;
  color: var(--pi-stone);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.webcam-box {
  background: var(--pi-stone-dark);
  color: var(--pi-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--pi-border);
}

.webcam-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.25rem;
  background: #111916;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.webcam-viewport {
  position: relative;
  background: #000;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.webcam-viewport img {
  width: 100%;
  max-height: 460px;
  object-fit: contain;
}

.webcam-footer {
  padding: 0.9rem 1.25rem;
  background: #151f1b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.83rem;
}

/* Interactive Map & Cadastre */
.map-layout {
  display: grid;
  grid-template-columns: 2.1fr 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

.map-wrapper {
  background: var(--pi-white);
  border: 1px solid var(--pi-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}

.map-controls-bar {
  padding: 0.85rem 1.15rem;
  background: var(--pi-stone-light);
  border-bottom: 1px solid var(--pi-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.map-layer-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.layer-btn {
  padding: 0.38rem 0.78rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--pi-border);
  background: var(--pi-white);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--pi-stone-dark);
  cursor: pointer;
  transition: all 0.15s ease;
}

.layer-btn:hover, .layer-btn.active {
  background: var(--pi-green);
  color: var(--pi-white);
  border-color: var(--pi-green);
}

#pi-map {
  width: 100%;
  height: 520px;
  z-index: 1;
}

.map-sidebar {
  background: var(--pi-white);
  border: 1px solid var(--pi-border);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  max-height: 585px;
}

.poi-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-right: 0.25rem;
  margin-top: 0.75rem;
}

.poi-item {
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--pi-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--pi-stone-light);
}

.poi-item:hover {
  border-color: var(--pi-green);
  background: var(--pi-green-soft);
}

.poi-item-title {
  font-weight: 700;
  font-size: 0.89rem;
  color: var(--pi-green-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
}

.poi-item-sub {
  font-size: 0.78rem;
  color: var(--pi-stone);
  margin-top: 0.15rem;
}

/* Street Directory (Nomenclàtor) */
.streets-box {
  margin-top: 2rem;
  background: var(--pi-white);
  border: 1px solid var(--pi-border);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  box-shadow: var(--shadow-sm);
}

.streets-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.street-search {
  padding: 0.6rem 1rem;
  border: 1px solid var(--pi-border);
  border-radius: 999px;
  min-width: 280px;
  font-size: 0.9rem;
  outline: none;
}

.street-search:focus {
  border-color: var(--pi-green);
  box-shadow: 0 0 0 3px rgba(18, 84, 61, 0.12);
}

.streets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 0.75rem;
}

.street-card {
  background: var(--pi-stone-light);
  border: 1px solid var(--pi-border);
  border-left: 4px solid var(--pi-green);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.95rem;
}

.street-name {
  font-weight: 700;
  color: var(--pi-green-dark);
  font-size: 0.92rem;
}

.street-desc {
  font-size: 0.8rem;
  color: var(--pi-stone);
  margin-top: 0.2rem;
}

/* EMD & Administration */
.emd-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.member-card {
  background: var(--pi-white);
  border: 1px solid var(--pi-border);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.member-card.president {
  border: 2px solid var(--pi-gold);
  background: linear-gradient(to bottom right, #ffffff, #fcf8ee);
}

.member-role {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--pi-green);
  margin-bottom: 0.25rem;
}

.member-card.president .member-role {
  color: #9e6f14;
}

.member-name {
  font-family: 'Merriweather', Georgia, serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--pi-stone-dark);
  margin-bottom: 0.35rem;
}

.member-party {
  font-size: 0.78rem;
  color: var(--pi-stone);
  background: var(--pi-stone-light);
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

.tramits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1rem;
}

.tramit-link-card {
  display: flex;
  align-items: flex-start;
  gap: 0.95rem;
  padding: 1.15rem;
  background: var(--pi-white);
  border: 1px solid var(--pi-border);
  border-radius: var(--radius-md);
  color: var(--pi-stone-dark);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.tramit-link-card:hover {
  border-color: var(--pi-green);
  background: var(--pi-green-soft);
  transform: translateY(-2px);
  color: var(--pi-green-dark);
}

.tramit-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--pi-green-soft);
  color: var(--pi-green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.tramit-link-card:hover .tramit-icon {
  background: var(--pi-green);
  color: var(--pi-white);
}

.tramit-title {
  font-weight: 700;
  font-size: 0.94rem;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.tramit-desc {
  font-size: 0.8rem;
  color: var(--pi-stone);
  margin: 0;
}

/* Routes Filter */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.filter-tab {
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--pi-border);
  background: var(--pi-white);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--pi-stone-dark);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-tab:hover, .filter-tab.active {
  background: var(--pi-green-dark);
  color: var(--pi-white);
  border-color: var(--pi-green-dark);
}

.route-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-familiar {
  background: #e3f6eb;
  color: #0e6b38;
}

.badge-mitja {
  background: #fef3d6;
  color: #946300;
}

.badge-superior {
  background: #fde2e0;
  color: #a32219;
}

.route-footer {
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px solid var(--pi-border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* Latin Quote / Historical Document Box */
.historical-quote {
  background: #fbf8f1;
  border: 1px solid #e5dcc8;
  border-left: 5px solid var(--pi-gold);
  border-radius: var(--radius-md);
  padding: 1.4rem 1.6rem;
  font-family: 'Merriweather', Georgia, serif;
  font-style: italic;
  color: #3a3222;
  font-size: 0.92rem;
  margin: 1.25rem 0;
}

/* Archive Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.15rem;
}

.gallery-item {
  background: var(--pi-white);
  border: 1px solid var(--pi-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.gallery-item img {
  width: 100%;
  height: 195px;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.gallery-caption {
  padding: 0.75rem 0.95rem;
  font-size: 0.82rem;
  color: var(--pi-stone-dark);
  font-weight: 600;
}

.gallery-caption span {
  display: block;
  font-size: 0.75rem;
  color: var(--pi-stone);
  font-weight: 400;
  margin-top: 0.15rem;
}

/* Suggestion Banner */
.suggestion-banner {
  background: linear-gradient(135deg, #0b3b2b 0%, #155c42 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 3rem;
  box-shadow: var(--shadow-md);
}

/* Footer */
.site-footer {
  background: #07281d;
  color: rgba(255, 255, 255, 0.82);
  padding: 4rem 0 2rem;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.site-footer h4 {
  color: #fff;
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.78);
}

.footer-links a:hover {
  color: #ffe39f;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.65);
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 20, 14, 0.92);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.lightbox-modal.open {
  display: flex;
}

.lightbox-content {
  max-width: 960px;
  max-height: 90vh;
  position: relative;
  text-align: center;
}

.lightbox-content img {
  max-height: 80vh;
  margin: 0 auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.lightbox-caption {
  color: #fff;
  margin-top: 0.85rem;
  font-size: 0.95rem;
}

.lightbox-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
}

/* 3D Relief Map Viewer (MapLibre GL JS) */
.map3d-card {
  background: var(--pi-white);
  border: 1px solid var(--pi-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 2.75rem;
}

.map3d-header {
  background: linear-gradient(135deg, #0b3b2b 0%, #14543e 100%);
  color: #fff;
  padding: 1.15rem 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.map3d-controls-bar {
  background: var(--pi-stone-light);
  border-bottom: 1px solid var(--pi-border);
  padding: 0.75rem 1.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.map3d-fly-btn {
  padding: 0.36rem 0.72rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--pi-border);
  background: var(--pi-white);
  color: var(--pi-stone-dark);
  cursor: pointer;
  transition: all 0.15s ease;
}

.map3d-fly-btn:hover,
.map3d-fly-btn.active {
  background: var(--pi-green);
  color: #fff;
  border-color: var(--pi-green);
}

#pi-map-3d {
  width: 100%;
  height: 560px;
  position: relative;
  background: #0d261d;
}

.map3d-hud {
  position: absolute;
  bottom: 14px;
  left: 14px;
  z-index: 10;
  background: rgba(11, 59, 43, 0.88);
  color: #fff;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  pointer-events: none;
  max-width: 360px;
}

.map3d-marker {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(11, 59, 43, 0.92);
  color: #fff;
  border: 1.5px solid #e6b85c;
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.73rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.38);
  transition: transform 0.15s ease, background 0.15s ease;
}

.map3d-marker:hover {
  transform: scale(1.08);
  background: #c88a2b;
  color: #fff;
}

.map3d-marker-alt {
  color: #ffe39f;
  font-weight: 600;
  font-size: 0.68rem;
}

.map3d-footer {
  background: var(--pi-stone-light);
  border-top: 1px solid var(--pi-border);
  padding: 0.75rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--pi-stone);
}

/* Responsive */
@media (max-width: 1120px) {
  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 74px;
    left: 0;
    right: 0;
    background: var(--pi-white);
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--pi-border);
    box-shadow: var(--shadow-md);
    gap: 0.35rem;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-cta {
    margin-left: 0;
    justify-content: center;
  }
  .hero-grid, .map-layout {
    grid-template-columns: 1fr;
  }
  .grid-3, .grid-4, .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4, .footer-grid, .hero-stats {
    grid-template-columns: 1fr;
  }
  .hero {
    padding: 3rem 0;
  }
  #pi-map, #pi-map-3d {
    height: 410px;
  }
}
