/* Shared site shell — navigation, hero banners, content sections and
   footer used by every page (index/sobre/zonas/equipa/contacto) plus
   atlas.html. style.css stays scoped to the interactive platform
   itself (map/panel/legend) and is loaded alongside this file only
   on atlas.html. */

:root {
  --ink: #1c2430;
  --muted: #5b6675;
  --border: #dde2e8;
  --accent: #2f6fb2;
  --accent-dark: #204d80;
  --surface: #ffffff;
  --surface-alt: #f4f6f8;
  --navy: #16202e;
  --navy-alt: #1f2c3d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.55;
}

a {
  color: var(--accent);
}

/* ---- Top navigation ---------------------------------------------- */

#site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--navy);
  color: #f4f6f8;
}

.site-nav {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.site-nav .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: #ffffff;
  text-decoration: none;
}

.site-nav .brand svg {
  flex-shrink: 0;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.site-nav a.nav-link {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 6px;
  color: #cdd6e0;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-nav a.nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.site-nav a.nav-link.active {
  background: var(--accent);
  color: #ffffff;
}

/* ---- Hero banner ---------------------------------------------------- */

.hero {
  padding: 64px 24px 56px;
  background:
    radial-gradient(circle at 15% 20%, rgba(47, 111, 178, 0.35), transparent 45%),
    radial-gradient(circle at 85% 0%, rgba(32, 77, 128, 0.4), transparent 40%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-alt) 100%);
  color: #ffffff;
  text-align: center;
}

.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: #9fb6d4;
  margin: 0 0 10px;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: 2.1rem;
  font-weight: 700;
}

.hero p.lead {
  max-width: 620px;
  margin: 0 auto;
  color: #dbe3ee;
  font-size: 1.02rem;
}

.hero .cta-row {
  margin-top: 26px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  box-shadow: 0 6px 16px rgba(47, 111, 178, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.page-hero {
  padding: 48px 24px 40px;
}

.page-hero h1 {
  font-size: 1.7rem;
}

/* ---- Content sections ------------------------------------------------ */

main.site-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}

section + section {
  margin-top: 56px;
}

.section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 8px;
}

section h2 {
  margin: 0 0 18px;
  font-size: 1.5rem;
}

section p {
  color: var(--muted);
  max-width: 760px;
}

/* An intro paragraph directly followed by a card grid should span the
   grid's full width, not the 760px reading-width cap above - otherwise
   it looks narrower than the wide grid right beneath it. */
section p:has(+ .card-grid) {
  max-width: none;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-top: 22px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.card h3 {
  margin: 10px 0 6px;
  font-size: 1.05rem;
}

.card p {
  margin: 0;
  font-size: 0.9rem;
}

.card .card-photo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.card .card-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(47, 111, 178, 0.12);
  color: var(--accent);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  margin-top: 10px;
}

.status-pill.ready {
  background: #e5f3ea;
  color: #1c7a3f;
}

.status-pill.pending {
  background: #fff6e5;
  color: #a1670f;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.callout {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  font-size: 0.9rem;
  color: var(--muted);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.stat {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
}

.stat .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.stat .label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}

/* ---- Contact info blocks ------------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
  margin-top: 26px;
}

.contact-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.contact-item .card-icon {
  flex-shrink: 0;
}

.contact-item h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: var(--accent-dark);
}

.contact-item p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink);
}

.contact-item a {
  color: var(--ink);
  text-decoration: underline;
}

/* ---- Funding acknowledgment band -------------------------------------- */

.funding-band {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
  padding: 28px 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.funding-band strong {
  color: var(--ink);
}

/* ---- Footer ------------------------------------------------------------ */

#site-footer {
  background: var(--navy);
  color: #b9c4d3;
}

.footer-grid {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}

.footer-grid h4 {
  color: #ffffff;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 14px;
}

.footer-grid .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  font-weight: 700;
  margin-bottom: 10px;
}

.footer-grid p {
  font-size: 0.85rem;
  margin: 0 0 8px;
  color: #b9c4d3;
}

.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-grid li {
  margin-bottom: 8px;
}

.footer-grid a {
  color: #b9c4d3;
  text-decoration: none;
  font-size: 0.85rem;
}

.footer-grid a:hover {
  color: #ffffff;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  padding: 16px 24px;
  font-size: 0.78rem;
  color: #7f8ea3;
}

/* ---- App shell (atlas.html only) -------------------------------------
   The interactive map needs the full remaining viewport height, so
   this page opts out of the normal scrolling content layout: body
   becomes a flex column (sticky nav + the platform's own banner, both
   sized to content, then main filling the rest, then a slim one-line
   footer) instead of the standard hero/multi-column footer used by
   every other page. A fixed height (not min-height) keeps the map's
   own container size stable after load - letting the page grow/scroll
   instead made the map's container resize post-init, which Leaflet
   doesn't track on its own and left blank/grey tiles until a zoom
   forced a recalculation. The side panel scrolls internally instead
   (see #panel in style.css). */

body.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Hidden on the Atlas page only, per the professor's direction
   (2026-10-15): until it's confirmed whether this team owns the whole
   site or just the Atlas screen, don't let the top nav imply either
   way. Nothing is removed - renderHeader()/mountSiteChrome() still run
   and every other page still shows the nav unchanged. */
body.app-shell #site-header {
  display: none;
}

body.app-shell #site-footer {
  flex-shrink: 0;
}

body.app-shell .footer-grid {
  display: none;
}

body.app-shell .footer-bottom {
  padding: 6px 24px;
}

@media (max-width: 640px) {
  .hero h1 {
    font-size: 1.6rem;
  }

  main.site-main {
    padding: 32px 16px 56px;
  }
}
