/* ═══════════════════════════════════════════════════════════════
   JJNews — Premium News Platform Design System
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset ── */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
img,video{display:block;max-width:100%}
button{cursor:pointer;border:none;background:none}

/* ── Design Tokens ── */
:root{
  --bg:        #07090e;
  --bg2:       #0c0f18;
  --surface:   #111520;
  --surface2:  #181d2c;
  --surface3:  #1f2436;
  --border:    #252b3b;
  --border2:   #2e3650;

  /* accent overridden dynamically via <style> in head */
  --accent:    #4f8ef7;
  --accent-rgb:79,142,247;
  --a10:       rgba(79,142,247,.1);
  --a20:       rgba(79,142,247,.2);

  --cat-ai:    #4f8ef7;
  --cat-fin:   #22c55e;
  --cat-tech:  #a855f7;

  --text:      #eef0f8;
  --text2:     #9aa3be;
  --muted:     #5a6480;

  --success:   #22c55e;
  --danger:    #ef4444;
  --warn:      #f59e0b;

  --r:         8px;
  --r-lg:      14px;
  --r-xl:      20px;

  --ease:      cubic-bezier(.4,0,.2,1);
  --t:         .18s var(--ease);
  --t-slow:    .35s var(--ease);

  --shadow-sm: 0 2px 12px rgba(0,0,0,.35);
  --shadow:    0 8px 32px rgba(0,0,0,.5);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.6);

  --max-w:     1280px;
  --font:      'Inter',system-ui,-apple-system,sans-serif;
  --mono:      'JetBrains Mono','Fira Code',monospace;
}

/* ── Base ── */
html{scroll-behavior:smooth;font-size:16px;-webkit-font-smoothing:antialiased}
body{
  font-family:var(--font);
  background:var(--bg);
  color:var(--text);
  line-height:1.65;
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

h1,h2,h3,h4,h5{line-height:1.2;font-weight:700;letter-spacing:-.02em}
h1{font-size:clamp(1.75rem,4vw,2.8rem)}
h2{font-size:clamp(1.35rem,3vw,2rem)}
h3{font-size:clamp(1.1rem,2.5vw,1.4rem)}
p{margin-bottom:1rem;color:var(--text2)}
a{color:var(--accent);text-decoration:none;transition:color var(--t)}
a:hover{color:var(--text)}
strong{color:var(--text);font-weight:600}

/* ── Utilities ── */
.container{width:100%;max-width:var(--max-w);margin:0 auto;padding:0 1.25rem}
@media(min-width:640px){.container{padding:0 1.75rem}}
@media(min-width:1024px){.container{padding:0 2.5rem}}

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

/* Category badge */
.badge{
  display:inline-flex;align-items:center;gap:.3rem;
  padding:.22em .65em;border-radius:4px;
  font-size:.7rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
  white-space:nowrap;
}
.badge-ai   {background:rgba(79,142,247,.15);color:var(--cat-ai)}
.badge-fin  {background:rgba(34,197,94,.15); color:var(--cat-fin)}
.badge-tech {background:rgba(168,85,247,.15);color:var(--cat-tech)}

.dot{width:7px;height:7px;border-radius:50%;display:inline-block;flex-shrink:0}
.dot-ai  {background:var(--cat-ai)}
.dot-fin {background:var(--cat-fin)}
.dot-tech{background:var(--cat-tech)}

/* Buttons */
.btn{
  display:inline-flex;align-items:center;gap:.4rem;
  padding:.55rem 1.25rem;border-radius:var(--r);
  font-family:var(--font);font-size:.9rem;font-weight:600;
  transition:all var(--t);white-space:nowrap;
}
.btn-primary{background:var(--accent);color:#fff}
.btn-primary:hover{background:rgba(var(--accent-rgb),.8);color:#fff;transform:translateY(-1px)}
.btn-ghost{background:transparent;color:var(--text2);border:1px solid var(--border2)}
.btn-ghost:hover{border-color:var(--accent);color:var(--accent)}
.btn-sm{padding:.35rem .85rem;font-size:.8rem}
.btn-danger{background:var(--danger);color:#fff}
.btn-danger:hover{background:#dc2626;color:#fff}

/* ═══════════════════════════════════════════════
   HEADER / NAV
   ═══════════════════════════════════════════════ */
.site-header{
  position:sticky;top:0;z-index:200;
  background:rgba(7,9,14,.88);
  backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);
  border-bottom:1px solid var(--border);
}
.header-inner{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  height:62px;
  gap:1.5rem;
}
.logo{display:flex;align-items:center;gap:.6rem;flex-shrink:0}
.logo-text{
  font-size:1.45rem;font-weight:800;letter-spacing:-.04em;
  background:linear-gradient(135deg,var(--accent),var(--cat-tech));
  -webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;
}
.logo-img{height:36px;width:auto}

.main-nav{
  display:flex;align-items:center;justify-content:center;gap:.15rem;
  list-style:none;overflow-x:auto;scrollbar-width:none;
}
.main-nav::-webkit-scrollbar{display:none}
.main-nav a{
  padding:.4rem .75rem;border-radius:6px;
  color:var(--text2);font-size:.875rem;font-weight:500;
  transition:all var(--t);white-space:nowrap;
}
.main-nav a:hover,.main-nav a.active{color:var(--text);background:var(--surface2)}

.header-actions{display:flex;align-items:center;gap:.5rem;flex-shrink:0}
.icon-btn{
  display:flex;align-items:center;justify-content:center;
  width:38px;height:38px;border-radius:8px;
  color:var(--text2);transition:all var(--t);
}
.icon-btn:hover{background:var(--surface2);color:var(--text)}
.icon-btn svg{width:18px;height:18px;stroke-width:1.75}
.hamburger-btn{display:none}

/* Search overlay */
.search-overlay{
  position:fixed;top:0;left:0;right:0;z-index:400;
  background:var(--surface);border-bottom:1px solid var(--border);
  padding:1rem 1.5rem;
  display:flex;align-items:center;gap:1rem;
  transform:translateY(-110%);transition:transform var(--t-slow);
}
.search-overlay.open{transform:translateY(0)}
.search-form{display:flex;flex:1;align-items:center;gap:.75rem;max-width:700px;margin:0 auto}
.search-input{
  flex:1;background:var(--surface2);border:1px solid var(--border2);
  border-radius:var(--r);padding:.6rem 1rem;
  color:var(--text);font-size:1rem;font-family:var(--font);
  transition:border-color var(--t);
}
.search-input:focus{outline:none;border-color:var(--accent)}
.search-close{color:var(--text2);font-size:1.5rem;padding:.25rem;flex-shrink:0}

/* Mobile drawer */
.mobile-drawer{
  position:fixed;top:0;right:0;bottom:0;width:280px;z-index:500;
  background:var(--surface);border-left:1px solid var(--border);
  padding:2rem 1.5rem;
  transform:translateX(100%);transition:transform var(--t-slow);
  display:flex;flex-direction:column;gap:1.5rem;overflow-y:auto;
}
.mobile-drawer.open{transform:translateX(0)}
.drawer-close{align-self:flex-end;color:var(--text2)}
.drawer-nav{list-style:none;display:flex;flex-direction:column;gap:.25rem}
.drawer-nav a{
  display:flex;align-items:center;gap:.75rem;padding:.65rem .85rem;
  border-radius:var(--r);color:var(--text2);font-size:.95rem;font-weight:500;
  transition:all var(--t);
}
.drawer-nav a:hover{background:var(--surface2);color:var(--text)}
.drawer-nav .drawer-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}
.drawer-backdrop{
  position:fixed;inset:0;z-index:490;
  background:rgba(0,0,0,.6);
  opacity:0;pointer-events:none;transition:opacity var(--t-slow);
}
.drawer-backdrop.open{opacity:1;pointer-events:all}

/* ═══════════════════════════════════════════════
   TICKER BAR
   ═══════════════════════════════════════════════ */
.ticker-bar{
  background:var(--surface);
  border-bottom:1px solid var(--border);
  padding:.4rem 0;overflow:hidden;
}
.ticker-inner{display:flex;align-items:center}
.ticker-label{
  background:var(--accent);color:#fff;
  padding:.28rem .75rem;font-size:.68rem;font-weight:700;
  letter-spacing:.1em;text-transform:uppercase;
  white-space:nowrap;flex-shrink:0;margin-right:1rem;
  border-radius:0 4px 4px 0;
}
.ticker-track{overflow:hidden;flex:1}
.ticker-content{
  display:flex;gap:2.5rem;white-space:nowrap;
  animation:ticker-scroll 40s linear infinite;
}
.ticker-content:hover{animation-play-state:paused}
.ticker-item{
  font-size:.8rem;color:var(--text2);flex-shrink:0;
  display:flex;align-items:center;gap:.6rem;
}
.ticker-item::before{content:'◆';font-size:.5rem;color:var(--muted)}
.ticker-item a{color:var(--text2);transition:color var(--t)}
.ticker-item a:hover{color:var(--accent)}
@keyframes ticker-scroll{
  from{transform:translateX(0)}
  to{transform:translateX(-50%)}
}

/* ═══════════════════════════════════════════════
   AD LAYOUT SYSTEM  v2.0
   Controlled entirely via DB — no HTML edits needed.
   Disabled slots produce ZERO output (no wrapper, no gap).
   ═══════════════════════════════════════════════ */
.ad-outer{width:100%;box-sizing:border-box}
.ad-inner{display:flex;align-items:flex-start;width:100%}
/* Single: centred in the content column */
.ad-single{justify-content:center}
/* Double: side-by-side on desktop, stacked on mobile */
.ad-double{flex-wrap:wrap;gap:15px;justify-content:center}
.ad-block{overflow:hidden;flex-shrink:0;max-width:100%;box-sizing:border-box}
/* Placeholder shown when no script is pasted yet */
.ad-ph{
  display:flex;align-items:center;justify-content:center;
  background:var(--surface);border:1px dashed var(--border);
  border-radius:var(--r);color:var(--muted);
  font-size:.68rem;letter-spacing:.07em;text-transform:uppercase;
  min-height:90px;min-width:120px;padding:1rem;text-align:center;
}
@media(max-width:640px){
  .ad-double{flex-direction:column;align-items:center}
}

/* ═══════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════ */
.hero{
  position:relative;
  height:clamp(400px,62vh,700px);
  overflow:hidden;background:var(--bg2);
}
.hero-img{
  position:absolute;inset:0;width:100%;height:100%;
  object-fit:cover;opacity:.45;
  transition:transform 8s ease;
}
.hero:hover .hero-img{transform:scale(1.03)}
.hero-gradient{
  position:absolute;inset:0;
  background:linear-gradient(
    180deg,
    rgba(7,9,14,0) 0%,
    rgba(7,9,14,.55) 45%,
    rgba(7,9,14,.97) 100%
  );
}
.hero-gradient-left{
  position:absolute;inset:0;
  background:linear-gradient(90deg,rgba(7,9,14,.65) 0%,transparent 60%);
}
.hero-content{
  position:absolute;bottom:0;left:0;right:0;
  padding:0 0 2.5rem;
}
.hero-content .container{
  display:flex;flex-direction:column;align-items:flex-start;gap:.75rem;
}
.hero-badge{
  padding:.28rem .75rem;border-radius:4px;
  font-size:.68rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase;
  color:#fff;background:var(--accent);
}
.hero-title{
  font-size:clamp(1.65rem,4vw,3rem);font-weight:800;
  line-height:1.12;max-width:680px;
  text-shadow:0 2px 24px rgba(0,0,0,.6);
}
.hero-title a{color:var(--text)}
.hero-title a:hover{color:rgba(var(--accent-rgb),.9)}
.hero-excerpt{
  font-size:.95rem;color:var(--text2);max-width:540px;
  line-height:1.55;margin-bottom:.25rem;
}
.hero-meta{
  display:flex;align-items:center;gap:1.25rem;
  font-size:.78rem;color:var(--muted);flex-wrap:wrap;
}
.hero-meta span{display:flex;align-items:center;gap:.35rem}
.hero-meta svg{width:13px;height:13px;stroke-width:2;flex-shrink:0}
.hero-read-btn{
  display:inline-flex;align-items:center;gap:.4rem;
  padding:.55rem 1.3rem;background:var(--accent);color:#fff;
  border-radius:6px;font-weight:600;font-size:.88rem;
  transition:all var(--t);
}
.hero-read-btn:hover{background:rgba(var(--accent-rgb),.8);color:#fff;transform:translateY(-1px)}
.hero-no-image{
  position:absolute;inset:0;
  background:linear-gradient(135deg,var(--bg2),var(--surface));
  display:flex;align-items:center;justify-content:center;
  font-size:5rem;opacity:.2;
}

/* ═══════════════════════════════════════════════
   SECTION HEADERS
   ═══════════════════════════════════════════════ */
.section-header{
  display:flex;align-items:center;justify-content:space-between;
  gap:1rem;padding:2rem 0 1.1rem;
}
.section-title-group{display:flex;align-items:center;gap:.65rem}
.section-stripe{
  width:3px;height:22px;border-radius:2px;
  background:var(--accent);flex-shrink:0;
}
.section-stripe.s-fin  {background:var(--cat-fin)}
.section-stripe.s-tech {background:var(--cat-tech)}
.section-label{
  font-size:.78rem;font-weight:700;text-transform:uppercase;
  letter-spacing:.1em;color:var(--muted);
}
.see-all{
  font-size:.8rem;font-weight:600;color:var(--text2);
  transition:color var(--t);white-space:nowrap;
  display:flex;align-items:center;gap:.25rem;
}
.see-all:hover{color:var(--accent)}

/* ═══════════════════════════════════════════════
   HOMEPAGE GRID
   ═══════════════════════════════════════════════ */
.homepage-body{padding:2rem 0 3rem}
.homepage-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:2rem;
}
@media(min-width:900px){
  .homepage-grid{grid-template-columns:1fr 300px}
}

/* Latest posts: 2-col on medium screens */
.latest-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:1.25rem;
}
@media(min-width:560px){
  .latest-grid{grid-template-columns:repeat(2,1fr)}
}

/* ═══════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════ */
.card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--r-lg);
  overflow:hidden;
  display:flex;flex-direction:column;
  transition:transform var(--t),box-shadow var(--t),border-color var(--t);
}
.card:hover{
  transform:translateY(-3px);
  box-shadow:var(--shadow);
  border-color:var(--border2);
}
.card-img-wrap{position:relative;overflow:hidden}
.card-img{
  width:100%;aspect-ratio:16/9;object-fit:cover;
  transition:transform var(--t-slow);
}
.card:hover .card-img{transform:scale(1.04)}
.card-img-ph{
  width:100%;aspect-ratio:16/9;
  background:linear-gradient(135deg,var(--surface2),var(--surface3));
  display:flex;align-items:center;justify-content:center;
  font-size:2.25rem;
}
.card-body{padding:1rem 1.1rem;flex:1;display:flex;flex-direction:column;gap:.5rem}
.card-meta{display:flex;align-items:center;gap:.6rem;font-size:.72rem;color:var(--muted)}
.card-meta time{margin-left:auto}
.card-title{font-size:.97rem;font-weight:700;line-height:1.3;color:var(--text)}
.card-title a{color:inherit;transition:color var(--t)}
.card-title a:hover{color:var(--accent)}
.card-title.clamp2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.card-title.clamp3{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.card-desc{font-size:.83rem;color:var(--muted);line-height:1.5;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
  flex:1;}
.card-footer{
  padding:.65rem 1.1rem;border-top:1px solid var(--border);
  display:flex;align-items:center;justify-content:space-between;
  font-size:.75rem;color:var(--muted);
}
.read-link{color:var(--accent);font-weight:600;font-size:.78rem;display:flex;align-items:center;gap:.25rem}

/* Card - horizontal (list view) */
.card-h{
  display:flex;flex-direction:row;gap:0;
  border-radius:var(--r-lg);overflow:hidden;
  background:var(--surface);border:1px solid var(--border);
  transition:transform var(--t),box-shadow var(--t),border-color var(--t);
}
.card-h:hover{transform:translateY(-2px);box-shadow:var(--shadow-sm);border-color:var(--border2)}
.card-h .card-img{width:110px;height:80px;aspect-ratio:unset;flex-shrink:0;border-radius:0}
.card-h .card-img-ph{width:80px;height:80px;aspect-ratio:unset;flex-shrink:0;font-size:1.4rem;border-radius:0}
.card-h .card-body{padding:.65rem .85rem;gap:.3rem}
.card-h .card-title{font-size:.86rem}
.card-h .card-meta{font-size:.7rem}

/* ═══════════════════════════════════════════════
   TRENDING SIDEBAR
   ═══════════════════════════════════════════════ */
.sidebar-widget{
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--r-lg);padding:1.25rem;
  display:flex;flex-direction:column;gap:.85rem;
}
.widget-title{
  font-size:.72rem;font-weight:700;letter-spacing:.1em;
  text-transform:uppercase;color:var(--muted);
  border-bottom:1px solid var(--border);padding-bottom:.6rem;
}
.trend-list{list-style:none;display:flex;flex-direction:column;gap:.75rem}
.trend-item{
  display:flex;gap:.75rem;align-items:flex-start;
  padding-bottom:.75rem;border-bottom:1px solid var(--border);
}
.trend-item:last-child{border-bottom:none;padding-bottom:0}
.trend-num{
  font-size:1.2rem;font-weight:800;color:var(--border2);
  flex-shrink:0;line-height:1;min-width:24px;
}
.trend-info{display:flex;flex-direction:column;gap:.2rem}
.trend-info a{font-size:.85rem;font-weight:600;color:var(--text);line-height:1.3;transition:color var(--t)}
.trend-info a:hover{color:var(--accent)}
.trend-info span{font-size:.72rem;color:var(--muted);display:flex;align-items:center;gap:.3rem}

/* ═══════════════════════════════════════════════
   CATEGORY CAROUSELS
   ═══════════════════════════════════════════════ */
.cat-section{padding:0 0 2.5rem;border-top:1px solid var(--border)}
.carousel-wrap{position:relative}
.carousel-track{
  display:flex;gap:1.25rem;
  overflow-x:auto;scroll-snap-type:x mandatory;
  scrollbar-width:none;-webkit-overflow-scrolling:touch;
  padding-bottom:.5rem;
}
.carousel-track::-webkit-scrollbar{display:none}
.carousel-card{flex:0 0 260px;scroll-snap-align:start}
@media(min-width:640px){.carousel-card{flex-basis:280px}}
@media(min-width:900px){.carousel-card{flex-basis:300px}}

.carousel-btn{
  position:absolute;top:50%;transform:translateY(-50%);
  width:36px;height:36px;border-radius:50%;
  background:var(--surface2);border:1px solid var(--border2);
  color:var(--text);font-size:1.2rem;
  display:flex;align-items:center;justify-content:center;
  transition:all var(--t);z-index:10;
  box-shadow:var(--shadow-sm);
}
.carousel-btn:hover{background:var(--accent);border-color:var(--accent);color:#fff}
.carousel-btn-prev{left:-18px}
.carousel-btn-next{right:-18px}
@media(max-width:900px){.carousel-btn{display:none}}

/* ═══════════════════════════════════════════════
   CATEGORY PAGE
   ═══════════════════════════════════════════════ */
.cat-hero{
  padding:3rem 0 2rem;
  border-bottom:1px solid var(--border);
}
.cat-hero-label{
  display:flex;align-items:center;gap:.6rem;margin-bottom:.6rem;
}
.cat-stripe{width:4px;height:28px;border-radius:2px;flex-shrink:0}
.cat-stripe-ai  {background:var(--cat-ai)}
.cat-stripe-fin {background:var(--cat-fin)}
.cat-stripe-tech{background:var(--cat-tech)}
.cat-hero-title{margin-bottom:.4rem}
.cat-hero-sub{color:var(--muted);font-size:.9rem}
.cat-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
  gap:1.25rem;
  padding:2rem 0;
}
.cat-layout{
  display:grid;
  grid-template-columns:1fr;
  gap:2rem;
  padding:2rem 0;
}
@media(min-width:900px){.cat-layout{grid-template-columns:1fr 280px}}

/* ═══════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════ */
.pagination{
  display:flex;justify-content:center;gap:.4rem;
  padding:2rem 0;flex-wrap:wrap;
}
.pagination a,.pagination span{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:38px;height:38px;padding:0 .75rem;
  border-radius:var(--r);font-size:.85rem;font-weight:600;
  border:1px solid var(--border);color:var(--text2);transition:all var(--t);
}
.pagination a:hover{border-color:var(--accent);color:var(--accent)}
.pagination .pg-active{background:var(--accent);border-color:var(--accent);color:#fff}

/* ═══════════════════════════════════════════════
   SINGLE POST
   ═══════════════════════════════════════════════ */
.post-hero-wrap{
  position:relative;max-height:500px;overflow:hidden;
  background:var(--surface);
}
.post-hero-img{
  width:100%;max-height:500px;object-fit:cover;
  display:block;
}
.post-hero-gradient{
  position:absolute;bottom:0;left:0;right:0;height:200px;
  background:linear-gradient(0deg,var(--bg) 0%,transparent 100%);
}

.post-layout{
  display:grid;grid-template-columns:1fr;
  gap:2.5rem;padding:2rem 0 3rem;
}
@media(min-width:900px){.post-layout{grid-template-columns:1fr 300px}}

.post-header{margin-bottom:1.75rem}
.post-header .badge{margin-bottom:.85rem}
.post-title{font-size:clamp(1.65rem,4vw,2.5rem);margin-bottom:.85rem;color:var(--text)}
.post-meta-bar{
  display:flex;flex-wrap:wrap;gap:1rem;
  font-size:.8rem;color:var(--muted);align-items:center;
  padding:.85rem 0;border-top:1px solid var(--border);border-bottom:1px solid var(--border);
  margin-bottom:2rem;
}
.post-meta-bar span{display:flex;align-items:center;gap:.35rem}
.post-meta-bar svg{width:13px;height:13px;stroke-width:2;flex-shrink:0}

/* Article typography */
.prose{font-size:1.05rem;line-height:1.75;color:var(--text2)}
.prose h2{
  font-size:clamp(1.3rem,3vw,1.7rem);color:var(--text);
  margin:2.25rem 0 .75rem;
  padding-top:1.5rem;border-top:1px solid var(--border);
}
.prose h3{font-size:1.2rem;color:var(--text);margin:1.75rem 0 .6rem}
.prose h4{font-size:1rem;color:var(--text);margin:1.25rem 0 .5rem}
.prose p{margin-bottom:1.25rem}
.prose a{color:var(--accent);border-bottom:1px solid rgba(var(--accent-rgb),.3)}
.prose a:hover{border-color:var(--accent)}
.prose ul,.prose ol{padding-left:1.5rem;margin-bottom:1.25rem}
.prose li{margin-bottom:.4rem}
.prose li p{margin-bottom:.25rem}
.prose blockquote{
  border-left:3px solid var(--accent);
  padding:.85rem 1.25rem;margin:1.75rem 0;
  background:var(--surface);border-radius:0 var(--r) var(--r) 0;
  color:var(--text2);font-style:italic;
}
.prose blockquote p{margin:0;color:var(--text2)}
.prose table{width:100%;border-collapse:collapse;margin:1.75rem 0;font-size:.92rem}
.prose th,.prose td{padding:.6rem .9rem;border:1px solid var(--border);text-align:left}
.prose th{background:var(--surface2);color:var(--text);font-weight:600;font-size:.85rem}
.prose td{color:var(--text2)}
.prose pre{
  background:var(--surface2);border:1px solid var(--border);
  border-radius:var(--r);padding:1.25rem 1.5rem;
  overflow-x:auto;margin:1.75rem 0;font-family:var(--mono);font-size:.87rem;
}
.prose code{
  background:var(--surface2);border:1px solid var(--border);
  padding:.15em .4em;border-radius:4px;font-family:var(--mono);font-size:.87em;color:var(--text);
}
.prose pre code{background:none;border:none;padding:0;color:inherit}
.prose img{border-radius:var(--r-lg);margin:2rem 0}
.prose hr{border:none;border-top:1px solid var(--border);margin:2rem 0}
.prose strong{color:var(--text)}
.prose em{color:var(--text2)}

/* Affiliate CTA */
.affiliate-cta{
  display:flex;flex-wrap:wrap;align-items:center;gap:1rem;justify-content:space-between;
  padding:1.35rem 1.5rem;margin:2rem 0;
  background:linear-gradient(135deg,rgba(var(--accent-rgb),.08),rgba(168,85,247,.08));
  border:1px solid rgba(var(--accent-rgb),.25);border-radius:var(--r-lg);
}
.affiliate-cta p{margin:0;color:var(--text);font-weight:500}

/* ═══════════════════════════════════════════════
   POST SIDEBAR
   ═══════════════════════════════════════════════ */
.post-sidebar{display:flex;flex-direction:column;gap:1.5rem}
.post-sidebar .sidebar-widget{position:sticky;top:80px}
.related-list{list-style:none;display:flex;flex-direction:column;gap:.75rem}
.related-item{
  padding-bottom:.75rem;border-bottom:1px solid var(--border);
  display:flex;flex-direction:column;gap:.25rem;
}
.related-item:last-child{border-bottom:none;padding-bottom:0}
.related-item a{font-size:.88rem;font-weight:600;color:var(--text);line-height:1.3;transition:color var(--t)}
.related-item a:hover{color:var(--accent)}
.related-item span{font-size:.72rem;color:var(--muted)}
.topic-pills{display:flex;flex-wrap:wrap;gap:.5rem}
.topic-pill{
  padding:.3rem .75rem;border-radius:999px;
  font-size:.75rem;font-weight:600;border:1px solid var(--border2);
  color:var(--text2);transition:all var(--t);
}
.topic-pill:hover{border-color:var(--accent);color:var(--accent)}

/* ═══════════════════════════════════════════════
   SEARCH PAGE
   ═══════════════════════════════════════════════ */
.search-header{padding:2.5rem 0 1.5rem;border-bottom:1px solid var(--border)}
.search-header h1 span{color:var(--accent)}
.search-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
  gap:1.25rem;
  padding:2rem 0;
}
.no-results{
  text-align:center;padding:5rem 0;
  display:flex;flex-direction:column;align-items:center;gap:1rem;
}
.no-results svg{width:48px;height:48px;stroke:var(--muted);stroke-width:1.5;opacity:.5}
.no-results h3{color:var(--text)}
.no-results p{color:var(--muted)}

/* ═══════════════════════════════════════════════
   404
   ═══════════════════════════════════════════════ */
.error-page{
  min-height:70vh;display:flex;align-items:center;justify-content:center;
  text-align:center;padding:2rem;flex-direction:column;gap:1rem;
}
.error-code{font-size:clamp(5rem,15vw,10rem);font-weight:900;color:var(--border2);line-height:1}
.error-page h2{color:var(--text)}
.error-page p{color:var(--muted);max-width:400px}

/* ═══════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════ */
.site-footer{
  margin-top:auto;
  background:var(--surface);border-top:1px solid var(--border);
  padding:3rem 0 1.75rem;
}
.footer-grid{
  display:grid;gap:2rem;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  margin-bottom:2.25rem;
}
.footer-brand .logo-text{font-size:1.2rem}
.footer-brand p{color:var(--muted);font-size:.85rem;margin-top:.5rem;line-height:1.55}
.footer-col h4{
  font-size:.75rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
  color:var(--muted);margin-bottom:.85rem;
}
.footer-col ul{list-style:none;display:flex;flex-direction:column;gap:.5rem}
.footer-col ul a{color:var(--text2);font-size:.87rem;transition:color var(--t)}
.footer-col ul a:hover{color:var(--accent)}
.footer-bottom{
  border-top:1px solid var(--border);padding-top:1.5rem;
  display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;
  gap:.75rem;font-size:.78rem;color:var(--muted);
}
.footer-links{display:flex;gap:1rem;flex-wrap:wrap}
.footer-links a{color:var(--muted);transition:color var(--t)}
.footer-links a:hover{color:var(--accent)}

/* ═══════════════════════════════════════════════
   FLASH MESSAGES
   ═══════════════════════════════════════════════ */
.flash-list{list-style:none;display:flex;flex-direction:column;gap:.5rem;margin-bottom:1rem}
.flash{padding:.75rem 1rem;border-radius:var(--r);font-size:.9rem;font-weight:500;transition:opacity var(--t)}
.flash-success{background:rgba(34,197,94,.1);border:1px solid rgba(34,197,94,.25);color:#4ade80}
.flash-error  {background:rgba(239,68,68,.1);border:1px solid rgba(239,68,68,.25);color:#f87171}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media(max-width:768px){
  .main-nav{display:none}
  .hamburger-btn{display:flex}
  .hero-content .container{padding:0 1.25rem}
  .post-layout{grid-template-columns:1fr}
  .cat-layout{grid-template-columns:1fr}
}
@media(max-width:480px){
  .ad-double{flex-direction:column;align-items:center}
}
