/*
Theme Name: SedLex
Theme URI: https://www.sedlex.fr/
Author: SEDLEX
Description: Thème éditorial pour sedlex.fr — référence sur les brevets et la propriété industrielle. Bordeaux + encre chaude sur papier crème : typographie forte, espace généreux, couleur restreinte. Lecture longue avec sommaire collant, barre de progression, encarts de référence et surlignage de jurisprudence.
Version: 1.1.0
Requires at least: 5.8
Requires PHP: 7.4
Text Domain: sedlex
Tags: editorial, blog, custom-menu, featured-images, translation-ready, full-width-template

© SEDLEX. Tous droits réservés. Code propriétaire — ne pas redistribuer.
*/

/* ============================================================
   SedLex theme — WordPress glue
   Design tokens live in assets/css/colors_and_type.css (loaded first)
   Components live in assets/css/kit.css (loaded second)
   This file (the canonical style.css) loads last and adds the
   WordPress-specific bits the design kit does not cover.
   ============================================================ */

/* ---------- Accessibility ---------- */
.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; padding: 0; overflow: hidden;
  position: absolute !important; word-wrap: normal !important;
}
.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 200;
  background: var(--surface); color: var(--bordeaux-700);
  font-family: var(--font-sans); font-weight: 600; font-size: 14px;
  padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: var(--shadow-md); text-decoration: none;
}
.skip-link:focus { left: 16px; }

/* ---------- Page scaffold ---------- */
.site-main { min-height: 50vh; }

/* ---------- Filigree (generative patent-plate texture) ---------- */
/* The scatter() layer is inline-styled (absolute, z-index:0, no pointer events);
   hosts must clip it and lift their own content above it. */
.filigree-layer { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
[data-filigree] { position: relative; overflow: hidden; }

/* ---------- Front page ---------- */
.hero { padding-top: 88px; padding-bottom: 72px; }
.hero-inner { max-width: 920px; position: relative; z-index: 1; }
.hero-eyebrow { margin-bottom: 22px; }
.hero-title { margin-bottom: 26px; }
.hero-em { font-style: italic; color: var(--bordeaux-600); }
.hero-lead { max-width: 620px; margin-bottom: 32px; }
.hero-cta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

.dossiers { padding-bottom: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 24px; border-bottom: 1px solid var(--line); padding-bottom: 16px; gap: 16px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }

.author-note { background: var(--bordeaux-600); border-radius: var(--r-lg); padding: 26px 24px; color: var(--paper); display: flex; flex-direction: column; justify-content: space-between; }
.author-quote { font-family: var(--font-serif); font-size: 1.18rem; line-height: 1.45; margin: 0; font-style: italic; position: relative; z-index: 1; }
.author-by { margin-top: 20px; display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.author-seal { width: 36px; height: 36px; border-radius: 999px; border: 2px solid rgba(247,242,233,.6); display: flex; align-items: center; justify-content: center; color: var(--paper); flex: none; }
.author-by span:last-child { font-family: var(--font-sans); font-size: 13px; opacity: .9; }

.resources-band { background: var(--paper-deep); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 48px; padding: 56px 0; }
.resources-band > .container { position: relative; z-index: 1; }
.resources-title { margin: 8px 0 28px; }
.resources-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; max-width: 860px; }
.resource { display: flex; align-items: center; gap: 13px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none; transition: all var(--dur) var(--ease); }
.resource:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.resource-ic { width: 20px; height: 20px; color: var(--bordeaux-600); flex: none; }
.resource-txt { flex: 1; }
.resource-t { display: block; font-family: var(--font-serif); font-size: 16px; color: var(--ink-900); }
.resource-s { font-family: var(--font-sans); font-size: 12.5px; color: var(--ink-500); }
.resource-ext { width: 17px; height: 17px; color: var(--ink-400); flex: none; }

.front-prose-wrap { padding-top: 56px; }

@media (max-width: 720px) {
  .resources-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 56px; }
}

/* ---------- Gutenberg / classic content widths inside prose ---------- */
.prose img,
.prose figure { max-width: 100%; height: auto; }
.prose figure { margin: 1.6em 0; }
.prose .wp-block-image img { border-radius: var(--r-md); }
.prose figcaption,
.wp-element-caption {
  font-family: var(--font-sans); font-size: 0.8rem; color: var(--ink-500);
  text-align: center; margin-top: 8px;
}
.prose .alignwide  { width: min(100%, calc(var(--measure) + 180px)); margin-left: auto; margin-right: auto; }
.prose .alignfull  { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.prose .alignleft  { float: left;  margin: 0.4em 1.4em 1em 0; max-width: 50%; }
.prose .alignright { float: right; margin: 0.4em 0 1em 1.4em; max-width: 50%; }
.prose .aligncenter { margin-left: auto; margin-right: auto; display: block; }
.prose pre,
.prose .wp-block-code {
  font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.6;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 16px 18px; overflow-x: auto;
}
.prose table {
  width: 100%; border-collapse: collapse; margin: 1.6em 0;
  font-family: var(--font-sans); font-size: 0.95rem;
}
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 13px; text-align: left; vertical-align: top; }
.prose th { background: var(--paper-deep); font-weight: 600; }
.prose hr { border: none; border-top: 1px solid var(--line-strong); margin: 2.2em 0; }
.prose ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.prose ol li::marker { color: var(--bordeaux-500); font-family: var(--font-mono); font-size: 0.85em; }

/* WordPress can mark up the law-callout / jurisprudence via block classes too */
.wp-block-quote { margin: 1.5em 0; padding-left: 1.25em; border-left: 3px solid var(--bordeaux-600); font-style: italic; color: var(--ink-700); }

/* Block style: "SedLex — Encart de référence" (Group block) → the law callout */
.wp-block-group.is-style-sedlex-callout {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--bordeaux-600);
  border-radius: var(--r-sm); padding: 18px 20px; margin: 1.6em 0;
}
.wp-block-group.is-style-sedlex-callout p { margin: 0 0 0.6em; font-size: 16.5px; line-height: 1.55; color: var(--ink-700); }
.wp-block-group.is-style-sedlex-callout p:last-child { margin-bottom: 0; }

/* Block style: "SedLex — Jurisprudence" (Quote block) → ochre highlight */
.wp-block-quote.is-style-sedlex-juris {
  background: var(--ochre-tint); border: 1px solid #E7D4A8; border-left: 1px solid #E7D4A8;
  border-radius: var(--r-sm); padding: 18px 20px; margin: 1.6em 0; font-style: italic;
}
.wp-block-quote.is-style-sedlex-juris cite,
.wp-block-quote.is-style-sedlex-juris .wp-block-quote__citation {
  display: block; margin-top: 10px; font-style: normal; font-family: var(--font-sans);
  font-size: 12.5px; color: var(--ink-500);
}

/* Links rendered with button/chrome classes must not carry the body underline
   (the kit used <button> elements; the theme renders some as <a>). */
a.nav-item, a.btn, a.tag, a.lang-pill { text-decoration: none; }
a.nav-item:hover, a.btn:hover { text-decoration: none; }

/* ---------- Nav: CSS-only mega-menu (kit.css markup was React-driven) ---------- */
.nav-group { position: relative; }
.nav-chev { width: 13px; height: 13px; }
.megamenu { display: none; }
.nav-group:hover > .megamenu,
.nav-group:focus-within > .megamenu { display: block; }
.megamenu .mm-d { display: block; font-size: 12.5px; color: var(--ink-500); margin-top: 2px; }
.crumb-sep { width: 14px; height: 14px; color: var(--ink-400); flex: none; }
.lang-wrap { position: relative; }
.lang-menu[hidden] { display: none; }

/* Lucide swaps <i data-lucide> for an inline <svg>; keep icons inheriting size/colour */
[data-lucide] { width: 1em; height: 1em; vertical-align: middle; }
.icon-btn [data-lucide] { width: 19px; height: 19px; }
.btn [data-lucide] { width: 17px; height: 17px; }
.btn-lg [data-lucide] { width: 19px; height: 19px; }
.dossier .go [data-lucide],
.lang-pill [data-lucide] { width: 15px; height: 15px; }
.lang-pill [data-lucide]:first-child { width: 16px; height: 16px; }

/* ---------- Mobile nav toggle (kit.css is desktop-first) ---------- */
.nav-toggle { display: none; }

/* ---------- Pagination ---------- */
.sedlex-pagination {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-top: var(--sp-7); font-family: var(--font-sans);
}
.sedlex-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink-700); text-decoration: none;
  font-size: 14px; font-weight: 500; transition: all var(--dur) var(--ease);
}
.sedlex-pagination .page-numbers:hover { border-color: var(--bordeaux-500); color: var(--bordeaux-700); }
.sedlex-pagination .page-numbers.current { background: var(--bordeaux-600); color: var(--paper); border-color: var(--bordeaux-600); }
.sedlex-pagination .page-numbers.dots { border: none; background: none; }

/* ---------- Comments ---------- */
.comments-area { max-width: var(--measure); margin: var(--sp-8) 0 0; }
.comments-area .comment-list { list-style: none; margin: 0; padding: 0; }
.comments-area .comment-body {
  padding: 18px 0; border-bottom: 1px solid var(--line);
  font-family: var(--font-sans); font-size: 15px;
}
.comments-area .comment-author { font-weight: 600; color: var(--ink-900); }
.comments-area .comment-metadata { font-size: 12.5px; color: var(--ink-500); }
.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"],
.comment-respond textarea {
  width: 100%; font-family: var(--font-sans); font-size: 15px; color: var(--ink-900);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); padding: 11px 14px; margin-bottom: 14px; outline: none;
}
.comment-respond input:focus, .comment-respond textarea:focus {
  border-color: var(--bordeaux-500); box-shadow: 0 0 0 3px var(--bordeaux-wash);
}

/* ---------- Widgets (footer / sidebar fallback) ---------- */
.widget { margin-bottom: var(--sp-6); font-family: var(--font-sans); }
.widget .widget-title {
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-500); margin: 0 0 14px;
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 5px 0; }
.widget a { color: var(--ink-700); text-decoration: none; }
.widget a:hover { color: var(--bordeaux-600); }

/* ---------- Forms (search results page, archive) ---------- */
.page-intro { max-width: 760px; margin: 0 0 var(--sp-6); }

/* ---------- Posts list / archive cards ---------- */
.post-list { display: grid; gap: 0; max-width: 860px; margin-top: var(--sp-6); }
.post-row {
  display: flex; gap: 20px; align-items: baseline; padding: 22px 4px;
  border-bottom: 1px solid var(--line); text-decoration: none;
}
.post-row:hover .post-row-title { color: var(--bordeaux-700); }
.post-row time { font-family: var(--font-mono); font-size: 12.5px; color: var(--bordeaux-600); width: 96px; flex: none; }
.post-row-title { font-family: var(--font-serif); font-size: 1.3rem; color: var(--ink-900); margin: 0 0 4px; transition: color var(--dur) var(--ease); }
.post-row-excerpt { font-family: var(--font-sans); font-size: 13.5px; color: var(--ink-500); line-height: 1.55; margin: 0; }

/* ---------- Article footer nav (prev / next) ---------- */
.article-nav { display: flex; justify-content: space-between; gap: 14px; margin-top: var(--sp-7); padding-top: var(--sp-5); border-top: 1px solid var(--line); }

/* ---------- Section (dossier sommaire) ---------- */
.section-screen { padding-top: 26px; padding-bottom: 40px; }
.section-hero { max-width: 760px; margin-top: 32px; }
.section-hero .eyebrow { margin-bottom: 16px; }
.section-h1 { margin: 0 0 22px; }
.section-intro { margin-top: 16px; }
.chapter-list { margin-top: 40px; border-top: 1px solid var(--line); max-width: 860px; }
.chapter { display: flex; align-items: center; gap: 20px; padding: 20px 4px; border-bottom: 1px solid var(--line); text-decoration: none; }
.chapter:hover .chapter-title { color: var(--bordeaux-700); }
.chapter-num { font-family: var(--font-mono); font-size: 13px; color: var(--bordeaux-600); width: 32px; flex: none; }
.chapter-body { flex: 1; }
.chapter-title { display: block; font-family: var(--font-serif); font-size: 1.3rem; color: var(--ink-900); margin-bottom: 3px; transition: color var(--dur) var(--ease); }
.chapter-sub { font-family: var(--font-sans); font-size: 13.5px; color: var(--ink-500); }
.chapter-go { width: 18px; height: 18px; color: var(--ink-400); flex: none; transition: transform var(--dur) var(--ease); }
.chapter:hover .chapter-go { transform: translateX(3px); color: var(--bordeaux-600); }

/* ---------- Article (long-form) ---------- */
.article-screen { padding-top: 26px; padding-bottom: 20px; }
.article-grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 56px; margin-top: 30px; align-items: start; }
.article-grid.no-toc { grid-template-columns: minmax(0, 1fr); }
.article-grid.no-toc .toc-wrap { display: none; }
.article-head { margin-bottom: 30px; }
.article-head .eyebrow { margin-bottom: 16px; }
.eyebrow-link { color: inherit; text-decoration: none; }
.eyebrow-link:hover { color: var(--bordeaux-700); }
.article-h1 { margin: 0 0 18px; }
.article-meta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.meta-read { display: flex; align-items: center; gap: 6px; }
.meta-read [data-lucide] { width: 15px; height: 15px; }
.send-off { color: var(--ink-700); font-style: italic; margin-top: 1.4em; }
.page-links { font-family: var(--font-sans); font-size: 14px; margin: 1.6em 0; display: flex; gap: 8px; align-items: center; }

/* ---------- List / search / 404 screens ---------- */
.list-screen { padding: 26px 0 var(--sp-8); }
.list-h1 { margin: 8px 0 10px; }
.post-row-body { flex: 1; display: flex; flex-direction: column; }
.search-none { max-width: 640px; margin-top: var(--sp-5); }
.error-404 > .page-intro, .error-404 > .error-dossiers { position: relative; z-index: 1; }
.error-404-head { max-width: 720px; }
.error-ref { display: inline-block; margin: 14px 0 18px; }
.error-joke-title { margin: 0 0 14px; }
.error-actions { margin-top: var(--sp-5); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.error-dossiers { margin-top: var(--sp-8); }
.error-dossiers h2 { margin-bottom: var(--sp-5); }
.sedlex-searchform { display: flex; gap: 10px; margin-top: var(--sp-5); max-width: 560px; }
.sedlex-searchform input { flex: 1; font-family: var(--font-sans); font-size: 15px; color: var(--ink-900); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 11px 14px; outline: none; }
.sedlex-searchform input:focus { border-color: var(--bordeaux-500); box-shadow: 0 0 0 3px var(--bordeaux-wash); }

/* ---------- Contact ---------- */
.contact-screen { padding: 26px 0 40px; }
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px; margin-top: 36px; align-items: start; }
.contact-intro { max-width: 460px; }
.contact-intro .article-h1 { margin: 0 0 22px; }
.contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px; box-shadow: var(--shadow-sm); }
.contact-form { display: flex; flex-direction: column; gap: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: block; }
.field-label { display: block; font-family: var(--font-sans); font-size: 13px; font-weight: 600; color: var(--ink-700); margin-bottom: 7px; }
.contact-form input, .contact-form textarea { width: 100%; font-family: var(--font-sans); font-size: 15px; color: var(--ink-900); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 11px 14px; outline: none; resize: vertical; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--bordeaux-500); box-shadow: 0 0 0 3px var(--bordeaux-wash); }
.hp-field { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-feedback[hidden] { display: none; }
.contact-feedback { font-family: var(--font-sans); font-size: 14px; padding: 10px 14px; border-radius: var(--r-md); }
.contact-feedback.is-error { background: var(--bordeaux-wash); color: var(--bordeaux-700); border: 1px solid var(--bordeaux-tint); }
.contact-sent[hidden] { display: none; }
.contact-sent { text-align: center; padding: 40px 10px; }
.contact-sent-ic { width: 56px; height: 56px; border-radius: 999px; background: var(--bordeaux-wash); display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; color: var(--bordeaux-600); }
.contact-sent-ic [data-lucide] { width: 26px; height: 26px; }
.contact-sent h3 { margin: 0 0 8px; }
.contact-sent .caption { margin: 0 0 20px; }

/* ---------- Footer extras ---------- */
.ftr-tagline { font-family: var(--font-sans); font-size: 13.5px; color: var(--ink-500); line-height: 1.6; margin-top: 16px; max-width: 260px; }
.ftr-menu ul, .ftr-legal-menu { list-style: none; margin: 0; padding: 0; }
.ftr-legal-menu { display: flex; gap: 16px; flex-wrap: wrap; }
.ftr-legal-menu a { color: var(--ink-500); text-decoration: none; }
.ftr-legal-menu a:hover { color: var(--bordeaux-600); }

/* ---------- Search overlay state ---------- */
.search-overlay[hidden] { display: none; }
.search-lead { width: 22px; height: 22px; color: var(--bordeaux-600); flex: none; }
.search-count { margin-left: auto; }
.search-empty { padding: 24px 14px; font-family: var(--font-serif); color: var(--ink-700); }

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .article-grid { grid-template-columns: 1fr !important; gap: 28px !important; }
  .toc { position: static; display: none; }
  .dossier-grid { grid-template-columns: repeat(2, 1fr); }
  .ftr-cols { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr !important; gap: 36px !important; }
}
@media (max-width: 720px) {
  .hdr-inner { padding: 0 18px; gap: 12px; }
  .nav { display: none; }
  .nav.open {
    display: flex; flex-direction: column; align-items: stretch; gap: 2px;
    position: absolute; top: 68px; left: 0; right: 0; margin: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md); padding: 10px;
  }
  .nav.open .nav-item { width: 100%; justify-content: space-between; }
  .nav.open .megamenu { position: static; transform: none; width: 100%; box-shadow: none; border: none; padding: 4px 0 8px 12px; }
  /* Nested submenus stack inline (indented) on mobile, no flyout. */
  .nav.open .submenu { position: static; display: block; width: 100%; box-shadow: none; border: none; padding: 2px 0 2px 14px; }
  .nav.open .mm-item > a { justify-content: flex-start; }
  .nav.open .mm-chev { display: none; }
  .nav-toggle { display: inline-flex; }
  .container { padding: 0 18px; }
  .dossier-grid { grid-template-columns: 1fr; }
  .ftr-cols { grid-template-columns: 1fr 1fr; gap: 24px; }
  .lang-pill .lang-label { display: none; }
  .display { font-size: clamp(2.2rem, 9vw, 3rem); }
}
