/* ============================================================
   GREAT Greenland ROV, Aquarius Project
   Styled to match the CRIS-UL site (cris-ul.github.io)
   ============================================================ */
:root {
  --brand:      #0083c1;   /* CRIS blue */
  --brand-dark: #006a9c;
  --bg:         #f5f5f5;
  --card:       #ffffff;
  --border:     #dddddd;
  --heading:    #333333;
  --text:       #444444;
  --muted:      #6a7178;
  --rov1:       #e8542f;
  --rov2:       #0083c1;
  --shadow-sm:  0 2px 6px rgba(0, 0, 0, 0.1);
  --shadow-md:  0 3px 10px rgba(0, 0, 0, 0.15);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  min-height: 100%;
}
body {
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
html { scroll-behavior: smooth; }

a { color: var(--brand); }
a:hover { opacity: 0.85; }

.content {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* ---------- TOP WHITE BAR + LOGOS ---------- */
.topbar {
  background: #ffffff;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cris-logo, .ul-logo { height: 50px; width: auto; object-fit: contain; }
.ul-logo { margin-left: 12px; }

/* ---------- BLUE NAV BAR ---------- */
.navbar {
  background: var(--brand);
  padding: 10px 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 30px;
  position: sticky;
  top: 0;
  z-index: 1000;
}
.nav-item {
  color: #ffffff;
  text-decoration: none;
  font-size: 17px;
  padding: 6px 12px;
  transition: 0.2s;
}
.nav-item:hover { opacity: 0.8; }
.nav-item.active { border-bottom: 2px solid #ffffff; }

/* ---------- HERO / DESCRIPTION ---------- */
.hero { margin-bottom: 10px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 13px;
  font-weight: bold;
  color: var(--brand);
  margin-bottom: 8px;
}
h1 {
  margin: 0 0 16px;
  font-size: 32px;
  color: var(--heading);
  font-weight: bold;
  line-height: 1.2;
}
p { font-size: 16px; color: var(--text); line-height: 1.6em; margin: 0 0 16px; }
p.lead { font-size: 18px; }

.badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.badge {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.badge b { color: var(--brand); }
a.badge { text-decoration: none; color: var(--text); transition: box-shadow .15s ease; }
a.badge:hover { box-shadow: 0 2px 10px rgba(0,0,0,.14); }

/* ---------- SECTIONS ---------- */
.section { margin-top: 48px; }
.section-head { margin-bottom: 18px; }
.section-head h2 { margin: 0 0 6px; font-size: 26px; color: var(--heading); }
.section-head p { margin: 0; color: var(--text); max-width: 780px; }
.kicker {
  color: var(--brand);
  font-weight: bold;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
}

/* ---------- MAP ---------- */
.map-grid { display: grid; grid-template-columns: 1fr 320px; gap: 22px; }
@media (max-width: 860px) { .map-grid { grid-template-columns: 1fr; } }

.map-stage {
  position: relative;
  height: 480px;
  border-radius: 6px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
#map {
  position: absolute;
  inset: 0;
  height: 100%;
  z-index: 1;
}

/* ---------- SITE VIEW (image backdrop + fixed points) ---------- */
#siteview {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: #04121c;
}
#siteview[hidden] { display: none; }
#siteview-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#siteview-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#siteview-title {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(4, 18, 28, 0.72);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: bold;
  max-width: 70%;
}
#siteview-title span { display: block; font-weight: normal; font-size: 12px; opacity: 0.85; }
#siteview-title .sv-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 7px; opacity: 1; }
#siteview-title .sv-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
#siteview-title .sv-legend i { width: 16px; height: 3px; border-radius: 2px; display: inline-block; }
#siteview-back { position: absolute; top: 12px; right: 12px; }
.sv-label {
  font-family: Arial, sans-serif;
  font-size: 12px;
  fill: #ffffff;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.85);
  stroke-width: 3px;
  font-weight: bold;
}
.sv-depth { font-size: 11px; font-weight: normal; }
.sv-dist {
  font-family: Arial, sans-serif;
  font-size: 11px;
  font-weight: bold;
  fill: #9be7ff;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.85);
  stroke-width: 3px;
}
.map-side {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  max-height: 480px;
  overflow: auto;
}
.map-side h3 { margin: 4px 0 10px; font-size: 16px; color: var(--heading); }
.map-hint {
  font-size: 13px;
  color: var(--muted);
  background: #eef7fc;
  border: 1px solid #cfe7f4;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 12px;
}
.legend-line { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; margin: 4px -6px; padding: 4px 6px; border-radius: 6px; font-weight: bold; color: var(--heading); cursor: pointer; transition: background 0.15s; }
.legend-line:hover, .legend-line:focus { background: #eef7fc; outline: none; }
.legend-line .swatch { width: 14px; height: 14px; border-radius: 4px; margin-top: 3px; flex: 0 0 auto; }
.legend-text { display: flex; flex-direction: column; line-height: 1.25; }
.legend-sub { font-weight: normal; color: var(--muted); font-size: 12px; }
.pt-list { list-style: none; margin: 8px 0 4px; padding: 0; }
.pt-list li {
  font-size: 13px; color: var(--text);
  padding: 5px 0; border-bottom: 1px dashed #e3e3e3;
  display: flex; justify-content: space-between; gap: 10px;
}
.pt-list li .d { color: var(--brand); font-variant-numeric: tabular-nums; font-weight: bold; }
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 6px 0; }
.stat { background: #f0f8fc; border: 1px solid #cfe7f4; border-radius: 6px; padding: 10px 14px; flex: 1 1 90px; }
.stat .n { font-size: 22px; font-weight: bold; color: var(--brand); }
.stat .l { font-size: 12px; color: var(--muted); }

/* Overview marker (single clickable location pin) */
.loc-pin {
  background: var(--brand);
  color: #fff;
  border: 3px solid #fff;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  white-space: nowrap;
  padding: 6px 12px;
  cursor: pointer;
}
.map-back-btn {
  background: #fff; border: 1px solid var(--brand); color: var(--brand);
  font-weight: bold; font-size: 13px; border-radius: 6px;
  padding: 6px 10px; cursor: pointer; box-shadow: var(--shadow-sm);
}
.map-back-btn:hover { background: var(--brand); color: #fff; }
.leaflet-popup-content b { color: var(--brand); }

/* ---------- CAD ---------- */

/* ---------- GALLERY ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
figure.shot {
  margin: 0; background: var(--card);
  border: 1px solid var(--border); border-radius: 6px;
  overflow: hidden; box-shadow: var(--shadow-sm);
}
figure.shot img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: #e9eef1; }
figure.shot figcaption { padding: 10px 12px; font-size: 13px; color: var(--muted); }
.gallery-empty { color: var(--muted); border: 1px dashed var(--border); border-radius: 6px; padding: 24px; background: #fff; }

/* ---------- FOOTER (CRIS-UL style) ---------- */
.footer { background: var(--brand); color: #ffffff; padding: 40px 20px; margin-top: 48px; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; flex-wrap: wrap; }
.footer-left { flex: 1; min-width: 260px; }
.footer-logo { max-width: 220px; margin-bottom: 15px; }
.footer-left p { color: #fff; margin-bottom: 16px; line-height: 1.5em; }
.footer-author { margin-top: 15px; font-size: 14px; opacity: 0.9; }
.footer-author a { color: #fff; text-decoration: underline; }
.footer-right { flex: 1; min-width: 200px; }
.footer-right h3 { font-size: 20px; margin-bottom: 12px; letter-spacing: 1px; }
.footer-link { color: #fff; text-decoration: none; font-size: 16px; display: inline-block; margin: 4px 0; }
.footer-link:hover { opacity: 0.8; }

@media (max-width: 700px) {
  .footer-inner { flex-direction: column; text-align: center; gap: 20px; }
  .footer-left, .footer-right { width: 100%; }
  .footer-logo { margin: 0 auto 15px; }
  .footer-right h3 { margin-top: 10px; }
}

/* Music toggle button */
#audio-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1000;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: #0a2a43;
  color: #fff;
  font-size: 20px;
  line-height: 46px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease, background 0.15s ease;
}
#audio-toggle:hover {
  transform: scale(1.08);
  background: #0e3a5c;
}
