/* Maailma Teekaart page — all classes scoped under .maailma-teekaart-page */

/* ─── Hero ────────────────────────────────────────────────────────────────── */
.wm-hero {
  padding: 80px var(--tm-content-px) 0;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.wm-hero-eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--wp--preset--color--accent);
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 20px;
}

.wm-hero-h1 {
  font-family: var(--wp--preset--font-family--cormorant);
  font-size: clamp(40px, 6vw, 76px);
  font-weight: 500;
  color: var(--wp--preset--color--text);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
}

.wm-hero-lead {
  font-size: 17px;
  color: var(--wp--preset--color--text-muted);
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto 40px;
}

.wm-hero-actions {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
  margin-bottom: 56px;
}

.wm-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  padding: 0 32px;
  border: 1px solid var(--wp--preset--color--text);
  color: var(--wp--preset--color--text);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--wp--preset--font-family--inter);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.wm-btn-ghost:hover {
  background: var(--wp--preset--color--text);
  color: var(--wp--preset--color--bg);
}

.wm-hero-stats {
  display: flex;
  justify-content: center;
  border-top: 1px solid var(--wp--preset--color--border);
  border-bottom: 1px solid var(--wp--preset--color--border);
  padding: 24px 0;
  max-width: 820px;
  margin: 0 auto;
}

.wm-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  padding: 0 20px;
  border-right: 1px solid var(--wp--preset--color--border);
}
.wm-stat:last-child {
  border-right: none;
}

.wm-stat-n {
  font-family: var(--wp--preset--font-family--cormorant);
  font-size: 34px;
  font-weight: 500;
  color: var(--wp--preset--color--text);
  line-height: 1;
  margin-bottom: 4px;
}

.wm-stat-l {
  font-size: 11px;
  letter-spacing: 0.07em;
  color: var(--wp--preset--color--text-muted);
  text-transform: uppercase;
}

/* ─── Map section ─────────────────────────────────────────────────────────── */
.wm-map-section {
  background: var(--wp--preset--color--bg-alt);
  padding: 80px var(--tm-content-px) 80px;
  margin-top: 64px;
}

.wm-map-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.wm-section-head {
  margin-bottom: 32px;
}

.wm-section-eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--wp--preset--color--accent);
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 12px;
}

.wm-section-title {
  font-family: var(--wp--preset--font-family--cormorant);
  font-size: clamp(24px, 3.5vw, 40px);
  font-weight: 500;
  color: var(--wp--preset--color--text);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 12px;
}

.wm-section-subtitle {
  font-size: 15px;
  color: var(--wp--preset--color--text-muted);
  margin: 0;
  line-height: 1.55;
}

.wm-map-container {
  max-width: 1100px;
}

/* Plugin overrides — scoped to this page only, no bleed */
.maailma-teekaart-page #jem-world-map {
  border: none !important;
  height: 560px;
  background: transparent;
}

.maailma-teekaart-page .jvm-tooltip {
  border-radius: 0 !important;
  border: 1px solid var(--wp--preset--color--border) !important;
  box-shadow: none !important;
  font-family: var(--wp--preset--font-family--inter) !important;
}

/* ─── Featured stories ────────────────────────────────────────────────────── */
.wm-story {
  padding-left: var(--tm-content-px);
  padding-right: var(--tm-content-px);
}

.wm-story--first {
  padding-top: 120px;
  padding-bottom: 64px;
}

.wm-story--middle {
  background: var(--wp--preset--color--bg-alt);
  padding-top: 96px;
  padding-bottom: 96px;
}

.wm-story--last {
  padding-top: 64px;
  padding-bottom: 120px;
}

.wm-story-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.wm-story--alt .wm-story-inner {
  direction: rtl;
}

.wm-story--alt .wm-story-inner > * {
  direction: ltr;
}

.wm-story-visual {
  aspect-ratio: 4 / 5;
  position: relative;
  overflow: hidden;
  background: var(--wp--preset--color--bg-alt);
}

.wm-story-region {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--wp--preset--color--accent);
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 16px;
}

.wm-story-title {
  font-family: var(--wp--preset--font-family--cormorant);
  font-size: clamp(22px, 2.8vw, 36px);
  font-weight: 500;
  color: var(--wp--preset--color--text);
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0 0 20px;
}

.wm-story-text {
  font-size: 16px;
  color: var(--wp--preset--color--text-body);
  line-height: 1.7;
  margin: 0 0 28px;
}

.wm-story-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--wp--preset--color--accent);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
  transition: opacity 0.2s;
}

.wm-story-link:hover {
  opacity: 0.7;
  color: var(--wp--preset--color--accent);
}

/* ─── Atlas ───────────────────────────────────────────────────────────────── */
.wm-atlas {
  padding: 80px var(--tm-content-px) 100px;
}

.wm-atlas-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.wm-atlas-head {
  margin-bottom: 56px;
}

/* Mobile continent anchor nav */
.wm-continent-nav {
  display: none;
}

.wm-continent {
  margin-bottom: 52px;
}

.wm-continent:last-child {
  margin-bottom: 0;
}

.wm-continent-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--wp--preset--color--border);
}

.wm-continent-name {
  font-family: var(--wp--preset--font-family--cormorant);
  font-size: 22px;
  font-weight: 500;
  color: var(--wp--preset--color--text);
  letter-spacing: -0.01em;
  margin: 0;
}

.wm-continent-count {
  font-size: 12px;
  color: var(--wp--preset--color--text-muted);
}

/* Carousel */
.wm-carousel-row {
  position: relative;
}

.wm-carousel-arrows {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.wm-carousel-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--wp--preset--color--border);
  background: var(--wp--preset--color--bg);
  color: var(--wp--preset--color--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.wm-carousel-btn:hover:not(:disabled) {
  background: var(--wp--preset--color--bg-alt);
  border-color: var(--wp--preset--color--text-muted);
}

.wm-carousel-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.wm-carousel-track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
}

.wm-carousel-track::-webkit-scrollbar {
  display: none;
}

/* Small continent (≤2 countries): grid on desktop */
@media (min-width: 769px) {
  .wm-continent--small .wm-carousel-track {
    display: grid;
    grid-template-columns: repeat(2, 220px);
    overflow: visible;
    justify-content: center;
    scroll-snap-type: none;
  }
  .wm-continent--small .wm-carousel-arrows {
    display: none;
  }
}

/* Country card */
.wm-country-card {
  scroll-snap-align: start;
  flex-shrink: 0;
  width: 220px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--wp--preset--color--border);
  background: var(--wp--preset--color--bg);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.wm-country-card:hover {
  border-color: var(--wp--preset--color--text-muted);
  box-shadow: 0 2px 12px rgba(26, 26, 26, 0.06);
  color: inherit;
}

.wm-card-visual {
  aspect-ratio: 1 / 1;
  background: var(--wp--preset--color--bg-alt);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.wm-card-visual .tm-hero-woodblock {
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

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

.wm-card-visual {
  pointer-events: none;
}

.wm-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wm-card-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wm-card-flag {
  width: 28px;
  height: auto;
  flex-shrink: 0;
  display: block;
}

.wm-card-name {
  font-family: var(--wp--preset--font-family--cormorant);
  font-size: 18px;
  font-weight: 500;
  color: var(--wp--preset--color--text);
  line-height: 1.2;
}

.wm-card-count {
  font-size: 12px;
  color: var(--wp--preset--color--text-muted);
}

.wm-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.wm-card-chip {
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--wp--preset--color--text-muted);
  background: var(--wp--preset--color--bg-alt);
  padding: 3px 8px;
  border: 1px solid var(--wp--preset--color--border);
}

/* ─── Editorial CTA ───────────────────────────────────────────────────────── */
.wm-cta {
  background: var(--wp--preset--color--text);
  color: var(--wp--preset--color--bg-alt);
  padding: 96px var(--tm-content-px);
}

.wm-cta-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.wm-cta-eyebrow {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--wp--preset--color--accent);
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 20px;
}

.wm-cta-title {
  font-family: var(--wp--preset--font-family--cormorant);
  font-size: clamp(26px, 3.4vw, 44px);
  font-weight: 500;
  color: #fff;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin: 0;
}

.wm-cta-p {
  font-size: 16px;
  line-height: 1.7;
  color: rgba(245, 244, 240, 0.82);
  margin: 0 0 20px;
}

.wm-cta-p:last-of-type {
  margin-bottom: 32px;
}

.wm-cta-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  padding-bottom: 3px;
  transition: border-color 0.2s;
}

.wm-cta-link:hover {
  border-color: rgba(255, 255, 255, 0.9);
  color: #fff;
}

/* ─── Mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .wm-hero {
    padding: 48px 14px 0;
  }

  .wm-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .wm-hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 100%;
    border-top: none;
    border-bottom: none;
    padding: 0;
    border-left: none;
  }

  .wm-stat {
    border-right: none;
    border: 1px solid var(--wp--preset--color--border);
    border-right: none;
    border-bottom: none;
    padding: 18px 12px;
    align-items: flex-start;
  }

  .wm-stat:nth-child(odd) {
    border-right: 1px solid var(--wp--preset--color--border);
  }

  .wm-stat:nth-child(3),
  .wm-stat:nth-child(4) {
    border-bottom: 1px solid var(--wp--preset--color--border);
  }

  .wm-stat:nth-child(1),
  .wm-stat:nth-child(2) {
    border-top: 1px solid var(--wp--preset--color--border);
  }

  .wm-stat-n {
    font-size: 28px;
  }

  .wm-map-section {
    padding: 56px 14px 56px;
    margin-top: 40px;
  }

  .maailma-teekaart-page #jem-world-map {
    height: 280px;
  }

  .wm-story--first,
  .wm-story--middle,
  .wm-story--last {
    padding: 48px 14px;
  }

  .wm-story-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .wm-story--alt .wm-story-inner {
    direction: ltr;
  }

  .wm-atlas {
    padding: 56px 14px 64px;
  }

  .wm-atlas-head {
    margin-bottom: 32px;
  }

  /* Show mobile nav on small screens */
  .wm-continent-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    position: sticky;
    top: 56px;
    background: var(--wp--preset--color--bg);
    padding: 10px 0;
    z-index: 10;
    border-bottom: 1px solid var(--wp--preset--color--border);
  }

  .wm-continent-nav-link {
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--wp--preset--color--text-muted);
    text-decoration: none;
    padding: 6px 12px;
    border: 1px solid var(--wp--preset--color--border);
    transition: color 0.15s, border-color 0.15s;
  }

  .wm-continent-nav-link:hover {
    color: var(--wp--preset--color--accent);
    border-color: var(--wp--preset--color--accent);
  }

  /* Small continent: revert to flex track on mobile (desktop uses grid) */
  .wm-continent--small .wm-carousel-track {
    display: flex;
    overflow-x: auto;
    justify-content: flex-start;
    grid-template-columns: none;
  }

  /* Hide all carousel arrows on mobile — native swipe handles scrolling */
  .wm-carousel-arrows {
    display: none;
  }

  .wm-cta {
    padding: 64px 14px;
  }

  .wm-cta-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}
