/* ==========================================================================
   Pompes Funèbres Casanova — feuille de style
   Fond blanc, bandeaux et encadrés grège, texte brun-gris.
   ========================================================================== */

:root {
  --white: #ffffff;
  --beige: #e4dfd6;
  --beige-light: #f2efe9;
  --line: #cfc7ba;
  --brown: #5b5148;
  --brown-dark: #423a33;
  --ink: #322c27;
  --muted: #6a625a;

  --serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --sans: "Lato", "Helvetica Neue", Arial, sans-serif;

  --container: 1140px;
  --nav-h: 50px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--ink); font-family: var(--sans); font-size: 16.5px; line-height: 1.65; }
img { max-width: 100%; display: block; }
a { color: var(--brown); }
a:hover { color: var(--ink); }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--brown); outline-offset: 2px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.25; color: var(--ink); margin: 0 0 .6em; }
h1 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); }
h2 { font-size: clamp(1.45rem, 2.4vw, 1.8rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 780px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -60px; background: var(--ink); color: var(--white); padding: 8px 14px; z-index: 100; }
.skip-link:focus { top: 8px; color: var(--white); }
.phone-num, .urgent-square__phone, .masthead__phone strong, .footer__phone { font-variant-numeric: lining-nums; white-space: nowrap; }

/* ---------- Boutons ---------- */
.btn { display: inline-block; padding: 11px 22px; border: 1px solid var(--brown); border-radius: 2px; font-family: var(--sans); font-weight: 700; font-size: .92rem; letter-spacing: .03em; text-decoration: none; text-align: center; background: var(--brown); color: var(--white); }
.btn:hover { background: var(--brown-dark); border-color: var(--brown-dark); color: var(--white); }
.btn--ghost { background: transparent; color: var(--brown); }
.btn--ghost:hover { background: var(--beige-light); color: var(--ink); }
.btn--sm { padding: 7px 14px; font-size: .86rem; }

/* ---------- Bandeau d'informations ---------- */
.topbar { background: var(--beige); font-size: .86rem; color: var(--muted); }
.topbar__inner { display: flex; justify-content: space-between; gap: 16px; min-height: 34px; align-items: center; flex-wrap: wrap; }

/* ---------- Nom et téléphone ---------- */
.masthead { background: var(--white); border-bottom: 1px solid var(--line); }
.masthead__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 92px; }
.brand { font-family: var(--serif); font-size: 1.65rem; color: var(--ink); text-decoration: none; line-height: 1.2; }
.brand:hover { color: var(--ink); }
.masthead__phone { display: flex; flex-direction: column; align-items: flex-end; text-decoration: none; color: var(--ink); line-height: 1.25; }
.masthead__phone span { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.masthead__phone strong { font-family: var(--serif); font-size: 1.45rem; font-weight: 400; color: var(--brown-dark); }

/* ---------- Navigation ---------- */
.navbar { position: sticky; top: 0; z-index: 50; background: var(--beige); border-bottom: 1px solid var(--line); }
.navbar__inner { display: flex; align-items: center; gap: 12px; min-height: var(--nav-h); }
.nav { display: flex; }
.nav a { display: block; padding: 13px 18px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: .92rem; white-space: nowrap; }
.nav a:first-child { padding-left: 0; }
.nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.nav a[aria-current="page"] { color: var(--brown); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.lang { margin-left: auto; display: flex; align-items: center; font-size: .85rem; color: var(--muted); }
.lang button { border: 0; background: none; padding: 6px 7px; color: var(--muted); font-weight: 700; letter-spacing: .04em; }
.lang button + button::before { content: "|"; margin-right: 14px; color: var(--line); font-weight: 400; }
.lang button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.burger { display: none; border: 1px solid var(--brown); border-radius: 2px; background: var(--white); color: var(--ink); padding: 6px 12px; font-weight: 700; font-size: .9rem; align-items: center; gap: 8px; }
.burger svg { width: 18px; height: 18px; }

/* ---------- Bannière d'accueil ---------- */
.hero { position: relative; }
.hero__img { width: 100%; height: 470px; object-fit: cover; object-position: center 45%; }
.hero__inner { position: absolute; inset: 0; display: flex; justify-content: flex-end; align-items: flex-end; padding-bottom: 32px; pointer-events: none; }
.hero__inner > * { pointer-events: auto; }

/* Le carré « Urgence décès 24h/24 » */
.urgent-square { width: 280px; aspect-ratio: 1 / 1; background: var(--brown); color: var(--white); padding: 26px; display: flex; flex-direction: column; justify-content: space-between; }
.urgent-square__label { display: block; font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.urgent-square__big { display: block; font-family: var(--serif); font-size: 2.6rem; line-height: 1.1; margin-top: 4px; }
.urgent-square__phone { display: block; font-family: var(--serif); font-size: 1.5rem; color: var(--white); text-decoration: none; margin-bottom: 12px; }
.urgent-square__phone:hover { color: var(--white); text-decoration: underline; }
.urgent-square .btn { display: block; background: var(--white); color: var(--brown-dark); border-color: var(--white); }
.urgent-square .btn:hover { background: var(--beige-light); color: var(--ink); }
.urgent-square--inline { width: auto; aspect-ratio: auto; gap: 14px; }

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section--beige { background: var(--beige); }
.section--tight { padding: 40px 0; }
.section__head { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin-bottom: 20px; }
.section__head h2 { margin: 0; }

.intro { display: grid; grid-template-columns: 1.3fr .9fr; gap: 48px; align-items: start; }
.intro p { color: var(--muted); }
.intro__box { background: var(--beige); padding: 24px 26px; }
.intro__box p { color: var(--ink); }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile { display: block; padding: 20px 18px; background: var(--beige); border: 1px solid var(--beige); color: var(--ink); text-decoration: none; font-family: var(--serif); font-size: 1.05rem; text-align: center; }
.tile:hover { border-color: var(--brown); color: var(--brown); }

/* ---------- En-tête des pages intérieures ---------- */
.page-hero { background: var(--beige); padding: 30px 0 26px; }
.page-hero h1 { margin: 0; }

/* ---------- Avis de décès ---------- */
.demo-banner { background: var(--beige-light); border: 1px solid var(--line); padding: 8px 14px; font-size: .9rem; color: var(--muted); margin: 0 0 20px; }
.filters { background: var(--beige-light); border: 1px solid var(--line); padding: 18px 20px; margin-bottom: 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip { border: 1px solid var(--line); background: var(--white); color: var(--ink); padding: 5px 12px; border-radius: 2px; font-size: .88rem; }
.chip:hover { border-color: var(--brown); }
.chip[aria-pressed="true"] { background: var(--brown); border-color: var(--brown); color: var(--white); }
.filters__fields { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto; gap: 12px; align-items: end; }
.results-meta { margin-bottom: 4px; color: var(--muted); font-size: .9rem; }

.avis-list { border-top: 1px solid var(--line); }
.avis-row { display: grid; grid-template-columns: 1.25fr 1.25fr 1.25fr auto; gap: 20px; align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--line); }
.avis-row__name { font-family: var(--serif); font-size: 1.12rem; line-height: 1.35; }
.avis-row__name a { color: var(--ink); text-decoration: none; }
.avis-row__name a:hover { text-decoration: underline; }
.surname { text-transform: uppercase; letter-spacing: .03em; }
.nee { display: block; font-family: var(--sans); font-size: .88rem; font-style: italic; color: var(--muted); }
.avis-row__info, .avis-row__funeral { font-size: .93rem; color: var(--muted); }
.avis-row__info strong { color: var(--ink); font-weight: 700; }
.avis-row__link { font-size: .9rem; font-weight: 700; white-space: nowrap; }
.empty-state { padding: 28px 0; color: var(--muted); border-bottom: 1px solid var(--line); }
.more-wrap { text-align: center; margin-top: 24px; }

/* Fiche d'un avis */
.back-link { display: inline-block; margin-bottom: 20px; font-size: .92rem; }
.avis-head { text-align: center; margin-bottom: 26px; }
.avis-head h1 { margin-bottom: 4px; }
.avis-head .nee { font-size: .95rem; }
.avis-head p { margin: 8px 0 0; color: var(--muted); }
.avis-photo { width: 160px; margin: 0 auto 18px; border: 1px solid var(--line); }
.avis-text { font-family: var(--serif); font-size: 1.08rem; line-height: 1.8; white-space: pre-line; text-align: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 28px 10px; }
.avis-thanks { margin: 16px 0 0; color: var(--muted); font-style: italic; text-align: center; }
.avis-block { margin-top: 40px; }
.avis-block > h2 { font-size: 1.35rem; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 200px 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px dotted var(--line); }
.timeline time { font-weight: 700; font-size: .95rem; }
.timeline p { margin: 0; color: var(--muted); }
.timeline strong { color: var(--ink); }
.condolence { padding: 12px 0; border-bottom: 1px dotted var(--line); }
.condolence p { margin: 0 0 4px; }
.condolence footer { font-size: .86rem; color: var(--muted); }
.avis-tools { margin-top: 30px; font-size: .9rem; color: var(--muted); text-align: center; }
.avis-tools a, .avis-tools button { background: none; border: 0; padding: 0; color: var(--brown); text-decoration: underline; font-size: inherit; }
.avis-tools span { margin: 0 8px; color: var(--line); }

.cta-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 20px; text-align: center; }
.cta-line p { margin: 0; }
.cta-band--line { border-top: 1px solid var(--line); }
.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn--block { display: block; width: 100%; }
.aside-card p + .btn, .aside-card .btn + .btn, .aside-card ul + .btn { margin-top: 12px; }
.aside-sticky > * + * { margin-top: 18px; }
.topbar__right { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.topbar a { color: inherit; }

/* ---------- Formulaires ---------- */
.form-card { background: var(--white); }
.section--beige .form-card { padding: 28px 32px; border: 1px solid var(--line); }
.form-card > h2 { margin-bottom: 4px; }
.form-card > p { color: var(--muted); font-size: .92rem; }
fieldset { border: 0; border-top: 1px solid var(--line); padding: 18px 0 0; margin: 0 0 22px; }
legend { font-family: var(--serif); font-size: 1.12rem; color: var(--ink); padding: 0 10px 0 0; }
.legend-num::after { content: "."; }
.legend-num { margin-right: 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label, .label { font-size: .9rem; font-weight: 700; color: var(--ink); }
.label--block { display: block; margin: 12px 0 6px; }
.field .hint { font-size: .8rem; color: var(--muted); }
.req { color: #9a4f35; }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="search"], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #c3baad; border-radius: 2px; background: var(--white); color: var(--ink); font: inherit; font-size: .97rem;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--beige); border-color: var(--brown); }

.choices { display: flex; flex-wrap: wrap; gap: 6px 24px; }
.choice { display: inline-flex; align-items: center; gap: 8px; font-size: .97rem; cursor: pointer; }
.choice input { width: 17px; height: 17px; margin: 0; accent-color: var(--brown); flex: none; }

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--muted); margin: 6px 0 18px; }
.consent input { width: 17px; height: 17px; margin-top: 3px; accent-color: var(--brown); flex: none; }
.form-actions { display: flex; align-items: center; gap: 14px; }
.form-success { display: none; padding: 20px; background: var(--beige-light); border: 1px solid var(--line); }
.form-success h3 { margin-bottom: 6px; }
.form-success p { margin: 0 0 4px; color: var(--muted); }
form.is-sent > *:not(.form-success) { display: none; }
form.is-sent .form-success { display: block; }
.form-error { display: none; color: #9a4f35; font-size: .9rem; margin-top: 10px; }
.form-error.is-visible { display: block; }
.icon-circle { display: none; }

.paths { display: flex; flex-wrap: wrap; gap: 10px; }
.path { display: block; padding: 12px 18px; background: var(--beige-light); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.path:hover { border-color: var(--brown); color: var(--ink); }
.path h2 { font-size: 1.05rem; margin: 0; }
.path p { margin: 0; font-size: .88rem; color: var(--muted); }
.path > svg { display: none; }

.compare { margin: 0 0 18px; }
.compare > div { margin-bottom: 8px; }
.compare h3 { display: inline; font-family: var(--sans); font-size: .95rem; font-weight: 700; }
.compare h3::after { content: " : "; }
.compare p { display: inline; color: var(--muted); font-size: .95rem; }

.form-layout { display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: start; }
.aside-sticky { position: sticky; top: calc(var(--nav-h) + 20px); display: grid; gap: 14px; }
.aside-card { background: var(--beige); padding: 20px 22px; }
.aside-card h3 { margin-bottom: 8px; }
.checklist { margin: 0; padding-left: 18px; color: var(--ink); font-size: .95rem; }
.checklist li { margin-bottom: 4px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 320px 1fr; gap: 40px; align-items: start; }
.info-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.info-list .label { display: block; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.hours { width: 100%; border-collapse: collapse; font-size: .93rem; }
.hours td { padding: 5px 0; border-bottom: 1px dotted #c3baad; }
.hours td:last-child { text-align: right; }
.hours tr:last-child td { border-bottom: 0; }
.map { border: 1px solid var(--line); width: 100%; height: 380px; display: block; }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--beige); color: var(--muted); font-size: .92rem; padding-top: 40px; }
.site-footer a { color: var(--brown-dark); }
.footer__grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 32px; padding-bottom: 28px; }
.site-footer h3 { font-family: var(--sans); font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); margin-bottom: 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.footer__brand .brand { font-size: 1.15rem; display: block; margin-bottom: 8px; }
.footer__phone { display: block; font-family: var(--serif); font-size: 1.25rem; color: var(--ink) !important; text-decoration: none; margin-bottom: 4px; }
.footer__bottom { border-top: 1px solid var(--line); padding: 14px 0; display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: space-between; font-size: .84rem; }
.footer__bottom nav { display: flex; flex-wrap: wrap; gap: 16px; }

.callbar { display: none; }

.legal h2 { font-size: 1.3rem; margin-top: 32px; }
.legal p, .legal li { color: var(--muted); }

@media print {
  .topbar, .masthead, .navbar, .site-footer, .callbar, .avis-tools, .back-link, #condolence-form-wrap, .page-hero, .demo-banner, .cta-band { display: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .intro, .form-layout, .contact-grid { grid-template-columns: 1fr; gap: 28px; }
  .aside-sticky { position: static; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .avis-row { grid-template-columns: 1fr 1fr; gap: 6px 20px; }
  .filters__fields { grid-template-columns: 1fr 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .nav { display: none; }
  .burger { display: inline-flex; }
  .nav.is-open { display: flex; flex-direction: column; position: absolute; left: 0; right: 0; top: 100%; background: var(--beige); border-bottom: 1px solid var(--line); padding: 4px 16px 10px; }
  .nav.is-open a { padding: 11px 0; border-bottom: 1px solid var(--line); }
  .nav.is-open a:last-child { border-bottom: 0; }
}

@media (max-width: 640px) {
  body { padding-bottom: 58px; }
  .container { padding: 0 16px; }
  .topbar { display: none; }
  .masthead__inner { min-height: 70px; gap: 12px; }
  .brand { font-size: 1.2rem; }
  .masthead__phone span { font-size: .7rem; }
  .masthead__phone strong { font-size: 1.05rem; }
  .hero__img { height: 240px; }
  .hero__inner { position: static; padding: 0; display: block; }
  .urgent-square { width: auto; aspect-ratio: auto; gap: 12px; }
  .section { padding: 44px 0; }
  .section--tight { padding: 28px 0; }
  .form-grid, .filters__fields { grid-template-columns: 1fr; }
  .avis-row { grid-template-columns: 1fr; gap: 2px; }
  .avis-row__link { margin-top: 6px; }
  .timeline li { grid-template-columns: 1fr; gap: 0; }
  .footer__grid { grid-template-columns: 1fr; gap: 22px; }
  .section__head { flex-direction: column; gap: 4px; }
  .map { height: 280px; }
  .callbar { display: grid; grid-template-columns: 1.5fr 1fr 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--beige); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .callbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 56px; color: var(--ink); text-decoration: none; font-size: .78rem; font-weight: 700; }
  .callbar a:first-child { background: var(--brown); color: var(--white); }
  .callbar svg { width: 19px; height: 19px; }
}

/* Devise sous le nom */
.brand-wrap { display: flex; flex-direction: column; gap: 2px; }
.motto { font-family: var(--serif); font-style: italic; font-size: .95rem; color: var(--muted); }
