/* ============================================================
   D-Believe Brand - Main Stylesheet
   Premium Blog Platform CSS
   ============================================================ */

/* ── CSS Variables (Theme System) ─────────────────────────────── */
:root {
  --primary:       #E63946;
  --primary-dark:  #c1121f;
  --primary-light: #ff6b77;
  --secondary:     #1D2D44;
  --secondary-dark:#0D1B2A;
  --accent:        #F4A261;
  --accent2:       #2EC4B6;

  /* Light Mode */
  --bg:            #F8F9FA;
  --bg-card:       #FFFFFF;
  --bg-elevated:   #F0F2F5;
  --text:          #1A1A2E;
  --text-muted:    #6B7280;
  --text-light:    #9CA3AF;
  --border:        #E5E7EB;
  --border-light:  #F3F4F6;

  --shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:     0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:     0 10px 40px rgba(0,0,0,.15);
  --shadow-xl:     0 20px 60px rgba(0,0,0,.20);

  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     20px;
  --radius-xl:     28px;
  --radius-full:   9999px;

  --font-heading:  'Poppins', sans-serif;
  --font-body:     'Inter', sans-serif;

  --transition:    all .3s cubic-bezier(.4,0,.2,1);
  --transition-fast: all .15s ease;

  --header-h:      72px;
  --container-xl:  1280px;
  --container-lg:  1024px;
}

/* Dark Mode */
[data-theme="dark"] {
  --bg:            #0D1B2A;
  --bg-card:       #1D2D44;
  --bg-elevated:   #162236;
  --text:          #F1F5F9;
  --text-muted:    #94A3B8;
  --text-light:    #64748B;
  --border:        #2A3F5A;
  --border-light:  #1E3048;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.3);
  --shadow-md:     0 4px 16px rgba(0,0,0,.4);
  --shadow-lg:     0 10px 40px rgba(0,0,0,.5);
  --shadow-xl:     0 20px 60px rgba(0,0,0,.6);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background .3s ease, color .3s ease;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
a  { color: var(--primary); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--primary-dark); }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── Typography ──────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p { margin-bottom: 1rem; color: var(--text); }

.text-primary   { color: var(--primary) !important; }
.text-accent    { color: var(--accent) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-gradient  {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Layout ──────────────────────────────────────────────────────── */
.container     { max-width: var(--container-xl); margin: 0 auto; padding: 0 1.5rem; }
.container-lg  { max-width: var(--container-lg); margin: 0 auto; padding: 0 1.5rem; }

.section { padding: 5rem 0; }
.section-sm { padding: 3rem 0; }
.section-lg { padding: 7rem 0; }

.row   { display: flex; flex-wrap: wrap; margin: 0 -0.75rem; }
.col   { flex: 1; padding: 0 0.75rem; }

/* ── Loader ──────────────────────────────────────────────────────── */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #0D1B2A;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2rem;
  transition: opacity .6s ease, visibility .6s ease;
}

#page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#loader-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.loader-brand {
  position: relative;
  z-index: 2;
  text-align: center;
  animation: loaderPulse 2s ease-in-out infinite;
}

.loader-brand .brand-name {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, #fff 0%, #E63946 50%, #F4A261 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.loader-brand .brand-tagline {
  font-family: var(--font-body);
  font-size: .9rem;
  color: rgba(255,255,255,.5);
  letter-spacing: .3em;
  text-transform: uppercase;
  margin-top: .5rem;
}

.loader-bar {
  position: relative;
  z-index: 2;
  width: 200px;
  height: 2px;
  background: rgba(255,255,255,.1);
  border-radius: 2px;
  overflow: hidden;
}

.loader-bar::after {
  content: '';
  position: absolute;
  left: -100%;
  top: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, transparent, #E63946, #F4A261, transparent);
  animation: loaderBar 1.8s ease-in-out infinite;
}

@keyframes loaderPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .85; transform: scale(.98); }
}

@keyframes loaderBar {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* ── Header / Navigation ─────────────────────────────────────────── */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  background: transparent;
  transition: var(--transition);
}

#site-header.scrolled {
  background: rgba(13,27,42,.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,.05);
  box-shadow: var(--shadow-md);
}

[data-theme="light"] #site-header.scrolled {
  background: rgba(248,249,250,.95);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  gap: 2rem;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo .logo-img {
  height: 44px;
  width: auto;
}

.nav-logo .logo-text {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, #E63946);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -.02em;
  line-height: 1;
}

[data-theme="light"] .nav-logo .logo-text {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
}

/* Nav Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.nav-links a {
  padding: .5rem 1rem;
  font-size: .9rem;
  font-weight: 500;
  color: rgba(255,255,255,.8);
  border-radius: var(--radius-full);
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
}

[data-theme="light"] .nav-links a { color: var(--text-muted); }

.nav-links a:hover,
.nav-links a.active {
  color: #fff;
  background: rgba(255,255,255,.1);
}

[data-theme="light"] .nav-links a:hover,
[data-theme="light"] .nav-links a.active {
  color: var(--primary);
  background: rgba(230,57,70,.08);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
}

/* Theme Toggle */
.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.8);
  font-size: 1.1rem;
  transition: var(--transition);
}

[data-theme="light"] .theme-toggle {
  background: var(--border);
  color: var(--text-muted);
}

.theme-toggle:hover { background: var(--primary); color: #fff; }

/* Search Toggle */
.search-toggle {
  width: 44px; height: 44px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.8);
  font-size: 1.1rem;
  transition: var(--transition);
}

[data-theme="light"] .search-toggle { background: var(--border); color: var(--text-muted); }
.search-toggle:hover { background: var(--primary); color: #fff; }

/* Mobile Menu Toggle */
.mobile-toggle {
  display: none;
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  align-items: center; justify-content: center;
  flex-direction: column; gap: 5px;
  background: rgba(255,255,255,.1);
}

.mobile-toggle span {
  display: block; width: 22px; height: 2px;
  background: rgba(255,255,255,.8);
  border-radius: 2px;
  transition: var(--transition);
}

[data-theme="light"] .mobile-toggle { background: var(--border); }
[data-theme="light"] .mobile-toggle span { background: var(--text-muted); }

/* Mobile Nav */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  background: rgba(13,27,42,.98);
  backdrop-filter: blur(20px);
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,.05);
  z-index: 999;
  transform: translateY(-10px);
  opacity: 0;
  transition: var(--transition);
}

[data-theme="light"] .mobile-nav { background: rgba(248,249,250,.98); }

.mobile-nav.open {
  display: block;
  transform: translateY(0);
  opacity: 1;
}

.mobile-nav a {
  display: block;
  padding: .875rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255,255,255,.8);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

[data-theme="light"] .mobile-nav a { color: var(--text-muted); }

.mobile-nav a:hover { color: #fff; background: rgba(230,57,70,.2); }
[data-theme="light"] .mobile-nav a:hover { color: var(--primary); background: rgba(230,57,70,.08); }

/* Search Bar */
.search-bar {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  background: rgba(13,27,42,.98);
  backdrop-filter: blur(20px);
  padding: 1.5rem 2rem;
  z-index: 998;
  transform: translateY(-100%);
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}

[data-theme="light"] .search-bar { background: rgba(248,249,250,.98); box-shadow: var(--shadow-md); }

.search-bar.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}

.search-input-wrap {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
}

.search-input-wrap input {
  width: 100%;
  padding: 1rem 1rem 1rem 3.5rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-lg);
  color: #fff;
  font-size: 1.1rem;
  outline: none;
  transition: var(--transition);
}

[data-theme="light"] .search-input-wrap input {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text);
}

.search-input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(230,57,70,.15);
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,.4);
  font-size: 1.1rem;
}

[data-theme="light"] .search-input-wrap .search-icon { color: var(--text-light); }

/* ── Hero Section ────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
    rgba(13,27,42,.97) 0%,
    rgba(13,27,42,.55) 50%,
    rgba(13,27,42,.15) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: calc(var(--header-h) + 4rem) 0 4rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(230,57,70,.15);
  border: 1px solid rgba(230,57,70,.3);
  color: var(--primary-light);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .4rem 1rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.5rem;
}

.hero-badge .dot {
  width: 6px; height: 6px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(230,57,70,.5); }
  50% { box-shadow: 0 0 0 8px rgba(230,57,70,0); }
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 1.5rem;
  letter-spacing: -.03em;
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(255,255,255,.7);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Featured post card in hero */
.hero-featured {
  position: relative;
  z-index: 2;
}

.hero-card {
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: var(--transition);
}

.hero-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); }

.hero-card-img {
  height: 260px;
  overflow: hidden;
}

.hero-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
}

.hero-card:hover .hero-card-img img { transform: scale(1.05); }

.hero-card-body { padding: 1.5rem; }

.hero-card-cat {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--primary);
  margin-bottom: 1rem;
}

.hero-card-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: .75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .8rem;
  color: rgba(255,255,255,.5);
}

.hero-card-meta span { display: flex; align-items: center; gap: .3rem; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  font-size: .9rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
  border: 2px solid transparent;
  letter-spacing: .01em;
}

.btn-sm  { padding: .5rem 1.25rem; font-size: .82rem; }
.btn-lg  { padding: 1rem 2.25rem; font-size: 1rem; }
.btn-xl  { padding: 1.1rem 2.75rem; font-size: 1.05rem; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 20px rgba(230,57,70,.35);
}
.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(230,57,70,.45);
}

.btn-outline-white {
  border-color: rgba(255,255,255,.4);
  color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.05);
}
.btn-outline-white:hover {
  border-color: rgba(255,255,255,.9);
  color: #fff;
  background: rgba(255,255,255,.1);
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}
.btn-secondary:hover { background: var(--secondary-dark); color: #fff; transform: translateY(-2px); }

.btn-ghost {
  color: var(--text-muted);
  background: transparent;
}
.btn-ghost:hover { color: var(--primary); background: rgba(230,57,70,.08); }

.btn-gradient {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 4px 20px rgba(230,57,70,.3);
}
.btn-gradient:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(230,57,70,.4); color: #fff; }

/* ── Cards ────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border);
}

/* Post Cards */
.post-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.post-card-thumb {
  position: relative;
  overflow: hidden;
  padding-top: 62%;
}

.post-card-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.post-card:hover .post-card-thumb img { transform: scale(1.06); }

.post-card-thumb-placeholder {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-card-cat {
  position: absolute;
  bottom: .75rem;
  left: .75rem;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .75rem;
  background: var(--primary);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-radius: var(--radius-full);
  z-index: 3;
  text-decoration: none;
}

/* Thumb cover link — makes the image area tap to post, not category */
.post-card-thumb-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
}

.post-card-bookmark {
  position: absolute;
  top: .75rem;
  right: .75rem;
  width: 34px; height: 34px;
  background: rgba(13,27,42,.7);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.7);
  font-size: .9rem;
  transition: var(--transition);
}

.post-card-bookmark:hover { background: var(--primary); color: #fff; }

.post-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
}

.post-card-meta span {
  display: flex;
  align-items: center;
  gap: .3rem;
}

.post-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: .75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.post-card-title a { color: inherit; }
.post-card-title a:hover { color: var(--primary); }

.post-card-excerpt {
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  margin-top: auto;
}

.post-author {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.post-author-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}

.post-author-name {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Featured Post Card */
.post-card-featured {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.post-card-featured img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s ease;
  z-index: 0;
}

.post-card-featured:hover img { transform: scale(1.04); }

.post-card-featured::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13,27,42,.95) 0%, rgba(13,27,42,.3) 60%, transparent 100%);
  z-index: 1;
}

.post-card-featured .card-body {
  position: relative;
  z-index: 2;
  padding: 2rem;
}

.post-card-featured .card-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: .75rem;
  line-height: 1.25;
}

.post-card-featured .card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .8rem;
  color: rgba(255,255,255,.6);
}

/* Grid Layouts */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.posts-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
}

/* ── Category Chips ───────────────────────────────────────────────── */
.category-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
  cursor: pointer;
}

.category-chip:hover,
.category-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(230,57,70,.3);
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

/* ── Section Headers ─────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
}

.section-title .accent-line {
  display: block;
  width: 48px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
  margin-top: .75rem;
}

/* ── Newsletter Section ──────────────────────────────────────────── */
.newsletter-section {
  background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--secondary) 100%);
  border-radius: var(--radius-xl);
  padding: 4rem;
  position: relative;
  overflow: hidden;
}

.newsletter-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(230,57,70,.2) 0%, transparent 70%);
  pointer-events: none;
}

.newsletter-form {
  display: flex;
  gap: .75rem;
  max-width: 480px;
}

.newsletter-input {
  flex: 1;
  padding: .875rem 1.25rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-full);
  color: #fff;
  font-size: .9rem;
  outline: none;
  transition: var(--transition);
}

.newsletter-input::placeholder { color: rgba(255,255,255,.4); }

.newsletter-input:focus {
  border-color: var(--primary);
  background: rgba(255,255,255,.12);
}

/* ── Newsletter two-col layout ───────────────────────────────────── */
.newsletter-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

/* ── Trending two-col layout ─────────────────────────────────────── */
.trending-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1.75rem;
  align-items: start;
}

/* ── Sidebar ──────────────────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 2rem; }

.sidebar-widget {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-light);
}

.widget-title {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text);
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

/* Recent Posts Widget */
.recent-post-item {
  display: flex;
  gap: .875rem;
  padding: .875rem 0;
  border-bottom: 1px solid var(--border-light);
}

.recent-post-item:last-child { border-bottom: none; padding-bottom: 0; }
.recent-post-item:first-child { padding-top: 0; }

.recent-post-thumb {
  width: 68px; height: 68px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.recent-post-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.recent-post-item:hover .recent-post-thumb img { transform: scale(1.1); }

.recent-post-info .title {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: .35rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-post-info .title a:hover { color: var(--primary); }

.recent-post-info .meta {
  font-size: .75rem;
  color: var(--text-muted);
  display: flex;
  gap: .5rem;
  align-items: center;
}

/* Tags Widget */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.tag-chip {
  display: inline-flex;
  padding: .3rem .75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: .78rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
}

.tag-chip:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Ad Widget / Ad Slot */
.ad-widget, .ad-slot {
  border-radius: var(--radius-md);
  overflow: hidden;
  text-align: center;
  padding: .75rem;
}

.ad-slot img { max-width: 100%; height: auto; border-radius: 8px; display: inline-block; }

.ad-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--text-light);
  margin-bottom: .5rem;
}

/* ── Blog List Layout ────────────────────────────────────────────── */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2.5rem;
  align-items: start;
}

/* ── Single Post ─────────────────────────────────────────────────── */
.post-hero {
  position: relative;
  height: 60vh;
  min-height: 400px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  margin-bottom: 3rem;
}

.post-hero img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.post-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(13,27,42,.7) 100%);
}

.post-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.post-meta-item {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  color: var(--text-muted);
}

.post-content {
  font-size: 1.1rem;
  line-height: 1.85;
  color: var(--text);
}

.post-content h2, .post-content h3, .post-content h4 {
  margin: 2.5rem 0 1rem;
  font-family: var(--font-heading);
}

.post-content p { margin-bottom: 1.5rem; }

.post-content img {
  width: 100%;
  border-radius: var(--radius-md);
  margin: 2rem 0;
}

.post-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 1.25rem 1.5rem;
  background: var(--bg-elevated);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 2rem 0;
  font-style: italic;
  font-size: 1.15rem;
}

.post-content a { color: var(--primary); text-decoration: underline; }

.post-content code {
  background: var(--bg-elevated);
  padding: .2em .5em;
  border-radius: 4px;
  font-size: .9em;
  color: var(--primary);
}

.post-content pre {
  background: var(--secondary-dark);
  color: #e5e5e5;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 2rem 0;
}

/* Share Bar */
.share-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: .85rem;
  font-weight: 600;
  transition: var(--transition);
}

.share-facebook { background: #1877F2; color: #fff; }
.share-twitter  { background: #1DA1F2; color: #fff; }
.share-whatsapp { background: #25D366; color: #fff; }
.share-copy     { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); }

.share-btn:hover { opacity: .9; transform: translateY(-2px); color: #fff; }
.share-copy:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── Comments ─────────────────────────────────────────────────────── */
.comment-card {
  display: flex;
  gap: 1rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-light);
}

.comment-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.comment-body .author {
  font-weight: 700;
  font-size: .9rem;
  color: var(--text);
  margin-bottom: .25rem;
}

.comment-body .date {
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
}

.comment-body .text {
  font-size: .95rem;
  line-height: 1.65;
  color: var(--text);
}

/* Comment Form */
.comment-form .form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .5rem;
}

.form-control {
  width: 100%;
  padding: .875rem 1.1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: .95rem;
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(230,57,70,.12);
}

textarea.form-control { resize: vertical; min-height: 140px; }

/* ── Breadcrumb ───────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--text-light); }
.breadcrumb .current { color: var(--text); font-weight: 500; }

/* ── Pagination ───────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-top: 3rem;
}

.page-btn {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.page-btn:hover, .page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(230,57,70,.3);
}

/* ── Footer ───────────────────────────────────────────────────────── */
#site-footer {
  background: var(--secondary-dark);
  color: rgba(255,255,255,.7);
  margin-top: auto;
}

.footer-top {
  padding: 5rem 0 3rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.footer-brand .brand-name {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: .75rem;
}

.footer-brand p {
  color: rgba(255,255,255,.5);
  font-size: .9rem;
  line-height: 1.7;
  max-width: 300px;
}

.footer-social {
  display: flex;
  gap: .75rem;
  margin-top: 1.5rem;
}

.social-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.6);
  font-size: 1rem;
  transition: var(--transition);
}

.social-icon:hover { background: var(--primary); color: #fff; transform: translateY(-3px); }

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 3rem;
}

.footer-heading {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: rgba(255,255,255,.3);
  margin-bottom: 1.25rem;
}

.footer-links { display: flex; flex-direction: column; gap: .5rem; }

.footer-links a {
  color: rgba(255,255,255,.55);
  font-size: .9rem;
  transition: var(--transition);
  padding: .2rem 0;
}

.footer-links a:hover { color: var(--primary); padding-left: .5rem; }

.footer-bottom {
  padding: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-bottom p {
  font-size: .85rem;
  color: rgba(255,255,255,.3);
  margin: 0;
}

/* ── About Page ───────────────────────────────────────────────────── */
.about-hero {
  padding: calc(var(--header-h) + 4rem) 0 4rem;
  text-align: center;
  background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--secondary) 100%);
}

.about-hero .title {
  font-size: clamp(2rem, 5vw, 4rem);
  color: #fff;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  border: 1px solid var(--border-light);
  transition: var(--transition);
}

.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.stat-number {
  font-size: 2.5rem;
  font-weight: 900;
  font-family: var(--font-heading);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: .85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: .25rem;
}

/* ── Contact Page ─────────────────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 3rem;
}

.contact-info-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-light);
}

.contact-icon {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, rgba(230,57,70,.15), rgba(244,162,97,.15));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  color: var(--primary);
  flex-shrink: 0;
}

/* ── Alerts & Notifications ──────────────────────────────────────── */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}

.alert-success { background: rgba(46,196,182,.1); border: 1px solid rgba(46,196,182,.3); color: #0d7a73; }
.alert-error   { background: rgba(230,57,70,.1); border: 1px solid rgba(230,57,70,.3); color: var(--primary); }
.alert-warning { background: rgba(244,162,97,.1); border: 1px solid rgba(244,162,97,.3); color: #c0682a; }
.alert-info    { background: rgba(69,123,157,.1); border: 1px solid rgba(69,123,157,.3); color: #2a6080; }

[data-theme="dark"] .alert-success { color: #2EC4B6; }
[data-theme="dark"] .alert-error   { color: var(--primary-light); }
[data-theme="dark"] .alert-warning { color: var(--accent); }
[data-theme="dark"] .alert-info    { color: #7ab8d4; }

/* ── Badges ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: .25rem .65rem;
  font-size: .72rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.badge-primary  { background: rgba(230,57,70,.15); color: var(--primary); }
.badge-success  { background: rgba(46,196,182,.15); color: #0d9488; }
.badge-warning  { background: rgba(244,162,97,.15); color: #c0682a; }
.badge-dark     { background: var(--secondary); color: rgba(255,255,255,.8); }

/* ── Scroll To Top ───────────────────────────────────────────────── */
#scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px; height: 48px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 20px rgba(230,57,70,.4);
  z-index: 900;
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition);
  pointer-events: none;
}

#scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

#scroll-top:hover { background: var(--primary-dark); transform: translateY(-4px); }

/* ── Skeleton Loading ────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--border) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

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

/* ── Reading Progress ────────────────────────────────────────────── */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  z-index: 9999;
  width: 0%;
  transition: width .1s linear;
}

/* ── Breaking News Ticker ────────────────────────────────────────── */
.news-ticker {
  background: var(--primary);
  color: #fff;
  padding: .6rem 0;
  overflow: hidden;
}

.ticker-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.ticker-label {
  background: rgba(0,0,0,.25);
  padding: .2rem .875rem;
  border-radius: var(--radius-full);
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  white-space: nowrap;
  flex-shrink: 0;
}

.ticker-track {
  overflow: hidden;
  flex: 1;
}

.ticker-items {
  display: flex;
  gap: 4rem;
  animation: ticker 30s linear infinite;
  width: max-content;
}

.ticker-items a {
  color: #fff;
  font-size: .875rem;
  font-weight: 500;
  white-space: nowrap;
}

.ticker-items a:hover { opacity: .85; }

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Page Hero (inner pages) ─────────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--secondary) 100%);
  padding: calc(var(--header-h) + 3.5rem) 0 3.5rem;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 80px;
  background: var(--bg);
  clip-path: ellipse(55% 100% at 50% 100%);
}

.page-hero-title {
  font-size: clamp(1.8rem, 4vw, 3rem);
  color: #fff;
  font-weight: 800;
}

.page-hero-sub {
  color: rgba(255,255,255,.6);
  font-size: 1.05rem;
  margin-top: .75rem;
}

/* ── Scroll Reveal Animation ─────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .6s ease, transform .6s ease;
}

.reveal.visible,
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── Site Loader ─────────────────────────────────────────────────── */
#page-loader {
  position: fixed;
  inset: 0;
  background: var(--secondary-dark);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.5rem;
  transition: opacity .7s ease, visibility .7s ease;
}

#page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#page-loader canvas { display: none; }

.loader-brand {
  position: relative;
  z-index: 1;
  text-align: center;
}

.loader-brand .brand-name {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -.02em;
  margin-bottom: .25rem;
}

.loader-brand .brand-tagline {
  font-size: .82rem;
  color: rgba(255,255,255,.45);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.loader-logo-mark {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem; font-weight: 900;
  color: #fff;
  font-family: var(--font-heading);
  margin: 0 auto 1rem;
  box-shadow: 0 8px 32px rgba(230,57,70,.4);
  animation: loader-pulse 1.8s ease-in-out infinite;
}

@keyframes loader-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 32px rgba(230,57,70,.4); }
  50% { transform: scale(1.06); box-shadow: 0 12px 40px rgba(230,57,70,.6); }
}

.loader-bar {
  width: 120px;
  height: 3px;
  background: rgba(255,255,255,.1);
  border-radius: 2px;
  overflow: hidden;
  margin: .75rem auto 0;
  position: relative;
}

.loader-bar::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  animation: loader-bar-anim 1.4s ease-in-out infinite;
}

@keyframes loader-bar-anim {
  0%   { left: -40%; width: 40%; }
  50%  { left: 30%; width: 50%; }
  100% { left: 110%; width: 40%; }
}

.loader-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 2px;
  animation: loader-bar 2s ease-in-out infinite;
}

@keyframes loader-bar {
  0% { width: 0; margin-left: 0; }
  50% { width: 100%; margin-left: 0; }
  100% { width: 0; margin-left: 100%; }
}

/* ── Nav Inner (header.php uses .nav-inner, .nav-logo, .nav-actions) ── */
.nav-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-img {
  height: 38px;
  width: auto;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -.03em;
}

.nav-links { list-style: none; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}

.search-toggle,
.theme-toggle {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.65);
  font-size: 1.05rem;
  background: rgba(255,255,255,.06);
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.search-toggle:hover,
.theme-toggle:hover { background: rgba(255,255,255,.14); color: #fff; }

/* Search Bar (slide-down style, opens below header) */
.search-bar {
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  background: rgba(13,27,42,.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 1.25rem 0;
  z-index: 480;
  transform: translateY(-110%);
  opacity: 0;
  transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .3s ease;
}

.search-bar.open {
  transform: translateY(0);
  opacity: 1;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 1.25rem;
  color: rgba(255,255,255,.35);
  font-size: 1.1rem;
  pointer-events: none;
}

.search-input-wrap input {
  width: 100%;
  padding: .875rem 1.25rem .875rem 3.5rem;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-full);
  color: #fff;
  font-size: 1rem;
  font-family: var(--font-body);
  outline: none;
  transition: var(--transition);
}

.search-input-wrap input:focus {
  border-color: var(--primary);
  background: rgba(255,255,255,.1);
  box-shadow: 0 0 0 3px rgba(230,57,70,.15);
}

.search-input-wrap input::placeholder { color: rgba(255,255,255,.3); }

/* Search overlay */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,27,42,.96);
  backdrop-filter: blur(20px);
  z-index: 600;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: calc(var(--header-h) + 3rem);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}

.search-overlay.open { opacity: 1; visibility: visible; }

.search-box {
  width: 100%;
  max-width: 640px;
  padding: 0 1.5rem;
}

.search-box input {
  width: 100%;
  padding: 1.25rem 1.5rem 1.25rem 3.5rem;
  background: rgba(255,255,255,.07);
  border: 2px solid rgba(255,255,255,.12);
  border-radius: var(--radius-full);
  color: #fff;
  font-size: 1.2rem;
  font-family: var(--font-body);
  outline: none;
  transition: var(--transition);
}

.search-box input:focus { border-color: var(--primary); background: rgba(255,255,255,.1); }
.search-box input::placeholder { color: rgba(255,255,255,.3); }

.search-icon {
  position: absolute;
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,.4);
  font-size: 1.2rem;
  pointer-events: none;
}

/* Flash Messages (public) */
.flash-messages {
  position: fixed;
  top: calc(var(--header-h) + 1rem);
  right: 1.5rem;
  z-index: 800;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-width: 360px;
}

.flash-message {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .875rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: .9rem;
  box-shadow: var(--shadow-lg);
  animation: slideInRight .3s ease;
}

@keyframes slideInRight {
  from { transform: translateX(110%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── About Page ──────────────────────────────────────────────────── */
.about-mission-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.about-values-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ── Utilities ───────────────────────────────────────────────────── */
.d-none    { display: none !important; }
.d-flex    { display: flex; }
.d-grid    { display: grid; }
.d-block   { display: block; }
.mt-1 { margin-top: .5rem; }  .mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.fw-bold  { font-weight: 700; }
.fw-black { font-weight: 900; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; } .gap-3 { gap: 1.5rem; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1199px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 991px) {
  .nav-links { display: none; }
  .mobile-toggle { display: flex; }
  .blog-layout { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .newsletter-section { padding: 2.5rem 1.5rem; }
  .newsletter-form { flex-direction: column; }
}

@media (max-width: 767px) {
  /* ── Base ── */
  :root { --header-h: 60px; }
  body { overflow-x: hidden; }
  .container, .container-lg { padding: 0 1rem; }

  /* ── Header ── */
  #site-header { height: 60px; }
  .nav-inner { height: 60px; gap: 0; }
  .nav-logo .logo-img { height: 36px; }
  .nav-logo .logo-text { font-size: 1.1rem; }
  .nav-actions { gap: .4rem; }
  .theme-toggle, .search-toggle {
    width: 38px; height: 38px; font-size: 1rem;
  }
  .mobile-toggle { display: flex; width: 38px; height: 38px; }

  /* ── Hero — full-bleed mobile ── */
  .hero { min-height: 75vw; max-height: 85vh; }
  .hero-content { padding: 1.5rem; }
  .hero-content .hero-title { font-size: clamp(1.4rem, 5vw, 2.2rem); line-height: 1.2; }
  .hero-content .hero-excerpt { font-size: .875rem; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .hero-badge { font-size: .7rem; padding: .3rem .75rem; }
  .hero-meta { font-size: .75rem; gap: .75rem; flex-wrap: wrap; }
  .hero-actions { flex-direction: row; flex-wrap: wrap; gap: .5rem; }
  .hero-actions .btn { padding: .6rem 1.1rem; font-size: .85rem; }

  /* ── Breaking news ticker ── */
  .breaking-news { padding: .5rem 1rem; font-size: .8rem; }
  .breaking-badge { font-size: .68rem; padding: .2rem .5rem; white-space: nowrap; flex-shrink: 0; }

  /* ── Section spacing ── */
  .section { padding: 2.5rem 0; }
  .section-sm { padding: 1.5rem 0; }
  .section-header { margin-bottom: 1.5rem; gap: .75rem; }
  .section-title { font-size: 1.25rem; }

  /* ── Category filter pills (scrollable row) ── */
  .category-filter {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    gap: .4rem;
  }
  .category-filter::-webkit-scrollbar { display: none; }
  .cat-btn { padding: .45rem .9rem; font-size: .8rem; flex-shrink: 0; white-space: nowrap; }

  /* ── Posts grid → single column ── */
  .posts-grid, .posts-grid-2 { grid-template-columns: 1fr; gap: 1.25rem; }

  /* ── Post card mobile ── */
  .post-card { border-radius: 16px; }
  .post-card-thumb { height: 200px; }
  .post-card-body { padding: 1rem; }
  .post-card-title { font-size: 1rem; line-height: 1.35; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; display: -webkit-box; overflow: hidden; }
  .post-card-excerpt { font-size: .82rem; -webkit-line-clamp: 2; line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
  .post-card-meta { font-size: .72rem; gap: .5rem; flex-wrap: wrap; }
  .post-card-footer { padding-top: .75rem; }
  .post-author-avatar { width: 28px; height: 28px; font-size: .75rem; }
  .post-author-name { font-size: .8rem; }

  /* ── Trending section: horizontal scroll on mobile ── */
  .trending-row {
    display: flex;
    overflow-x: auto;
    gap: 1rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .trending-row::-webkit-scrollbar { display: none; }
  .trending-row .post-card {
    min-width: 75vw;
    max-width: 300px;
    scroll-snap-align: start;
    flex-shrink: 0;
  }

  /* ── Blog layout (sidebar goes below on mobile) ── */
  .blog-layout { grid-template-columns: 1fr; gap: 2rem; }
  .sidebar { order: 2; }

  /* ── Footer ── */
  .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .footer-top { padding: 2.5rem 0 1.5rem; }
  .footer-brand img { max-height: 40px; }
  .footer-heading { font-size: .9rem; margin-bottom: .875rem; }
  .footer-links a { font-size: .875rem; padding: .4rem 0; }
  .footer-social { gap: .5rem; }
  .social-icon { width: 36px; height: 36px; font-size: .95rem; }

  /* ── Footer bottom ── */
  .footer-bottom { flex-direction: column; text-align: center; gap: .5rem; padding: 1.25rem 0; }
  .footer-bottom p { font-size: .82rem; }

  /* ── Post page ── */
  .post-hero { height: 50vw; min-height: 220px; max-height: 360px; }
  .post-layout { grid-template-columns: 1fr; }

  /* Comment form: stack name+email on mobile */
  #comment-form [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* ── Newsletter ── */
  .newsletter-section { padding: 2rem 1rem; border-radius: 16px; }
  .newsletter-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .newsletter-form { flex-direction: column; gap: .75rem; max-width: 100%; }
  .newsletter-form input { padding: .875rem 1rem; font-size: 1rem; }
  .newsletter-form .btn { width: 100%; justify-content: center; padding: .875rem; }

  /* ── Trending ── */
  .trending-layout { grid-template-columns: 1fr; gap: 1.25rem; }
  .trending-layout .post-card-featured { min-height: 260px !important; }

  /* ── About page ── */
  .about-mission-layout { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-values-grid { grid-template-columns: 1fr 1fr; gap: .75rem; }

  /* ── Search bar ── */
  .search-bar { padding: .875rem 0; }
  .search-input-wrap input { padding: .75rem 1rem .75rem 3rem; font-size: .95rem; }

  /* ── Mobile nav ── */
  .mobile-nav {
    top: 60px;
    padding: 1rem;
  }
  .mobile-nav.open {
    display: flex;
    flex-direction: column;
    gap: .25rem;
  }
  .mobile-nav a {
    padding: .875rem 1rem;
    border-radius: 12px;
    font-size: .95rem;
    font-weight: 500;
  }

  /* ── Ads ── */
  .ad-slot { padding: .75rem; border-radius: 12px; }
  .ad-label { font-size: .65rem; }

  /* ── Stats row ── */
  .stats-row { grid-template-columns: 1fr 1fr; gap: .75rem; }

  /* ── Scroll top button ── */
  #scroll-top { bottom: 1.25rem; right: 1.25rem; width: 42px; height: 42px; font-size: 1rem; border-radius: 12px; }
}

@media (max-width: 480px) {
  .container, .container-lg { padding: 0 .875rem; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .hero { min-height: 85vw; }
  .post-card-thumb { height: 180px; }
  /* Post hero full height on tiny screens */
  .post-hero { height: 55vw; }
}
