/*
Theme Name: Monsieur Rowli
Theme URI: https://monsieurrowli.fr
Author: Monsieur Rowli
Description: Univers éditorial personnel — thème sombre, éditorial et premium. Custom Post Types Livres et Tests, catégorie Écrits, emblème renard et signature « Depuis la lisière ».
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: monsieur-rowli
Tags: blog, portfolio, editorial, dark, custom-post-types
*/

/* ------------------------------------------------------------------
   1. Tokens
------------------------------------------------------------------ */
:root {
  --ink: #16130f;
  --ink-raised: #211d18;
  --paper: #ece7de;
  --copper: #c1662a;
  --copper-soft: #d99257;
  --muted: #9a9088;
  --border: rgba(236, 231, 222, 0.14);
  --radius: 2px;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-sans: "Archivo", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --wrap: 1240px;
  --read: 720px;
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4, blockquote {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.015em;
  margin: 0;
  line-height: 1.08;
}

p { margin: 0; }

::selection { background: var(--copper); color: var(--ink); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-inline: 24px; }
.read { max-width: var(--read); margin: 0 auto; padding-inline: 24px; }
.hairline { border-top: 1px solid var(--border); }
.muted { color: var(--muted); }
.italic { font-style: italic; }
.center { text-align: center; }

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

.skip-link:focus {
  position: fixed; top: 12px; left: 12px; z-index: 999;
  background: var(--copper); color: var(--ink); padding: 10px 16px;
}

:focus-visible { outline: 1px solid var(--copper); outline-offset: 3px; }

.eyebrow {
  font-size: 0.688rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow .num { color: var(--copper); margin-right: 12px; }

.link-rule {
  background-image: linear-gradient(var(--copper), var(--copper));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size .45s cubic-bezier(.2,.7,.2,1), color .3s;
  padding-bottom: 2px;
}
.link-rule:hover { background-size: 100% 1px; color: var(--paper); }

.tag {
  display: inline-block;
  border: 1px solid var(--border);
  padding: 4px 10px;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.meta-line {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.meta-line .rule { width: 32px; height: 1px; background: var(--copper); }

.btn-copper {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(193, 102, 42, .55);
  padding: 8px 14px;
  font-size: 0.68rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--copper-soft);
  transition: background-color .3s, color .3s;
}
.btn-copper:hover { background: var(--copper); color: var(--ink); }

/* ------------------------------------------------------------------
   3. Fox emblem & signature
------------------------------------------------------------------ */
.fox { display: inline-block; color: var(--copper); }
.fox svg { display: block; width: 100%; height: 100%; }

.fox-divider { display: flex; align-items: center; gap: 24px; }
.fox-divider .rule { flex: 1; height: 1px; background: var(--border); }
.fox-divider .fox { opacity: .7; }

.fox-watermark {
  position: absolute;
  opacity: .045;
  pointer-events: none;
  color: var(--copper);
}

.signature { display: flex; align-items: center; gap: 16px; }
.signature .rule { width: 40px; height: 1px; background: var(--copper); }
.signature span {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--copper-soft);
}

/* ------------------------------------------------------------------
   4. Header
------------------------------------------------------------------ */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color .5s, border-color .5s;
}
.site-header.is-scrolled {
  background: rgba(22, 19, 15, .92);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--border);
}
.site-header .bar {
  height: 80px; display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .name { font-family: var(--font-display); font-size: 1.125rem; }
.brand .name em { font-style: italic; }

.main-nav ul { display: flex; gap: 36px; list-style: none; margin: 0; padding: 0; }
.main-nav a { font-size: 0.875rem; color: var(--muted); }
.main-nav a:hover,
.main-nav .current-menu-item > a { color: var(--paper); }

.menu-toggle {
  display: none; background: none; border: 0; color: var(--paper);
  padding: 8px; cursor: pointer;
}
.mobile-nav { display: none; }

@media (max-width: 860px) {
  .main-nav { display: none; }
  .menu-toggle { display: block; }
  .mobile-nav.is-open {
    display: block;
    position: fixed; inset: 80px 0 0 0; z-index: 40;
    background: var(--ink); padding: 24px;
    overflow-y: auto;
  }
  .mobile-nav ul { list-style: none; margin: 0; padding: 0; }
  .mobile-nav li { border-top: 1px solid var(--border); }
  .mobile-nav a { display: block; padding: 20px 0; font-family: var(--font-display); font-size: 1.75rem; }
}

/* ------------------------------------------------------------------
   5. Hero & page headers
------------------------------------------------------------------ */
.hero { position: relative; min-height: 92vh; display: flex; align-items: flex-end; overflow: hidden; }
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; opacity: .5; }
.hero__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, var(--ink) 6%, rgba(22,19,15,.55) 55%, rgba(22,19,15,.8));
}
.hero__inner { position: relative; padding-block: 140px 88px; }
.hero h1 { font-size: clamp(3.2rem, 11vw, 8.5rem); line-height: .95; }
.hero h1 em { font-style: italic; }
.hero__baseline { margin-top: 32px; max-width: 34rem; color: var(--muted); line-height: 1.75; }
.hero__baseline strong { color: var(--paper); font-weight: 400; font-family: var(--font-display); font-style: italic; }

.page-header { padding-block: 160px 56px; }
.page-header h1 { font-size: clamp(2.8rem, 7vw, 4.5rem); max-width: 22ch; margin-top: 20px; }
.page-header p { margin-top: 28px; max-width: 34rem; color: var(--muted); line-height: 1.75; }

/* ------------------------------------------------------------------
   6. Section headings
------------------------------------------------------------------ */
.section { padding-block: 72px; position: relative; }
.section-heading {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px;
}
.section-heading h2 { margin-top: 12px; font-size: clamp(1.85rem, 4vw, 2.6rem); }
.section-heading .note { margin-top: 12px; font-family: var(--font-display); font-style: italic; color: var(--muted); max-width: 28rem; }

/* ------------------------------------------------------------------
   7. « En ce moment » — asymmetric grid
------------------------------------------------------------------ */
.now-grid { display: grid; gap: 48px; margin-top: 48px; }
@media (min-width: 900px) {
  .now-grid { grid-template-columns: 1.35fr 1fr; }
  .now-grid .now-side { display: grid; gap: 48px; align-content: start; }
}
.now-card h3 { font-size: 1.9rem; margin-top: 16px; transition: color .3s; }
.now-card:hover h3 { color: var(--copper-soft); }
.now-card p { margin-top: 14px; color: var(--muted); }
.now-card figure { margin: 0 0 20px; overflow: hidden; background: var(--ink-raised); }
.now-card figure img { transition: transform 1.2s cubic-bezier(.2,.7,.2,1); width: 100%; }
.now-card:hover figure img { transform: scale(1.04); }

/* ------------------------------------------------------------------
   8. Livres
------------------------------------------------------------------ */
.book-grid { display: grid; gap: 56px 40px; margin-top: 56px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.book figure { margin: 0; overflow: hidden; background: var(--ink-raised); }
.book figure img { aspect-ratio: 2/3; object-fit: cover; width: 100%; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.book:hover figure img { transform: scale(1.045); }
.book h3 { margin-top: 20px; font-size: 1.5rem; transition: color .3s; }
.book:hover h3 { color: var(--copper-soft); }
.book .book-meta { margin-top: 8px; }

.book-list .book-row {
  border-top: 1px solid var(--border);
  padding-block: 48px;
  display: grid; gap: 32px;
}
@media (min-width: 760px) { .book-list .book-row { grid-template-columns: 220px 1fr; } }

.book-single { display: grid; gap: 56px; }
@media (min-width: 900px) { .book-single { grid-template-columns: 320px 1fr; } }
.buy-links { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 10px; }

.spec-list { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 10px; font-size: .875rem; color: var(--muted); }
.spec-list b { color: var(--paper); font-weight: 500; }

/* ------------------------------------------------------------------
   9. Tests (jeux vidéo)
------------------------------------------------------------------ */
.test-row {
  border-top: 1px solid var(--border);
  padding-block: 44px;
  display: grid; gap: 28px; align-items: start;
}
@media (min-width: 860px) { .test-row { grid-template-columns: 280px 1fr auto; } }
.test-row figure { margin: 0; overflow: hidden; background: var(--ink-raised); }
.test-row figure img { aspect-ratio: 16/10; object-fit: cover; width: 100%; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.test-row:hover figure img { transform: scale(1.04); }
.test-row h3 { font-size: 1.9rem; margin-top: 14px; transition: color .3s; }
.test-row a:hover h3 { color: var(--copper-soft); }
.test-row .chapo { margin-top: 12px; color: var(--muted); max-width: 40rem; }

.score { text-align: right; font-family: var(--font-display); line-height: 1; }
.score .value { font-size: 3.4rem; color: var(--copper); }
.score .max { font-size: 1rem; color: var(--muted); }
.score .label { display: block; margin-top: 8px; font-family: var(--font-sans); font-size: .625rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }

.published-box {
  border: 1px solid var(--border);
  padding: 24px;
  margin-block: 40px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}
.published-box .who { font-family: var(--font-display); font-size: 1.25rem; font-style: italic; }

/* ------------------------------------------------------------------
   10. Écrits & article
------------------------------------------------------------------ */
.entry-list .entry-row { border-top: 1px solid var(--border); padding-block: 56px; display: block; }
.entry-list h2 { margin-top: 20px; font-size: clamp(2rem, 4.5vw, 3rem); transition: color .3s; }
.entry-list .entry-row:hover h2 { color: var(--copper-soft); }
.entry-list .sub { margin-top: 12px; font-family: var(--font-display); font-style: italic; color: var(--muted); }
.entry-list .chapo { margin-top: 24px; max-width: 42rem; color: var(--muted); }
.entry-list blockquote { margin: 32px 0 0; border-left: 1px solid var(--copper); padding-left: 20px; font-size: 1.25rem; font-style: italic; }

.article-header { padding-block: 150px 40px; text-align: left; }
.article-header h1 { font-size: clamp(2.6rem, 6.5vw, 4.4rem); margin-top: 24px; }
.article-header .chapo { margin-top: 28px; font-family: var(--font-display); font-size: 1.35rem; font-style: italic; line-height: 1.5; color: rgba(236,231,222,.85); }
.article-figure { margin: 48px auto 0; max-width: var(--wrap); padding-inline: 24px; }
.article-figure img { width: 100%; }
.article-figure figcaption { margin-top: 12px; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.entry-content {
  color: rgba(236, 231, 222, .88);
  font-size: 1.0625rem;
  line-height: 1.85;
}
.entry-content > * { margin-block: 1.5em; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content h2 { font-size: 1.75rem; margin-top: 2.4em; margin-bottom: .7em; color: var(--paper); }
.entry-content h3 { font-size: 1.3rem; margin-top: 2em; margin-bottom: .6em; color: var(--paper); }
.entry-content blockquote {
  border-left: 1px solid var(--copper);
  padding-left: 24px;
  font-size: 1.4rem; line-height: 1.5; font-style: italic; color: var(--paper);
  margin-block: 2em;
}
.entry-content a { color: var(--copper-soft); text-decoration: underline; text-underline-offset: 3px; }
.entry-content ul { list-style: none; padding-left: 20px; }
.entry-content ul li { position: relative; margin-block: .6em; }
.entry-content ul li::before {
  content: ""; position: absolute; left: -20px; top: .75em;
  width: 6px; height: 1px; background: var(--copper);
}
.entry-content ol { padding-left: 20px; }
.entry-content img { margin-inline: auto; }

.pull-quote {
  margin-block: 56px;
  border-left: 1px solid var(--copper);
  padding-left: 24px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 1.9rem);
  font-style: italic; line-height: 1.35;
}

.related { display: grid; gap: 32px; margin-top: 40px; }
@media (min-width: 760px) { .related { grid-template-columns: repeat(3, 1fr); } }
.related a { display: block; border-top: 1px solid var(--border); padding-top: 20px; }
.related h3 { margin-top: 12px; font-size: 1.25rem; transition: color .3s; }
.related a:hover h3 { color: var(--copper-soft); }

/* ------------------------------------------------------------------
   11. Archives filter, pagination, 404, search
------------------------------------------------------------------ */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.filter-bar a { border: 1px solid var(--border); padding: 6px 14px; font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); transition: color .3s, border-color .3s; }
.filter-bar a:hover, .filter-bar a[aria-current="page"] { color: var(--copper-soft); border-color: rgba(193,102,42,.5); }

.pagination { margin-top: 64px; display: flex; gap: 12px; flex-wrap: wrap; font-size: .8rem; letter-spacing: .12em; }
.pagination .page-numbers { border: 1px solid var(--border); padding: 8px 14px; color: var(--muted); }
.pagination .current, .pagination a:hover { color: var(--copper-soft); border-color: rgba(193,102,42,.5); }

.search-form { display: flex; gap: 12px; margin-top: 28px; max-width: 520px; }
.search-form input[type="search"] {
  flex: 1; background: transparent; border: 0; border-bottom: 1px solid var(--border);
  color: var(--paper); font-family: var(--font-sans); font-size: 1rem; padding: 10px 2px;
}
.search-form input[type="search"]::placeholder { color: var(--muted); }
.search-form button { background: none; border: 0; color: var(--copper-soft); cursor: pointer; letter-spacing: .16em; text-transform: uppercase; font-size: .7rem; }

/* ------------------------------------------------------------------
   12. Footer
------------------------------------------------------------------ */
.site-footer { border-top: 1px solid var(--border); margin-top: 128px; }
.site-footer .cols { display: grid; gap: 48px; padding-block: 64px; }
@media (min-width: 860px) { .site-footer .cols { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer ul { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 12px; }
.site-footer a { font-size: .875rem; color: var(--muted); }
.site-footer a:hover { color: var(--paper); }
.site-footer .colophon {
  border-top: 1px solid var(--border);
  padding-block: 24px 40px;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  font-size: .75rem; color: var(--muted);
}

/* ------------------------------------------------------------------
   13. Motion
------------------------------------------------------------------ */
.fade-up { animation: fade-up .9s cubic-bezier(.16,1,.3,1) both; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

/* WordPress core alignment classes */
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { margin-inline: auto; }
.alignwide, .alignfull { max-width: none; }
.wp-caption-text, .wp-element-caption { font-size: .75rem; color: var(--muted); }
.sticky, .gallery-caption, .bypostauthor { display: block; }
