/* ============================================
   Tabloème — Feuille de style commune
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Special+Elite&display=swap');

:root {
  --or-fonce: #8b6f3a;
  --or-clair: #c9a961;
  --or-pale: #e8d9b0;
  --vélin: #f5ede0;
  --vélin-fonce: #ebe0c9;
  --encre: #2a1f12;
  --encre-douce: #4a3a26;
  --sang: #6b1818;
  --ombre: rgba(60, 40, 15, 0.25);

  --serif-titre: 'Cormorant Garamond', 'Garamond', Georgia, serif;
  --serif-corps: 'EB Garamond', 'Garamond', Georgia, serif;
  --machine: 'Special Elite', 'Courier New', monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--serif-corps);
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--encre);
  background-color: var(--vélin);
  background-image:
    radial-gradient(ellipse at top left, rgba(201, 169, 97, 0.08), transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(139, 111, 58, 0.06), transparent 50%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.55  0 0 0 0 0.42  0 0 0 0 0.18  0 0 0 0.04 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
  cursor: url('image/parchemin.png'), auto;
}

/* ============================================
   En-tête de navigation
   ============================================ */

.site-header {
  padding: 1.5rem 1rem 0.5rem;
  text-align: center;
  border-bottom: 1px solid var(--or-pale);
  margin-bottom: 2rem;
}

.site-header a.brand {
  font-family: var(--serif-titre);
  font-size: 1.8rem;
  font-weight: 600;
  font-style: italic;
  color: var(--encre);
  text-decoration: none;
  letter-spacing: 0.05em;
  transition: color 0.3s ease;
}

.site-header a.brand:hover,
.site-header a.brand:focus {
  color: var(--or-fonce);
}

.site-header .tagline {
  display: block;
  font-family: var(--serif-corps);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--encre-douce);
  margin-top: 0.25rem;
  letter-spacing: 0.08em;
}

/* ============================================
   Page d'accueil — galerie de tableaux
   ============================================ */

.galerie {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.5rem;
  align-items: stretch;
}

.galerie .titre-principal {
  grid-column: 1 / -1;
  text-align: center;
  font-family: var(--serif-titre);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 500;
  font-style: italic;
  margin: 1rem 0 0.5rem;
  color: var(--encre);
  letter-spacing: 0.02em;
}

.galerie .sous-titre {
  grid-column: 1 / -1;
  text-align: center;
  font-style: italic;
  color: var(--encre-douce);
  font-size: 1.15rem;
  margin: 0 0 2rem;
  letter-spacing: 0.05em;
}

.galerie .ornement {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--or-clair);
  font-size: 1.4rem;
  letter-spacing: 1rem;
  margin-bottom: 1rem;
}

.tableau {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  padding: 1.25rem;
  background: linear-gradient(145deg, rgba(255, 251, 240, 0.5), rgba(232, 217, 176, 0.3));
  border: 1px solid var(--or-pale);
  border-radius: 2px;
  box-shadow:
    0 2px 4px var(--ombre),
    0 8px 24px rgba(60, 40, 15, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  position: relative;
}

.tableau:hover,
.tableau:focus {
  transform: translateY(-6px) rotate(-0.3deg);
  box-shadow:
    0 6px 12px var(--ombre),
    0 16px 40px rgba(60, 40, 15, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  outline: none;
}

.tableau:focus-visible {
  outline: 2px dashed var(--or-fonce);
  outline-offset: 4px;
}

.tableau img {
  max-width: 100%;
  height: auto;
  display: block;
  margin-bottom: 1rem;
}

.tableau .cartel {
  font-family: var(--serif-titre);
  font-style: italic;
  font-weight: 500;
  font-size: 1.3rem;
  color: var(--encre);
  text-align: center;
  letter-spacing: 0.04em;
  margin: 0;
}

.tableau .cartel::before,
.tableau .cartel::after {
  content: "·";
  color: var(--or-clair);
  margin: 0 0.5rem;
}

/* Cas particulier : le « tableau-titre » central de la galerie */
.tableau--vedette {
  background:
    url('image/chambranle.jpg') center/cover no-repeat;
  min-height: 230px;
  justify-content: center;
  padding: 2rem;
}

.tableau--vedette .cartel-vedette {
  background: rgba(245, 237, 224, 0.85);
  padding: 1rem 1.5rem;
  border: 1px solid var(--or-fonce);
}

.tableau--vedette h1 {
  font-family: var(--serif-titre);
  font-size: 2rem;
  font-style: italic;
  margin: 0 0 0.3rem;
  color: var(--encre);
}

.tableau--vedette p {
  font-style: italic;
  margin: 0;
  font-size: 0.95rem;
  color: var(--encre-douce);
}

/* ============================================
   Pages de poèmes
   ============================================ */

.poeme {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.poeme-cadre {
  background-color: rgba(255, 251, 240, 0.6);
  border: 1px solid var(--or-pale);
  padding: 2.5rem 2rem;
  box-shadow:
    0 4px 12px var(--ombre),
    inset 0 0 80px rgba(232, 217, 176, 0.2);
  position: relative;
}

.poeme-cadre::before,
.poeme-cadre::after {
  content: "";
  position: absolute;
  width: 30px;
  height: 30px;
  border: 1px solid var(--or-fonce);
}

.poeme-cadre::before {
  top: 8px;
  left: 8px;
  border-right: none;
  border-bottom: none;
}

.poeme-cadre::after {
  bottom: 8px;
  right: 8px;
  border-left: none;
  border-top: none;
}

.poeme figure {
  margin: 0 0 2rem;
  text-align: center;
}

.poeme figure img {
  max-width: 100%;
  height: auto;
  display: inline-block;
  margin: 0 0.25rem;
}

.poeme h1 {
  font-family: var(--serif-titre);
  font-size: 2.5rem;
  font-weight: 500;
  font-style: italic;
  text-align: center;
  margin: 0 0 0.3rem;
  color: var(--encre);
  letter-spacing: 0.03em;
}

.poeme h1 a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed var(--or-clair);
  padding-bottom: 2px;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.poeme h1 a:hover,
.poeme h1 a:focus {
  color: var(--or-fonce);
  border-color: var(--or-fonce);
}

.poeme .sous-titre {
  text-align: center;
  font-style: italic;
  color: var(--encre-douce);
  margin: 0 0 2rem;
  font-size: 1.05rem;
}

.poeme-texte {
  font-size: 1.25rem;
  line-height: 1.9;
  text-align: center;
  margin: 1.5rem 0;
  color: var(--encre);
}

.poeme-texte.justifie {
  text-align: justify;
  font-size: 1.15rem;
}

.poeme-prose {
  font-size: 1.1rem;
  line-height: 1.85;
  text-align: justify;
  margin: 1.5rem 0;
}

.poeme-prose p {
  margin: 0 0 1.2rem;
  text-indent: 1.5rem;
}

.poeme .signature {
  text-align: right;
  font-style: italic;
  color: var(--encre-douce);
  margin-top: 2rem;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}

.poeme .signature .date {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--machine);
  font-style: normal;
  font-size: 0.85rem;
  color: var(--or-fonce);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ============================================
   Définitions (acrostiche, iritis)
   ============================================ */

.definitions {
  max-width: 640px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.definition {
  padding: 1.5rem 0;
  border-top: 1px solid var(--or-pale);
}

.definitions .definition:first-of-type {
  border-top: 2px solid var(--or-fonce);
}

.definitions .definition:last-of-type {
  border-bottom: 2px solid var(--or-fonce);
}

.definition dt {
  font-family: var(--serif-titre);
  font-size: 1.6rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--encre);
}

.definition dt em {
  display: block;
  font-size: 0.95rem;
  font-weight: 400;
  font-style: italic;
  color: var(--or-fonce);
  margin-top: 0.2rem;
  letter-spacing: 0.05em;
}

.definition dd {
  margin: 0;
  text-align: center;
  line-height: 1.7;
  color: var(--encre-douce);
}

.definition dd .categorie {
  display: inline-block;
  font-style: italic;
  color: var(--or-fonce);
  font-weight: 500;
  margin-right: 0.4rem;
}

/* ============================================
   Navigation entre poèmes (pied de page)
   ============================================ */

.navigation {
  max-width: 720px;
  margin: 2rem auto 0;
  padding: 2rem 1.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--or-pale);
}

.navigation a {
  font-family: var(--serif-titre);
  font-style: italic;
  color: var(--encre-douce);
  text-decoration: none;
  font-size: 1rem;
  letter-spacing: 0.03em;
  transition: color 0.3s ease;
}

.navigation a:hover,
.navigation a:focus {
  color: var(--or-fonce);
}

.navigation .accueil {
  font-size: 1.1rem;
  color: var(--or-fonce);
}

/* ============================================
   Pied de page
   ============================================ */

.site-footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  font-size: 0.9rem;
  color: var(--encre-douce);
  font-style: italic;
}

.site-footer a {
  color: var(--or-fonce);
  text-decoration: none;
  border-bottom: 1px dashed var(--or-clair);
}

.site-footer a:hover,
.site-footer a:focus {
  color: var(--encre);
  border-bottom-color: var(--encre);
}

.site-footer .ornement {
  color: var(--or-clair);
  font-size: 1.2rem;
  letter-spacing: 0.8rem;
  margin-bottom: 0.8rem;
}

/* ============================================
   Responsive — mobile
   ============================================ */

@media (max-width: 600px) {
  body {
    font-size: 1.05rem;
  }

  .galerie {
    gap: 1.5rem;
    padding: 1.5rem 1rem 3rem;
  }

  .poeme,
  .definitions {
    padding: 1rem 1rem 2rem;
  }

  .poeme-cadre {
    padding: 1.75rem 1.25rem;
  }

  .poeme h1 {
    font-size: 2rem;
  }

  .poeme-texte {
    font-size: 1.1rem;
  }

  .poeme-prose {
    font-size: 1rem;
    text-align: left;
  }

  .poeme-prose p {
    text-indent: 1rem;
  }
}

/* ============================================
   Réduction des animations pour utilisateurs sensibles
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
