/**
 * Learning Section Styles
 * AWSReady - Learn pages (learn.html, learn-article.html)
 *
 * Design language: AWS brand (navy #232f3e + orange #ff9900),
 * modern cards with subtle shadows, generous spacing, Inter typography.
 * Tokens come from style.css (CSS custom properties).
 */

/* ========================================
   Page Layout
   ======================================== */

.learn-page {
  min-height: 100vh;
  background: var(--gray-50, #f9fafb);
}

/* ========================================
   Reading Progress Bar (article page)
   ======================================== */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: var(--z-fixed, 30);
  pointer-events: none;
}

.reading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(
    90deg,
    var(--primary-500, #ff9900) 0%,
    var(--primary-400, #fb923c) 100%
  );
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(255, 153, 0, 0.4);
}

/* ========================================
   Hero Section
   ======================================== */

.learn-hero {
  position: relative;
  background:
    radial-gradient(
      ellipse at top right,
      rgba(255, 153, 0, 0.18) 0%,
      transparent 55%
    ),
    radial-gradient(
      ellipse at bottom left,
      rgba(37, 99, 235, 0.22) 0%,
      transparent 55%
    ),
    linear-gradient(135deg, #0f1e33 0%, #232f3e 55%, #1b2533 100%);
  color: #ffffff;
  padding: 4.5rem 0 3.5rem;
  text-align: center;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.learn-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  pointer-events: none;
}

.learn-hero > .container {
  position: relative;
  z-index: 1;
}

.learn-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  background: rgba(255, 153, 0, 0.12);
  border: 1px solid rgba(255, 153, 0, 0.35);
  border-radius: var(--radius-full, 9999px);
  color: var(--primary-300, #fdba74);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.learn-hero-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-500, #ff9900);
  box-shadow: 0 0 10px var(--primary-500, #ff9900);
}

.learn-hero h1 {
  font-size: clamp(2rem, 4.2vw, 3rem);
  font-weight: 800;
  margin: 0 0 1rem;
  letter-spacing: -0.025em;
  line-height: 1.1;
  background: linear-gradient(180deg, #ffffff 0%, #d1d5db 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.learn-hero p {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.78);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ========================================
   Filter Bar (sticky pill style)
   ======================================== */

.learn-filters {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky, 20);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

.filter-bar {
  display: flex;
  gap: 10px;
  padding: 14px 0;
  flex-wrap: wrap;
  align-items: center;
}

.filter-bar select {
  appearance: none;
  -webkit-appearance: none;
  padding: 9px 36px 9px 16px;
  border: 1.5px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius-full, 9999px);
  background-color: var(--gray-50, #f9fafb);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary, #374151);
  cursor: pointer;
  transition: all var(--transition-fast, 0.15s ease);
  font-family: var(--font-family-base);
  min-height: 40px;
}

.filter-bar select:hover {
  border-color: var(--primary-400, #fb923c);
  background-color: #ffffff;
}

.filter-bar select:focus {
  outline: none;
  border-color: var(--primary-500, #ff9900);
  background-color: #ffffff;
  box-shadow: var(--shadow-focus, 0 0 0 4px rgba(255, 153, 0, 0.2));
}

/* ========================================
   Section Common
   ======================================== */

.learn-featured,
.learn-categories,
.learn-articles {
  padding: 3rem 0;
}

.learn-featured {
  padding-top: 3.5rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.learn-featured h2,
.learn-categories h2,
.learn-articles h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--secondary-color, #232f3e);
  margin: 0;
  letter-spacing: -0.02em;
  position: relative;
  padding-left: 1rem;
}

.learn-featured h2::before,
.learn-categories h2::before,
.learn-articles h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10%;
  bottom: 10%;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    var(--primary-500, #ff9900) 0%,
    var(--primary-600, #ea580c) 100%
  );
}

.section-subtitle {
  color: var(--text-tertiary, #6b7280);
  font-size: 0.9375rem;
  margin: 0.375rem 0 0;
}

/* ========================================
   Category Grid
   ======================================== */

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.category-card {
  --accent: var(--primary-500, #ff9900);
  position: relative;
  display: block;
  padding: 1.75rem 1.5rem 1.5rem;
  background: #ffffff;
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.1));
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.25s var(--ease-smooth),
    box-shadow 0.25s var(--ease-smooth),
    border-color 0.25s var(--ease-smooth);
  border: 1px solid var(--gray-200, #e5e7eb);
  overflow: hidden;
  isolation: isolate;
}

.category-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--accent) 0%,
    var(--accent) 100%
  );
  opacity: 0.9;
}

.category-card::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -30%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  filter: blur(40px);
  transition: opacity 0.3s var(--ease-smooth);
  z-index: -1;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg, 0 12px 40px rgba(0, 0, 0, 0.15));
  border-color: transparent;
  text-decoration: none;
}

.category-card:hover::after {
  opacity: 0.08;
}

.category-card:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px var(--accent),
    var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.1));
}

.category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md, 12px);
  font-size: 1.75rem;
  line-height: 1;
  margin-bottom: 1rem;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}

/* Fallback for browsers without color-mix */
@supports not (background: color-mix(in srgb, red, blue)) {
  .category-icon {
    background: rgba(255, 153, 0, 0.12);
  }
}

.category-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary, #111827);
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.category-card p {
  color: var(--text-tertiary, #6b7280);
  font-size: 0.875rem;
  margin: 0 0 1rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.category-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.875rem;
  border-top: 1px dashed var(--gray-200, #e5e7eb);
}

.article-count {
  font-size: 0.8125rem;
  color: var(--text-tertiary, #6b7280);
  font-weight: 600;
}

.category-card-arrow {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.125rem;
  transition: transform 0.25s var(--ease-smooth);
}

.category-card:hover .category-card-arrow {
  transform: translateX(4px);
}

/* ========================================
   Article Card (grid)
   ======================================== */

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.article-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.1));
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.25s var(--ease-smooth),
    box-shadow 0.25s var(--ease-smooth);
  border: 1px solid var(--gray-200, #e5e7eb);
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg, 0 12px 40px rgba(0, 0, 0, 0.15));
  text-decoration: none;
}

.article-card:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px var(--primary-500, #ff9900),
    var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.1));
}

.article-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #1e3a5f 0%, #232f3e 50%, #2563eb 100%);
}

.article-cover-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 55%,
    rgba(0, 0, 0, 0.45) 100%
  );
  pointer-events: none;
}

.article-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease-smooth);
}

.article-card:hover .article-cover {
  transform: scale(1.04);
}

.article-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background-image:
    radial-gradient(
      circle at 25% 25%,
      rgba(255, 153, 0, 0.35) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 75% 75%,
      rgba(37, 99, 235, 0.35) 0%,
      transparent 50%
    );
}

.article-cover-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}

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

.article-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.article-card-body h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary, #111827);
  margin: 0 0 0.5rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card:hover .article-card-body h3 {
  color: var(--primary-600, #ea580c);
}

.article-card-body p {
  font-size: 0.875rem;
  color: var(--text-tertiary, #6b7280);
  line-height: 1.55;
  margin: 0 0 1rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-100, #f3f4f6);
  margin-top: auto;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ========================================
   Featured Grid (larger, prominent)
   ======================================== */

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.75rem;
}

.featured-article-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: var(--radius-xl, 24px);
  overflow: hidden;
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.1));
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.3s var(--ease-smooth),
    box-shadow 0.3s var(--ease-smooth);
  border: 1px solid var(--gray-200, #e5e7eb);
}

.featured-article-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl, 0 20px 60px rgba(0, 0, 0, 0.2));
  text-decoration: none;
}

.featured-article-card:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px var(--primary-500, #ff9900),
    var(--shadow-lg, 0 12px 40px rgba(0, 0, 0, 0.15));
}

.featured-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #1e3a5f 0%, #232f3e 50%, #2563eb 100%);
}

.featured-cover-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 50%,
    rgba(0, 0, 0, 0.55) 100%
  );
  pointer-events: none;
}

.featured-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease-smooth);
}

.featured-article-card:hover .featured-cover {
  transform: scale(1.05);
}

.featured-ribbon {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: linear-gradient(
    135deg,
    var(--primary-500, #ff9900) 0%,
    var(--primary-600, #ea580c) 100%
  );
  color: #ffffff;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-full, 9999px);
  box-shadow: 0 4px 12px rgba(255, 153, 0, 0.4);
}

.featured-card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.featured-card-body h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary, #111827);
  margin: 0 0 0.625rem;
  line-height: 1.35;
  letter-spacing: -0.015em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured-article-card:hover .featured-card-body h3 {
  color: var(--primary-600, #ea580c);
}

.featured-card-body p {
  font-size: 0.9375rem;
  color: var(--text-tertiary, #6b7280);
  line-height: 1.6;
  margin: 0 0 1rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========================================
   Badges
   ======================================== */

.difficulty-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.4;
  border: 1px solid transparent;
}

.difficulty-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}

/* Specific semantic colors (fallbacks inline from JS remain) */
.difficulty-badge.basic {
  background: #d1fae5;
  color: #065f46;
  border-color: rgba(6, 95, 70, 0.12);
}

.difficulty-badge.intermediate {
  background: #dbeafe;
  color: #1e40af;
  border-color: rgba(30, 64, 175, 0.12);
}

.difficulty-badge.advanced {
  background: #ffedd5;
  color: #9a3412;
  border-color: rgba(154, 52, 18, 0.12);
}

.exam-badge {
  display: inline-block;
  padding: 3px 9px;
  background: var(--gray-100, #f3f4f6);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius-xs, 4px);
  font-size: 0.6875rem;
  color: var(--gray-700, #374151);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-family: "SF Mono", Monaco, Consolas, "Courier New", monospace;
}

.category-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 153, 0, 0.1);
  color: var(--primary-700, #c2410c);
  border: 1px solid rgba(255, 153, 0, 0.25);
}

.read-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
  color: var(--text-tertiary, #6b7280);
  font-weight: 500;
}

.read-time::before {
  content: "⏱";
  font-size: 0.875rem;
  opacity: 0.7;
}

/* ========================================
   Loading & Empty States
   ======================================== */

.loading-state,
.article-loading {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--text-tertiary, #6b7280);
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--gray-200, #e5e7eb);
  border-top-color: var(--primary-500, #ff9900);
  border-radius: 50%;
  animation: learn-spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes learn-spin {
  to {
    transform: rotate(360deg);
  }
}

.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--text-tertiary, #6b7280);
  background: #ffffff;
  border-radius: var(--radius-lg, 16px);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.1));
  border: 1px dashed var(--gray-300, #d1d5db);
  margin: 2rem 0;
}

.empty-state::before {
  content: "📚";
  display: block;
  font-size: 3rem;
  margin-bottom: 0.75rem;
  opacity: 0.7;
}

.empty-state p {
  font-size: 1rem;
  margin: 0;
  font-weight: 500;
}

/* ========================================
   Load More Button
   ======================================== */

.btn-load-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2.25rem;
  background: #ffffff;
  border: 2px solid var(--gray-300, #d1d5db);
  border-radius: var(--radius-full, 9999px);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-secondary, #374151);
  cursor: pointer;
  transition: all var(--transition-base, 0.3s ease);
  font-family: var(--font-family-base);
  min-height: var(--touch-target-comfortable, 48px);
}

.btn-load-more:hover {
  border-color: var(--primary-500, #ff9900);
  color: var(--primary-600, #ea580c);
  background: var(--primary-50, #fff7ed);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.1));
}

.btn-load-more:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus, 0 0 0 4px rgba(255, 153, 0, 0.2));
}

/* ========================================
   Article Detail - Breadcrumb
   ======================================== */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-tertiary, #6b7280);
  padding: 1.25rem 0 0.25rem;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--primary-600, #ea580c);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast, 0.15s ease);
}

.breadcrumb a:hover {
  color: var(--primary-700, #c2410c);
  text-decoration: underline;
}

.breadcrumb .breadcrumb-sep {
  color: var(--gray-300, #d1d5db);
  font-size: 0.75rem;
}

/* ========================================
   Article Detail - Container & Header
   ======================================== */

.learn-article-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.article-detail-header {
  padding: 1.5rem 0 2rem;
  margin-bottom: 0.5rem;
}

.article-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.25rem;
  align-items: center;
}

.article-detail-header h1 {
  font-size: clamp(1.875rem, 3.5vw, 2.625rem);
  font-weight: 800;
  color: var(--secondary-color, #232f3e);
  margin: 0 0 1rem;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.article-detail-dates {
  font-size: 0.875rem;
  color: var(--text-tertiary, #6b7280);
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  align-items: center;
}

.article-detail-dates span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.article-detail-dates .dot-sep {
  color: var(--gray-300, #d1d5db);
}

/* ========================================
   Article Detail - Cover Image
   ======================================== */

.article-hero-wrap {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto 2.5rem;
  border-radius: var(--radius-xl, 24px);
  overflow: hidden;
  box-shadow: var(--shadow-lg, 0 12px 40px rgba(0, 0, 0, 0.15));
  background: linear-gradient(135deg, #1e3a5f 0%, #232f3e 50%, #2563eb 100%);
}

.article-hero-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 60%,
    rgba(0, 0, 0, 0.35) 100%
  );
  pointer-events: none;
}

.article-hero-img {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
  display: block;
}

/* ========================================
   Article Detail - Body (reading-optimized)
   ======================================== */

.article-body {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-primary, #111827);
  font-family: var(--font-family-base);

  /* Content protection - MUST remain */
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.article-body > :first-child {
  margin-top: 0;
}

.article-body h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-top: 3rem;
  margin-bottom: 1rem;
  color: var(--secondary-color, #232f3e);
  letter-spacing: -0.02em;
  line-height: 1.25;
  position: relative;
  padding-bottom: 0.625rem;
}

.article-body h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 52px;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--primary-500, #ff9900) 0%,
    transparent 100%
  );
  border-radius: 2px;
}

.article-body h3 {
  font-size: 1.375rem;
  font-weight: 700;
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  color: var(--secondary-color, #232f3e);
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.article-body h4 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary, #374151);
}

.article-body p {
  margin: 0 0 1.5rem;
}

.article-body strong {
  color: var(--secondary-color, #232f3e);
  font-weight: 700;
}

.article-body em {
  color: var(--text-secondary, #374151);
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.5rem;
  padding-left: 1.75rem;
}

.article-body li {
  margin-bottom: 0.625rem;
  line-height: 1.75;
}

.article-body li::marker {
  color: var(--primary-500, #ff9900);
  font-weight: 700;
}

.article-body a {
  color: var(--primary-600, #ea580c);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color var(--transition-fast, 0.15s ease);
  font-weight: 500;
}

.article-body a:hover {
  color: var(--primary-700, #c2410c);
  text-decoration-thickness: 2.5px;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md, 12px);
  margin: 1.5rem 0;
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.1));
  border: 1px solid var(--gray-200, #e5e7eb);
}

.article-body hr {
  border: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--gray-300, #d1d5db),
    transparent
  );
  margin: 2.5rem 0;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
  border-radius: var(--radius-sm, 8px);
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.1));
  border: 1px solid var(--gray-200, #e5e7eb);
}

.article-body th,
.article-body td {
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
  padding: 0.75rem 1rem;
  text-align: left;
}

.article-body th {
  background: var(--gray-50, #f9fafb);
  font-weight: 700;
  color: var(--text-secondary, #374151);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.article-body tr:last-child td {
  border-bottom: none;
}

.article-body tr:hover td {
  background: var(--gray-50, #f9fafb);
}

/* Code styles (syntax-highlighting friendly) */
.article-body code {
  background: var(--gray-100, #f3f4f6);
  color: #be185d;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs, 4px);
  font-family: "SF Mono", Monaco, "Inconsolata", "Courier New", monospace;
  font-size: 0.875em;
  border: 1px solid var(--gray-200, #e5e7eb);
  font-weight: 500;
}

.article-body pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.375rem 1.5rem;
  border-radius: var(--radius-md, 12px);
  overflow-x: auto;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.9rem;
  line-height: 1.7;
  position: relative;
}

.article-body pre::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--primary-500, #ff9900),
    #2563eb,
    #10b981
  );
  border-radius: var(--radius-md, 12px) var(--radius-md, 12px) 0 0;
  opacity: 0.8;
}

.article-body pre code {
  background: none;
  color: inherit;
  padding: 0;
  border: none;
  font-size: 0.9rem;
  font-weight: 400;
}

/* Blockquote */
.article-body blockquote {
  border-left: 4px solid var(--primary-500, #ff9900);
  padding: 1rem 1.5rem;
  margin: 1.75rem 0;
  color: var(--text-secondary, #374151);
  background: linear-gradient(
    90deg,
    rgba(255, 153, 0, 0.06) 0%,
    transparent 100%
  );
  border-radius: 0 var(--radius-sm, 8px) var(--radius-sm, 8px) 0;
  font-style: italic;
  font-size: 1.0625rem;
}

.article-body blockquote p:last-child {
  margin-bottom: 0;
}

/* Callout / Note Box */
.article-body .note,
.article-body .callout {
  background: rgba(37, 99, 235, 0.05);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-left: 4px solid #2563eb;
  border-radius: var(--radius-sm, 8px);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
  color: var(--text-secondary, #374151);
}

.article-body .warning {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-left: 4px solid var(--warning-color, #f59e0b);
  border-radius: var(--radius-sm, 8px);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
  color: var(--text-secondary, #374151);
}

.article-body .tip,
.article-body .success {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-left: 4px solid #10b981;
  border-radius: var(--radius-sm, 8px);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
  color: var(--text-secondary, #374151);
}

/* ========================================
   Article Detail - Related Articles
   ======================================== */

.related-section {
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--gray-200, #e5e7eb);
  margin-top: 3rem;
}

.related-section h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--secondary-color, #232f3e);
  margin: 0 0 1.5rem;
  letter-spacing: -0.02em;
  position: relative;
  padding-left: 1rem;
}

.related-section h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10%;
  bottom: 10%;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    var(--primary-500, #ff9900) 0%,
    var(--primary-600, #ea580c) 100%
  );
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.related-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: var(--radius-lg, 16px);
  overflow: hidden;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.1));
  text-decoration: none;
  color: inherit;
  transition:
    transform 0.25s var(--ease-smooth),
    box-shadow 0.25s var(--ease-smooth);
  border: 1px solid var(--gray-200, #e5e7eb);
}

.related-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.1));
  text-decoration: none;
}

.related-card-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
}

.related-card-cover-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 60%,
    rgba(0, 0, 0, 0.4) 100%
  );
}

.related-card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.related-card-body {
  padding: 1rem 1.125rem 1.125rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.related-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.related-card-body h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary, #111827);
  margin: 0 0 0.375rem;
  line-height: 1.4;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-card:hover .related-card-body h3 {
  color: var(--primary-600, #ea580c);
}

.related-card-body p {
  font-size: 0.8125rem;
  color: var(--text-tertiary, #6b7280);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========================================
   Article Detail - Navigation (Prev/Next)
   ======================================== */

.article-nav {
  display: flex;
  justify-content: space-between;
  padding: 1.75rem 0 0;
  border-top: 1px solid var(--gray-200, #e5e7eb);
  margin-top: 2.5rem;
  gap: 1rem;
}

.article-nav-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text-secondary, #374151);
  max-width: 45%;
  padding: 1rem 1.25rem;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius-md, 12px);
  background: #ffffff;
  transition: all var(--transition-fast, 0.15s ease);
}

.article-nav-link:hover {
  color: var(--primary-600, #ea580c);
  border-color: var(--primary-300, #fdba74);
  background: var(--primary-50, #fff7ed);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.1));
}

.article-nav-label {
  font-size: 0.6875rem;
  color: var(--text-tertiary, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin-bottom: 0.375rem;
}

.article-nav-title {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary, #111827);
}

.article-nav-link.next {
  text-align: right;
  margin-left: auto;
}

/* ========================================
   Article Detail - Error State
   ======================================== */

.article-error {
  text-align: center;
  padding: 5rem 1.5rem;
  color: var(--text-tertiary, #6b7280);
}

.article-error::before {
  content: "🔍";
  display: block;
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.article-error h2 {
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--secondary-color, #232f3e);
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
}

.article-error a {
  color: var(--primary-600, #ea580c);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-error a:hover {
  color: var(--primary-700, #c2410c);
}

/* ========================================
   Visually Hidden (a11y)
   ======================================== */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ========================================
   Content Protection (MUST remain)
   ======================================== */

@media print {
  body {
    display: none !important;
  }
}

/* ========================================
   Reduced Motion
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  .article-card,
  .featured-article-card,
  .category-card,
  .related-card,
  .article-cover,
  .featured-cover,
  .btn-load-more,
  .article-nav-link {
    transition: none !important;
  }

  .article-card:hover,
  .featured-article-card:hover,
  .category-card:hover,
  .related-card:hover {
    transform: none !important;
  }

  .spinner {
    animation-duration: 2s;
  }
}

/* ========================================
   Responsive - Tablet
   ======================================== */

@media (max-width: 768px) {
  .learn-hero {
    padding: 3rem 0 2.5rem;
  }

  .learn-hero h1 {
    font-size: 2rem;
  }

  .learn-hero p {
    font-size: 1rem;
  }

  .learn-hero-eyebrow {
    font-size: 0.6875rem;
  }

  .filter-bar {
    gap: 8px;
    padding: 12px 0;
  }

  .filter-bar select {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    font-size: 0.8125rem;
    padding: 9px 32px 9px 14px;
  }

  .learn-featured,
  .learn-categories,
  .learn-articles {
    padding: 2.25rem 0;
  }

  .learn-featured h2,
  .learn-categories h2,
  .learn-articles h2,
  .related-section h2 {
    font-size: 1.375rem;
  }

  .category-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .articles-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .featured-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .article-detail-header {
    padding: 1rem 0 1.5rem;
  }

  .article-body {
    font-size: 1.0625rem;
    line-height: 1.75;
  }

  .article-body h2 {
    font-size: 1.5rem;
    margin-top: 2.25rem;
  }

  .article-body h3 {
    font-size: 1.2rem;
    margin-top: 1.75rem;
  }

  .article-body pre {
    padding: 1.125rem 1.125rem;
    font-size: 0.8375rem;
    margin: 1.25rem -0.5rem;
    border-radius: var(--radius-sm, 8px);
  }

  .article-hero-wrap {
    margin-bottom: 1.75rem;
    border-radius: var(--radius-md, 12px);
  }

  .article-hero-img {
    max-height: 300px;
  }

  .article-nav {
    flex-direction: column;
  }

  .article-nav-link {
    max-width: 100%;
  }

  .article-nav-link.next {
    text-align: left;
    margin-left: 0;
  }

  .learn-article-container {
    padding: 0 1rem 3rem;
  }
}

/* ========================================
   Responsive - Mobile
   ======================================== */

@media (max-width: 480px) {
  .learn-hero {
    padding: 2.5rem 0 2rem;
  }

  .learn-hero h1 {
    font-size: 1.75rem;
  }

  .learn-hero p {
    font-size: 0.9375rem;
  }

  .filter-bar select {
    flex: 1 1 100%;
  }

  .article-detail-header h1 {
    font-size: 1.625rem;
  }

  .article-body {
    font-size: 1rem;
  }

  .article-body h2 {
    font-size: 1.375rem;
  }

  .article-body h3 {
    font-size: 1.125rem;
  }

  .featured-card-body,
  .article-card-body {
    padding: 1.125rem;
  }

  .featured-card-body h3 {
    font-size: 1.125rem;
  }
}

/* ==========================================
   Premium / private article markers
   ========================================== */

/* Lock badge — overlays the cover image on premium article cards.
   Positioned top-right so it doesn't collide with the difficulty badge
   (which sits top-left via .article-cover-badge). */
.premium-lock-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px 5px 9px;
  /* Gradient stops chosen so the darkest stop still passes 4.5:1 contrast
     against the #2a1a04 text. #d97706 fails (4.3:1); #db7b0f passes (≈5.1:1). */
  background: linear-gradient(
    135deg,
    #fbbf24 0%,
    #f59e0b 50%,
    #db7b0f 100%
  );
  color: #2a1a04;
  font-size: 0.6875rem;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: var(--radius-full, 9999px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 4px 14px rgba(180, 83, 9, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  pointer-events: none;
}

.premium-lock-badge-icon {
  font-size: 0.8125rem;
  line-height: 1;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.4));
}

.premium-lock-badge-text {
  line-height: 1;
}

/* When the featured ribbon is already in the top-right, nudge the lock
   badge down so they stack cleanly rather than overlapping. */
.featured-cover-wrap .premium-lock-badge {
  top: 52px;
}

/* Premium card treatment — a warmer tint and a subtle gold inset ring
   that reads as "special" without shouting. */
.article-card-premium {
  background:
    linear-gradient(180deg, #fffdf7 0%, #ffffff 35%);
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow:
    0 0 0 1px rgba(245, 158, 11, 0.18) inset,
    var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.05));
}

.article-card-premium:hover {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow:
    0 0 0 1px rgba(245, 158, 11, 0.28) inset,
    var(--shadow-lg, 0 12px 40px rgba(0, 0, 0, 0.12));
}

.featured-article-card.article-card-premium {
  background:
    linear-gradient(180deg, #fffdf7 0%, #ffffff 40%);
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow:
    0 0 0 1px rgba(245, 158, 11, 0.22) inset,
    var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.1));
}

.featured-article-card.article-card-premium:hover {
  box-shadow:
    0 0 0 1px rgba(245, 158, 11, 0.35) inset,
    var(--shadow-xl, 0 20px 60px rgba(0, 0, 0, 0.2));
}

/* ==========================================
   Paywall view on the article detail SPA
   ========================================== */

.article-paywall {
  max-width: 720px;
  margin: 2.5rem auto;
  background: #ffffff;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius-xl, 20px);
  box-shadow:
    0 0 0 1px rgba(245, 158, 11, 0.12) inset,
    0 12px 40px rgba(17, 24, 39, 0.08);
  overflow: hidden;
}

/* Branded header strip — sets tone before the title */
.article-paywall .paywall-header-strip {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1.5rem;
  /* Darkest gradient stop capped so #2a1a04 text stays ≥4.5:1 everywhere. */
  background: linear-gradient(
    90deg,
    #fbbf24 0%,
    var(--primary-500, #ff9900) 50%,
    #db7b0f 100%
  );
  color: #2a1a04;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(180, 83, 9, 0.25);
}

.article-paywall .paywall-header-strip-icon {
  font-size: 0.9375rem;
  line-height: 1;
}

.article-paywall .paywall-body {
  padding: 2rem 2rem 2.25rem;
}

.article-paywall .paywall-cover {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: var(--radius-lg, 12px);
  margin-bottom: 1.5rem;
  display: block;
  border: 1px solid var(--gray-100, #f3f4f6);
}

.article-paywall h1 {
  font-size: 1.875rem;
  font-weight: 800;
  margin: 0 0 0.875rem;
  color: var(--text-primary, #111827);
  line-height: 1.25;
  letter-spacing: -0.02em;
  /* Programmatic focus target (tabindex="-1") for screen-reader
     announcement when the paywall replaces the skeleton. */
  outline: none;
}

.article-paywall h1:focus-visible {
  outline: 2px solid #b45309;
  outline-offset: 4px;
  border-radius: 2px;
}

/* Exam chips + lock pill — now live under the title */
.article-paywall .paywall-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

/* The lock pill inside paywall-meta is inline, not an overlay. */
.article-paywall .paywall-meta .premium-lock-badge {
  position: static;
  top: auto;
  right: auto;
}

.article-paywall .paywall-excerpt {
  color: var(--text-secondary, #374151);
  line-height: 1.65;
  font-size: 1.0625rem;
  margin: 0 0 1.75rem;
}

/* CTA block — elevated, clearly actionable */
.article-paywall .paywall-cta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.5rem 1.5rem 1.625rem;
  background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
  border: 1px solid #fcd34d;
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 1px 2px rgba(180, 83, 9, 0.06);
}

.article-paywall .paywall-cta-title {
  font-weight: 800;
  color: #7c2d12;
  font-size: 1.1875rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0;
}

.article-paywall .paywall-cta-body {
  color: #78350f;
  font-size: 0.9375rem;
  line-height: 1.55;
  margin: 0 0 0.25rem;
}

.article-paywall .paywall-cta-body strong {
  color: #7c2d12;
  font-weight: 700;
}

.article-paywall .paywall-cta-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  margin-top: 0.875rem;
}

.article-paywall .paywall-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.375rem;
  border-radius: var(--radius-md, 8px);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9375rem;
  line-height: 1.2;
  transition:
    transform 0.15s var(--ease-smooth, ease),
    box-shadow 0.15s var(--ease-smooth, ease),
    background 0.15s ease;
  border: 1px solid transparent;
  cursor: pointer;
}

.article-paywall .paywall-btn-primary {
  /* Brand orange kept visually, but darker end-stops so white text
     passes WCAG 1.4.3 AA at 15px bold (both stops ≥ 5:1 against #fff). */
  background: linear-gradient(
    135deg,
    #b45309 0%,
    #7c2d12 100%
  );
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(124, 45, 18, 0.38);
}

.article-paywall .paywall-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(124, 45, 18, 0.45);
  color: #ffffff;
  text-decoration: none;
}

.article-paywall .paywall-btn-primary:focus-visible {
  /* Solid dark ring — opaque, meets 1.4.11 non-text contrast against
     the white page background and the button's own dark gradient. */
  outline: 2px solid #1f0d00;
  outline-offset: 2px;
}

.article-paywall .paywall-btn-secondary {
  background: #ffffff;
  color: #7c2d12;
  border-color: #fcd34d;
}

.article-paywall .paywall-btn-secondary:hover {
  background: #fffbeb;
  transform: translateY(-1px);
  text-decoration: none;
}

.article-paywall .paywall-btn-secondary:focus-visible {
  outline: 2px solid #7c2d12;
  outline-offset: 2px;
}

.article-paywall .paywall-refresh-hint {
  margin: 0.875rem 0 0;
  font-size: 0.8125rem;
  color: #92400e;
  line-height: 1.5;
}

.article-paywall .paywall-refresh-link {
  color: #7c2d12;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(124, 45, 18, 0.35);
  text-underline-offset: 2px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
}

.article-paywall .paywall-refresh-link:hover {
  text-decoration-color: currentColor;
}

.article-paywall .paywall-refresh-link:focus-visible {
  outline: 2px solid #7c2d12;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Respect users who prefer reduced motion — disable hover lifts. */
@media (prefers-reduced-motion: reduce) {
  .article-paywall .paywall-btn,
  .article-paywall .paywall-btn-primary:hover,
  .article-paywall .paywall-btn-secondary:hover {
    transition: none !important;
    transform: none !important;
  }
}

/* Mobile — under 720px, reduce padding and stack the CTA buttons */
@media (max-width: 720px) {
  .article-paywall {
    margin: 1.25rem 1rem;
    border-radius: var(--radius-lg, 14px);
  }

  .article-paywall .paywall-header-strip {
    padding: 0.625rem 1.125rem;
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
  }

  .article-paywall .paywall-body {
    padding: 1.375rem 1.25rem 1.625rem;
  }

  .article-paywall .paywall-cover {
    max-height: 200px;
    margin-bottom: 1.125rem;
  }

  .article-paywall h1 {
    font-size: 1.4375rem;
  }

  .article-paywall .paywall-excerpt {
    font-size: 0.9875rem;
    margin-bottom: 1.25rem;
  }

  .article-paywall .paywall-cta {
    padding: 1.125rem 1.125rem 1.25rem;
  }

  .article-paywall .paywall-cta-title {
    font-size: 1.0625rem;
  }

  .article-paywall .paywall-cta-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .article-paywall .paywall-btn {
    width: 100%;
    padding: 0.8125rem 1rem;
  }
}
