/*
Theme Name: Renobois
Description: Site une page de Renobois – Christian Fallet (rénovation, toiture, menuiserie).
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: renobois
*/

:root {
  --teal: #2a6b6d;
  --teal-deep: #1d5356;
  --teal-ink: #0a4d50;
  --terra: #e0876a;
  --terra-deep: #c96f52;
  --sun: #f6cf45;
  --cream: #fbf4ec;
  --white: #fff;
  --ink: #23393a;
  --muted: #5d7475;
  --radius: 14px;
  --display: "Fredoka", "Trebuchet MS", sans-serif;
  --body: "Nunito", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
}
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.1; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  color: var(--white);
  background:
    repeating-linear-gradient(0deg, transparent 0 21px, rgba(0,0,0,.10) 21px 22px),
    var(--teal);
  box-shadow: 0 2px 0 rgba(0,0,0,.12);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: baseline; gap: 12px; text-decoration: none; font-family: var(--display); }
.brand-name { font-size: 30px; font-weight: 600; letter-spacing: .01em; }
.brand-tag { font-size: 15px; opacity: .9; }
.nav { display: flex; gap: 4px; font-family: var(--display); font-size: 16px; }
.nav a { text-decoration: none; padding: 7px 14px; border-radius: 8px; transition: background .15s; }
.nav a:hover { background: rgba(255,255,255,.14); }
.nav .nav-cta { background: var(--white); color: var(--teal-ink); }
.nav .nav-cta:hover { background: var(--sun); }

/* ---------- Accueil ---------- */
.hero {
  position: relative;
  color: var(--white);
  background:
    repeating-linear-gradient(0deg, transparent 0 43px, rgba(0,0,0,.08) 43px 44px),
    var(--teal);
  padding: 72px 0 120px;
  overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.kicker { font-family: var(--display); color: var(--sun); font-size: 17px; margin-bottom: 14px; }
.hero h1 { font-size: clamp(40px, 5.600vw, 68px); font-weight: 600; }
.hero h1 .hl { color: #f3a98f; }
.lead { margin-top: 22px; font-size: 19px; max-width: 34em; color: rgba(255,255,255,.92); }
.lead-small { margin-top: 8px; font-weight: 700; color: var(--white); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--display); font-size: 18px; font-weight: 500;
  padding: 12px 22px; border-radius: 999px; text-decoration: none;
  border: 2px solid transparent; transition: transform .15s, background .15s;
}
.btn svg { width: 20px; height: 20px; }
.btn:hover { transform: translateY(-2px); }
.btn-sun { background: var(--sun); color: var(--teal-ink); }
.btn-sun:hover { background: #ffdc5c; }
.btn-ghost { border-color: rgba(255,255,255,.7); color: var(--white); }
.btn-ghost:hover { background: rgba(255,255,255,.12); }

.hero-visual { position: relative; padding: 10px 10px 40px 0; }
.polaroid {
  margin: 0; background: var(--white); padding: 12px; border-radius: 6px;
  transform: rotate(2.500deg);
  box-shadow: 0 18px 40px rgba(0,0,0,.28);
}
.polaroid img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 3px; background: #9fc3d8; }
.logo-card {
  position: absolute; left: -46px; bottom: -6px; width: 168px; height: auto;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.3));
  transform: rotate(-6deg);
}
.roofline { position: absolute; left: 0; bottom: -1px; width: 100%; height: 60px; fill: var(--terra); }

/* ---------- Sections ---------- */
section { padding: 84px 0; }
.section-head { margin-bottom: 36px; }
.section-head h2, .about h2, .contact h2 { font-size: clamp(32px, 4vw, 44px); font-weight: 600; }
.section-head p { margin-top: 8px; font-size: 18px; }

/* Services */
.services { background: var(--terra); padding-top: 56px; }
.services .section-head { color: var(--white); }
.services .section-head h2 { color: var(--white); }
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 6px 0 var(--terra-deep);
  display: flex; flex-direction: column;
  transition: transform .18s;
}
.card:hover { transform: translateY(-4px); }
.card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #e9ddd0; }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { font-size: 25px; color: var(--teal-ink); }
.card p { color: var(--muted); flex: 1; }
.link {
  align-self: flex-start; background: none; border: 0; padding: 4px 0; cursor: pointer;
  font: 500 16px var(--display); color: var(--teal-ink);
  border-bottom: 2px solid var(--sun);
}
.link:hover { border-color: var(--terra); }

/* Réalisations */
.gallery-section h2, .about h2 { color: var(--teal-ink); }
.gallery-section .section-head p { color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.pill {
  font: 500 16px var(--display); color: var(--teal-ink);
  background: var(--white); border: 2px solid #e6d9c9; border-radius: 999px;
  padding: 7px 16px; cursor: pointer; transition: background .15s, border-color .15s;
}
.pill:hover { border-color: var(--teal); }
.pill.is-active { background: var(--teal); border-color: var(--teal); color: var(--white); }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 190px; grid-auto-flow: dense; gap: 12px; }
.tile {
  position: relative; padding: 0; border: 0; cursor: zoom-in; overflow: hidden;
  border-radius: 10px; background: #e9ddd0;
}
.tile.tall { grid-row: span 2; }
.tile.wide { grid-column: span 2; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.tile:hover img { transform: scale(1.050); }
.tile span {
  position: absolute; left: 8px; bottom: 8px;
  font: 500 13px var(--display); color: var(--teal-ink);
  background: rgba(255,255,255,.92); padding: 3px 10px; border-radius: 999px;
}
.tile[hidden] { display: none; }

/* Avant / Après */
.compare-section { background: var(--white); }
.compare-section h2 { color: var(--teal-ink); }
.compare-section .section-head p { color: var(--muted); }
.compare-grid { display: grid; grid-template-columns: 2.37fr 1fr; gap: 24px; align-items: start; }
.compare-grid figure { margin: 0; }
.compare {
  --pos: 50%;
  position: relative; aspect-ratio: var(--ar); overflow: hidden;
  border-radius: var(--radius); background: #e9ddd0;
  box-shadow: 0 6px 0 #e6d9c9;
}
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: var(--t, none); }
.compare .before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare .handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: 4px; translate: -50% 0;
  background: var(--white); box-shadow: 0 0 0 1px rgba(0,0,0,.15);
}
.compare .handle::after {
  content: "‹ ›"; position: absolute; top: 50%; left: 50%; translate: -50% -50%;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--sun); color: var(--teal-ink); font: 600 20px var(--display);
  border: 3px solid var(--white); box-shadow: 0 3px 10px rgba(0,0,0,.3);
}
.compare input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: ew-resize; touch-action: pan-y;
}
.compare:has(input:focus-visible) { outline: 3px solid var(--sun); outline-offset: 3px; }
.tag {
  position: absolute; top: 12px;
  font: 500 14px var(--display); padding: 4px 12px; border-radius: 999px;
}
.tag-before { left: 12px; background: rgba(255,255,255,.92); color: var(--teal-ink); }
.tag-after { right: 12px; background: var(--teal); color: var(--white); }
.compare-grid figcaption { margin-top: 14px; color: var(--muted); }
.compare-grid figcaption strong { font: 500 19px var(--display); color: var(--teal-ink); margin-right: 6px; }

/* À propos */
.about { background: var(--white); }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.about p { margin-top: 16px; font-size: 18px; max-width: 32em; }
.points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.points li {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--cream); border-radius: var(--radius); padding: 18px 20px;
}
.points strong { display: block; font: 500 20px var(--display); color: var(--teal-ink); }
.points span { color: var(--muted); }
.dot { flex: none; width: 14px; height: 14px; margin-top: 8px; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 4px rgba(246,207,69,.35); }

/* Contact */
.contact { background: var(--terra); }
.contact-card {
  position: relative;
  display: grid; grid-template-columns: 1.300fr 1fr; gap: 40px; align-items: center;
  color: var(--white);
  background:
    repeating-linear-gradient(0deg, transparent 0 43px, rgba(0,0,0,.08) 43px 44px),
    var(--teal);
  border-radius: 20px; padding: 48px;
  box-shadow: 0 8px 0 var(--terra-deep);
}
.contact-intro p { margin-top: 12px; font-size: 18px; max-width: 26em; }
.flower { position: absolute; right: 34px; top: -62px; width: 58px; transform: rotate(8deg); }
.contact-details {
  font-style: normal; display: grid; gap: 2px;
  background: var(--white); color: var(--ink);
  border-radius: var(--radius); padding: 24px 26px;
}
.contact-details strong { font: 500 22px var(--display); color: var(--teal-ink); }
.contact-details span:first-of-type { color: var(--muted); margin-bottom: 10px; }
.contact-details a { margin-top: 12px; font-weight: 700; color: var(--teal-ink); }

/* Pied de page */
.site-footer { background: var(--teal-deep); color: rgba(255,255,255,.85); font-size: 15px; }
.footer-row { display: flex; justify-content: space-between; padding: 20px 0; }

/* Visionneuse */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgba(14, 40, 42, .92); }
.lightbox img { max-width: min(92vw, 1300px); max-height: 82vh; border-radius: 6px; border: 8px solid var(--white); }
#lb-cap { position: fixed; bottom: 18px; left: 0; right: 0; text-align: center; color: var(--white); font-family: var(--display); }
.lb-close, .lb-nav {
  position: fixed; width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--white); color: var(--teal-ink); font-size: 28px; line-height: 1;
}
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; translate: 0 -50%; }
.lb-next { right: 16px; top: 50%; translate: 0 -50%; }
.lb-close:hover, .lb-nav:hover { background: var(--sun); }

:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }

/* ---------- Adaptatif ---------- */
@media (max-width: 900px) {
  .hero { padding: 48px 0 100px; }
  .hero-grid, .about-grid, .contact-card { grid-template-columns: 1fr; gap: 36px; }
  .compare-grid { grid-template-columns: 1fr; gap: 32px; }
  .compare-grid figure:last-child { max-width: 360px; }
  .hero-visual { padding: 0 0 36px 30px; max-width: 520px; }
  .logo-card { left: 0; width: 130px; }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 160px; }
  .brand-tag { display: none; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 32px); }
  section { padding: 60px 0; }
  .header-row { min-height: 58px; }
  .brand-name { font-size: 24px; }
  .nav { font-size: 14px; gap: 0; }
  .nav a { padding: 6px 8px; }
  .nav a:nth-child(3) { display: none; }
  .service-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 130px; gap: 8px; }
  .contact-card { padding: 32px 22px; }
  .flower { right: 18px; top: -58px; width: 50px; }
  .btn { font-size: 17px; padding: 11px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Barre d'administration WordPress */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }
