/* =========================================================
   LEGO Batman: Legacy of the Dark Knight — Guide Site
   Design System: Dark Gotham Aesthetic
   ========================================================= */

/* --- CSS Custom Properties --- */
:root {
  /* Colors */
  --bg-page: #0d0d1a;
  --bg-card: #1a1a2e;
  --bg-nav: #0a0a1a;
  --bg-hero-start: #0a0a1a;
  --bg-hero-mid: #1a1a2e;
  --bg-hero-end: #0d0d1a;
  --text-primary: #e0e0f0;
  --text-secondary: #8888aa;
  --text-muted: #666688;
  --accent: #f5c518;
  --accent-hover: #ffd633;
  --border: #2a2a4a;
  --border-light: #3a3a5a;
  --success: #2ecc71;
  --danger: #e74c3c;
  --info: #3498db;

  /* Typography */
  --font-heading: "Oswald", "Impact", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;

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

  /* Layout */
  --max-width: 1200px;
  --content-width: 800px;
  --sidebar-width: 280px;
  --header-height: 64px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

/* --- 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);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  color: var(--accent-hover);
}

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

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
}

h1 { font-size: 3rem; letter-spacing: 0.02em; }
h2 { font-size: 2.25rem; margin-bottom: var(--space-lg); }
h3 { font-size: 1.5rem; margin-bottom: var(--space-md); }
h4 { font-size: 1.125rem; margin-bottom: var(--space-sm); }

p { margin-bottom: var(--space-md); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent); }

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

.content-container {
  max-width: var(--content-width);
  margin: 0 auto;
}

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

/* --- Header / Navigation --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.site-logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.site-logo:hover {
  color: var(--accent-hover);
}

.site-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--bg-nav);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-sm);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  list-style: none;
}

.nav-menu a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-sm) 0;
  position: relative;
  transition: color 0.2s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--accent);
}

.nav-menu a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.2s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
  width: 100%;
}

/* --- Hero Section --- */
.hero {
  background: linear-gradient(180deg, var(--bg-hero-start) 0%, var(--bg-hero-mid) 50%, var(--bg-hero-end) 100%);
  padding: var(--space-4xl) 0 var(--space-3xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(245, 197, 24, 0.03) 0%, transparent 60%);
  animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  0% { transform: translate(0, 0); opacity: 0.5; }
  100% { transform: translate(5%, 5%); opacity: 1; }
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  margin-bottom: var(--space-md);
  text-transform: uppercase;
}

.hero h1 .highlight {
  color: var(--accent);
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-xl);
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  background: var(--accent);
  color: var(--bg-page);
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.hero-cta:hover {
  background: var(--accent-hover);
  color: var(--bg-page);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(245, 197, 24, 0.3);
}

/* --- Section Cards Grid --- */
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
  padding: var(--space-3xl) 0;
}

.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.section-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.section-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.section-card:hover::before {
  opacity: 1;
}

.section-card .card-icon {
  font-size: 2rem;
  margin-bottom: var(--space-md);
}

.section-card h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
  color: #fff;
}

.section-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* --- Page Content --- */
.page-content {
  padding: var(--space-3xl) 0;
}

.page-header {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  margin-bottom: var(--space-sm);
}

.page-header .meta {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* --- Breadcrumbs --- */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--text-secondary);
}

.breadcrumbs a:hover {
  color: var(--accent);
}

.breadcrumbs .separator {
  color: var(--text-muted);
}

.breadcrumbs .current {
  color: var(--text-primary);
}

/* --- Article Content --- */
.article-content {
  max-width: var(--content-width);
  margin: 0 auto;
}

.article-content h2 {
  margin-top: var(--space-2xl);
}

.article-content h3 {
  margin-top: var(--space-xl);
}

.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 blockquote {
  border-left: 3px solid var(--accent);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
  background: var(--bg-card);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-secondary);
}

.article-content code {
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-lg) 0;
  font-size: 0.9rem;
}

.article-content th,
.article-content td {
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border: 1px solid var(--border);
}

.article-content th {
  background: var(--bg-card);
  font-family: var(--font-heading);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
}

.article-content td {
  color: var(--text-primary);
}

.article-content tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

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

.empty-section .icon {
  font-size: 3rem;
  margin-bottom: var(--space-lg);
}

.empty-section h3 {
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.empty-section p {
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
}

/* --- Tags & Difficulty --- */
.difficulty-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.difficulty-badge.beginner {
  background: rgba(46, 204, 113, 0.15);
  color: var(--success);
}

.difficulty-badge.intermediate {
  background: rgba(245, 197, 24, 0.15);
  color: var(--accent);
}

.difficulty-badge.advanced {
  background: rgba(231, 76, 60, 0.15);
  color: var(--danger);
}

/* --- Footer --- */
.site-footer {
  background: var(--bg-nav);
  border-top: 1px solid var(--border);
  padding: var(--space-2xl) 0;
  margin-top: var(--space-4xl);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  text-align: center;
}

.footer-inner p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.footer-links a:hover {
  color: var(--accent);
}

/* --- Cookie Overlay --- */
.cookie-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(5, 5, 15, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
}

.cookie-overlay.show {
  display: block;
}

/* --- Cookie Consent --- */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, var(--bg-card) 0%, #1e1e34 100%);
  border-top: 2px solid var(--accent);
  padding: var(--space-lg) var(--space-lg);
  z-index: 200;
  display: none;
  font-size: 0.9rem;
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4);
}

.cookie-consent.show {
  display: block;
}

.cookie-consent-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.cookie-content {
  flex: 1;
  min-width: 200px;
}

.cookie-content p {
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
  line-height: 1.5;
}

.cookie-buttons {
  display: flex;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.cookie-btn {
  padding: var(--space-sm) var(--space-xl);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cookie-btn.accept {
  background: linear-gradient(135deg, var(--accent) 0%, #e0b010 100%);
  color: var(--bg-page);
  box-shadow: 0 0 20px rgba(245, 197, 24, 0.25);
}

.cookie-btn.accept:hover {
  background: linear-gradient(135deg, var(--accent-hover) 0%, #f0c020 100%);
  box-shadow: 0 0 30px rgba(245, 197, 24, 0.45);
  transform: translateY(-2px) scale(1.02);
}

.cookie-btn.accept:active {
  transform: translateY(0) scale(0.98);
}

.cookie-btn.decline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.cookie-btn.decline:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
  background: rgba(255, 255, 255, 0.03);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-nav);
    flex-direction: column;
    padding: var(--space-md);
    border-bottom: 1px solid var(--border);
    gap: 0;
  }

  .nav-menu.open {
    display: flex;
  }

  .nav-menu a {
    display: block;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border);
  }

  .nav-menu a:last-child {
    border-bottom: none;
  }

  .section-grid {
    grid-template-columns: 1fr;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.25rem; }

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

  .cookie-consent-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .section-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
