/*
Theme Name: Rewindsk Magazine
Theme URI: https://rewindsk.com
Author: Rewindsk
Description: Fast SEO-optimized magazine theme. Poppins, red-vine palette, dark mode, live blog.
Version: 3.0.0
License: GPL-2.0-or-later
Text Domain: rewindsk
Tags: magazine, blog, dark-mode, fast, seo, custom-menu, featured-images, threaded-comments, responsive
*/

/* ── VARIABLES ─────────────────────────────────────── */
:root {
  --rv-red:      #8B0000;
  --rv-red-h:    #a80000;
  --rv-vine:     #6B2737;
  --rv-wine:     #4a1020;

  --bg:          #ffffff;
  --bg2:         #faf5f5;
  --bg3:         #f3eaea;
  --card:        #ffffff;
  --hdr:         #ffffff;

  --t1:          #160808;
  --t2:          #3d1a1a;
  --t3:          #7a5050;
  --t4:          #b08080;

  --border:      #e8d4d4;
  --border2:     #f0e4e4;

  --accent:      #8B0000;
  --accent-h:    #a80000;
  --accent-lite: #fdf2f2;

  --link:        #8B0000;
  --sh-sm:       0 1px 4px rgba(139,0,0,.07);
  --sh:          0 4px 16px rgba(139,0,0,.10);
  --sh-lg:       0 8px 32px rgba(139,0,0,.16);

  --r:           8px;
  --r-lg:        12px;
  --hdr-h:       60px;

  --live-bg:     #0f0608;
  --live-line:   #3a1520;
  --live-dot:    #e74c3c;
}

[data-theme="dark"] {
  --bg:          #0c0606;
  --bg2:         #160c0c;
  --bg3:         #1e1010;
  --card:        #1a0d0d;
  --hdr:         #0e0707;
  --t1:          #f5e8e8;
  --t2:          #d4a8a8;
  --t3:          #9a7070;
  --t4:          #6a5050;
  --border:      #3a2020;
  --border2:     #2a1616;
  --accent:      #c0392b;
  --accent-h:    #e74c3c;
  --accent-lite: #200e0e;
  --link:        #e05555;
  --sh-sm:       0 1px 4px rgba(0,0,0,.3);
  --sh:          0 4px 16px rgba(0,0,0,.4);
  --sh-lg:       0 8px 32px rgba(0,0,0,.55);
  --live-bg:     #070304;
  --live-line:   #2a1018;
}

/* ── RESET ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
  overflow-x: hidden;
  max-width: 100vw;
}
body {
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  background: var(--bg);
  color: var(--t1);
  transition: background .25s, color .25s;
  overflow-x: hidden;
  max-width: 100%;
}
img    { max-width: 100%; height: auto; display: block }
a      { color: var(--link); text-decoration: none; transition: color .15s }
a:hover{ color: var(--accent-h) }
ul     { list-style: none }
button { cursor: pointer; border: none; background: none; font-family: inherit }
input, textarea { font-family: inherit }

/* ── LAYOUT ────────────────────────────────────────── */
.wrap {
  max-width: min(1200px, 100%);
  margin: 0 auto;
  padding: 0 20px;
}
@media (max-width: 480px) { .wrap { padding: 0 12px } }

.site-grid {
  display: grid;
  grid-template-columns: 1fr 296px;
  gap: 32px;
  align-items: start;
  min-width: 0;
}
@media (max-width: 960px) { .site-grid { grid-template-columns: 1fr } }

/* ── KEYFRAMES ─────────────────────────────────────── */
@keyframes blink      { 0%,100%{opacity:1}   50%{opacity:.15} }
@keyframes pulse-sq   { 0%,100%{box-shadow:0 0 0 0 rgba(139,0,0,.6)} 50%{box-shadow:0 0 0 6px rgba(139,0,0,0)} }
@keyframes pulse-dot  { 0%,100%{box-shadow:0 0 0 0 rgba(231,76,60,.7)} 50%{box-shadow:0 0 0 8px rgba(231,76,60,0)} }
@keyframes fadeUp     { from{opacity:0;transform:translateY(10px)} to{opacity:1;transform:translateY(0)} }
@keyframes countbump  { 0%{transform:scale(1)} 50%{transform:scale(1.4)} 100%{transform:scale(1)} }

/* Ticker: starts fully off-screen right, scrolls left */
@keyframes ticker-rtl {
  0%   { transform: translateX(0) }
  100% { transform: translateX(-50%) }
}

/* ── BREAKING NEWS BAR ─────────────────────────────── */
.breaking-bar {
  background: var(--accent);
  color: #fff;
  height: 32px;
  overflow: hidden;
  contain: layout style;
}
.breaking-inner {
  display: flex;
  align-items: center;
  height: 100%;
  max-width: min(1200px,100%);
  margin: 0 auto;
  padding: 0 20px;
  gap: 0;
}
.breaking-pill {
  background: rgba(0,0,0,.25);
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  white-space: nowrap;
}
.breaking-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #ff9999;
  animation: blink 1.2s ease-in-out infinite;
}
.breaking-track-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  /* mask edges */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%);
}
/* The track holds 2× duplicated content for seamless loop.
   translateX(0) = first copy visible.
   translateX(-50%) = second copy visible = seamless loop. */
.breaking-track {
  display: flex;
  white-space: nowrap;
  animation: ticker-rtl 50s linear infinite;
  will-change: transform;
}
.breaking-track:hover { animation-play-state: paused }
.breaking-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-right: 40px;
  font-size: .73rem;
  font-weight: 500;
  color: rgba(255,255,255,.92);
}
.breaking-item a     { color: #fff }
.breaking-item a:hover { text-decoration: underline }
.breaking-item strong{ font-weight: 700; margin-right: 2px }
.breaking-sep        { color: rgba(255,255,255,.3); font-size: .8rem }

/* ── HEADER ────────────────────────────────────────── */
#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--hdr);
  border-bottom: 2px solid var(--accent);
  transition: background .25s, box-shadow .25s;
}
.header-inner {
  display: flex;
  align-items: center;
  height: var(--hdr-h);
  gap: 12px;
  max-width: min(1200px,100%);
  margin: 0 auto;
  padding: 0 20px;
}
@media (max-width: 480px) { .header-inner { padding: 0 12px } }

.site-logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.04em;
  flex-shrink: 0;
  color: var(--accent);
  line-height: 1;
}
.site-logo em { color: var(--t1); font-style: normal }

#primary-nav { flex: 1; overflow: hidden; min-width: 0 }
#primary-nav ul {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
  min-width: 0;
}
#primary-nav ul::-webkit-scrollbar { display: none }
#primary-nav ul li a {
  display: block;
  padding: 5px 10px;
  border-radius: var(--r);
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--t2);
  white-space: nowrap;
  transition: background .15s, color .15s;
}
#primary-nav ul li a:hover,
#primary-nav ul li.current-menu-item a {
  background: var(--accent-lite);
  color: var(--accent);
}
.hdr-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0 }

/* Dark toggle */
.dark-toggle { display: flex; align-items: center; gap: 6px }
.dark-toggle-label {
  font-size: .65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--t3);
}
.toggle-track {
  width: 40px; height: 22px;
  background: var(--border);
  border-radius: 11px;
  position: relative;
  transition: background .25s;
  flex-shrink: 0; cursor: pointer;
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform .25s;
}
[data-theme="dark"] .toggle-track { background: #3a2020 }
[data-theme="dark"] .toggle-track::after { transform: translateX(18px) }

.btn-menu {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px; height: 32px; padding: 4px;
}
.btn-menu span {
  display: block; height: 2px;
  background: var(--t1); border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
@media (max-width: 768px) {
  .btn-menu { display: flex }
  #primary-nav {
    display: none;
    position: absolute;
    top: calc(var(--hdr-h) + 2px);
    left: 0; right: 0;
    background: var(--hdr);
    border-bottom: 2px solid var(--accent);
    box-shadow: var(--sh-lg);
    padding: 10px 12px 14px;
    z-index: 999;
  }
  #primary-nav.open { display: block }
  #primary-nav ul { flex-direction: column; align-items: flex-start; gap: 2px }
  #primary-nav ul li a { font-size: .8rem; padding: 8px 12px; width: 100% }
  .dark-toggle-label { display: none }
}

/* ── STATUS BAR (under header) ─────────────────────── */
/* Two separate indicators: pulsing SQUARE = new posts count, pulsing DOT = live active */
.status-bar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border2);
  padding: 5px 0;
}
.status-inner {
  max-width: min(1200px,100%);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: .72rem;
}
@media (max-width: 480px) { .status-inner { padding: 0 12px } }

/* PULSING SQUARE — new posts count */
.status-count {
  display: flex;
  align-items: center;
  gap: 7px;
}
.pulse-square {
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
  animation: pulse-sq 2s ease-in-out infinite;
}
.count-num {
  font-weight: 800;
  font-size: .85rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.count-num.bump { animation: countbump .4s ease }
.count-label { color: var(--t3); font-weight: 500 }

/* PULSING DOT — live active */
.status-live {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
}
.pulse-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--live-dot);
  flex-shrink: 0;
  animation: pulse-dot 1.6s ease-in-out infinite;
}
.live-label-text {
  font-size: .7rem;
  font-weight: 700;
  color: var(--live-dot);
  text-transform: uppercase;
  letter-spacing: .07em;
}
.live-label-text a { color: var(--live-dot) }
.live-label-text a:hover { text-decoration: underline }

/* ── CONTENT LABELS ────────────────────────────────── */
.content-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 2px 7px;
  border-radius: 3px;
  line-height: 1.5;
  flex-shrink: 0;
}
.label-exclusive { background: var(--rv-wine);   color: #f5c0c0 }
.label-top       { background: var(--accent);     color: #fff }
.label-live      { background: var(--live-dot);   color: #fff; animation: blink 2s ease-in-out infinite }
.label-live::before {
  content: '';
  width: 5px; height: 5px;
  background: #fff;
  border-radius: 50%;
  display: inline-block;
}
.label-relevant  { background: var(--rv-vine);    color: #f0d0d8 }

/* ── SECTION HEAD ──────────────────────────────────── */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
  margin-bottom: 20px;
  gap: 10px;
}
.section-head h2, .section-head h3 {
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  margin: 0;
}
.section-head a {
  font-size: .68rem; font-weight: 600;
  color: var(--t3); text-transform: uppercase; letter-spacing: .06em;
}
.section-head a:hover { color: var(--accent) }

/* ── HERO ──────────────────────────────────────────── */
.hero-wrap { margin: 20px 0 28px }
.hero-post {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  height: 470px;
  background: var(--bg3);
  contain: layout;
}
@media (max-width: 960px) { .hero-post { height: 380px } }
@media (max-width: 600px) { .hero-post { height: 260px; border-radius: var(--r) } }
@media (max-width: 400px) { .hero-post { height: 200px } }

.hero-post > img, .hero-post > a > img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  transition: transform .5s ease;
}
.hero-post:hover > img, .hero-post:hover > a > img { transform: scale(1.03) }

.hero-grad {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10,2,2,.93) 0%, rgba(10,2,2,.55) 50%, transparent 80%);
  display: flex; align-items: flex-end;
  padding: 28px 32px;
}
@media (max-width: 600px) { .hero-grad { padding: 16px } }

.hero-content { color: #fff; max-width: 680px; min-width: 0 }
.hero-meta-top {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; margin-bottom: 10px;
}
.hero-cat {
  background: var(--accent); color: #fff;
  font-size: .62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  padding: 2px 10px; border-radius: 20px;
}
.hero-cat:hover { background: var(--accent-h); color: #fff }
.hero-title {
  font-size: clamp(1.3rem, 3vw, 2.1rem);
  font-weight: 800; line-height: 1.2;
  color: #fff; margin-bottom: 10px; letter-spacing: -.02em;
}
.hero-title a { color: #fff }
.hero-meta {
  font-size: .72rem; color: rgba(255,255,255,.7);
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}
.hero-read {
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.9);
  padding: 2px 9px; border-radius: 20px;
  font-size: .65rem; font-weight: 600;
}

/* ── POST CARDS ────────────────────────────────────── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
@media (max-width: 560px) { .posts-grid { grid-template-columns: 1fr; gap: 14px } }

.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  min-width: 0;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-lg);
  border-color: var(--accent);
}
.card-thumb {
  position: relative; overflow: hidden;
  aspect-ratio: 16/9; background: var(--bg3); flex-shrink: 0;
}
.card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.post-card:hover .card-thumb img { transform: scale(1.05) }
.card-labels {
  position: absolute; top: 9px; left: 9px;
  display: flex; gap: 4px; flex-wrap: wrap;
}
.card-cat {
  background: var(--accent); color: #fff;
  font-size: .59rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  padding: 2px 8px; border-radius: 20px;
}
.card-cat:hover { background: var(--accent-h) }
.card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 7px; min-width: 0 }
.card-title {
  font-size: .94rem; font-weight: 700;
  line-height: 1.35; letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-title a { color: var(--t1) }
.card-title a:hover { color: var(--accent) }
.card-excerpt {
  font-size: .78rem; color: var(--t3); line-height: 1.5; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
@media (max-width: 560px) { .card-excerpt { display: none } }
.card-meta {
  display: flex; align-items: center; gap: 7px;
  font-size: .68rem; color: var(--t3);
  border-top: 1px solid var(--border2); padding-top: 9px; flex-wrap: wrap;
}
.card-meta .sep { opacity: .4 }
.card-meta a   { color: var(--t3) }
.card-meta a:hover { color: var(--accent) }
.card-avatar { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; flex-shrink: 0 }

/* ── LIVE BLOG SECTION ─────────────────────────────── */
/* Distinctive dark-background live transcription section */
.live-section {
  background: var(--live-bg);
  border: 1px solid var(--live-line);
  border-radius: var(--r-lg);
  margin-bottom: 28px;
  overflow: hidden;
}
.live-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--live-line);
  background: rgba(0,0,0,.2);
  gap: 10px;
}
.live-section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--live-dot);
}
.live-section-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--live-dot);
  animation: pulse-dot 1.6s ease-in-out infinite;
  flex-shrink: 0;
}
.live-section-link {
  font-size: .67rem; font-weight: 600;
  color: rgba(255,255,255,.4);
  text-transform: uppercase; letter-spacing: .07em;
}
.live-section-link:hover { color: rgba(255,255,255,.8) }

.live-posts-list { padding: 0 }

.live-post-entry {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0;
  border-bottom: 1px solid var(--live-line);
  position: relative;
}
.live-post-entry:last-child { border-bottom: none }

/* Minute timestamp column */
.live-time-col {
  padding: 16px 0 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
}
.live-time {
  font-size: .65rem;
  font-weight: 700;
  color: var(--live-dot);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 1.2;
}
.live-time-date {
  font-size: .58rem;
  color: rgba(255,255,255,.3);
  margin-top: 2px;
}
/* Vertical timeline line */
.live-time-col::after {
  content: '';
  position: absolute;
  top: 28px; right: 0;
  width: 1px;
  bottom: 0;
  background: var(--live-line);
}
.live-post-entry:last-child .live-time-col::after { display: none }
/* Timeline dot */
.live-timeline-dot {
  position: absolute;
  right: -5px; top: 22px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--live-dot);
  border: 2px solid var(--live-bg);
  z-index: 1;
}
.live-post-entry:first-child .live-timeline-dot {
  animation: pulse-dot 1.6s ease-in-out infinite;
}

/* Content column */
.live-post-body {
  padding: 14px 20px 14px 16px;
  min-width: 0;
}
.live-post-title {
  font-size: .9rem;
  font-weight: 700;
  color: rgba(255,255,255,.95);
  margin-bottom: 6px;
  line-height: 1.3;
}
.live-post-title a { color: rgba(255,255,255,.95) }
.live-post-title a:hover { color: var(--live-dot) }
.live-post-excerpt {
  font-size: .78rem;
  color: rgba(255,255,255,.55);
  line-height: 1.6;
  margin-bottom: 8px;
  /* max 400 chars — enforced in PHP, but clamp visually too */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.live-post-tags {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.live-tag {
  font-size: .6rem; font-weight: 600;
  color: rgba(255,255,255,.35);
  transition: color .15s;
}
.live-tag::before { content: '#' }
.live-tag:hover { color: var(--live-dot) }

@media (max-width: 480px) {
  .live-post-entry { grid-template-columns: 48px 1fr }
  .live-time-col   { padding: 12px 0 12px 12px }
  .live-post-body  { padding: 12px 12px 12px 12px }
}

/* ── PAGINATION ─────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 5px; margin: 24px 0; flex-wrap: wrap;
}
.pagination a, .pagination span {
  font-size: .77rem; font-weight: 600;
  padding: 7px 12px; border-radius: var(--r);
  border: 1px solid var(--border); color: var(--t2);
  transition: background .15s, color .15s, border-color .15s;
}
.pagination a:hover, .pagination .current {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

/* ── SIDEBAR ────────────────────────────────────────── */
.sidebar {
  display: flex; flex-direction: column; gap: 20px;
  position: sticky; top: calc(var(--hdr-h) + 8px);
  max-height: calc(100vh - var(--hdr-h) - 16px);
  overflow-y: auto; scrollbar-width: thin;
}
@media (max-width: 960px) { .sidebar { position: static; max-height: none; overflow-y: visible } }

.widget {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
}
.widget-title {
  font-size: .66rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--accent); margin-bottom: 12px;
  padding-bottom: 7px; border-bottom: 1px solid var(--border2);
}
.widget-posts li {
  display: flex; gap: 9px; padding: 8px 0;
  border-bottom: 1px solid var(--border2);
}
.widget-posts li:last-child { border-bottom: none }
.w-num { font-size: 1.1rem; font-weight: 900; color: var(--border); line-height: 1; min-width: 22px; flex-shrink: 0 }
.w-post-title {
  font-size: .78rem; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4;
}
.w-post-title a { color: var(--t1) }
.w-post-title a:hover { color: var(--accent) }
.w-post-date { font-size: .65rem; color: var(--t4); margin-top: 2px }

.widget-cats li {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 0; border-bottom: 1px solid var(--border2); font-size: .78rem;
}
.widget-cats li:last-child { border-bottom: none }
.widget-cats a { color: var(--t2); font-weight: 500 }
.widget-cats a:hover { color: var(--accent) }
.cat-count {
  background: var(--accent-lite); color: var(--accent);
  font-size: .63rem; font-weight: 700; padding: 1px 7px; border-radius: 20px;
}

/* ── AD UNITS ───────────────────────────────────────── */
.ad-unit {
  background: var(--bg2); border: 1px dashed var(--border); border-radius: var(--r);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; color: var(--t4);
  font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; gap: 4px;
}
.ad-unit::before {
  content: 'Ad'; position: absolute; top: 5px; left: 8px;
  font-size: .56rem; opacity: .5; letter-spacing: .12em; text-transform: uppercase;
}
.ad-banner { height: 76px; margin: 16px 0 }
.ad-square  { height: 250px }
.ad-mid     { height: 90px; margin: 24px 0 }
.ad-unit-custom { margin: 16px 0 }

/* ── SINGLE POST ────────────────────────────────────── */
.post-wrap { max-width: 720px; min-width: 0; overflow-x: hidden }

.post-cat-row {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.post-cat-badge {
  background: var(--accent); color: #fff;
  font-size: .62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  padding: 3px 11px; border-radius: 20px;
}
.post-cat-badge:hover { background: var(--accent-h) }
.post-title {
  font-size: clamp(1.5rem, 3.5vw, 2.3rem);
  font-weight: 800; line-height: 1.2;
  letter-spacing: -.025em; color: var(--t1); margin-bottom: 12px;
}
.post-meta-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  font-size: .73rem; color: var(--t3);
  padding: 11px 0; border-top: 1px solid var(--border2); border-bottom: 1px solid var(--border2);
  margin-bottom: 20px;
}
.meta-author { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--t2) }
.meta-author img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent) }
.meta-sep   { opacity: .3 }
.meta-read  { margin-left: auto; font-style: italic; font-size: .7rem; background: var(--accent-lite); color: var(--accent); padding: 2px 9px; border-radius: 20px }

/* Featured image – max 470px */
.single-featured {
  border-radius: var(--r-lg); overflow: hidden;
  margin-bottom: 24px;
  height: clamp(200px, 40vw, 470px);
  background: var(--bg3); contain: layout;
}
.single-featured img { width: 100%; height: 100%; object-fit: cover; object-position: center }
.single-featured figcaption { font-size: .7rem; color: var(--t4); font-style: italic; text-align: center; padding: 7px 0 0 }

/* Post content */
.post-content { font-size: .98rem; line-height: 1.85; color: var(--t2) }
.post-content p  { margin-bottom: 1.4rem }
.post-content h2 {
  font-size: 1.35rem; font-weight: 800; margin: 2rem 0 .75rem;
  color: var(--t1); padding-left: 12px; border-left: 3px solid var(--accent);
}
.post-content h3 { font-size: 1.1rem; font-weight: 700; margin: 1.6rem 0 .6rem; color: var(--t1) }
.post-content blockquote {
  border-left: 3px solid var(--accent); padding: 12px 18px; margin: 1.6rem 0;
  background: var(--accent-lite); border-radius: 0 var(--r) var(--r) 0;
  font-style: italic; color: var(--t1);
}
.post-content ul  { list-style: disc; padding-left: 1.3rem; margin-bottom: 1.3rem }
.post-content ol  { list-style: decimal; padding-left: 1.3rem; margin-bottom: 1.3rem }
.post-content li  { margin-bottom: .4rem; color: var(--t2) }
.post-content a   { color: var(--accent); border-bottom: 1px solid transparent }
.post-content a:hover { border-color: var(--accent) }
.post-content img { border-radius: var(--r); margin: 1.3rem 0; box-shadow: var(--sh); max-height: 470px; object-fit: cover; width: 100% }
.post-content code {
  background: var(--bg3); font-family: 'Courier New', monospace;
  font-size: .87em; padding: 2px 5px; border-radius: 4px; color: var(--accent);
}
.post-content pre {
  background: var(--bg3); padding: 16px; border-radius: var(--r);
  overflow-x: auto; margin: 1.3rem 0;
}
.post-content pre code { background: none; padding: 0; color: var(--t1) }

/* Floating share bar on desktop */
.share-float {
  position: fixed;
  left: calc(50% + 380px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}
@media (max-width: 1360px) { .share-float { display: none } }
.share-float-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--t3);
  font-size: .8rem;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  cursor: pointer;
  box-shadow: var(--sh-sm);
}
.share-float-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent) }
.share-float-btn.cp.copied { background: #27ae60; color: #fff; border-color: #27ae60 }

/* Inline share bar (mobile/tablet) */
.share-bar {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  padding: 14px 0; border-top: 1px solid var(--border2); border-bottom: 1px solid var(--border2);
  margin: 18px 0;
}
@media (min-width: 1361px) { .share-bar { display: none } }
.share-lbl { font-size: .67rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--t4) }
.share-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .73rem; font-weight: 600;
  padding: 6px 13px; border-radius: var(--r);
  border: 1px solid var(--border); color: var(--t2);
  transition: all .15s; cursor: pointer;
}
.share-btn:hover    { border-color: var(--accent); color: var(--accent) }
.share-btn.tw:hover { background: #1d9bf0; color: #fff; border-color: #1d9bf0 }
.share-btn.fb:hover { background: #1877f2; color: #fff; border-color: #1877f2 }
.share-btn.cp.copied{ background: #27ae60; color: #fff; border-color: #27ae60 }

/* Tags */
.post-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 18px 0; border-top: 1px solid var(--border2); margin-top: 20px;
}
.post-tags-lbl {
  font-size: .66rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--t4); align-self: center; margin-right: 4px;
}
.tag-chip {
  background: var(--bg3); color: var(--t2);
  font-size: .7rem; font-weight: 600;
  padding: 3px 11px; border-radius: 20px;
  border: 1px solid var(--border); transition: background .15s, color .15s, border-color .15s;
}
.tag-chip::before { content: '#' }
.tag-chip:hover { background: var(--accent); color: #fff; border-color: var(--accent) }

/* Author box */
.author-box {
  display: flex; gap: 16px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px; margin: 26px 0; align-items: flex-start;
}
.author-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent); flex-shrink: 0 }
.author-name { font-size: .95rem; font-weight: 700; margin-bottom: 2px; color: var(--t1) }
.author-role { font-size: .63rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: 7px }
.author-bio  { font-size: .8rem; color: var(--t3); line-height: 1.6; margin-bottom: 9px }
.author-links { display: flex; gap: 6px; flex-wrap: wrap }
.author-links a {
  font-size: .68rem; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
  border: 1px solid var(--border); color: var(--t3);
  transition: all .15s;
}
.author-links a:hover { background: var(--accent); color: #fff; border-color: var(--accent) }

/* Related posts */
.related-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px }
@media (max-width: 680px) { .related-grid { grid-template-columns: repeat(2,1fr) } }
@media (max-width: 440px) { .related-grid { grid-template-columns: 1fr } }
.rel-card { border-radius: var(--r); overflow: hidden; background: var(--card); border: 1px solid var(--border); transition: transform .2s, box-shadow .2s }
.rel-card:hover { transform: translateY(-3px); box-shadow: var(--sh) }
.rel-thumb { aspect-ratio: 16/10; overflow: hidden; background: var(--bg3) }
.rel-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; max-height: 200px }
.rel-card:hover .rel-thumb img { transform: scale(1.06) }
.rel-body  { padding: 10px }
.rel-cat   { font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); margin-bottom: 3px }
.rel-title { font-size: .8rem; font-weight: 700; line-height: 1.35; margin-bottom: 4px }
.rel-title a { color: var(--t1) }
.rel-title a:hover { color: var(--accent) }
.rel-date  { font-size: .63rem; color: var(--t4) }

/* ── COMMENTS ───────────────────────────────────────── */
.comments-sec { margin: 32px 0 }
.comments-heading { font-size: 1.1rem; font-weight: 700; margin-bottom: 18px; padding-bottom: 8px; border-bottom: 2px solid var(--accent) }
.comment-list { display: flex; flex-direction: column; gap: 12px }
.comment-item { background: var(--card); border: 1px solid var(--border2); border-radius: var(--r); padding: 14px }
.comment-item.depth-2 { margin-left: 28px }
.c-header { display: flex; align-items: center; gap: 9px; margin-bottom: 9px }
.c-ava { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-lite); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--accent); font-size: .78rem; flex-shrink: 0; overflow: hidden }
.c-ava img { width: 100%; height: 100%; object-fit: cover }
.c-name { font-size: .83rem; font-weight: 700; color: var(--t1) }
.c-date { font-size: .65rem; color: var(--t4); margin-top: 1px }
.c-body p { font-size: .83rem; color: var(--t2); line-height: 1.6 }
.c-reply  { font-size: .68rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; margin-top: 7px; display: inline-block }

.c-form-wrap { margin-top: 26px }
.c-form-title { font-size: 1rem; font-weight: 700; margin-bottom: 13px; color: var(--t1) }
.c-form { display: flex; flex-direction: column; gap: 11px }
.c-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px }
@media (max-width: 500px) { .c-row { grid-template-columns: 1fr } }
.c-field { display: flex; flex-direction: column; gap: 4px }
.c-field label { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--t3) }
.c-field input, .c-field textarea {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--r);
  padding: 8px 11px; font-size: .83rem; color: var(--t1);
  transition: border-color .15s, box-shadow .15s; resize: vertical;
}
.c-field input:focus, .c-field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(139,0,0,.1) }
.c-field textarea { min-height: 100px }
.c-submit { align-self: flex-start; background: var(--accent); color: #fff; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 10px 22px; border-radius: var(--r); transition: background .15s, transform .15s }
.c-submit:hover { background: var(--accent-h); transform: translateY(-1px) }

/* ── FOOTER ─────────────────────────────────────────── */
#site-footer { background: var(--bg2); border-top: 2px solid var(--accent); margin-top: 48px }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; padding: 36px 0 28px }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr } }

.footer-logo { font-size: 1.4rem; font-weight: 800; color: var(--accent); letter-spacing: -.03em; display: block; margin-bottom: 8px }
.footer-desc { font-size: .78rem; color: var(--t3); line-height: 1.6; margin-bottom: 14px }
.footer-social { display: flex; gap: 6px; flex-wrap: wrap }
.footer-social a { width: 30px; height: 30px; border-radius: var(--r); background: var(--card); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: .78rem; color: var(--t3); transition: background .15s, color .15s, border-color .15s }
.footer-social a:hover { background: var(--accent); color: #fff; border-color: var(--accent) }
.footer-col-title { font-size: .63rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--t1); margin-bottom: 12px }
.footer-links { display: flex; flex-direction: column; gap: 6px }
.footer-links a { font-size: .76rem; color: var(--t3); display: flex; align-items: center; gap: 5px; transition: color .15s }
.footer-links a::before { content: '›'; color: var(--accent); font-size: .9rem }
.footer-links a:hover { color: var(--accent) }

.footer-bottom { border-top: 1px solid var(--border2); padding: 13px 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px }
.footer-copy { font-size: .72rem; color: var(--t4) }
.footer-copy strong { color: var(--accent) }
.footer-legal { display: flex; gap: 13px }
.footer-legal a { font-size: .68rem; color: var(--t4) }
.footer-legal a:hover { color: var(--accent) }

/* ── UTILS ──────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap }
.fade-up { animation: fadeUp .4s ease both }
.d1 { animation-delay: .08s } .d2 { animation-delay: .16s } .d3 { animation-delay: .24s }

#rdprogress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); z-index: 9999; pointer-events: none; transition: width .1s linear }

#scroll-top { position: fixed; bottom: 20px; right: 20px; z-index: 800; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .95rem; display: flex; align-items: center; justify-content: center; box-shadow: var(--sh-lg); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s }
#scroll-top.show { opacity: 1; pointer-events: auto }
#scroll-top:hover { transform: translateY(-3px) }

@media print {
  #site-header, #site-footer, .sidebar, .ad-unit, .share-bar, .share-float,
  .related-posts, .c-form-wrap, #scroll-top { display: none !important }
  .site-grid { grid-template-columns: 1fr }
}
