/* ============================================================
   Graffiti Kings Wiki — Main Stylesheet
   ============================================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;600;700&family=Rajdhani:wght@400;500;600&display=swap');

/* ── CSS Variables ── */
:root {
  --bg:            #0a0a0a;
  --bg-secondary:  #111111;
  --neon-gold:     #FFD700;
  --neon-cyan:     #00FFFF;
  --neon-pink:     #FF00FF;
  --neon-lime:     #39FF14;
  --text:          #e8e8e8;
  --text-dim:      #aaaaaa;
  --accent-border: #333;
}

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

/* ── Body ── */
body {
  background: #0a0a0a;
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  min-height: 100vh;
}

/* ── Matrix Canvas ── */
.matrix-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.07;
  pointer-events: none;
}

/* ── Site Wrapper ── */
.site-wrapper {
  position: relative;
  z-index: 1;
}

/* ── Header ── */
.site-header {
  background: rgba(0, 0, 0, 0.95);
  border-bottom: 2px solid var(--neon-gold);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.logo-link {
  text-decoration: none;
}

.site-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.6rem;
  color: var(--neon-gold);
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
}

/* ── Navigation ── */
.main-nav {
  display: flex;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-family: 'Oswald', sans-serif;
  letter-spacing: 1px;
  transition: all 0.3s;
}

.nav-links a:hover {
  color: var(--neon-gold);
  text-shadow: 0 0 10px var(--neon-gold);
}

/* ── Hamburger ── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--neon-gold);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ── Search Bar ── */
.search-container {
  position: relative;
}

.search-input {
  background: var(--bg-secondary);
  border: 1px solid var(--neon-cyan);
  border-radius: 4px;
  color: var(--text);
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.95rem;
  padding: 0.45rem 1rem;
  outline: none;
  width: 220px;
  transition: box-shadow 0.3s;
}

.search-input:focus {
  box-shadow: 0 0 12px rgba(0, 255, 255, 0.4);
}

.search-input::placeholder {
  color: var(--text-dim);
}

/* ── Hero ── */
.hero {
  position: relative;
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(180deg, #0a0a0a 0%, #111111 100%);
  border-bottom: 2px solid #222;
}

.hero-logo img {
  max-width: 90%;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.5));
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.4)); }
  50%       { filter: drop-shadow(0 0 50px rgba(255, 215, 0, 0.9)); }
}

.hero-title {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(2rem, 5vw, 4rem);
  color: var(--neon-gold);
  text-transform: uppercase;
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
  letter-spacing: 5px;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--neon-cyan);
  letter-spacing: 3px;
  margin: 1rem 0;
}

.tagline {
  color: var(--text-dim);
  max-width: 700px;
  margin: 1rem auto;
  line-height: 1.8;
}

/* ── Content Layout ── */
.content-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
}

/* ── Sidebar ── */
.sidebar {
  background: var(--bg-secondary);
  border: 1px solid #222;
  border-radius: 8px;
  padding: 1.5rem;
  height: fit-content;
  position: sticky;
  top: 80px;
}

.sidebar-section {
  margin-bottom: 2rem;
}

.sidebar-title {
  font-family: 'Oswald', sans-serif;
  color: var(--neon-gold);
  font-size: 0.9rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-bottom: 1px solid #333;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.sidebar-links a {
  display: block;
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
  padding-left: 0.8rem;
  transition: all 0.3s;
}

.sidebar-links a:hover {
  color: var(--neon-gold);
  border-left-color: var(--neon-gold);
}

/* ── Main Content ── */
.main-content {
  padding: 0 0 0 2rem;
}

/* ── Page Logo ── */
.page-logo img {
  max-width: 90%;
  height: auto;
  display: block;
  margin: 2rem auto;
  filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.4));
}

/* ── Page Title ── */
.page-title {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  color: var(--neon-gold);
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  margin-bottom: 0.5rem;
  border-bottom: 3px solid var(--neon-gold);
  padding-bottom: 0.8rem;
}

.page-subtitle {
  color: var(--neon-cyan);
  letter-spacing: 2px;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

/* ── Infobox ── */
.infobox {
  float: right;
  width: 320px;
  margin: 0 0 2rem 2rem;
  background: rgba(255, 215, 0, 0.03);
  border: 1px solid var(--neon-gold);
  border-radius: 8px;
  overflow: hidden;
}

.infobox-title {
  background: var(--neon-gold);
  color: #000;
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  padding: 0.8rem 1rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.infobox table {
  width: 100%;
  border-collapse: collapse;
}

.infobox td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid #222;
  font-size: 0.9rem;
}

.infobox td:first-child {
  color: var(--neon-gold);
  font-weight: bold;
  width: 40%;
}

.infobox-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

/* ── Table of Contents ── */
.toc {
  background: rgba(0, 255, 255, 0.03);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.toc-title {
  font-family: 'Oswald', sans-serif;
  color: var(--neon-cyan);
  font-size: 1rem;
  margin-bottom: 1rem;
  letter-spacing: 2px;
}

.toc ol {
  padding-left: 1.5rem;
}

.toc li {
  margin: 0.4rem 0;
}

.toc a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.3s;
}

.toc a:hover {
  color: var(--neon-cyan);
}

/* ── Article Sections ── */
.section {
  margin-bottom: 3rem;
}

.section-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  color: var(--neon-gold);
  border-bottom: 2px solid #333;
  padding-bottom: 0.6rem;
  margin-bottom: 1.2rem;
  letter-spacing: 2px;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--neon-gold);
  box-shadow: 0 0 10px var(--neon-gold);
}

.subsection-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.2rem;
  color: var(--neon-cyan);
  margin: 1.5rem 0 0.8rem;
  letter-spacing: 1px;
}

p {
  line-height: 1.8;
  margin-bottom: 1.2rem;
  color: var(--text);
}

/* ── Quote Block ── */
.quote-block {
  border-left: 4px solid var(--neon-pink);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: rgba(255, 0, 255, 0.05);
  font-style: italic;
  color: var(--text-dim);
}

.highlight {
  color: var(--neon-gold);
  font-weight: bold;
}

/* ── Gallery ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.gallery-item {
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
  transition: transform 0.3s;
}

.gallery-item:hover {
  transform: scale(1.03);
}

.gallery-item-placeholder {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: var(--neon-cyan);
}

.gallery-caption {
  padding: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  border-top: 1px solid #222;
}

/* ── Citations ── */
.citations {
  margin-top: 3rem;
  border-top: 2px solid #222;
  padding-top: 2rem;
}

.citation-title {
  font-family: 'Oswald', sans-serif;
  color: var(--neon-pink);
  font-size: 1.2rem;
  margin-bottom: 1rem;
  letter-spacing: 2px;
}

.citation-item {
  margin-bottom: 1.5rem;
  padding: 1rem 1.2rem;
  background: rgba(255, 0, 255, 0.03);
  border-left: 3px solid var(--neon-pink);
  border-radius: 0 8px 8px 0;
}

.citation-number {
  color: var(--neon-pink);
  font-weight: bold;
  margin-right: 0.5rem;
}

.citation-text {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ── Key Facts Table ── */
.key-facts-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.key-facts-table th {
  background: rgba(255, 215, 0, 0.1);
  color: var(--neon-gold);
  font-family: 'Oswald', sans-serif;
  letter-spacing: 1px;
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--neon-gold);
}

.key-facts-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #222;
  color: var(--text);
  font-size: 0.95rem;
}

.key-facts-table tr:hover td {
  background: rgba(255, 215, 0, 0.03);
}

/* ── Faction Cards ── */
.factions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.faction-card {
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.3s;
}

.faction-card:hover {
  border-color: var(--neon-gold);
  background: rgba(255, 215, 0, 0.05);
  transform: translateY(-2px);
}

.faction-card-title {
  font-family: 'Oswald', sans-serif;
  color: var(--neon-gold);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.faction-card-desc {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ── Tag Badge ── */
.tag-badge {
  display: inline-block;
  padding: 0.2rem 0.8rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: bold;
  margin: 0.2rem;
  background: rgba(255, 215, 0, 0.1);
  color: var(--neon-gold);
  border: 1px solid rgba(255, 215, 0, 0.3);
}

/* ── Character Carousel ── */
.carousel-container {
  overflow: hidden;
  position: relative;
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease;
}

.carousel-item {
  min-width: 200px;
  margin: 0 0.5rem;
  text-align: center;
}

/* ── Character Card ── */
.character-card {
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.3s;
}

.character-portrait {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  border: 2px solid var(--neon-gold);
}

.character-name {
  font-family: 'Oswald', sans-serif;
  color: var(--neon-gold);
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.character-faction {
  color: var(--neon-cyan);
  font-size: 0.8rem;
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  font-family: 'Oswald', sans-serif;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}

.btn-primary {
  background: var(--neon-gold);
  color: #000;
}

.btn-primary:hover {
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.btn-outline {
  border: 1px solid var(--neon-gold);
  color: var(--neon-gold);
  background: transparent;
}

.btn-outline:hover {
  background: rgba(255, 215, 0, 0.1);
}

/* ── Footer ── */
.site-footer {
  background: #050505;
  border-top: 2px solid #222;
  padding: 3rem 2rem;
  text-align: center;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.3s;
}

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

.footer-copy {
  color: #555;
  font-size: 0.85rem;
  margin-top: 1rem;
}

/* ── Scanlines ── */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.05) 2px,
    rgba(0, 0, 0, 0.05) 4px
  );
  pointer-events: none;
  z-index: 2;
  opacity: 0.4;
}

/* ── Timeline ── */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--neon-gold), var(--neon-cyan));
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  padding-left: 2rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.4rem;
  top: 0.4rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--neon-gold);
  box-shadow: 0 0 10px var(--neon-gold);
}

.timeline-year {
  font-family: 'Oswald', sans-serif;
  color: var(--neon-gold);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.timeline-content {
  background: rgba(255, 215, 0, 0.03);
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1.5rem;
}

.timeline-event-title {
  font-family: 'Oswald', sans-serif;
  color: var(--neon-cyan);
  font-size: 1.1rem;
  margin-bottom: 0.6rem;
}

/* ── Graffiti Divider ── */
.graffiti-divider {
  height: 3px;
  background: linear-gradient(to right, transparent, var(--neon-gold), var(--neon-cyan), transparent);
  margin: 2rem 0;
  position: relative;
}

/* ── Search Results ── */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #111;
  border: 1px solid #333;
  border-radius: 0 0 8px 8px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 200;
}

.search-result-item {
  display: block;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #222;
  text-decoration: none;
  transition: background 0.2s;
  cursor: pointer;
}

.search-result-item:hover {
  background: rgba(255, 215, 0, 0.05);
}

.search-result-title {
  color: var(--neon-gold);
  font-size: 0.95rem;
}

.search-result-type {
  color: var(--text-dim);
  font-size: 0.75rem;
}

/* ============================================================
   Mobile Responsive
   ============================================================ */
@media (max-width: 900px) {
  .hamburger {
    display: flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #000;
    border-bottom: 2px solid var(--neon-gold);
    padding: 1rem 2rem;
    z-index: 99;
  }

  .nav-open .main-nav {
    display: block;
  }

  .nav-links {
    flex-direction: column;
    gap: 1rem;
  }

  .content-wrapper {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .main-content {
    padding: 0;
  }

  .infobox {
    float: none;
    width: 100%;
    margin: 2rem 0;
  }

  .search-input {
    width: 150px;
  }
}
