/*
 * Gaming Blog Website — Main Stylesheet
 *
 * Google Fonts to load in <head>:
 *   <link rel="preconnect" href="https://fonts.googleapis.com">
 *   <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
 *   <link href="https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
 *
 * Font usage:
 *   --font-heading : 'Rajdhani', sans-serif  (gaming/display headings)
 *   --font-body    : 'Inter', sans-serif      (body copy, UI text)
 */

/* ============================================================
   1. CSS RESET / NORMALIZE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 100%; /* 16px base */
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, video, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
}

/* ============================================================
   2. CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ============================================================ */
:root {
  /* --- Color Palette (dark gaming theme) --- */
  --color-bg:           #0d0f14;
  --color-bg-alt:       #13161e;
  --color-bg-card:      #1a1d27;
  --color-bg-nav:       #0a0c10;
  --color-surface:      #22263a;
  --color-border:       #2e3350;

  --color-primary:      #7c3aed;   /* vivid purple */
  --color-primary-hover:#9d5cf5;
  --color-accent:       #06b6d4;   /* cyan accent */
  --color-accent-hover: #22d3ee;

  --color-text:         #e2e8f0;   /* body text — contrast ≥ 4.5:1 on bg */
  --color-text-muted:   #94a3b8;
  --color-text-heading: #f1f5f9;
  --color-text-inverse: #0d0f14;

  --color-success:      #22c55e;
  --color-warning:      #f59e0b;
  --color-error:        #ef4444;

  /* --- Category label colors --- */
  --color-cat-reviews:        #7c3aed;
  --color-cat-top-lists:      #06b6d4;
  --color-cat-tips-tricks:    #22c55e;
  --color-cat-game-mechanics: #f59e0b;
  --color-cat-gaming-news:    #ef4444;

  /* --- Typography --- */
  --font-heading: 'Rajdhani', 'Segoe UI', sans-serif;
  --font-body:    'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono:    'Fira Code', 'Courier New', monospace;

  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg:   1.125rem;   /* 18px */
  --text-xl:   1.25rem;    /* 20px */
  --text-2xl:  1.5rem;     /* 24px */
  --text-3xl:  1.875rem;   /* 30px */
  --text-4xl:  2.25rem;    /* 36px */
  --text-5xl:  3rem;       /* 48px */

  /* --- Spacing scale --- */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* --- Layout --- */
  --container-sm:  640px;
  --container-md:  768px;
  --container-lg:  1024px;
  --container-xl:  1280px;
  --container-2xl: 1536px;
  --container-max: 1920px;

  /* --- Borders & Radius --- */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.4);
  --shadow-md:  0 4px 12px rgba(0,0,0,.5);
  --shadow-lg:  0 8px 24px rgba(0,0,0,.6);
  --shadow-glow: 0 0 20px rgba(124,58,237,.35);

  /* --- Transitions --- */
  --transition-fast:   150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow:   400ms ease;

  /* --- Focus ring --- */
  --focus-ring: 0 0 0 3px rgba(124,58,237,.7);
  --focus-ring-accent: 0 0 0 3px rgba(6,182,212,.7);
}

/* ============================================================
   3. BASE TYPOGRAPHY
   ============================================================ */
body {
  font-family: var(--font-body);
  font-size: var(--text-base); /* 16px minimum */
  color: var(--color-text);
  background-color: var(--color-bg);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-text-heading);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.02em;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--color-text);
  margin-bottom: var(--space-4);
}

a {
  color: var(--color-accent);
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

strong, b { font-weight: 600; }
em, i     { font-style: italic; }

small { font-size: var(--text-sm); }

code, pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
}

code {
  padding: 0.1em 0.4em;
}

pre {
  padding: var(--space-4);
  overflow-x: auto;
  margin-bottom: var(--space-4);
}

blockquote {
  border-left: 4px solid var(--color-primary);
  padding: var(--space-4) var(--space-6);
  margin: var(--space-6) 0;
  background: var(--color-bg-alt);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--color-text-muted);
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}

/* ============================================================
   4. LAYOUT — CONTAINER, GRID, FLEXBOX UTILITIES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 640px)  { .container { padding-inline: var(--space-6); } }
@media (min-width: 1024px) { .container { padding-inline: var(--space-8); } }
@media (min-width: 1280px) { .container { max-width: var(--container-2xl); } }
@media (min-width: 1920px) { .container { max-width: 1800px; } }

/* Flex helpers */
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4        { gap: var(--space-4); }
.gap-6        { gap: var(--space-6); }
.gap-8        { gap: var(--space-8); }

/* Grid helpers */
.grid         { display: grid; }

/* Post card grid — responsive columns */
.posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  width: 100%;
}

@media (min-width: 640px) {
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .posts-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1280px) {
  .posts-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Two-column article layout (content + sidebar) */
.article-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

@media (min-width: 1024px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

/* Single-column layout for About/Contact pages */
.article-layout--single {
  display: block;
  max-width: 800px;
  margin-inline: auto;
}

/* Visually hidden (accessible) */
.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;
}

/* ============================================================
   5. NAVIGATION HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg-nav);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* Logo / site name */
.site-logo {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text-heading);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

.site-logo:hover {
  color: var(--color-primary-hover);
  text-decoration: none;
}

/* Primary nav */
.site-nav {
  display: none;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.site-nav a {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--color-text-heading);
  background: var(--color-surface);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: var(--color-primary);
}

/* Mobile menu toggle */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.nav-toggle:hover {
  background: var(--color-surface);
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: transform var(--transition-normal), opacity var(--transition-normal);
}

/* Mobile nav open state */
.site-header.nav-open .site-nav {
  display: block;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--color-bg-nav);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-4);
  z-index: 99;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}

.site-header.nav-open .site-nav ul {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-1);
}

.site-header.nav-open .site-nav a {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
}

/* Show nav on wider screens */
@media (min-width: 768px) {
  .site-nav {
    display: block;
  }
  .nav-toggle {
    display: none;
  }
}

@media (min-width: 1024px) {
  .site-nav a {
    font-size: var(--text-base);
    padding: var(--space-2) var(--space-4);
  }
}

/* ============================================================
   6. FOOTER
   ============================================================ */
.site-footer {
  background: var(--color-bg-nav);
  border-top: 1px solid var(--color-border);
  padding: var(--space-12) 0 var(--space-8);
  margin-top: var(--space-16);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
}

@media (min-width: 640px) {
  .footer-inner { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .footer-inner { grid-template-columns: 2fr 1fr 1fr; }
}

.footer-brand .site-logo {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
  display: inline-block;
}

.footer-brand p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: 0;
}

.footer-heading {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text-heading);
  margin-bottom: var(--space-4);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.footer-bottom {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.footer-copyright {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.footer-legal {
  display: flex;
  gap: var(--space-4);
}

.footer-legal a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-legal a:hover {
  color: var(--color-accent);
}

/* ============================================================
   7. POST CARDS GRID
   ============================================================ */
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}

/* Card thumbnail */
.post-card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-surface);
}

.post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.post-card:hover .post-card__thumb img {
  transform: scale(1.05);
}

/* Card body */
.post-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: var(--space-5);
  gap: var(--space-3);
}

/* Category label */
.post-card__category,
.category-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
  transition: background var(--transition-fast);
}

.post-card__category:hover,
.category-label:hover {
  background: var(--color-primary-hover);
  text-decoration: none;
}

/* Per-category colors */
.category-label--reviews        { background: var(--color-cat-reviews); }
.category-label--top-lists      { background: var(--color-cat-top-lists); color: var(--color-text-inverse); }
.category-label--tips-tricks    { background: var(--color-cat-tips-tricks); color: var(--color-text-inverse); }
.category-label--game-mechanics { background: var(--color-cat-game-mechanics); color: var(--color-text-inverse); }
.category-label--gaming-news    { background: var(--color-cat-gaming-news); }

/* Card title */
.post-card__title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text-heading);
  line-height: 1.3;
  margin: 0;
}

.post-card__title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.post-card__title a:hover {
  color: var(--color-primary-hover);
  text-decoration: none;
}

/* Card meta (date, author) */
.post-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.post-card__date {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* Card excerpt */
.post-card__excerpt {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0;
  /* Clamp to 3 lines */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Card read-more link */
.post-card__link {
  margin-top: auto;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.post-card__link:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* ============================================================
   8. HERO IMAGE
   ============================================================ */
.hero {
  position: relative;
  width: 100%;
  background: var(--color-surface);
  overflow: hidden;
}

/* Post hero — full-width banner */
.hero--post {
  aspect-ratio: 21 / 9;
  max-height: 560px;
}

/* Homepage hero */
.hero--home {
  aspect-ratio: 16 / 5;
  max-height: 380px;
}

.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Gradient overlay for text legibility */
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 30%,
    rgba(13, 15, 20, 0.85) 100%
  );
}

.hero__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-6) var(--space-4);
}

@media (min-width: 640px) {
  .hero__content { padding: var(--space-8) var(--space-6); }
}

@media (min-width: 768px) {
  .hero__content { padding: var(--space-12) var(--space-10); }
}

.hero__title {
  font-size: var(--text-3xl);
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,.6);
  margin-bottom: var(--space-3);
}

@media (min-width: 768px) {
  .hero__title { font-size: var(--text-5xl); }
}

.hero__subtitle {
  font-size: var(--text-lg);
  color: rgba(255,255,255,.85);
  max-width: 640px;
}

/* Standalone post hero (not inside .hero wrapper) */
.post-hero-img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-8);
  box-shadow: var(--shadow-lg);
}

@media (max-width: 639px) {
  .post-hero-img {
    border-radius: 0;
    margin-left: calc(-1 * var(--space-4));
    margin-right: calc(-1 * var(--space-4));
    width: calc(100% + var(--space-8));
    max-height: 240px;
  }
}

/* ============================================================
   9. ARTICLE / POST BODY
   ============================================================ */
.article-header {
  margin-bottom: var(--space-8);
}

.article-header .category-label {
  margin-bottom: var(--space-4);
}

.article-title {
  font-size: var(--text-4xl);
  color: var(--color-text-heading);
  margin-bottom: var(--space-4);
  line-height: 1.15;
}

@media (min-width: 768px) {
  .article-title { font-size: var(--text-5xl); }
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-border);
}

.article-meta__author {
  font-weight: 600;
  color: var(--color-text);
}

.article-body {
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--color-text);
}

.article-body h2 {
  font-size: var(--text-3xl);
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--color-primary);
}

.article-body h3 {
  font-size: var(--text-2xl);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
  color: var(--color-accent);
}

.article-body h4 {
  font-size: var(--text-xl);
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}

.article-body p {
  margin-bottom: var(--space-5);
}

.article-body ul,
.article-body ol {
  list-style: revert;
  padding-left: var(--space-6);
  margin-bottom: var(--space-5);
}

.article-body li {
  margin-bottom: var(--space-2);
  line-height: 1.7;
}

.article-body a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body a:hover {
  color: var(--color-accent-hover);
}

.article-body img {
  border-radius: var(--radius-md);
  margin: var(--space-6) 0;
  box-shadow: var(--shadow-md);
}

.article-body figure {
  margin: var(--space-8) 0;
}

.article-body figcaption {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  text-align: center;
  margin-top: var(--space-2);
  font-style: italic;
}

/* ============================================================
   10. BREADCRUMB NAVIGATION
   ============================================================ */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
}

.breadcrumb__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.breadcrumb__item:not(:last-child)::after {
  content: '›';
  color: var(--color-border);
  font-size: var(--text-base);
  line-height: 1;
}

.breadcrumb__link {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb__link:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

.breadcrumb__current {
  color: var(--color-text);
  font-weight: 500;
  /* Truncate long titles */
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 640px) {
  .breadcrumb__current { max-width: 480px; }
}

/* ============================================================
   11. RELATED POSTS SECTION
   ============================================================ */
.related-posts {
  margin-top: var(--space-16);
  padding-top: var(--space-10);
  border-top: 2px solid var(--color-border);
}

.related-posts__heading {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.related-posts__heading::before {
  content: '';
  display: block;
  width: 4px;
  height: 1.2em;
  background: var(--color-primary);
  border-radius: 2px;
  flex-shrink: 0;
}

.related-posts__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

@media (min-width: 640px) {
  .related-posts__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .related-posts__grid { grid-template-columns: repeat(3, 1fr); }
}

/* Compact related post card */
.related-card {
  display: flex;
  gap: var(--space-4);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.related-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.related-card__thumb {
  flex-shrink: 0;
  width: 100px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-surface);
}

.related-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.related-card:hover .related-card__thumb img {
  transform: scale(1.08);
}

.related-card__body {
  padding: var(--space-3) var(--space-4) var(--space-3) 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-1);
}

.related-card__title {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text-heading);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-card__title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.related-card__title a:hover {
  color: var(--color-primary-hover);
}

.related-card__date {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ============================================================
   12. IMAGE FALLBACK DIV (.img-fallback)
   ============================================================ */
.img-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 160px;
  background: var(--color-surface);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-style: italic;
  line-height: 1.5;
  /* Ensure it fills the same space as the image it replaces */
  box-sizing: border-box;
}

.img-fallback::before {
  content: '🖼';
  display: block;
  font-size: var(--text-3xl);
  margin-bottom: var(--space-3);
  opacity: 0.5;
  font-style: normal;
}

/* When used inside a card thumbnail */
.post-card__thumb .img-fallback {
  aspect-ratio: 16 / 9;
  min-height: unset;
  border-radius: 0;
  border: none;
  background: var(--color-bg-alt);
}

/* When used as a hero replacement */
.hero .img-fallback,
.hero--post .img-fallback {
  min-height: 320px;
  border-radius: 0;
  border: none;
  font-size: var(--text-base);
}

/* ============================================================
   13. FOCUS INDICATORS (Accessibility — Req 7.3)
   ============================================================ */

/* Remove default outline and replace with custom ring */
:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Links */
a:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
  text-decoration: underline;
}

/* Buttons */
button:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
  box-shadow: var(--focus-ring);
}

/* Nav links */
.site-nav a:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  background: var(--color-surface);
}

/* Nav toggle button */
.nav-toggle:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* Post card links */
.post-card__title a:focus-visible,
.post-card__link:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Breadcrumb links */
.breadcrumb__link:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Footer links */
.footer-links a:focus-visible,
.footer-legal a:focus-visible,
.site-logo:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Category labels (interactive) */
.category-label:focus-visible,
.post-card__category:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* Related card links */
.related-card__title a:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Form inputs (contact page) */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 0;
  border-color: var(--color-primary);
  box-shadow: var(--focus-ring);
}

/* ============================================================
   14. RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Prevent horizontal overflow on all screens */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

* {
  min-width: 0; /* prevents flex/grid children from overflowing */
}

/* --- 320px (smallest mobile) --- */
@media (max-width: 374px) {
  :root {
    --text-4xl: 1.75rem;
    --text-3xl: 1.5rem;
    --text-2xl: 1.25rem;
  }

  .site-header .container {
    padding-inline: var(--space-3);
  }

  .article-title {
    font-size: var(--text-3xl);
  }

  .hero__title {
    font-size: var(--text-2xl);
  }
}

/* --- Mobile general (< 768px) --- */
@media (max-width: 767px) {
  .container {
    padding-inline: var(--space-4);
  }

  .article-title {
    font-size: var(--text-3xl);
  }

  .article-body h2 {
    font-size: var(--text-2xl);
  }

  .article-body h3 {
    font-size: var(--text-xl);
  }

  .main-content {
    padding: var(--space-6) 0 var(--space-10);
  }

  .related-posts {
    margin-top: var(--space-10);
  }

  .related-card {
    flex-direction: column;
  }

  .related-card__thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .footer-legal {
    flex-wrap: wrap;
    gap: var(--space-3);
  }

  .section-heading {
    font-size: var(--text-2xl);
  }

  .breadcrumb {
    font-size: var(--text-xs);
  }

  .breadcrumb__current {
    max-width: 160px;
  }
}

/* --- 768px (tablet) --- */
@media (min-width: 768px) {
  h1 { font-size: var(--text-5xl); }
  h2 { font-size: var(--text-4xl); }
  h3 { font-size: var(--text-3xl); }

  .article-body {
    font-size: var(--text-lg);
  }

  .post-card__excerpt {
    font-size: var(--text-base);
  }

  .related-posts__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .breadcrumb {
    font-size: var(--text-base);
  }
}

/* --- 1024px (desktop) --- */
@media (min-width: 1024px) {
  .site-header .container {
    height: 72px;
  }

  .article-body {
    font-size: var(--text-lg);
    line-height: 1.85;
  }

  .related-posts__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero--post {
    max-height: 640px;
  }
}

/* --- 1280px (large desktop) --- */
@media (min-width: 1280px) {
  .posts-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .hero--home {
    max-height: 720px;
  }
}

/* --- 1920px (ultra-wide) --- */
@media (min-width: 1920px) {
  :root {
    --text-base: 1.125rem; /* 18px on ultra-wide */
  }

  .container {
    max-width: 1800px;
  }

  .posts-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .hero--post {
    max-height: 800px;
  }

  .hero--home {
    max-height: 900px;
  }
}

/* ============================================================
   15. PAGE-SPECIFIC SECTIONS
   ============================================================ */

/* Main content wrapper */
.main-content {
  padding: var(--space-8) 0 var(--space-16);
}

/* Section headings */
.section-heading {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--color-text-heading);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-8);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.section-heading::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, var(--color-primary), transparent);
  border-radius: 1px;
}

/* Category page header */
.category-header {
  padding: var(--space-10) 0 var(--space-8);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-8);
}

.category-header__title {
  font-size: var(--text-4xl);
  margin-bottom: var(--space-3);
}

.category-header__desc {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 640px;
}

/* About / Contact page */
.page-header {
  padding: var(--space-12) 0 var(--space-8);
  text-align: center;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-10);
}

.page-header__title {
  font-size: var(--text-5xl);
  margin-bottom: var(--space-4);
}

.page-header__subtitle {
  font-size: var(--text-xl);
  color: var(--color-text-muted);
  max-width: 560px;
  margin-inline: auto;
}

/* Contact form */
.contact-form {
  max-width: 640px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  transition: border-color var(--transition-fast);
}

.form-input:hover,
.form-textarea:hover {
  border-color: var(--color-text-muted);
}

.form-textarea {
  min-height: 160px;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  cursor: pointer;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  border: 2px solid var(--color-primary);
}

.btn--primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
  text-decoration: none;
  color: #fff;
}

.btn--outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn--outline:hover {
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
}

.btn:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
  box-shadow: var(--focus-ring-accent);
}

/* ============================================================
   16. UTILITY CLASSES
   ============================================================ */
.text-muted    { color: var(--color-text-muted); }
.text-heading  { color: var(--color-text-heading); }
.text-accent   { color: var(--color-accent); }
.text-primary  { color: var(--color-primary); }
.text-center   { text-align: center; }
.text-sm       { font-size: var(--text-sm); }
.text-lg       { font-size: var(--text-lg); }
.font-heading  { font-family: var(--font-heading); }
.uppercase     { text-transform: uppercase; letter-spacing: 0.05em; }
.mt-4          { margin-top: var(--space-4); }
.mt-8          { margin-top: var(--space-8); }
.mb-4          { margin-bottom: var(--space-4); }
.mb-8          { margin-bottom: var(--space-8); }
.py-8          { padding-block: var(--space-8); }
.py-16         { padding-block: var(--space-16); }
