/* Éphéméride pédagogique — almanach annuel d'études IA */
:root {
  --wine: #7C2D12;
  --parchment: #FEF7ED;
  --umber: #78350F;
  --emerald: #065F46;
  --gold: #A16207;
  --ink: #292524;
  --shadow: rgba(120, 53, 15, 0.15);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--parchment);
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(161, 98, 7, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(124, 45, 18, 0.05) 0%, transparent 45%);
  min-height: 100vh;
}

h1, h2, h3, h4, .brand, .nav-link, .btn, .vignette-title {
  font-family: "Cinzel", "Times New Roman", serif;
  font-weight: 600;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); color: var(--wine); line-height: 1.25; }
h2 { font-size: clamp(1.35rem, 3vw, 1.85rem); color: var(--umber); margin-top: 2rem; }
h3 { font-size: 1.25rem; color: var(--wine); }

a { color: var(--emerald); text-decoration-thickness: 1px; }
a:hover { color: var(--wine); }

img { max-width: 100%; height: auto; }

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

/* Ruban de navigation */
.site-header {
  background: linear-gradient(180deg, var(--wine) 0%, #5c1f0d 100%);
  border-bottom: 4px double var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 12px var(--shadow);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.brand {
  color: var(--parchment);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  line-height: 1.3;
}

.brand span {
  display: block;
  font-family: "Source Serif 4", serif;
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-top: 0.15rem;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.nav-link {
  color: var(--parchment);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  border-bottom-color: var(--gold);
  color: #fff;
}

/* Hero gravure */
.hero {
  position: relative;
  padding: 3.5rem 0 3rem;
  text-align: center;
  border-bottom: 1px solid rgba(161, 98, 7, 0.35);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 1rem 4%;
  border: 2px solid var(--umber);
  border-image: repeating-linear-gradient(
    45deg,
    var(--gold),
    var(--gold) 4px,
    transparent 4px,
    transparent 8px
  ) 1;
  pointer-events: none;
  opacity: 0.4;
}

.hero-lead {
  font-size: 1.2rem;
  font-style: italic;
  color: var(--umber);
  max-width: 42rem;
  margin: 0 auto 1.5rem;
}

.hero-text {
  max-width: 52rem;
  margin: 0 auto;
  text-align: left;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.45);
  border-left: 4px solid var(--emerald);
}

.slogan {
  display: block;
  margin-top: 2rem;
  padding: 1rem 1.5rem;
  font-style: italic;
  color: var(--emerald);
  border-top: 1px dashed var(--gold);
  border-bottom: 1px dashed var(--gold);
}

/* Sections & vignettes */
section {
  padding: 2.5rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

.section-title::after {
  content: "◆";
  display: block;
  color: var(--gold);
  font-size: 0.75rem;
  margin-top: 0.5rem;
}

.vignette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.75rem;
}

.vignette {
  background: #fff;
  border: 1px solid rgba(120, 53, 15, 0.25);
  padding: 1.5rem;
  position: relative;
  box-shadow: 3px 3px 0 var(--shadow);
}

.vignette::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  bottom: 6px;
  border: 1px solid rgba(161, 98, 7, 0.2);
  pointer-events: none;
}

.vignette-num {
  font-family: "Cinzel", serif;
  font-size: 0.75rem;
  color: var(--gold);
  letter-spacing: 0.15em;
}

.vignette-title {
  font-size: 1.1rem;
  margin: 0.5rem 0;
  color: var(--wine);
}

.dicton {
  font-style: italic;
  color: var(--umber);
  border-left: 3px solid var(--emerald);
  padding-left: 1rem;
  margin: 1.25rem 0;
}

.gravure-frame {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, rgba(124, 45, 18, 0.08), rgba(6, 95, 70, 0.06));
  border: 2px solid var(--umber);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-family: "Cinzel", serif;
  font-size: 0.85rem;
  color: var(--umber);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Boutons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--emerald);
  color: var(--parchment) !important;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.2s;
}

.btn:hover {
  background: var(--wine);
  color: var(--parchment) !important;
}

.btn-outline {
  background: transparent;
  color: var(--emerald) !important;
  border: 2px solid var(--emerald);
}

.btn-outline:hover {
  background: var(--emerald);
  color: var(--parchment) !important;
}

.cta-block {
  text-align: center;
  padding: 2.5rem;
  margin: 2rem 0;
  background: rgba(6, 95, 70, 0.06);
  border: 1px double var(--emerald);
}

/* Disclaimer DGCCRF */
.disclaimer {
  background: rgba(124, 45, 18, 0.06);
  border: 1px solid rgba(124, 45, 18, 0.2);
  padding: 1.25rem 1.5rem;
  font-size: 0.92rem;
  margin: 2rem 0;
}

.disclaimer strong {
  color: var(--wine);
}

/* Formulaire */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-family: "Cinzel", serif;
  font-size: 0.85rem;
  color: var(--umber);
  margin-bottom: 0.35rem;
  letter-spacing: 0.04em;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-family: "Source Serif 4", serif;
  font-size: 1rem;
  border: 1px solid rgba(120, 53, 15, 0.35);
  background: #fff;
  color: var(--ink);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: 2px solid var(--emerald);
  outline-offset: 1px;
}

.checkbox-group {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  font-size: 0.92rem;
}

.checkbox-group input {
  width: auto;
  margin-top: 0.3rem;
}

.alert {
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid;
}

.alert-success {
  background: rgba(6, 95, 70, 0.08);
  border-color: var(--emerald);
}

.alert-error {
  background: rgba(124, 45, 18, 0.08);
  border-color: var(--wine);
}

/* Tableau programmes */
.program-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.program-table th,
.program-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(120, 53, 15, 0.2);
}

.program-table th {
  font-family: "Cinzel", serif;
  color: var(--wine);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  background: rgba(161, 98, 7, 0.08);
}

/* Pied de page */
.site-footer {
  background: var(--umber);
  color: var(--parchment);
  padding: 2.5rem 0 1.5rem;
  margin-top: 3rem;
  border-top: 4px double var(--gold);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-grid h4 {
  font-family: "Cinzel", serif;
  color: var(--gold);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  margin: 0 0 0.75rem;
}

.footer-grid p,
.footer-grid a {
  font-size: 0.9rem;
  color: rgba(254, 247, 237, 0.88);
  line-height: 1.6;
}

.footer-grid a {
  text-decoration: underline;
  text-decoration-color: var(--gold);
}

.footer-bottom {
  border-top: 1px solid rgba(254, 247, 237, 0.2);
  padding-top: 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  font-style: italic;
}

.footer-legal {
  font-size: 0.78rem;
  opacity: 0.75;
  margin-top: 1rem;
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--umber);
  color: var(--parchment);
  padding: 1.25rem;
  z-index: 1000;
  box-shadow: 0 -4px 20px var(--shadow);
  transform: translateY(100%);
  transition: transform 0.35s ease;
}

.cookie-banner.visible {
  transform: translateY(0);
}

.cookie-inner {
  width: min(1120px, 92%);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.cookie-text {
  flex: 1 1 400px;
  font-size: 0.9rem;
  line-height: 1.55;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cookie-actions .btn {
  font-size: 0.75rem;
  padding: 0.55rem 1rem;
}

.cookie-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(41, 37, 36, 0.6);
  z-index: 1001;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cookie-modal.visible {
  display: flex;
}

.cookie-modal-content {
  background: var(--parchment);
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  border: 2px solid var(--wine);
}

.cookie-modal-content h3 {
  margin-top: 0;
}

/* Page légale */
.legal-content h2 {
  margin-top: 2.5rem;
}

.legal-content ul {
  padding-left: 1.25rem;
}

.legal-content li {
  margin-bottom: 0.5rem;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--umber);
  margin: 1.5rem 0;
}

.breadcrumb a {
  color: var(--emerald);
}

.page-header {
  padding: 2rem 0 1rem;
  border-bottom: 1px dashed rgba(161, 98, 7, 0.4);
  margin-bottom: 1.5rem;
}

.program-detail .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--umber);
  margin-bottom: 1.5rem;
}

.program-detail .meta span {
  padding: 0.25rem 0.75rem;
  background: rgba(161, 98, 7, 0.1);
  border: 1px solid rgba(161, 98, 7, 0.25);
}

.error-page {
  text-align: center;
  padding: 5rem 1rem;
}

.error-page h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
}

@media (max-width: 640px) {
  .header-inner {
    flex-direction: column;
    text-align: center;
  }

  .main-nav {
    justify-content: center;
  }

  .cookie-inner {
    flex-direction: column;
    text-align: center;
  }
}
