/* ============================================================
   The LAC Slums Comprehensive Dataset — site stylesheet
   Clean academic style: white background, minimal, readable
   ============================================================ */

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: "Georgia", serif;
  color: #222;
  background: #fff;
  line-height: 1.7;
}

a { color: #1a3a5c; text-decoration: underline; }
a:hover { color: #2e6da4; }

/* ---------- Layout ---------- */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Navigation ---------- */
nav {
  border-bottom: 1px solid #ddd;
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 100;
}

nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

nav .site-title {
  font-size: 0.9rem;
  font-weight: bold;
  color: #1a3a5c;
  text-decoration: none;
  font-family: "Georgia", serif;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

nav ul a {
  font-size: 0.9rem;
  font-family: Arial, sans-serif;
  text-decoration: none;
  color: #444;
}

nav ul a:hover { color: #1a3a5c; }

/* ---------- Hero ---------- */
.hero {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid #eee;
}

.hero h1 {
  font-size: 2rem;
  line-height: 1.3;
  color: #1a3a5c;
  margin-bottom: 0.75rem;
}

.hero .subtitle {
  font-size: 1.05rem;
  color: #555;
  font-family: Arial, sans-serif;
  margin-bottom: 1.25rem;
}

.hero .authors {
  font-size: 0.9rem;
  color: #666;
  font-family: Arial, sans-serif;
}

.hero .affiliations {
  font-size: 0.82rem;
  color: #888;
  font-family: Arial, sans-serif;
  margin-top: 0.3rem;
}

.hero .status-badge {
  display: inline-block;
  margin-top: 1.25rem;
  background: #eef4fb;
  color: #1a3a5c;
  font-size: 0.8rem;
  font-family: Arial, sans-serif;
  padding: 0.3rem 0.75rem;
  border-radius: 3px;
  border: 1px solid #c5d9ed;
  text-decoration: none;
}

.hero .status-badge:hover { background: #ddeaf8; }

/* ---------- Sections ---------- */
section {
  padding: 3rem 0;
  border-bottom: 1px solid #eee;
}

section h2 {
  font-size: 1.4rem;
  color: #1a3a5c;
  margin-bottom: 1.25rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid #c5d9ed;
  display: inline-block;
}

section p, section li {
  font-size: 0.97rem;
  color: #333;
  font-family: Arial, sans-serif;
}

section p { margin-bottom: 0.9rem; }

section ul, section ol {
  padding-left: 1.4rem;
  margin-bottom: 0.9rem;
}

section li { margin-bottom: 0.4rem; }

/* ---------- Countries grid ---------- */
.countries {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.country-tag {
  background: #f5f5f5;
  border: 1px solid #ddd;
  font-size: 0.82rem;
  font-family: Arial, sans-serif;
  padding: 0.2rem 0.65rem;
  border-radius: 3px;
  color: #444;
}

/* ---------- Tables ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  font-family: Arial, sans-serif;
  margin-bottom: 1rem;
}

th {
  background: #f0f4f8;
  color: #1a3a5c;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border: 1px solid #ddd;
  font-weight: bold;
}

td {
  padding: 0.5rem 0.75rem;
  border: 1px solid #eee;
  vertical-align: top;
}

tr:nth-child(even) td { background: #fafafa; }

/* ---------- Placeholder card ---------- */
.placeholder-card {
  background: #fafafa;
  border: 1px dashed #ccc;
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  font-family: Arial, sans-serif;
  font-size: 0.9rem;
  color: #777;
}

.placeholder-card .card-title {
  font-size: 0.97rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 0.35rem;
}

.placeholder-card .card-meta {
  font-size: 0.82rem;
  color: #999;
  margin-top: 0.5rem;
}

/* ---------- Download buttons ---------- */
.download-btns {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.btn-download {
  display: inline-block;
  background: #1a3a5c;
  color: #fff;
  font-size: 0.85rem;
  font-family: Arial, sans-serif;
  padding: 0.4rem 1.1rem;
  border-radius: 3px;
  text-decoration: none;
}

.btn-download:hover { background: #2e6da4; color: #fff; }

.btn-download--outline {
  background: #fff;
  color: #1a3a5c;
  border: 1px solid #1a3a5c;
}

.btn-download--outline:hover { background: #eef4fb; color: #1a3a5c; }

/* ---------- Citation ---------- */
.citation-text {
  font-family: Arial, sans-serif;
  font-size: 0.95rem;
  font-style: italic;
  background: #fafafa;
  border-left: 3px solid #c5d9ed;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  color: #333;
}

.bibtex {
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  font-family: "Courier New", monospace;
  color: #333;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.6;
}

/* ---------- Coding exercises button ---------- */
.btn-exercises {
  display: inline-block;
  margin-top: 0.25rem;
  background: #1a3a5c;
  color: #fff;
  font-size: 0.82rem;
  font-family: Arial, sans-serif;
  padding: 0.3rem 0.9rem;
  border-radius: 3px;
  text-decoration: none;
}

.btn-exercises:hover { background: #2e6da4; color: #fff; }

/* ---------- Footer ---------- */
footer {
  padding: 2rem 0;
  font-size: 0.82rem;
  font-family: Arial, sans-serif;
  color: #999;
  text-align: center;
}

/* Sample map figure: small thumbnail, click to enlarge */
.map-figure {
  margin: 1.5rem 0 0;
  flex: 0 0 300px;
}
.map-thumb {
  display: inline-block;
  cursor: zoom-in;
}
.map-thumb img {
  display: block;
  width: 300px;
  max-width: 100%;
  height: auto;
  border: 1px solid #ddd;
}
.map-figure figcaption {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.4rem;
}

/* Lightbox for the enlarged map */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.8);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 94vw;
  max-height: 94vh;
  background: #fff;
}

/* Countries: two aligned columns (6 + 5), filled top to bottom */
.countries {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 150px));
  grid-template-rows: repeat(6, auto);
  grid-auto-flow: column;
  gap: 0.4rem;
}
.country-tag { text-align: center; }

/* Countries and map side by side; stack on narrow screens */
.geo-row {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}
.geo-countries { flex: 0 0 auto; min-width: 0; }
.country-tag { padding: 0.2rem 0.3rem; }
@media (max-width: 700px) {
  .geo-row { flex-direction: column; }
  .map-figure { flex: none; }
}