/* ==========================================================================
   Mon Budget Immo · pages intérieures (FAQ, Contact, Blog, pages légales)
   Complète styles.css : mêmes jetons, mêmes composants.
   ========================================================================== */

.nav__links a[aria-current="page"] { background: rgba(11, 11, 18, 0.07); font-weight: 500; }
.menu__links a[aria-current="page"] { color: var(--color-iris); }

/* ---------- En-tête de page ---------- */
.phead { position: relative; isolation: isolate; overflow: clip; padding: clamp(140px, 20vh, 200px) 0 clamp(56px, 8vw, 96px); text-align: center; }
.phead--compact { padding-bottom: clamp(40px, 5vw, 64px); }
.phead__bg { position: absolute; inset: 0; z-index: -1; }
.phead::after { content: ""; position: absolute; inset: auto 0 0; height: 40%; z-index: -1; background: linear-gradient(transparent, var(--color-canvas)); }
.phead__in { display: flex; flex-direction: column; align-items: center; }
.phead__title { max-width: 900px; font-size: clamp(40px, 6.2vw, 72px); line-height: 1.02; letter-spacing: -0.05em; }
.phead--compact .phead__title { font-size: clamp(34px, 4.6vw, 54px); }
.phead__lead { margin-top: 22px; max-width: 640px; font-size: clamp(16px, 1.5vw, 18px); color: var(--color-graphite); text-wrap: pretty; }
.phead__cta { margin-top: 32px; }

.card h2 { font-size: clamp(20px, 2vw, 26px); font-weight: 500; letter-spacing: -0.035em; line-height: 1.15; }

/* ==========================================================================
   FAQ
   ========================================================================== */
.faq { padding-bottom: var(--section); }
.faq__grid { display: grid; gap: 40px; }
.faq__card { display: grid; gap: 4px; --spot: rgba(184, 202, 245, 0.45); }
.faq__actions { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px; }
.faq__list { display: grid; gap: 48px; }
.faq__group { display: grid; gap: 10px; }
.faq__gtitle { margin-bottom: 10px; font-size: clamp(22px, 2.4vw, 28px); letter-spacing: -0.035em; }

.qa {
  border-radius: var(--radius-2xl); background: var(--color-white);
  box-shadow: 0 0 0 1px var(--hairline);
  transition: box-shadow 0.3s var(--ease-out);
}
.qa[open] { box-shadow: 0 0 0 1px var(--hairline), var(--shadow-md); }
.qa summary {
  list-style: none; display: flex; align-items: center; gap: 16px;
  padding: 20px 24px; border-radius: inherit; cursor: pointer;
  font-size: 18px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.3;
}
.qa summary::-webkit-details-marker { display: none; }
/* le repère reste à gauche, juste avant la question */
.qa summary::before {
  content: ""; flex: none; width: 28px; height: 28px; border-radius: 9px;
  background: var(--color-cloud) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28' fill='none' stroke='%230b0b12' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M14 9v10M9 14h10'/%3E%3C/svg%3E") center / 28px;
}
.qa[open] summary::before { rotate: 45deg; background-color: var(--color-periwinkle); }
.qa summary:hover::before { background-color: var(--color-periwinkle); }
.qa__body { padding: 0 24px 24px 68px; color: var(--color-graphite); }
.qa__body > * + * { margin-top: 12px; }
.qa__body ul, .qa__body ol { display: grid; gap: 8px; }
.qa__body ol { list-style: decimal; padding-left: 20px; }
.qa__body ul li { display: flex; align-items: baseline; gap: 10px; }
.qa__body ul li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 2px; background: var(--color-iris); translate: 0 -2px; }
.qa__body ul li:has(.grade) { align-items: center; }
.qa__body ul li:has(.grade)::before { display: none; }
.qa__body a, .legal__body a, .field--check a { color: var(--color-iris); text-underline-offset: 3px; }
.qa__body strong { color: var(--color-ink); font-weight: 500; }

/* ouverture animée : amélioration progressive, sans effet si le navigateur ne la gère pas */
.qa::details-content { interpolate-size: allow-keywords; overflow: clip; contain: layout; }
.qa:not([open])::details-content { block-size: 0; }
@media (prefers-reduced-motion: no-preference) {
  .qa summary::before { transition: rotate 0.3s var(--ease-out), background-color 0.3s; }
  .qa::details-content { transition: block-size 0.35s var(--ease-out), content-visibility 0.35s, display 0.35s; transition-behavior: allow-discrete; }
}

@media (min-width: 960px) {
  .faq__grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 72px; align-items: start; }
  .faq__aside { position: sticky; top: 104px; }
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact { padding-bottom: var(--section); }
.contact__grid { display: grid; gap: 16px; }
.contact__side { display: grid; gap: 16px; align-content: start; }
.contact__side .card { display: grid; gap: 4px; justify-items: start; }
.contact__side .btn { margin-top: 20px; }
.contact__demo { --spot: rgba(155, 216, 169, 0.4); background: linear-gradient(160deg, #fff 40%, #eef7f0); }
.contact__faq { --spot: rgba(253, 233, 155, 0.5); }

.form { display: grid; gap: 20px; overflow: visible; }
.form__intro { margin-top: -12px !important; font-size: 14px; }
.form__row { display: grid; gap: 20px; }
.field { display: grid; gap: 6px; align-content: start; }
.field label { font-weight: 500; font-size: 15px; color: var(--color-ink); }
.field__opt { margin-left: 6px; font-family: var(--font-mono); font-size: 11px; font-weight: 400; color: var(--color-mist); }
.field__hint { font-size: 13px; color: var(--color-graphite); }
.field input:not([type="checkbox"]), .field textarea {
  width: 100%; min-height: 52px; padding: 14px 16px;
  border: 1px solid rgba(11, 11, 18, 0.16); border-radius: var(--radius-xl);
  background: var(--color-canvas); color: var(--color-ink);
  font: inherit; letter-spacing: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.field textarea { resize: vertical; min-height: 148px; }
.field input:hover, .field textarea:hover { border-color: rgba(11, 11, 18, 0.34); }
.field input:focus-visible, .field textarea:focus-visible { outline: none; border-color: var(--color-iris); background: var(--color-white); box-shadow: 0 0 0 4px rgba(62, 72, 205, 0.16); }

/* l'erreur n'apparaît qu'après une saisie ou une tentative d'envoi */
.field__error { display: none; margin: 0 !important; font-size: 14px; color: #b3261e !important; }
.field__error span { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 4px; border-radius: 50%; background: #b3261e; color: #fff; font-size: 12px; font-weight: 600; }
.field :is(input, textarea):user-invalid { border-color: #b3261e; background: #fdf1f0; }
.field :is(input, textarea):user-invalid ~ .field__error { display: block; }
.field :is(input:not([type="checkbox"]), textarea):required:user-valid { border-color: var(--grade-a); }

.field--check { grid-template-columns: 24px 1fr; gap: 6px 12px; align-items: start; }
.field--check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--color-iris); }
.field--check label { font-weight: 400; color: var(--color-graphite); }
.field--check .field__error { grid-column: 2; }
.form__submit { justify-self: start; }
.form__status { margin: 0 !important; padding: 14px 16px; border-radius: var(--radius-xl); background: #eef7f0; color: var(--color-ink) !important; font-size: 15px; }

@media (min-width: 640px) { .form__row { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .contact__grid { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); align-items: start; } }

/* ==========================================================================
   Blog
   ========================================================================== */
.blog { padding-bottom: var(--section); }
.posts { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.post {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--radius-3xl); background: var(--color-white);
  box-shadow: 0 0 0 1px var(--hairline), 0 20px 40px -28px rgba(11, 11, 18, 0.2);
  transition: translate 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
  --spot: rgba(184, 202, 245, 0.35);
}
.post:hover { translate: 0 -6px; box-shadow: 0 0 0 1px var(--hairline), var(--shadow-xl); }
.post__media { display: block; overflow: hidden; aspect-ratio: 768 / 403; background: var(--color-cloud); }
.post__media img { width: 100%; height: 100%; object-fit: cover; transition: scale 0.8s var(--ease-out); }
.post:hover .post__media img { scale: 1.04; }
.post__body { display: flex; flex-direction: column; gap: 12px; flex: 1; padding: 24px; }
.post__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-graphite); }
.post__cat { padding: 4px 10px; border-radius: 9999px; background: var(--color-periwinkle); color: var(--color-ink); }
.post__title { font-size: 20px; font-weight: 500; line-height: 1.25; letter-spacing: -0.03em; text-wrap: pretty; }
.post__title a { text-decoration: none; }
/* toute la carte est cliquable, un seul lien pour le clavier et les lecteurs d'écran */
.post__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.post__title a:focus-visible { outline: none; }
.post__title a:focus-visible::after { outline: 2px solid var(--color-iris); outline-offset: -4px; }
.post__excerpt { color: var(--color-graphite); font-size: 15px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.post__more { margin-top: auto; padding-top: 8px; font-weight: 500; color: var(--color-iris); }
.post:hover .btn__arrow { transform: translateX(4px); }

@media (min-width: 960px) {
  .post--lead { grid-column: 1 / -1; display: grid; grid-template-columns: 56% minmax(0, 1fr); align-items: center; }
  .post--lead .post__body { justify-content: center; padding: clamp(32px, 4vw, 56px); gap: 16px; }
  .post--lead .post__title { font-size: clamp(26px, 2.8vw, 36px); line-height: 1.12; letter-spacing: -0.04em; }
  .post--lead .post__excerpt { font-size: 17px; -webkit-line-clamp: 4; line-clamp: 4; }
  .post--lead .post__more { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .post, .post__media img { transition: none; }
  .post:hover { translate: none; }
  .post:hover .post__media img { scale: none; }
}

/* ==========================================================================
   Pages légales
   ========================================================================== */
.legal { padding-bottom: var(--section); }
.legal__grid { display: grid; gap: 32px; }
.legal__toc {
  padding: 24px; border-radius: var(--radius-2xl); background: var(--color-white); box-shadow: 0 0 0 1px var(--hairline);
  font-size: 14px;
}
.legal__toc-title { margin-bottom: 12px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-graphite); }
.legal__toc ol { display: grid; gap: 2px; }
.legal__toc a { display: block; padding: 7px 10px; margin-inline: -10px; border-radius: 8px; text-decoration: none; color: var(--color-graphite); line-height: 1.35; transition: background-color 0.2s, color 0.2s; }
.legal__toc a:hover, .legal__toc a.is-active { background: var(--color-cloud); color: var(--color-ink); }
.legal__body {
  padding: clamp(24px, 4vw, 56px); border-radius: var(--radius-3xl); background: var(--color-white);
  box-shadow: 0 0 0 1px var(--hairline), 0 20px 40px -28px rgba(11, 11, 18, 0.2);
  color: var(--color-graphite); line-height: 1.65; overflow-wrap: anywhere;
}
.legal__body > * + * { margin-top: 14px; }
.legal__body h2 { margin-top: 44px; scroll-margin-top: 104px; font-size: clamp(20px, 2.2vw, 26px); letter-spacing: -0.03em; line-height: 1.2; color: var(--color-ink); text-wrap: pretty; }
.legal__body h2:first-child { margin-top: 0; }
.legal__body h3 { margin-top: 28px; font-size: 17px; color: var(--color-ink); }
.legal__body strong { color: var(--color-ink); font-weight: 500; }
.legal__body ul { display: grid; gap: 8px; padding-left: 20px; list-style: disc; }

@media (min-width: 960px) {
  .legal__grid { grid-template-columns: 280px minmax(0, 1fr); gap: 48px; align-items: start; }
  .legal__toc { position: sticky; top: 104px; max-height: calc(100svh - 128px); overflow-y: auto; }
}

/* ==========================================================================
   Article de blog
   ========================================================================== */
.progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 90; pointer-events: none; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--color-iris), var(--color-sky)); transform-origin: left; transform: scaleX(0); }

.phead--article { padding-bottom: clamp(32px, 4vw, 56px); }
.phead--article .phead__title { max-width: 980px; font-size: clamp(32px, 4.6vw, 58px); line-height: 1.06; letter-spacing: -0.045em; }
.phead .eyebrow a { text-decoration: none; }
.phead .eyebrow a:hover { text-decoration: underline; text-underline-offset: 3px; }
.article__meta {
  margin-top: 24px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 14px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-graphite);
}
.article__meta span:not(.post__cat)::before { content: "·"; margin-right: 14px; color: var(--color-mist); }

.article__media { max-width: 1040px; margin-inline: auto; overflow: hidden; border-radius: var(--radius-3xl); box-shadow: 0 0 0 1px var(--hairline), var(--shadow-xl); }
.article__media img { width: 100%; height: auto; }

.article__grid { display: grid; gap: 32px; padding-block: clamp(40px, 6vw, 80px); }
.article__body { min-width: 0; }

/* ---------- Texte courant ---------- */
.prose { max-width: 720px; font-size: 18px; line-height: 1.7; color: #2c2c35; overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 2.2em; scroll-margin-top: 104px; font-size: clamp(24px, 2.8vw, 32px); line-height: 1.15; letter-spacing: -0.035em; color: var(--color-ink); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.8em; font-size: 20px; line-height: 1.3; color: var(--color-ink); }
.prose h4 { margin-top: 1.6em; font-size: 17px; font-weight: 500; color: var(--color-ink); }
.prose strong { font-weight: 600; color: var(--color-ink); }
.prose a { color: var(--color-iris); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose ul, .prose ol { display: grid; gap: 0.5em; padding-left: 1.4em; }
.prose ul { list-style: none; padding-left: 0; }
.prose ul > li { position: relative; padding-left: 1.4em; }
.prose ul > li::before { content: ""; position: absolute; left: 0.2em; top: 0.68em; width: 7px; height: 7px; border-radius: 2px; background: var(--color-iris); }
.prose ol { list-style: decimal; }
.prose ol > li::marker { font-family: var(--font-mono); font-size: 0.85em; color: var(--color-iris); }
.prose hr { margin-block: 2.4em; border: 0; height: 1px; background: var(--color-ash); }
.prose blockquote {
  margin-block: 1.8em; padding: 24px 28px; border-radius: var(--radius-2xl);
  background: var(--color-white); box-shadow: 0 0 0 1px var(--hairline);
  border-left: 4px solid var(--color-iris);
  font-size: 19px; color: var(--color-ink);
}
.prose blockquote > * + * { margin-top: 0.8em; }
.table-wrap { overflow-x: auto; border-radius: var(--radius-xl); background: var(--color-white); box-shadow: 0 0 0 1px var(--hairline); }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.45; }
.prose th, .prose td { padding: 14px 18px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--color-ash); }
.prose th { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-graphite); background: var(--color-canvas); }
.prose tr:last-child td { border-bottom: 0; }

.article__after { padding-bottom: var(--section); }
.article__cta { display: grid; gap: 24px; align-items: center; background: linear-gradient(140deg, #fff 40%, #eef0fb); --spot: rgba(184, 202, 245, 0.45); }
.article__cta p:not(.card__kicker) { max-width: 560px; }
.article__more { margin-top: clamp(64px, 8vw, 104px); }
.article__back { margin-top: 40px; text-align: center; }
.article__after .post__title { font-size: 18px; }

@media (min-width: 960px) {
  .article__grid { grid-template-columns: 260px minmax(0, 720px); gap: 64px; justify-content: center; align-items: start; }
  .article__toc { position: sticky; top: 104px; max-height: calc(100svh - 128px); overflow-y: auto; }
  .article__cta { grid-template-columns: 1fr auto; padding: clamp(32px, 4vw, 48px); }
}
@media (max-width: 767px) {
  .prose { font-size: 17px; }
  .article__media { border-radius: var(--radius-2xl); }
}

/* ---------- Signature des articles ---------- */
.byline {
  margin-top: 24px; display: inline-flex; align-items: center; gap: 10px; padding: 5px 16px 5px 5px; border-radius: 9999px;
  background: rgba(255, 255, 255, 0.7); box-shadow: var(--shadow-subtle);
  font-size: 14px; color: var(--color-graphite); text-decoration: none;
  transition: background-color 0.25s;
}
.byline:hover { background: var(--color-white); }
.byline img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.byline strong { font-weight: 500; color: var(--color-ink); }
.byline + .article__meta { margin-top: 16px; }

.article__col { min-width: 0; }
.author {
  max-width: 720px; margin-top: 56px; padding: 24px; display: grid; grid-template-columns: 72px 1fr; gap: 20px; align-items: start;
  border-radius: var(--radius-2xl); background: var(--color-white); box-shadow: 0 0 0 1px var(--hairline);
  color: var(--color-graphite);
}
.author img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.author__label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.author__name { margin-top: 2px; font-size: 20px; font-weight: 500; letter-spacing: -0.03em; color: var(--color-ink); }
.author__name + p { margin-top: 8px; }
.author__links { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 20px; }
.author__links a, .about__link { color: var(--color-iris); font-weight: 500; text-underline-offset: 3px; }
.about__link { text-decoration: none; }
.about__link:hover .btn__arrow { transform: translateX(4px); }

/* ==========================================================================
   À propos
   ========================================================================== */
.about { padding-bottom: var(--section); }
.about__grid { display: grid; gap: 40px; }
.profile { display: grid; justify-items: start; gap: 4px; --spot: rgba(184, 202, 245, 0.45); }
.profile__photo { width: 112px; height: 112px; margin-bottom: 16px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 4px var(--color-white), 0 0 0 5px var(--hairline), var(--shadow-md); }
.profile__role { margin-top: 2px !important; }
.profile__facts { width: 100%; margin: 20px 0 0; padding-top: 20px; border-top: 1px solid var(--color-ash); display: grid; gap: 12px; font-size: 14px; }
.profile__facts div { display: grid; grid-template-columns: 76px 1fr; gap: 12px; }
.profile__facts dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-graphite); padding-top: 3px; }
.profile__facts dd { margin: 0; color: var(--color-ink); }
.profile__links { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.about__body h2:first-child { margin-top: 0; }

.path { padding-bottom: var(--section); }
.tl { position: relative; max-width: 820px; margin-inline: auto; display: grid; gap: 12px; }
.tl::before { content: ""; position: absolute; left: 43px; top: 24px; bottom: 24px; width: 1px; background: var(--color-ash); }
.tl__item {
  position: relative; display: grid; grid-template-columns: 88px 1fr; gap: 20px; align-items: start;
  padding: 20px 24px 20px 0;
}
.tl__year {
  position: relative; z-index: 1; justify-self: center; padding: 6px 12px; border-radius: 9999px;
  background: var(--color-ink); color: var(--color-white);
  font-family: var(--font-mono); font-size: 13px;
}
.tl__item:nth-last-child(-n + 2) .tl__year { background: var(--color-iris); }
.tl__item h3 { font-size: 20px; }
.tl__item p { margin-top: 6px; color: var(--color-graphite); }

.about-cards { padding-bottom: var(--section); }
.about-cards__grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.about-cards .card { grid-column: auto; border-top: 4px solid var(--tint, var(--color-ash)); }
.card--periwinkle { --tint: var(--color-periwinkle); --spot: rgba(184, 202, 245, 0.45); }
.about-scale { margin-top: 14px; display: grid; gap: 8px; }
.about-scale li { display: flex; align-items: center; gap: 12px; font-weight: 500; }

@media (min-width: 960px) {
  .about__grid { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 72px; align-items: start; }
  .about__aside { position: sticky; top: 104px; }
}
@media (max-width: 767px) {
  .tl::before { left: 31px; }
  .tl__item { grid-template-columns: 64px 1fr; gap: 14px; padding-right: 0; }
  .tl__year { padding: 5px 8px; font-size: 12px; }
  .author { grid-template-columns: 1fr; }
}
