/*
Theme Name: La Plume du poussin
Theme URI: https://laplumedupoussin.fr
Author: La Plume du poussin
Description: Thème d'auteur pour la publication de nouvelles. Lecture longue, incipit en une, plume de progression.
Version: 1.0.1
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: plume-du-poussin
Tags: blog, one-column, custom-logo, custom-menu, editor-style, translation-ready
*/

/* ------------------------------------------------------------------
   1. Jetons
------------------------------------------------------------------ */
:root {
  --rose: #fbe7de;
  --rose-fonce: #f3d2c4;
  --papier: #fffcf9;
  --jaune: #e9ce78;
  --terre: #bd5c2a;
  --terre-clair: #dc8b5e;
  --encre: #453634;
  --encre-douce: #7c6663;
  --trait: rgba(69, 54, 52, 0.14);

  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --titre: "Fraunces", Georgia, serif;
  --util: "Karla", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --lisible: 34rem;
  --large: 72rem;
  --pas: clamp(1.25rem, 4vw, 2.5rem);

  --wonk: "SOFT" 60, "WONK" 1;
}

/* ------------------------------------------------------------------
   2. Base
------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background: var(--rose);
  color: var(--encre);
  font-family: var(--serif);
  font-size: clamp(1.0625rem, 0.4vw + 1rem, 1.1875rem);
  line-height: 1.72;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--terre); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--encre); }

:focus-visible {
  outline: 2px solid var(--terre);
  outline-offset: 3px;
  border-radius: 2px;
}

.lien-evitement {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--papier);
  padding: 0.75rem 1.25rem;
  font-family: var(--util);
  z-index: 100;
}
.lien-evitement:focus { left: 1rem; top: 1rem; }

.invisible {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* ------------------------------------------------------------------
   3. Titres et libellés
------------------------------------------------------------------ */
h1, h2, h3, h4 {
  font-family: var(--titre);
  font-variation-settings: var(--wonk);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.35rem); }
h3 { font-size: 1.4rem; }

.etiquette {
  font-family: var(--util);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terre);
}

.meta {
  font-family: var(--util);
  font-size: 0.83rem;
  letter-spacing: 0.02em;
  color: var(--encre-douce);
}
.meta a { color: inherit; }

/* ------------------------------------------------------------------
   4. Gabarit
------------------------------------------------------------------ */
.enveloppe {
  width: min(100% - 2 * var(--pas), var(--large));
  margin-inline: auto;
}

.colonne {
  width: min(100% - 2 * var(--pas), var(--lisible));
  margin-inline: auto;
}

main { display: block; }

.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section--papier { background: var(--papier); }

/* ------------------------------------------------------------------
   5. En-tête
------------------------------------------------------------------ */
.entete {
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--trait);
}

.entete__grille {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.marque { display: flex; align-items: center; gap: 0.85rem; text-decoration: none; color: inherit; }
.marque img { width: 62px; height: auto; }
.marque__nom {
  font-family: var(--titre);
  font-variation-settings: var(--wonk);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.1;
}
.marque__note { font-family: var(--util); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--encre-douce); }

.nav ul {
  display: flex;
  gap: clamp(1rem, 2.5vw, 2rem);
  list-style: none;
  margin: 0; padding: 0;
  font-family: var(--util);
  font-size: 0.92rem;
  flex-wrap: wrap;
}
.nav a {
  color: var(--encre);
  text-decoration: none;
  padding-bottom: 3px;
  border-bottom: 1.5px solid transparent;
}
.nav a:hover, .nav .current-menu-item > a { border-bottom-color: var(--terre); }

.bascule {
  display: none;
  font-family: var(--util);
  font-size: 0.9rem;
  background: none;
  border: 1px solid var(--trait);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  color: var(--encre);
  cursor: pointer;
}

@media (max-width: 720px) {
  .bascule { display: block; }
  .nav { flex-basis: 100%; display: none; }
  .nav.est-ouvert { display: block; }
  .nav ul { flex-direction: column; gap: 0.6rem; padding-top: 1rem; }
}

/* ------------------------------------------------------------------
   6. Une : l'incipit
------------------------------------------------------------------ */
.une {
  position: relative;
  padding-block: clamp(3rem, 8vw, 6rem);
  overflow: hidden;
}

.une::before {
  content: "";
  position: absolute;
  inset: auto -12% -45% auto;
  width: min(38rem, 80vw);
  aspect-ratio: 1;
  background: var(--rose-fonce);
  border-radius: 50%;
  opacity: 0.55;
  z-index: 0;
}

.une > * { position: relative; z-index: 1; }

.une__titre {
  font-size: clamp(2.6rem, 7.5vw, 5rem);
  margin-block: 0.35em 0.5em;
  max-width: 16ch;
}
.une__titre a { color: inherit; text-decoration: none; }
.une__titre a:hover { color: var(--terre); }

.incipit {
  max-width: 42ch;
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.72;
  color: var(--encre);
}

.incipit::first-letter {
  font-family: var(--titre);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 600;
  font-size: 3.6em;
  line-height: 0.78;
  float: left;
  margin: 0.06em 0.1em 0 0;
  color: var(--terre);
}

.bouton {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--util);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  background: var(--terre);
  color: var(--papier);
  text-decoration: none;
  border: 1px solid var(--terre);
  transition: background 0.18s ease, color 0.18s ease;
}
.bouton:hover { background: transparent; color: var(--terre); }

.bouton--fantome { background: transparent; color: var(--terre); }
.bouton--fantome:hover { background: var(--terre); color: var(--papier); }

/* ------------------------------------------------------------------
   7. Sommaire (listes de nouvelles)
------------------------------------------------------------------ */
.sommaire__entete {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--trait);
  padding-bottom: 1rem;
  margin-bottom: 0.5rem;
}
.sommaire__entete h2 { margin: 0; }

.liste { list-style: none; margin: 0; padding: 0; }

.entree {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding-block: 1.9rem;
  border-bottom: 1px solid var(--trait);
  align-items: start;
}

.entree__date {
  font-family: var(--util);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--encre-douce);
  padding-top: 0.55rem;
}

.entree__titre {
  font-size: clamp(1.45rem, 2.6vw, 1.95rem);
  margin: 0 0 0.35rem;
}
.entree__titre a { color: inherit; text-decoration: none; }
.entree__titre a:hover { color: var(--terre); }

.entree__extrait { margin: 0 0 0.7rem; color: var(--encre-douce); max-width: 58ch; }

@media (max-width: 620px) {
  .entree { grid-template-columns: 1fr; gap: 0.5rem; }
  .entree__date { padding-top: 0; }
}

/* ------------------------------------------------------------------
   8. Article
------------------------------------------------------------------ */
.article { padding-block: clamp(2.5rem, 6vw, 4.5rem); }

.article__entete { text-align: center; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.article__entete h1 { margin-bottom: 0.4em; }
.article__meta { display: flex; justify-content: center; gap: 1.2rem; flex-wrap: wrap; }

.texte { font-size: 1.13rem; line-height: 1.8; }
.texte p { margin: 0 0 1.5em; }
.texte > p:first-of-type::first-letter {
  font-family: var(--titre);
  font-variation-settings: "SOFT" 100, "WONK" 1;
  font-weight: 600;
  font-size: 3.7em;
  line-height: 0.78;
  float: left;
  margin: 0.06em 0.1em 0 0;
  color: var(--terre);
}
.texte h2, .texte h3 { margin-top: 2em; }
.texte blockquote {
  margin: 2em 0;
  padding-left: 1.4rem;
  border-left: 2px solid var(--terre-clair);
  font-style: italic;
  color: var(--encre-douce);
}
.texte hr {
  border: 0;
  margin: 3rem auto;
  width: 5rem;
  height: 1px;
  background: var(--trait);
  position: relative;
}
.texte hr::after {
  content: "❧";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--papier);
  padding: 0 0.6rem;
  color: var(--terre-clair);
  font-size: 1rem;
}
.texte img, .texte figure { margin-block: 2rem; }
.texte figcaption { font-family: var(--util); font-size: 0.82rem; color: var(--encre-douce); text-align: center; margin-top: 0.5rem; }
.texte ul, .texte ol { padding-left: 1.3rem; }

/* Plume de progression : signature */
.plume {
  position: fixed;
  top: 50%;
  right: clamp(1rem, 3vw, 3rem);
  transform: translateY(-50%);
  width: 46px;
  z-index: 20;
  pointer-events: none;
}
.plume svg { width: 100%; height: auto; overflow: visible; }
.plume__trait { fill: none; stroke: var(--trait); stroke-width: 3; }
.plume__encre { fill: none; stroke: var(--terre); stroke-width: 3; }
.plume__masque rect { transition: none; }
.plume__legende {
  display: block;
  text-align: center;
  font-family: var(--util);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--encre-douce);
  margin-top: 0.5rem;
}

.jauge {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: var(--terre);
  z-index: 30;
  display: none;
}

@media (max-width: 1180px) {
  .plume { display: none; }
  .jauge { display: block; }
}

/* Pied d'article */
.soutien {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding: clamp(1.75rem, 4vw, 2.5rem);
  background: var(--rose);
  border-radius: 22px;
  text-align: center;
}
.soutien h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.soutien p { margin: 0 auto 1.4rem; max-width: 46ch; color: var(--encre-douce); }

.voisines {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--trait);
}
.voisines a { text-decoration: none; color: inherit; display: block; }
.voisines a:hover .voisines__titre { color: var(--terre); }
.voisines__titre { font-family: var(--titre); font-variation-settings: var(--wonk); font-size: 1.15rem; font-weight: 600; margin-top: 0.3rem; }
.voisines__suivante { text-align: right; }
@media (max-width: 620px) {
  .voisines { grid-template-columns: 1fr; }
  .voisines__suivante { text-align: left; }
}

/* ------------------------------------------------------------------
   9. Bandeau atelier + pied de page
------------------------------------------------------------------ */
.atelier { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (max-width: 800px) { .atelier { grid-template-columns: 1fr; } }
.atelier__illu { max-width: 260px; margin-inline: auto; }

.pied {
  border-top: 1px solid var(--trait);
  padding-block: 2.5rem;
  font-family: var(--util);
  font-size: 0.88rem;
  color: var(--encre-douce);
}
.pied__grille { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; align-items: center; }
.pied a { color: var(--encre-douce); }
.pied ul { display: flex; gap: 1.25rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }

/* ------------------------------------------------------------------
   10. Pagination, recherche, commentaires
------------------------------------------------------------------ */
.pagination { margin-top: 3rem; font-family: var(--util); font-size: 0.95rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.pagination .page-numbers {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--trait);
  border-radius: 999px;
  text-decoration: none;
  color: var(--encre);
}
.pagination .current { background: var(--terre); color: var(--papier); border-color: var(--terre); }

.recherche { display: flex; gap: 0.5rem; }
.recherche input[type="search"] {
  flex: 1;
  font-family: var(--util);
  font-size: 1rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--trait);
  border-radius: 999px;
  background: var(--papier);
  color: var(--encre);
}
.recherche button {
  font-family: var(--util);
  font-weight: 600;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.3rem;
  background: var(--encre);
  color: var(--papier);
  cursor: pointer;
}

.commentaires { margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--trait); }
.commentaires ol { list-style: none; padding: 0; }
.commentaires .comment-body { padding-block: 1.25rem; border-bottom: 1px solid var(--trait); }
.commentaires .comment-author { font-family: var(--util); font-weight: 600; font-size: 0.95rem; }
.commentaires .comment-meta { font-family: var(--util); font-size: 0.8rem; color: var(--encre-douce); }
.commentaires input[type="text"], .commentaires input[type="email"], .commentaires input[type="url"], .commentaires textarea {
  width: 100%;
  font-family: var(--serif);
  font-size: 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--trait);
  border-radius: 12px;
  background: var(--papier);
  color: var(--encre);
}
.commentaires .form-submit input {
  font-family: var(--util);
  font-weight: 600;
  background: var(--terre);
  color: var(--papier);
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.6rem;
  cursor: pointer;
}

/* ------------------------------------------------------------------
   11. Blocs WordPress
------------------------------------------------------------------ */
.texte .wp-block-image img { border-radius: 14px; }
.texte .wp-block-pullquote { border-block: 1px solid var(--trait); padding-block: 1.5rem; text-align: center; }
.texte .wp-block-separator { max-width: 5rem; }
.alignwide { width: min(100vw - 2 * var(--pas), 52rem); margin-inline: auto; }
.alignfull { width: 100vw; margin-left: 50%; transform: translateX(-50%); max-width: none; }
.alignleft { float: left; margin: 0.4rem 1.6rem 1rem 0; }
.alignright { float: right; margin: 0.4rem 0 1rem 1.6rem; }
.aligncenter { margin-inline: auto; }
