/* Wibidi Unified Editorial Stylesheet
   Self-hosted (CSP-safe) design system matching Wibidi's Front Page & App */

:root {
  color-scheme: light;
  --wb-bg: #f9fafb;
  --wb-surface: #ffffff;
  --wb-surface-alt: #f3f4f6;
  --wb-ink: #111827;
  --wb-body: #374151;
  --wb-muted: #6b7280;
  --wb-line: #e5e7eb;
  --wb-line-strong: #d1d5db;
  --wb-red: #dc2626;
  --wb-red-hover: #b91c1c;
  --wb-red-soft: #fef2f2;
  --wb-red-border: #fecaca;
  --wb-emerald: #059669;
  --wb-emerald-soft: #ecfdf5;
  --wb-emerald-border: #a7f3d0;
  --wb-shadow-sm: 0 1px 3px rgba(17, 24, 39, 0.05), 0 1px 2px rgba(17, 24, 39, 0.04);
  --wb-shadow-md: 0 10px 30px -10px rgba(17, 24, 39, 0.08);
  --wb-radius: 16px;
  --wb-radius-lg: 20px;
  --wb-max: 1024px;
  --wb-measure: 72ch;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--wb-bg);
  color: var(--wb-ink);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--wb-red);
  color: #ffffff;
}

a {
  color: var(--wb-red);
  text-decoration: none;
  text-underline-offset: 4px;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--wb-red);
  outline-offset: 3px;
}

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

.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 100;
  background: var(--wb-ink);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}

.skip-link:focus {
  top: 16px;
}

.wb-container {
  width: min(var(--wb-max), calc(100% - 32px));
  margin-inline: auto;
}

/* Unified 3-Zone Top Bar */
.wb-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--wb-line);
}

.wb-header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.wb-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--wb-ink);
  white-space: nowrap;
  flex-shrink: 0;
}

.wb-brand:hover {
  text-decoration: none;
}

.wb-brand img {
  width: 36px;
  height: 30px;
  object-fit: contain;
  display: block;
}

.wb-brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--wb-red);
}

.wb-nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.wb-nav-links a {
  color: var(--wb-body);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  transition: color 0.15s ease;
}

.wb-nav-links a:hover,
.wb-nav-links a[aria-current="page"] {
  color: var(--wb-red);
  text-decoration: underline;
}

.wb-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.wb-lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  background: var(--wb-surface-alt);
  border: 1px solid var(--wb-line);
  border-radius: 10px;
}

.wb-lang-btn {
  background: transparent;
  border: none;
  color: var(--wb-body);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  min-width: 34px;
  min-height: 32px;
  padding: 0 8px;
  border-radius: 7px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.wb-lang-btn:hover {
  color: var(--wb-ink);
}

.wb-lang-btn.active,
.wb-lang-btn[aria-pressed="true"] {
  background: var(--wb-red);
  color: #ffffff;
}

.wb-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--wb-red);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.wb-btn-primary:hover {
  background: var(--wb-red-hover);
  color: #ffffff;
  text-decoration: none;
}

.wb-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--wb-surface);
  color: var(--wb-ink);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid var(--wb-line-strong);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.wb-btn-secondary:hover {
  border-color: var(--wb-red);
  color: var(--wb-red);
  text-decoration: none;
}

/* Semantic Breadcrumbs Bar */
.wb-breadcrumb-wrap {
  background: var(--wb-surface);
  border-bottom: 1px solid var(--wb-line);
}

.wb-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-block: 10px;
  font-size: 13px;
  color: var(--wb-muted);
}

.wb-breadcrumb a {
  color: var(--wb-body);
  font-weight: 500;
}

.wb-breadcrumb a:hover {
  color: var(--wb-red);
}

.wb-breadcrumb-sep {
  color: var(--wb-line-strong);
  user-select: none;
}

.wb-breadcrumb-current {
  color: var(--wb-ink);
  font-weight: 600;
}

/* Main Editorial Layout */
.wb-main {
  padding-block: 40px 72px;
}

.wb-hero {
  max-width: var(--wb-measure);
  margin-bottom: 36px;
}

.wb-meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--wb-red);
  margin-bottom: 14px;
}

.wb-meta-line .sep {
  color: var(--wb-line-strong);
  font-weight: 400;
}

.wb-meta-line .muted {
  color: var(--wb-muted);
  font-weight: 500;
}

h1 {
  font-size: clamp(2rem, 4vw, 2.85rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--wb-ink);
  margin: 0 0 16px;
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--wb-ink);
  margin: 36px 0 12px;
  text-wrap: balance;
}

h3 {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--wb-ink);
  margin: 0 0 8px;
}

.wb-subtitle {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--wb-muted);
  margin: 0;
  max-width: 64ch;
}

p {
  margin: 0 0 16px;
  color: var(--wb-body);
  max-width: var(--wb-measure);
}

ul, ol {
  margin: 0 0 20px;
  padding-left: 20px;
  color: var(--wb-body);
  max-width: var(--wb-measure);
}

li {
  margin-bottom: 10px;
}

strong {
  color: var(--wb-ink);
  font-weight: 700;
}

/* Clean Single-Elevation Surface Cards */
.wb-card {
  background: var(--wb-surface);
  border: 1px solid var(--wb-line);
  border-radius: var(--wb-radius);
  padding: 28px;
  margin-block: 24px;
  box-shadow: var(--wb-shadow-sm);
}

.wb-card.highlight {
  background: var(--wb-red-soft);
  border-color: var(--wb-red-border);
}

.wb-card.emerald {
  background: var(--wb-emerald-soft);
  border-color: var(--wb-emerald-border);
}

.wb-card h2:first-child,
.wb-card h3:first-child {
  margin-top: 0;
}

.wb-card p:last-child,
.wb-card ul:last-child {
  margin-bottom: 0;
}

/* Grids */
.wb-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-block: 24px;
}

.wb-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-block: 24px;
}

.wb-stat-card {
  background: var(--wb-surface);
  border: 1px solid var(--wb-line);
  border-radius: var(--wb-radius);
  padding: 20px;
  box-shadow: var(--wb-shadow-sm);
}

.wb-stat-label {
  display: block;
  font-size: 13px;
  color: var(--wb-muted);
  margin-bottom: 6px;
}

.wb-stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--wb-ink);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.wb-stat-value.accent {
  color: var(--wb-red);
}

/* Tables with Tabular Numerals */
.wb-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--wb-line);
  border-radius: var(--wb-radius);
  background: var(--wb-surface);
  margin-block: 24px;
  box-shadow: var(--wb-shadow-sm);
}

.wb-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.wb-table th,
.wb-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--wb-line);
}

.wb-table thead th {
  background: var(--wb-surface-alt);
  color: var(--wb-ink);
  font-weight: 700;
  font-size: 13px;
}

.wb-table tbody tr:last-child td {
  border-bottom: none;
}

.wb-table tbody tr.wb-row-highlight {
  background: var(--wb-red-soft);
}

/* Interactive Filter Tabs & Anchor Jump Bar */
.wb-jump-bar,
.wb-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.wb-jump-link,
.wb-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--wb-surface);
  border: 1px solid var(--wb-line);
  border-radius: 10px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--wb-body);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.wb-jump-link:hover,
.wb-filter-btn:hover {
  border-color: var(--wb-red);
  color: var(--wb-red);
  text-decoration: none;
}

.wb-filter-btn.active {
  background: var(--wb-red);
  border-color: var(--wb-red);
  color: #ffffff;
}

/* Persona Story Cards & Blog Hub Cards */
.wb-story-section {
  background: var(--wb-surface);
  border: 1px solid var(--wb-line);
  border-radius: var(--wb-radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: var(--wb-shadow-sm);
}

.wb-story-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.wb-story-meta {
  font-size: 13px;
  font-weight: 600;
  color: var(--wb-red);
}

.wb-story-outcome {
  font-size: 13px;
  font-weight: 700;
  color: var(--wb-emerald);
}

.wb-story-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--wb-line);
  font-size: 13px;
  color: var(--wb-body);
}

.wb-story-facts strong {
  display: block;
  font-size: 12px;
  color: var(--wb-muted);
  margin-bottom: 2px;
}

.wb-article-card {
  background: var(--wb-surface);
  border: 1px solid var(--wb-line);
  border-radius: var(--wb-radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--wb-shadow-sm);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.wb-article-card:hover {
  border-color: var(--wb-red);
  transform: translateY(-2px);
  box-shadow: var(--wb-shadow-md);
  text-decoration: none;
}

.wb-article-card[hidden] {
  display: none;
}

.wb-article-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--wb-red);
  padding-top: 12px;
  border-top: 1px solid var(--wb-line);
}

/* FAQ Accordion */
.wb-faq {
  border-top: 1px solid var(--wb-line);
  margin-top: 20px;
}

.wb-faq details {
  border-bottom: 1px solid var(--wb-line);
  padding-block: 16px;
}

.wb-faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-weight: 700;
  color: var(--wb-ink);
}

.wb-faq summary::-webkit-details-marker {
  display: none;
}

.wb-faq summary::after {
  content: "+";
  color: var(--wb-red);
  font-size: 20px;
  font-weight: 600;
}

.wb-faq details[open] summary::after {
  content: "−";
}

.wb-faq details p {
  margin-top: 10px;
  margin-bottom: 0;
  color: var(--wb-body);
}

/* Bottom Conversion Banner (Consistent Wibidi Light/Red Surface) */
.wb-cta-banner {
  margin-top: 44px;
  background: var(--wb-surface);
  border: 1px solid var(--wb-red-border);
  border-radius: var(--wb-radius-lg);
  padding: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: var(--wb-shadow-sm);
}

.wb-cta-banner h2 {
  margin: 0 0 6px;
  font-size: 1.45rem;
}

.wb-cta-banner p {
  margin: 0;
  color: var(--wb-muted);
}

/* Related Links Row */
.wb-related {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--wb-line);
}

.wb-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

/* Quiet Editorial Footer */
.wb-footer {
  border-top: 1px solid var(--wb-line);
  background: var(--wb-surface);
  padding-block: 28px;
  font-size: 13px;
  color: var(--wb-muted);
}

.wb-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wb-footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.wb-footer-links a {
  color: var(--wb-body);
  font-weight: 500;
}

.wb-footer-links a:hover {
  color: var(--wb-red);
}

/* Language Sections */
.lang-section {
  display: none;
}

.lang-section.active {
  display: block;
}

@media (max-width: 820px) {
  .wb-nav-links {
    display: none;
  }
  .wb-grid-2,
  .wb-grid-3,
  .wb-story-facts,
  .wb-related-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .wb-btn-primary.desktop-only {
    display: none;
  }
  .wb-story-section,
  .wb-card,
  .wb-cta-banner {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
