/* ============================================
   Nouvel Cho! — Minimalist Design System
   Clean, airy, elegant, mobile-first
   ============================================ */

:root {
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;

  /* Sober, elegant palette */
  --bg: #fafafa;
  --bg-card: #ffffff;
  --text: #111111;
  --text-muted: #555555;
  --text-light: #777777;
  --border: #e5e5e5;
  --accent: #b91c1c;        /* Deep, refined red */
  --accent-hover: #9f1a1a;

  /* Spacing scale (generous by design) */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  --max-width: 1100px;
  --content-width: 720px;
}

/* Reset & base */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  margin: 0;
  padding: 0;
}

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

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ====================== HEADER (allsafi.com style) ====================== */
header {
  background: linear-gradient(135deg, #1a1a1a, #2c3e50);
  color: white;
  border-bottom: 4px solid #ff2143;
  padding: 0;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.8rem 1rem 1.4rem;
  flex-wrap: wrap;
}

.logo {
  height: 110px;
  width: auto;
  border-radius: 8px;
  flex-shrink: 0;
}

.header-text {
  text-align: center;
}

.header-text h1 {
  font-size: 2.6rem;
  margin: 0 0 0.25rem;
  font-family: 'Barlow', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.header-text p {
  font-size: 1.05rem;
  opacity: 0.92;
  margin: 0;
}

/* Navigation row under the big header */
.header-nav {
  background: rgba(255,255,255,0.06);
  border-top: 1px solid rgba(255,255,255,0.1);
}

.header-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.65rem 1rem;
  display: flex;
  justify-content: center;
  gap: 2.25rem;
  flex-wrap: wrap;
}

.header-nav a {
  color: rgba(255,255,255,0.9);
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  transition: all 0.2s ease;
  border-radius: 3px;
}

.header-nav a:hover {
  color: white;
  background: rgba(255,255,255,0.1);
}

.header-nav a.active {
  color: #ff2143;
  font-weight: 600;
}

/* Mobile adjustments for the allsafi-style header */
@media (max-width: 640px) {
  .header-container {
    flex-direction: column;
    text-align: center;
    gap: 0.6rem;
    padding: 1.2rem 1rem 0.9rem;
  }
  .logo {
    height: 82px;
  }
  .header-text h1 {
    font-size: 2.1rem;
  }
  .header-text p {
    font-size: 0.95rem;
  }
  .header-nav-inner {
    gap: 1rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }
}

/* ====================== HERO / EDITORIAL PRELUDE ====================== */
.hero {
  padding: 3rem 0 4rem;
}

#hero-banner {
  margin-bottom: 1.5rem;
  /* Slightly to the left */
  padding-left: 0.75rem;
  border-left: 5px solid #ff2143;
}

.hero-banner-title {
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1.05;
  margin: 0 0 0.35rem;
  color: #111;
  letter-spacing: -0.03em;
}

.hero-banner-subtitle {
  font-size: 1.15rem;
  color: #444;
  font-weight: 500;
  line-height: 1.35;
  max-width: 620px;
}

.editorial-content {
  max-width: 680px;
  margin: 0;
  padding-left: 0.75rem; /* align with the banner's left accent */
}

.editorial-text p {
  font-size: 1.18rem;
  line-height: 1.65;
  color: #222;
  margin-bottom: 1.1em;
}

.editorial-text p:last-child {
  margin-bottom: 0;
}

.editorial-cta {
  margin-top: 2rem;
}

.editorial-btn {
  display: inline-block;
  background: #ff2143;
  color: white;
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid #ff2143;
}

.editorial-btn:hover {
  background: #e11d3a;
  border-color: #e11d3a;
  color: white;
  transform: translateY(-1px);
}

.hero-error {
  color: #888;
  font-style: italic;
}

/* Banner responsive */
@media (max-width: 640px) {
  .hero-banner-title {
    font-size: 2.4rem;
  }
  .hero-banner-subtitle {
    font-size: 1.05rem;
  }
  #hero-banner {
    padding-left: 0.5rem;
    border-left-width: 4px;
  }
  .editorial-content {
    padding-left: 0.5rem;
  }
}

.featured-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  background: var(--bg-card);
  border-radius: 4px;
  padding: 0;
}

.featured-image {
  overflow: hidden;
  border-radius: 4px;
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  transition: transform 0.4s ease;
}

.featured-card:hover .featured-image img {
  transform: scale(1.015);
}

.featured-body {
  padding: 0.5rem 0;
}

.meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.date {
  color: var(--text-light);
  font-weight: 500;
}

.category {
  background: #f1f1f1;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 2px 9px;
  border-radius: 20px;
  font-weight: 500;
}

.featured-title {
  font-size: 2.1rem;
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 1.1rem;
  letter-spacing: -0.02em;
}

.featured-excerpt {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: 0 0 1.75rem;
  max-width: 42ch;
}

.read-more-btn {
  display: inline-block;
  font-weight: 600;
  color: var(--accent);
  transition: all 0.2s ease;
  font-size: 1rem;
}

.read-more-btn:hover {
  color: var(--accent-hover);
  transform: translateX(3px);
}

/* ====================== ARTICLES FEED ====================== */
.feed {
  padding: var(--space-xl) 0 var(--space-2xl);
  border-top: 1px solid var(--border);
}

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

.section-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.section-link {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.section-link:hover {
  color: var(--accent);
}

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

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.article-card:hover {
  border-color: #d4d4d4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.card-link {
  display: block;
  height: 100%;
}

.card-image {
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.article-card:hover .card-image img {
  transform: scale(1.03);
}

.card-content {
  padding: 1.25rem 1.35rem 1.5rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.65rem;
}

.card-excerpt {
  font-size: 0.97rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.55;
}

.no-articles,
.error-state {
  color: var(--text-light);
  font-style: italic;
  padding: 2rem 0;
}

/* ====================== CURATED SOURCES ====================== */
.sources {
  background: #f4f4f4;
  padding: var(--space-2xl) 0;
}

.sources .section-header {
  margin-bottom: 2.25rem;
}

.sources .section-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0;
}

.sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.75rem;
}

.source-block {
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem 1.6rem 1.4rem;
  display: flex;
  flex-direction: column;
}

.source-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.source-header i {
  font-size: 1.45rem;
  color: var(--text);
}

.source-header h3 {
  font-size: 1.05rem;
  margin: 0;
  font-weight: 700;
}

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

.source-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.source-item {
  display: flex;
  gap: 0.85rem;
  padding: 0.35rem 0;
  transition: background 0.15s ease;
  border-radius: 3px;
}

.source-item:hover {
  background: #f8f8f8;
}

.source-thumb {
  width: 58px;
  height: 42px;
  background: #f1f1f1;
  background-size: cover;
  background-position: center;
  border-radius: 3px;
  flex-shrink: 0;
}

.source-text {
  flex: 1;
  min-width: 0;
}

.source-text p {
  margin: 0.15rem 0 0;
  font-size: 0.93rem;
  line-height: 1.45;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.source-more {
  margin-top: 1.1rem;
  font-size: 0.85rem;
  color: var(--accent);
  align-self: flex-start;
  transition: color 0.2s ease;
}

.source-more:hover {
  color: var(--accent-hover);
}

/* ====================== FOOTER ====================== */
footer {
  background: #111111;
  color: #888;
  padding: 2.25rem 0;
  font-size: 0.9rem;
}

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

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: #888;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #ccc;
}

/* ====================== RESPONSIVE ====================== */
@media (max-width: 860px) {
  .featured-card {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

  .featured-excerpt {
    max-width: none;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
  }

  .main-nav {
    gap: 1.25rem;
    flex-wrap: wrap;
  }
}

/* ====================== HOMEPAGE SIDEBAR (Nouvel Cho Pase) ====================== */
.homepage-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .homepage-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.homepage-sidebar {
  position: sticky;
  top: 30px;
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  padding: 1.25rem 1.1rem;
  height: fit-content;
  max-height: 80vh;
  overflow-y: auto;
}

.homepage-sidebar-title {
  font-size: 1rem;
  font-weight: 700;
  color: #111;
  margin: 0 0 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid #ff2143;
  letter-spacing: 0.02em;
}

.homepage-sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.homepage-sidebar-item {
  font-size: 0.9rem;
  line-height: 1.3;
}

.homepage-sidebar-item a {
  color: #333;
  text-decoration: none;
  display: block;
  padding: 0.25rem 0.35rem;
  border-radius: 3px;
  transition: all 0.15s ease;
}

.homepage-sidebar-item a:hover {
  background: white;
  color: #b91c1c;
  transform: translateX(2px);
}

.homepage-sidebar-item .date {
  font-size: 0.72rem;
  color: #888;
  display: block;
  margin-bottom: 1px;
}

.homepage-sidebar-item .title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 500;   
}

.homepage-sidebar-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e5e5e5;
  text-align: center;
}

.homepage-sidebar-footer a {
  font-size: 0.82rem;
  color: #b91c1c;
  text-decoration: none;
  font-weight: 600;
}

.homepage-sidebar-footer a:hover {
  text-decoration: underline;
}

/* ====================== NOUVEL CHO! BAR (under header, above editorial) ====================== */
.nouvel-cho-bar {
  background: #ffffff;
  border-bottom: 1px solid #e5e5e5;
  padding: 0.05rem 0;
  position: relative;
  z-index: 10;
}

.nouvel-cho-bar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.nouvel-cho-bar-text {
  font-size: 2.15rem;
  font-weight: 800;
  color: #111111;
  letter-spacing: -0.03em;
  padding-left: 0.85rem;
  border-left: 5px solid #ff2143;
  display: block;
  margin: 0;
  line-height: 1.0;
}

@media (max-width: 900px) {
  .homepage-sidebar {
    position: static;
    max-height: none;
  }
}

/* Adjust hero when placed next to the sidebar */
.homepage-main .hero {
  padding-top: 1rem;
  padding-bottom: 1.5rem;
}

.homepage-main .hero .container {
  padding-left: 0;
  padding-right: 0.5rem;
}

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

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

  .hero {
    padding: 3rem 0 2rem;
  }

  .feed {
    padding: 2rem 0 3rem;
  }
}

/* Small polish */
.loading {
  color: var(--text-light);
  font-style: italic;
}
