/* ============================================================
   Featured Articles Card-Based Layout - Public Index Page
   TWO-COLUMN horizontal card layout (image left, content right)
   Fully theme-responsive (light/dark mode)
   Mobile-responsive (2-col → 1-col)
   ============================================================ */

/* ══════════════════════════════════════════════════════════
   FALLBACK STYLES (no data-bs-theme attribute present)
   Applied on cold first load before config.js writes a theme
   to localStorage. Uses light-mode values so the page is
   always readable regardless of theme-toggle state.
   ══════════════════════════════════════════════════════════ */

.featured-section-header {
  border-bottom: 1px solid #e2e8f0;
}

.featured-section-subtitle {
  color: #f59e0b;
}

.featured-section-title {
  color: #0f172a;
}

.featured-view-all-link {
  color: #f59e0b;
}

.featured-article-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.featured-badge {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #d97706;
}

.featured-article-categories {
  color: #f59e0b;
}

.featured-article-title {
  color: #0f172a;
}

.featured-article-description {
  color: #475569;
}

.featured-article-meta {
  color: #64748b;
}

.featured-read-more {
  color: #f59e0b;
}

/* ══════════════════════════════════════════════════════════
   DARK MODE STYLES
   ══════════════════════════════════════════════════════════ */

[data-bs-theme="dark"] .featured-section-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

[data-bs-theme="dark"] .featured-section-subtitle {
  color: #ffc107;
}

[data-bs-theme="dark"] .featured-section-title {
  color: #f8fbff;
}

[data-bs-theme="dark"] .featured-view-all-link {
  color: #ffc107;
}

[data-bs-theme="dark"] .featured-view-all-link:hover {
  color: #ffda6a;
}

[data-bs-theme="dark"] .featured-article-card {
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

[data-bs-theme="dark"] .featured-article-card:hover {
  border-color: rgba(96, 165, 250, 0.35);
}

[data-bs-theme="dark"] .featured-badge {
  background: rgba(255, 193, 7, 0.2);
  border: 1px solid rgba(255, 193, 7, 0.5);
  color: #ffc107;
}

[data-bs-theme="dark"] .featured-article-categories {
  color: #ffc107;
}

[data-bs-theme="dark"] .featured-article-title {
  color: #ffffff;
}

[data-bs-theme="dark"] .featured-article-description {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .featured-article-meta {
  color: #94a3b8;
}

[data-bs-theme="dark"] .featured-read-more {
  color: #ffc107;
}

[data-bs-theme="dark"] .featured-read-more:hover {
  color: #ffda6a;
}

/* ══════════════════════════════════════════════════════════
   LIGHT MODE STYLES
   ══════════════════════════════════════════════════════════ */

[data-bs-theme="light"] .featured-section-header {
  border-bottom: 1px solid #e2e8f0;
}

[data-bs-theme="light"] .featured-section-subtitle {
  color: #f59e0b;
}

[data-bs-theme="light"] .featured-section-title {
  color: #0f172a;
}

[data-bs-theme="light"] .featured-view-all-link {
  color: #f59e0b;
}

[data-bs-theme="light"] .featured-view-all-link:hover {
  color: #d97706;
}

[data-bs-theme="light"] .featured-article-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="light"] .featured-article-card:hover {
  border-color: #3b82f6;
}

[data-bs-theme="light"] .featured-badge {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #d97706;
}

[data-bs-theme="light"] .featured-article-categories {
  color: #f59e0b;
}

[data-bs-theme="light"] .featured-article-title {
  color: #0f172a;
}

[data-bs-theme="light"] .featured-article-description {
  color: #475569;
}

[data-bs-theme="light"] .featured-article-meta {
  color: #64748b;
}

[data-bs-theme="light"] .featured-read-more {
  color: #f59e0b;
}

[data-bs-theme="light"] .featured-read-more:hover {
  color: #d97706;
}

/* ══════════════════════════════════════════════════════════
   THEME-AGNOSTIC LAYOUT STYLES
   ══════════════════════════════════════════════════════════ */

/* ── Section Header ────────────────────────────────────────────────── */
.featured-section-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
}

.featured-section-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.featured-section-subtitle {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin: 0;
  text-transform: uppercase;
}

.featured-section-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.featured-view-all-link {
  align-items: center;
  display: inline-flex;
  font-size: 0.875rem;
  font-weight: 600;
  gap: 0.5rem;
  text-decoration: none;
  transition: all 180ms ease;
}

.featured-view-all-link:hover {
  transform: translateX(4px);
}

/* ── Card Grid ───────────────────────────────────────────────────────── */
.featured-articles-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 2rem;
}

/* ── Individual Card (Horizontal Layout: Image Left, Content Right) ─────────── */
.featured-article-card {
  border-radius: 12px;
  display: flex;
  flex-direction: row;
  min-height: 280px;
  overflow: hidden;
  position: relative;
  transition: all 280ms ease;
}

.featured-article-card:hover {
  transform: translateY(-3px);
}

/* ── Image Container (LEFT side, ~45% width) ───────────────────────────── */
.featured-article-image-container {
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  width: 45%;
}

.featured-article-image {
  display: block;
  height: 100%;
  object-fit: cover;
  transition: transform 400ms ease;
  width: 100%;
}

.featured-article-card:hover .featured-article-image {
  transform: scale(1.06);
}

/* ── Featured Badge (overlay on image) ────────────────────────────────── */
.featured-badge {
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  left: 0.75rem;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.55rem;
  position: absolute;
  text-transform: uppercase;
  top: 0.75rem;
  z-index: 10;
}

/* ── Content Area (RIGHT side, ~55% width) ─────────────────────────────── */
.featured-article-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 1.5rem;
  width: 55%;
}

/* ── Categories ──────────────────────────────────────────────────────── */
.featured-article-categories {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.4;
  margin: 0;
  text-transform: uppercase;
}

/* ── Title ───────────────────────────────────────────────────────────── */
.featured-article-title {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  text-transform: uppercase;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Description ─────────────────────────────────────────────────────── */
.featured-article-description {
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  display: -webkit-box;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Bottom Metadata & Action ───────────────────────────────────────────── */
.featured-article-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto;
}

.featured-article-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.7rem;
  gap: 0.75rem;
}

.featured-meta-item {
  align-items: center;
  display: inline-flex;
  gap: 0.35rem;
}

/* ── Read More Link ──────────────────────────────────────────────────── */
.featured-read-more {
  align-items: center;
  display: inline-flex;
  font-size: 0.85rem;
  font-weight: 600;
  gap: 0.45rem;
  text-decoration: none;
  transition: all 180ms ease;
}

.featured-read-more:hover {
  transform: translateX(4px);
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ══════════════════════════════════════════════════════════ */

/* Large tablet (992px – 1199px) — Keep 2 columns, tighter spacing */
@media (min-width: 992px) and (max-width: 1199px) {
  .featured-articles-grid {
    gap: 1.25rem;
  }

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

  .featured-article-content {
    padding: 1.25rem;
  }

  .featured-article-title {
    font-size: 1.05rem;
  }
}

/* Tablet (768px – 991px) — Keep 2 columns, adjust card structure */
@media (min-width: 768px) and (max-width: 991px) {
  .featured-articles-grid {
    gap: 1rem;
  }

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

  .featured-article-card {
    min-height: 240px;
  }

  .featured-article-image-container {
    width: 42%;
  }

  .featured-article-content {
    padding: 1rem;
    width: 58%;
  }

  .featured-article-title {
    font-size: 1rem;
  }

  .featured-article-description {
    font-size: 0.8rem;
  }
}

/* Mobile (≤767px) — 1 column, vertical card layout */
@media (max-width: 767px) {
  .featured-section-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

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

  .featured-articles-grid {
    gap: 1.25rem;
    grid-template-columns: 1fr;
  }

  .featured-article-card {
    flex-direction: column;
    min-height: auto;
  }

  .featured-article-image-container {
    aspect-ratio: 16 / 9;
    width: 100%;
  }

  .featured-article-content {
    padding: 1.25rem;
    width: 100%;
  }

  .featured-article-title {
    font-size: 1.1rem;
  }

  .featured-article-description {
    font-size: 0.85rem;
  }

  .featured-view-all-link {
    font-size: 0.8rem;
  }
}

/* Extra small mobile (≤375px) */
@media (max-width: 375px) {
  .featured-section-title {
    font-size: 1.35rem;
  }

  .featured-article-content {
    padding: 1rem;
  }

  .featured-article-title {
    font-size: 1rem;
  }

  .featured-article-categories {
    font-size: 0.6rem;
  }

  .featured-article-meta {
    font-size: 0.65rem;
  }
}
