/*
Theme Name: Socle Décision
Template: generatepress
Version: 1.0.0
Description: Habillage sobre et structure pour un carnet editorial de conseil aux dirigeants de PME.
*/

/* ============================================================
   Design tokens
   palette slate-professional / spacing compact / width compact /
   border-radius rounded (16px) / shadow medium
   body signature sig-C (no-sidebar / one-container / nav-below-header)
   ============================================================ */
:root {
  --sd-primary:      #334155;
  --sd-primary-deep: #1E293B;
  --sd-secondary:    #64748B;
  --sd-accent:       #475569;
  --sd-warm:         #EFF1F5;
  --sd-surface:      #F8FAFC;
  --sd-ink:          #0F172A;
  --sd-ink-soft:     #64748B;
  --sd-rule:         #E2E8F0;
  --sd-radius:       16px;                          /* border_radius: rounded */
  --sd-radius-sm:    8px;
  --sd-shadow:       0 4px 12px rgba(0, 0, 0, 0.1); /* shadow_style: medium */
  --sd-gap-section:  2rem;                          /* spacing: compact */
  --sd-gap-block:    1rem;
  --sd-pad:          1rem;
  --sd-measure:      720px;                         /* content_width compact: content */
  --sd-wide:         1000px;                        /* content_width compact: wide */
}

body { font-weight: 400; }

/* Rounded geometry — the palette is cool and sober, the corners are soft. */
.wp-block-image img,
.post-image img,
.page-header-image img,
button, input, select, textarea,
.button, .wp-block-button__link {
  border-radius: var(--sd-radius-sm);
}

/* ============================================================
   Front-page H1 — the brief tagline, visible, never the blogname.
   Gate: reports/audit-harness/h1-visible.cjs
   ============================================================ */
.sd-home-h1 {
  max-width: var(--sd-wide);
  margin: 0 auto;
  padding: var(--sd-gap-section) 20px 0.5rem;
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--sd-ink);
}

@media (max-width: 768px) {
  .sd-home-h1 { font-size: 1.1rem; padding-top: 1.25rem; }
}

/* ============================================================
   Featured-post hero (brief §10: homepage hero = featured-post)
   Side-by-side card on desktop, stacked on mobile. Rounded, soft shadow.
   ============================================================ */
.sd-hero {
  max-width: var(--sd-wide);
  margin: 1rem auto var(--sd-gap-section);
  padding: 0 20px;
}

.sd-hero-frame {
  display: grid;
  grid-template-columns: 44% 1fr;
  background: #FFFFFF;
  border: 1px solid var(--sd-rule);
  border-radius: var(--sd-radius);
  box-shadow: var(--sd-shadow);
  overflow: hidden;
}

.sd-hero-media { margin: 0; display: block; height: 100%; }

.sd-hero-media img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

.sd-hero-caption { padding: 1.6rem 1.75rem; }

.sd-hero-flag {
  display: inline-block;
  background: var(--sd-warm);
  color: var(--sd-primary);
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 0.9rem;
}

.sd-hero-title {
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.5rem;
}

.sd-hero-title a { color: var(--sd-ink); text-decoration: none; }
.sd-hero-title a:hover { color: var(--sd-primary); }

.sd-hero-stamp {
  font-size: 0.8rem;
  color: var(--sd-ink-soft);
  margin: 0 0 0.8rem;
}

.sd-hero-lede {
  color: var(--sd-ink-soft);
  line-height: 1.7;
  margin: 0 0 1.2rem;
  font-size: 0.97rem;
  max-width: 58ch;
}

.sd-hero-cta {
  display: inline-block;
  background: var(--sd-primary);
  color: #FFFFFF;
  padding: 0.7rem 1.5rem;
  text-decoration: none;
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid var(--sd-primary);
  border-radius: var(--sd-radius-sm);
}

.sd-hero-cta:hover { background: #FFFFFF; color: var(--sd-primary-deep); border-color: var(--sd-primary-deep); }

@media (max-width: 880px) {
  .sd-hero-frame { grid-template-columns: 1fr; }
  .sd-hero-media img { min-height: 0; height: 200px; }
  .sd-hero-caption { padding: 1.2rem 1.1rem 1.4rem; }
  .sd-hero-title { font-size: 1.25rem; }
}

/* ============================================================
   "Articles récents" rule above the loop (brief §10)
   ============================================================ */
.sd-loop-rule {
  max-width: var(--sd-wide);
  margin: var(--sd-gap-section) auto var(--sd-gap-block);
  padding: 0 20px;
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sd-primary);
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.sd-loop-rule::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--sd-rule);
}

/* ============================================================
   One-container layout (sig-C) — a single wrap, posts separated by rules
   rather than by boxes.
   ============================================================ */
.one-container .site-main > .post,
.one-container .site-main > .page {
  padding-bottom: var(--sd-gap-section);
  margin-bottom: var(--sd-gap-section);
  border-bottom: 1px solid var(--sd-rule);
}

.one-container .site-main > .post:last-of-type { border-bottom: none; }

.one-container .inside-article > .post-image img,
.one-container .site-main .post-image img {
  border-radius: var(--sd-radius);
  box-shadow: var(--sd-shadow);
}

.entry-title { font-family: 'Roboto', Arial, sans-serif; }
.entry-title a { color: var(--sd-ink); text-decoration: none; }
.entry-title a:hover { color: var(--sd-primary); }

.entry-meta { color: var(--sd-ink-soft); font-size: 0.85rem; }

/* Body copy measure — compact token: 720px reading column inside a 1000px shell */
.entry-content > p,
.entry-content > ul,
.entry-content > ol,
.entry-content > blockquote,
.entry-content > h2,
.entry-content > h3 { max-width: var(--sd-measure); }

.entry-content h2 {
  font-family: 'Roboto', Arial, sans-serif;
  margin-top: var(--sd-gap-section);
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--sd-warm);
}

.entry-content h3 { font-family: 'Roboto', Arial, sans-serif; margin-top: 1.5rem; }

.entry-content a { color: var(--sd-primary); }
.entry-content a:hover { color: var(--sd-ink); }

.entry-content blockquote {
  border-left: 4px solid var(--sd-primary);
  background: var(--sd-surface);
  border-radius: 0 var(--sd-radius-sm) var(--sd-radius-sm) 0;
  padding: 1rem 1.3rem;
  margin-left: 0;
  color: var(--sd-ink);
}

/* "À retenir" synthesis blocks — persona content rule (brief §8:
   every article closes on at least two actionable points). */
.sd-retenir {
  background: var(--sd-warm);
  border-left: 5px solid var(--sd-primary);
  border-radius: 0 var(--sd-radius) var(--sd-radius) 0;
  padding: 1.1rem 1.4rem;
  margin: var(--sd-gap-section) 0;
  font-size: 0.95rem;
  color: var(--sd-ink);
  max-width: var(--sd-measure);
}

.sd-retenir p:last-child, .sd-retenir ul:last-child { margin-bottom: 0; }
.sd-retenir strong { color: var(--sd-primary-deep); }

/* ============================================================
   Forms (WPForms Lite) — palette primary submit (APPENDIX-A §form rule,
   gate: contact-form-render.cjs form_button_palette_match)
   ============================================================ */
.wpforms-container input[type="text"],
.wpforms-container input[type="email"],
.wpforms-container input[type="tel"],
.wpforms-container select,
.wpforms-container textarea {
  width: 100%;
  border: 1px solid var(--sd-rule);
  border-radius: var(--sd-radius-sm);
  padding: 0.7rem 0.9rem;
  font-family: inherit;
  font-size: 1rem;
  background: #FFFFFF;
  color: var(--sd-ink);
}

.wpforms-container input:focus,
.wpforms-container select:focus,
.wpforms-container textarea:focus {
  border-color: var(--sd-primary);
  outline: none;
}

.wpforms-container label { font-size: 0.95rem; }

.wpforms-container button[type="submit"],
.wpforms-container .wpforms-submit {
  background: var(--sd-primary) !important;
  color: #FFFFFF !important;
  border: 1px solid var(--sd-primary) !important;
  border-radius: var(--sd-radius-sm) !important;
  padding: 0.75rem 1.7rem !important;
  font-family: 'Roboto', Arial, sans-serif;
  font-weight: 700;
  cursor: pointer;
}

.wpforms-container button[type="submit"]:hover {
  background: #FFFFFF !important;
  color: var(--sd-primary-deep) !important;
}

.search-field {
  border: 1px solid var(--sd-rule);
  background: var(--sd-surface);
  padding: 10px 16px;
  border-radius: var(--sd-radius-sm);
  font-family: inherit;
}

.search-field:focus { border-color: var(--sd-primary); outline: none; }

/* ============================================================
   /a-propos/ — avatar-left bio (brief §10 "About structure: avatar-left").
   flow-root + float, not grid: wpautop injects a stray <p> between the
   portrait and the copy, which collapses a 2-column grid.
   ============================================================ */
.sd-bio {
  display: flow-root;
  margin: var(--sd-gap-section) 0;
}

.sd-bio > p:empty { display: none; }

.sd-bio img {
  float: left;
  width: 210px;
  margin: 0.25rem 1.75rem 1.25rem 0;
  border-radius: var(--sd-radius);
  box-shadow: var(--sd-shadow);
  display: block;
}

@media (max-width: 600px) {
  .sd-bio img { float: none; margin: 0 0 1.25rem; width: 190px; }
}

/* ============================================================
   Author card at the foot of every post (brief §9 E-E-A-T)
   ============================================================ */
.sd-signature {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 1.2rem;
  align-items: start;
  margin-top: var(--sd-gap-section);
  padding: 1.3rem;
  background: var(--sd-surface);
  border: 1px solid var(--sd-rule);
  border-radius: var(--sd-radius);
  max-width: var(--sd-measure);
}

.sd-signature img { width: 82px; height: 82px; object-fit: cover; display: block; border-radius: 50%; }
.sd-signature .sd-sig-name { font-family: 'Roboto', Arial, sans-serif; font-weight: 700; margin: 0 0 0.2rem; }
.sd-signature .sd-sig-name a { color: var(--sd-ink); text-decoration: none; }
.sd-signature .sd-sig-name a:hover { color: var(--sd-primary); }
.sd-signature .sd-sig-role { font-size: 0.84rem; color: var(--sd-ink-soft); margin: 0 0 0.4rem; }
.sd-signature .sd-sig-line { font-size: 0.9rem; color: var(--sd-ink-soft); margin: 0; line-height: 1.6; }

@media (max-width: 520px) {
  .sd-signature { grid-template-columns: 1fr; }
}

/* Byline avatar thumb */
.sd-byline-thumb {
  width: 24px;
  height: 24px;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 0.4rem;
  border-radius: 50%;
}

/* ============================================================
   Footer — single-line-dark, no headings (brief §10)
   ============================================================ */
.site-info {
  font-size: 0.85rem;
  background-color: var(--sd-ink);
  color: #CBD5E1;
  border-top: 3px solid var(--sd-primary);
}

.site-info .copyright-bar { line-height: 2; letter-spacing: 0.01em; }
.site-info .copyright-bar a { color: #E2E8F0; text-decoration: none; border-bottom: 1px solid #334155; }
.site-info .copyright-bar a:hover { color: #FFFFFF; border-bottom-color: #94A3B8; }
.sd-foot-dot { color: #64748B; margin: 0 0.35rem; }

/* ============================================================
   Mobile tagline strip (gate: mobile-tagline.cjs M2-1).
   Sits between the logo and the toggle cluster inside the nav bar.
   #475569 on #FFFFFF = 7.6:1 — 10px text needs >= 4.5:1.
   ============================================================ */
@media (max-width: 1024px) {
  #mobile-header .site-logo.mobile-header-logo img {
    width: auto;
    max-width: 128px;
    height: auto;
    max-height: 40px;
    object-fit: contain;
  }
}

@media (max-width: 1024px) {
  #mobile-header .inside-navigation { position: relative; }
  #mobile-header .inside-navigation::before {
    content: "D\00e9cisions, droit et gestion pour dirigeants de PME";
    position: absolute;
    /* Measured band at 390w: logo 10-130, search 232-287, toggle 287-390. */
    left: 138px;
    right: 166px;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 10px;
    color: #475569;
    line-height: 1.2;
    white-space: normal;
    pointer-events: none;
  }
}

/* ============================================================
   Nav search reveal — documented GP gap. GP ships only the
   has-inline-mobile-toggle variant of the hide/reveal rules in
   main.min.css, so the form renders as a permanently visible empty
   box. menu.min.js toggles .nav-search-active.
   ============================================================ */
.main-navigation { position: relative; }

.main-navigation .navigation-search {
  position: absolute;
  left: -99999px;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease-in-out;
}

.main-navigation .navigation-search.nav-search-active {
  left: 0;
  opacity: 1;
  z-index: 20;
  pointer-events: auto;
}

.main-navigation .navigation-search input[type="search"] {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
  background: var(--sd-surface);
  color: var(--sd-ink);
}

/* ============================================================
   Category archive intro (GP archive description)
   ============================================================ */
.page-header .taxonomy-description {
  color: var(--sd-ink-soft);
  max-width: 70ch;
  line-height: 1.7;
}

.page-header {
  border-bottom: 1px solid var(--sd-rule);
  padding-bottom: var(--sd-gap-block);
  margin-bottom: var(--sd-gap-section);
}

/* Read more */
.read-more {
  font-family: 'Roboto', Arial, sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--sd-primary);
  text-decoration: none;
}
.read-more:hover { color: var(--sd-ink); }

/* Scroll-to-top (brief §10: scroll-to-top = yes) — rounded, per token. */
.generate-back-to-top {
  border-radius: var(--sd-radius-sm) !important;
  background-color: var(--sd-primary) !important;
  color: #FFFFFF !important;
  box-shadow: var(--sd-shadow);
}

.generate-back-to-top:hover { background-color: var(--sd-ink) !important; }
