*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root { --bg: #111111; --accent: #43C97E; --text: #d4d4d4; --muted: #666; --nav-height: 64px; }
html { scroll-behavior: smooth; height: 100%; }
body { min-height: 100vh; background: var(--bg); color: var(--text); font-family: 'JetBrains Mono', monospace; font-weight: 300; min-height: 100vh; overflow-x: hidden; }
body::before { content: ''; position: fixed; inset: 0; background-image: linear-gradient(rgba(255,255,255,0.012) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px); background-size: 60px 60px; pointer-events: none; z-index: 0; }
nav { position: fixed; top: 0; left: 0; right: 0; height: var(--nav-height); display: flex; align-items: center; justify-content: space-between; padding: 0 2.5rem; background: rgba(17,17,17,0.85); backdrop-filter: blur(12px); border-bottom: 1px solid #1e1e1e; z-index: 100; }
.nav-logo { font-size: 1rem; font-weight: 700; color: #fff; text-decoration: none; letter-spacing: -0.02em; transition: color .2s; }
.nav-logo:hover { color: var(--accent); }
.nav-sitemap li { list-style: none; }
.nav-sitemap { display: flex; gap: .15rem; list-style: none; flex-wrap: wrap; }
.nav-sitemap a { font-size: .78rem; color: var(--muted); text-decoration: none; padding: .35rem .7rem; border-radius: 6px; transition: color .2s, background .2s; }
.nav-sitemap a:hover { color: var(--accent); background: rgba(67,201,126,.07); }
.page { flex: 1; position: relative; z-index: 1; max-width: 860px; margin: 0 auto; padding: calc(var(--nav-height) + 3rem) 2.5rem 6rem; }
.section-label { font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #666; margin-bottom: 1.8rem; display: block; }
.section-divider { border: none; border-top: 1px solid #2e2e2e; margin: 3rem 0; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; color: #fff; letter-spacing: -.03em; margin-bottom: .5rem; line-height: 1.2;  }
.subtitle { font-size: .82rem; color: var(--muted); margin-bottom: 2rem;  }

/* MAP */
.map-wrap {  }
.map-frame-wrap { border-radius: 12px; overflow: hidden; border: 1px solid #1e2e22; width: 100%; height: 460px; position: relative; }
.map-frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }

/* ACCORDION */
.accordion { display: flex; flex-direction: column; gap: .4rem; }
.acc-item { border: 1px solid #1e1e1e; border-radius: 8px; overflow: hidden; }
.acc-header { width: 100%; background: #161616; border: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: .65rem 1rem; font-family: 'JetBrains Mono', monospace; font-size: .82rem; font-weight: 600; color: var(--text); transition: background .2s, color .2s; text-align: left; }
.acc-header:hover { background: #1c1c1c; color: var(--accent); }
.acc-header.open { color: var(--text); background: #161616; }
.acc-arrow { font-size: .6rem; color: var(--muted); transition: transform .25s; flex-shrink: 0; }
.acc-header.open .acc-arrow { transform: rotate(180deg); color: var(--muted); }
.acc-body { max-height: 0; overflow: hidden; transition: max-height .4s ease; background: #161616; }
.acc-body-inner { padding: .75rem 1rem 1rem; }

/* FREGUESIA GRID */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem; }
.freg-card {
  display: flex; flex-direction: row; align-items: center; gap: .6rem;
  padding: .6rem; height: 80px;
  background: #141414; border: 1px solid #1e1e1e; border-radius: 6px;
  transition: border-color .2s, background .2s;
}
.freg-card:hover { border-color: var(--accent); background: #0d1f10; }
.freg-card { text-decoration: none !important; }
.freg-coa-wrap { flex-shrink: 0; width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; }
.freg-coa { max-width: 64px; max-height: 64px; width: auto; height: auto; display: block; }
.freg-name { flex: 1; font-size: .7rem; color: var(--muted); text-align: left; line-height: 1.3; word-break: break-word; transition: color .2s; }
.freg-card:hover .freg-name { color: var(--accent); }

/* FLAG */
.flag-wrap { max-width: 100%; }
.flag-img { width: 100%; height: auto; display: block; border-radius: 6px; border: 1px solid #2a2a2a; }

/* WEATHER + TIME CARDS */
.info-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.info-card {
  flex: 1; min-width: 160px;
  background: #141414; border: 1px solid #1e1e1e; border-radius: 10px;
  padding: 1.1rem 1.3rem;
}
a.info-card-link {
  text-decoration: none; color: inherit;
  transition: border-color .2s, background .2s;
  cursor: pointer; display: block;
}
a.info-card-link:hover { border-color: var(--accent); background: #161616; }
.info-card-label { font-size: .6rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #444; display: block; margin-bottom: .6rem; }
.info-card-value { font-size: 1.4rem; font-weight: 700; color: #fff; margin-bottom: .4rem; }
.info-card-sub { font-size: .65rem; color: #444; margin-top: .5rem; }
.weather-main { display: flex; align-items: center; gap: .8rem; margin-bottom: .4rem; }
.weather-desc { font-size: .78rem; color: var(--muted); }
.temp-switch { display: flex; gap: .3rem; margin-top: .4rem; }
.temp-btn { font-family: 'JetBrains Mono', monospace; font-size: .65rem; padding: .2rem .5rem; border-radius: 5px; border: 1px solid #2a2a2a; background: transparent; color: var(--muted); cursor: pointer; transition: color .2s, border-color .2s, background .2s; }
.temp-btn.active { color: var(--accent); border-color: var(--accent); background: rgba(67,201,126,.07); }
.temp-btn:hover { color: var(--accent); border-color: var(--accent); }

/* COORDS */
.coords { font-size: .85rem; color: var(--muted); }
.coords span { color: #ccc; }

/* WHERE IN THE WORLD — pan+zoom viewer */
.location-viewer { display: flex; gap: .6rem; align-items: flex-start; }
.viewer-canvas {
  flex: 1; max-width: 860px; height: 340px;
  overflow: hidden; border-radius: 8px; border: 1px solid #2a2a2a;
  position: relative; background: #0e0e0e;
  cursor: default; user-select: none;
}
.location-img {
  width: 100%; height: 100%; object-fit: contain;
  display: block; transform-origin: center center;
  transition: none; will-change: transform;
}
.viewer-controls { display: flex; flex-direction: column; gap: .4rem; flex-shrink: 0; }
.zoom-btn {
  font-family: 'JetBrains Mono', monospace; font-size: .9rem; font-weight: 700;
  width: 32px; height: 32px; border-radius: 6px; border: 1px solid #2a2a2a;
  background: #141414; color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color .2s, border-color .2s, background .2s; user-select: none;
}
.zoom-btn:hover { color: var(--accent); border-color: var(--accent); background: rgba(67,201,126,.07); }
.zoom-btn-reset { font-size: .75rem; }

/* FUN FACTS */
.facts { display: flex; flex-direction: column; gap: .8rem; }
.facts li { list-style: none; font-size: .88rem; color: var(--text); line-height: 1.6; padding-left: 1.2rem; position: relative; }
.facts li::before { content: '-'; position: absolute; left: 0; color: var(--accent); }


footer a { font-size: .78rem; color: #666; text-decoration: none; transition: color .2s; }


@media (max-width: 860px) {
  nav { padding: 0 1.2rem; }
  .nav-links a { padding: .35rem .5rem; font-size: .75rem; }
  .page { flex: 1; padding-left: 1.2rem; padding-right: 1.2rem; }
  .map-frame-wrap { height: 320px; }
  .info-row { flex-direction: column; }
}

/* USEFUL LINKS */
.useful-links { display: flex; flex-direction: column; gap: .55rem; list-style: none; }
.useful-links li { padding-left: 1.2rem; position: relative; }
.useful-links li::before { content: '-'; position: absolute; left: 0; color: var(--accent); }
.useful-links a { font-size: .88rem; color: #666666; text-decoration: none; transition: color .2s; }
.useful-links a:hover { color: var(--accent); }

/* MUSIC PLAYER SLIDER */
#music-player-slider {
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: #2a2a2a;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

#music-player-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: background 0.2s;
}

#music-player-slider::-webkit-slider-thumb:hover {
  background: #5fd8a3;
}

#music-player-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}

#music-player-slider::-moz-range-thumb:hover {
  background: #5fd8a3;
}

#music-player-slider::-moz-range-track {
  background: transparent;
  border: none;
}

.nav-sitemap-active { color: var(--accent) !important; outline: 1px solid var(--accent); border-radius: 4px; padding: .2rem .5rem !important; }

.nav-sitemap a.active { color: var(--accent); outline: 1px solid var(--accent); border-radius: 4px; }
