/* ============================================================
   LWBYL — Stylesheet
   Aesthetic: editorial travel, dark base, warm amber accent
   Fonts: Playfair Display (display) + DM Sans (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400;1,700&family=DM+Sans:wght@300;400;500&display=swap');

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

:root {
  --bg:          #0e0d0c;
  --bg-2:        #141310;
  --bg-card:     #1a1815;
  --border:      #2a2724;
  --text:        #e8e2d9;
  --text-muted:  #8a8278;
  --accent:      #c8924a;
  --accent-dim:  #7a5630;
  --accent-glow: rgba(200,146,74,0.15);
  --white:       #f5f0ea;
  --sans:        'DM Sans', sans-serif;
  --serif:       'Playfair Display', Georgia, serif;
  --radius:      4px;
  --transition:  0.25s ease;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent-dim); border-radius: 3px; }

/* ── Typography helpers ───────────────────────────────────── */
.serif { font-family: var(--serif); }
.muted { color: var(--text-muted); }
.accent-text { color: var(--accent); }

/* ── Layout ───────────────────────────────────────────────── */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ── Nav ──────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(14,13,12,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex;
  align-items: center;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-logo {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.02em;
  cursor: pointer;
}

.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color var(--transition);
}

.nav-links a:hover,
.nav-links a.active { color: var(--accent); text-decoration: none; }

/* ── Hero ─────────────────────────────────────────────────── */
#hero {
  padding: 120px 0 80px;
  text-align: center;
  position: relative;
}

.hero-label {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 20px;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 900;
  line-height: 1.1;
  color: var(--white);
  margin-bottom: 20px;
}

.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 48px;
}

/* ── Stats bar ────────────────────────────────────────────── */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 60px;
  padding: 28px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 80px;
}

.stat-item { text-align: center; }
.stat-num {
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Map Section ──────────────────────────────────────────── */
#map-section {
  padding: 80px 0;
}

.section-heading {
  font-family: var(--serif);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.section-title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 48px;
}

#world-map-container {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  overflow: hidden;
  position: relative;
}

#world-map {
  width: 100%;
  height: auto;
}

/* SVG country paths */
#world-map .land {
  fill: #2a2724;
  stroke: #1a1815;
  stroke-width: 0.5;
  transition: fill var(--transition);
  cursor: default;
}

#world-map .land.visited {
  fill: var(--accent-dim);
  cursor: pointer;
}

#world-map .land.visited:hover {
  fill: var(--accent);
}

/* Map tooltip */
#map-tooltip {
  position: fixed;
  background: var(--bg-card);
  border: 1px solid var(--accent-dim);
  color: var(--text);
  padding: 6px 12px 6px 8px;
  font-size: 0.82rem;
  border-radius: var(--radius);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 999;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tip-flag {
  width: 22px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

/* ── Country Grid — continent grouped ────────────────────── */
#countries-section {
  padding: 80px 0;
}

.continent-group {
  margin-bottom: 64px;
}

.continent-label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 24px;
}

.continent-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 16px;
}

.country-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  position: relative;
}

.country-card:hover {
  border-color: var(--accent-dim);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.card-image {
  height: 190px;
  background: var(--bg-2);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-image > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.country-card:hover .card-image > img { transform: scale(1.04); }

.card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
}

.card-flag-bg {
  width: 120px;
  opacity: 0.12;
  filter: grayscale(0.4);
}

/* Flag badge — bottom-left corner of card image */
.card-flag-badge {
  position: absolute;
  bottom: 12px;
  left: 14px;
  width: 36px;
  height: 24px;
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.12);
}

.card-flag-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 18px 20px 22px;
}

.card-meta {
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.card-name {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 8px;
}

.card-intro {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-arrow {
  margin-top: 16px;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: gap var(--transition);
}

.country-card:hover .card-arrow { gap: 10px; }

/* ── Country Page (overlay) ───────────────────────────────── */
#country-page {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  overflow-y: auto;
  animation: slideUp 0.35s ease forwards;
}

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

.cp-back {
  position: fixed;
  top: 18px; left: 28px;
  z-index: 210;
  background: rgba(14,13,12,0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color var(--transition), border-color var(--transition);
}

.cp-back:hover { color: var(--accent); border-color: var(--accent-dim); }

.cp-hero {
  height: min(55vh, 540px);
  background: var(--bg-2);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.cp-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}

.cp-hero-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8rem;
  opacity: 0.08;
}

.cp-hero-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 48px 48px 44px;
  background: linear-gradient(transparent, rgba(14,13,12,0.95));
}

.cp-hero-meta {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.cp-hero-title {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 900;
  color: var(--white);
  line-height: 1.05;
  display: flex;
  align-items: center;
  gap: 20px;
}

.cp-flag-img {
  height: 0.6em;
  width: auto;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  vertical-align: middle;
  margin-right: 4px;
}

.cp-intro {
  max-width: 640px;
  font-size: 1.05rem;
  color: var(--text-muted);
  font-style: italic;
  font-family: var(--serif);
  margin-top: 14px;
  line-height: 1.6;
}

/* Country page body */
.cp-body {
  max-width: 780px;
  margin: 0 auto;
  padding: 64px 28px 100px;
}

.cp-section {
  margin-bottom: 52px;
}

.cp-section h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.cp-section p {
  color: var(--text-muted);
  font-size: 0.97rem;
  line-height: 1.8;
}

.cp-tips {
  background: var(--bg-card);
  border: 1px solid var(--accent-dim);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-top: 48px;
}

.cp-tips-label {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.cp-tips p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* Photo grid inside country page */
.cp-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin: 48px 0;
}

.cp-photos img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius);
}

/* ── Divider ──────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ── Footer ───────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

footer strong {
  font-family: var(--serif);
  color: var(--accent);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 680px) {
  .stats-bar { gap: 28px; }
  .nav-links { display: none; }
  .cp-hero-overlay { padding: 24px 24px 28px; }
  .cp-body { padding: 40px 20px 80px; }
}
