/* =========================================================
   Habitek Conseil – Pages : Conseils (rubrique, articles), Contact, Zones d'intervention, erreur 404
   S'appuie sur style.css (en-têtes .legal-hero, sommaire .legal__toc, formulaires .form__…, boutons)
   et services.css (cartes, FAQ, étapes) : mêmes codes que la page d'accueil.
   ========================================================= */

/* ---------- Article : en-tête magazine (texte + photo) ---------- */
.article-hero {
  padding: clamp(36px, 6vh, 72px) 0 clamp(40px, 6vh, 72px);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(70% 140% at 100% 0%, rgba(11, 44, 94, .07), transparent 60%),
    linear-gradient(180deg, var(--sand), var(--white));
}

.article-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  align-items: center;
  gap: clamp(32px, 5vw, 88px);
}

.article-hero__title {
  margin: 18px 0 0;
  font-size: clamp(2rem, 3.4vw, 3rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.03em;
  color: var(--navy);
}

.article-hero__lead { max-width: 680px; margin-top: 20px; font-size: 18px; line-height: 1.7; color: var(--ink); }
.article-hero__lead a { color: var(--navy); border-bottom: 1px solid rgba(11, 44, 94, .3); }
.article-hero__meta { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 26px; font-size: 13.5px; color: var(--muted); }
.article-hero__meta li { display: inline-flex; align-items: center; gap: 8px; }
.article-hero__meta svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--taupe); }

.article-hero__media {
  margin: 0;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--sand);
  box-shadow: 0 30px 60px -32px rgba(6, 28, 63, .35);
}

.article-hero__media img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Article : sommaire + contenu ---------- */
.article {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 780px);
  justify-content: center;
  align-items: start;
  gap: clamp(32px, 5vw, 96px);
  padding-top: clamp(44px, 7vh, 80px);
  padding-bottom: clamp(64px, 9vh, 112px);
}

.article__aside { position: sticky; top: calc(var(--header-h) + 28px); display: grid; gap: 28px; }
.article__toc { position: static; }

.article__service { padding: 28px; border-radius: var(--radius); background: var(--navy); color: rgba(255, 255, 255, .72); }
.article__service-title { margin-top: 14px; font-size: 20px; font-weight: 600; line-height: 1.3; color: var(--white); }
.article__service-text { margin: 8px 0 22px; font-size: 14.5px; line-height: 1.6; }
.article__service .btn { width: 100%; }
.article__service-phone { display: flex; flex-direction: column; margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .14); }
.article__service-phone small { font-size: 12px; }
.article__service-phone .num { font-size: 18px; font-weight: 600; color: var(--white); }

.article__body { min-width: 0; font-size: 17px; line-height: 1.8; color: var(--text); }
.article__body > * + * { margin-top: 18px; }

.article__body h2 {
  margin: 52px 0 0;
  scroll-margin-top: calc(var(--header-h) + 24px);
  font-size: clamp(1.35rem, 2.1vw, 1.7rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.015em;
  color: var(--navy);
}

.article__body > h2:first-child { margin-top: 0; }
.article__body h2 + * { margin-top: 14px; }
.article__body strong { font-weight: 600; color: var(--ink); }
.article__body a:not(.btn) { font-weight: 500; color: var(--navy); border-bottom: 1px solid rgba(11, 44, 94, .3); transition: border-color .2s; }
.article__body a:not(.btn):hover { border-bottom-color: var(--navy); }

.article__list { display: grid; gap: 10px; }
.article__list li { position: relative; padding-left: 26px; }
.article__list li::before { content: ""; position: absolute; left: 4px; top: .85em; width: 10px; height: 1.5px; background: var(--taupe); }

.article__steps { display: grid; gap: 12px; margin-left: 0; padding: 0; list-style: none; counter-reset: step; }
.article__steps li { position: relative; padding-left: 44px; counter-increment: step; }

.article__steps li::before {
  content: counter(step);
  position: absolute;
  top: .2em;
  left: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: var(--white);
}

.article__tip {
  display: flex;
  gap: 14px;
  padding: 20px 22px;
  border-left: 3px solid var(--taupe);
  border-radius: 0 6px 6px 0;
  background: var(--sand);
  font-size: 15.5px;
  line-height: 1.7;
}

.article__tip svg { flex-shrink: 0; width: 20px; height: 20px; margin-top: 3px; color: var(--taupe); }

.article__table { overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; }
.article__table table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.6; }
.article__table--wide table { min-width: 560px; }
.article__table th { padding: 12px 16px; background: var(--sand); border-bottom: 1px solid var(--line); font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-align: left; text-transform: uppercase; color: var(--taupe); }
.article__table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.article__table tr:last-child td { border-bottom: 0; }
.article__table td:first-child { font-weight: 600; color: var(--navy); }

.article__faq { margin-top: 56px; }
.article__faq > h2 { margin: 0; }
.article__faq .svc-faq__list { margin-top: 18px; }
.article__faq .svc-faq__item p { padding-right: 0; font-size: 16px; }

.article__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
  margin-top: 56px;
  padding: 30px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sand);
}

.article__cta-title { font-size: 19px; font-weight: 600; line-height: 1.4; color: var(--navy); }
.article__cta-text { margin-top: 6px; font-size: 15px; line-height: 1.6; color: var(--muted); }
.article__cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Rubrique « Conseils » ---------- */
.guides { padding-top: clamp(36px, 5vh, 56px); padding-bottom: clamp(64px, 9vh, 110px); }
.guides__filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }

.guides__chip {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  transition: border-color .25s, color .25s, background-color .25s;
}

.guides__chip:hover { border-color: var(--navy); color: var(--navy); }
.guides__chip.is-active { border-color: var(--navy); background: var(--navy); color: var(--white); }

.guides__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 32px; }
.guides__item--featured { grid-column: 1 / -1; padding-bottom: 48px; border-bottom: 1px solid var(--line); }

.guide-card { display: flex; flex-direction: column; height: 100%; }
.guide-card__media { display: block; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--radius); background: var(--sand); }
.guide-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
.guide-card:hover .guide-card__media img { transform: scale(1.04); }
.guide-card__body { display: flex; flex: 1; flex-direction: column; }
.guide-card__meta { margin-top: 20px; font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--taupe); }
.guide-card__title { margin: 10px 0 0; font-size: 21px; font-weight: 600; line-height: 1.3; letter-spacing: -.015em; color: var(--navy); }
.guide-card__text { flex: 1; margin-top: 10px; font-size: 15px; line-height: 1.65; color: var(--muted); }
.guide-card:hover .svc-card__more svg { transform: translateX(4px); }

/* Article à la une : photo et texte côte à côte */
.guides__item--featured .guide-card { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: clamp(28px, 4vw, 64px); }
.guides__item--featured .guide-card__meta { margin-top: 0; }
.guides__item--featured .guide-card__title { font-size: clamp(24px, 2.3vw, 34px); line-height: 1.2; }
.guides__item--featured .guide-card__text { flex: 0; font-size: 16.5px; }

.guides__services { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }

.guides__services a {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .25s, background-color .25s;
}

.guides__services a:hover { border-color: var(--navy); background: var(--sand); }
.guides__services-icon { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: var(--radius); background: rgba(11, 44, 94, .06); color: var(--navy); }
.guides__services-icon svg { width: 22px; height: 22px; stroke-width: 1.6; }
.guides__services strong { display: block; font-size: 15.5px; font-weight: 600; color: var(--navy); }
.guides__services small { display: block; margin-top: 2px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.guides__services a > svg { flex-shrink: 0; width: 18px; height: 18px; margin-left: auto; color: var(--navy); }

/* ---------- Contact ---------- */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  align-items: start;
  gap: clamp(32px, 4vw, 72px);
  padding-top: clamp(40px, 6vh, 72px);
  padding-bottom: clamp(64px, 9vh, 112px);
}

.contact__form {
  padding: clamp(28px, 3vw, 48px);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  box-shadow: 0 30px 60px -42px rgba(6, 28, 63, .32);
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.contact__title { margin: 0; font-size: clamp(1.4rem, 2vw, 1.7rem); font-weight: 600; color: var(--navy); }
.contact__intro { margin: 8px 0 28px; font-size: 14px; color: var(--muted); }
.contact__form .alert { margin-bottom: 26px; }
.contact__form .form__row + .form__row { margin-top: 22px; }
.contact__submit { width: 100%; }
.contact__form .checkbox a { font-weight: 500; }

.contact__sent { padding: 24px 0; text-align: center; }
.contact__sent-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #edf6f0; color: #2e7d4f; }
.contact__sent-icon svg { width: 30px; height: 30px; stroke-width: 2; }
.contact__sent h2 { margin: 20px 0 0; font-size: clamp(1.4rem, 2.2vw, 1.8rem); font-weight: 600; line-height: 1.3; color: var(--navy); }
.contact__sent p { max-width: 520px; margin: 14px auto 0; line-height: 1.7; color: var(--muted); }
.contact__sent p a { font-weight: 600; color: var(--navy); }
.contact__sent-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }

.contact__aside { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 18px; }
.contact-card { padding: 26px 28px; border: 1px solid var(--line); border-radius: 6px; background: var(--sand); }
.contact-card--navy { border-color: var(--navy); background: var(--navy); color: rgba(255, 255, 255, .75); }
.contact-card__phone { display: block; margin-top: 14px; font-size: clamp(26px, 2.2vw, 32px); font-weight: 600; letter-spacing: -.01em; color: var(--white); }
.contact-card__text { margin-top: 10px; font-size: 14.5px; line-height: 1.6; }
.contact-card--navy .contact-card__text { color: rgba(255, 255, 255, .7); }
.contact-card__line { display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; font-size: 14.5px; font-weight: 500; color: var(--white); overflow-wrap: anywhere; }
.contact-card__line svg { flex-shrink: 0; width: 18px; height: 18px; color: var(--taupe-300); }
.contact-card__title { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 12.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--navy); }
.contact-card__title:not(:first-child) { margin-top: 26px; }
.contact-card__title svg { width: 18px; height: 18px; color: var(--taupe); }
.contact-card__address { font-size: 15px; font-style: normal; line-height: 1.6; color: var(--ink); }
.contact-card__links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 10px; font-size: 13.5px; font-weight: 600; }
.contact-card__links a { color: var(--navy); border-bottom: 1px solid rgba(11, 44, 94, .25); }
.contact-card__hours { display: grid; gap: 4px; margin: 0; font-size: 14.5px; }
.contact-card__hours div { display: flex; justify-content: space-between; gap: 12px; }
.contact-card__hours dt { color: var(--muted); }
.contact-card__hours dd { margin: 0; font-weight: 600; color: var(--ink); }
.contact-card__note { margin-top: 14px; font-size: 13px; line-height: 1.55; color: var(--muted); }

.svc-steps__list--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- Zones d'intervention ---------- */
.zones-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }

.zones-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--navy);
  transition: border-color .25s;
}

.zones-nav a:hover { border-color: var(--navy); }
.zones-nav svg { width: 16px; height: 16px; color: var(--taupe); }

.zone { padding: clamp(56px, 7vw, 110px) 0; scroll-margin-top: var(--header-h); }
.zone + .zone { border-top: 1px solid var(--line); }
.zone--reverse { background: var(--sand); }
.zone__grid { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); align-items: start; gap: clamp(32px, 5vw, 96px); }
.zone--reverse .zone__media { order: 2; }
/* La photo reste en vue pendant la lecture du secteur (colonne de texte plus haute) */
.zone__media { position: sticky; top: calc(var(--header-h) + 32px); margin: 0; aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--radius); background: var(--sand); }
.zone__media img { width: 100%; height: 100%; object-fit: cover; }
.zone__content .about__title { margin-bottom: 18px; }
.zone__text { font-size: 16.5px; line-height: 1.75; color: var(--ink); }
.zone__focus { margin-bottom: 8px; }
.zone__cities { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.zone__cities li { padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); font-size: 13.5px; color: var(--ink); }
.zone__services { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 30px; font-size: 14px; color: var(--muted); }
.zone__services a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--navy); border-bottom: 1px solid rgba(11, 44, 94, .25); }
.zone__services svg { width: 14px; height: 14px; }

/* ---------- Erreur 404 ---------- */
.err__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.err__links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(32px, 5vw, 80px); padding-top: clamp(40px, 6vh, 64px); padding-bottom: clamp(64px, 9vh, 110px); }
.err__list { margin-top: 14px; border-top: 1px solid var(--line); }
.err__list a { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 15.5px; color: var(--navy); }
.err__list svg { flex-shrink: 0; width: 16px; height: 16px; transition: transform .3s var(--ease-out); }
.err__list a:hover svg { transform: translateX(4px); }

/* ---------- Pages de services : « Pour aller plus loin » (articles liés) ---------- */
.svc-guides { padding: 0 0 clamp(64px, 6vw, 96px); background: var(--white); }
.svc-guides__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 24px; margin-bottom: 24px; }
.svc-guides__title { margin: 0; font-size: clamp(22px, 1.8vw, 28px); font-weight: 600; letter-spacing: -.02em; color: var(--navy); }
.svc-guides__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.svc-guides__list a {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--taupe);
  border-radius: var(--radius);
  background: var(--sand);
  transition: border-color .25s, background-color .25s;
}

.svc-guides__list a:hover { border-color: var(--navy); background: var(--white); }
.svc-guides__meta { font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--taupe); }
.svc-guides__list strong { flex: 1; font-size: 17px; font-weight: 600; line-height: 1.4; color: var(--navy); }
.svc-guides__more { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--navy); }
.svc-guides__more svg { width: 15px; height: 15px; transition: transform .3s var(--ease-out); }
.svc-guides__list a:hover .svc-guides__more svg { transform: translateX(4px); }

/* Lien « Nos zones d'intervention » du bandeau défilant */
.zones__link { transition: color .25s; }
.zones__link:hover { color: var(--white); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Adaptations ---------- */
@media (max-width: 1100px) {
  .svc-guides__list { grid-template-columns: minmax(0, 1fr); }
  .article { grid-template-columns: minmax(0, 1fr); }
  .article__aside { position: static; }
  .article__toc { padding: 20px 22px; border: 1px solid var(--line); border-radius: 6px; background: var(--sand); }
  .article__service { display: none; }
  .contact { grid-template-columns: minmax(0, 1fr); }
  .contact__aside { position: static; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .guides__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1000px) {
  .article-hero__grid, .zone__grid { grid-template-columns: minmax(0, 1fr); }
  .zone--reverse .zone__media { order: 0; }
  .zone__media { position: static; }
  .guides__item--featured .guide-card { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .guides__item--featured .guide-card__meta { margin-top: 20px; }
}

@media (max-width: 900px) {
  .svc-steps__list--3 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .guides__grid, .err__links { grid-template-columns: minmax(0, 1fr); }
  .contact .form__row { grid-template-columns: minmax(0, 1fr); }
  .contact .form__row > .form__field + .form__field { margin-top: 22px; }
  .contact__form { padding: 24px 20px; }
  .article__body { font-size: 16px; }
  .article-hero__lead { font-size: 16.5px; }
  .article__cta { padding: 24px 20px; }
  .article__cta-actions, .article__cta-actions .btn { width: 100%; }
}

/* ---------- Contact : en-tête avec photo (gabarit des articles) ---------- */
.article-hero__title em { font-style: normal; color: var(--taupe); }
.contact-hero .article-hero__meta a { color: var(--navy); font-weight: 600; }
.contact-hero .article-hero__meta a:hover { text-decoration: underline; text-underline-offset: 3px; }