/* ---------- RESET & TOKENS ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, svg { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
a { color: inherit; text-decoration: none; }

:root {
  --bg: #FDFDFD;
  --bg-primary: #FDFDFD;
  --bg-secondary: #F8FAFC;
  --surface: #FFFFFF;
  --surface-1: #FFFFFF;
  --surface-2: #F5F5F4;
  --surface-3: #E2E8F0;
  --text: #0F172A;
  --text-primary: #0F172A;
  --text-secondary: #64748B;
  --muted: #64748B;
  --border: #E2E8F0;
  --border-color: #E2E8F0;
  --primary: #B91C1C;
  --brand-red: #B91C1C;
  --primary-ink: #FFFFFF;
  --secondary: #1E3A8A;
  --accent: #1E3A8A;
  --shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  --serif: "Playfair Display", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --font-heading: "Playfair Display", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ad-bg: #F1F5F9;
  --ad-border: #CBD5E1;
}

html.dark {
  --bg: #09090B;
  --bg-primary: #09090B;
  --bg-secondary: #121215;
  --surface: #18181B;
  --surface-1: #18181B;
  --surface-2: #1F1F23;
  --surface-3: #27272A;
  --text: #F8FAFC;
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --muted: #94A3B8;
  --border: #27272A;
  --border-color: #27272A;
  --primary: #EF4444;
  --brand-red: #EF4444;
  --primary-ink: #FFFFFF;
  --secondary: #60A5FA;
  --accent: #60A5FA;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
  --ad-bg: #1F1F23;
  --ad-border: #3F3F46;
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; color: var(--text); }

.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
@media (min-width: 768px) { .container { padding: 0 32px; } }

/* ---------- TOP STRIP ---------- */
.top-strip {
  background: #0F172A;
  color: #E2E8F0;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 0;
  border-bottom: 1px solid #1F2937;
}
html.dark .top-strip { background: #000; border-bottom: 1px solid #1F1F23; }
.top-strip .container { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.top-strip .date { font-weight: 600; }
.top-strip .links { display: flex; gap: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; scrollbar-width: none; max-width: 100%; }
.top-strip .links::-webkit-scrollbar { display: none; }
.top-strip a:hover { color: #FFF; }

/* ---------- MASTHEAD ---------- */
.masthead {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
  background-color: color-mix(in srgb, var(--surface) 92%, transparent);
}
.masthead-inner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 16px 0; }
@media (min-width: 768px) { .masthead-inner { padding: 22px 0; } }

.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); color: var(--primary-ink);
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 900; font-size: 22px;
  letter-spacing: -0.04em;
}
.brand-title { font-family: var(--serif); font-weight: 900; font-size: 22px; letter-spacing: -0.02em; }
.brand-title em { font-style: italic; color: var(--primary); font-weight: 700; }
@media (min-width: 768px) { .brand-title { font-size: 28px; } }

.masthead-center { text-align: center; }
.masthead-tag { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }

.masthead-actions { display: flex; align-items: center; gap: 8px; justify-self: end; position: relative; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 4px; color: var(--text);
  transition: background-color 0.15s ease;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- HEADER SEARCH & RESPONSIVE CONTROLS ---------- */
.masthead-search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.masthead-search-container #masthead-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.masthead-search-container #masthead-search-btn:hover {
  background: var(--surface-2);
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 0 4px 0 12px;
  height: 38px;
  gap: 8px;
  box-sizing: border-box;
}

.search-input-wrapper .search-input-icon {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  flex-shrink: 0;
  cursor: pointer;
}

.search-input-wrapper input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  color: var(--text-primary) !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  font-size: 13.5px;
  font-family: var(--sans);
  font-weight: 500;
  opacity: 1 !important;
  pointer-events: auto !important;
  padding: 0 !important;
  margin: 0 !important;
}

.search-input-wrapper input::placeholder {
  color: var(--text-secondary);
}

.search-clear-btn {
  display: none !important;
}

.search-submit-btn {
  background: var(--primary, #9e1a1b);
  color: #ffffff;
  border: none;
  border-radius: 14px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  transition: background-color 0.15s ease, opacity 0.15s ease;
  flex-shrink: 0;
  height: 28px;
}

.search-submit-btn:hover {
  opacity: 0.9;
}

.search-clear-btn:hover {
  color: var(--text-primary);
}

.search-clear-btn svg {
  width: 14px;
  height: 14px;
}

/* Search Dropdown Results Panel */
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  background: var(--surface-1);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.25);
  max-height: 420px;
  overflow-y: auto;
  z-index: 120;
  padding: 6px 0;
  width: 360px;
  right: 0;
}

.search-result-item {
  display: flex;
  flex-direction: column;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--text-primary);
  transition: background-color 0.15s ease;
}

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

.search-result-item:hover {
  background: var(--surface-2);
}

.search-result-title {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.35;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.search-result-meta {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-result-badge {
  background: var(--brand-red, #dc2626);
  color: #ffffff;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.search-no-results {
  padding: 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

/* Responsive Desktop / Mobile Helpers */
@media (min-width: 768px) {
  .hide-desktop {
    display: none !important;
  }

  .masthead-search-container #masthead-search-btn {
    display: none !important; /* Standalone search button hidden on desktop */
  }

  .search-input-wrapper {
    display: flex !important;
    width: 280px;
    transition: width 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  }

  .search-input-wrapper:focus-within {
    width: 360px;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 20%, transparent);
  }

  .search-results-dropdown {
    width: 380px;
    right: 0;
  }
}

/* Mobile & Responsive View (max-width: 767px) */
@media (max-width: 767px) {
  .hide-mobile-actions {
    display: none !important;
  }

  .masthead-search-container #masthead-search-btn {
    display: flex !important;
  }

  .search-input-wrapper {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(calc(100vw - 32px), 340px);
    z-index: 200;
    box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.25);
    background: var(--surface-1);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 6px 12px;
  }

  .search-input-wrapper.active {
    display: flex !important;
    animation: fadeInDown 0.2s ease-out forwards;
  }

  .search-results-dropdown {
    position: absolute;
    top: calc(100% + 56px);
    right: 0;
    width: min(calc(100vw - 32px), 340px);
    z-index: 201;
  }
}

/* Masthead More Menu Container */
.masthead-more-container {
  position: relative;
  display: flex;
  align-items: center;
}

.masthead-more-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface-1);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.25);
  min-width: 190px;
  padding: 6px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: fadeInDown 0.18s ease-out forwards;
}

.more-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--sans);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.more-dropdown-item:hover {
  background: var(--surface-2);
}

.more-dropdown-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.more-dropdown-item:hover svg {
  color: var(--primary);
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* primary nav */
.primary-nav {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.primary-nav .container { display: flex; gap: 28px; padding-top: 10px; padding-bottom: 10px; white-space: nowrap; }
.primary-nav a {
  font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text); padding: 4px 0; border-bottom: 2px solid transparent;
}
.primary-nav a:hover, .primary-nav a.active { border-bottom-color: var(--primary); color: var(--primary); }

/* ---------- SIDEBAR DRAWER ---------- */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease; z-index: 90;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 320px; max-width: 86vw;
  background: var(--surface); border-right: 1px solid var(--border);
  transform: translateX(-100%); transition: transform 0.25s ease;
  z-index: 100; display: flex; flex-direction: column;
  overflow-y: auto;
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.drawer-title { font-family: var(--serif); font-weight: 800; font-size: 20px; }
.drawer-section { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.drawer-section h4 { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; font-family: var(--sans); font-weight: 700; }
.drawer-section ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.drawer-section a { font-size: 15px; font-weight: 500; }
.drawer-section a:hover { color: var(--primary); }
.drawer-social { display: flex; flex-wrap: wrap; gap: 8px; }
.drawer-social a {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 4px;
  border: 1px solid var(--border); transition: background 0.15s, color 0.15s;
}
.drawer-social a:hover { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.drawer-social svg { width: 18px; height: 18px; }

/* ---------- HERO / FEATURED ---------- */
.hero-section { padding: 32px 0 12px; }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 2fr 1fr; gap: 40px; } }

.hero-article { display: flex; flex-direction: column; gap: 16px; }
.hero-article .hero-img { aspect-ratio: 16/9; overflow: hidden; border-radius: 2px; background: var(--surface-2); }
.hero-article .hero-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.hero-article:hover .hero-img img { transform: scale(1.02); }
.hero-category { font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--primary); }
.hero-title { font-size: clamp(28px, 5vw, 48px); line-height: 1.05; }
.hero-excerpt { color: var(--muted); font-size: 17px; line-height: 1.6; }
.hero-meta { font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }
.hero-meta b { color: var(--text); font-weight: 600; }

.hero-side { display: flex; flex-direction: column; gap: 28px; }
.side-article { display: grid; grid-template-columns: 100px 1fr; gap: 14px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.side-article:last-child { border-bottom: 0; padding-bottom: 0; }
.side-article .side-img { aspect-ratio: 1/1; overflow: hidden; border-radius: 2px; background: var(--surface-2); }
.side-article .side-img img { width: 100%; height: 100%; object-fit: cover; }
.side-category { font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--primary); }
.side-title { font-size: 16px; line-height: 1.25; margin-top: 4px; }
.side-meta { font-size: 11px; color: var(--muted); margin-top: 6px; letter-spacing: 0.04em; }

/* ---------- MAIN FEED ---------- */
.feed-section { padding: 16px 0 64px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 24px 0 20px; border-top: 4px solid var(--text); margin-top: 32px; }
.section-head h2 { font-size: 26px; }
.section-head .more { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); font-weight: 700; }

.feed-grid { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 640px) { .feed-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .feed-grid { grid-template-columns: repeat(3, 1fr); gap: 36px 32px; } }

.card { display: flex; flex-direction: column; gap: 12px; padding-bottom: 28px; border-bottom: 1px solid var(--border); transition: transform 0.2s ease; }
.card:hover { transform: translateY(-2px); }
.card:hover .card-title { color: var(--primary); }
.card-img { aspect-ratio: 16/10; overflow: hidden; background: var(--surface-2); border-radius: 2px; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card:hover .card-img img { transform: scale(1.04); }
.card-category { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--primary); }
.card-title { font-size: 20px; line-height: 1.2; transition: color 0.15s ease; }
.card-excerpt { font-size: 14.5px; color: var(--muted); line-height: 1.55; }
.card-meta { font-size: 12px; color: var(--muted); letter-spacing: 0.04em; margin-top: 4px; }
.card-meta b { color: var(--text); font-weight: 600; }

.load-more-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 48px; }
.btn-load {
  background: var(--text); color: var(--bg);
  padding: 14px 36px; font-weight: 700; font-size: 13px;
  letter-spacing: 0.16em; text-transform: uppercase;
  border-radius: 2px; transition: opacity 0.15s ease;
}
.btn-load:hover { opacity: 0.85; }
.btn-load[disabled] { opacity: 0.4; cursor: not-allowed; }
.feed-status { font-size: 13px; color: var(--muted); }

/* ---------- AD SLOTS ---------- */
.ad-slot {
  width: 100%; background: var(--ad-bg);
  border: 1px dashed var(--ad-border);
  display: block;
  padding: 12px 16px;
  border-radius: 2px;
  text-align: center;
  overflow: hidden;
  box-sizing: border-box;
}
.ad-slot .ad-label { font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 6px; display: block; }
.ad-slot .ad-size { font-size: 13px; color: var(--muted); font-weight: 500; }
.ad-slot ins.adsbygoogle { display: block; margin: 0 auto; }
.ad-slot.leaderboard { min-height: 110px; }
.ad-slot.rectangle { min-height: 250px; max-width: 336px; margin: 0 auto; }
.ad-slot.banner-image { background-image: linear-gradient(135deg, #1E3A8A 0%, #B91C1C 100%); border: 0; min-height: 120px; color: #FFF; }
.ad-slot.banner-image .ad-label, .ad-slot.banner-image .ad-size { color: rgba(255,255,255,0.85); }
.ad-slot.banner-image strong { font-family: var(--serif); font-size: 24px; font-weight: 800; color: #FFF; }
.feed-ad { grid-column: 1 / -1; }
@media (min-width: 1024px) { .feed-ad { grid-column: span 3; } }

/* ---------- ARTICLE PAGE ---------- */
.article-wrap { padding: 32px 0 64px; }
.article-layout { display: grid; grid-template-columns: 1fr; gap: 40px; }
@media (min-width: 1024px) { .article-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 64px; } }

.article-head { max-width: 820px; margin: 0 auto 24px; }
.article-cat { font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--primary); margin-bottom: 14px; }
.article-cat a { color: var(--primary); text-decoration: none; transition: opacity 0.2s; }
.article-cat a:hover { text-decoration: underline; opacity: 0.85; }
.article-title { font-size: clamp(32px, 5vw, 52px); line-height: 1.08; margin-bottom: 18px; }
.article-deck { font-size: 18px; color: var(--muted); line-height: 1.55; margin-bottom: 28px; }
.article-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 13px; }
.byline-avatar { width: 40px; height: 40px; border-radius: 999px; background: var(--surface-2); display: grid; place-items: center; font-family: var(--serif); font-weight: 800; color: var(--text); }
.byline-meta { display: flex; flex-direction: column; }
.byline-meta b { font-size: 14px; }
.byline-meta span { color: var(--muted); font-size: 12px; }
.byline-spacer { flex: 1; }

.share { display: flex; gap: 8px; align-items: center; position: relative; }
.share-dropdown-container { position: relative; display: inline-block; }

.share-btn-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-1);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.share-btn-trigger:hover,
.share-btn-trigger[aria-expanded="true"] {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.share-btn-trigger .share-icon-svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.share-btn-trigger .share-chevron-svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.share-btn-trigger[aria-expanded="true"] .share-chevron-svg {
  transform: rotate(180deg);
}

/* Hide share label text on smaller screens */
@media (max-width: 640px) {
  .share-btn-text {
    display: none !important;
  }
  .share-btn-trigger {
    padding: 8px 10px;
    gap: 4px;
  }
}

.share-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  padding: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: shareDropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.share-dropdown-menu[hidden] {
  display: none !important;
}

@keyframes shareDropdownFade {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.share-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.share-menu-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.share-menu-close:hover {
  color: var(--text);
  background: var(--surface-2);
}

.share-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.share-option-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  cursor: pointer;
}

.share-option-btn:hover {
  background: var(--surface-1);
  border-color: var(--text);
  transform: translateY(-1px);
}

.share-option-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.share-x svg { color: #1DA1F2; }
.share-fb svg { color: #1877F2; }
.share-linkedin svg { color: #0A66C2; }
.share-whatsapp svg { color: #25D366; }
.share-email svg { color: var(--text); }
.share-native svg { color: var(--primary); }

.share-copy-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.share-copy-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.share-copy-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 4px 4px 10px;
}

.share-url-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  outline: none;
  width: 100%;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.share-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--primary, #B91C1C);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.1s ease;
  font-family: inherit;
}

.share-copy-btn:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.share-copy-btn.copied {
  background: #16a34a !important;
  color: #ffffff;
}

.share-copy-btn svg {
  width: 14px;
  height: 14px;
}

.article-hero { margin: 28px 0 32px; }
.article-hero img { width: 100%; max-height: 540px; object-fit: cover; border-radius: 4px; transition: opacity 0.3s ease; }
.article-hero img.skeleton { min-height: 380px; }
.article-hero-fallback {
  width: 100%;
  max-height: 540px;
  min-height: 250px;
  height: clamp(200px, 40vw, 540px);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
.article-hero-fallback strong {
  font-size: clamp(24px, 5vw, 48px) !important;
  line-height: 1.2;
}
.article-hero figcaption { font-size: 13px; color: var(--text-secondary, var(--muted)); margin-top: 10px; line-height: 1.4; font-style: italic; }

.article-body { max-width: 720px; margin: 0 auto; font-size: 18px; line-height: 1.75; }
.article-body p { margin-bottom: 22px; }
.article-body p:first-of-type::first-letter {
  font-family: inherit;
  font-weight: inherit;
  font-size: inherit;
  float: none;
  line-height: inherit;
  margin: 0;
  color: inherit;
}

.article-tags { max-width: 720px; margin: 32px auto 0; display: flex; flex-wrap: wrap; gap: 8px; }
.article-tags a {
  font-size: 12px; padding: 6px 12px; border-radius: 999px;
  background: var(--surface-2); color: var(--text); font-weight: 600;
}
.article-tags a:hover { background: var(--text); color: var(--bg); }

.article-aside { display: flex; flex-direction: column; gap: 28px; }
.aside-block h4 { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; font-family: var(--sans); font-weight: 700; color: var(--muted); padding-bottom: 10px; border-bottom: 2px solid var(--text); margin-bottom: 16px; }
.aside-list { display: flex; flex-direction: column; gap: 16px; }
.aside-item { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.aside-item:last-child { border-bottom: 0; }
.aside-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 2px; }
.aside-item .t { font-family: var(--serif); font-weight: 700; font-size: 14px; line-height: 1.25; }
.aside-item .m { font-size: 11px; color: var(--muted); margin-top: 4px; letter-spacing: 0.04em; }

/* ---------- STATIC PAGES ---------- */
.prose-wrap { padding: 48px 0 80px; }
.prose { max-width: 760px; margin: 0 auto; }
.prose .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--primary); margin-bottom: 14px; }
.prose h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.1; margin-bottom: 18px; }
.prose .lead { font-size: 18px; color: var(--muted); line-height: 1.6; margin-bottom: 32px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.prose h2 { font-size: 24px; margin: 32px 0 12px; }
.prose h3 { font-size: 18px; margin: 24px 0 8px; font-family: var(--sans); font-weight: 700; letter-spacing: 0.02em; }
.prose p { margin-bottom: 18px; line-height: 1.75; font-size: 16.5px; }
.prose ul { padding-left: 22px; margin-bottom: 18px; }
.prose ul li { margin-bottom: 8px; line-height: 1.6; }
.prose a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }

/* Contact form */
.contact-form { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.field input, .field textarea, .field select {
  font: inherit; padding: 12px 14px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); border-radius: 2px; outline: none; transition: border-color 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--primary); }
.field textarea { min-height: 140px; resize: vertical; }
.btn-primary {
  background: var(--primary); color: #FFF; padding: 14px 28px;
  font-weight: 700; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase;
  border-radius: 2px; transition: opacity 0.15s; align-self: flex-start;
}
.btn-primary:hover { opacity: 0.9; }
.form-status { font-size: 14px; color: var(--secondary); margin-top: 6px; }

/* Ads page rate cards */
.rate-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 16px; }
@media (min-width: 700px) { .rate-grid { grid-template-columns: repeat(3, 1fr); } }
.rate-card { padding: 24px; border: 1px solid var(--border); border-radius: 2px; background: var(--surface); }
.rate-card h3 { font-family: var(--serif); font-size: 20px; margin-bottom: 6px; }
.rate-card .price { font-size: 28px; font-weight: 800; color: var(--primary); margin: 8px 0 12px; font-family: var(--serif); }
.rate-card ul { padding-left: 18px; }
.rate-card ul li { font-size: 14px; margin-bottom: 6px; color: var(--muted); }

/* ---------- FOOTER ---------- */
.site-footer { background: #0F172A; color: #CBD5E1; padding: 48px 0 24px; margin-top: 32px; }
html.dark .site-footer { background: #000; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 32px; padding-bottom: 32px; border-bottom: 1px solid #1F2937; }
@media (min-width: 700px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; } }
.footer-brand h3 { font-family: var(--serif); color: #FFF; font-size: 26px; margin-bottom: 12px; }
.footer-brand p { font-size: 14px; line-height: 1.6; color: #94A3B8; max-width: 360px; }
.footer-col h5 { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: #FFF; font-weight: 700; margin-bottom: 14px; font-family: var(--sans); }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 14px; color: #CBD5E1; }
.footer-col a:hover { color: #FFF; text-decoration: underline; text-underline-offset: 3px; }
.footer-social { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.footer-social a {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid #1F2937; border-radius: 999px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.footer-social a:hover { background: var(--primary); border-color: var(--primary); color: #FFF; }
.footer-social svg { width: 16px; height: 16px; }
.footer-bottom { padding-top: 20px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: 12px; color: #94A3B8; }

.footerSvgYt {background-image: url('data:image/svg+xml,<svg viewBox="0 0 24 24" fill="currentColor"><path d="M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"/></svg>');

//url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath' d='M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z'/%3E%3C/svg%3E");
background-repeat: no-repeat no-repeat;
background-position: center center;
background-size: cover;
}




/* ---------- UTIL ---------- */
.hide-mobile { display: none; }
@media (min-width: 768px) { .hide-mobile { display: block; } span.hide-mobile, a.hide-mobile, div.masthead-tag.hide-mobile, div.top-strip nav.hide-mobile { display: inline-flex; } .hide-desktop { display: none; } }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 0%, var(--border) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: skel 1.4s infinite linear; }
@keyframes skel { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* hide emergent badge for cleaner look on dark, keep visible */
#emergent-badge { z-index: 200 !important; }

/* override CRA root div (React mounts here, App returns null) */
#root { display: none; }

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.btn-spinner {
  animation: spin 0.8s linear infinite;
}

/* Skeleton Loading Animation */
@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}
.skeleton-box {
  background: linear-gradient(to right, var(--surface-2) 4%, var(--surface-3) 25%, var(--surface-2) 36%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite linear;
  border-radius: 4px;
}
.skeleton-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-primary);
}
.skeleton-img { width: 100%; height: 200px; }
.skeleton-cat { width: 60px; height: 16px; }
.skeleton-title { width: 90%; height: 24px; }
.skeleton-title-2 { width: 60%; height: 24px; }
.skeleton-p { width: 100%; height: 14px; }
.skeleton-meta { width: 40%; height: 12px; }

/* Interaction styles */
.interaction-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 100px;
  cursor: pointer;
  color: var(--text-primary);
  font-family: inherit;
  font-weight: 600;
  transition: all 0.2s ease;
}
.interaction-btn:hover {
  background: var(--surface-3);
}
.interaction-btn.active {
  background: var(--brand-red);
  color: #fff;
  border-color: var(--brand-red);
}
.interaction-btn.active .int-icon {
  fill: currentColor;
}
.int-icon {
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), fill 0.2s ease;
}
.pop-anim .int-icon {
  transform: scale(1.3);
}
.comment-like-btn, .comment-dislike-btn {
  padding: 4px 8px;
  border-radius: 4px;
  background: transparent;
  border: 1px solid transparent;
  font-size: 12px;
}
.comment-like-btn:hover, .comment-dislike-btn:hover {
  background: var(--surface-2);
}
.comment-like-btn.active, .comment-dislike-btn.active {
  background: var(--surface-3);
  color: var(--brand-red);
}







/* Sub-nav styling for category pages */
.sub-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.sub-nav a {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 20px;
  transition: all 0.2s;
}
.sub-nav a:hover, .sub-nav a.active {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
}
.sub-nav-local {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sub-nav-local input {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
}

/* Modern WYSIWYG Editor & Article Render Styling */
.wysiwyg-container {
  background: var(--surface-1, #ffffff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
}

.wysiwyg-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: var(--surface-2, #f8fafc);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  position: sticky;
  top: 0;
  z-index: 20;
  max-width: 100%;
  box-sizing: border-box;
}

.wysiwyg-group {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.wysiwyg-divider {
  width: 1px;
  height: 20px;
  background: var(--border-color, #cbd5e1);
  margin: 0 6px;
  flex-shrink: 0;
}

.wysiwyg-select {
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 6px;
  background: var(--surface-1, #ffffff);
  color: var(--text-primary, #1e293b);
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
}
.wysiwyg-select:focus {
  border-color: var(--brand-red, #dc2626);
}

.wysiwyg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--text-primary, #334155);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  flex-shrink: 0;
}

.wysiwyg-btn:hover {
  background: var(--surface-1, #ffffff);
  border-color: var(--border-color, #cbd5e1);
  color: var(--brand-red, #dc2626);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.wysiwyg-btn.active {
  background: var(--brand-red, #dc2626);
  color: #ffffff;
  border-color: var(--brand-red, #dc2626);
}

.wysiwyg-btn svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  display: block;
}

@media (max-width: 768px) {
  .wysiwyg-toolbar, #wysiwyg-toolbar {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 6px 10px;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color, #cbd5e1) transparent;
  }
  .wysiwyg-toolbar::-webkit-scrollbar, #wysiwyg-toolbar::-webkit-scrollbar {
    height: 3px;
  }
  .wysiwyg-toolbar::-webkit-scrollbar-thumb, #wysiwyg-toolbar::-webkit-scrollbar-thumb {
    background: var(--border-color, #cbd5e1);
    border-radius: 3px;
  }
  .wysiwyg-toolbar .wysiwyg-group[style*="margin-left: auto"],
  #wysiwyg-toolbar .wysiwyg-group[style*="margin-left: auto"] {
    margin-left: 0 !important;
  }
  .wysiwyg-divider {
    margin: 0 4px;
  }
  .wysiwyg-select {
    padding: 5px 8px;
    font-size: 12px;
    max-width: 110px;
  }
  .wysiwyg-btn {
    width: 34px;
    height: 34px;
  }
}

.wysiwyg-editor {
  min-height: 380px;
  padding: 24px;
  color: var(--text-primary, #0f172a);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.7;
  outline: none;
  background: var(--surface-1, #ffffff);
}

.wysiwyg-editor[contenteditable="true"]:empty::before {
  content: attr(placeholder);
  color: #94a3b8;
  cursor: text;
  display: block;
}

.wysiwyg-source-textarea {
  width: 100%;
  min-height: 380px;
  padding: 16px;
  font-family: monospace;
  font-size: 14px;
  line-height: 1.5;
  border: 0;
  outline: none;
  background: #0f172a;
  color: #f8fafc;
  resize: vertical;
}

/* Article & Editor Elements Render */
.article-body, .wysiwyg-editor {
  word-break: break-word;
}

.article-body h1, .wysiwyg-editor h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-top: 1.8rem;
  margin-bottom: 0.8rem;
  line-height: 1.3;
}

.article-body h2, .wysiwyg-editor h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.7rem;
  line-height: 1.35;
}

.article-body h3, .wysiwyg-editor h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 1.3rem;
  margin-bottom: 0.6rem;
}

.article-body h4, .wysiwyg-editor h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.1rem;
  margin-bottom: 0.5rem;
}

.article-body p, .wysiwyg-editor p {
  margin-bottom: 1.2rem;
  font-size: 16px;
  line-height: 1.75;
}

.article-body ul, .wysiwyg-editor ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin-bottom: 1.2rem;
}

.article-body ol, .wysiwyg-editor ol {
  list-style-type: decimal;
  padding-left: 1.5rem;
  margin-bottom: 1.2rem;
}

.article-body li, .wysiwyg-editor li {
  margin-bottom: 0.4rem;
}

.wysiwyg-checklist {
  list-style: none !important;
  padding-left: 0 !important;
  margin-bottom: 1.2rem;
}

.wysiwyg-checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.5rem;
}

.wysiwyg-checklist li input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--brand-red, #dc2626);
  cursor: pointer;
}

.article-body blockquote, .wysiwyg-editor blockquote {
  border-left: 4px solid var(--brand-red, #dc2626);
  padding: 12px 20px;
  margin: 20px 0;
  font-style: italic;
  font-size: 1.05rem;
  background: var(--surface-2, #f8fafc);
  border-radius: 0 8px 8px 0;
  color: var(--text-primary, #334155);
}

.article-body pre, .wysiwyg-editor pre {
  background: #0f172a;
  color: #f1f5f9;
  padding: 16px 20px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'Fira Code', Consolas, Monaco, monospace;
  font-size: 14px;
  line-height: 1.6;
  margin: 20px 0;
}

.article-body code, .wysiwyg-editor code {
  font-family: 'Fira Code', Consolas, Monaco, monospace;
  background: var(--surface-2, #f1f5f9);
  color: #e11d48;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
}

.article-body pre code, .wysiwyg-editor pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
}

mark.wysiwyg-highlight {
  background-color: #fef08a;
  color: #854d0e;
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 500;
}

hr.wysiwyg-delimiter {
  border: 0;
  height: 1px;
  background: var(--border-color, #cbd5e1);
  margin: 32px 0;
  position: relative;
}

hr.wysiwyg-delimiter::after {
  content: "✦";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--surface-1, #ffffff);
  padding: 0 12px;
  color: #94a3b8;
  font-size: 14px;
}

/* Responsive Tables */
.wysiwyg-table-wrapper {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: 8px;
  border: 1px solid var(--border-color, #e2e8f0);
}

table.wysiwyg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

table.wysiwyg-table th {
  background: var(--surface-2, #f8fafc);
  font-weight: 700;
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--border-color, #e2e8f0);
}

table.wysiwyg-table td {
  padding: 10px 14px;
  border: 1px solid var(--border-color, #e2e8f0);
}

table.wysiwyg-table tr:nth-child(even) td {
  background: var(--surface-2, #f9fafb);
}

/* Responsive Media Embeds */
.embed-responsive-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 24px 0;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.embed-responsive-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  border: 0;
}

.embed-responsive-wrapper.twitter-wrapper,
.embed-responsive-wrapper.instagram-wrapper,
.embed-responsive-wrapper.facebook-wrapper {
  aspect-ratio: auto;
  min-height: 400px;
  max-width: 540px;
  margin: 24px auto;
  background: transparent;
  box-shadow: none;
}

.article-img-figure {
  margin: 24px 0;
  text-align: center;
}

.article-img-figure img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  display: inline-block;
}

.article-img-figure figcaption {
  font-size: 13px;
  color: var(--text-secondary, #64748b);
  margin-top: 8px;
  font-style: italic;
}

/* Modal Dialogs for WYSIWYG */
.wysiwyg-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.wysiwyg-dialog {
  background: var(--surface-1, #ffffff);
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  padding: 24px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.wysiwyg-dialog h3 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

.wysiwyg-dialog .form-group {
  margin-bottom: 16px;
}

.wysiwyg-dialog label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary, #334155);
}

.wysiwyg-dialog input, .wysiwyg-dialog select {
  width: 100%;
  padding: 10px;
  font-size: 14px;
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 6px;
  background: var(--bg-primary, #ffffff);
  color: var(--text-primary, #0f172a);
}

.wysiwyg-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* Cover Image Dropzone */
.cover-upload-zone {
  border: 2px dashed var(--border-color, #cbd5e1);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  background: var(--surface-2, #f8fafc);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.cover-upload-zone:hover {
  border-color: var(--brand-red, #b91c1c);
  background: var(--surface-1, #ffffff);
}
.cover-preview-container {
  position: relative;
  margin-top: 12px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color, #e2e8f0);
}
.cover-preview-img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
}
.cover-action-bar {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

/* Dashboard Header & Back/Cancel Button Styling */
.db-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.db-header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

#btn-back-content {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface-2, #f1f5f9);
  color: var(--text-primary, #0f172a);
  border: 1px solid var(--border-color, #cbd5e1);
  padding: 8px 16px;
  min-height: 40px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

#btn-back-content:hover {
  background: var(--surface-3, #e2e8f0);
  border-color: var(--brand-red, #dc2626);
  color: var(--brand-red, #dc2626);
}

#btn-back-content:active {
  transform: scale(0.98);
}

#btn-back-content svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  flex-shrink: 0;
}

.form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 640px) {
  .db-header {
    align-items: center;
    gap: 12px;
  }
  .db-header h1 {
    font-size: 20px;
  }
  #btn-back-content {
    padding: 6px 12px;
    font-size: 13px;
    min-height: 36px;
    gap: 6px;
  }
  #btn-back-content svg {
    width: 16px;
    height: 16px;
  }
  .form-grid-2col {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Responsive Overflow & Touch Scroll Improvements for Small Mobile Screens */
.content-tabs {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  max-width: 100%;
}

.content-tab {
  flex-shrink: 0;
}

#wysiwyg-editor-holder, .wysiwyg-container {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-container {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .studio-main { min-width: 0;
    padding: 16px;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: auto;
  }
  .wysiwyg-toolbar, #wysiwyg-toolbar {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 8px 10px;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color, #cbd5e1) transparent;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
  .wysiwyg-toolbar::-webkit-scrollbar, #wysiwyg-toolbar::-webkit-scrollbar {
    height: 4px;
  }
  .wysiwyg-toolbar::-webkit-scrollbar-thumb, #wysiwyg-toolbar::-webkit-scrollbar-thumb {
    background: var(--border-color, #cbd5e1);
    border-radius: 4px;
  }
  .wysiwyg-group {
    flex-shrink: 0;
    white-space: nowrap;
  }
  .wysiwyg-editor {
    padding: 16px;
    min-height: 280px;
    font-size: 15px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .wysiwyg-source-textarea {
    padding: 12px;
    min-height: 280px;
    font-size: 13px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

.studio-main > div:nth-of-type(2) {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.studio-main > div:nth-of-type(3) {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

/* Explicit rule for user focus */
div.top-strip > div.container > nav.links,
div:nth-of-type(2) > div:nth-of-type(1) > nav:nth-of-type(1) {
  display: flex !important;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  max-width: 100%;
}

.image-fallback {
  width: 100%;
  height: 100%;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  box-sizing: border-box;
}


.article-hero .image-fallback {
  max-height: 540px;
  min-height: 250px;
  height: clamp(200px, 40vw, 540px);
}

.card-img .image-fallback {
  min-height: 200px;
}

.hero-img .image-fallback, .side-img .image-fallback {
  min-height: 100%;
}

.card-fallback-img .fallback-cat, .side-fallback-img .fallback-cat {
  font-size: clamp(12px, 2vw, 14px);
}
.aside-fallback-img .fallback-cat {
  font-size: 9px;
  line-height: 1.1;
  word-break: break-word;
  white-space: normal;
}


.hero-fallback-img .fallback-cat, .article-hero-fallback .fallback-cat {
  font-size: clamp(16px, 3vw, 24px);
  margin-bottom: 8px;
}


.aside-fallback-img {
  width: 64px;
  height: 64px;
  min-height: 64px;
  padding: 4px;
  border-radius: 2px;
}
