/* ═══════════════════════════════════════════════════════════════════════════
   Country Flag Emoji Polyfill (Windows)
   Windows doesn't render flag emoji natively — this loads Twemoji flags font
   only on Windows (detected via JS adding .win class to body)
   ═══════════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Twemoji Country Flags";
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067,
    U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
  src: url("https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1/dist/TwemojiCountryFlags.woff2") format("woff2");
}

.win .lang-flag {
  font-family: "Twemoji Country Flags", "Nunito Sans", sans-serif;
}

/* ═══════════════════════════════════════════════════════════════════════════
   StudioLingo.ai Blog — Design Tokens
   Mirrors the StudioLingo app visual identity
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Brand colours */
  --background: #fcfaff;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-alt: #f7f1fb;
  --surface-soft: #f2e8fb;
  --border: #e8dcf5;
  --border-strong: #d6bceb;
  --text: #22112e;
  --muted: #725f81;
  --body: #5f4d6e;
  --primary: #820ad1;
  --primary-dark: #4c0677;
  --primary-soft: #efe0fb;
  --highlight: #f6ecff;
  --shadow-sm: 0 18px 40px rgba(91, 27, 125, 0.09);
  --shadow-lg: 0 24px 64px rgba(76, 6, 119, 0.16);
  --code-bg: #f7f1fb;

  /* Spacing */
  --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;

  /* Fluid type */
  --text-xs:   clamp(0.7rem,  1.5vw, 0.75rem);
  --text-sm:   clamp(0.8rem,  1.8vw, 0.875rem);
  --text-base: clamp(0.9rem,  2vw,   1rem);
  --text-md:   clamp(1rem,    2.2vw, 1.125rem);
  --text-lg:   clamp(1.1rem,  2.5vw, 1.25rem);
  --text-xl:   clamp(1.25rem, 3vw,   1.5rem);
  --text-2xl:  clamp(1.5rem,  4vw,   2rem);
  --text-3xl:  clamp(1.75rem, 5vw,   2.5rem);
  --text-hero: clamp(2rem,    6vw,   3.5rem);

  /* Radius */
  --radius-sm: 0.75rem;
  --radius-md: 1.25rem;
  --radius-lg: 2rem;
  --radius-full: 999px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Dark Mode
   ═══════════════════════════════════════════════════════════════════════════ */

[data-theme="dark"] {
  --background: #1a0f24;
  --surface: rgba(40, 25, 55, 0.92);
  --surface-alt: #241535;
  --surface-soft: #2d1a40;
  --border: #3d2655;
  --border-strong: #5a3878;
  --text: #f0e8f6;
  --muted: #b8a5c8;
  --body: #d0c2db;
  --primary: #b65cf0;
  --primary-dark: #820ad1;
  --primary-soft: #2d1a40;
  --highlight: #301e45;
  --shadow-sm: 0 18px 40px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.4);
  --code-bg: #241535;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Reset & Base
   ═══════════════════════════════════════════════════════════════════════════ */

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

html {
  font-family: "Nunito Sans", "Segoe UI", sans-serif;
  font-size: var(--text-base);
  color: var(--body);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(130, 10, 209, 0.08), transparent 28%),
    radial-gradient(circle at top right, rgba(159, 59, 218, 0.1), transparent 22%),
    linear-gradient(180deg, #ffffff 0%, var(--background) 38%, #ffffff 100%);
  transition: background 0.3s ease, color 0.3s ease;
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(130, 10, 209, 0.15), transparent 28%),
    radial-gradient(circle at top right, rgba(159, 59, 218, 0.12), transparent 22%),
    linear-gradient(180deg, var(--background) 0%, #0f0818 38%, var(--background) 100%);
}

body, button, input, textarea, select { font: inherit; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover { color: var(--primary-dark); }
[data-theme="dark"] a:hover { color: #d49bf5; }

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

/* ═══════════════════════════════════════════════════════════════════════════
   Layout
   ═══════════════════════════════════════════════════════════════════════════ */

.section-shell {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 640px)  { .section-shell { padding-inline: var(--space-6); } }
@media (min-width: 1024px) { .section-shell { padding-inline: var(--space-8); } }

.site-main {
  min-height: 60vh;
  padding-block: var(--space-12) var(--space-12);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Header
   ═══════════════════════════════════════════════════════════════════════════ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(252, 250, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease;
}

[data-theme="dark"] .site-header {
  background: rgba(26, 15, 36, 0.88);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding-block: var(--space-4);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.brand-mark:hover { color: var(--text); }

.brand-mark-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-dark);
  box-shadow: 0 2px 10px rgba(76, 6, 119, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-mark-wordmark {
  font-size: var(--text-md);
  font-weight: 900;
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--text);
}

.brand-mark-wordmark span { color: var(--primary); }

.brand-mark-blog-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-left: var(--space-1);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  padding: var(--space-2);
  cursor: pointer;
}

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

.nav-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 700;
  transition: transform 180ms ease, background 180ms ease;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}

.nav-pill:hover {
  transform: translateY(-1px);
  background: var(--surface);
  color: var(--text);
}

.nav-pill-active {
  background: var(--surface);
  border-color: var(--border);
}

.nav-pill-primary {
  background: var(--primary);
  color: white;
  border-color: transparent;
}

.nav-pill-primary:hover {
  background: var(--primary-dark);
  color: white;
  transform: translateY(-1px);
}

/* Theme toggle */
.theme-toggle {
  position: relative;
  padding: var(--space-2);
}

.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* Mobile nav */
@media (max-width: 768px) {
  .mobile-menu-toggle { display: flex; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    padding: var(--space-4);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    gap: var(--space-2);
  }

  .site-nav.open { display: flex; }
  .nav-pill { width: 100%; justify-content: center; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Hero / Page Headers
   ═══════════════════════════════════════════════════════════════════════════ */

.page-hero {
  text-align: center;
  padding-block: var(--space-12) var(--space-8);
}

.page-hero h1 {
  font-size: var(--text-hero);
  font-weight: 900;
  color: var(--text);
  line-height: 1.1;
  margin: 0 0 var(--space-4);
}

.page-hero p {
  font-size: var(--text-lg);
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Post Cards (Grid)
   ═══════════════════════════════════════════════════════════════════════════ */

.post-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

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

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 250ms ease, box-shadow 250ms ease;
  display: flex;
  flex-direction: column;
}

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

.post-card-cover {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-alt);
}

.post-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Placeholder gradient for posts without cover images */
.post-card-cover-placeholder {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, #a53ce2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-card-cover-placeholder svg {
  opacity: 0.3;
}

.post-card-body {
  padding: var(--space-5);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  font-size: var(--text-xs);
  color: var(--muted);
  flex-wrap: wrap;
}

.post-card-category {
  display: inline-block;
  padding: 2px 10px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: var(--text-xs);
  text-decoration: none;
}

.post-card-category:hover {
  background: var(--primary);
  color: white;
}

.post-card-title {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--text);
  margin: 0 0 var(--space-3);
  line-height: 1.3;
}

.post-card-title a {
  color: inherit;
  text-decoration: none;
}

.post-card-title a:hover { color: var(--primary); }

.post-card-excerpt {
  font-size: var(--text-sm);
  color: var(--body);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.post-card-author {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--muted);
  font-weight: 700;
}

.post-card-author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.post-card-author-avatar svg {
  width: 18px;
  height: 18px;
}

.post-card-reading-time {
  font-size: var(--text-xs);
  color: var(--muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Featured Post (first post, large)
   ═══════════════════════════════════════════════════════════════════════════ */

.featured-post {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
  .featured-post { grid-template-columns: 1.2fr 1fr; }
}

.featured-post-cover {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, #a53ce2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.featured-post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-post-body {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: var(--space-3);
}

.featured-post-body h2 {
  font-size: var(--text-2xl);
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
  margin: 0 0 var(--space-4);
}

.featured-post-body h2 a {
  color: inherit;
  text-decoration: none;
}

.featured-post-body h2 a:hover { color: var(--primary); }

.featured-post-body p {
  color: var(--body);
  line-height: 1.7;
  margin: 0 0 var(--space-6);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Single Post
   ═══════════════════════════════════════════════════════════════════════════ */

.post-header {
  text-align: center;
  padding-block: var(--space-8);
  max-width: 800px;
  margin-inline: auto;
}

.post-header h1 {
  font-size: var(--text-3xl);
  font-weight: 900;
  color: var(--text);
  line-height: 1.15;
  margin: 0 0 var(--space-4);
}

.post-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--muted);
  flex-wrap: wrap;
}

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

.post-cover {
  max-width: 900px;
  margin: 0 auto var(--space-8);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.post-cover img {
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
}

/* Article content */
.post-content {
  max-width: 720px;
  margin-inline: auto;
  font-size: var(--text-md);
  line-height: 1.8;
  color: var(--body);
}

.post-content h2 {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text);
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
}

.post-content h3 {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

.post-content p { margin: 0 0 var(--space-6); }

.post-content a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-content blockquote {
  margin: var(--space-6) 0;
  padding: var(--space-4) var(--space-6);
  border-left: 4px solid var(--primary);
  background: var(--surface-alt);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
  font-style: italic;
}

.post-content blockquote p:last-child { margin-bottom: 0; }

.post-content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  overflow-x: auto;
  font-size: var(--text-sm);
  line-height: 1.6;
  margin: var(--space-6) 0;
}

[data-theme="dark"] .post-content pre {
  background: #1a1025;
}

.post-content code {
  font-family: "Fira Code", "Consolas", monospace;
  font-size: 0.9em;
}

.post-content :not(pre) > code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.post-content ul, .post-content ol {
  margin: 0 0 var(--space-6);
  padding-left: var(--space-6);
}

.post-content li { margin-bottom: var(--space-2); }

.post-content img {
  border-radius: var(--radius-md);
  margin: var(--space-6) 0;
}

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

/* Tags on single post */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}

.post-tag {
  display: inline-block;
  padding: var(--space-1) var(--space-4);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  transition: all 0.2s ease;
}

.post-tag:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
}

/* Social share */
.post-share {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}

.post-share-label {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.share-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* CTA Banner */
.cta-banner {
  margin-top: var(--space-12);
  padding: var(--space-8);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: var(--radius-lg);
  text-align: center;
  color: white;
}

.cta-banner h3 {
  font-size: var(--text-2xl);
  font-weight: 900;
  margin: 0 0 var(--space-3);
}

.cta-banner p {
  font-size: var(--text-md);
  opacity: 0.9;
  margin: 0 0 var(--space-6);
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  background: white;
  color: var(--primary);
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: var(--text-md);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  color: var(--primary-dark);
}

/* Related posts */
.related-posts {
  margin-top: var(--space-12);
}

.related-posts h3 {
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--text);
  margin: 0 0 var(--space-6);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Pagination
   ═══════════════════════════════════════════════════════════════════════════ */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-12);
  list-style: none;
  padding: 0;
}

.pagination .page-item {
  display: inline-flex;
}

.pagination .page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s ease;
}

.pagination .page-link:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.pagination .page-item.active .page-link {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination .page-item.disabled .page-link {
  opacity: 0.4;
  pointer-events: none;
  cursor: default;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Taxonomy Pages (Categories / Tags)
   ═══════════════════════════════════════════════════════════════════════════ */

.taxonomy-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
  margin-bottom: var(--space-8);
}

.taxonomy-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s ease;
}

.taxonomy-chip:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.taxonomy-chip-count {
  background: var(--surface-alt);
  padding: 1px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Search
   ═══════════════════════════════════════════════════════════════════════════ */

.search-container {
  max-width: 560px;
  margin: 0 auto var(--space-8);
  position: relative;
}

.search-input {
  width: 100%;
  padding: var(--space-3) var(--space-5) var(--space-3) 48px;
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-md);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(130, 10, 209, 0.12);
}

.search-input::placeholder { color: var(--muted); }

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-results {
  margin-top: var(--space-4);
}

.search-results-empty {
  text-align: center;
  color: var(--muted);
  padding: var(--space-8);
}

/* ═══════════════════════════════════════════════════════════════════════════
   About Page
   ═══════════════════════════════════════════════════════════════════════════ */

.about-content {
  max-width: 720px;
  margin-inline: auto;
  font-size: var(--text-md);
  line-height: 1.8;
  color: var(--body);
}

.about-content h2 {
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text);
  margin-top: var(--space-8);
  margin-bottom: var(--space-4);
}

.about-content p { margin: 0 0 var(--space-6); }

.about-logo {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-8);
}

.about-logo-badge {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--primary-dark);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-logo-badge svg {
  width: 64px;
  height: 64px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Footer
   ═══════════════════════════════════════════════════════════════════════════ */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: var(--space-12);
  background: var(--surface-alt);
}

[data-theme="dark"] .site-footer {
  background: rgba(20, 12, 30, 0.6);
}

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

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

.footer-tagline {
  font-size: var(--text-sm);
  color: var(--muted);
  margin: var(--space-3) 0 0;
}

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

.footer-col h4 {
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--text);
  margin: 0 0 var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.footer-col a {
  font-size: var(--text-sm);
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-col a:hover { color: var(--primary); }

.footer-bottom {
  grid-column: 1 / -1;
  text-align: center;
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--muted);
}

.footer-bottom p { margin: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   Utilities
   ═══════════════════════════════════════════════════════════════════════════ */

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

/* ═══════════════════════════════════════════════════════════════════════════
   Language Switcher
   ═══════════════════════════════════════════════════════════════════════════ */

.lang-switcher {
  position: relative;
}

.lang-switcher-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

.lang-flag {
  font-size: 1.25em;
  line-height: 1;
}

.lang-switcher-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 160px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  z-index: 200;
  padding: var(--space-2);
}

.lang-switcher-dropdown.open {
  display: flex;
  flex-direction: column;
}

.lang-option {
  display: block;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.lang-option:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

@media (max-width: 768px) {
  .lang-switcher-dropdown {
    position: static;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0;
    max-height: none;
  }

  .lang-switcher-dropdown.open {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    gap: var(--space-1);
  }

  .lang-option {
    padding: var(--space-1) var(--space-3);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RTL Support (Arabic)
   ═══════════════════════════════════════════════════════════════════════════ */

[lang="ar"] .post-content,
[lang="ar"] .about-content,
[lang="ar"] .page-hero {
  direction: rtl;
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Utilities
   ═══════════════════════════════════════════════════════════════════════════ */

.text-center { text-align: center; }
.mt-8 { margin-top: var(--space-8); }
.mb-8 { margin-bottom: var(--space-8); }
