/*
Theme Name: Trame Aplomb
Template: generatepress
Version: 1.0.0
Description: Habillage technique et anguleux pour un carnet de chantier — immobilier residentiel et renovation.
*/

/* ============================================================
   Design tokens
   palette ember-glow / spacing spacious / width wide /
   border-radius none (sharp) / shadow dramatic
   ============================================================ */
:root {
  --ta-primary:      #C17747;
  --ta-primary-deep: #9A5C33;
  --ta-secondary:    #D4A574;
  --ta-accent:       #F39C12;
  --ta-warm:         #E8D5C4;
  --ta-surface:      #FDF8F4;
  --ta-ink:          #2C1810;
  --ta-ink-soft:     #5D5D5D;
  --ta-rule:         #F5E0CC;
  --ta-radius:       0px;             /* border_radius: none */
  --ta-shadow:       0 8px 30px rgba(0, 0, 0, 0.12);   /* shadow_style: dramatic */
  --ta-gap-section:  6rem;            /* spacing: spacious */
  --ta-gap-block:    2rem;
  --ta-pad:          3rem;
  --ta-measure:      1100px;          /* content_width: wide */
}

body { font-weight: 400; }

/* Sharp corners everywhere — the palette is warm, the geometry is not. */
.wp-block-image img,
.post-image img,
.page-header-image img,
button, input, select, textarea,
.button, .wp-block-button__link {
  border-radius: var(--ta-radius);
}

/* ============================================================
   Front-page H1 — the brief tagline, visible, never the blogname.
   Gate: reports/audit-harness/h1-visible.cjs
   ============================================================ */
.ta-home-h1 {
  max-width: var(--ta-measure);
  margin: 0 auto;
  padding: var(--ta-gap-block) 20px 1rem;
  font-family: 'Bitter', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ta-ink);
}

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

/* ============================================================
   Featured-post hero (brief SS10: homepage hero = featured-post)
   Stacked, full-bleed image over a hard-ruled caption block.
   ============================================================ */
.ta-hero {
  max-width: var(--ta-measure);
  margin: 1.5rem auto var(--ta-gap-block);
  padding: 0 20px;
}

.ta-hero-frame {
  background: #FFFFFF;
  border: 2px solid var(--ta-ink);
  box-shadow: var(--ta-shadow);
  overflow: hidden;
}

.ta-hero-media { margin: 0; display: block; }

.ta-hero-media img {
  width: 100%;
  height: 340px;
  object-fit: cover;
  display: block;
}

.ta-hero-caption {
  padding: 1.75rem 2rem 2rem;
  border-top: 2px solid var(--ta-ink);
}

.ta-hero-flag {
  display: inline-block;
  background: var(--ta-ink);
  color: var(--ta-surface);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.3rem 0.85rem;
  margin-bottom: 1rem;
}

.ta-hero-title {
  font-family: 'Bitter', Georgia, serif;
  font-size: 1.85rem;
  line-height: 1.2;
  margin: 0 0 0.6rem;
}

.ta-hero-title a { color: var(--ta-ink); text-decoration: none; box-shadow: inset 0 -2px 0 var(--ta-warm); }
.ta-hero-title a:hover { color: var(--ta-primary-deep); box-shadow: inset 0 -2px 0 var(--ta-primary); }

.ta-hero-stamp {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--ta-ink-soft);
  margin: 0 0 0.9rem;
  text-transform: lowercase;
}

.ta-hero-lede {
  color: var(--ta-ink-soft);
  line-height: 1.7;
  margin: 0 0 1.4rem;
  font-size: 1rem;
  max-width: 62ch;
}

.ta-hero-cta {
  display: inline-block;
  background: var(--ta-primary);
  color: #FFFFFF;
  padding: 0.75rem 1.6rem;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 2px solid var(--ta-primary);
}

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

@media (max-width: 768px) {
  .ta-hero-media img { height: 200px; }
  .ta-hero-caption { padding: 1.2rem 1.1rem 1.4rem; }
  .ta-hero-title { font-size: 1.3rem; }
}

/* ============================================================
   "Articles recents" rule above the loop (brief SS10)
   ============================================================ */
.ta-loop-rule {
  max-width: var(--ta-measure);
  margin: 2.5rem auto 1.25rem;
  padding: 0 20px;
  font-family: 'Bitter', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ta-ink);
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

/* ============================================================
   Separate containers (sig-E) — hard-edged cards, no rounding
   ============================================================ */
.separate-containers .site-main > .post,
.separate-containers .site-main > .page,
.separate-containers .paging-navigation,
.separate-containers .page-header {
  border: 1px solid var(--ta-rule);
  border-left: 4px solid var(--ta-primary);
  box-shadow: var(--ta-shadow);
}

.separate-containers .site-main > .post:hover { border-left-color: var(--ta-ink); }

.entry-title a { color: var(--ta-ink); text-decoration: none; }
.entry-title a:hover { color: var(--ta-primary-deep); }

.entry-meta { color: var(--ta-ink-soft); }

/* Body copy measure — wide container, readable line length */
.entry-content > p,
.entry-content > ul,
.entry-content > ol,
.entry-content > blockquote { max-width: 72ch; }

.entry-content h2 {
  font-family: 'Bitter', Georgia, serif;
  margin-top: var(--ta-gap-block);
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--ta-rule);
}

.entry-content h3 { font-family: 'Bitter', Georgia, serif; margin-top: 1.75rem; }

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

/* "Point de vigilance" blocks — persona content rule (brief SS8) */
.ta-vigilance {
  background: var(--ta-warm);
  border-left: 6px solid var(--ta-ink);
  padding: 1.1rem 1.4rem;
  margin: var(--ta-gap-block) 0;
  font-size: 0.95rem;
  color: var(--ta-ink);
  max-width: 72ch;
}

.ta-vigilance p:last-child { margin-bottom: 0; }

/* ============================================================
   Forms (WPForms Lite)
   ============================================================ */
.wpforms-container input[type="text"],
.wpforms-container input[type="email"],
.wpforms-container input[type="tel"],
.wpforms-container select,
.wpforms-container textarea {
  width: 100%;
  border: 2px solid var(--ta-rule);
  border-radius: var(--ta-radius);
  padding: 0.7rem 0.9rem;
  font-family: inherit;
  font-size: 1rem;
  background: #FFFFFF;
  color: var(--ta-ink);
}

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

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

.wpforms-container button[type="submit"],
.wpforms-container .wpforms-submit {
  background: var(--ta-primary) !important;
  color: #FFFFFF !important;
  border: 2px solid var(--ta-primary) !important;
  border-radius: var(--ta-radius) !important;
  padding: 0.75rem 1.7rem !important;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

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

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

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

/* ============================================================
   /a-propos/ — avatar-left bio (brief SS10 "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.
   ============================================================ */
.ta-bio {
  display: flow-root;
  margin: var(--ta-gap-block) 0;
}

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

.ta-bio img {
  float: left;
  width: 210px;
  margin: 0.25rem 2rem 1.25rem 0;
  border: 2px solid var(--ta-ink);
  box-shadow: var(--ta-shadow);
  display: block;
}

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

/* ============================================================
   Author card at the foot of every post (brief SS9 E-E-A-T)
   ============================================================ */
.ta-signature {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 1.25rem;
  align-items: start;
  margin-top: 2.5rem;
  padding: 1.35rem;
  background: var(--ta-surface);
  border: 1px solid var(--ta-rule);
  border-top: 4px solid var(--ta-primary);
}

.ta-signature img { width: 82px; height: 82px; object-fit: cover; display: block; border: 1px solid var(--ta-rule); }
.ta-signature .ta-sig-name { font-family: 'Bitter', Georgia, serif; font-weight: 700; margin: 0 0 0.2rem; }
.ta-signature .ta-sig-name a { color: var(--ta-ink); text-decoration: none; }
.ta-signature .ta-sig-name a:hover { color: var(--ta-primary-deep); }
.ta-signature .ta-sig-role { font-size: 0.84rem; color: var(--ta-ink-soft); margin: 0 0 0.4rem; }
.ta-signature .ta-sig-line { font-size: 0.9rem; color: var(--ta-ink-soft); margin: 0; line-height: 1.6; }

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

/* Byline avatar thumb */
.ta-byline-thumb {
  width: 24px;
  height: 24px;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 0.4rem;
  border: 1px solid var(--ta-rule);
}

/* ============================================================
   Footer — single-line-light, no headings (brief SS10)
   ============================================================ */
.site-info {
  font-size: 0.86rem;
  border-top: 2px solid var(--ta-ink);
}

.site-info .copyright-bar { line-height: 2; letter-spacing: 0.01em; }
.site-info .copyright-bar a { color: var(--ta-ink); text-decoration: none; border-bottom: 1px solid var(--ta-rule); }
.site-info .copyright-bar a:hover { color: var(--ta-primary-deep); border-bottom-color: var(--ta-primary); }
.ta-foot-dot { color: var(--ta-primary); 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.
   #5D5D5D on #FFFFFF = 7.0:1 — 10px text needs >= 4.5:1.
   ============================================================ */
/* Documented GP gap: with nav-above-header the standalone #site-navigation is
   emitted outside .site-header, so GP Menu Plus's own hide rule (scoped to navs
   inside the header) never applies to it. Below the mobile breakpoint the page
   therefore renders two nav bars and two .menu-toggle buttons, and the first one
   in DOM order is the desktop nav's. #mobile-header carries the mobile logo and
   toggle, so the desktop nav is hidden here. Gates: mobile-hamburger-position.cjs,
   mobile-tagline.cjs. */
@media (max-width: 1024px) {
  #site-navigation { display: none; }
}

/* GP sizes the mobile-header logo from the <img> width attribute (560px on this
   2x PNG), which overflows the flex row and wraps .menu-toggle onto a second line
   at the left edge. Constraining the image alone restores GP's own wrap layout:
   one 60px bar, logo left, search item then toggle flush right.
   Do NOT add flex-wrap:nowrap here — .main-nav relies on wrapping to a zero-height
   second line, and forcing nowrap drags it back into the bar.
   Gates: mobile-hamburger-position.cjs (right edge 355-375), mobile-tagline.cjs. */
@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: "Le batiment vu du chantier";
    font-style: italic;
    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-size: 10px;
    color: #5D5D5D;
    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(--ta-surface);
  color: var(--ta-ink);
}

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

/* Scroll-to-top (brief SS10: scroll-to-top = yes) — square, not round. */
.generate-back-to-top {
  border-radius: var(--ta-radius) !important;
  background-color: var(--ta-ink) !important;
  color: var(--ta-surface) !important;
}

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