/* ================================================
   MENELDOR — style.css
   Shared styles for all pages
   ================================================ */

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

:root {
  --gold: #c9a84c;
  --gold-light: #e8d5a3;
  --gold-dim: rgba(201,168,76,0.3);
  --dark: #0a0a0a;
  --dark-mid: #111111;
  --off-white: #f5f2ec;
  --text-muted: rgba(245,242,236,0.72);
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--dark);
  color: var(--off-white);
  font-family: 'Raleway', sans-serif;
  font-weight: 300;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.5rem 3rem;
  background: rgba(10,10,10,0.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(201,168,76,0.12);
  transition: background 0.4s;
}

/* Home page overrides nav background to be transparent over video */
nav.transparent {
  background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
}
nav.transparent.scrolled {
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(8px);
}

.nav-logo img {
  height: 80px;
  fill: white; /* SVG fill */
  filter: brightness(0) invert(1); /* works for both SVG and PNG */
}

.nav-center {
  display: flex;
  gap: 2.8rem;
  list-style: none;
}

.nav-center a {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--off-white);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s, color 0.2s;
}

.nav-center a:hover { opacity: 1; color: var(--gold); }
.nav-center a.active { opacity: 1; color: var(--gold); }

.nav-flag {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-flag img {
  width: 76px;
  height: auto;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.2);
  opacity: 0.95;
}

/* ── THEME TOGGLE ── */
.theme-toggle {
  background: none;
  border: 1px solid rgba(201,168,76,0.35);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  color: var(--off-white);
  transition: border-color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--gold);
  background: rgba(201,168,76,0.08);
}

/* ── LIGHT MODE ── */
body.light-mode,
html.light-mode body {
  --dark: #f5f0e8;
  --dark-mid: #ebe5d8;
  --off-white: #1a1710;
  --text-muted: rgba(20,18,10,0.72);
  --gold: #9a6e1a;
  --gold-light: #7a5510;
  background: #f5f0e8;
  color: #1a1710;
}

/* Nav */
body.light-mode nav,
html.light-mode nav {
  background: rgba(245,240,232,0.97);
  border-bottom: 1px solid rgba(154,110,26,0.2);
}
body.light-mode nav.scrolled,
html.light-mode nav.scrolled {
  background: rgba(245,240,232,0.98);
}
body.light-mode .nav-center a,
html.light-mode .nav-center a { color: var(--off-white); }

/* Logos — invert in light mode */
body.light-mode .nav-logo img,
body.light-mode footer img,
html.light-mode .nav-logo img,
html.light-mode footer img { filter: brightness(0); }
body.light-mode .merch-emblem,
body.light-mode .resources-emblem,
html.light-mode .merch-emblem,
html.light-mode .resources-emblem { filter: brightness(0) !important; }

/* Hero — keep original dark-mode appearance since it's over a video */
body.light-mode .hero-icon,
html.light-mode .hero-icon { filter: brightness(0) invert(1); }
body.light-mode .hero-wordmark,
html.light-mode .hero-wordmark { filter: brightness(0) invert(1); }
body.light-mode .hero-tagline,
html.light-mode .hero-tagline { color: #e8d5a3; }
body.light-mode .hero-cta,
html.light-mode .hero-cta { color: #f5f2ec; border-color: rgba(201,168,76,0.5); }
body.light-mode .hero-cta:hover,
html.light-mode .hero-cta:hover { background: #c9a84c; border-color: #c9a84c; color: #0a0a0a; }
body.light-mode .scroll-hint,
html.light-mode .scroll-hint { color: #f5f2ec; }
body.light-mode .scroll-hint span,
html.light-mode .scroll-hint span { color: #f5f2ec; }

/* Feature cards — keep readable dark background in light mode */
body.light-mode .feature-card,
html.light-mode .feature-card { background: #2a2520; }
body.light-mode .feature-card:hover,
html.light-mode .feature-card:hover { background: #3a3028; }
body.light-mode .feature-card h3,
body.light-mode .feature-card p,
html.light-mode .feature-card h3,
html.light-mode .feature-card p { color: #f5f2ec; }

/* Post cards — keep readable dark background in light mode */
body.light-mode .post-card,
html.light-mode .post-card { background: #2a2520; }
body.light-mode .post-card:hover,
html.light-mode .post-card:hover { background: #3a3028; }
body.light-mode .post-card h3,
html.light-mode .post-card h3 { color: #f5f2ec; }
body.light-mode .post-card .post-excerpt,
body.light-mode .post-card .post-meta,
html.light-mode .post-card .post-excerpt,
html.light-mode .post-card .post-meta { color: rgba(245,242,236,0.65); }
body.light-mode .post-card .post-category,
html.light-mode .post-card .post-category { color: #c9a84c; }

/* Article body text — dark on cream */
body.light-mode .article-body p,
html.light-mode .article-body p { color: rgba(20,18,10,0.85); }
body.light-mode .article-body blockquote,
html.light-mode .article-body blockquote { color: rgba(20,18,10,0.75); border-left-color: rgba(154,110,26,0.5); }
body.light-mode .article-title,
html.light-mode .article-title { color: #1a1710; }
body.light-mode .article-back,
html.light-mode .article-back { color: rgba(20,18,10,0.6); }
body.light-mode .article-back:hover,
html.light-mode .article-back:hover { color: #9a6e1a; }
body.light-mode .article-byline,
html.light-mode .article-byline { color: rgba(20,18,10,0.6); }

/* About / general page text */
body.light-mode .about-section p,
html.light-mode .about-section p { color: rgba(20,18,10,0.78); }
body.light-mode .intro p,
html.light-mode .intro p { color: rgba(20,18,10,0.72); }

/* Toggle button */
body.light-mode .theme-toggle,
html.light-mode .theme-toggle {
  color: var(--off-white);
  border-color: rgba(154,110,26,0.4);
}

/* ── PAGE HEADER (Articles, About) ── */
.page-header {
  padding: 10rem 3rem 4rem;
  text-align: center;
  border-bottom: 1px solid rgba(201,168,76,0.15);
  margin-bottom: 0;
}

.page-label {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.8;
  margin-bottom: 1.2rem;
}

.page-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 300;
  color: var(--off-white);
  letter-spacing: 2px;
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid rgba(201,168,76,0.15);
  padding: 3rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
}

footer img {
  height: 80px;
  filter: brightness(0) invert(1);
  opacity: 0.5;
}

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

.footer-links a {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--text-muted);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
}

.footer-links a svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

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

.footer-copy {
  font-size: 14px;
  color: var(--text-muted);
  opacity: 0.4;
  font-family: 'Cinzel', serif;
  letter-spacing: 1px;
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ── ARTICLE GLOBAL STYLES ── */
.article-body a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(201,168,76,0.35);
  transition: border-color 0.2s, color 0.2s;
}
.article-body a:hover {
  border-color: var(--gold);
}
.article-body a:hover {
  opacity: 1;
}

.article-body p {
  font-size: 1.25rem;
  line-height: 2;
  color: rgba(245,242,236,0.82);
  margin-bottom: 1.8rem;
}

.article-body blockquote {
  border-left: 2px solid rgba(201,168,76,0.4);
  margin: 2rem 0;
  padding: 0.5rem 0 0.5rem 1.8rem;
  font-style: italic;
  font-size: 1.25rem;
  line-height: 1.9;
  color: rgba(245,242,236,0.78);
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 2rem;
  transition: color 0.2s;
}
.article-back:hover { color: var(--gold); }

.article-category {
  font-family: 'Cinzel', serif;
  font-size: 13px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.8;
  margin-bottom: 1.4rem;
}

.article-meta {
  font-family: 'Cinzel', serif;
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.article-byline {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 3rem 4rem;
  font-family: 'Cinzel', serif;
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ── CONTACT EMAIL LINK ── */
.contact-email {
  display: inline-block;
  font-family: 'Cinzel', serif;
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(201,168,76,0.35);
  transition: border-color 0.2s, color 0.2s;
}
.contact-email:hover {
  color: var(--gold-light);
  border-color: var(--gold-light);
}

/* ── FEATURES (three pillars) ── */
.features {
  padding: 4rem 3rem 4rem !important;
}

/* ══════════════════════════════════════
   TABLET — 769px to 1180px (covers iPad 10th gen at 1180 CSS px)
   ══════════════════════════════════════ */

@media (min-width: 769px) and (max-width: 1180px) {
  nav { padding: 0.8rem 1.2rem; }
  .nav-logo img { height: 44px; }
  .nav-center { gap: 0.9rem; }
  .nav-center a { font-size: 10px; letter-spacing: 1.5px; white-space: nowrap; }
  .nav-flag { gap: 10px; }
  .nav-flag img { width: 44px; }
  .theme-toggle { width: 28px; height: 28px; font-size: 13px; }
}

/* ══════════════════════════════════════
   MOBILE RESPONSIVE — 768px and below
   ══════════════════════════════════════ */

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  position: relative;
  z-index: 600;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--off-white);
  transition: transform 0.3s, opacity 0.3s;
}
.nav-hamburger--open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger--open span:nth-child(2) { opacity: 0; }
.nav-hamburger--open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {

  nav { padding: 1rem 1.5rem; z-index: 1000; }
  .nav-logo img { height: 52px; }
  .nav-flag { gap: 12px; margin-left: auto; margin-right: 1rem; }
  .nav-flag img { width: 48px; }
  .theme-toggle { width: 30px; height: 30px; font-size: 14px; }
  .nav-hamburger { display: flex; z-index: 1100; }

  .nav-center {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
    background: #0a0a0a;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    z-index: 900;
    list-style: none;
    padding-top: 0;
    padding-bottom: 200px; /* offsets the nav bar height so links sit slightly above true center, balancing the X button */
    margin: 0;
    overflow-y: auto;
  }
  .nav-center.nav-open { display: flex; }
  .nav-center li { width: 100%; text-align: center; }
  .nav-center a { font-size: 18px; letter-spacing: 4px; opacity: 1; display: block; padding: 0.6rem 0; }
  body.light-mode .nav-center { background: #f5f0e8 !important; }
  body.light-mode .nav-center a { color: #1a1710; }

  /* Lock scroll when nav is open */
  html.nav-is-open { overflow: hidden; }


  .features { grid-template-columns: 1fr !important; padding: 2rem 1.5rem !important; }
  .intro { padding: 4rem 1.5rem; }
  .posts-grid { grid-template-columns: 1fr !important; }
  .post-card.featured { grid-row: span 1; }
  .posts-section { padding: 4rem 1.5rem; }
  .page-header { padding: 7rem 1.5rem 3rem; }
  .article-header { padding: 7rem 1.5rem 3rem !important; }
  .article-body { padding: 2rem 1.5rem 4rem !important; }
  .article-body p { font-size: 1.05rem; }
  .article-body blockquote { font-size: 1rem; padding-left: 1.2rem; }
  .article-byline { padding: 0 1.5rem 3rem; }
  .sources-section { padding: 2rem 1.5rem 4rem !important; }
  .video-grid { grid-template-columns: 1fr !important; }
  .content-warning { margin: 1rem 1.5rem 0; }
  .about-wrap { padding: 3rem 1.5rem 5rem; }

  footer { padding: 2rem 1.5rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
  footer img { height: 48px; }
  .footer-links { order: 2; }
  .footer-copy { order: 3; width: 100%; text-align: center; }
}
