/* foraine.css : terrassement-montauban : Terres du Bas-Quercy
   Reset → tokens → composants → pages → responsive (fin de fichier). Préfixe .tbq- */

/* ===== 1. RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } } /* la seule animation du site (.tbq-reveal) est déjà scopée à prefers-reduced-motion: no-preference, cf. § 3 */
body { min-height: 100%; }
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; border: none; background: none; cursor: pointer; }
ul, ol { list-style: none; }
input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--tbq-brique); outline-offset: 2px; }

/* ===== 2. TOKENS ===== */
:root {
  --tbq-argile: #E4D3B8;
  --tbq-brique: #A8452E;
  --tbq-brique-clair: #C15C3F;
  --tbq-brique-texte: #8A3A22; /* variante assombrie de --brique, réservée au texte/liens sur fond clair (AA >= 4.5, mesuré contrast_check.py) */
  --tbq-nuit: #241B17;
  --tbq-galet: #6B7268;
  --tbq-blanc: #FAF7F2;
  --tbq-vigne: #5B6B3F;
  --tbq-radius: 3px;
  --tbq-ombre: 0 6px 18px rgba(36, 27, 23, .16);
  --tbq-ease: cubic-bezier(.22, .61, .36, 1);
  --tbq-marge: clamp(20px, 4vw, 64px);
  --tbq-display: "Bitter", Georgia, serif;
  --tbq-corps: "Work Sans", -apple-system, sans-serif;
  --tbq-mono: "JetBrains Mono", "Courier New", monospace;
}

/* ===== fontes auto-hébergées (4 fichiers, sop-coding § 4) ===== */
@font-face { font-family: "Bitter"; src: url("../fonts/bitter-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Work Sans"; src: url("../fonts/work-sans-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Work Sans"; src: url("../fonts/work-sans-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

body { font-family: var(--tbq-corps); font-weight: 400; font-size: 17px; line-height: 1.55; color: var(--tbq-nuit); background: var(--tbq-blanc); }
h1, h2, h3 { font-family: var(--tbq-display); font-weight: 700; line-height: 1.1; }
h1 { font-size: 56px; }
h2 { font-size: 34px; }
h3 { font-size: 22px; }
p { max-width: 68ch; }
.tbq-mono { font-family: var(--tbq-mono); font-weight: 500; font-size: 14px; letter-spacing: 0; }

/* ===== 3. COMPOSANTS ===== */

.tbq-conteneur { max-width: 1180px; margin: 0 auto; padding: 0 var(--tbq-marge); }

/* -- Header -- */
.tbq-header { position: sticky; top: 0; z-index: 30; background: var(--tbq-blanc); border-bottom: 1px solid var(--tbq-galet); }
.tbq-header__barre { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px var(--tbq-marge); max-width: 1180px; margin: 0 auto; flex-wrap: nowrap; }
.tbq-logo { display: flex; align-items: center; gap: 8px; font-family: var(--tbq-display); font-weight: 700; font-size: 17px; color: var(--tbq-nuit); white-space: nowrap; flex: none; }
.tbq-logo svg { width: 28px; height: 28px; flex: none; }
.tbq-nav { display: flex; align-items: center; gap: 14px; flex-wrap: nowrap; overflow: hidden; }
.tbq-nav a { font-weight: 600; font-size: 14px; padding: 6px 1px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tbq-nav a:hover { border-color: var(--tbq-brique); }
.tbq-header__tel { display: flex; align-items: center; gap: 6px; font-family: var(--tbq-mono); font-weight: 500; font-size: 14px; color: var(--tbq-brique); white-space: nowrap; flex: none; }
.tbq-header__tel svg { width: 18px; height: 18px; flex: none; }
.tbq-nav-toggle { display: none; }

/* -- Bouton -- */
.tbq-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 18px; padding: 15px 28px; border-radius: var(--tbq-radius); background: var(--tbq-brique); color: var(--tbq-blanc); min-height: 44px; transition: background-color .18s var(--tbq-ease); }
.tbq-btn:hover { background: var(--tbq-brique-clair); }
.tbq-btn--plein-largeur { width: 100%; }
.tbq-btn--contour { background: transparent; border: 2px solid var(--tbq-blanc); color: var(--tbq-blanc); }
.tbq-btn--contour:hover { background: var(--tbq-blanc); color: var(--tbq-brique); }

/* -- Signature : l'arche de brique -- */
.tbq-arche { display: block; width: 100%; height: 64px; }
.tbq-arche--reduite { width: 240px; height: 32px; margin: 0 auto; }
.tbq-arche path.brique { stroke-width: 2px; }

/* -- Hero -- */
.tbq-hero { position: relative; min-height: 600px; display: flex; flex-direction: column; justify-content: flex-start; align-items: center; text-align: center; padding: 40px var(--tbq-marge) 80px; background: var(--tbq-nuit) center/cover no-repeat; overflow: hidden; }
.tbq-hero__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.tbq-hero__voile { position: absolute; inset: 0; background: rgba(36, 27, 23, .45); z-index: 1; }
.tbq-hero__corps { position: relative; z-index: 2; max-width: 760px; color: var(--tbq-blanc); }
.tbq-hero h1 { color: var(--tbq-blanc); font-size: 44px; margin-bottom: 10px; }
.tbq-hero__accroche { font-size: 18px; font-weight: 600; margin-bottom: 10px; }
.tbq-hero__faits { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; color: var(--tbq-argile); margin-bottom: 6px; }
.tbq-hero__faits span:not(:last-child)::after { content: "·"; margin-left: 14px; color: var(--tbq-argile); }
.tbq-hero__arche-place { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; }

/* -- Carte de devis (formulaire classique, DR § 19) -- */
.tbq-carte-devis { position: relative; z-index: 3; margin: 18px auto -170px; max-width: 440px; width: 100%; background: var(--tbq-blanc); border: 1px solid var(--tbq-brique); border-radius: var(--tbq-radius); box-shadow: var(--tbq-ombre); padding: 18px 22px 18px; text-align: left; }
.tbq-carte-devis__accroche { font-weight: 600; font-size: 16px; color: var(--tbq-brique); margin-bottom: 10px; }
.tbq-champ { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.tbq-champ label { font-size: 13px; font-weight: 600; color: var(--tbq-nuit); }
.tbq-champ input, .tbq-champ select { border: 1px solid var(--tbq-galet); border-radius: var(--tbq-radius); padding: 9px 11px; font-size: 16px; background: var(--tbq-blanc); color: var(--tbq-nuit); width: 100%; min-width: 0; }
.tbq-champ input:focus, .tbq-champ select:focus { border-color: var(--tbq-brique); }
.tbq-ligne-double { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-width: 0; }
.tbq-ligne-double > * { min-width: 0; }
.tbq-contact, .tbq-contact > *, .tbq-zone > *, .tbq-service > *, .tbq-carte-devis { min-width: 0; }
.tbq-reassurance { font-size: 12px; color: var(--tbq-galet); margin-top: 8px; line-height: 1.4; }
.tbq-reassurance a { text-decoration: underline; }
.tbq-piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* -- Sticky CTA -- */
.tbq-sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; background: var(--tbq-nuit); border-top: 1px solid var(--tbq-brique); }
.tbq-sticky a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 10px; min-height: 56px; color: var(--tbq-blanc); font-weight: 600; font-size: 16px; }
.tbq-sticky a:first-child { background: var(--tbq-brique); }
.tbq-sticky svg { width: 20px; height: 20px; flex: none; }

/* -- Section générique -- */
.tbq-section { padding: 88px var(--tbq-marge); }
.tbq-section__tete { max-width: 760px; margin: 0 auto 44px; text-align: center; }
.tbq-section--argile { background: var(--tbq-argile); }
.tbq-section--blanc { background: var(--tbq-blanc); }
.tbq-section--nuit { background: var(--tbq-nuit); color: var(--tbq-blanc); }
.tbq-section--nuit h2, .tbq-section--nuit h3 { color: var(--tbq-blanc); }
.tbq-section--brique { background: var(--tbq-brique); color: var(--tbq-blanc); }
.tbq-section--brique h2, .tbq-section--brique h3 { color: var(--tbq-blanc); }
.tbq-filet { height: 1px; background: var(--tbq-brique); width: 72px; margin: 0 auto 20px; }

/* -- Zone -- */
.tbq-zone { display: grid; grid-template-columns: 7fr 5fr; gap: 48px; align-items: start; max-width: 1180px; margin: 0 auto; }
.tbq-zone p { max-width: 62ch; }
.tbq-zone__communes { margin-top: 18px; font-size: 16px; }
.tbq-zone__communes a { color: var(--tbq-brique-texte); text-underline-offset: 3px; text-decoration: underline; text-decoration-thickness: 2px; font-weight: 600; }
.tbq-zone__carte { border: 1px solid var(--tbq-galet); border-radius: var(--tbq-radius); overflow: hidden; background: var(--tbq-galet); min-height: 280px; position: relative; display: flex; align-items: center; justify-content: center; }
.tbq-zone__carte iframe { width: 100%; height: 320px; border: 0; display: block; }
.tbq-carte-charger { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--tbq-blanc); font-weight: 600; font-size: 15px; padding: 32px; min-height: 280px; width: 100%; justify-content: center; }
.tbq-carte-charger svg { width: 28px; height: 28px; }
.tbq-carte-charger:hover { background: rgba(250, 247, 242, .08); }

/* -- Services (liste éditoriale numérotée) -- */
.tbq-services { max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; gap: 56px; }
.tbq-service { display: grid; grid-template-columns: 5fr 7fr; gap: 36px; align-items: center; }
.tbq-service--inverse { grid-template-columns: 7fr 5fr; }
.tbq-service--inverse .tbq-service__media { order: 2; }
.tbq-service__num { font-family: var(--tbq-display); font-size: 46px; color: var(--tbq-brique); line-height: 1; margin-bottom: 6px; }
.tbq-service__media { border-radius: var(--tbq-radius); overflow: hidden; aspect-ratio: 4/3; background: var(--tbq-argile); }
.tbq-service__media img { width: 100%; height: 100%; object-fit: cover; }
.tbq-service__placeholder { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--tbq-nuit); background: var(--tbq-blanc); font-size: 13px; text-align: center; padding: 12px; border: 1px dashed var(--tbq-galet); }
.tbq-service__lien { display: inline-block; margin-top: 10px; font-weight: 600; color: var(--tbq-brique); text-decoration: underline; text-decoration-thickness: 2px; }

/* -- Sol (bande matière) -- */
.tbq-sol { max-width: 640px; margin: 0 auto; text-align: center; }
.tbq-sol figure { margin-top: 40px; }
.tbq-sol figcaption { font-family: var(--tbq-mono); font-size: 13px; margin-top: 10px; color: var(--tbq-blanc); }
.tbq-bande-galets { height: 26px; background-size: cover; background-position: center; margin-top: 40px; border-radius: var(--tbq-radius); background-color: var(--tbq-galet); }

/* -- Réalisations (mosaïque sans marge) -- */
.tbq-mosaique { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; max-width: 1180px; margin: 0 auto; }
.tbq-mosaique--paire { grid-template-columns: 1fr 1fr; }
.tbq-centre { text-align: center; }
.tbq-section--sans-haut { padding-top: 0; }
.tbq-carte-large { max-width: 1000px; margin: 0 auto; }
address .tbq-ligne { display: block; }
.tbq-mosaique__paire { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--tbq-argile); }
.tbq-mosaique__paire img { width: 100%; height: 100%; object-fit: cover; }
.tbq-mosaique__etiquette { position: absolute; left: 8px; bottom: 8px; background: rgba(36, 27, 23, .72); color: var(--tbq-argile); font-family: var(--tbq-mono); font-size: 12px; padding: 3px 8px; border-radius: var(--tbq-radius); }
.tbq-realisations-vide { max-width: 640px; margin: 0 auto; text-align: center; background: var(--tbq-argile); padding: 56px var(--tbq-marge); border-radius: var(--tbq-radius); }

/* -- Histoire -- */
.tbq-histoire { max-width: 620px; margin: 0 auto; text-align: center; }
.tbq-histoire__exergue { font-family: var(--tbq-display); font-weight: 700; font-size: 22px; color: var(--tbq-argile); margin-bottom: 18px; }
.tbq-histoire__materiel { margin-top: 22px; }

/* -- Avis -- */
.tbq-avis-vide { max-width: 560px; margin: 0 auto; text-align: center; }
.tbq-avis-vide a { font-weight: 600; color: var(--tbq-brique-texte); text-decoration: underline; }
.tbq-avis-liste { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.tbq-avis-item { border-top: 1px solid var(--tbq-galet); padding-top: 18px; }
.tbq-avis-item__etoiles { color: var(--tbq-brique-texte); font-family: var(--tbq-mono); font-size: 14px; }
.tbq-avis-item__meta { font-size: 14px; color: var(--tbq-nuit); margin-top: 4px; }

/* -- FAQ (accordéon natif) -- */
.tbq-faq { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 4px; }
.tbq-faq details { border-bottom: 1px solid var(--tbq-galet); padding: 18px 0; }
.tbq-faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; font-family: var(--tbq-display); font-weight: 700; font-size: 18px; }
.tbq-faq summary::-webkit-details-marker { display: none; }
.tbq-faq summary svg { width: 18px; height: 18px; flex: none; transition: transform .2s var(--tbq-ease); }
.tbq-faq details[open] summary svg { transform: rotate(45deg); }
.tbq-faq p { margin-top: 12px; max-width: none; }

/* -- Bande contact -- */
.tbq-cta-final { text-align: center; }
.tbq-cta-final h2 { margin-bottom: 24px; }
.tbq-cta-final .tbq-carte-devis { margin: 0 auto; }

/* -- Footer -- */
.tbq-footer { background: var(--tbq-nuit); color: var(--tbq-blanc); padding: 0 var(--tbq-marge) 32px; }
.tbq-footer__arche { max-width: 1180px; margin: 0 auto; padding-top: 32px; }
.tbq-footer__grille { max-width: 1180px; margin: 20px auto 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; padding-top: 24px; }
.tbq-footer h3 { font-size: 16px; color: var(--tbq-argile); margin-bottom: 14px; }
.tbq-footer address { font-style: normal; font-size: 15px; line-height: 1.7; }
.tbq-footer a { font-size: 15px; opacity: .92; }
.tbq-footer ul { display: flex; flex-direction: column; gap: 8px; }
.tbq-footer__bas { max-width: 1180px; margin: 32px auto 0; padding-top: 20px; border-top: 1px solid var(--tbq-galet); font-size: 13px; color: var(--tbq-argile); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* -- Fil d'Ariane -- */
.tbq-fil-ariane { max-width: 1180px; margin: 0 auto; padding: 16px var(--tbq-marge) 0; font-size: 14px; color: var(--tbq-galet); }
.tbq-fil-ariane a { text-decoration: underline; }

/* -- Hero de page (sous-service) -- */
.tbq-hero-page { position: relative; min-height: 420px; display: flex; align-items: center; padding: 56px var(--tbq-marge); background: var(--tbq-brique) center/cover no-repeat; color: var(--tbq-blanc); overflow: hidden; }
.tbq-hero-page__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.tbq-hero-page__voile { position: absolute; inset: 0; background: rgba(36, 27, 23, .5); z-index: 1; }
.tbq-hero-page__corps { position: relative; z-index: 2; max-width: 640px; }
.tbq-hero-page h1 { color: var(--tbq-blanc); font-size: 40px; }

/* -- Page article (sous-service) -- */
.tbq-article { max-width: 720px; margin: 0 auto; padding: 72px var(--tbq-marge); display: flex; flex-direction: column; gap: 28px; }
.tbq-article h2 { margin-top: 8px; }
.tbq-article__liees { max-width: 1000px; margin: 0 auto; padding: 0 var(--tbq-marge) 72px; }
.tbq-aussi { max-width: 780px; margin: 0 auto; padding: 0 var(--tbq-marge) 88px; text-align: center; }
.tbq-aussi ul { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-top: 16px; }
.tbq-aussi a { font-weight: 600; color: var(--tbq-brique); text-decoration: underline; }

/* -- Contact page -- */
.tbq-contact { max-width: 1000px; margin: 0 auto; padding: 72px var(--tbq-marge); display: grid; grid-template-columns: 1fr 1fr; gap: 56px; }
.tbq-contact__infos address { line-height: 1.8; }
.tbq-contact__infos h3 { margin-top: 24px; margin-bottom: 8px; }
.tbq-contact .tbq-carte-devis { margin: 0; max-width: none; }

/* -- Pages simples (confidentialité, merci, 404) -- */
.tbq-page-simple { max-width: 720px; margin: 0 auto; padding: 88px var(--tbq-marge) 120px; }
.tbq-page-simple h2 { margin-top: 32px; margin-bottom: 12px; }
.tbq-page-simple p { margin-bottom: 14px; }
.tbq-404 { text-align: center; padding: 140px var(--tbq-marge); }
.tbq-404 h1 { margin-bottom: 16px; }

/* ===== reveal léger (§ 11, sans lib, reduced-motion respecté) ===== */
@media (prefers-reduced-motion: no-preference) {
  .tbq-reveal { animation: tbq-apparait .5s var(--tbq-ease) both; }
  @keyframes tbq-apparait { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* ===== 4. RESPONSIVE (fin de fichier) ===== */
@media (max-width: 1023px) {
  .tbq-zone { grid-template-columns: 1fr; }
  .tbq-service, .tbq-service--inverse { grid-template-columns: 1fr; }
  .tbq-service--inverse .tbq-service__media { order: 0; }
  .tbq-footer__grille { grid-template-columns: repeat(2, 1fr); }
  .tbq-contact { grid-template-columns: 1fr; }
  .tbq-nav { display: none; } /* S5 : header minimal (logo + tél) sous 1024 px, services atteignables dans la page */
}
@media (max-width: 480px) {
  .tbq-logo span { display: none; } /* icône seule : le nom complet reste dans le H1/footer */
  .tbq-header__barre { padding: 10px 16px; gap: 10px; }
  .tbq-header__tel { font-size: 13px; }
}
@media (max-width: 767px) {
  h1 { font-size: 34px; }
  h2 { font-size: 26px; }
  h3 { font-size: 19px; }
  .tbq-hero { min-height: 0; padding: 32px 20px 200px; }
  .tbq-hero h1 { font-size: 32px; }
  .tbq-carte-devis { margin: 16px 0 -170px; max-width: none; }
  .tbq-ligne-double { grid-template-columns: 1fr; }
  .tbq-nav { display: none; }
  .tbq-section { padding: 56px 20px; }
  .tbq-mosaique { grid-template-columns: 1fr 1fr; }
  .tbq-footer__grille { grid-template-columns: 1fr 1fr; gap: 24px; }
  body { padding-bottom: 56px; } /* réserve pour le sticky */
}
