/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Primary Colors */
  --primary-blue: #2563eb;
  --primary-blue-dark: #1e40af;
  --primary-blue-light: #3b82f6;
  --primary-blue-lighter: #60a5fa;
  --primary-blue-lightest: #93c5fd;
  --primary-green: #10b981;

  /* Text Colors */
  --text-dark: #111827;
  --text-medium: #374151;
  --text-light: #6b7280;
  --text-white: #ffffff;
  --text-black: #000000;

  /* Background Colors */
  --bg-white: #ffffff;
  --bg-light: #f9fafb;
  --bg-lighter: #f3f4f6;
  --bg-lightest: #fbfcfd;
  --bg-blue-tint: #f0f9ff;
  --bg-blue-lightest: #eff6ff;
  --bg-blue-lighter: #dbeafe;
  --bg-blue-light: #bfdbfe;
  --bg-gray: #f5f5f5;
  --bg-dark-blue: #152a47;
  --bg-nav-dark: #1e3a5f;

  /* Border Colors */
  --border-color: #e5e7eb;
  --border-light: #f3f4f6;
  --border-gray: #e2e8f0;
  --border-input: #d1d5db;

  /* Gradient Colors - Navigation */
  --gradient-nav-start: rgba(37, 99, 235, 0.15);
  --gradient-nav-mid: rgba(59, 130, 246, 0.12);
  --gradient-nav-end: rgba(96, 165, 250, 0.1);
  --gradient-nav-hover-start: rgba(37, 99, 235, 0.15);
  --gradient-nav-hover-end: rgba(59, 130, 246, 0.1);
  --gradient-nav-border: rgba(59, 130, 246, 0.2);
  --gradient-nav-shadow: rgba(37, 99, 235, 0.12);
  --gradient-nav-hover-shadow: rgba(37, 99, 235, 0.2);

  /* Gradient Colors - Body Background */
  --gradient-body-1: #fbfcfd;
  --gradient-body-2: #f0f9ff;
  --gradient-body-3: #ffffff;
  --gradient-body-4: #f8fafc;

  /* Gradient Colors - Cards and Sections */
  --gradient-card-start: #ffffff;
  --gradient-card-end: #f8fafc;
  --gradient-card-blue-start: #ffffff;
  --gradient-card-blue-end: #eff6ff;
  --gradient-card-blue-hover-start: #ffffff;
  --gradient-card-blue-hover-end: #dbeafe;
  --gradient-section-start: rgba(255, 255, 255, 0.9);
  --gradient-section-end: rgba(248, 250, 252, 0.8);
  --gradient-section-border: rgba(226, 232, 240, 0.8);

  /* Gradient Colors - Buttons */
  --gradient-btn-primary-start: var(--primary-blue);
  --gradient-btn-primary-end: var(--primary-blue-light);
  --gradient-btn-primary-hover-start: var(--primary-blue-dark);
  --gradient-btn-primary-hover-end: var(--primary-blue);
  --gradient-btn-secondary-start: #ffffff;
  --gradient-btn-secondary-end: #eff6ff;
  --gradient-btn-secondary-hover-start: #dbeafe;
  --gradient-btn-secondary-hover-end: #bfdbfe;

  /* Gradient Colors - Featured Article */
  --gradient-featured-start: #1e3a5f;
  --gradient-featured-end: var(--primary-blue);
  --gradient-featured-overlay: rgba(255, 255, 255, 0.1);

  /* Gradient Colors - Placeholder Images */
  --gradient-placeholder-1-start: #667eea;
  --gradient-placeholder-1-end: #764ba2;
  --gradient-placeholder-2-start: #f093fb;
  --gradient-placeholder-2-end: #f5576c;
  --gradient-placeholder-3-start: #4facfe;
  --gradient-placeholder-3-end: #00f2fe;
  --gradient-placeholder-4-start: #fa709a;
  --gradient-placeholder-4-end: #fee140;
  --gradient-placeholder-5-start: #30cfd0;
  --gradient-placeholder-5-end: #330867;
  --gradient-placeholder-6-start: #a8edea;
  --gradient-placeholder-6-end: #fed6e3;

  /* Gradient Colors - Category Hover */
  --gradient-category-hover-start: rgba(59, 130, 246, 0.1);
  --gradient-category-hover-end: rgba(147, 197, 253, 0.05);

  /* Gradient Colors - Article Tags */
  --gradient-tag-start: #eff6ff;
  --gradient-tag-end: #dbeafe;
  --gradient-tag-hover-start: #dbeafe;
  --gradient-tag-hover-end: #bfdbfe;
  --gradient-tag-border: rgba(37, 99, 235, 0.2);

  /* Gradient Colors - Table of Contents */
  --gradient-toc-start: #f8fafc;
  --gradient-toc-end: #f1f5f9;
  --gradient-toc-border: #e2e8f0;
  --gradient-toc-link-hover: rgba(59, 131, 246, 0.05);

  /* Accent Colors */
  --accent-green: #256d48;
  --accent-link: rgba(0, 0, 0, 0.3);
  --accent-link-hover: #000000;

  /* Shadow Colors */
  --shadow-color: rgba(0, 0, 0, 0.05);
  --shadow-color-md: rgba(0, 0, 0, 0.1);
  --shadow-color-lg: rgba(0, 0, 0, 0.15);
  --shadow-blue: rgba(37, 99, 235, 0.1);
  --shadow-blue-md: rgba(37, 99, 235, 0.12);
  --shadow-blue-lg: rgba(37, 99, 235, 0.15);
  --shadow-blue-xl: rgba(37, 99, 235, 0.2);
  --shadow-blue-border: rgba(59, 130, 246, 0.2);
  --shadow-blue-border-light: rgba(59, 130, 246, 0.3);

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 var(--shadow-color);
  --shadow-md: 0 4px 6px -1px var(--shadow-color-md),
    0 2px 4px -1px var(--shadow-color);
  --shadow-lg: 0 10px 15px -3px var(--shadow-color-md),
    0 4px 6px -2px var(--shadow-color);
  --shadow-xl: 0 20px 25px -5px var(--shadow-color-md),
    0 10px 10px -5px var(--shadow-color);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: var(--text-dark);
  background: linear-gradient(
    to bottom,
    var(--gradient-body-1) 0%,
    var(--gradient-body-2) 30%,
    var(--gradient-body-3) 70%,
    var(--gradient-body-4) 100%
  );
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  background: transparent;
  padding: 1.25rem 0 0 0;
}

@media (max-width: 480px) {
  .header {
    padding: 0.875rem 0 0 0;
  }
}

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

@media (max-width: 768px) {
  .header-top {
    padding-bottom: 0.75rem;
  }
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-blue);
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}

.logo-img {
  height: 27px;
  width: auto;
  display: block;
}

.logo a {
  display: inline-block;
  text-decoration: none;
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 102;
  position: relative;
}

.mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--text-dark);
  transition: all 0.3s ease;
  border-radius: 2px;
  transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  padding: 0.8rem 1.5rem;
  background: linear-gradient(
    135deg,
    var(--gradient-nav-start) 0%,
    var(--gradient-nav-mid) 50%,
    var(--gradient-nav-end) 100%
  );
  border-radius: 12px;
  margin-top: 1rem;
  margin-bottom: 0;
  border: 1px solid var(--gradient-nav-border);
  box-shadow: 0 2px 12px var(--shadow-blue-md);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.nav-link {
  color: var(--text-medium);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: transparent;
  overflow: hidden;
}

.nav-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    var(--gradient-nav-hover-start) 0%,
    var(--gradient-nav-hover-end) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 8px;
  z-index: 0;
}

.nav-link:hover {
  color: var(--primary-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--gradient-nav-hover-shadow);
}

.nav-link:hover::before {
  opacity: 1;
}

.nav-link.active {
  color: var(--primary-blue);
  font-weight: 600;
  background: linear-gradient(
    135deg,
    var(--gradient-nav-hover-start) 0%,
    var(--gradient-nav-hover-end) 100%
  );
  box-shadow: 0 2px 8px var(--gradient-nav-hover-shadow);
}

.nav-link.active::before {
  opacity: 1;
}

.nav-link.active::after {
  display: none;
}

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

.search-container {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-light);
  pointer-events: none;
}

.search-input {
  padding: 0.625rem 0.75rem 0.625rem 2.5rem;
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.9rem;
  width: 220px;
  transition: all 0.2s ease;
  background-color: var(--bg-light);
}

.search-input:hover {
  border-color: var(--border-light);
  background-color: var(--bg-white);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-blue);
  background-color: var(--bg-white);
  box-shadow: 0 0 0 3px var(--shadow-blue);
}

/* Search Results Dropdown */
.search-results-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  margin-top: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.search-result-item {
  display: block;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--text-dark);
  transition: background-color 0.2s;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background-color: var(--bg-light);
  transform: translateX(4px);
  transition: all 0.2s ease;
}

.search-result-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  color: var(--text-dark);
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow-x: hidden;
}

.search-result-meta {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.search-result-description {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow-x: hidden;
}

.btn-subscribe-header {
  background-color: var(--primary-green);
  color: white;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-subscribe-header:hover {
  background-color: var(--accent-green);
}

/* Main Layout */
.main {
  padding: 2rem 0;
}

@media (max-width: 768px) {
  .main {
    padding: 1.25rem 0;
  }
}

@media (max-width: 480px) {
  .main {
    padding: 1rem 0;
  }
}

.layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
}

@media (max-width: 1024px) {
  .layout {
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .layout {
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  .layout {
    gap: 1.25rem;
  }
}

.main-content {
  min-width: 0;
  background-color: var(--bg-white);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

@media (max-width: 768px) {
  .main-content {
    padding: 1.5rem;
  }
}

/* Featured Article */
.featured-article-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}

.featured-article-link:hover {
  transform: translateY(-2px);
}

.featured-article-link:hover .featured-article {
  box-shadow: 0 8px 24px var(--shadow-color-md);
}

.featured-article {
  background: linear-gradient(
    135deg,
    var(--gradient-card-blue-start) 0%,
    var(--gradient-card-blue-end) 100%
  );
  border-radius: 16px;
  padding: 3rem;
  margin-bottom: 3rem;
  border: 1px solid var(--gradient-nav-border);
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--shadow-blue);
}

@media (max-width: 768px) {
  .featured-article {
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 12px;
  }
}

@media (max-width: 480px) {
  .featured-article {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 10px;
  }
}

.featured-article:hover {
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.15);
  border-color: var(--shadow-blue-border-light);
  background: linear-gradient(
    135deg,
    var(--gradient-card-blue-start) 0%,
    var(--gradient-card-blue-hover-end) 100%
  );
}

.tag-featured {
  position: absolute;
  top: 2rem;
  left: 2rem;
  background: linear-gradient(
    135deg,
    var(--primary-blue) 0%,
    var(--primary-blue-dark) 100%
  );
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-md);
}

.featured-full-width {
  width: 100%;
  margin-bottom: 3rem;
}

@media (max-width: 768px) {
  .featured-full-width {
    margin-bottom: 2rem;
  }
}

@media (max-width: 480px) {
  .featured-full-width {
    margin-bottom: 1.5rem;
  }
}

.featured-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
  margin-top: 2.5rem;
}

.featured-content .featured-image {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

@media (min-width: 1024px) {
  .featured-content {
    grid-template-columns: 1fr 1.2fr;
    gap: 3rem;
  }

  .featured-content .featured-text {
    order: 1;
  }

  .featured-content .featured-image {
    order: 2;
  }
}

.featured-text {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.featured-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-dark);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.featured-description {
  font-size: 1.125rem;
  color: var(--text-medium);
  line-height: 1.75;
  margin-bottom: 1rem;
  font-weight: 400;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.95rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--gradient-placeholder-1-start) 0%,
    var(--gradient-placeholder-1-end) 100%
  );
}

.meta-item {
  color: var(--text-light);
}

.featured-image {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 450px;
  border-radius: 10px;
  overflow: hidden;
  background-color: var(--bg-gray);
  display: flex;
  align-items: center;
  justify-content: center;
}

.featured-image::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(10px);
  transform: scale(1.1);
  opacity: 0.9;
  z-index: 0;
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  border-radius: 10px;
  position: relative;
  z-index: 1;
}

.image-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
}

.featured-img-bg {
  width: 100%;
  height: 450px;
  min-height: 450px;
  background: linear-gradient(
    135deg,
    var(--gradient-featured-start) 0%,
    var(--gradient-featured-end) 100%
  );
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}

.featured-img-bg::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(
      circle at 20% 50%,
      var(--gradient-featured-overlay) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 80%,
      var(--gradient-featured-overlay) 0%,
      transparent 50%
    );
}

.featured-img-bg::after {
  content: "↑";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 80px;
  color: white;
  opacity: 0.3;
  font-weight: 300;
}

/* Section Styles */
.section {
  margin-bottom: 3rem;
  padding: 2rem;
  background: linear-gradient(
    135deg,
    var(--gradient-section-start) 0%,
    var(--gradient-section-end) 100%
  );
  border-radius: 16px;
  border: 1px solid var(--gradient-section-border);
  box-shadow: 0 2px 8px var(--shadow-color);
}

@media (max-width: 768px) {
  .section {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .section {
    padding: 1.25rem;
  }
}

@media (max-width: 768px) {
  .section {
    margin-bottom: 2rem;
  }
}

@media (max-width: 480px) {
  .section {
    margin-bottom: 1.5rem;
  }
}

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

.section-title {
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

#articles-section-title {
  margin-bottom: 1.75rem;
}

.carousel-controls {
  display: flex;
  gap: 0.5rem;
}

.carousel-btn {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--shadow-blue-border-light);
  background: linear-gradient(
    135deg,
    var(--gradient-card-blue-start) 0%,
    var(--gradient-card-blue-end) 100%
  );
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--primary-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.carousel-btn:hover {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
  background: linear-gradient(
    135deg,
    var(--gradient-btn-secondary-hover-start) 0%,
    var(--gradient-btn-secondary-hover-end) 100%
  );
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.carousel-btn:active {
  transform: scale(0.95);
}

/* Article Grid */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 1rem;
}

/* Top Stories Carousel Animation */
#top-stories-container {
  position: relative;
  overflow: hidden;
}

#top-stories-container.animate-slide {
  animation: slideIn 0.4s ease-in-out;
}

@keyframes slideIn {
  from {
    opacity: 0.3;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

#top-stories-container.animate-slide-left {
  animation: slideInLeft 0.3s ease-in-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0.3;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.article-card {
  background: linear-gradient(
    135deg,
    var(--gradient-card-start) 0%,
    var(--gradient-card-end) 100%
  );
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

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

.article-image {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
}

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

.card-img-1 {
  background: linear-gradient(
    135deg,
    var(--gradient-placeholder-1-start) 0%,
    var(--gradient-placeholder-1-end) 100%
  );
}

.card-img-2 {
  background: linear-gradient(
    135deg,
    var(--gradient-placeholder-2-start) 0%,
    var(--gradient-placeholder-2-end) 100%
  );
}

.card-img-3 {
  background: linear-gradient(
    135deg,
    var(--gradient-placeholder-3-start) 0%,
    var(--gradient-placeholder-3-end) 100%
  );
}

.card-img-4 {
  background: linear-gradient(
    135deg,
    var(--gradient-placeholder-4-start) 0%,
    var(--gradient-placeholder-4-end) 100%
  );
}

.card-img-5 {
  background: linear-gradient(
    135deg,
    var(--gradient-placeholder-5-start) 0%,
    var(--gradient-placeholder-5-end) 100%
  );
}

.card-img-6 {
  background: linear-gradient(
    135deg,
    var(--gradient-placeholder-6-start) 0%,
    var(--gradient-placeholder-6-end) 100%
  );
}

.tag {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(4px);
  color: var(--text-white);
}

.article-content {
  padding: 1.5rem;
}

.article-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.article-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-dark);
  line-height: 1.4;
}

.article-description {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.article-meta-small {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-light);
}

/* Pagination Dots */
.pagination-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--border-input);
  cursor: pointer;
  transition: background-color 0.2s;
}

.dot.active {
  background-color: var(--primary-blue);
}

/* Latest Articles */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.article-card-horizontal {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  background: linear-gradient(
    135deg,
    var(--gradient-card-start) 0%,
    var(--gradient-card-end) 100%
  );
  border-radius: 8px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.article-card-horizontal:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--shadow-color-md);
}

.article-card-horizontal .article-image {
  height: 140px;
}

.article-card-horizontal .article-content {
  padding: 1.25rem 1.25rem 1.25rem 0;
}

.load-more-container {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.btn-load-more {
  background: linear-gradient(
    135deg,
    var(--primary-blue) 0%,
    var(--primary-blue-dark) 100%
  );
  color: white;
  border: none;
  padding: 0.875rem 2.5rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
}

.btn-load-more:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(
    135deg,
    var(--gradient-btn-primary-hover-start) 0%,
    var(--gradient-btn-primary-hover-end) 100%
  );
}

.btn-load-more:active {
  transform: translateY(0);
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-card {
  background: linear-gradient(
    135deg,
    var(--gradient-card-blue-start) 0%,
    var(--gradient-card-blue-end) 100%
  );
  border: 1px solid var(--gradient-nav-border);
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: 0 2px 8px var(--shadow-blue);
  transition: all 0.2s ease;
}

@media (max-width: 768px) {
  .sidebar-card {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .sidebar-card {
    padding: 1.25rem;
  }
}

.sidebar-card:hover {
  box-shadow: 0 4px 12px var(--shadow-blue-md);
  background: linear-gradient(135deg, #ffffff 0%, #dbeafe 100%);
  border-color: var(--shadow-blue-border-light);
  transform: translateY(-2px);
}

.sidebar-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text-dark);
  letter-spacing: -0.01em;
}

.sidebar-description {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.email-input {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

.email-input:focus {
  outline: none;
  border-color: var(--primary-blue);
}

.btn-subscribe {
  background-color: var(--primary-blue);
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-subscribe:hover {
  background-color: var(--bg-dark-blue);
}

/* Popular List */
.popular-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.popular-item-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.popular-item {
  display: flex;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0.5rem;
  border-radius: 8px;
  margin: -0.5rem;
}

.popular-item-link:hover .popular-item {
  background-color: var(--bg-light);
  transform: translateX(4px);
}

.popular-image {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.popular-img {
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--gradient-placeholder-1-start) 0%,
    var(--gradient-placeholder-1-end) 100%
  );
}

.popular-content {
  flex: 1;
  min-width: 0;
}

.popular-title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  color: var(--text-dark);
  line-height: 1.4;
}

.popular-meta {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Categories */
.categories-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.category-item {
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  padding: 0.5rem;
  border-radius: 8px;
  margin: -0.5rem;
  justify-content: space-between;
  padding: 0.75rem 0.5rem;
  color: var(--text-dark);
  text-decoration: none;
  transition: all 0.2s ease;
  border-bottom: 1px solid var(--border-light);
}

.category-item:last-child {
  border-bottom: none;
}

.category-item:hover {
  color: var(--primary-blue);
  background: linear-gradient(
    135deg,
    var(--gradient-category-hover-start) 0%,
    var(--gradient-category-hover-end) 100%
  );
  transform: translateX(4px);
}

.category-item svg {
  color: var(--text-light);
  transition: transform 0.2s;
}

.category-item:hover svg {
  transform: translateX(4px);
  color: var(--primary-blue);
}

/* Footer */
.footer {
  background-color: var(--bg-light);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

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

.footer-nav-link {
  color: var(--text-medium);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

.footer-nav-link:hover {
  color: var(--primary-blue);
}

.footer-contact-section {
  display: flex;
  align-items: center;
}

.footer-contact-section-content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .footer-nav {
    width: 100%;
    justify-content: flex-start;
    gap: 1rem;
  }

  .footer-contact-section-content {
    align-items: flex-start;
  }
}

.footer-contact-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.01em;
}

.footer-email-link {
  color: var(--text-medium);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.footer-email-link:hover {
  color: var(--primary-blue);
  text-decoration: underline;
  transform: translateX(2px);
}

.footer-copyright {
  text-align: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-light);
  font-size: 0.9rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-sitemap-link {
  color: var(--text-medium);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.footer-sitemap-link:hover {
  color: var(--primary-blue);
  text-decoration: underline;
}

/* Page Header */
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color);
}

.page-title {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}

.page-description {
  font-size: 1.1rem;
  color: var(--text-light);
  line-height: 1.6;
}

/* About Page */
.about-page {
  max-width: 900px;
  margin: 0 auto;
}

.about-content {
  padding: 2rem 0;
}

.about-section {
  margin-bottom: 3rem;
}

.about-section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

.about-section p {
  font-size: 1.05rem;
  color: var(--text-dark);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.about-card {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 1.75rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

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

.about-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.75rem;
}

.about-card p {
  font-size: 0.95rem;
  color: var(--text-light);
  line-height: 1.6;
  margin: 0;
}

.subscribe-cta {
  margin-top: 1.5rem;
  max-width: 500px;
}

.link {
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
}

.link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.guide-card {
  border-left: 4px solid var(--primary-blue);
}

/* Article Detail */
.article-detail {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem 2.5rem;
}

@media (max-width: 768px) {
  .article-detail {
    padding: 1.5rem;
    border-radius: 10px;
  }
}

@media (max-width: 480px) {
  .article-detail {
    padding: 1.25rem;
    border-radius: 8px;
  }
}

.article-detail-header {
  margin-bottom: 1.5rem;
}

.article-detail-image {
  width: 100%;
  margin-bottom: 2rem;
  border-radius: 8px;
  overflow: hidden;
}

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

.article-detail-category {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.article-detail-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.article-tag {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  background: linear-gradient(
    135deg,
    var(--gradient-tag-start) 0%,
    var(--gradient-tag-end) 100%
  );
  color: var(--primary-blue);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  border: 1px solid var(--gradient-tag-border);
}

.article-tag:hover {
  background: linear-gradient(
    135deg,
    var(--gradient-btn-secondary-hover-start) 0%,
    var(--gradient-btn-secondary-hover-end) 100%
  );
  color: var(--primary-blue-dark);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.article-detail-meta {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 0;
}

.article-detail-body {
  font-size: 1.0625rem;
  color: var(--text-dark);
  line-height: 1.85;
  font-weight: 400;
}

/* Table of Contents */
.article-toc {
  background: linear-gradient(
    135deg,
    var(--gradient-toc-start) 0%,
    var(--gradient-toc-end) 100%
  );
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  box-shadow: 0 2px 8px var(--shadow-color);
}

.toc-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 1rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--gradient-toc-border);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin-bottom: 0.625rem;
}

.toc-list li:last-child {
  margin-bottom: 0;
}

.toc-link {
  display: inline-block;
  color: var(--primary-blue);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.375rem 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  position: relative;
  padding-left: 1.25rem;
}

.toc-link::before {
  content: "•";
  position: absolute;
  left: 0.25rem;
  color: var(--primary-blue);
  font-weight: bold;
}

.toc-link:hover {
  background-color: var(--gradient-toc-link-hover);
  color: var(--primary-blue-dark);
  transform: translateX(2px);
  text-decoration: underline;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

.article-detail-body p {
  margin-bottom: 1.5rem;
}

.article-detail-body h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  color: var(--text-dark);
  letter-spacing: -0.01em;
  line-height: 1.3;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-light);
  scroll-margin-top: 100px; /* Offset for fixed header when scrolling */
}

.article-detail-body h3 {
  font-size: 1.375rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
  letter-spacing: -0.01em;
  line-height: 1.4;
  padding-bottom: 0.375rem;
  border-bottom: 1px solid var(--border-light);
  scroll-margin-top: 100px; /* Offset for fixed header when scrolling */
}

.article-detail-body p {
  margin-bottom: 1rem;
}

.article-detail-body .article-content-link {
  color: var(--primary-blue);
  text-decoration: underline;
  text-decoration-color: var(--primary-blue);
  font-weight: 500;
  padding: 0.125rem 0.25rem;
  margin: 0 -0.25rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.article-detail-body .article-content-link:hover {
  background-color: var(--bg-blue-lightest);
  color: var(--primary-blue-dark);
  text-decoration-color: var(--primary-blue-dark);
}

.article-content-image {
  margin: 2rem 0;
  text-align: center;
}

.article-content-image img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px var(--shadow-color-md);
  display: block;
  margin: 0 auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-content-image-link {
  display: inline-block;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.article-content-image-link:hover {
  transform: scale(1.002);
}

.article-content-image-link:hover img {
  box-shadow: 0 6px 20px var(--shadow-color-lg);
  transform: scale(1.001);
}

@media (max-width: 768px) {
  .article-content-image {
    margin: 1.5rem 0;
  }

  .article-content-image img {
    border-radius: 8px;
  }
}

/* Lists styling */
.article-detail-body ul,
.article-detail-body ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
  color: var(--text-dark);
}

.article-detail-body ul {
  list-style-type: disc;
}

.article-detail-body ol {
  list-style-type: decimal;
}

.article-detail-body li {
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.article-detail-body li p {
  margin-bottom: 0.5rem;
}

.article-detail-body ul ul,
.article-detail-body ol ol,
.article-detail-body ul ol,
.article-detail-body ol ul {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Bold and italic styling */
.article-detail-body strong {
  font-weight: 700;
  color: var(--text-dark);
}

.article-detail-body em {
  font-style: italic;
  color: var(--text-dark);
}

.article-detail-body strong em,
.article-detail-body em strong {
  font-weight: 700;
  font-style: italic;
}

/* Tables styling */
.article-content-table-wrapper {
  margin: 2rem 0;
  overflow-x: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px var(--shadow-color-md);
}

.article-content-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-light);
  font-size: 0.95rem;
}

.article-content-table thead {
  background: linear-gradient(
    135deg,
    var(--gradient-card-blue-start) 0%,
    var(--gradient-card-blue-end) 100%
  );
}

.article-content-table th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-dark);
  border-bottom: 2px solid var(--border-color);
  font-size: 0.95rem;
}

.article-content-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-dark);
}

.article-content-table tbody tr:hover {
  background-color: var(--bg-blue-lightest);
}

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

@media (max-width: 768px) {
  .article-content-table-wrapper {
    margin: 1.5rem 0;
    border-radius: 6px;
  }

  .article-content-table {
    font-size: 0.875rem;
  }

  .article-content-table th,
  .article-content-table td {
    padding: 0.75rem 0.5rem;
  }
}

.article-source {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* FAQ Section */
.faq-section {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 2px solid var(--border-light);
}

.faq-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: #f7f7f7;
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.1s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.faq-item:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-question:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

.faq-question-text {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-medium);
  flex: 1;
  padding-right: 1rem;
}

.faq-icon {
  font-size: 0.875rem;
  color: var(--text-medium);
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: 0.1s ease;
  padding: 0 1.5rem;
  opacity: 0;
}

.faq-item.active .faq-answer {
  max-height: 2000px;
  padding: 0 1.5rem 1.25rem 1.5rem;
  opacity: 1;
}

.faq-answer p {
  color: var(--text-medium);
  line-height: 1.7;
  margin: 0 0 0.75rem 0;
  padding-top: 0.5rem;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

/* Formatting support in FAQ answers */
.faq-answer strong {
  font-weight: 700;
  color: var(--text-dark);
}

.faq-answer em {
  font-style: italic;
  color: var(--text-medium);
}

.faq-answer ul,
.faq-answer ol {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
  color: var(--text-medium);
}

.faq-answer ul {
  list-style-type: disc;
}

.faq-answer ol {
  list-style-type: decimal;
}

.faq-answer li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.faq-answer .article-content-link {
  color: var(--primary-blue);
  text-decoration: underline;
  font-weight: 500;
}

.faq-answer .article-content-link:hover {
  color: var(--primary-blue-dark);
}

.faq-answer .article-content-table-wrapper {
  margin: 0.75rem 0;
  overflow-x: auto;
}

.faq-answer .article-content-table {
  font-size: 0.875rem;
}

.faq-answer .article-content-table th,
.faq-answer .article-content-table td {
  padding: 0.5rem 0.75rem;
}

@media (max-width: 768px) {
  .faq-title {
    font-size: 1.75rem;
  }

  .faq-question {
    padding: 1rem 1.25rem;
  }

  .faq-question-text {
    font-size: 1rem;
  }

  .faq-answer {
    padding: 0 1.25rem;
  }

  .faq-item.active .faq-answer {
    padding: 0 1.25rem 1rem 1.25rem;
  }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    order: -1;
  }

  /* On article pages, show sidebar after article content */
  body:has(.article-detail) .main-content {
    order: 0;
  }

  body:has(.article-detail) .sidebar {
    order: 1;
  }

  .featured-content {
    gap: 2rem;
  }

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

@media (max-width: 768px) {
  /* Show sidebar after articles on tag pages in mobile */
  body.tag-page .main-content {
    order: 0;
  }

  body.tag-page .sidebar {
    order: 1;
  }

  /* On article pages, show sidebar after article content */
  body:has(.article-detail) .main-content {
    order: 0;
  }

  body:has(.article-detail) .sidebar {
    order: 1;
  }

  .mobile-menu-toggle {
    display: flex;
    position: relative;
    margin-left: auto;
  }

  .header-top {
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
  }

  .header .container {
    position: relative;
  }

  .logo {
    flex: 0 0 auto;
    width: auto;
  }

  .header-actions {
    flex: 1 1 auto;
    min-width: 0;
  }

  .nav {
    display: flex;
    flex-direction: column;
    position: relative;
    background: linear-gradient(
      135deg,
      var(--shadow-blue) 0%,
      var(--shadow-blue-md) 100%
    );
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gradient-nav-border);
    box-shadow: 0 4px 12px var(--shadow-blue-lg);
    align-items: stretch;
    padding: 0;
    gap: 0;
    margin-top: 0;
    border-radius: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
    z-index: 1000;
    width: 100%;
  }

  .nav.active {
    max-height: 500px;
    opacity: 1;
    padding: 1rem 1.5rem;
  }

  .nav-link {
    display: block;
    width: 100%;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--shadow-blue-border);
    font-size: 1rem;
    border-radius: 0;
    margin-bottom: 0;
    text-align: left;
  }

  .nav-link:last-child {
    border-bottom: none;
  }

  .nav-link:hover {
    transform: none;
    box-shadow: none;
  }

  .nav-link::before {
    display: none;
  }

  .header-actions {
    width: 100%;
    order: 2;
    margin-left: 0;
  }

  .search-input {
    width: 100%;
    font-size: 16px; /* Prevents zoom on iOS */
    margin-top: 0.5rem;
  }

  .search-results-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    max-height: 60vh;
    border-radius: 8px;
    z-index: 999;
  }

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

  .article-card-horizontal {
    grid-template-columns: 1fr;
  }

  .article-card-horizontal .article-image {
    height: 200px;
  }

  .featured-title {
    font-size: 2rem;
  }

  .featured-description {
    font-size: 1.05rem;
  }

  .featured-image,
  .featured-img-bg {
    min-height: 300px;
    height: 300px;
  }
}

@media (max-width: 480px) {
  /* Show sidebar after articles on tag pages in mobile */
  body.tag-page .main-content {
    order: 0;
  }

  body.tag-page .sidebar {
    order: 1;
  }

  /* On article pages, show sidebar after article content */
  body:has(.article-detail) .main-content {
    order: 0;
  }

  body:has(.article-detail) .sidebar {
    order: 1;
  }

  .container {
    padding: 0 12px;
  }

  .header-top {
    flex-wrap: wrap;
    gap: 0.75rem;
    position: relative;
  }

  .logo {
    order: 1;
    width: calc(100% - 50px);
  }

  .mobile-menu-toggle {
    order: 2;
    position: relative;
    margin-left: auto;
    padding: 6px;
  }

  .header-actions {
    gap: 0.5rem;
    order: 3;
    width: 100%;
    justify-content: flex-end;
  }

  .search-container {
    position: relative;
    width: 100%;
    max-width: 100%;
  }

  .search-input {
    width: 100%;
    font-size: 16px; /* Prevents zoom on iOS */
    margin-top: 0.5rem;
  }

  .search-results-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    max-height: 60vh;
    border-radius: 8px;
    z-index: 999;
  }

  .mobile-menu-toggle span {
    width: 22px;
  }

  .featured-article {
    padding: 1.5rem;
  }

  .featured-title {
    font-size: 1.75rem;
  }

  .featured-description {
    font-size: 1rem;
  }

  .featured-image,
  .featured-img-bg {
    min-height: 250px;
    height: 250px;
  }

  .featured-article {
    padding: 1.75rem;
  }

  .page-title {
    font-size: 2rem;
  }

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