:root {
  /* Refined Editorial Dark Mode */
  --bg: #111318;
  --surface: #181b21;
  --surface-2: #22262f;
  --border: #2a2e37;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --text: #e2e8f0;
  --text-muted: #8b96a5;
  --success: #10b981;
  --error: #ef4444;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}
.mt-3 {
  margin-top: 1rem;
}

/* -----------------------------
   NAVBAR
----------------------------- */
.blog-nav {
  background-color: rgba(17, 19, 24, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}
.brand h1 span {
  color: var(--text-muted);
  font-weight: 400;
}
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 28px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover {
  color: #fff;
}
.nav-links .premium-link {
  color: var(--accent);
}

/* -----------------------------
   LAYOUT
----------------------------- */
.layout-container {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 60px;
  max-width: 1200px;
  margin: 40px auto 60px;
  padding: 0 24px;
  align-items: start;
  flex: 1;
}

/* -----------------------------
   ARTICLE STYLING
----------------------------- */
.article-content {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}
.article-header {
  margin-bottom: 40px;
}
.article-header .category {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
}
.article-header h2 {
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 12px 0 16px;
  color: #f8fafc;
  letter-spacing: -0.02em;
}
.article-header .meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-family: "Inter", sans-serif;
}

.article-body {
  font-family: "Lora", serif; /* Elegant reading font */
  font-size: 1.2rem;
  line-height: 1.8;
  color: #cbd5e1;
}
.article-body p {
  margin-bottom: 28px;
}

/* The Fade Effect before the paywall */
.content-fade {
  position: relative;
  mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0) 90%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0) 90%
  );
  margin-bottom: -40px; /* Pulls the widget up slightly into the fade */
}

/* -----------------------------
   SIDEBARS
----------------------------- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 32px;
  font-size: 0.95rem;
}
.author-bio {
  text-align: center;
}
.author-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 16px;
  border: 1px solid var(--border);
}
.sidebar-widget {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.sidebar-widget:last-child {
  border-bottom: none;
}
.sidebar-widget h4 {
  margin-bottom: 12px;
  color: #fff;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sidebar-widget p {
  color: var(--text-muted);
  line-height: 1.5;
}
.trending-list {
  list-style: none;
}
.trending-list li {
  margin-bottom: 14px;
}
.trending-list a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  line-height: 1.4;
  display: block;
}
.trending-list a:hover {
  color: var(--accent);
}

/* -----------------------------
   EDITORIAL PAYWALL WIDGET
----------------------------- */
.paywall-wrapper {
  position: relative;
  z-index: 10;
  margin: 20px 0 40px;
  font-family: "Inter", sans-serif;
}

.verification-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 32px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.widget-header {
  margin-bottom: 32px;
}
.widget-header h3 {
  font-size: 1.4rem;
  color: #fff;
  font-weight: 600;
  margin-bottom: 8px;
}
.widget-header .subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto 16px;
  line-height: 1.5;
}
.security-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Status & Interaction Panels */
.widget-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 400px;
  margin: 0 auto 24px;
}

.status-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}
.status-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  align-items: center;
}
.status-row .label {
  color: var(--text-muted);
}
.status-row .value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}
.value.checking {
  color: var(--accent);
}
.value.ready {
  color: var(--success);
}
.value.error {
  color: var(--error);
}
.value.pending {
  color: var(--text-muted);
}

.interaction-panel {
  min-height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.gate-panel p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.watch-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Status Dots */
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}
.dot.pulse {
  background: var(--accent);
  animation: pulse 2s infinite;
}
.value.ready .dot,
.status-dot.success {
  background: var(--success);
}
.value.error .dot,
.status-dot.error {
  background: var(--error);
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}
.status-dot.pulsing {
  background-color: var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
  }
  70% {
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}
.btn-primary {
  background: var(--text);
  color: var(--bg);
}
.btn-primary:hover:not(:disabled) {
  background: #fff;
  transform: translateY(-1px);
}
.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface-2);
}
.btn-large {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  max-width: 400px;
  margin: 0 auto;
}
.btn:disabled,
.btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Alerts / Errors */
.alert-panel {
  background: rgba(239, 68, 68, 0.05);
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
}
.alert-panel h4 {
  color: var(--error);
  margin-bottom: 6px;
  font-size: 0.95rem;
}
.alert-panel p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

/* Countdown Ring */
.countdown-ring {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 8px;
}
.progress-ring__circle {
  transition: stroke-dashoffset 1s linear;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}
.countdown-text {
  position: absolute;
  font-size: 1.4rem;
  font-weight: 500;
  font-family: monospace;
  color: #fff;
}
.watch-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 !important;
}

/* Success Panel */
.success-icon {
  width: 40px;
  height: 40px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin: 0 auto 12px;
}

/* -----------------------------
   ADVERTISEMENTS
----------------------------- */
.ad-slot-wrapper {
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 32px;
}
.ad-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
  width: 100%;
  text-align: center;
  font-family: "Inter", sans-serif;
}
.ad-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

/* Ad Sizes Constraints */
.top-ad,
.bottom-ad {
  max-width: 728px;
  margin: 24px auto;
}
.inline-ad {
  float: right;
  margin: 8px 0 24px 32px;
  max-width: 300px;
  background: var(--surface-2);
  padding: 12px;
  border-radius: 8px;
}

/* -----------------------------
   FOOTER & MISC
----------------------------- */
.site-footer {
  text-align: center;
  padding: 40px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
#debug-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid var(--accent);
  padding: 16px;
  font-family: monospace;
  font-size: 0.75rem;
  color: #fff;
  max-width: 400px;
  max-height: 50vh;
  overflow-y: auto;
}
#debug-panel h4 {
  color: var(--accent);
  margin-bottom: 8px;
}

/* -----------------------------
   RESPONSIVE DESIGN
----------------------------- */
@media (max-width: 1200px) {
  .layout-container {
    grid-template-columns: 1fr 280px;
    max-width: 900px;
  }
  .left-sidebar {
    display: none;
  }
}
@media (max-width: 800px) {
  .layout-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .right-sidebar {
    display: none;
  }
  .top-ad,
  .bottom-ad {
    display: none;
  }
  .inline-ad {
    float: none;
    margin: 32px auto;
    max-width: 100%;
  }
  .article-header h2 {
    font-size: 2.2rem;
  }
  .verification-widget {
    padding: 32px 20px;
  }
}
