/* ==========================================================
   Blog article – Join Immobilier
   Typo : Newsreader (texte, titres) + Hanken Grotesk (interface)
   Palette : encre marine, mer, galet, craie
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400..700&family=Newsreader:ital,opsz,wght@0,6..72,400..700;1,6..72,400..700&display=swap');

#blog-article {
  --encre: #12303c;
  --mer: #1b5b73;
  --mer-fonce: #123f51;
  --galet: #d8dee1;
  --craie: #f2f5f4;
  --discret: #566469;
  --blog-offset: 1.5rem;
  /* à augmenter si le site a un en-tête collant */
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  color: var(--encre);
  font-family: var(--serif);
  padding-block: 1.5rem 4rem;
}

#blog-article .blog-shell {
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 1rem;
}

/* ---------- Hero ---------- */
#blog-article .blog-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: clamp(340px, 56vh, 560px);
  border-radius: 1.5rem;
  overflow: hidden;
  isolation: isolate;
  background: var(--encre);
  color: #fff;
}

#blog-article .blog-hero__img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#blog-article .blog-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top,
      rgba(10, 28, 36, .9) 0%,
      rgba(10, 28, 36, .55) 40%,
      rgba(10, 28, 36, 0) 72%);
}

#blog-article .blog-hero--plain {
  min-height: 0;
  padding-block: 3.5rem 1rem;
}

#blog-article .blog-hero--plain::after {
  display: none;
}

#blog-article .blog-hero__text {
  width: 100%;
  padding: clamp(1.25rem, 4vw, 3rem);
}

#blog-article .blog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1.25rem;
  margin: 0 0 1rem;
  font: 500 .9rem/1.4 var(--sans);
  color: rgba(255, 255, 255, .88);
}

#blog-article .blog-meta__cats {
  padding-left: 1.25rem;
  border-left: 1px solid rgba(255, 255, 255, .45);
}

#blog-article .blog-meta a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: .2em;
  text-decoration-color: rgba(255, 255, 255, .5);
}

#blog-article .blog-meta a:hover {
  text-decoration-color: #fff;
}

#blog-article .blog-hero__title {
  max-width: 26ch;
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 1.2rem + 3.2vw, 3.4rem);
  line-height: 1.07;
  letter-spacing: -.015em;
  text-wrap: balance;
  color: #fff;
}

/* ---------- Grille : sommaire + texte ---------- */
#blog-article .blog-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}

@media (min-width: 992px) {
  #blog-article .blog-body {
    grid-template-columns: 15rem minmax(0, 42.5rem);
    gap: 4rem;
    justify-content: center;
    margin-top: 3.5rem;
  }

  /* le texte reste toujours dans la 2e colonne… */
  #blog-article .blog-main {
    grid-column: 2;
  }

  /* …sauf sans sommaire : colonne unique centrée */
  #blog-article .blog-body:has(.blog-aside:empty) {
    grid-template-columns: minmax(0, 42.5rem);
  }

  #blog-article .blog-body:has(.blog-aside:empty) .blog-main {
    grid-column: 1;
  }
}

/* ---------- Sommaire ---------- */
#blog-article .blog-aside:empty {
  display: none;
}

#blog-article .toc {
  font: 400 .92rem/1.35 var(--sans);
}

#blog-article .toc summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 0;
  border-block: 1px solid var(--galet);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

#blog-article .toc summary::-webkit-details-marker {
  display: none;
}

#blog-article .toc summary::after {
  content: "";
  width: .55rem;
  height: .55rem;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  transition: transform .2s;
}

#blog-article .toc[open] summary::after {
  transform: rotate(-135deg);
}

#blog-article .toc ol {
  list-style: none;
  margin: .75rem 0 0;
  padding: 0;
  border-left: 2px solid var(--galet);
}

#blog-article .toc a {
  display: block;
  margin-left: -2px;
  padding: .4rem 0 .4rem 1rem;
  border-left: 2px solid transparent;
  color: var(--discret);
  text-decoration: none;
}

#blog-article .toc a:hover {
  color: var(--encre);
}

#blog-article .toc a[aria-current="true"] {
  border-left-color: var(--mer);
  color: var(--encre);
  font-weight: 600;
}

@media (min-width: 992px) {
  #blog-article .blog-aside {
    position: sticky;
    top: var(--blog-offset);
    align-self: start;
    max-height: calc(100vh - 2 * var(--blog-offset));
    overflow-y: auto;
  }

  #blog-article .toc summary {
    padding: 0 0 .5rem;
    border-block: 0;
    pointer-events: none;
    /* sommaire toujours ouvert sur grand écran */
    cursor: default;
  }

  #blog-article .toc summary::after {
    display: none;
  }

  #blog-article .toc ol {
    margin-top: 0;
  }
}

/* ---------- Chapeau ---------- */
#blog-article .blog-chapeau {
  margin: 0 0 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--galet);
  font-size: clamp(1.25rem, 1.1rem + .6vw, 1.5rem);
  font-style: italic;
  line-height: 1.5;
  text-wrap: pretty;
}

/* ---------- Contenu de l'article ---------- */
#blog-article .article-content {
  font-size: 1.1875rem;
  line-height: 1.75;
}

#blog-article .article-content p {
  margin: 0 0 1.25em;
  text-wrap: pretty;
}

#blog-article .article-content strong {
  font-weight: 600;
}

#blog-article .article-content h2 {
  margin: 3.25rem 0 1.1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--galet);
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  line-height: 1.2;
  letter-spacing: -.01em;
  text-wrap: balance;
  color: var(--encre);
  scroll-margin-top: var(--blog-offset);
}

#blog-article .article-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

#blog-article .article-content h3 {
  margin: 2rem 0 .75rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.3rem;
  line-height: 1.3;
  scroll-margin-top: var(--blog-offset);
}

#blog-article .article-content a {
  color: var(--mer);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}

#blog-article .article-content a:hover {
  text-decoration-thickness: 2px;
}

#blog-article .article-content ul,
#blog-article .article-content ol {
  margin: 0 0 1.25em;
  padding-left: 1.4em;
}

#blog-article .article-content li {
  margin-bottom: .5em;
  padding-left: .25em;
}

#blog-article .article-content li::marker {
  color: var(--mer);
}

#blog-article .article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 1rem;
}

/* Bouton « Découvrir tous nos biens » dans le texte */
#blog-article .article-content p.cta-biens {
  margin: 2.5rem 0;
}

#blog-article .article-content a.btn-cta {
  display: inline-block;
  padding: .95rem 1.9rem;
  border-radius: 999px;
  background: var(--mer);
  color: #fff;
  font: 600 1rem/1.2 var(--sans);
  text-decoration: none;
  transition: background-color .2s;
}

#blog-article .article-content a.btn-cta:hover {
  background: var(--mer-fonce);
}

/* ---------- Galerie ---------- */
#blog-article .blog-gallery {
  --swiper-theme-color: var(--mer);
  --swiper-navigation-color: var(--encre);
  margin-top: 4rem;
}

#blog-article .blog-gallery .swiper-slide img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 1rem;
}

#blog-article .blog-gallery .swiper-pagination {
  position: static;
  margin-top: 1rem;
}

#blog-article .blog-gallery .swiper-button-prev,
#blog-article .blog-gallery .swiper-button-next {
  top: calc(50% - 1.5rem);
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(18, 48, 60, .25);
}

#blog-article .blog-gallery .swiper-button-prev::after,
#blog-article .blog-gallery .swiper-button-next::after {
  font-size: 1rem;
  font-weight: 700;
}

/* ---------- Bloc d'appel à l'action ---------- */
#blog-article .blog-cta {
  display: grid;
  gap: 1.5rem;
  margin-top: 4rem;
  padding: clamp(1.75rem, 5vw, 3.5rem);
  border-radius: 1.5rem;
  background: var(--encre);
  color: #fff;
}

@media (min-width: 768px) {
  #blog-article .blog-cta {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 3rem;
  }
}

#blog-article .blog-cta__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem);
  line-height: 1.15;
  text-wrap: balance;
  color: #fff;
}

#blog-article .blog-cta__text {
  margin-top: .75rem;
  font-size: 1.1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, .85);
}

#blog-article .blog-cta__text p {
  margin: 0 0 .5rem;
}

#blog-article .blog-cta__btn {
  display: inline-block;
  padding: .95rem 2rem;
  border-radius: 999px;
  background: #fff;
  color: var(--encre);
  font: 600 1rem/1.2 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s;
}

#blog-article .blog-cta__btn:hover {
  background: var(--craie);
}

/* ---------- Retour au blog ---------- */
#blog-article .blog-back {
  margin-top: 3rem;
  text-align: center;
}

#blog-article .blog-back a {
  display: inline-block;
  padding: .8rem 1.6rem;
  border: 1px solid var(--galet);
  border-radius: 999px;
  color: var(--encre);
  font: 600 .95rem/1.2 var(--sans);
  text-decoration: none;
  transition: border-color .2s;
}

#blog-article .blog-back a:hover {
  border-color: var(--encre);
}

/* ---------- Accessibilité ---------- */
#blog-article a:focus-visible,
#blog-article summary:focus-visible {
  outline: 3px solid var(--mer);
  outline-offset: 3px;
}

#blog-article .blog-hero a:focus-visible,
#blog-article .blog-cta a:focus-visible {
  outline-color: #fff;
}

@media (prefers-reduced-motion: no-preference) {
  html:has(#blog-article) {
    scroll-behavior: smooth;
  }
}

@media (prefers-reduced-motion: reduce) {
  #blog-article * {
    transition: none !important;
  }
}

/* ---------- Mobile ---------- */
@media (max-width: 575.98px) {
  #blog-article .article-content {
    font-size: 1.125rem;
  }

  #blog-article .blog-meta__cats {
    padding-left: 0;
    border-left: 0;
  }
}