:root {
  --color-bg: #ffffff;
  --color-surface: #f7f8fb;
  --color-text: #1a1a2e;
  --color-text-muted: #5a5a6e;
  --color-primary: #e63946;
  --color-primary-dark: #c62828;
  --color-accent: #2a9d8f;
  --color-dark: #1a1a2e;
  --color-dark-soft: #252540;
  --color-border: #e5e7eb;
  --font-heading: 'Rubik', system-ui, sans-serif;
  --font-body: 'Nunito Sans', system-ui, sans-serif;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(26, 26, 46, 0.08);
  --shadow-lg: 0 12px 40px rgba(26, 26, 46, 0.14);
  --max-width: 1200px;
  --content-width: 760px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header */
.fb-header {
  background: var(--color-dark);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.fb-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.fb-logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.6rem;
  color: #fff;
  letter-spacing: -0.5px;
}

.fb-logo span {
  color: var(--color-primary);
}

.fb-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.fb-nav a {
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.fb-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
  text-decoration: none;
}

.fb-nav a.active {
  background: var(--color-primary);
  color: #fff;
}

/* Hero */
.fb-hero {
  background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-dark-soft) 100%);
  color: #fff;
  padding: 80px 24px;
  text-align: center;
}

.fb-hero h1 {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 800;
  margin: 0 0 16px;
  line-height: 1.1;
}

.fb-hero p {
  font-size: 1.25rem;
  opacity: 0.85;
  max-width: 640px;
  margin: 0 auto 32px;
}

.fb-hero .fb-cta {
  display: inline-flex;
  gap: 12px;
}

.fb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fb-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.fb-btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.fb-btn-secondary {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
}

/* Layout */
.fb-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px;
}

.fb-section-title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.fb-section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--color-border);
}

/* Grid */
.fb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.fb-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.fb-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.fb-card-image {
  aspect-ratio: 16 / 9;
  background: var(--color-dark-soft);
  overflow: hidden;
}

.fb-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.fb-card:hover .fb-card-image img {
  transform: scale(1.04);
}

.fb-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.fb-card-meta {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.fb-card-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 12px;
  line-height: 1.3;
  color: var(--color-text);
}

.fb-card-title a {
  color: inherit;
}

.fb-card-excerpt {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 16px;
  flex: 1;
}

.fb-card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.fb-card-footer img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

/* Categories */
.fb-categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.fb-category-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.fb-category-card:hover {
  transform: translateY(-4px);
}

.fb-category-card h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin: 0 0 8px;
}

.fb-category-card p {
  color: var(--color-text-muted);
  margin: 0;
  font-size: 0.95rem;
}

/* Article page */
.fb-article {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 48px 24px;
}

.fb-breadcrumbs {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

.fb-breadcrumbs a {
  color: var(--color-text-muted);
}

.fb-breadcrumbs a:hover {
  color: var(--color-primary);
}

.fb-article-header {
  margin-bottom: 32px;
}

.fb-article-title {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 16px;
}

.fb-article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.fb-article-meta img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.fb-article-hero {
  width: 100%;
  border-radius: var(--radius);
  margin: 0 0 32px;
  box-shadow: var(--shadow);
}

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

.fb-article-body h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--color-border);
}

.fb-article-body h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 28px 0 12px;
}

.fb-article-body p {
  margin: 0 0 18px;
}

.fb-article-body ul,
.fb-article-body ol {
  margin: 0 0 20px;
  padding-left: 24px;
}

.fb-article-body li {
  margin-bottom: 8px;
}

.fb-article-body strong {
  color: var(--color-text);
  font-weight: 700;
}

.fb-article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.95rem;
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
}

.fb-article-body th {
  background: var(--color-dark);
  color: #fff;
  text-align: left;
  padding: 14px 16px;
  font-weight: 700;
}

.fb-article-body td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
}

.fb-article-body tr:nth-child(even) {
  background: var(--color-surface);
}

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

.fb-author-box {
  display: flex;
  gap: 18px;
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 24px;
  margin: 40px 0;
  box-shadow: var(--shadow);
}

.fb-author-box img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.fb-author-box h4 {
  font-family: var(--font-heading);
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.fb-author-box p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.fb-article-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

/* Footer */
.fb-footer {
  background: var(--color-dark);
  color: rgba(255,255,255,0.7);
  padding: 48px 24px;
  margin-top: 64px;
}

.fb-footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}

.fb-footer h4 {
  font-family: var(--font-heading);
  color: #fff;
  margin: 0 0 16px;
  font-size: 1.1rem;
}

.fb-footer a {
  color: rgba(255,255,255,0.7);
  display: block;
  margin-bottom: 8px;
}

.fb-footer a:hover {
  color: #fff;
}

.fb-footer-bottom {
  max-width: var(--max-width);
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  .fb-header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 16px;
  }

  .fb-nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-top: 8px;
  }

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

  .fb-hero .fb-cta {
    flex-direction: column;
  }

  .fb-article-title {
    font-size: 1.75rem;
  }

  .fb-author-box {
    flex-direction: column;
    text-align: center;
  }
}

/* Legacy compatibility helpers */
.rv-header { display: none; }
.rv-main { padding: 0 !important; }

/* Utility */
.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;
}
