/* ── Variables de tema ─────────────────────────────────────────────────── */
:root {
  --bg:        #ffffff;
  --text:      #1a1a1a;
  --text-muted:#4a4a4a;
  --separator: rgba(0,0,0,0.1);
  --divider:   rgba(0,0,0,0.35);
  --glyph:     rgba(0,0,0,0.28);
}
html.dark {
  --bg:        #141414;
  --text:      #e0e0dc;
  --text-muted:#909088;
  --separator: rgba(255,255,255,0.08);
  --divider:   rgba(255,255,255,0.3);
  --glyph:     rgba(255,255,255,0.22);
}

/* ── Base ──────────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
body {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.3s, color 0.3s;
}
h1, h2, h3 { font-family: 'Russo One', sans-serif; }

/* ── Accesibilidade: foco visible ──────────────────────────────────────── */
:focus-visible {
  outline: 2px solid #4a9eff;
  outline-offset: 3px;
  border-radius: 2px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.focus\:not-sr-only:focus {
  position: fixed; width: auto; height: auto;
  padding: 0.5rem 1rem; margin: 0; overflow: visible;
  clip: auto; white-space: normal;
}

/* ── Swiper / Hero ─────────────────────────────────────────────────────── */
.hero-swiper { width: 100% !important; height: 100% !important; position: absolute !important; inset: 0; }
.hero-swiper .swiper-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hero-title {
  font-family: 'Russo One', sans-serif;
  font-size: clamp(2.4rem, 7vw, 5.5rem);
  letter-spacing: -0.01em;
  line-height: 1.0;
  text-transform: uppercase;
}
.hero-subtitle {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.75;
}

/* ── Navbar ────────────────────────────────────────────────────────────── */
.nav-name {
  font-family: 'Russo One', sans-serif;
  letter-spacing: 0.1em;
  font-size: 1.1rem;
  text-transform: uppercase;
}
.nav-link {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  letter-spacing: 0.1em;
  font-size: 1rem;
  text-transform: uppercase;
}

/* ── Toggle día/noite ──────────────────────────────────────────────────── */
.theme-toggle {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 3px 10px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  background: none;
  user-select: none;
}
.theme-toggle:hover { color: #fff; border-color: rgba(255,255,255,0.5); }

/* ── Marcador de entrada (antes da primeira sección) ───────────────────── */
.section-open {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 4rem 1.5rem 2rem;
  overflow: hidden;
}
.section-open .long-line {
  flex: 1;
  max-width: 180px;
  height: 2px;
  background: var(--text);
  opacity: 0.55;
}
.section-open .diamonds {
  font-size: 0.75rem;
  color: var(--text);
  opacity: 0.6;
  letter-spacing: 0.5em;
  margin-right: -0.5em; /* compensa o espazo extra do letter-spacing no último carácter */
}

/* ── Separador entre seccións (reticle) ────────────────────────────────── */
.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 1.25rem;
}
.section-divider .line {
  width: 80px;
  height: 1px;
  background: var(--divider);
  opacity: 0.8;
}
.section-divider .mark {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--divider);
  opacity: 0.85;
}
.section-divider .reticle {
  width: 14px;
  height: 14px;
  border: 1px solid var(--divider);
  border-radius: 50%;
  position: relative;
}
.section-divider .reticle::before,
.section-divider .reticle::after {
  content: '';
  position: absolute;
  background: var(--divider);
}
.section-divider .reticle::before {
  width: 1px; height: 6px;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
}
.section-divider .reticle::after {
  height: 1px; width: 6px;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
}
.section-divider .tick {
  font-size: 0.55rem;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--divider);
  opacity: 0.85;
}

/* ── Cabeceiras de sección ─────────────────────────────────────────────── */
.section-coord {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  display: block;
}
.section-title {
  font-family: 'Russo One', sans-serif;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

/* ── Contido de sección (prose) ────────────────────────────────────────── */
.prose p,
.prose li {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 1.05rem;
  line-height: 1.7;
}
.prose p {
  margin-bottom: 0.15rem;
  opacity: 0.82;
}
.prose strong {
  font-weight: 500;
  color: var(--text);
}
#gl313 .prose p,
.prose--intro p {
  font-size: 1.18rem !important;
  line-height: 1.65 !important;
  opacity: 0.88;
}
.prose--intro {
  padding: 0;
  text-align: justify;
}
.brand-name {
  font-family: 'Russo One', sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 1em;
}
.prose ul {
  list-style: none;
  padding: 0;
  margin: 0.65rem 0 0 0;
  border-top: 1px solid var(--separator);
}
.prose ul li {
  position: relative;
  padding: 0.32rem 0 0.32rem 1.6rem;
  opacity: 0.82;
}
.prose ul li::before {
  content: '›';
  position: absolute;
  left: 0.2rem;
  top: 0.32rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  color: var(--glyph);
  line-height: 1.65;
}

/* ── Leaflet map ── */
.leaflet-container {
  font-family: 'Space Grotesk', sans-serif;
  background: #f5f5f5;
}
.map-popup .leaflet-popup-content-wrapper {
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  padding: 0;
  border: 1px solid #ddd;
}
.map-popup .leaflet-popup-content {
  margin: 10px 14px;
}
.map-popup .leaflet-popup-tip {
  background: #fff;
}

/* ── Leaflet: baixar z-index dos controis por debaixo do nav (1000) ─────── */
.leaflet-top,
.leaflet-bottom { z-index: 400 !important; }

/* ── Botón volver arriba ───────────────────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 1.5rem;
  z-index: 999;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  background: #0f0f0f;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 6px 12px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, color 0.2s, border-color 0.2s;
  user-select: none;
}
.back-to-top--visible {
  opacity: 1;
  pointer-events: auto;
}
.back-to-top:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}
