/* ============================================
   COUDEMAIL.FR — Magazine Puériculture
   Direction artistique : Botanique & Organique
   Palette : Vert sauge, crème, terre cuite, brun
   Typo : Cormorant Garamond + Fira Sans
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  --sage: #8B9D77;
  --sage-dark: #6B7D5A;
  --sage-light: #A8B898;
  --sage-pale: #D4DCC9;
  --cream: #FAF6F0;
  --cream-dark: #F0E8DA;
  --terracotta: #C1876B;
  --terracotta-light: #D9A68E;
  --terracotta-dark: #A66B4F;
  --brown: #7A6455;
  --brown-light: #9B8576;
  --brown-dark: #5C4A3D;
  --text-dark: #3A3028;
  --text-body: #4D4339;
  --text-muted: #8A7E72;
  --white: #FFFFFF;

  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Fira Sans', 'Segoe UI', sans-serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-card: 0 2px 12px rgba(58, 48, 40, 0.08);
  --shadow-card-hover: 0 8px 30px rgba(58, 48, 40, 0.14);
  --shadow-hero: 0 12px 40px rgba(58, 48, 40, 0.12);

  --max-width: 1200px;
  --header-height: 70px;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text-body);
  background-color: var(--cream);
  line-height: 1.7;
  min-height: 100vh;
}

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

a {
  color: var(--terracotta-dark);
  text-decoration: none;
  transition: color 0.25s ease;
}

a:hover {
  color: var(--sage-dark);
}

ul, ol {
  list-style: none;
}

/* --- Decorative Underlines (global pattern) --- */
.underline-art {
  position: relative;
  display: inline;
  background-image: linear-gradient(120deg, var(--terracotta-light) 0%, var(--sage-light) 100%);
  background-repeat: no-repeat;
  background-size: 100% 3px;
  background-position: 0 92%;
  padding-bottom: 2px;
  transition: background-size 0.3s ease;
}

.underline-art:hover {
  background-size: 100% 6px;
}

.underline-wavy {
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-color: var(--terracotta-light);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.underline-thick {
  position: relative;
  display: inline;
  background-image: linear-gradient(to right, var(--sage) 0%, var(--sage-light) 100%);
  background-repeat: no-repeat;
  background-size: 100% 8px;
  background-position: 0 88%;
  padding-bottom: 3px;
}

/* --- Top Bar --- */
.top-bar {
  background: linear-gradient(135deg, var(--sage-dark) 0%, var(--sage) 50%, var(--terracotta) 100%);
  color: var(--cream);
  text-align: center;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 300;
  letter-spacing: 0.5px;
}

.top-bar span {
  opacity: 0.92;
}

/* --- Header --- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--cream-dark);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(58, 48, 40, 0.05);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.site-logo {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.5px;
}

.site-logo .logo-accent {
  color: var(--terracotta);
}

/* --- Navigation --- */
.main-nav ul {
  display: flex;
  gap: 8px;
}

.main-nav a {
  display: block;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-body);
  border-radius: var(--radius-sm);
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.main-nav a:hover {
  background: var(--sage-pale);
  color: var(--sage-dark);
}

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 26px;
  height: 2.5px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  padding: 80px 24px;
  overflow: hidden;
  background-color: var(--sage-pale);
}

.hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.15;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='10' cy='10' r='2' fill='%236B7D5A'/%3E%3Ccircle cx='40' cy='10' r='1.5' fill='%236B7D5A'/%3E%3Ccircle cx='25' cy='30' r='2.5' fill='%236B7D5A'/%3E%3Ccircle cx='55' cy='35' r='1.5' fill='%236B7D5A'/%3E%3Ccircle cx='10' cy='50' r='1.8' fill='%236B7D5A'/%3E%3Ccircle cx='45' cy='55' r='2' fill='%236B7D5A'/%3E%3Cpath d='M0 25 Q15 20 30 25 T60 25' fill='none' stroke='%236B7D5A' stroke-width='0.8'/%3E%3Cpath d='M0 45 Q15 40 30 45 T60 45' fill='none' stroke='%236B7D5A' stroke-width='0.6'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 60px 60px;
}

.hero-content {
  position: relative;
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-text {
  background: rgba(250, 246, 240, 0.88);
  backdrop-filter: blur(8px);
  padding: 40px 36px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hero);
}

.hero-label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--white);
  background: var(--terracotta);
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-dark);
  margin-bottom: 18px;
}

.hero-title .highlight {
  position: relative;
  display: inline;
  background-image: linear-gradient(120deg, var(--terracotta-light) 0%, var(--sage-light) 100%);
  background-repeat: no-repeat;
  background-size: 100% 10px;
  background-position: 0 88%;
}

.hero-excerpt {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.hero-cta {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, var(--terracotta) 0%, var(--terracotta-dark) 100%);
  padding: 12px 28px;
  border-radius: 30px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 15px rgba(193, 135, 107, 0.3);
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(193, 135, 107, 0.45);
  color: var(--white);
}

.hero-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-hero);
  aspect-ratio: 4/3;
}

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

/* --- Section Layout --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.category-section {
  padding: 64px 0;
  border-bottom: 1px solid var(--cream-dark);
}

.category-section:last-of-type {
  border-bottom: none;
}

.section-header {
  margin-bottom: 40px;
  text-align: center;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(to right, var(--terracotta-light), var(--sage));
  border-radius: 2px;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 16px;
}

/* --- Featured Article (Pillar) --- */
.featured-article {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 36px;
  align-items: center;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  margin-bottom: 40px;
}

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

.featured-article-image {
  aspect-ratio: 4/3;
  overflow: hidden;
}

.featured-article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.featured-article:hover .featured-article-image img {
  transform: scale(1.04);
}

.featured-article-body {
  padding: 32px 36px 32px 0;
}

.article-category-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--sage-dark);
  background: var(--sage-pale);
  padding: 3px 12px;
  border-radius: 16px;
  margin-bottom: 12px;
}

.featured-article-title {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-dark);
  margin-bottom: 14px;
}

.featured-article-title a {
  color: inherit;
  transition: color 0.25s ease;
}

.featured-article-title a:hover {
  color: var(--terracotta);
}

.featured-article-excerpt {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--terracotta-dark);
  position: relative;
  background-image: linear-gradient(120deg, var(--terracotta-light) 0%, var(--sage-light) 100%);
  background-repeat: no-repeat;
  background-size: 0% 2px;
  background-position: 0 100%;
  padding-bottom: 2px;
  transition: background-size 0.3s ease;
}

.read-more:hover {
  background-size: 100% 2px;
  color: var(--terracotta-dark);
}

.read-more::after {
  content: '\2192';
  transition: transform 0.2s ease;
}

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

/* --- Article Grid --- */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.article-card {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.article-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
}

.article-card-image {
  aspect-ratio: 16/10;
  overflow: hidden;
}

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

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

.article-card-body {
  padding: 20px 22px 24px;
}

.article-card-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.article-card-title a {
  color: inherit;
  transition: color 0.25s ease;
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-color: transparent;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.article-card-title a:hover {
  color: var(--terracotta);
  text-decoration-color: var(--terracotta-light);
}

.article-card-excerpt {
  font-size: 0.87rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.article-card .read-more {
  font-size: 0.82rem;
}

/* --- Breadcrumb (for article pages) --- */
.breadcrumb {
  padding: 16px 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

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

.breadcrumb a:hover {
  color: var(--terracotta);
}

.breadcrumb span {
  margin: 0 6px;
  opacity: 0.5;
}

/* --- Article Content (for article pages) --- */
.article-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.article-page h1 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-dark);
  margin-bottom: 24px;
}

.article-page h2 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 40px 0 16px;
  position: relative;
  display: inline-block;
}

.article-page h2::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 40px;
  height: 3px;
  background: linear-gradient(to right, var(--terracotta-light), var(--sage));
  border-radius: 2px;
}

.article-page h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 32px 0 12px;
}

.article-page p {
  margin-bottom: 18px;
}

.article-page ul,
.article-page ol {
  margin: 16px 0 24px 24px;
}

.article-page ul {
  list-style: disc;
}

.article-page ol {
  list-style: decimal;
}

.article-page li {
  margin-bottom: 8px;
}

.article-page blockquote {
  border-left: 4px solid var(--sage);
  padding: 16px 24px;
  margin: 24px 0;
  background: var(--cream-dark);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-muted);
}

.article-page a {
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-color: var(--terracotta-light);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.article-page img {
  border-radius: var(--radius-md);
  margin: 24px 0;
}

.article-page .featured-image {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
}

/* --- Sidebar (for article pages) --- */
.article-layout {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
}

.sidebar {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  align-self: start;
}

.sidebar-block {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.sidebar-block h3 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 14px;
  position: relative;
  display: inline-block;
}

.sidebar-block h3::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 30px;
  height: 3px;
  background: var(--terracotta-light);
  border-radius: 2px;
}

.sidebar-block ul li {
  margin-bottom: 10px;
}

.sidebar-block ul li a {
  font-size: 0.88rem;
  color: var(--text-body);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-block ul li a::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage-light);
  flex-shrink: 0;
}

.sidebar-block ul li a:hover {
  color: var(--terracotta);
}

/* --- Footer --- */
.site-footer {
  background: linear-gradient(160deg, var(--brown-dark) 0%, var(--sage-dark) 40%, var(--terracotta-dark) 100%);
  color: var(--cream);
  padding: 56px 24px 32px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 40px;
}

.footer-brand .footer-logo {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 12px;
}

.footer-brand .footer-logo .logo-accent {
  color: var(--terracotta-light);
}

.footer-brand p {
  font-size: 0.88rem;
  line-height: 1.7;
  opacity: 0.8;
}

.footer-col h4 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--cream);
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col ul li a {
  color: var(--cream);
  opacity: 0.75;
  font-size: 0.88rem;
  transition: opacity 0.2s ease;
}

.footer-col ul li a:hover {
  opacity: 1;
  color: var(--terracotta-light);
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(250, 246, 240, 0.15);
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.6;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero-image {
    max-height: 360px;
  }

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

  .featured-article-body {
    padding: 24px 28px 28px;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

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

  .sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }

  .hamburger {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--white);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 200;
    padding: 80px 24px 24px;
    transition: right 0.35s ease;
  }

  .main-nav.open {
    right: 0;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 4px;
  }

  .main-nav a {
    font-size: 1rem;
    padding: 12px 16px;
  }

  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(58, 48, 40, 0.4);
    z-index: 150;
  }

  .nav-overlay.active {
    display: block;
  }

  .hero {
    padding: 48px 20px;
  }

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

  .hero-text {
    padding: 28px 24px;
  }

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

  .section-title {
    font-size: 1.7rem;
  }

  .category-section {
    padding: 44px 0;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.65rem;
  }

  .hero-text {
    padding: 22px 18px;
  }

  .hero-excerpt {
    font-size: 0.92rem;
  }

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

  .article-card-body {
    padding: 16px 18px 20px;
  }
}
