/**
 * style.css — TheLavaSurfer Global Styles
 *
 * Uses CSS custom properties for easy theming.
 * Light mode is default; data-theme="dark" on <html> activates dark mode.
 * Mobile-first responsive design.
 */

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

/* ─────────────────────────────────────────────
   CSS VARIABLES — LIGHT MODE
───────────────────────────────────────────── */
:root {
  --red:      #c8102e;
  --red-dark: #a00d25;
  --dark:     #0d0d0d;
  --mid:      #2b2b2b;
  --muted:    #6b6b6b;
  --light:    #f4f2ee;
  --white:    #ffffff;
  --border:   #e0ddd8;
  --gold:     #b8912a;

  /* Semantic */
  --bg:          var(--white);
  --bg-alt:      var(--light);
  --text:        var(--dark);
  --text-muted:  var(--muted);
  --text-body:   var(--mid);
  --border-col:  var(--border);
  --card-bg:     var(--white);
  --nav-bg:      var(--white);
  --footer-bg:   var(--dark);
  --footer-text: #aaa;

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-serif:   'Source Serif 4', Georgia, serif;

  /* Spacing */
  --container: 1280px;
  --pad: 40px;
}

/* ─────────────────────────────────────────────
   DARK MODE
───────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:          #0d0d0d;
  --bg-alt:      #161616;
  --text:        #f0ede8;
  --text-muted:  #888;
  --text-body:   #bbb;
  --border-col:  #2a2a2a;
  --card-bg:     #161616;
  --nav-bg:      #0d0d0d;
  --footer-bg:   #080808;
}

/* ─────────────────────────────────────────────
   GLOBAL
───────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.2s, color 0.2s;
}

a { text-decoration: none; color: inherit; }

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

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

/* ─────────────────────────────────────────────
   READING PROGRESS BAR
───────────────────────────────────────────── */
#reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--red);
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ─────────────────────────────────────────────
   TICKER
───────────────────────────────────────────── */
.ticker-bar {
  background: var(--dark);
  color: #aaa;
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 6px 0;
  overflow: hidden;
  white-space: nowrap;
  user-select: none;
}

.ticker-track {
  display: inline-block;
  animation: ticker-scroll 40s linear infinite;
}

.ticker-track:hover { animation-play-state: paused; }

.tick-item { margin-right: 48px; }

.tick-sym {
  color: #fff;
  font-weight: 600;
  margin-right: 6px;
}

.tick-val.up { color: #4caf82; }
.tick-val.dn { color: #e85c5c; }
.tick-val em { font-style: normal; }

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ─────────────────────────────────────────────
   TOP BAR
───────────────────────────────────────────── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px var(--pad);
  border-bottom: 1px solid var(--border-col);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  gap: 12px;
}

.top-bar-links { display: flex; gap: 16px; }
.top-bar-links a:hover { color: var(--red); }

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  line-height: 1;
}

/* ─────────────────────────────────────────────
   HEADER
───────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px var(--pad);
  border-bottom: 3px solid var(--text);
  gap: 16px;
}

.site-logo {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--text);
  line-height: 1;
  flex-shrink: 0;
}

.site-logo span { color: var(--red); }
.site-logo.small { font-size: 28px; }

.header-center { text-align: center; flex: 1; }

.header-tagline {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.header-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
  letter-spacing: 0.06em;
}

.header-right { flex-shrink: 0; }

/* ─────────────────────────────────────────────
   BUTTONS
───────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  background: var(--red);
  color: #fff !important;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 9px 20px;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover { background: var(--red-dark); }

.btn-outline {
  display: inline-block;
  background: none;
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 9px 20px;
  border: 1.5px solid var(--border-col);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline:hover { border-color: var(--text); }

/* ─────────────────────────────────────────────
   NAVIGATION
───────────────────────────────────────────── */
.site-nav {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border-col);
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 0 var(--border-col);
}

.nav-links { display: flex; align-items: center; }

.nav-links a {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 16px;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}

.nav-links a:first-child { padding-left: 0; }
.nav-links a:hover,
.nav-links a.active { color: var(--red); border-bottom-color: var(--red); }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: all 0.3s;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 300;
  overflow-y: auto;
}

.mobile-menu.open { display: block; }

.mobile-menu-inner { padding: 24px; }

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--text);
}

.mobile-menu-header button {
  font-size: 28px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}

.mobile-menu a {
  display: block;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  padding: 14px 0;
  border-bottom: 1px solid var(--border-col);
}

.mobile-menu a:hover { color: var(--red); }

/* ─────────────────────────────────────────────
   CATEGORY LABEL
───────────────────────────────────────────── */
.cat-label {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 8px;
}

.cat-label:hover { text-decoration: underline; }

/* ─────────────────────────────────────────────
   ARTICLE CARDS
───────────────────────────────────────────── */
.article-card {
  display: block;
  color: inherit;
}

.article-card:hover .card-title { color: var(--red); }

.card-img {
  width: 100%;
  height: 200px;
  margin-bottom: 14px;
  overflow: hidden;
  position: relative;
}

.card-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.35) 0%, transparent 60%);
}

.card-body {}

.card-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 8px;
  color: var(--text);
  transition: color 0.15s;
}

.card-desc {
  font-family: var(--font-serif);
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.dot { color: var(--border-col); }

/* Hero card */
.hero-card {
  display: block;
  color: inherit;
  position: relative;
}

.hero-card:hover .hero-title { color: var(--red); }

.hero-img {
  width: 100%;
  height: 480px;
  position: relative;
}

.hero-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.1) 60%, transparent 100%);
}

.hero-body {
  padding: 28px 0 0;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.5px;
  color: var(--text);
  margin-bottom: 12px;
  transition: color 0.15s;
}

.hero-desc {
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 14px;
}

/* ─────────────────────────────────────────────
   SECTION HEADERS
───────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 16px;
  border-bottom: 2px solid var(--text);
  margin-bottom: 24px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.see-all {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  border-bottom: 1px solid var(--red);
}

.see-all:hover { color: var(--red-dark); border-color: var(--red-dark); }

/* ─────────────────────────────────────────────
   GRID LAYOUTS
───────────────────────────────────────────── */
.card-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.card-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.card-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* ─────────────────────────────────────────────
   PAGE LAYOUT (main + sidebar)
───────────────────────────────────────────── */
.page-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 56px;
  padding: 36px 0 64px;
}

.content-sidebar {
  border-left: 1px solid var(--border-col);
  padding-left: 32px;
}

.sidebar-widget { margin-bottom: 32px; }

.widget-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--text);
  margin-bottom: 16px;
}

/* ─────────────────────────────────────────────
   SIDEBAR LIST ITEMS
───────────────────────────────────────────── */
.list-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-col);
}

.list-item:last-child { border-bottom: none; }

.list-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  color: var(--border-col);
  min-width: 32px;
  line-height: 1;
  flex-shrink: 0;
}

.list-item a { display: block; flex: 1; }

.list-item h4 {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  transition: color 0.15s;
}

.list-item:hover h4 { color: var(--red); }

.list-item .meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ─────────────────────────────────────────────
   FOOTER
───────────────────────────────────────────── */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 56px 0 24px;
  margin-top: 64px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 220px repeat(3, 1fr);
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid #2a2a2a;
  margin-bottom: 24px;
}

.footer-brand .site-logo { color: #fff; margin-bottom: 14px; display: block; }
.footer-brand p { font-size: 12px; color: #666; line-height: 1.7; }

.footer-col h4 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  font-size: 13px;
  color: #777;
  margin-bottom: 9px;
  transition: color 0.15s;
}

.footer-col a:hover { color: #fff; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #555;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-bottom a { color: #555; }
.footer-bottom a:hover { color: #aaa; }

/* ─────────────────────────────────────────────
   COOKIE BANNER
───────────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 12px;
  z-index: 1000;
  max-width: 560px;
  width: calc(100% - 40px);
  transition: bottom 0.4s ease;
  border-top: 3px solid var(--red);
  border-radius: 2px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.cookie-banner.show { bottom: 20px; }

.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }

.cookie-actions button {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 14px;
  cursor: pointer;
  border: 1.5px solid #555;
  background: none;
  color: #aaa;
  transition: all 0.2s;
}

.cookie-actions button:hover { border-color: #aaa; color: #fff; }

.cookie-accept {
  background: var(--red) !important;
  border-color: var(--red) !important;
  color: #fff !important;
}

/* ─────────────────────────────────────────────
   INTERNAL LINK STYLES
───────────────────────────────────────────── */
.internal-link {
  color: var(--red) !important;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}

.internal-link:hover { color: var(--red-dark) !important; }

/* ─────────────────────────────────────────────
   PAGE HERO (category pages)
───────────────────────────────────────────── */
.page-hero {
  background: var(--bg-alt);
  border-bottom: 2px solid var(--text);
  padding: 36px 0;
  margin-bottom: 32px;
}

.page-hero-inner {
  display: flex;
  align-items: baseline;
  gap: 20px;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--text);
  line-height: 1;
}

.page-hero .hero-count {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

/* ─────────────────────────────────────────────
   LOADING / EMPTY STATES
───────────────────────────────────────────── */
.loading-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.skeleton {
  animation: shimmer 1.5s infinite;
  background: linear-gradient(90deg, var(--bg-alt) 25%, var(--border-col) 50%, var(--bg-alt) 75%);
  background-size: 200% 100%;
  border-radius: 2px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-img  { height: 200px; margin-bottom: 14px; }
.skeleton-text { height: 16px; margin-bottom: 10px; }
.skeleton-text.short { width: 60%; }

.empty-state {
  text-align: center;
  padding: 80px 20px;
  grid-column: 1 / -1;
}

.empty-state h2 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ─────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────── */
@media (max-width: 1100px) {
  :root { --pad: 24px; }
  .card-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  /* Nav: hide links, show hamburger */
  .nav-links { display: none; }
  .hamburger { display: flex; }

  .top-bar-links { display: none; }
  .header-center { display: none; }

  /* Layouts */
  .page-layout { grid-template-columns: 1fr; gap: 0; }
  .content-sidebar {
    border-left: none;
    padding-left: 0;
    border-top: 1px solid var(--border-col);
    padding-top: 28px;
    margin-top: 28px;
  }

  .card-grid-3 { grid-template-columns: repeat(2, 1fr); gap: 20px; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }

  .hero-img { height: 300px; }
  .hero-title { font-size: 28px; }

  .site-logo { font-size: 32px; }
  .page-hero h1 { font-size: 36px; }
}

@media (max-width: 600px) {
  :root { --pad: 16px; }

  .card-grid-3,
  .card-grid-2 { grid-template-columns: 1fr; }

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

  .site-logo { font-size: 26px; }

  .hero-img { height: 240px; }
  .hero-title { font-size: 24px; }

  .page-hero h1 { font-size: 28px; }
}
