/* Signal Pilot Blog - Theme Styles */
/* Matches signalpilot.io design system */

:root {
  /* Dark Theme (Default) */
  --bg: #05070d;
  --bg-soft: #0c101b;
  --bg-elevated: #151c2d;
  --text: #ecf1ff;
  --text-muted: #b5c0d8;
  --text-muted-2: #7784a1;
  --brand: #5b8aff;
  --brand-2: #7b9bff;
  --accent: #76ddff;
  --success: #3ed598;
  --warning: #f9a23c;
  --border: rgba(102, 128, 214, 0.22);
  --shadow: 0 18px 60px rgba(12,16,27,.35);
  --radius: 16px;
  --grad: linear-gradient(90deg, #9cc0ff 0%, #86a8ff 35%, #7ccaff 60%, #8ca5ff 85%, #b9d4ff 100%);
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-elevated: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --text-muted-2: #334155;
  --brand: #3b82f6;
  --brand-2: #2563eb;
  --accent: #0ea5e9;
  --success: #10b981;
  --warning: #f97316;
  --border: rgba(30,41,59,.2);
  --shadow: 0 18px 60px rgba(0,0,0,.08);
  --grad: linear-gradient(90deg, #1e40af 0%, #3b82f6 35%, #0ea5e9 60%, #2563eb 85%, #1e3a8a 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

/* Background Effects */
.bg-aurora {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.bg-aurora::before,
.bg-aurora::after {
  content: '';
  position: absolute;
  width: 150%;
  height: 150%;
  border-radius: 50%;
  mix-blend-mode: screen;
  opacity: 0.15;
  animation: aurora 20s ease-in-out infinite alternate;
}

.bg-aurora::before {
  background: radial-gradient(ellipse at 30% 20%, var(--brand) 0%, transparent 50%);
  top: -50%;
  left: -25%;
}

.bg-aurora::after {
  background: radial-gradient(ellipse at 70% 80%, var(--accent) 0%, transparent 50%);
  bottom: -50%;
  right: -25%;
  animation-delay: -10s;
}

@keyframes aurora {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(5%, 5%) rotate(10deg); }
}

/* Container */
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 24px);
}

.container-narrow {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 24px);
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(5, 7, 13, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

[data-theme="light"] .header {
  background: rgba(255, 255, 255, 0.85);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.logo img {
  height: 26px;
  width: 26px;
}

.logo-text {
  font-family: 'Gugi', system-ui, -apple-system, sans-serif;
  font-size: 1.4rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #fff;
}

[data-theme="light"] .logo-text {
  color: #0f172a;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav a:hover,
.nav a.active {
  color: var(--text);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Google Translate Widget */
.translate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  position: relative;
}

.translate-btn:hover {
  background: var(--bg-soft);
  border-color: var(--brand);
  color: var(--text);
}

.translate-wrapper {
  position: relative;
}

.translate-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem;
  z-index: 1000;
  display: none;
  min-width: 150px;
  box-shadow: var(--shadow);
}

.translate-wrapper.open .translate-dropdown {
  display: block;
}

/* Custom Language Selector */
.lang-dropdown {
  position: relative;
  z-index: 100;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  color: var(--text);
  font-size: 0.85rem;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-toggle:hover {
  border-color: var(--brand);
  background: var(--bg-elevated);
}

.lang-toggle .flag {
  font-size: 1.1rem;
  line-height: 1;
}

.lang-toggle .chevron {
  width: 12px;
  height: 12px;
  transition: transform 0.2s;
}

.lang-dropdown.active .lang-toggle .chevron {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.lang-dropdown.active .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-menu button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.lang-menu button:hover {
  background: rgba(91, 138, 255, 0.1);
  color: var(--text);
}

.lang-menu button .flag {
  font-size: 1.2rem;
}

/* Hide Google Translate UI but keep select accessible for JS */
#google_translate_element {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.goog-te-banner-frame,
.goog-te-gadget-icon,
#goog-gt-tt,
.goog-te-balloon-frame,
.goog-te-menu-frame {
  display: none !important;
}

body {
  top: 0 !important;
}

.skiptranslate:not(#google_translate_element) {
  display: none !important;
}

iframe.goog-te-banner-frame {
  display: none !important;
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.theme-toggle:hover {
  color: var(--text);
}

/* Sun/Moon icons - sun visible in dark mode, moon visible in light mode */
.icon-sun {
  display: block;
}

.icon-moon {
  display: none;
}

[data-theme="light"] .icon-sun {
  display: none;
}

[data-theme="light"] .icon-moon {
  display: block;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.btn-primary {
  background: linear-gradient(115deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 4px 20px rgba(91, 138, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(91, 138, 255, 0.4);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

/* Hero Section */
.hero {
  padding: clamp(3rem, 8vw, 5rem) 0;
  text-align: center;
}

.hero-title {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 1rem;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* Article Grid */
.articles-section {
  padding: clamp(2rem, 5vw, 4rem) 0;
}

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

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
}

/* Search */
.search-container {
  width: 100%;
  margin-bottom: 1rem;
}

.search-box {
  position: relative;
  max-width: 400px;
}

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

.search-input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 2.75rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

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

.search-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(91, 138, 255, 0.15);
}

.search-clear {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted-2);
  cursor: pointer;
  padding: 0.25rem;
  display: none;
  transition: color 0.2s;
}

.search-clear:hover {
  color: var(--text);
}

.search-input:not(:placeholder-shown) + .search-clear {
  display: block;
}

.search-results {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  min-height: 1.25rem;
}

.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.no-results svg {
  margin-bottom: 1rem;
  opacity: 0.5;
}

.category-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .category-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 0.5rem;
    margin: 0 -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .category-filters::-webkit-scrollbar {
    display: none;
  }
  .filter-btn {
    flex-shrink: 0;
  }
}

.filter-btn {
  padding: 0.5rem 1rem;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

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

/* Load More */
.load-more-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 2.5rem;
  gap: 0.75rem;
}

.load-more-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.load-more-btn svg {
  transition: transform 0.2s;
}

.load-more-btn:hover svg {
  transform: translateY(2px);
}

.load-more-btn.hidden {
  display: none;
}

.articles-count {
  font-size: 0.85rem;
  color: var(--text-muted-2);
}

/* Article Card */
.article-card {
  background: rgba(10, 14, 24, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

[data-theme="light"] .article-card {
  background: rgba(255, 255, 255, 0.8);
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--brand);
}

/* Mobile tap feedback */
.article-card:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

@media (hover: none) {
  .article-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border);
  }
  .article-card:active {
    transform: scale(0.98);
    border-color: var(--brand);
    box-shadow: var(--shadow);
  }
}

.article-card-image {
  aspect-ratio: 16/9;
  background: var(--bg-soft);
  position: relative;
  overflow: hidden;
}

.article-card-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-image: inherit;
  transition: transform 0.4s ease;
}

.article-card:hover .article-card-image::before {
  transform: scale(1.08);
}

/* Category Placeholder Images */
.article-card[data-category="indicators"] .article-card-image::before {
  background-image: url('/assets/images/categories/indicators.png');
}

.article-card[data-category="psychology"] .article-card-image::before {
  background-image: url('/assets/images/categories/psychology.png');
}

.article-card[data-category="cycles"] .article-card-image::before {
  background-image: url('/assets/images/categories/cycles.png');
}

.article-card[data-category="practical"] .article-card-image::before {
  background-image: url('/assets/images/categories/practical.png');
}

.article-card[data-category="risk"] .article-card-image::before {
  background-image: url('/assets/images/categories/risk.png');
}

.article-card[data-category="systems"] .article-card-image::before {
  background-image: url('/assets/images/categories/systems.png');
}

.article-card[data-category="beginner"] .article-card-image::before {
  background-image: url('/assets/images/categories/beginner.png');
}

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

.article-card-category {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.35rem 0.75rem;
  background: rgba(5, 7, 13, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
}

.article-card-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.article-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

.article-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted-2);
}

.article-card-meta span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Article Page */
.article-hero {
  width: 100%;
  max-height: 400px;
  overflow: hidden;
  position: relative;
}

.article-hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
}

.hero-image {
  width: 100%;
  max-width: 900px;
  margin: 0 auto 2rem;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-soft) 0%, var(--bg-elevated) 50%, var(--bg-soft) 100%);
  position: relative;
}

.hero-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(91, 138, 255, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 60%, rgba(118, 221, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Hide broken images but keep the placeholder background */
.hero-image img[src="hero.png"] {
  opacity: 0;
}

/* Show AI prompt as visible text for image generation */
.hero-image .ai-prompt {
  position: absolute;
  inset: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: calc(var(--radius) - 0.5rem);
  background: rgba(5, 7, 13, 0.6);
  margin: 0;
  overflow: auto;
}

/* Hide prompt when real image exists */
.hero-image img:not([src="hero.png"]) ~ .ai-prompt {
  display: none;
}

.article-header {
  padding: clamp(2rem, 6vw, 3rem) 0 2rem;
  text-align: center;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

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

.breadcrumb-sep {
  color: var(--text-muted-2);
}

.breadcrumb-current {
  color: var(--text-muted-2);
}

.article-category {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: rgba(91, 138, 255, 0.15);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--brand);
  margin-bottom: 1.5rem;
}

.article-title {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 1.5rem;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.article-meta span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Share Buttons */
.share-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.share-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}

.share-btn:hover {
  background: var(--brand);
  color: #fff;
  transform: scale(1.1);
}

.share-btn.copied {
  background: var(--success);
  color: #fff;
}

/* Article Content */
.article-content {
  padding: 2rem 0 4rem;
}

.article-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  color: var(--text);
}

.article-content h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  color: var(--text);
}

.article-content p {
  margin-bottom: 1.25rem;
  color: var(--text-muted);
}

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

.article-content em {
  color: var(--accent);
  font-style: italic;
}

.article-content ul,
.article-content ol {
  margin: 1.25rem 0;
  padding-left: 1.5rem;
  color: var(--text-muted);
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-content blockquote {
  margin: 2rem 0;
  padding: 1.5rem 2rem;
  background: var(--bg-soft);
  border-left: 4px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-muted);
}

.article-content hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 3rem 0;
}

.article-content a {
  color: var(--brand);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.article-content a:hover {
  border-bottom-color: var(--brand);
}

/* CTA Box */
.cta-box {
  margin: 3rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(91, 138, 255, 0.1) 0%, rgba(118, 221, 255, 0.1) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.cta-box p {
  color: var(--text);
  margin-bottom: 1.25rem;
}

.cta-box .btn-primary {
  color: #fff !important;
  background: var(--brand);
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Footer */
.footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

.footer-social {
  display: flex;
  gap: 1rem;
}

.footer-social a {
  color: var(--text-muted);
  transition: color 0.2s;
}

.footer-social a:hover {
  color: var(--brand);
}

.footer-copy {
  color: var(--text-muted-2);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
  .nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    opacity: 0;
    visibility: hidden;
    display: flex;
    transition: all 0.3s ease;
    z-index: 150;
  }

  .nav.open {
    opacity: 1;
    visibility: visible;
  }

  .nav a {
    font-size: 1.5rem;
  }

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

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .article-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Mobile Menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 0.5rem;
  z-index: 200;
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  .header-controls .btn-primary {
    display: none;
  }
}

/* Reading Progress */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  z-index: 1000;
  transition: width 0.1s;
}

/* Back to Top */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: var(--brand);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(91, 138, 255, 0.4);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-4px);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Related Articles */
.related-articles {
  margin: 3rem 0;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.related-articles h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text);
}

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

.related-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.related-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}

.related-category {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.related-card h4 {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  margin: 0;
}

@media (max-width: 768px) {
  .related-grid {
    grid-template-columns: 1fr;
  }
}

/* Article Navigation (Prev/Next) */
.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 2rem 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.article-nav-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}

.article-nav-link:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  background: var(--bg-elevated);
}

.article-nav-link.prev {
  text-align: left;
}

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

.article-nav-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted-2);
}

.article-nav-link.next .article-nav-label {
  justify-content: flex-end;
}

.article-nav-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.article-nav-link.placeholder {
  visibility: hidden;
}

@media (max-width: 640px) {
  .article-nav {
    flex-direction: column;
  }

  .article-nav-link.prev,
  .article-nav-link.next {
    text-align: left;
  }

  .article-nav-link.next .article-nav-label {
    justify-content: flex-start;
  }

  .article-nav-link.placeholder {
    display: none;
  }
}
