/* ============================================================
   Site de Carl de Miranda — Feuille de styles principale
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Lato:wght@300;400;700&display=swap');

/* --- Variables --- */
:root {
  --primary:       #2C5364;
  --primary-dark:  #1a3340;
  --accent:        #B07D3A;
  --accent-light:  #D4A057;
  --bg:            #F7F5F0;
  --surface:       #FFFFFF;
  --text:          #1E1E1E;
  --text-muted:    #666666;
  --border:        #DDD9D0;
  --shadow:        0 2px 14px rgba(0,0,0,0.08);
  --radius:        6px;
  --font-heading:  'Playfair Display', Georgia, serif;
  --font-body:     'Lato', 'Helvetica Neue', Arial, sans-serif;
  --max-width:     1080px;
  --transition:    0.2s ease;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }
ul { list-style: none; }

/* --- Typography --- */
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.3; color: var(--primary-dark); }
h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 2.5vw, 1.9rem); margin-bottom: 0.75rem; }
h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* --- Layout wrapper --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
  background: var(--primary);
  color: #fff;
  padding: 1rem 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-title {
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
}
.site-title a { color: #fff; }
.site-title a:hover { color: var(--accent-light); }
.site-subtitle {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Hamburger toggle (mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: var(--transition);
}

/* ============================================================
   Navigation
   ============================================================ */
.site-nav {
  background: var(--primary-dark);
  border-bottom: 3px solid var(--accent);
}
.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}
.nav-list a {
  display: block;
  color: rgba(255,255,255,0.85);
  padding: 0.75rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background var(--transition), color var(--transition);
}
.nav-list a:hover,
.nav-list a.active {
  background: var(--accent);
  color: #fff;
}

/* ============================================================
   Main layout
   ============================================================ */
.page-main {
  flex: 1;
  padding: 2.5rem 0 3rem;
}
.page-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 2.5rem;
  align-items: start;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 1.5rem;
}
.sidebar-photo {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 3px solid var(--border);
}
.sidebar-caption {
  margin-top: 0.6rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================================
   Content area
   ============================================================ */
.content {
  min-width: 0;
}
.content-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}
.content-header h1 {
  margin-bottom: 0.3rem;
}
.content-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0;
}

/* ============================================================
   Book Grid (ouvrages.html)
   ============================================================ */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.8rem;
  margin-top: 1rem;
}
.book-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid var(--border);
}
.book-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.13);
}
.book-card-cover {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  background: var(--border);
}
.book-card-body {
  padding: 0.9rem;
}
.book-card-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 0.25rem;
  line-height: 1.3;
}
.book-card-year {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.book-card-link {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.book-card-link:hover { color: var(--primary); }

/* ============================================================
   Book page (individual)
   ============================================================ */
.book-detail {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.book-cover-img {
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.book-meta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.book-meta-item {
  font-size: 0.88rem;
  color: var(--text-muted);
}
.book-meta-item strong { color: var(--text); }
.book-award {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #FFF8E7;
  border: 1px solid #E6C96B;
  border-radius: var(--radius);
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  color: #7A5C00;
  margin-bottom: 1rem;
}

/* Buy buttons */
.buy-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.2rem;
}
.btn-buy {
  display: inline-block;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: background var(--transition), transform var(--transition);
}
.btn-buy-primary {
  background: var(--accent);
  color: #fff;
}
.btn-buy-primary:hover { background: var(--accent-light); color: #fff; transform: translateY(-1px); }
.btn-buy-secondary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-buy-secondary:hover { background: var(--primary); color: #fff; transform: translateY(-1px); }

/* ============================================================
   Homepage specifics
   ============================================================ */
.home-featured {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.featured-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform var(--transition);
}
.featured-card:hover { transform: translateY(-3px); }
.featured-card img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
}
.featured-card-body { padding: 0.8rem; }
.featured-card-body h3 { font-size: 0.95rem; margin-bottom: 0.2rem; }
.featured-card-body a { font-size: 0.82rem; color: var(--accent); font-weight: 700; }

.home-notice {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 1.2rem 1.5rem;
  border-radius: var(--radius);
  margin: 1.5rem 0;
}
.home-notice h3 { color: var(--accent-light); margin-bottom: 0.4rem; }
.home-notice p { margin: 0; color: rgba(255,255,255,0.9); font-size: 0.95rem; }
.home-notice a { color: var(--accent-light); font-weight: 700; }
.home-notice a:hover { color: #fff; }

.award-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #FFFBEF;
  border: 1px solid #E8C84A;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
}
.award-banner img { width: 70px; flex-shrink: 0; border-radius: 4px; }
.award-banner p { margin: 0; font-size: 0.9rem; color: #5A4200; }
.award-banner a { color: var(--accent); font-weight: 700; }

/* ============================================================
   Contact form
   ============================================================ */
.form-group {
  margin-bottom: 1.2rem;
}
.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.3rem;
  letter-spacing: 0.02em;
}
.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44,83,100,0.12);
}
textarea.form-control { min-height: 140px; resize: vertical; }
.form-required { color: var(--accent); margin-left: 2px; }
.form-note { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.3rem; }
.btn-submit {
  display: inline-block;
  padding: 0.7rem 2rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background var(--transition), transform var(--transition);
}
.btn-submit:hover { background: var(--accent); transform: translateY(-1px); }
.contact-email-link {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
}

/* ============================================================
   Newsletter form
   ============================================================ */
.newsletter-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  max-width: 500px;
}
.newsletter-conditions {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ============================================================
   Informations — articles list
   ============================================================ */
.info-section { margin-bottom: 2rem; }
.info-section h2 { margin-bottom: 0.8rem; }
.info-article {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.2rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.info-article h3 { margin-bottom: 0.3rem; }
.info-article .meta { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.5rem; }

/* ============================================================
   Divider
   ============================================================ */
.divider {
  border: none;
  border-top: 2px solid var(--border);
  margin: 2rem 0;
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.65);
  padding: 1.5rem 0;
  margin-top: auto;
  font-size: 0.85rem;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.4rem;
}
.footer-inner a { color: rgba(255,255,255,0.65); }
.footer-inner a:hover { color: var(--accent-light); }

/* ============================================================
   Responsive — Tablet (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
  .page-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    display: flex;
    align-items: center;
    gap: 1.2rem;
  }
  .sidebar-photo {
    width: 100px;
    flex-shrink: 0;
  }
  .book-detail {
    grid-template-columns: 150px 1fr;
    gap: 1.2rem;
  }
}

/* ============================================================
   Responsive — Mobile (≤ 520px)
   ============================================================ */
@media (max-width: 520px) {
  .nav-toggle { display: flex; }
  .site-nav { position: relative; }
  .nav-list {
    display: none;
    flex-direction: column;
    width: 100%;
    border-top: 1px solid rgba(255,255,255,0.1);
  }
  .nav-list.open { display: flex; }
  .nav-list a { padding: 0.9rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.07); }

  .sidebar { flex-direction: column; align-items: flex-start; }
  .sidebar-photo { width: 120px; }
  .book-detail { grid-template-columns: 1fr; }
  .book-cover-img { max-width: 160px; }
  .books-grid { grid-template-columns: repeat(2, 1fr); }
  .home-featured { grid-template-columns: repeat(2, 1fr); }
  .award-banner { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   Vidéo intégrée (webinaire) — garde le ratio 16/9 sur mobile
   ============================================================ */
.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 1.5rem;
  background: var(--primary-dark);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
/* Repli pour les navigateurs sans aspect-ratio */
@supports not (aspect-ratio: 16 / 9) {
  .video-wrap { height: 0; padding-bottom: 56.25%; }
}

/* ============================================================
   Pages d'articles — illustrations, sommaires, lecteurs audio
   ============================================================ */
.article-figure { margin: 1.75rem 0; }
.article-figure img {
  margin: 0 auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.article-figure figcaption {
  margin-top: 0.6rem;
  text-align: center;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-muted);
}

/* Encadré listant les autres parties d'un texte */
.parts-nav {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}
.parts-nav h2 { font-size: 1.05rem; margin-bottom: 0.6rem; }
.parts-nav ol { list-style: decimal; padding-left: 1.3rem; line-height: 1.9; }
.parts-nav ul { list-style: none; padding-left: 0; line-height: 1.9; }

/* Lien vers la partie suivante */
.next-part {
  display: inline-block;
  margin: 1.5rem 0 0.5rem;
  font-weight: 700;
}

/* Mention de libre diffusion en bas des textes */
.note-diffusion {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ============================================================
   Page Informations — sections nettement séparées
   ============================================================ */
.info-section {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
}
.info-section-media { flex: 0 0 auto; width: 200px; }
.info-section-media img {
  width: 100%;
  border-radius: var(--radius);
}
.info-section-media figcaption {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--text-muted);
  text-align: center;
}
.info-section-body { flex: 1 1 280px; min-width: 0; }
.info-section-body > h2 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.info-section-body > p:last-child { margin-bottom: 0; }
.info-section-body .date {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.info-section-body ul {
  list-style: disc;
  padding-left: 1.3rem;
  line-height: 1.9;
}
.info-section .audio-box { margin: 1rem 0 0; box-shadow: none; }

@media (max-width: 640px) {
  .info-section { flex-direction: column; padding: 1.25rem; }
  .info-section-media { width: 100%; max-width: 240px; align-self: center; }
}

/* Lecteur audio */
.audio-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0;
}
.audio-box audio { width: 100%; margin-top: 0.75rem; }
