/* ==========================================================================
   Green Card Conseil USA — Blog (liste des articles + article)
   Complète assets/css/style.css, à charger après lui.
   Sommaire :
   1. En-tête de page & fil d'Ariane
   2. Liste des articles (cartes)
   3. Article : en-tête & image principale
   4. Article : mise en page & sommaire
   5. Article : contenu éditorial
   6. Article : encadrés, tableau, sources, CTA
   ========================================================================== */

/* 1. En-tête de page & fil d'Ariane
   ========================================================================== */
.page-hero {
  padding-block: clamp(40px, 6vw, 72px) clamp(48px, 6vw, 80px);
  background: var(--blue-light);
}

.page-hero .section-head {
  margin-bottom: 0;
}

.page-hero h1 {
  font-size: clamp(2.125rem, 1.3rem + 3vw, 3.25rem);
  font-weight: 800;
  line-height: 1.1;
}

.breadcrumb {
  margin-bottom: 28px;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-size: 0.875rem;
  color: #64748b;
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.breadcrumb li + li::before {
  content: "/";
  color: var(--border-strong);
}

.breadcrumb a {
  font-weight: 500;
  color: var(--navy);
}

.breadcrumb a:hover {
  color: var(--red);
}

.breadcrumb [aria-current="page"] {
  color: var(--text);
}

/* 2. Liste des articles (cartes)
   ========================================================================== */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.post-card {
  overflow: hidden;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  font-size: 0.8125rem;
  color: #64748b;
}

.post-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.post-meta .icon {
  width: 15px;
  height: 15px;
}

.post-card .btn {
  position: relative;
  z-index: 2;
  align-self: flex-start;
  margin-top: auto;
}

.post-card .guide-body > p:not(.post-meta) {
  margin-top: 12px;
  margin-bottom: 24px;
  font-size: 0.96875rem;
}

/* Article mis en avant : premier de la liste, sur toute la largeur */
.post-card--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

.post-card--featured .guide-media {
  aspect-ratio: auto;
  min-height: 340px;
}

.post-card--featured .guide-media img {
  position: absolute;
  inset: 0;
}

.post-card--featured .guide-body {
  justify-content: center;
  padding: clamp(28px, 4vw, 48px);
}

.post-card h2 {
  margin-top: 12px;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.3;
}

.post-card h2 a {
  color: inherit;
}

.post-card h2 a::after {
  /* Rend toute la carte cliquable */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.post-card h2 a:focus-visible {
  outline: none;
}

.post-card:has(h2 a:focus-visible) {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.post-card--featured h2 {
  margin-top: 14px;
  font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2rem);
  line-height: 1.2;
}

.post-card--featured .guide-body > p:not(.post-meta) {
  margin-top: 14px;
  font-size: 1.0625rem;
}

.post-card .btn:hover {
  transform: none;
}

.blog-empty-note {
  margin-top: 40px;
  font-size: 0.9375rem;
  text-align: center;
  color: #64748b;
}

@media (max-width: 1024px) {
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .post-card--featured {
    grid-template-columns: 1fr;
  }

  .post-card--featured .guide-media {
    aspect-ratio: 16 / 10;
    min-height: 0;
  }
}

@media (max-width: 680px) {
  .post-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

/* 3. Article : en-tête & image principale
   ========================================================================== */
.article-hero {
  padding-block: clamp(40px, 6vw, 72px) 0;
  background: linear-gradient(180deg, var(--blue-light) 0%, var(--blue-light) 72%, var(--white) 72%);
}

.article-head {
  max-width: 860px;
}

.article-head h1 {
  font-size: clamp(2rem, 1.25rem + 2.8vw, 3rem);
  font-weight: 800;
  line-height: 1.12;
}

.article-lead {
  margin-top: 22px;
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  line-height: 1.7;
}

.article-head .post-meta {
  margin-top: 24px;
  font-size: 0.875rem;
}

.article-figure {
  margin: clamp(32px, 4vw, 48px) 0 0;
}

.article-figure img {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.article-figure figcaption {
  margin-top: 12px;
  font-size: 0.8125rem;
  color: #64748b;
}

@media (max-width: 680px) {
  .article-figure img {
    aspect-ratio: 16 / 10;
  }
}

/* 4. Article : mise en page & sommaire
   ========================================================================== */
.article-section {
  padding-block: clamp(48px, 6vw, 80px) var(--section-y);
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 760px);
  justify-content: center;
  gap: clamp(40px, 5vw, 72px);
  align-items: start;
}

.toc {
  position: sticky;
  top: calc(var(--header-h) + 28px);
  padding: 24px;
  background: var(--gray-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.toc-title {
  margin-bottom: 14px;
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
}

.toc ol {
  display: grid;
  gap: 2px;
  counter-reset: toc;
}

.toc li {
  counter-increment: toc;
}

.toc a {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--heading);
}

.toc a::before {
  content: counter(toc, decimal-leading-zero);
  flex-shrink: 0;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.85;
  color: var(--navy);
  opacity: 0.55;
}

.toc a:hover {
  color: var(--red);
}

@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: minmax(0, 760px);
  }

  .toc {
    position: static;
  }
}

/* 5. Article : contenu éditorial
   ========================================================================== */
.prose {
  font-size: 1.0625rem;
  line-height: 1.8;
}

.prose > * + * {
  margin-top: 20px;
}

.prose h2 {
  margin-top: clamp(48px, 5vw, 64px);
  font-size: clamp(1.5rem, 1.15rem + 1.2vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
}

.prose h3 {
  margin-top: 36px;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.3;
}

.prose h2 + *,
.prose h3 + * {
  margin-top: 16px;
}

.prose > :first-child {
  margin-top: 0;
}

.prose strong {
  color: var(--heading);
  font-weight: 600;
}

.prose a:not(.btn) {
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: rgba(0, 40, 104, 0.35);
  text-underline-offset: 3px;
}

.prose a:not(.btn):hover {
  color: var(--red);
  text-decoration-color: currentColor;
}

.prose ul,
.prose ol {
  display: grid;
  gap: 10px;
}

.prose ul li {
  position: relative;
  padding-left: 22px;
}

.prose ul li::before {
  content: "";
  position: absolute;
  top: 0.75em;
  left: 4px;
  width: 6px;
  height: 6px;
  background: var(--red);
  border-radius: 50%;
}

.prose ol {
  counter-reset: steps;
}

.prose ol li {
  position: relative;
  padding-left: 40px;
  counter-increment: steps;
}

.prose ol li::before {
  content: counter(steps);
  position: absolute;
  top: 0.2em;
  left: 0;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1;
  color: var(--white);
  background: var(--navy);
  border-radius: 50%;
}

/* 6. Article : encadrés, tableau, sources, CTA
   ========================================================================== */
.tip {
  display: flex;
  gap: 16px;
  padding: 22px 24px;
  font-size: 1rem;
  line-height: 1.7;
  background: var(--blue-light);
  border-left: 3px solid var(--navy);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.prose .tip {
  margin-top: 28px;
}

.tip > .icon {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  color: var(--navy);
}

.tip p + p {
  margin-top: 8px;
}

.tip-title {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--heading);
}

.tip--warning {
  background: #fdf2f4;
  border-left-color: var(--red);
}

.tip--warning > .icon {
  color: var(--red);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.compare-table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  font-size: 0.96875rem;
  line-height: 1.55;
}

.compare-table caption {
  padding: 14px 18px;
  font-size: 0.875rem;
  text-align: left;
  color: #64748b;
  caption-side: bottom;
  border-top: 1px solid var(--border);
}

.compare-table th,
.compare-table td {
  padding: 14px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.compare-table thead th {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--white);
  background: var(--navy);
}

.compare-table tbody th {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--heading);
  background: var(--gray-light);
}

.compare-table tbody tr:last-child th,
.compare-table tbody tr:last-child td {
  border-bottom: 0;
}

.article-faq {
  margin-top: clamp(48px, 5vw, 64px);
}

.article-faq h2 {
  margin-bottom: 24px;
}

.article-faq .faq-list {
  margin-top: 0;
}

.article-sources {
  margin-top: 48px;
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.article-sources h2 {
  margin: 0 0 14px;
  font-size: 1.125rem;
}

.article-sources ul {
  gap: 8px;
  font-size: 0.9375rem;
}

.article-sources p {
  margin-top: 16px;
  font-size: 0.875rem;
  color: #64748b;
}

.article-cta {
  position: relative;
  margin-top: 48px;
  padding: clamp(28px, 4vw, 44px);
  overflow: hidden;
  color: #d5deee;
  background: linear-gradient(140deg, var(--navy) 0%, var(--navy-deep) 100%);
  border-radius: var(--radius-lg);
  isolation: isolate;
}

.article-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(480px 240px at 100% 120%, rgba(191, 10, 48, 0.38), transparent 70%);
}

.article-cta h2 {
  margin: 0;
  font-size: clamp(1.5rem, 1.15rem + 1.1vw, 1.875rem);
  color: var(--white);
}

.article-cta p {
  margin-top: 14px;
  max-width: 560px;
}

.article-cta .btn-row {
  margin-top: 26px;
}

.article-back {
  margin-top: 40px;
}

@media (max-width: 560px) {
  .article-cta .btn-row .btn {
    width: 100%;
  }

  .tip {
    padding: 18px;
  }
}

/* Composants de la homepage réutilisés dans le contenu éditorial */
.prose a.text-link {
  text-decoration: none;
}

.prose .article-faq h2 {
  margin-top: 0;
}

.prose .faq-item h3 {
  margin-top: 0;
  font-size: inherit;
}

.prose .faq-answer {
  font-size: 1rem;
  line-height: 1.7;
}

/* Bloc « À lire aussi » en fin d'article : cartes compactes */
.prose .related {
  margin-top: 56px;
}

.prose .related > h2 {
  margin: 0 0 24px;
  font-size: 1.5rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.prose .related .post-card h3 {
  margin-top: 10px;
  font-size: 1.0625rem;
  line-height: 1.35;
}

.prose .related a {
  text-decoration: none;
}

.related .guide-body {
  padding: 18px 18px 20px;
}

.related .guide-category {
  top: 12px;
  left: 12px;
}

.related .post-card .guide-body > p:not(.post-meta),
.related .post-card .btn {
  display: none;
}

@media (max-width: 760px) {
  .related-grid {
    grid-template-columns: 1fr;
  }
}
