/* =========================================================
   Reading the Land — Amrita WCE-LRR Landslide Field Atlas
   Single-page stylesheet
   ========================================================= */

/* ─── Variables ──────────────────────────────────────────── */
:root {
  --maroon:        #9c1b3f;
  --maroon-dark:   #6e1430;
  --maroon-darker: #4a0d20;
  --gold:          #f0b429;
  --gold-dark:     #c9921a;
  --cream:         #fdf8f2;
  --cream-2:       #f6ece1;
  --text-dark:     #2b1014;
  --text-body:     #3a2a2e;
  --text-muted:    #7a6166;
  --white:         #ffffff;
  --shadow:        0 8px 28px rgba(60, 10, 25, 0.12);
  --radius:        14px;
  --font-head:     'Poppins', 'Segoe UI', sans-serif;
  --font-body:     'Source Sans 3', 'Segoe UI', sans-serif;
}

/* ─── Reset / Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.65;
  color: var(--text-body);
  background: var(--cream);
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--text-dark);
  margin: 0 0 0.5em;
  line-height: 1.15;
}

p { margin: 0 0 1em; }
a { color: var(--maroon); }
img { max-width: 100%; display: block; }

/* ─── Header ─────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--maroon-dark);
  border-bottom: 4px solid var(--gold);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
  text-decoration: none;
  flex-wrap: wrap;
}

.brand-mark {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.8rem;
  letter-spacing: 0.12em;
  color: var(--white);
}

.brand-sub {
  font-size: 0.9rem;
  color: var(--gold);
  font-weight: 600;
}

.top-nav { display: flex; gap: 28px; }

.nav-link {
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-link:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.nav-link.nav-active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.nav-link.nav-disabled {
  color: rgba(255,255,255,0.38);
  cursor: default;
  pointer-events: auto; /* keep click so we can redirect */
}

.nav-link.nav-disabled:hover {
  color: rgba(255,255,255,0.38);
  border-bottom-color: transparent;
}

/* ─── Hero ───────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 86vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(160deg, rgba(74,13,32,0.92) 0%, rgba(156,27,63,0.85) 55%, rgba(240,180,41,0.55) 100%),
    url('../images/ls60_raini.jpg') center / cover no-repeat;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, transparent 0%, rgba(0,0,0,0.32) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
  color: var(--white);
  padding: 60px 28px 40px;
}

.hero-kicker {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  color: var(--white);
  text-shadow: 0 4px 24px rgba(0,0,0,0.35);
  margin-bottom: 0.25em;
}

.hero-tagline {
  font-family: var(--font-head);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 1.1em;
}

.hero-desc {
  font-size: 1.1rem;
  line-height: 1.72;
  color: #fbeef0;
  max-width: 700px;
  margin: 0 auto 2em;
}

.btn-hero {
  display: inline-block;
  background: var(--gold);
  color: var(--maroon-darker);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  padding: 15px 36px;
  border-radius: 50px;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-hero:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.3);
}

/* ─── Overview Section ───────────────────────────────────── */
.overview-section {
  background: var(--cream);
  padding: 0 0 60px;
}

/* Stats ribbon */
.stats-ribbon {
  background: var(--maroon-dark);
  padding: 36px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.sr-item {
  flex: 1 1 160px;
  text-align: center;
  padding: 12px 24px;
}

.sr-num {
  display: block;
  font-family: var(--font-head);
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 6px;
}

.sr-lbl {
  display: block;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.72);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.sr-sep {
  width: 1px;
  height: 56px;
  background: rgba(255,255,255,0.2);
  flex-shrink: 0;
  align-self: center;
}

/* Section intro */
.ov-intro {
  max-width: 880px;
  margin: 0 auto;
  padding: 56px 28px 32px;
  text-align: center;
}

.ov-intro h2 {
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  color: var(--maroon);
}

.ov-intro p {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: 0;
}

/* Choropleth map */
.map-wrap {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 28px;
}

#choropleth-map {
  width: 100%;
  height: 62vh;
  min-height: 380px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--cream-2);
  cursor: pointer;
}

/* ─── State Panel ────────────────────────────────────────── */
.state-panel {
  max-width: 1300px;
  margin: 28px auto 0;
  padding: 0 28px;
  animation: panelIn 0.25s ease;
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.state-panel > div {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border-top: 4px solid var(--maroon);
}

.panel-hd {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--cream-2);
}

.panel-count {
  font-family: var(--font-head);
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}

.panel-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0 0 3px;
}

.panel-sub {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
}

.panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.panel-col {
  padding: 22px 28px;
}

.panel-col:first-child {
  border-right: 1px solid var(--cream-2);
}

.panel-sh {
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold-dark);
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--cream-2);
}

.panel-types {
  list-style: none;
  margin: 0;
  padding: 0;
}

.panel-types li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 0.92rem;
  color: var(--text-body);
  border-bottom: 1px solid var(--cream-2);
}

.panel-types li:last-child { border-bottom: none; }

.type-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.type-ct {
  margin-left: auto;
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.panel-body {
  font-size: 0.92rem;
  line-height: 1.68;
  color: var(--text-body);
  margin: 0;
}

.panel-factors {
  list-style: none;
  margin: 0;
  padding: 0;
}

.panel-factors li {
  position: relative;
  padding: 6px 0 6px 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-body);
  border-bottom: 1px solid var(--cream-2);
}

.panel-factors li:last-child { border-bottom: none; }

.panel-factors li::before {
  content: '▸';
  position: absolute;
  left: 0;
  top: 8px;
  color: var(--maroon);
  font-size: 0.68rem;
}

.panel-footer {
  padding: 18px 28px 22px;
  background: var(--cream);
  border-top: 1px solid var(--cream-2);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.btn-panel-cta {
  background: var(--maroon);
  color: var(--white);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 28px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}

.btn-panel-cta:hover {
  background: var(--maroon-dark);
  transform: translateY(-2px);
}

.panel-refs {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
  flex: 1 1 260px;
}

.panel-refs cite { font-style: italic; }

/* ─── Sites Section ──────────────────────────────────────── */
.sites-section {
  background: var(--white);
  min-height: 420px;
}

/* Placeholder */
.sites-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 28px;
}

.sites-empty-inner {
  text-align: center;
  color: var(--text-muted);
}

.sites-empty-arrow {
  font-size: 2.8rem;
  margin-bottom: 16px;
  opacity: 0.35;
  animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

.sites-empty-inner p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0;
}

/* Sites content */
.sites-hero { }

.sites-hero-inner {
  padding: 48px 28px 40px;
  color: var(--white);
}

.sh-kicker {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  margin-bottom: 10px;
}

.sh-name {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  color: var(--white);
  margin-bottom: 0.2em;
}

.sh-sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.85);
  margin: 0;
  max-width: 680px;
}

/* Quick stats */
.sites-stats {
  background: var(--white);
  border-bottom: 2px solid var(--cream-2);
  padding: 24px 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0;
  max-width: 100%;
}

.ss-item {
  flex: 1 1 140px;
  text-align: center;
  padding: 10px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ss-num {
  font-family: var(--font-head);
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 5px;
}

.ss-lbl {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ss-sep {
  width: 1px;
  background: var(--cream-2);
  align-self: stretch;
  margin: 8px 0;
}

.ss-types {
  flex: 2 1 240px;
  align-items: flex-start;
  text-align: left;
}

.ss-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.type-chip {
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--cream-2);
  color: var(--text-muted);
  border-radius: 50px;
  padding: 3px 10px;
}

/* Body wrapper */
.sites-body {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 28px 60px;
}

/* Map + context two-column */
.sites-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-top: 48px;
  align-items: start;
}

.col-label {
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold-dark);
  margin-bottom: 10px;
}

#site-map {
  width: 100%;
  height: 46vh;
  min-height: 300px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--cream-2);
}

.map-tip {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 8px 0 0;
}

/* Research context */
.duo-context {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.ctx-block { }

.ctx-sh {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--maroon);
  margin: 0 0 0.5em;
  padding-bottom: 6px;
  border-bottom: 2px solid rgba(156,27,63,0.12);
}

.ctx-body {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-body);
  margin: 0;
}

.ctx-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ctx-list li {
  position: relative;
  padding: 5px 0 5px 16px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-body);
  border-bottom: 1px solid var(--cream-2);
}

.ctx-list li:last-child { border-bottom: none; }

.ctx-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  top: 7px;
  color: var(--maroon);
  font-size: 0.68rem;
}

/* Site inventory */
.inventory {
  margin-top: 52px;
}

.inventory-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--maroon);
  margin-bottom: 28px;
}

.site-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

/* Individual site card */
.site-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border-left: 5px solid var(--cream-2);
  transition: border-color 0.2s, box-shadow 0.2s;
  scroll-margin-top: 90px;
}

.site-card:hover {
  border-left-color: var(--gold);
  box-shadow: 0 12px 32px rgba(156,27,63,0.16);
}

.sc-img-wrap { position: relative; }

.sc-img-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--cream-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sc-placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4em;
  color: var(--text-muted);
}
.sc-placeholder-icon { font-size: 2rem; opacity: 0.4; }
.sc-placeholder-txt  { font-size: 0.78rem; font-style: italic; }

.sc-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--cream-2);
}

.sc-caption {
  background: var(--maroon-dark);
  color: rgba(255,255,255,0.88);
  font-size: 0.8rem;
  padding: 7px 14px;
  font-style: italic;
  line-height: 1.45;
  margin: 0;
}

.sc-body {
  padding: 16px 18px 18px;
}

.sc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.sc-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 2px;
  line-height: 1.25;
}

.sc-loc {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0;
}

.sc-code {
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50px;
  padding: 3px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.sc-dl {
  border-top: 1px solid var(--cream-2);
  padding-top: 9px;
  margin-bottom: 10px;
}

.sc-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 0.88rem;
  padding: 3px 0;
}

.sc-row dt {
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-dark);
  min-width: 52px;
  flex-shrink: 0;
}

.sc-row dd {
  margin: 0;
  color: var(--text-body);
}

.sc-coords {
  color: var(--maroon);
  text-decoration: none;
  font-size: 0.85rem;
}

.sc-coords:hover { text-decoration: underline; }

.sc-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--cream-2);
  padding-top: 8px;
  margin: 8px 0 10px;
  font-style: italic;
}

.btn-show-map {
  background: none;
  border: 1px solid var(--cream-2);
  border-radius: 50px;
  padding: 5px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--maroon);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-family: var(--font-body);
}

.btn-show-map:hover {
  background: var(--cream-2);
  border-color: var(--maroon);
}

/* References */
.sites-refs {
  background: var(--maroon-darker);
  border-radius: var(--radius);
  margin-top: 52px;
}

.refs-inner {
  padding: 36px 40px;
}

.refs-hd {
  font-family: var(--font-head);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: 14px;
}

.refs-list {
  margin: 0;
  padding-left: 1.4em;
}

.refs-list li {
  color: rgba(255,255,255,0.7);
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 8px;
}

.refs-list li:last-child { margin-bottom: 0; }

/* ─── About Section ──────────────────────────────────────── */
.about-section {
  background: var(--cream-2);
  padding: 90px 28px;
}

.about-inner {
  max-width: 820px;
  margin: 0 auto;
}

.about-inner h2 {
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  color: var(--maroon);
  margin-bottom: 0.8em;
}

.about-inner p {
  font-size: 1.08rem;
  line-height: 1.72;
}

.about-credit {
  margin-top: 2em;
  padding-top: 1.5em;
  border-top: 2px solid rgba(156,27,63,0.12);
  color: var(--text-muted);
  font-size: 1rem;
}

/* ─── Footer ─────────────────────────────────────────────── */
.site-footer {
  background: var(--maroon-darker);
  color: var(--cream-2);
  text-align: center;
  padding: 22px 16px;
  font-size: 0.9rem;
}

.site-footer p { margin: 0; }

/* ─── Leaflet overrides ──────────────────────────────────── */
.leaflet-popup-content-wrapper { border-radius: 10px; }

.leaflet-popup-content {
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.5;
}

.leaflet-popup-content b {
  color: var(--maroon);
  font-family: var(--font-head);
}

.leaflet-tooltip.state-tooltip {
  background: rgba(255,255,255,0.97);
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(60,10,25,0.14);
  font-family: var(--font-body);
  font-size: 0.88rem;
  padding: 7px 13px;
  pointer-events: none;
}

.leaflet-tooltip.state-tooltip b {
  color: var(--maroon);
  font-family: var(--font-head);
  display: block;
  margin-bottom: 1px;
}

/* Choropleth legend (Leaflet control) */
.choropleth-legend {
  background: rgba(255,255,255,0.96);
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: 0 4px 16px rgba(60,10,25,0.12);
  font-family: var(--font-body);
  font-size: 0.83rem;
  min-width: 172px;
}

.choropleth-legend b {
  display: block;
  font-family: var(--font-head);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--maroon);
  margin-bottom: 8px;
}

.leg-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  color: var(--text-body);
}

.leg-sw {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.1);
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 960px) {
  .sites-duo {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .panel-grid {
    grid-template-columns: 1fr;
  }
  .panel-col:first-child {
    border-right: none;
    border-bottom: 1px solid var(--cream-2);
  }
}

@media (max-width: 700px) {
  body { font-size: 17px; }

  .header-inner { padding: 12px 16px; }
  .brand-mark   { font-size: 1.5rem; }
  .brand-sub    { font-size: 0.78rem; }
  .top-nav      { gap: 16px; }

  .hero { min-height: 100vh; }

  .sr-sep { display: none; }
  .stats-ribbon { padding: 28px 16px; }

  .ov-intro { padding: 40px 16px 24px; }
  .map-wrap { padding: 0 12px; }
  #choropleth-map { height: 52vh; min-height: 300px; }

  .state-panel { padding: 0 12px; }
  .panel-hd { flex-direction: column; align-items: flex-start; gap: 8px; }
  .panel-count { font-size: 2.4rem; }

  .sites-hero-inner { padding: 36px 16px 30px; }
  .sites-stats { padding: 18px 16px; }
  .ss-sep { display: none; }
  .sites-body { padding: 0 16px 40px; }
  .site-cards-grid { grid-template-columns: 1fr; }
  #site-map { height: 40vh; }
  .refs-inner { padding: 28px 20px; }

  .about-section { padding: 60px 16px; }
}

@media (max-width: 480px) {
  .sites-stats { flex-direction: column; align-items: stretch; }
  .ss-item { flex-direction: row; justify-content: center; gap: 12px; align-items: center; }
  .ss-item.ss-types { flex-direction: column; align-items: flex-start; }
}
