/* ==========================================================================
   Fineagle - shared styles (landing page + map page)
   ========================================================================== */

:root {
  --color-primary: #0d3b4a;   /* deep sea teal */
  --color-secondary: #2f6e4f; /* forest green */
  --color-accent: #e8a93b;    /* sun gold */
  --color-bg: #f4f7f5;
  --color-panel: #ffffff;
  --color-text: #1c2b2d;
  --color-muted: #5a6b6e;
  --color-border: #dde5e1;

  --header-height: 56px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

/* Pin the footer to the bottom of the viewport on short pages, instead of
   leaving the body's own background exposed below it. */
body.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.landing main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Let the last section absorb any leftover space, so its background (not
   the body's) reaches down to the footer on pages shorter than the viewport. */
body.landing main > section:last-child {
  flex: 1;
}

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

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Header / nav
   ========================================================================== */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 1.5rem;
  background: var(--color-primary);
  color: #fff;
}

.site-header .logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-header nav {
  display: flex;
  align-items: center;
}

.site-header nav a {
  color: #fff;
  text-decoration: none;
  margin-left: 1.5rem;
  font-weight: 600;
  opacity: 0.85;
}

.site-header nav a:hover,
.site-header nav a.active {
  opacity: 1;
  border-bottom: 2px solid var(--color-accent);
}

.lang-toggle {
  display: inline-flex;
  margin-left: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  overflow: hidden;
}

.lang-btn {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}

.lang-btn:hover {
  opacity: 1;
}

.lang-btn.active {
  background: var(--color-accent);
  color: var(--color-primary);
  opacity: 1;
}

/* On the landing page the header is a normal sticky bar */
body.landing .site-header {
  position: sticky;
  top: 0;
  z-index: 1001;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(232, 169, 59, 0.4);
}

.btn-secondary {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: #fff;
}

/* ==========================================================================
   Landing page sections
   ========================================================================== */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 64vh;
  color: #fff;
  background:
    linear-gradient(100deg, rgba(13, 59, 74, 0.95) 0%, rgba(13, 59, 74, 0.8) 40%, rgba(13, 59, 74, 0.25) 85%),
    url("../assets/archipelago2.jpg") center 70% / cover no-repeat;
}

.hero .container {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding-top: 4rem;
  padding-bottom: 4rem;
  flex-wrap: wrap;
}

.hero-content {
  flex: 1 1 360px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin: 0 0 0.25rem;
  line-height: 1.15;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--color-accent);
  margin: 0 0 1rem;
  font-style: italic;
}

.hero-tagline {
  font-size: 1.1rem;
  max-width: 38ch;
  color: #dceef2;
  margin: 0 0 2rem;
}

.hero-graphic {
  flex: 0 1 336px;
  display: flex;
  justify-content: center;
}

.hero-eagle-btn {
  display: block;
  width: 100%;
  max-width: 384px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 1rem;
  -webkit-tap-highlight-color: transparent;
}

.hero-eagle-btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 6px;
}

.hero-eagle-btn.is-mirrored {
  transform: scaleX(-1);
}

.hero-graphic img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.45));
  animation: hero-soar 7s ease-in-out infinite;
}

.hero-eagle-btn:hover img {
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.45)) brightness(1.08);
}

@keyframes hero-soar {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-16px) rotate(-2deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-graphic img {
    animation: none;
  }
}

.about,
.species,
.methodology {
  padding: 3.5rem 0;
}

.about h2,
.species h2,
.methodology h2,
.stats h2,
.cta-footer h2 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  color: var(--color-primary);
  margin-top: 0;
}

.about p,
.species p,
.methodology p {
  max-width: 70ch;
  color: var(--color-text);
}

.species,
.methodology {
  position: relative;
  color: #fff;
  padding: 5rem 0;
  background-image:
    linear-gradient(rgba(13, 59, 74, 0.8), rgba(13, 59, 74, 0.8)),
    url("../assets/siblings_in_nest.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.species h2,
.methodology h2 {
  color: #fff;
}

.species p,
.methodology p {
  color: #eaf3f0;
}

.species-facts {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem 2rem;
}

.species-facts li {
  padding-left: 1.4rem;
  position: relative;
}

.species-facts li::before {
  content: "\2022";
  color: var(--color-accent);
  font-weight: 700;
  position: absolute;
  left: 0;
}

/* ==========================================================================
   Stats grid
   ========================================================================== */

.stats {
  padding: 3.5rem 0;
  background: var(--color-bg);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.stat-card {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
}

.stat-value {
  display: block;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
  font-weight: 800;
  color: var(--color-accent);
}

.stat-value--text {
  font-size: clamp(1.1rem, 2.2vw, 1.5rem);
}

.stat-label {
  display: block;
  margin-top: 0.4rem;
  color: var(--color-muted);
  font-size: 0.95rem;
}

/* ==========================================================================
   CTA + footer
   ========================================================================== */

.cta-footer {
  padding: 4rem 0;
  text-align: center;
  background: var(--color-secondary);
  color: #fff;
}

.cta-footer h2 {
  color: #fff;
}

.cta-footer p {
  max-width: 50ch;
  margin: 0 auto 2rem;
  color: #e3f1e9;
}

.cta-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer {
  background: var(--color-primary);
  color: #cfe3e9;
  padding: 2rem 0;
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--color-accent);
}

.site-footer p {
  margin: 0.35rem 0;
}

.footer-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2.5rem;
  margin-top: 1.5rem;
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem 2rem;
}

.footer-logo {
  display: block;
  height: 48px;
  width: auto;
}

/* ==========================================================================
   Meet the Eagles page
   ========================================================================== */

.eagles-page {
  padding: 3.5rem 0 4.5rem;
  position: relative;
  color: #fff;
  background-image:
    linear-gradient(rgba(13, 59, 74, 0.82), rgba(13, 59, 74, 0.82)),
    url("../assets/archipelago2.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.eagles-page h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: #fff;
  margin-top: 0;
}

.eagles-intro {
  max-width: 70ch;
  color: #eaf3f0;
  margin-bottom: 0.75rem;
}

.eagles-hint {
  max-width: 70ch;
  color: #cfe3e9;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.eagles-notice {
  max-width: 70ch;
  color: #cfe3e9;
  font-size: 0.9rem;
  font-style: italic;
  margin-bottom: 2.5rem;
}

.eagle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.eagle-card {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.eagle-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: top center;
  border: 4px solid var(--pair-color, var(--color-border));
}

.eagle-card.deceased img {
  filter: grayscale(100%);
}

.eagle-card-body {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.eagle-card-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  color: var(--color-primary);
}

.eagle-card-name .color-swatch {
  width: 14px;
  height: 14px;
}

.eagle-card dl {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-muted);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.6rem;
}

.eagle-card dt {
  font-weight: 600;
  color: var(--color-text);
}

.eagle-card dd {
  margin: 0;
}

.eagle-card a {
  color: var(--color-secondary);
  font-weight: 600;
  text-decoration: none;
}

.eagle-card a:hover {
  text-decoration: underline;
}

.locate-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: flex-start;
  margin-top: auto;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--pair-bg, rgba(0, 0, 0, 0.05));
  border: 1px solid var(--pair-color, var(--color-border));
  font-size: 0.8rem;
}

.locate-badge:hover {
  text-decoration: underline;
}

.coming-soon-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: flex-start;
  margin-top: auto;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: transparent;
  border: 1px dashed var(--color-border);
  font-size: 0.8rem;
  color: var(--color-muted);
}

.deceased-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: flex-start;
  margin-top: auto;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid var(--color-border);
  font-size: 0.8rem;
  color: var(--color-muted);
}

/* ==========================================================================
   FAQ page
   ========================================================================== */

.faq-page {
  padding: 3.5rem 0 4.5rem;
  position: relative;
  color: #fff;
  background-image:
    linear-gradient(rgba(13, 59, 74, 0.82), rgba(13, 59, 74, 0.82)),
    url("../assets/flight.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.faq-page h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: #fff;
  margin-top: 0;
}

.faq-intro {
  max-width: 70ch;
  color: #eaf3f0;
  margin-bottom: 2rem;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 70ch;
}

.faq-item {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 0.25rem 1.25rem;
}

.faq-item summary {
  padding: 0.9rem 0;
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 1.5rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 0.9rem;
  color: var(--color-accent);
  font-weight: 700;
}

.faq-item[open] summary::after {
  content: "\2212";
}

.faq-item .faq-answer {
  color: var(--color-text);
  padding: 0 0 1rem;
}

.faq-item .faq-answer a {
  color: var(--color-secondary);
}

/* ==========================================================================
   News page
   ========================================================================== */

.news-page {
  padding: 3.5rem 0 4.5rem;
  position: relative;
  color: #fff;
  background-image:
    linear-gradient(rgba(13, 59, 74, 0.82), rgba(13, 59, 74, 0.82)),
    url("../assets/siblings_in_nest.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.news-page h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: #fff;
  margin-top: 0;
}

.news-intro {
  max-width: 70ch;
  color: #eaf3f0;
  margin-bottom: 2rem;
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 70ch;
}

.news-status {
  color: var(--color-muted);
}

.news-post {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
}

.news-post-image {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: cover;
}

.news-post-body {
  padding: 1.5rem 1.75rem;
}

.news-post-title {
  margin: 0 0 0.35rem;
  font-size: 1.3rem;
  color: var(--color-primary);
}

.news-post-date {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.news-post-content {
  color: var(--color-text);
}

.news-post-content > :first-child {
  margin-top: 0;
}

.news-post-content > :last-child {
  margin-bottom: 0;
}

.news-post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.news-post-content a {
  color: var(--color-secondary);
}

/* ==========================================================================
   Map page
   ========================================================================== */

body.map-page {
  height: 100vh;
  overflow: hidden;
}

body.map-page .site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  background: rgba(13, 59, 74, 0.85);
  backdrop-filter: blur(2px);
}

#map {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: var(--color-bg);
}

.info-panel {
  position: absolute;
  top: calc(var(--header-height) + 10px);
  right: 10px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  padding: 0.75rem 1rem 1rem;
  width: 230px;
  max-height: calc(100vh - var(--header-height) - 90px);
  overflow-y: auto;
}

.info-panel h2 {
  margin: 0.25rem 0 0.5rem;
  font-size: 1.05rem;
  color: var(--color-primary);
}

.eagle-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.3rem 0;
}

.eagle-toggle label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.9rem;
  gap: 0.5rem;
  flex: none;
}

.eagle-name-btn {
  font-size: 0.9rem;
  cursor: pointer;
  flex: 1;
}

.eagle-name-btn:hover {
  text-decoration: underline;
  color: var(--color-primary);
}

.color-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex: none;
}

.panel-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.panel-actions button {
  flex: 1;
  font-size: 0.8rem;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  cursor: pointer;
}

.panel-actions button:hover {
  background: var(--color-border);
}

.layer-select-row {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.layer-select-row label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.layer-select-row select {
  font-size: 0.85rem;
  padding: 0.3rem 0.5rem;
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
}

.trail-window-row {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.trail-window-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.trail-pills {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.trail-pill {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text);
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.trail-pill:hover {
  background: var(--color-border);
}

.trail-pill.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.panel-toggle {
  display: none;
}

/* Playback bar */

.playback-bar {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: min(640px, calc(100% - 20px));
}

#play-pause-btn {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--color-secondary);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#play-pause-btn:hover {
  background: var(--color-primary);
}

#time-slider {
  flex: 1 1 auto;
  min-width: 0;
}

#time-display {
  flex: none;
  font-size: 0.8rem;
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#speed-select {
  flex: none;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  font-size: 0.8rem;
  padding: 0.25rem;
}

/* Leaflet tweaks */
.leaflet-popup-content {
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Push default top-left controls (zoom) below the overlay header */
body.map-page .leaflet-top {
  top: var(--header-height);
}

/* Current-position marker: plain colored dot, no default divIcon box */
.eagle-current-marker {
  background: transparent !important;
  border: none !important;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 480px) {
  :root {
    --header-height: 96px;
  }

  .site-header {
    height: auto;
    flex-wrap: wrap;
    row-gap: 0.5rem;
    padding: 0.6rem 0.75rem;
  }

  .site-header .logo {
    font-size: 1.05rem;
  }

  .site-header nav {
    flex: 1 0 100%;
    justify-content: center;
  }

  .site-header nav a {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    font-size: 0.85rem;
  }

  .lang-toggle {
    margin-left: 0.5rem;
  }

  .lang-btn {
    font-size: 0.7rem;
    padding: 0.25rem 0.45rem;
  }
}

@media (max-width: 768px) {
  .hero {
    min-height: 0;
    background:
      linear-gradient(180deg, rgba(13, 59, 74, 0.55) 0%, rgba(13, 59, 74, 0.92) 55%, rgba(13, 59, 74, 0.97) 100%),
      url("../assets/archipelago2.jpg") center 75% / cover no-repeat;
  }

  .hero .container {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
    flex-direction: column-reverse;
    text-align: center;
  }

  .hero-tagline {
    margin-left: auto;
    margin-right: auto;
  }

  .info-panel {
    top: auto;
    bottom: 76px;
    left: 10px;
    right: 10px;
    width: auto;
    max-height: 40vh;
  }

  .info-panel.collapsed #eagle-controls,
  .info-panel.collapsed .panel-actions,
  .info-panel.collapsed .layer-select-row,
  .info-panel.collapsed .trail-window-row {
    display: none;
  }

  .panel-toggle {
    display: inline-block;
    float: right;
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--color-primary);
  }

  .playback-bar {
    width: calc(100% - 20px);
    padding: 0.4rem 0.75rem;
    gap: 0.5rem;
  }

  #time-display {
    font-size: 0.7rem;
  }

  #speed-select {
    display: none;
  }
}
