:root {
  --paper: #f4efe6;
  --paper-2: #ebe3d5;
  --ink: #16202e;
  --text: #2a2723;
  --muted: #857a6c;
  --line: #d9cfbf;
  --accent: #d0573c;
  --accent-dark: #a9412a;
  --display: Fraunces, Georgia, serif;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--text); font: 19px/1.75 var(--serif);
  background-color: var(--paper);
  /* grain de papier */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.3 0 0 0 0 0.25 0 0 0 0 0.2 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: #f3c6b9; }
a { color: var(--accent-dark); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; }

/* ---------- En-tête ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff; text-align: center;
  padding: clamp(3.5rem, 10vw, 7rem) 1.25rem clamp(3rem, 8vw, 5.5rem);
  background:
    radial-gradient(ellipse at 15% 0%, rgba(208, 87, 60, .35), transparent 55%),
    radial-gradient(ellipse at 90% 100%, rgba(80, 120, 170, .35), transparent 55%),
    linear-gradient(rgba(20, 28, 40, .55), rgba(20, 28, 40, .55)),
    url(assets/banniere.jpeg) center / cover,
    var(--ink);
}
/* grand point d'interrogation en filigrane */
.hero::before {
  content: "?"; position: absolute; right: -2%; top: 50%; transform: translateY(-50%) rotate(12deg);
  font: italic 700 clamp(18rem, 40vw, 34rem)/1 var(--display); color: rgba(255, 255, 255, .04); pointer-events: none;
}
/* bord déchiré */
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 18px;
  background: var(--paper);
  -webkit-mask: radial-gradient(12px 10px at 50% 100%, #000 98%, transparent) 0 0 / 24px 18px repeat-x;
          mask: radial-gradient(12px 10px at 50% 100%, #000 98%, transparent) 0 0 / 24px 18px repeat-x;
}
.hero__brand { position: relative; color: inherit; text-decoration: none; display: inline-flex; flex-direction: column; align-items: center; gap: .8rem; }
.hero__title { font: italic 500 clamp(2.6rem, 8vw, 5.4rem)/1 var(--display); letter-spacing: -.02em; font-variation-settings: "opsz" 144; }
.hero__q { display: inline-block; color: var(--accent); font-style: normal; font-weight: 700; transform: rotate(-8deg) translateY(-.15em); transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.hero__brand:hover .hero__q { transform: rotate(10deg) translateY(-.25em) scale(1.08); }
.hero__sub { font: 600 .78rem var(--sans); letter-spacing: .35em; text-transform: uppercase; color: #aab6c8; padding-left: .35em; }
.hero__sub::before, .hero__sub::after { content: "—"; margin: 0 .8em; color: var(--accent); }
.hero__admin { position: absolute; top: 1rem; right: 1.25rem; font: 500 .8rem var(--sans); color: #fff; background: rgba(255, 255, 255, .1); padding: .35rem .8rem; border-radius: 99px; text-decoration: none; }
.hero__admin:hover { background: var(--accent); }
.hero--small { padding: 2.2rem 1.25rem 2.6rem; }
.hero--small .hero__title { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.hero--small::before { font-size: 16rem; }

/* barre de lecture */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); z-index: 10; }

main { max-width: 1140px; margin: 0 auto; padding: 0 1.25rem 4rem; }

/* ---------- Notes ---------- */
.post { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.post__title { font-size: clamp(2rem, 4.6vw, 3.2rem); margin: .6rem 0 .5rem; letter-spacing: -.015em; font-variation-settings: "opsz" 144; display: flex; align-items: baseline; gap: .35em; flex-wrap: wrap; }
.post__title a { color: inherit; text-decoration: none; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat; transition: background-size .35s; }
.post__title a:hover { background-size: 100% 2px; }
.post__num { font: italic 700 1.5em/1 var(--display); color: transparent; -webkit-text-stroke: 1.5px var(--accent); }
.post__date { font: 500 .78rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 2rem; }
.post__date::before { content: ""; display: inline-block; width: 2rem; height: 1px; background: var(--accent); vertical-align: middle; margin-right: .7rem; }

.post__body { max-width: 66ch; }
.post__body > p:first-child::first-letter { float: left; font: 600 4.4em/.8 var(--display); color: var(--accent); margin: .08em .1em 0 0; }
.post__body h2 { font-size: 1.6rem; margin: 2.2rem 0 .6rem; }
.post__body h3 { font-size: 1.3rem; margin: 1.8rem 0 .5rem; }
.post__body blockquote { margin: 2rem 0; padding: .2rem 0 .2rem 1.4rem; border-left: 3px solid var(--accent); font: italic 1.25em/1.5 var(--display); color: var(--ink); }
.post__body a { text-decoration-color: var(--accent); text-underline-offset: 3px; }
.post__body strong { color: var(--ink); }
.post__body li { margin: .3rem 0; }

/* photo scotchée */
.post__photo { position: sticky; top: 2rem; display: block; background: #fff; padding: 12px 12px 40px; box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 14px 30px -12px rgba(40, 30, 20, .35); transform: rotate(2deg); transition: transform .4s; }
.post__photo::before { content: ""; position: absolute; top: -14px; left: 50%; width: 110px; height: 30px; transform: translateX(-50%) rotate(-3deg); background: rgba(240, 225, 190, .75); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.post__photo:hover { transform: rotate(0) scale(1.01); }

.pill { display: inline-block; font: 600 .72rem var(--sans); letter-spacing: .12em; text-transform: uppercase; background: var(--accent); color: #fff; padding: .35rem .8rem; border-radius: 99px; text-decoration: none; }
.pill--admin { background: var(--ink); }

/* notes précédentes : image à droite / à gauche en alternance */
.section-title { display: flex; align-items: center; gap: 1rem; font: italic 500 1.5rem var(--display); color: var(--muted); margin: 2rem 0 0; }
.section-title::before, .section-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.post--short { grid-template-columns: minmax(0, 1fr) 260px; padding: 3rem 0; border-bottom: 1px dashed var(--line); }
.post--short:nth-of-type(odd) { grid-template-columns: 260px minmax(0, 1fr); }
.post--short:nth-of-type(odd) .post__photo { order: -1; transform: rotate(-2.5deg); }
.post--short .post__photo { position: static; padding-bottom: 28px; }
.post--short .post__photo img { aspect-ratio: 1; object-fit: cover; }
.post--short .post__title { font-size: clamp(1.6rem, 3vw, 2.1rem); }
.post--short .post__date { margin-bottom: 1rem; }
.post__excerpt { color: #4a443d; }
.more { font: 600 .9rem var(--sans); color: var(--accent-dark); text-decoration: none; }
.more::after { content: " →"; display: inline-block; transition: transform .2s; }
.more:hover::after { transform: translateX(4px); }
.muted { color: var(--muted); font-family: var(--sans); font-size: .85rem; }
.small { font-size: .8rem; }
.empty { padding: 4rem 0; text-align: center; color: var(--muted); }

/* navigation entre notes */
.neighbours { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding: 2rem 0; border-top: 1px solid var(--line); }
.neighbours a { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); font: 600 1.15rem/1.3 var(--display); padding: 1rem 1.2rem; border-radius: 10px; transition: background .2s; }
.neighbours a:hover { background: var(--paper-2); }
.neighbours small { font: 600 .72rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: .3rem; }
.neighbours__next { text-align: right; grid-column: 2; }

/* encart newsletter */
.subscribe { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; background: var(--ink); color: #dfe5ee; border-radius: 18px; padding: clamp(1.5rem, 4vw, 2.8rem); margin: 2rem 0 3rem; position: relative; overflow: hidden; }
.subscribe::before { content: "✉"; position: absolute; right: -1rem; bottom: -3.5rem; font-size: 12rem; color: rgba(255, 255, 255, .04); transform: rotate(-12deg); }
.subscribe h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 .5rem; font-style: italic; }
.subscribe p { margin: 0; font-size: 1rem; color: #aab6c8; }
.subscribe__form { position: relative; display: flex; flex-wrap: wrap; gap: .6rem; font-family: var(--sans); }
.subscribe__form > input[type=email] { flex: 1 1 100%; }
.subscribe__form label { color: #aab6c8; font-size: .85rem; flex-direction: row; align-items: center; gap: .6rem; flex: 1; }
.subscribe__form label input { width: 4.5rem; }
.subscribe__form input { border-color: transparent; }

/* ---------- Commentaires ---------- */
.comments { max-width: 760px; margin: 0 auto; }
.comments > .section-title { margin-bottom: 1.5rem; }
.comment { display: flex; gap: 1rem; margin: 1.4rem 0; }
.avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font: 600 1.1rem var(--display); color: #fff; background: hsl(var(--hue), 45%, 45%); }
.comment__content { flex: 1; min-width: 0; background: #fffdf8; border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: .8rem 1.1rem; }
.comment__content p { margin: .3rem 0; font-size: 1.02rem; line-height: 1.6; }
.comment--pending .comment__content { background: #fff6dc; border-color: #ecd593; }
.comment__meta { font: .82rem var(--sans) !important; color: var(--muted); }
.comment__meta strong { color: var(--ink); }
.comment__actions { display: flex; gap: .4rem; margin-top: .5rem; }
.badge { background: #d9a520; color: #fff; border-radius: 99px; padding: .05em .6em; font-size: .72rem; }
.comment-form { background: var(--paper-2); border-radius: 18px; padding: clamp(1.25rem, 4vw, 2rem); margin-top: 2.5rem; }
.comment-form h3 { margin: 0 0 1rem; font-size: 1.5rem; font-style: italic; }

/* ---------- Formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 1rem; font-family: var(--sans); }
.form label { display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; font-weight: 500; }
input, textarea { font: inherit; font-size: 1rem; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); width: 100%; }
textarea { font-family: var(--serif); line-height: 1.6; resize: vertical; }
input.small { max-width: 8rem; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hp { position: absolute; left: -9999px; }
.btn { display: inline-block; font: 600 .92rem var(--sans); padding: .7rem 1.3rem; border: 1px solid var(--line); border-radius: 99px; background: #fff; color: var(--text); cursor: pointer; text-decoration: none; transition: transform .15s, background .2s; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; align-self: flex-start; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.small { padding: .3rem .8rem; font-size: .78rem; }
.btn.danger { color: #b3361f; }
form.inline { display: inline; }
.flash, .error { font: .95rem var(--sans); padding: .8rem 1.1rem; border-radius: 10px; margin: 2rem 0 0; }
.flash { background: #e1efe6; color: #2f6b4f; }
.error { background: #f8e2dc; color: #a33a2c; margin: 0 0 1rem; }
.narrow { max-width: 640px; margin: 0 auto; padding: 3rem 0; }
.page-title { font-size: clamp(2.2rem, 5vw, 3rem); font-style: italic; margin: 0 0 1rem; }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--ink); color: #8794a8; text-align: center; padding: 2.5rem 1.25rem; font: .85rem var(--sans); display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.site-footer__q { font: italic 700 2rem var(--display); color: var(--accent); }

/* apparition douce au défilement */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s, transform .7s; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Tablette ---------- */
@media (max-width: 1000px) {
  .post { grid-template-columns: minmax(0, 1fr) 250px; }
  .post--short, .post--short:nth-of-type(odd) { grid-template-columns: minmax(0, 1fr) 200px; }
  .post--short:nth-of-type(odd) .post__photo { order: 0; }
  .subscribe { grid-template-columns: 1fr; }
}

/* ---------- Téléphone : photo au-dessus du texte ---------- */
@media (max-width: 700px) {
  body { font-size: 17px; }
  .post, .post--short, .post--short:nth-of-type(odd) { grid-template-columns: 1fr; gap: 1.8rem; }
  .post__photo, .post--short:nth-of-type(odd) .post__photo { order: -1; position: static; width: 82%; margin: 1rem auto 0; transform: rotate(-1.5deg); }
  .post__photo img { max-height: 46vh; width: 100%; object-fit: cover; }
  .post--short .post__photo { width: 70%; }
  .hero__admin { position: static; display: inline-block; margin-top: 1.2rem; }
  .neighbours { grid-template-columns: 1fr; }
  .neighbours__next { grid-column: 1; }
  .comment { gap: .7rem; }
  .avatar { width: 36px; height: 36px; font-size: .95rem; }
}
