/* ============================================
   Forza Horizon 6 Guide — Horizon Festival Theme
   Mobile-first, responsive design system
   Auto-deployed via Cloudflare Pages
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --color-bg: #f0f4f8;
  --color-surface: #ffffff;
  --color-text: #1a1a2e;
  --color-text-secondary: #4a4a6a;
  --color-text-muted: #8888aa;
  --color-primary: #1a3a6b;
  --color-primary-hover: #0f2a4f;
  --color-accent: #ff6b35;
  --color-accent-hover: #e55a2b;
  --color-border: #dde3ed;
  --color-border-light: #e8eef5;
  --color-tag-bg: #e8eef5;

  --font-heading: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  --max-width: 72rem;
  --content-width: 42rem;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

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

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

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--color-primary-hover); }

/* --- Utility --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* --- Header --- */
.site-header {
  background: var(--color-surface);
  border-bottom: 2px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}

.site-logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
}
.site-logo:hover { color: var(--color-primary-hover); }

@media (max-width: 1023px) { .site-logo { font-size: 1.1rem; } }

.main-nav { display: flex; align-items: center; gap: var(--space-md); flex-shrink: 1; min-width: 0; }
@media (min-width: 1024px) { .main-nav { gap: var(--space-lg); } }

.main-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: var(--space-xs) 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.main-nav a:hover, .main-nav a.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

/* --- Nav Dropdown (Categories) --- */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs) 0;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  transition: color 0.2s, border-color 0.2s;
}
.nav-dropdown-btn:hover { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.nav-dropdown.open .nav-dropdown-btn { color: var(--color-primary); }
.nav-dropdown.open .lang-arrow { transform: rotate(180deg); }

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 200px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  list-style: none;
  padding: 4px;
  z-index: 200;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }

.nav-dropdown-menu li { margin: 0; }
.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border-bottom: none !important;
  transition: background 0.15s, color 0.15s;
}
.nav-dropdown-menu a:hover { background: var(--color-tag-bg); color: var(--color-primary); }

.lang-switcher {
  position: relative;
  padding-left: var(--space-lg);
  border-left: 1px solid var(--color-border);
}

.lang-current {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-family: inherit;
}
.lang-current:hover { border-color: var(--color-primary); background: var(--color-tag-bg); }


.lang-arrow { transition: transform 0.2s; }
.lang-switcher.open .lang-arrow { transform: rotate(180deg); }

.lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 180px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  list-style: none;
  padding: 4px;
  z-index: 200;
}
.lang-switcher.open .lang-dropdown { display: block; }

.lang-dropdown li { margin: 0; }
.lang-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.lang-dropdown a:hover { background: var(--color-tag-bg); color: var(--color-primary); }

.mobile-nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: var(--space-sm); color: var(--color-text-secondary); }

/* --- Hero --- */
.hero {
  padding: var(--space-3xl) 0;
  text-align: left;
  background:
    linear-gradient(90deg, rgba(10,22,40,0.92) 0%, rgba(10,22,40,0.7) 40%, rgba(10,22,40,0.15) 70%, transparent 100%),
    url(/images/hero.jpg) right center / cover no-repeat;
  border-bottom: 1px solid var(--color-border);
  min-height: 70vh;
  display: flex;
  align-items: center;
}

.hero .container {
  max-width: 42rem;
  margin-left: 0;
  padding-left: var(--space-xl);
}

.hero-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 14px;
  border-radius: 20px;
  background: var(--color-accent);
  color: #fff;
  margin-bottom: var(--space-lg);
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: var(--space-md);
  line-height: 1.15;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: #c0c8e0;
  max-width: 36rem;
  margin-bottom: var(--space-xl);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.hero-cta {
  display: inline-block;
  background: var(--color-accent);
  color: #fff;
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: var(--radius-md);
  transition: background 0.2s ease;
}
.hero-cta:hover { background: var(--color-accent-hover); color: #fff; }

.hero-link {
  display: inline-block;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-md);
  color: #ffffff;
  transition: border-color 0.2s, color 0.2s;
}
.hero-link:hover { border-color: var(--color-accent); color: var(--color-accent); }

/* --- Sections --- */
.section-alt {
  padding: var(--space-2xl) 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.section-featured {
  padding: var(--space-2xl) 0;
}

.section-links {
  padding: var(--space-2xl) 0;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.section-subtitle {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-lg);
  font-size: 1rem;
}

/* --- Screenshots Scroll --- */
.section-screenshots {
  padding: var(--space-2xl) 0;
  background: var(--color-surface);
}

.sscroll {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

.sscroll-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #e0e6ef;
}

.sscroll-item img {
  display: block;
  width: 100%;
  height: auto;
}

/* --- Overview Grid --- */
.overview-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

.overview-text {
  font-size: 1rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-lg);
}

.feature-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}
.feature-list li {
  position: relative;
  padding: var(--space-sm) var(--space-md);
  padding-left: var(--space-xl);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
}
.feature-list li::before {
  content: "▸";
  position: absolute;
  left: var(--space-sm);
  color: var(--color-accent);
}

.info-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  border-left: 3px solid var(--color-accent);
}
.info-card h3 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-top: var(--space-md);
  margin-bottom: 2px;
}
.info-card h3:first-child { margin-top: 0; }
.info-card p {
  font-size: 0.95rem;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

/* --- Article Grid --- */
.article-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

/* --- Article Card (Icon Version) --- */
.article-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
}
.article-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.article-card-body { padding: var(--space-lg); flex: 1; display: flex; flex-direction: column; }

.article-card-top {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.article-card-type {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--color-tag-bg);
  color: var(--color-text-secondary);
}
.article-card-type--guide { background: #e3f2fd; color: #1565c0; }
.article-card-type--reference { background: #f3e5f5; color: #7b1fa2; }
.article-card-type--tierlist { background: #fff3e0; color: #e65100; }
.article-card-type--faq { background: #e8f5e9; color: #2e7d32; }
.article-card-type--map-guide { background: #e0f2f1; color: #00695c; }

.article-card-category {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-accent);
  margin-bottom: var(--space-xs);
}

.article-card-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  line-height: 1.3;
}
.article-card-title a { color: var(--color-text); text-decoration: none; }
.article-card-title a:hover { color: var(--color-primary); }

.article-card-excerpt {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-md);
  flex: 1;
}

.article-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.difficulty-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}
.difficulty-badge.beginner { background: #e8f5e9; color: #2e7d32; }
.difficulty-badge.intermediate { background: #fff3e0; color: #e65100; }
.difficulty-badge.advanced { background: #fbe9e7; color: #bf360c; }

/* --- System Requirements Table --- */
.req-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.req-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.req-table th {
  text-align: left;
  padding: var(--space-md);
  background: var(--color-tag-bg);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
}
.req-table th:first-child { width: 18%; }
.req-table th:nth-child(2) { width: 41%; }
.req-table th:nth-child(3) { width: 41%; }

.req-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}
.req-table tr:last-child td { border-bottom: none; }
.req-table tr td:first-child { font-weight: 600; color: var(--color-text); white-space: nowrap; }
.req-table tr td:not(:first-child) { color: var(--color-text-secondary); font-size: 0.85rem; }

/* --- Links Grid --- */
.links-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: box-shadow 0.2s, transform 0.2s;
}
.link-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--color-primary); }

.link-card-icon { margin-bottom: var(--space-sm); }
.link-card-icon svg { width: 32px; height: 32px; color: var(--color-primary); }
.link-card-title { font-weight: 700; font-size: 1rem; color: var(--color-text); margin-bottom: 2px; }
.link-card-desc { font-size: 0.8rem; color: var(--color-text-muted); }
.link-card:hover .link-card-title { color: var(--color-primary); }

/* --- Article Page --- */
.article-page { padding: var(--space-2xl) 0; }

.article-header { margin-bottom: var(--space-xl); padding-bottom: var(--space-xl); border-bottom: 1px solid var(--color-border); }
.article-header .article-card-category { font-size: 0.8rem; }
.article-header h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  margin: var(--space-sm) 0;
  color: var(--color-text);
}
.article-header .article-card-meta { margin-top: var(--space-md); }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-lg);
}
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-primary); }
.breadcrumb span { color: var(--color-text-secondary); }

/* --- Article Content --- */
.article-content {
  max-width: var(--content-width);
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-text);
}
.article-content h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border-light);
}
.article-content h3 { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 700; margin-top: var(--space-xl); margin-bottom: var(--space-sm); }
.article-content p { margin-bottom: var(--space-md); }
.article-content ul, .article-content ol { margin-bottom: var(--space-md); padding-left: var(--space-xl); }
.article-content li { margin-bottom: var(--space-sm); }
.article-content strong { color: var(--color-text); font-weight: 600; }
.article-content blockquote {
  border-left: 3px solid var(--color-accent);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
  background: var(--color-tag-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--color-text-secondary);
  font-style: italic;
}
.article-content hr { border: none; border-top: 1px solid var(--color-border); margin: var(--space-2xl) 0; }

/* --- Article Content: Tables --- */
.article-content .table-wrap {
  overflow-x: auto;
  margin-bottom: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.article-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 480px;
}
.article-content th {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-tag-bg);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}
.article-content td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: top;
}
.article-content tr:last-child td { border-bottom: none; }
.article-content tbody tr:nth-child(even) { background: var(--color-bg); }
.article-content tbody tr:hover { background: #e0e6ef; }

/* --- Wiki Sidebar --- */
.wiki-sidebar { margin-top: var(--space-2xl); padding-top: var(--space-xl); border-top: 1px solid var(--color-border); }
.wiki-sidebar-section { margin-bottom: var(--space-lg); }
.wiki-sidebar-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); margin-bottom: var(--space-sm); }
.wiki-sidebar-list { list-style: none; padding: 0; margin: 0; }
.wiki-sidebar-list li { margin: 0; }
.wiki-sidebar-cat { margin-bottom: 2px; }
.wiki-sidebar-cat-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.wiki-sidebar-cat-link:hover { background: var(--color-tag-bg); color: var(--color-primary); }
.wiki-sidebar-cat-link.active { color: var(--color-accent); }
.wiki-sidebar-articles { list-style: none; padding: 0 0 0 1.5rem; margin: 2px 0 4px; }
.wiki-sidebar-articles a {
  display: block;
  font-size: 0.8rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.wiki-sidebar-articles a:hover { color: var(--color-primary); background: var(--color-tag-bg); }
.wiki-sidebar-articles a.active { color: var(--color-primary); font-weight: 600; }

/* --- Related (below article) --- */
.article-related { margin-top: var(--space-2xl); padding-top: var(--space-xl); border-top: 1px solid var(--color-border); }
.article-related h3 { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 700; margin-bottom: var(--space-md); }
.related-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.related-links li { margin: 0; }
.related-links a {
  display: inline-block;
  font-size: 0.85rem;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  transition: border-color 0.2s, color 0.2s;
}
.related-links a:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* --- Prev / Next Navigation --- */
.prev-next { margin-top: var(--space-2xl); padding-top: var(--space-lg); border-top: 1px solid var(--color-border); }
.prev-next-inner { display: flex; justify-content: space-between; gap: var(--space-lg); }
.prev-next-prev, .prev-next-next { flex: 1; }
.prev-next-next { text-align: right; }
.prev-next-label { display: block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted); margin-bottom: 2px; }
.prev-next-title { font-size: 0.9rem; font-weight: 600; color: var(--color-primary); }
.prev-next a { text-decoration: none; }
.prev-next a:hover .prev-next-title { color: var(--color-primary-hover); }
.prev-next a:hover .prev-next-label { color: var(--color-primary); }

/* --- Section Page --- */
.section-page { padding: var(--space-2xl) 0; }

.section-page-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 2px solid var(--color-accent);
}

.section-page-icon svg {
  width: 40px;
  height: 40px;
  color: var(--color-primary);
}

.section-page-header h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.15;
}

.section-page-desc {
  font-size: 1rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  max-width: var(--content-width);
}

/* --- Section Card Grid (Homepage) --- */
.section-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.section-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.section-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--color-primary); }

.section-card-icon svg {
  width: 32px;
  height: 32px;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.section-card-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 2px;
}

.section-card-count {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* --- Empty Section --- */
.empty-section {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
}

.empty-section-icon {
  margin-bottom: var(--space-md);
  color: var(--color-text-muted);
  opacity: 0.5;
}

.empty-section-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.empty-section-text {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  max-width: 400px;
  margin: 0 auto;
}

.empty-section-seo {
  text-align: left;
  max-width: var(--content-width);
  margin: var(--space-xl) auto 0;
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--color-text-secondary);
}
/* --- Cookie Consent Overlay --- */
.cookie-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
}
.cookie-overlay.is-visible {
  display: block;
}

/* --- Cookie Consent Banner --- */
.cookie-banner {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: #1a1a2e;
  color: #fff;
  padding: var(--space-lg) var(--space-xl);
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
  flex-wrap: wrap;
  box-shadow: 0 -6px 20px rgba(0,0,0,0.2);
  border-top: 1px solid rgba(255,255,255,0.08);
}
.cookie-banner.is-visible { display: flex; }

.cookie-banner-text {
  font-size: 0.8rem;
  line-height: 1.5;
  flex: 1;
  min-width: 240px;
  color: rgba(255,255,255,0.8);
}

.cookie-banner-actions {
  display: flex;
  gap: var(--space-sm);
  flex-shrink: 0;
  align-items: center;
}

.cookie-btn {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 1.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cookie-btn-accept {
  background: linear-gradient(135deg, #ff6b35, #e85a2a);
  color: #fff;
  padding: 0.6rem 2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(255,107,53,0.3);
}
.cookie-btn-accept:hover {
  background: linear-gradient(135deg, #ff7b45, #f06030);
  box-shadow: 0 4px 16px rgba(255,107,53,0.5);
  transform: translateY(-1px);
}
.cookie-btn-accept:active {
  transform: translateY(0);
}

.cookie-btn-reject {
  background: transparent;
  color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 0.6rem 1.25rem;
}
.cookie-btn-reject:hover {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.3);
}

@media (max-width: 639px) {
  .cookie-banner.is-visible { flex-direction: column; text-align: center; }
  .cookie-banner-actions { width: 100%; justify-content: center; }
  .cookie-btn-accept { flex: 1; }
}

/* --- Footer Nav --- */
.footer-nav {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
}
.footer-nav a {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  text-decoration: none;
}
.footer-nav a:hover { color: var(--color-primary); }

.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-xl) 0;
  margin-top: var(--space-3xl);
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.site-footer p { margin-bottom: var(--space-sm); }

/* --- Legal Pages (Privacy, About) --- */
.legal-page { padding: var(--space-2xl) 0; }
.legal-page .container { max-width: var(--content-width); }
.legal-page h1 { font-size: 2rem; font-weight: 800; margin-bottom: var(--space-sm); }
.legal-updated { font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: var(--space-xl); }
.legal-page h2 { font-size: 1.2rem; font-weight: 700; margin-top: var(--space-xl); margin-bottom: var(--space-sm); }
.legal-page p { margin-bottom: var(--space-md); line-height: 1.7; color: var(--color-text-secondary); }
.legal-page ul { margin-bottom: var(--space-lg); padding-left: var(--space-xl); }
.legal-page li { margin-bottom: var(--space-sm); color: var(--color-text-secondary); }
.legal-page a { color: var(--color-accent); }
.legal-page a:hover { color: var(--color-accent-hover); text-decoration: underline; }

/* --- 404 --- */
.page-404 { text-align: center; padding: var(--space-3xl) 0; }
.page-404 h1 { font-family: var(--font-heading); font-size: 4rem; color: var(--color-accent); margin-bottom: var(--space-md); }
.page-404 p { font-size: 1.125rem; color: var(--color-text-secondary); margin-bottom: var(--space-xl); }

/* --- Share Buttons --- */
.share-buttons {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-lg) 0; margin: var(--space-xl) 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.share-label { font-size: 0.85rem; font-weight: 600; color: var(--color-text-muted); white-space: nowrap; }
.share-links { display: flex; gap: var(--space-sm); }
.share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  color: var(--color-text-secondary); background: var(--color-surface);
  border: 1px solid var(--color-border);
  transition: all .2s;
}
.share-btn:hover { color: #fff; transform: translateY(-2px); }
.share-twitter:hover { background: #000; border-color: #000; }
.share-facebook:hover { background: #1877f2; border-color: #1877f2; }
.share-reddit:hover { background: #ff4500; border-color: #ff4500; }

/* --- Responsive: Tablet (640px+) --- */
@media (min-width: 640px) {
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 3rem; }
  .links-grid { grid-template-columns: repeat(4, 1fr); }
  .overview-grid { grid-template-columns: 1fr 280px; }
  .section-grid { grid-template-columns: repeat(3, 1fr); }
}

/* --- Full-Screen Map Page --- */
.map-full-main { display: flex; flex-direction: column; min-height: calc(100vh - 3.5rem); }
.map-full-main .section-map { flex: 1; display: flex; flex-direction: column; padding: 0; }
.map-full-main .section-map .container { flex: 1; display: flex; flex-direction: column; max-width: none; padding: 0; max-height: 100%; }
.map-full-main .section-map .map-toolbar { padding: 8px 16px; margin: 0; }
.map-full-main .section-map .section-title,
.map-full-main .section-map .section-subtitle { display: none; }
.map-full-main .map-wrapper { flex: 1; min-height: 0; margin: 0; gap: 0; }
.map-full-main .map-filters {
  flex: 0 0 220px;
  padding: 12px 10px;
  font-size: .82rem;
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  max-height: none;
}
.map-full-main .map-container { flex: 1; height: auto; border: none; border-radius: 0; }
.map-full-main .mg-group-title { font-size: .85rem; padding: 6px 8px; }

/* Homepage: Open Full Map button above map */
.map-open-btn {
  display: block; text-align: center; padding: 14px 0 0;
}
.map-open-btn a {
  display: inline-block; padding: 10px 32px;
  background: var(--color-accent); color: #fff;
  border-radius: 6px; font-weight: 600; font-size: .95rem;
  transition: background .2s;
}
.map-open-btn a:hover { background: var(--color-accent-hover); }

/* --- Interactive Map --- */
.section-map {
  padding: var(--space-3xl) 0;
  background: var(--color-surface);
}
.map-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--space-md);
}
.map-total { font-size: .85rem; color: var(--color-text); }
.map-edit-btn {
  padding: 4px 12px; border: 1px solid var(--color-accent);
  background: transparent; color: var(--color-accent);
  border-radius: 4px; cursor: pointer; font-size: .8rem;
}
.map-edit-btn.active, .map-edit-btn:hover { background: var(--color-accent); color: #fff; }
.map-wrapper {
  display: flex; gap: var(--space-lg); min-height: 1200px;
}
.map-filters {
  flex: 0 0 215px; font-size: .8rem; overflow: visible; max-height: none;
}
.mg-group { margin-bottom: 4px; }
.mg-group-row { display: flex; gap: 4px; }
.mg-group-title {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 6px; font-weight: 600; font-size: .82rem;
  border-bottom: 1px solid var(--color-border); margin-bottom: 2px;
}
.mg-toggle {
  background: none; border: none; color: var(--color-accent);
  cursor: pointer; font-size: .72rem; padding: 1px 4px;
}
.mg-group-body { padding: 2px 0; }
.mg-cat {
  display: flex; align-items: center; gap: 5px;
  width: 100%; padding: 3px 6px; border: none; background: none;
  cursor: pointer; font-size: .8rem; text-align: left;
  border-radius: 3px; color: var(--color-text);
}
.mg-cat:hover { background: var(--color-accent); }
.mg-cat.selected { background: var(--color-bg); }
.mg-cat .mg-cnt {
  margin-left: auto; font-size: .7rem; opacity: .5;
  min-width: 18px; text-align: right;
}
.mg-dot { width: 6px; height: 6px; border-radius: 50%; background: #666; flex-shrink: 0; }
.mg-cat[data-cat="complete"] .mg-cat-icon { color: #2ecc71; font-weight: 700; }
.mg-cat[data-cat="incomplete"] .mg-cat-icon { color: #e74c3c; }
.mg-icn-check::before { content: "✓"; }
.mg-icn-circle::before { content: "◌"; }

.map-container {
  flex: 1; height: 1200px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--color-border);
}
.map-container .leaflet-container { background: var(--color-bg); }
.mm { background: transparent !important; border: none !important; }
.leaflet-popup-content-wrapper { border-radius: 6px; font-size: .85rem; }
.leaflet-popup-content { margin: 6px 10px; }
.leaflet-popup-content strong { display: block; margin-bottom: 2px; }

/* ─── Coordinate Picker ─── */
.map-picker {
  margin-top: var(--space-md);
  background: var(--color-bg); border-radius: 8px; overflow: hidden;
  border: 1px solid var(--color-border);
}
.mp-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px; font-weight: 600; font-size: .9rem;
  background: var(--color-accent); color: #fff;
}
.mp-close { background: none; border: none; color: #fff; font-size: 1.2rem; cursor: pointer; }
.mp-body { padding: 12px 14px; }
.mp-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.mp-row label { flex: 0 0 60px; font-size: .8rem; color: var(--color-text); opacity: .7; }
.mp-input {
  flex: 1; padding: 5px 8px; border: 1px solid var(--color-border);
  border-radius: 3px; font-size: .82rem; background: var(--color-surface); color: var(--color-text);
}
.mp-json { width: 100%; min-height: 50px; font-family: monospace; font-size: .8rem; padding: 6px; border: 1px solid var(--color-border); border-radius: 3px; background: var(--color-surface); color: var(--color-text); resize: vertical; }
.mp-actions { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.mp-btn { padding: 5px 14px; border: none; border-radius: 3px; cursor: pointer; font-size: .8rem; }
.mp-btn-primary { background: var(--color-accent); color: #fff; }
.mp-btn-green { background: #2ecc71; color: #fff; }
.mp-copied { font-size: .78rem; color: #2ecc71; }
.mg-reset {
  width: 100%; padding: 6px; margin-top: 8px;
  border: 1px solid var(--color-border); border-radius: 4px;
  background: none; color: var(--color-text); cursor: pointer; font-size: .78rem;
}
.mg-reset:disabled { opacity: .35; cursor: default; }

@media (max-width: 767px) {
  .map-wrapper { flex-direction: column; min-height: auto; }
  .map-wrapper { min-height: 500px; }
  .map-filters { flex: none; max-height: 250px; }
  .map-container { height: 500px; }
  .mp-row { flex-direction: column; align-items: start; }
}

/* --- Responsive: Desktop (1024px+) --- */
@media (min-width: 1024px) {
  .article-grid { grid-template-columns: repeat(3, 1fr); }
  .hero h1 { font-size: 3.25rem; }
  .hero { min-height: 60vh; padding: var(--space-3xl) 0; }
  .article-page-layout { display: grid; grid-template-columns: 220px 1fr; gap: var(--space-2xl); align-items: start; }
  .wiki-sidebar { margin-top: 0; padding-top: 0; border-top: none; position: sticky; top: 5rem; }
  .section-grid { grid-template-columns: repeat(5, 1fr); }
}

/* --- Mobile Nav --- */
@media (max-width: 639px) {
  .mobile-nav-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 3.5rem;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 2px solid var(--color-border);
    flex-direction: column;
    padding: var(--space-md) var(--space-lg);
    gap: var(--space-md);
  }
  .main-nav.open { display: flex; }
  .nav-dropdown { width: 100%; }
  .nav-dropdown-btn { width: 100%; justify-content: space-between; }
  .nav-dropdown-menu { position: static; box-shadow: none; border: 1px solid var(--color-border); margin-top: 4px; width: 100%; }
  .lang-switcher { padding-left: 0; border-left: none; padding-top: var(--space-md); border-top: 1px solid var(--color-border); width: 100%; }
  .lang-current { width: 100%; justify-content: space-between; }
  .lang-dropdown { position: static; box-shadow: none; border: 1px solid var(--color-border); margin-top: 4px; }
  .hero { min-height: auto; background: linear-gradient(180deg, #0a1628 0%, var(--color-primary) 50%, var(--color-bg) 100%); }
  .hero .container { max-width: 100%; margin: 0; padding: 0 var(--space-lg); }
  .hero h1 { font-size: 1.75rem; }
  .article-header h1 { font-size: 1.5rem; }
  .overview-grid { grid-template-columns: 1fr; }
  .links-grid { grid-template-columns: repeat(2, 1fr); }
  .sscroll { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .sscroll { grid-template-columns: 1fr; }
}
