/*
Theme Name: 3427 Édition
Theme URI: https://3427.fr/
Author: 3427 Édition
Description: Thème bloc éditorial sur mesure pour 3427 Édition, inspiré de la sobriété des thèmes WordPress Twenty Twenty-Five. Catalogue, textes gratuits, traductions, téléchargements et futures ventes.
Version: 0.10.0
Template: twentytwentyfive
Requires at least: 6.7
Tested up to: 6.8
Requires PHP: 8.0
Text Domain: edition3427
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
  --c-bg: #f4f1ea;
  --c-bg-soft: #ebe7df;
  --c-ink: #171c23;
  --c-muted: #6f706e;
  --c-line: #c9c5bd;
  --c-paper: #fbfaf6;
  --c-accent: #9d6247;
  --c-white: #fff;
  --font-display: "Arial Narrow", "Helvetica Neue Condensed", "Roboto Condensed", Impact, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --content: 1180px;
  --wide: 1320px;
  --shadow: 0 22px 45px rgba(18, 24, 31, .16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.55;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--c-accent); }
img { max-width: 100%; height: auto; }

.wp-site-blocks { padding: 0; }
.wp-block-post-content { margin-top: 0; }

/* --- Layout helpers --- */
.ed-wrap { width: min(calc(100% - 48px), var(--wide)); margin-inline: auto; }
.ed-section { padding: clamp(56px, 7vw, 104px) 0; border-top: 1px solid var(--c-line); }
.ed-kicker {
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: .69rem;
  font-weight: 650;
  color: var(--c-muted);
  margin: 0 0 10px;
}
.ed-display,
.ed-section h2,
.ed-section h1 {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: -.025em;
  font-stretch: condensed;
  line-height: .92;
  margin: 0;
}
.ed-section h2 { font-size: clamp(2.7rem, 6vw, 5.8rem); }
.ed-meta { font-family: var(--font-sans); font-size: .78rem; color: var(--c-muted); }
.ed-rule { height: 1px; background: var(--c-line); border: 0; margin: 28px 0; }

/* --- Header --- */
.ed-header {
  border-bottom: 1px solid var(--c-line);
  background: rgba(244, 241, 234, .96);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
}
.ed-header-inner {
  width: min(calc(100% - 48px), var(--wide));
  min-height: 104px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 28px;
  align-items: center;
}
.ed-brand { display: inline-flex; flex-direction: column; gap: 6px; text-decoration: none; width: fit-content; }
.ed-brand img { width: 116px; image-rendering: auto; }
.ed-brand small {
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .54rem;
  color: var(--c-muted);
}
.ed-nav { display: flex; justify-content: center; gap: clamp(20px, 3.4vw, 54px); font-family: var(--font-serif); font-size: .92rem; }
.ed-nav a { text-decoration: none; }
.ed-header-cta, .ed-button {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  background: var(--c-ink);
  color: var(--c-paper) !important;
  text-decoration: none;
  border: 1px solid var(--c-ink);
  font-family: var(--font-sans);
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: .02em;
  transition: transform .18s ease, background .18s ease, color .18s ease;
}
.ed-header-cta:hover, .ed-button:hover { background: transparent; color: var(--c-ink) !important; transform: translateY(-1px); }
.ed-button--ghost { background: transparent; color: var(--c-ink) !important; }
.ed-button--ghost:hover { background: var(--c-ink); color: var(--c-paper) !important; }

/* --- Hero --- */
.ed-hero { padding: clamp(56px, 7vw, 92px) 0 68px; }
.ed-hero-grid {
  width: min(calc(100% - 48px), var(--wide));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.05fr .85fr .55fr;
  gap: clamp(36px, 5vw, 80px);
  align-items: center;
}
.ed-hero-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: clamp(4.1rem, 8.2vw, 8.8rem);
  line-height: .82;
  letter-spacing: -.045em;
  margin: 6px 0 18px;
}
.ed-hero-author { font-size: clamp(1.35rem, 2vw, 2rem); margin: 0 0 24px; }
.ed-hero-copy { max-width: 590px; font-size: 1.05rem; }
.ed-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.ed-book-object { perspective: 1400px; padding: 18px; }
.ed-book-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  width: min(100%, 390px);
  margin-inline: auto;
  background:
    linear-gradient(to bottom, rgba(17,31,42,.08), rgba(5,8,12,.34)),
    linear-gradient(175deg, #8ba1a6 0 52%, #cc8f68 53%, #6a463c 57%, #161d23 73%);
  box-shadow: var(--shadow);
  transform: rotateY(-8deg) rotateZ(-1deg);
  border-radius: 2px;
  color: #fff;
  overflow: hidden;
}
.ed-book-cover:before {
  content: "";
  position: absolute;
  left: 50%; bottom: 0;
  width: 3px; height: 44%;
  background: linear-gradient(#f1b562, #f1b562 40%, transparent 41%);
  box-shadow: -22px 0 0 -1px rgba(255,255,255,.5), 22px 0 0 -1px rgba(255,255,255,.5);
  transform: perspective(300px) rotateX(58deg);
  transform-origin: bottom;
}
.ed-book-cover:after {
  content: "";
  position: absolute;
  top: 8px; right: -10px; bottom: 8px;
  width: 12px;
  background: #d8d4c9;
  box-shadow: inset 1px 0 2px rgba(0,0,0,.25);
}
.ed-cover-author { position: absolute; top: 7%; left: 12%; right: 12%; text-align: center; font-family: var(--font-sans); text-transform: uppercase; letter-spacing: .22em; font-size: .54rem; }
.ed-cover-title { position: absolute; top: 22%; left: 0; right: 0; text-align: center; font-family: var(--font-sans); text-transform: uppercase; letter-spacing: .28em; line-height: 1.55; font-size: clamp(1.4rem, 3vw, 2.25rem); }
.ed-cover-mark { position: absolute; bottom: 6%; left: 0; right: 0; text-align: center; font-family: var(--font-display); font-size: .9rem; }
.ed-hero-quote { align-self: stretch; display: flex; flex-direction: column; justify-content: center; border-left: 1px solid var(--c-line); padding-left: 34px; }
.ed-hero-quote blockquote { margin: 0 0 34px; font-size: clamp(1.3rem, 2.1vw, 1.85rem); font-style: italic; line-height: 1.28; }
.ed-hero-quote ul { list-style: none; padding: 0; margin: 0; font-family: var(--font-sans); text-transform: uppercase; letter-spacing: .17em; font-size: .62rem; color: var(--c-muted); }

/* --- Catalog --- */
.ed-heading-row { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 38px; }
.ed-heading-row a { font-size: .86rem; }
.ed-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(18px, 2.2vw, 34px); }
.ed-card { min-width: 0; }
.ed-card a { text-decoration: none; }
.ed-card-cover {
  aspect-ratio: 2 / 3;
  width: 100%;
  background: #d8d6cf;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid rgba(23,28,35,.09);
  box-shadow: 0 10px 25px rgba(23,28,35,.08);
}
.ed-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; filter: saturate(.86); transition: transform .3s ease; }
.ed-card:hover .ed-card-cover img { transform: scale(1.025); }
.ed-card-title { font-size: 1.04rem; line-height: 1.25; margin: 0 0 3px; font-weight: 600; }
.ed-card-author { margin: 0 0 3px; font-size: .85rem; }
.ed-card-type { margin: 0; font-size: .77rem; color: var(--c-muted); font-family: var(--font-sans); }
.ed-card-price { margin: 8px 0 0; font-family: var(--font-sans); font-weight: 750; font-size: .9rem; }
.ed-card-placeholder { height: 100%; display:flex; align-items:center; justify-content:center; background: linear-gradient(145deg,#d9d5ca,#8d9392); color:#fff; text-align:center; padding:20px; font-family:var(--font-display); text-transform:uppercase; font-size:1.4rem; letter-spacing:.04em; }
.ed-empty { padding: 30px; border: 1px dashed var(--c-line); font-family: var(--font-sans); color: var(--c-muted); }

/* --- Free texts --- */
.ed-free-layout { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(40px, 8vw, 120px); align-items: start; }
.ed-free-intro { max-width: 600px; }
.ed-free-list { display: grid; gap: 16px; }
.ed-free-card {
  background: rgba(255,255,255,.28);
  border: 1px solid var(--c-line);
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 22px;
  padding: 16px;
  align-items: center;
}
.ed-free-thumb { aspect-ratio: 4 / 5; background: #d0cfca; overflow: hidden; }
.ed-free-thumb img { width:100%; height:100%; object-fit:cover; filter: grayscale(1); }
.ed-free-downloads { border-left: 1px solid var(--c-line); padding-left: 22px; display: grid; gap: 10px; font-family: var(--font-sans); font-size: .74rem; font-weight: 650; }
.ed-free-downloads a { text-decoration: none; white-space: nowrap; }

/* --- About / Support --- */
.ed-split { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(42px, 8vw, 120px); align-items: start; }
.ed-about-copy { columns: 2; column-gap: 44px; }
.ed-about-copy p:first-child { margin-top: 0; }
.ed-motto { font-family: var(--font-sans); text-transform: uppercase; letter-spacing: .2em; font-size: .64rem; color: var(--c-muted); margin-top: 25px; }
.ed-support { background: rgba(255,255,255,.22); }
.ed-support .ed-split { align-items: center; }
.ed-tip-note { font-family: "Segoe Print", "Bradley Hand", cursive; font-size: 1.2rem; transform: rotate(-3deg); display: inline-block; margin-left: 18px; }

/* --- Single publication --- */
.ed-single { padding: 70px 0 100px; }
.ed-single-grid { width:min(calc(100% - 48px),var(--content)); margin-inline:auto; display:grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: clamp(42px, 8vw, 100px); align-items:start; }
.ed-single-cover img { width:100%; box-shadow:var(--shadow); }
.ed-single-title { font-family:var(--font-display); text-transform:uppercase; font-size:clamp(3.7rem,7vw,7.4rem); line-height:.88; letter-spacing:-.035em; margin:.1em 0 .14em; }
.ed-single-author { font-size:1.35rem; margin:0 0 18px; }
.ed-single-description { font-size:1.08rem; max-width:720px; }
.ed-buybox { margin-top:34px; padding:24px 0; border-top:1px solid var(--c-line); border-bottom:1px solid var(--c-line); display:flex; align-items:center; justify-content:space-between; gap:22px; }
.ed-download-row { display:flex; flex-wrap:wrap; gap:10px; margin-top:22px; }

/* --- Article/page --- */
.ed-prose { width:min(calc(100% - 48px), 820px); margin:70px auto 110px; }
.ed-prose h1 { font-family:var(--font-display); text-transform:uppercase; font-size:clamp(3rem,7vw,6rem); line-height:.9; }
.ed-prose h2 { font-family:var(--font-display); text-transform:uppercase; margin-top:2em; }
.ed-prose p { margin:1.2em 0; }

/* --- Footer --- */
.ed-footer { border-top: 1px solid var(--c-line); padding: 46px 0 30px; }
.ed-footer-grid { width:min(calc(100% - 48px),var(--wide)); margin-inline:auto; display:grid; grid-template-columns: 1fr 1fr 1.2fr; gap:40px; }
.ed-footer img { width:118px; }
.ed-footer p { margin:.3em 0; font-size:.86rem; }
.ed-footer-links { display:grid; gap:4px; font-family:var(--font-sans); font-size:.76rem; }
.ed-footer-links a { text-decoration:none; }
.ed-footer-quote { border-left:1px solid var(--c-line); padding-left:30px; font-style:italic; }
.ed-footer-quote cite { display:block; margin-top:12px; font-style:normal; font-family:var(--font-sans); font-size:.7rem; text-transform:uppercase; letter-spacing:.1em; color:var(--c-muted); }
.ed-copyright { width:min(calc(100% - 48px),var(--wide)); margin:35px auto 0; padding-top:20px; border-top:1px solid var(--c-line); color:var(--c-muted); font-family:var(--font-sans); font-size:.68rem; }

/* --- WP editor/content niceties --- */
.wp-block-button__link { border-radius: 0; }
.wp-block-separator { border-color: var(--c-line); }

@media (max-width: 1100px) {
  .ed-hero-grid { grid-template-columns: 1fr .85fr; }
  .ed-hero-quote { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--c-line); padding: 28px 0 0; display: grid; grid-template-columns: 1fr auto; gap: 30px; }
  .ed-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .ed-header-inner { grid-template-columns: 1fr auto; min-height:88px; }
  .ed-brand small { display:none; }
  .ed-nav { display:none; }
  .ed-hero-grid, .ed-free-layout, .ed-split, .ed-single-grid { grid-template-columns: 1fr; }
  .ed-hero-title { font-size:clamp(4rem,18vw,7rem); }
  .ed-book-object { order:-1; max-width:420px; margin-inline:auto; }
  .ed-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ed-about-copy { columns:1; }
  .ed-free-card { grid-template-columns:80px 1fr; }
  .ed-free-downloads { grid-column:1/-1; border-left:0; border-top:1px solid var(--c-line); padding:14px 0 0; display:flex; }
  .ed-footer-grid { grid-template-columns:1fr; }
  .ed-footer-quote { border-left:0; border-top:1px solid var(--c-line); padding:24px 0 0; }
}
@media (max-width: 520px) {
  body { font-size:17px; }
  .ed-wrap, .ed-header-inner, .ed-hero-grid, .ed-footer-grid, .ed-copyright, .ed-single-grid, .ed-prose { width:min(calc(100% - 28px), var(--wide)); }
  .ed-header-cta { padding:10px 14px; }
  .ed-grid { grid-template-columns: 1fr 1fr; gap:16px 13px; }
  .ed-card-title { font-size:.93rem; }
  .ed-heading-row { align-items:start; flex-direction:column; }
  .ed-hero-quote { grid-template-columns:1fr; }
  .ed-free-card { grid-template-columns: 1fr; }
  .ed-free-thumb { max-width:120px; }
  .ed-tip-note { display:block; margin:16px 0 0; }
}

/* --- Featured publications slider (v0.10) --- */
.ed-featured-slider {
  position: relative;
  overflow: hidden;
  padding-bottom: 28px;
}
.ed-featured-track {
  display: grid;
}
.ed-featured-slide {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(18px);
  transition: opacity .46s ease, transform .46s ease, visibility 0s linear .46s;
}
.ed-featured-slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
  transition-delay: 0s;
  z-index: 2;
}
.ed-featured-copy { min-width: 0; }
.ed-featured-count {
  display: inline-block;
  margin-left: .7em;
  color: var(--c-ink);
  font-variant-numeric: tabular-nums;
}
.ed-featured-subtitle {
  max-width: 620px;
  margin: -6px 0 12px;
  font-size: 1.08rem;
  font-style: italic;
  color: var(--c-muted);
}
.ed-hero-title a {
  color: inherit;
  text-decoration: none;
}
.ed-hero-title a:hover { color: var(--c-ink); }
.ed-hero-copy p { margin: 0; }
.ed-hero-copy p + p { margin-top: .85em; }
.ed-featured-cover {
  display: block;
  width: min(100%, 390px);
  margin-inline: auto;
  aspect-ratio: 2 / 3;
  perspective: 1400px;
  text-decoration: none;
  transform: rotateY(-6deg) rotateZ(-.65deg);
  transform-origin: center;
  transition: transform .28s ease, box-shadow .28s ease;
  box-shadow: var(--shadow);
  background: #d8d6cf;
  overflow: hidden;
}
.ed-featured-cover:hover,
.ed-featured-cover:focus-visible {
  transform: rotateY(-2deg) rotateZ(0deg) translateY(-3px);
  box-shadow: 0 28px 52px rgba(18, 24, 31, .2);
}
.ed-featured-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ed-featured-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10% 11%;
  background:
    linear-gradient(165deg, rgba(255,255,255,.18), transparent 35%),
    linear-gradient(145deg, #777d7c, #1f2930 72%);
  color: #fff;
  font-family: var(--font-sans);
  text-transform: uppercase;
}
.ed-featured-cover-placeholder span {
  text-align: center;
  letter-spacing: .18em;
  font-size: .62rem;
}
.ed-featured-cover-placeholder strong {
  align-self: center;
  max-width: 100%;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: .9;
  text-align: center;
  overflow-wrap: anywhere;
}
.ed-featured-cover-placeholder small {
  text-align: center;
  letter-spacing: .12em;
}
.ed-featured-controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
  margin-top: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--c-line);
  position: relative;
  z-index: 5;
}
.ed-featured-arrows { display: flex; gap: 8px; }
.ed-featured-arrows button,
.ed-slider-pause,
.ed-featured-dots button {
  appearance: none;
  border: 0;
  color: var(--c-ink);
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.ed-featured-arrows button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--c-line);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.ed-featured-arrows button:hover,
.ed-featured-arrows button:focus-visible {
  background: var(--c-ink);
  border-color: var(--c-ink);
  color: var(--c-paper);
}
.ed-featured-dots {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 9px;
}
.ed-featured-dots button {
  width: 34px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
}
.ed-featured-dots button span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--c-line);
  transition: height .18s ease, background .18s ease;
}
.ed-featured-dots button.is-active span {
  height: 4px;
  background: var(--c-ink);
}
.ed-slider-pause {
  justify-self: end;
  min-width: 70px;
  padding: 7px 0;
  font-family: var(--font-sans);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--c-muted);
}
.ed-slider-pause:hover,
.ed-slider-pause:focus-visible { color: var(--c-ink); }
.ed-featured-slide:not(.is-active) * { pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .ed-featured-slide,
  .ed-featured-cover { transition: none; }
}

@media (max-width: 820px) {
  .ed-featured-slide .ed-book-object { order: 0; }
  .ed-featured-slide .ed-hero-quote { order: 3; }
  .ed-featured-controls { grid-template-columns: auto 1fr auto; }
}

@media (max-width: 520px) {
  .ed-featured-slider { padding-bottom: 18px; }
  .ed-featured-controls { gap: 10px; }
  .ed-featured-arrows button { width: 38px; height: 38px; }
  .ed-featured-dots { gap: 3px; }
  .ed-featured-dots button { width: 22px; }
  .ed-slider-pause { min-width: 54px; font-size: .59rem; }
  .ed-featured-cover { max-width: 300px; }
}
