/* ============================================================
   THEME PREMIUM RGE — Bleu marine + Or doré
   toiture-services.fr — Tous travaux toiture certifiés
   ============================================================ */
:root {
  --primary: #1e3a8a;
  --primary-dark: #1e293b;
  --primary-light: #eff6ff;
  --gold: #d4a017;
  --gold-light: #fde68a;
  --ink: #0f172a;
  --ink-mute: #475569;
  --paper: #f8fafc;
  --paper-alt: #fff;
  --border: #e2e8f0;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; color: var(--ink); background: var(--paper); line-height: 1.7; -webkit-font-smoothing: antialiased; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
section[id], div[id] { scroll-margin-top: 100px; }
a { color: var(--primary); }

/* ===== Header ===== */
header { background: #fff; color: var(--ink); padding: 16px 0; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
header nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
header .logo { display: inline-flex; align-items: center; gap: 12px; font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 900; color: var(--primary); text-decoration: none; }
header .logo .logo-mark { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; background: var(--primary); color: var(--gold); border-radius: 8px; font-size: 1.4rem; font-weight: 900; }
.nav-links { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.nav-link { color: var(--primary); text-decoration: none; font-weight: 700; font-size: .95rem; padding: 8px 14px; border-radius: 4px; transition: all .15s; display: inline-block; }
.nav-link:hover { background: var(--primary-light); color: var(--primary); }
.nav-link.active { background: var(--primary); color: #fff; }

/* ===== CTA ===== */
.btn-cta { display: inline-block; background: var(--primary); color: #fff; padding: 12px 26px; border-radius: 6px; text-decoration: none; font-weight: 700; transition: all .2s; border: 2px solid var(--primary); font-size: .95rem; }
.btn-cta:hover { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); }
.btn-cta.btn-premium { background: var(--gold); border-color: var(--gold); color: var(--primary-dark); }
.btn-cta.btn-premium:hover { background: #b8860b; border-color: #b8860b; }
.btn-ghost { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-ghost:hover { background: var(--primary); color: #fff; }

/* ===== Hero ===== */
.hero { position: relative; background: linear-gradient(165deg, #1e3a8a 0%, #1e40af 50%, #312e81 100%); color: #fff; padding: 100px 0 110px; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background: url('https://picsum.photos/seed/toiture-services-hero/1800/900') center/cover; opacity: .22; mix-blend-mode: luminosity; }
.hero::after { content: ''; position: absolute; top: 0; right: -100px; width: 360px; height: 360px; background: radial-gradient(circle, rgba(212,160,23,.3), transparent 60%); pointer-events: none; }
.hero .container { position: relative; }
.hero .hero-lead { max-width: 720px; }
.hero h1 { font-family: 'Playfair Display', serif; font-size: clamp(2.2rem, 4.5vw, 3.6rem); line-height: 1.15; margin: 0 0 22px; font-weight: 900; }
.hero h1 em { font-style: italic; color: var(--gold); }
.hero .lead { font-size: 1.18rem; margin: 0 0 32px; opacity: .92; }
.badge-pill { display: inline-flex; align-items: center; gap: 10px; background: rgba(212,160,23,.15); border: 1px solid rgba(212,160,23,.4); color: var(--gold); padding: 8px 18px; border-radius: 4px; font-size: .82rem; font-weight: 600; margin-bottom: 22px; letter-spacing: .08em; text-transform: uppercase; }
.badge-pill::before { content: '◆'; color: var(--gold); }

.trust-bar { display: flex; gap: 32px; flex-wrap: wrap; margin-top: 36px; padding-top: 28px; border-top: 1px solid rgba(255,255,255,.15); }
.trust-bar .tb-item { display: flex; align-items: center; gap: 12px; }
.trust-bar .tb-item .tb-num { font-family: 'Playfair Display', serif; font-size: 2rem; font-weight: 900; color: var(--gold); line-height: 1; }
.trust-bar .tb-item .tb-label { font-size: .82rem; opacity: .85; line-height: 1.3; }

/* ===== Sections ===== */
section { padding: 80px 0; background: var(--paper-alt); }
section.alt { background: var(--paper); }
section.dark { background: var(--primary-dark); color: #fff; }
section h2 { font-family: 'Playfair Display', serif; font-size: clamp(1.9rem, 3vw, 2.8rem); margin: 0 0 14px; font-weight: 900; color: var(--primary); }
section h2 em { font-style: italic; color: var(--gold); }
section h2.center { text-align: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .2em; font-size: .8rem; color: var(--gold); font-weight: 700; margin-bottom: 10px; }
.section-intro { max-width: 720px; color: var(--ink-mute); font-size: 1.05rem; margin-bottom: 50px; }

/* ===== Service cards (premium) ===== */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; }
.service-card { background: #fff; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; transition: all .3s; text-decoration: none; color: inherit; display: block; position: relative; }
.service-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .3s; }
.service-card:hover { box-shadow: 0 30px 60px rgba(30,58,138,.15); transform: translateY(-6px); }
.service-card:hover::before { transform: scaleX(1); }
.service-card .thumb { height: 200px; background-size: cover; background-position: center; position: relative; }
.service-card .thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(30,58,138,.4), transparent 50%); }
.service-card .rge-badge { position: absolute; top: 14px; left: 14px; background: var(--gold); color: var(--primary-dark); font-size: .7rem; font-weight: 800; padding: 6px 12px; letter-spacing: .08em; z-index: 2; }
.service-card .body { padding: 26px; }
.service-card h3 { font-family: 'Playfair Display', serif; font-size: 1.4rem; margin: 0 0 10px; font-weight: 900; color: var(--primary); }
.service-card p { font-size: .95rem; color: var(--ink-mute); margin: 0 0 16px; line-height: 1.6; }
.service-card .arrow { color: var(--gold); font-weight: 700; font-size: .9rem; letter-spacing: .05em; }

/* ===== Cards (legacy generic) ===== */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; }
.card { background: #fff; padding: 32px; border-radius: 4px; border: 1px solid var(--border); border-top: 3px solid var(--gold); }
.card .num { display: inline-block; font-family: 'Playfair Display', serif; font-size: .9rem; font-weight: 900; color: var(--gold); margin-bottom: 14px; letter-spacing: .1em; }
.card h3 { font-family: 'Playfair Display', serif; margin: 0 0 10px; font-size: 1.3rem; color: var(--primary); }
.card p { margin: 0; color: var(--ink-mute); font-size: .96rem; }

/* ===== Devis section ===== */
#devis { background: linear-gradient(180deg, #fff 0%, var(--paper) 100%); }
#vac6f0118e8d { background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 28px; min-height: 440px; box-shadow: 0 20px 50px rgba(30,58,138,.08); }

/* ===== Gallery ===== */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 30px 0; }
.gallery-grid figure { margin: 0; border-radius: 4px; overflow: hidden; aspect-ratio: 4/3; position: relative; }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.gallery-grid figure:hover img { transform: scale(1.08); }
.gallery-grid figcaption { position: absolute; bottom: 0; left: 0; right: 0; padding: 18px 16px 14px; background: linear-gradient(to top, rgba(30,58,138,.85), transparent); color: #fff; font-weight: 600; font-size: .95rem; font-family: 'Playfair Display', serif; }

/* ===== Stats band ===== */
.stats-band { background: var(--primary-dark); color: #fff; padding: 50px 0; }
.stats-band .container { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 30px; text-align: center; }
.stats-band .stat .num { font-family: 'Playfair Display', serif; font-size: 3rem; font-weight: 900; color: var(--gold); line-height: 1; }
.stats-band .stat .label { font-size: .92rem; opacity: .85; margin-top: 8px; letter-spacing: .05em; text-transform: uppercase; }

/* ===== Footer ===== */
footer { background: var(--primary-dark); color: #cbd5e1; padding: 60px 0 30px; }
footer .footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
footer h3, footer strong { color: #fff; font-family: 'Playfair Display', serif; }
footer a { color: #cbd5e1; text-decoration: none; font-size: .93rem; }
footer a:hover { color: var(--gold); }

/* ===== Responsive ===== */
@media (max-width: 720px) {
  header nav { flex-direction: column; align-items: stretch; }
  .nav-links { flex-wrap: wrap; justify-content: center; }
  footer .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding: 70px 0 80px; }
  .trust-bar { gap: 18px; }
}

/* Hero context : ghost button must be visible on dark gradient (auto-patched 2026-05-11) */
.hero .btn-ghost { color: #fff !important; border-color: rgba(255,255,255,.7) !important; }
.hero .btn-ghost:hover { background: rgba(255,255,255,.15) !important; border-color: #fff !important; color: #fff !important; }


/* === RESPONSIVE-MOBILE-PATCH v1 — 2026-05-12 (v3 spec-boost) ===
   Master mobile-first patch for the 100+ aprod-* portfolio.
   v3 : selectors prefixed with body/html body to win cascade against
   inline <style> blocks (vitrier-urgence, serrurier-flash, etc.).
   Rollback : strip the block between markers.
   Targets : tap targets 44px, hero compact, form above-fold, no iOS zoom,
             no horizontal scroll, fluid imgs, single-column cards,
             readable RGPD banner. !important used to override theme CSS.
   ============================================================ */

/* --- Universal safety (all viewports) --- */
img, video, iframe { max-width: 100%; height: auto; }
*, *::before, *::after { box-sizing: border-box; }

/* --- A11y color-contrast overrides for known portfolio inline colors ---
   Each inline `style="color:#xxx"` from helpers (temoignages, cro_pack) failed
   WCAG 4.5:1 ratio on white/light bg. CSS overrides via attribute selectors win
   because inline colors are NOT !important — our !important beats them.
   ============================================================ */
[style*="color:#f59e0b"] { color: #b45309 !important; } /* amber → darker amber 5.21:1 */
[style*="color: #f59e0b"] { color: #b45309 !important; }
[style*="color:#f6b952"] { color: #b45309 !important; } /* yellow → darker amber */
[style*="color: #f6b952"] { color: #b45309 !important; }
[style*="color:#cba3a3"] { color: #7f1d1d !important; } /* pink → dark red 8.5:1 */
[style*="color: #cba3a3"] { color: #7f1d1d !important; }
[style*="color:#9ca3af"] { color: #4b5563 !important; } /* light gray → medium gray 7.56:1 */
[style*="color: #9ca3af"] { color: #4b5563 !important; }
[style*="color:#6b7280"] { color: #374151 !important; } /* medium gray → darker 11.6:1 */
[style*="color: #6b7280"] { color: #374151 !important; }
[style*="color:#d1d5db"] { color: #4b5563 !important; } /* lighter gray → medium */
[style*="color:#e5e7eb"] { color: #4b5563 !important; } /* very light gray */
/* btn-urgent : pink on yellow disaster fix */
.btn-urgent, a.btn-urgent { color: #fff !important; background: #dc2626 !important; }
/* small star/rating amber on near-white bg */
.temoignages-block [style*="color:#f59e0b"],
.temoignages-block [style*="color: #f59e0b"] { color: #b45309 !important; }

/* --- Mobile (<= 767px) --- */
@media (max-width: 767px) {
  html, body { overflow-x: hidden !important; max-width: 100vw; }

  /* Typography & spacing */
  .container { padding-left: 14px !important; padding-right: 14px !important; }
  section { padding: 28px 0 !important; }
  section h2, h2 { font-size: 1.45rem !important; line-height: 1.25 !important; margin: 0 0 14px !important; }
  h3 { font-size: 1.1rem !important; }
  p, li { font-size: .95rem; line-height: 1.55; }

  /* Hero compact (push form above the fold on most pages) */
  .hero, .hero-section, [class*="hero-"] { padding: 22px 0 18px !important; }
  /* h1 + Bootstrap display-* classes (override BS .display-1..6 responsive sizing) */
  .hero h1, h1,
  h1.display-1, h1.display-2, h1.display-3, h1.display-4, h1.display-5, h1.display-6,
  .display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-size: 1.55rem !important;
    line-height: 1.22 !important;
    margin: 0 0 10px !important;
    font-weight: 800 !important;
  }
  .hero p, .hero .subtitle, .hero-subtitle, p.lead, .lead { font-size: .95rem !important; line-height: 1.5 !important; margin: 0 auto 14px !important; max-width: 100% !important; }
  .badge-pill, .hero .badge, .badge { font-size: .75rem !important; padding: 4px 12px !important; margin-bottom: 12px !important; }

  /* Bootstrap container & spacing tightening on mobile */
  .container, .container-fluid, .container-sm, .container-md, .container-lg, .container-xl {
    padding-left: 14px !important; padding-right: 14px !important;
  }
  .py-5, [class*="py-"] { padding-top: 28px !important; padding-bottom: 28px !important; }
  .my-5, [class*="my-"] { margin-top: 20px !important; margin-bottom: 20px !important; }
  .mt-5, .mt-4 { margin-top: 16px !important; }
  .mb-5, .mb-4 { margin-bottom: 16px !important; }

  /* Bootstrap row/col stacking (defensive) */
  .row > [class^="col-"], .row > [class*=" col-"] { margin-bottom: 10px; }

  /* Header / nav */
  header { padding: 10px 0 !important; }
  header nav { flex-wrap: wrap; gap: 8px !important; }
  header nav a, header nav .logo {
    padding: 10px 8px !important;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
  }
  header .logo { font-size: 1.1rem !important; padding-left: 0 !important; }

  /* Buttons & CTAs : enforce 44px tap target */
  .btn-cta, .btn, button, input[type="submit"], input[type="button"], [role="button"], a.btn {
    min-height: 44px !important;
    padding: 12px 18px !important;
    font-size: 1rem !important;
    line-height: 1.2 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .btn-cta { padding: 14px 22px !important; font-weight: 700 !important; }
  a.read-more, a.lire-suite, a[class*="text-decoration"] { min-height: 40px; padding: 8px 4px; display: inline-block; }

  /* Forms : 16px font (no iOS zoom) + 44px controls */
  input, textarea, select, button { font-size: 16px !important; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
  textarea, select {
    min-height: 44px !important;
    padding: 10px 12px !important;
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box !important;
  }
  label { font-size: .9rem; }
  form { max-width: 100% !important; }

  /* Card grids : stack 1 col */
  .cards-grid, .grid, .row-cards, [class*="cards-"] { grid-template-columns: 1fr !important; gap: 12px !important; }
  .card { padding: 18px !important; }
  .card h3 { font-size: 1.1rem !important; margin: 0 0 8px !important; }

  /* Footer */
  footer { padding: 32px 0 16px !important; margin-top: 24px !important; }
  .footer-grid { grid-template-columns: 1fr !important; gap: 18px !important; }

  /* RGPD banner safety (don't cover form/CTA) */
  .rgpd-banner, .cookie-banner, [class*="cookie"] {
    bottom: 12px !important; left: 12px !important; right: 12px !important;
    max-width: calc(100vw - 24px) !important; font-size: .85rem;
  }

  /* MediaBuyer / VUD banner : keep responsive */
  .vud-banner-autopromo img, .mb-banner img, .autopromo img { max-width: 100% !important; height: auto !important; }
  .mb-urgent-banner {
    margin: 14px 12px !important;
    padding: 12px 14px !important;
    max-width: calc(100vw - 24px) !important;
    border-radius: 10px !important;
  }
  .mb-urgent-banner > div:nth-child(2) { font-size: .95rem !important; }
  .mb-urgent-banner > div:nth-child(3) { font-size: .8rem !important; }
  .mb-urgent-banner a {
    display: inline-block !important;
    min-height: 36px !important;
    padding: 6px 4px !important;
    line-height: 1.4 !important;
  }

  /* Real artisans cards SIRENE (.real-artisans-block / .ra-grid / .ra-card) */
  .real-artisans-block { margin: 24px 8px !important; padding: 18px 12px !important; border-radius: 10px !important; }
  .real-artisans-block h2 { font-size: 1.15rem !important; margin: 0 0 4px !important; line-height: 1.3 !important; }
  .real-artisans-block .ra-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
  .real-artisans-block .ra-card { padding: 14px !important; }
  .real-artisans-block .ra-card h3 { font-size: .95rem !important; line-height: 1.3 !important; }
  .real-artisans-block .ra-card a { min-height: 40px !important; padding: 8px 10px !important; }
  /* Legacy selectors keep working */
  .real-artisans, .ra-cards, [class*="artisan-card"]:not(.ra-card) { display: flex !important; flex-direction: column !important; gap: 10px !important; }

  /* Sticky bottom CTA bar (helper sticky-cta.php) */
  .sticky-cta-bar { z-index: 9999; }
  .sticky-cta-btn { min-height: 56px !important; padding: 14px 8px !important; font-size: .92rem !important; }
  /* Ensure form/page bottom isn't covered by sticky CTA */
  body:has(.sticky-cta-bar) { padding-bottom: 76px !important; }

  /* Tables : scrollable */
  table { display: block; overflow-x: auto; max-width: 100%; }

  /* Touch-friendly spacing for footer / inline links */
  footer a, .footer-links a { padding: 6px 4px; display: inline-block; min-height: 32px; }
}

/* --- Small mobile (<= 380px iPhone SE / Pixel 3a) --- */
@media (max-width: 380px) {
  .hero h1, h1 { font-size: 1.4rem !important; }
  .btn-cta { padding: 12px 16px !important; font-size: .95rem !important; }
  .container { padding-left: 10px !important; padding-right: 10px !important; }
}

/* --- Reduced motion respect --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* --- Print safety (don't break print layout) --- */
@media print {
  header, footer, .rgpd-banner, .cookie-banner, .vud-banner-autopromo { display: none !important; }
}
/* === RESPONSIVE-MOBILE-PATCH-END === */

/* === HERO COMPACT — widget above-fold (2026-05-30) === */
.hero{padding-top:34px!important;padding-bottom:26px!important;min-height:0!important}
.hero h1{font-size:2.2rem!important;margin-top:0!important;margin-bottom:12px!important;line-height:1.15!important}
.hero p,.hero .lead,.hero__lead,.hero .hero__lead{margin-top:0!important;margin-bottom:16px!important}
.hero .badge-pill,.badge-pill{margin-bottom:10px!important}
#devis,#devis-section,.widget-section{padding-top:26px!important}
@media(max-width:768px){
  .hero{padding-top:16px!important;padding-bottom:10px!important}
  .hero h1{font-size:1.5rem!important}
  .hero p,.hero .lead,.hero__lead{display:none!important}
  #devis,#devis-section,.widget-section{padding-top:12px!important}
}
/* === /HERO COMPACT === */
