/**
 * @file
 * Article page styles — pixel-perfect from Figma (931:13850).
 */

/* ===== HERO ===== */
.art-hero {
  position: relative;
  min-height: 700px;
  padding: 0;
  overflow: hidden;
  margin-top: -86px;
  padding-top: 86px;
}

/* Hero background image with dark overlay */
.art-hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.art-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.art-hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

/* Hero image (fallback for old template structure) */
.art-hero__image {
  margin: 24px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

/* Decorative globule shapes on hero image */
.art-hero__image::before,
.art-hero__image::after {
  content: '';
  position: absolute;
  width: 180px;
  height: 180px;
  background: var(--color-orange-light);
  border-radius: 50% 40% 60% 45% / 55% 50% 45% 50%;
  opacity: 0.7;
  z-index: 1;
  pointer-events: none;
}

.art-hero__image::before {
  top: -40px;
  left: -60px;
  transform: rotate(-15deg);
}

.art-hero__image::after {
  bottom: -30px;
  right: -50px;
  width: 150px;
  height: 150px;
  transform: rotate(20deg);
  border-radius: 45% 55% 50% 40% / 50% 45% 55% 50%;
}

.art-hero__image-placeholder {
  width: 100%;
  height: 400px;
  background: var(--color-blue-light);
  border-radius: var(--radius-lg);
}

.art-hero__image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  display: block;
}

/* Hero inner content */
.art-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 46px 80px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

/* Breadcrumb on dark hero — white SemiBold per Figma */
.art-hero .hub-breadcrumb__home {
  color: var(--color-white);
}

.art-hero .hub-breadcrumb__sep {
  color: var(--color-white);
  font-weight: 600;
}

.art-hero .hub-breadcrumb__link {
  color: var(--color-white);
  font-weight: 600;
}

.art-hero .hub-breadcrumb__current {
  color: var(--color-white);
}

/* Meta: tag + reading time */
.art-hero__meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Tag badge — orange bg with white border pill */
.art-hero__tag {
  background: var(--color-orange);
  border-radius: 100px;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.art-hero__tag-inner {
  border: 1px solid var(--color-white);
  border-radius: 100px;
  padding: 4px 16px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--color-white);
  line-height: normal;
}

.art-hero__reading-time {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-white);
  line-height: 1.5;
}

/* Title */
.art-hero__title {
  font-family: var(--font-heading);
  font-size: 75px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: -0.05em;
  color: var(--color-white);
  line-height: normal;
  margin: 0;
  max-width: 1172px;
}

/* Title with pill word */
.art-hero__title-line {
  display: block;
}

.art-hero__title-pill {
  display: inline-block;
  border: 1px solid var(--color-white);
  border-radius: 100px;
  padding: 0 16px;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

/* Author in hero */
.art-hero__author {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
}

.art-hero__author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.art-hero__author-info {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-white);
  display: flex;
  flex-direction: column;
  padding-bottom: 2px;
}

.art-hero__author-name {
  text-transform: uppercase;
  letter-spacing: -0.03em;
  line-height: normal;
}

.art-hero__author-role {
  line-height: 1.5;
  color: var(--color-white);
}

/* Introduction text (on dark hero bg) */
.art-hero__intro {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-white);
  max-width: 1172px;
}

.art-hero__intro p {
  color: var(--color-white);
  margin-bottom: 0;
}

/* ===== CONTENT SECTION (Bloc 1) ===== */
.art-bloc1 {
  background: var(--color-white);
  border-radius: 40px 40px 0 0;
  padding: 0 80px 80px;
  position: relative;
  margin-top: -80px;
  overflow: visible;
}

.art-bloc1__inner {
  max-width: var(--container-width);
  width: 100%;
  margin-inline: auto;
  position: relative;
  display: flex;
  justify-content: flex-end;
}

/* ===== LAYOUT (fallback, used for old template structure) ===== */
.art-layout {
  padding: 0 80px;
}

.art-layout__inner {
  max-width: var(--container-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
}

/* ===== CONTENT ===== */
.art-content {
  width: 758px;
  max-width: 758px;
  flex-shrink: 0;
  padding-top: 80px;
  padding-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Chapo / Introduction */
.art-chapo {
  margin-bottom: 0;
}

.art-chapo p {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-black);
  margin-bottom: 0;
}

/* Summarize AI block — Figma 1286:5698 — compact version */
/* Masqué à la demande du client, gardé en DOM pour réactivation future */
.art-summary-ai {
  display: none !important;
  background: var(--color-orange-light);
  border-radius: 16px;
  padding: 12px 16px;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 16px;
  overflow: hidden;
}

.art-summary-ai__title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--color-black);
}

.art-summary-ai__tags {
  display: flex;
  gap: 8px;
  align-items: center;
}

.art-summary-ai .art-summary-ai__tag {
  border: 1px solid var(--color-orange);
  border-radius: 100px;
  padding: 4px 14px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--color-orange);
  text-decoration: none;
  line-height: normal;
  transition: background var(--transition-base), color var(--transition-base);
}

.art-summary-ai .art-summary-ai__tag:hover {
  background: var(--color-orange);
  color: var(--color-white);
  text-decoration: none;
}

/* H2 — blue, 50px, with pill patterns */
.art-content h2 {
  font-family: var(--font-heading);
  font-size: 50px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: -0.05em;
  color: var(--color-blue);
  line-height: 1;
  margin-top: 0;
  margin-bottom: 0;
  scroll-margin-top: 110px;
}

/* Pill inside h2/h3 — rounded border, adapts to multi-line text */
.art-content__pill {
  display: inline-block;
  border: 1.5px solid var(--color-blue);
  border-radius: 24px;
  padding: 2px 16px;
}

/* H3 — orange, 32px — per Figma */
.art-content h3 {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: -0.05em;
  color: var(--color-orange);
  line-height: 1;
  margin-top: 0;
  margin-bottom: 0;
}

/* Paragraphs — 16px, line-height 1.5 per Figma */
.art-content p {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-black);
  margin-bottom: 0;
}

.art-content strong {
  font-weight: 600;
}

.art-content a {
  color: var(--color-blue);
  text-decoration: underline;
  font-weight: 700;
}

/* Sources: keep normal weight — links there are references, not emphasis. */
.art-content .art-sources a {
  font-weight: 400;
}

.art-content ul,
.art-content ol {
  margin-bottom: 0;
  padding-left: 24px;
}

.art-content ul {
  list-style: disc;
}

.art-content ol {
  list-style: decimal;
}

.art-content li {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-black);
  margin-bottom: 0;
}

/* Images */
.art-content img {
  border-radius: var(--radius-md);
  margin-block: 24px;
  max-width: 100%;
  height: auto;
}

/* Tables — Figma 955:6566
   Caption extracted to .art-table-caption div via preprocess to avoid CSS caption bugs.
   Wrapper .art-table-wrap handles margins. */
.art-table-wrap{
  padding-bottom: 24px;
}

/* Caption (now a div above the table) */
.art-table-caption {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: -0.05em;
  color: var(--color-blue);
  text-align: center;
  line-height: 1.3;
  padding: 16px 24px;
  background: var(--color-blue-light);
  border: 0.8px solid var(--color-blue);
  border-radius: 24px 24px 0 0;
}

/* Table body — no top radius, border on left/right/bottom */
.art-table-wrap table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 0.8px solid var(--color-blue);
  border-top: none;
  border-radius: 0 0 24px 24px;
  background: var(--color-blue-light);
  overflow: hidden;
}

/* Standalone tables without caption wrapper */
.art-content table:not(.art-table-wrap table) {
  width: 100%;
  margin-top: 24px;
  margin-bottom: 24px;
  border-collapse: separate;
  border-spacing: 0;
  border: 0.8px solid var(--color-blue);
  border-radius: 24px;
  background: var(--color-blue-light);
  overflow: hidden;
}

/* Head */
.art-content thead th {
  background: transparent;
  color: var(--color-black);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0;
  line-height: 1.3;
  padding: 16px 8px;
  text-align: center;
  border: none;
}

/* Body cells — 16px Regular per Figma */
.art-content tbody tr:last-child td {
  padding-bottom: 16px;
}

.art-content td {
  padding: 4px 8px;
  border: none;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-black);
  text-align: center;
}

/* Column separators only — vertical blue lines between columns */
.art-content th + th,
.art-content td + td {
  border-left: 0.8px solid var(--color-blue);
}
.art-table-wrap th + th, .art-table-wrap td + td {
  border-left: 0.8px solid var(--color-blue);
}
.art-table-wrap td {
  padding: 4px 8px;
  border: none;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-black);
  text-align: center;
}

/* Callout boxes */
.art-content .callout {
  padding: 24px;
  background: var(--color-orange-light);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-orange);
  margin-block: 24px;
}

/* Blockquotes — blue accent per Figma */
.art-content blockquote {
  padding: 24px;
  background: var(--color-blue-light);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-blue);
  margin-block: 24px;
  font-style: normal;
}

.art-content blockquote p {
  margin-bottom: 0;
}

/* Links in article body — hover underline */
.art-content a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

/* ===== SOURCES SECTION — Figma 1020:5940 ===== */
.art-sources {
  background: var(--color-orange-light);
  border-radius: 24px;
  padding: 42px;
  margin-top: 24px;
  scroll-margin-top: 100px;
}

@media (max-width: 768px) {
  .art-sources {
    scroll-margin-top: 190px;
  }
}

.art-content .art-sources__title {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-black);
  margin: 0 0 16px 0;
  padding: 0;
  line-height: normal;
  letter-spacing: normal;
}

.art-sources .art-sources__list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.art-sources li {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 0;
  color: var(--color-black);
}

.art-sources li strong {
  font-weight: 600;
}

/* Bold markers for <ol> lists in sources */
.art-sources ol {
  padding-left: 0;
  margin: 0;
  list-style: none;
  counter-reset: source-counter;
}

.art-sources ol li {
  counter-increment: source-counter;
}

.art-sources ol li::before {
  content: counter(source-counter) ". ";
  font-weight: 600;
}

/* ===== CITATION (border bleu comme le hero homepage) ===== */
.art-citation {
  background: transparent;
  border: 1px solid var(--color-blue);
  border-radius: 24px;
  padding: 42px;
  margin-top: 24px;
}

.art-citation h2, .art-citation h3 {
  margin-top: 0 !important;
}
.art-citation .art-citation__title {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-black);
  margin: 0 0 16px 0;
  padding: 0;
  line-height: normal;
  letter-spacing: normal;
}

.art-citation ul {
  list-style: disc;
  padding-left: 24px;
  margin: 0;
}

.art-citation ol {
  list-style: decimal;
  padding-left: 24px;
  margin: 0;
}

.art-citation li,
.art-citation p {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 0;
  color: var(--color-black);
}

.art-citation li strong,
.art-citation p strong {
  font-weight: 600;
}

@media (max-width: 768px) {
  .art-citation {
    padding: 24px;
    border-width: 0.8px;
    border-radius: var(--radius-lg);
    word-wrap: anywhere;
  }
}

/* ===== SIDEBAR ===== */
/* Figma: sidebar at x=80 from full-bleed Bloc1 (1440px).
   bloc1 has padding-left: 80px, so sidebar left=0 inside bloc1__inner = 80px from viewport. */
.art-sidebar {
  position: absolute;
  left: 0;
  top: -80px;
  bottom: 0;
  pointer-events: none;
}

.art-sidebar__sticky {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
  justify-content: center;
  padding-top: 160px;
  padding-bottom: 80px;
  position: sticky;
  top: 0;
  pointer-events: auto;
  width: 413px;
}

/* ===== SHARE SECTION in sidebar — blue-light card per Figma ===== */
.art-share {
  background: var(--color-blue-light);
  border-radius: 32px;
  padding: 42px 16px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  overflow: hidden;
}

.art-share__title {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-black);
  line-height: 1.3;
}

.art-share__buttons {
  display: flex;
  gap: 16px;
}

.art-share__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 100px;
  border: 0.8px solid var(--color-blue);
  background: var(--color-blue-light);
  color: var(--color-blue);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  transition: background-color var(--transition-base), color var(--transition-base);
}

.art-share__btn:hover {
  background: var(--color-blue);
  color: var(--color-white);
}

.art-share__btn svg {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

/* ===== AUTHOR CARD in sidebar — white with orange border per Figma ===== */
.art-sidebar__author {
  background: var(--color-white);
  border: 1px solid var(--color-orange);
  border-radius: 24px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.art-sidebar__author-avatar {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.art-sidebar__author-info {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  padding-bottom: 2px;
}

.art-sidebar__author-name {
  color: var(--color-black);
  text-transform: uppercase;
  line-height: 1.3;
}

.art-sidebar__author-role {
  color: var(--color-orange);
  line-height: 1.5;
}

/* Sidebar quote card (kept for backwards compatibility) */
.art-sidebar__quote {
  position: relative;
  width: 100%;
  min-height: 200px;
}

.art-sidebar__quote-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.art-sidebar__quote-inner {
  position: relative;
  z-index: 1;
  padding: 16px;
}

.art-sidebar__quote-icon {
  position: absolute;
  right: 0;
  top: 0;
  width: 48px;
  height: 48px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.art-sidebar__quote-icon img {
  width: 40px;
  height: 40px;
}

.art-sidebar__quote-author {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.art-sidebar__quote-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.art-sidebar__quote-name {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -0.03em;
  color: var(--color-black);
}

.art-sidebar__quote-role {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-orange);
  line-height: 1.5;
}

.art-sidebar__quote-text {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--color-black);
  margin: 0;
  padding-left: 48px;
}

/* ===== POUR ALLER PLUS LOIN — Figma 965:4371 ===== */
.art-related {
  padding: 80px 188px;
  overflow: hidden;
  background: var(--color-white);
  position: relative;
}

/* Decorative globules near "Pour aller plus loin" — Figma 931:13850 */
.globule--art-mid-left {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  top: -80px;
  left: -120px;
  width: 350px;
  height: 414px;
  opacity: 0.15;
}

.globule--art-mid-left img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.globule--art-mid-right {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  bottom: -60px;
  right: -80px;
  width: 250px;
  height: 250px;
  opacity: 0.15;
}

.globule--art-mid-right img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.art-related__inner {
  max-width: var(--container-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 80px;
}

.art-related__heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 433px;
}

.art-related__grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

/* "avec le" prefix before author name — Figma shows regular weight */
.hub-article-item__author-prefix {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

/* Separator line between content and "pour aller plus loin" */
.art-separator {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  height: 0;
  border-top: 1px solid var(--color-blue-light);
  background: var(--color-white);
}

/* Full-bleed white background for article bottom area */
.page--article {
  background: var(--color-white);
}

/* ===== TABLET / MEDIUM ===== */
/* Taille intermédiaire (1024-1340px) — sidebar plus étroite pour éviter le chevauchement */
@media (max-width: 1340px) and (min-width: 1025px) {
  .art-bloc1 {
    padding: 0 32px 80px;
  }
  .art-content {
    width: calc(100% - 300px - 32px);
    max-width: 758px;
  }
  .art-sidebar__sticky {
    width: 300px;
    padding-top: 140px;
  }
  .art-hero__title {
    font-size: 60px;
  }
}

/* Tablet (769-1024px) — reduce hero title, show mobile TOC */
@media (max-width: 1024px) and (min-width: 769px) {
  .art-hero__title {
    font-size: 56px;
  }
  .art-hero__inner {
    padding: 46px 40px 0;
  }
}

@media (max-width: 1024px) {
  .art-layout__inner {
    grid-template-columns: 1fr;
  }

  .art-sidebar {
    display: none;
  }

  .art-bloc1 {
    justify-content: center;
  }

  .art-bloc1__inner {
    justify-content: center;
  }

  .art-content {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .globule--art-mid-left,
  .globule--art-mid-right {
    display: none;
  }

  .art-hero {
    min-height: 700px;
    margin-top: -71px;
    padding-top: 71px;
  }

  /* Fix 1: Fil d'ariane — less top margin */
  .art-hero__inner {
    padding: 24px 16px 40px;
  }

  /* Fix 2: Extrait — padding bottom before white bloc */
  .art-hero__intro {
    padding-bottom: 24px;
  }

  .art-hero__title {
    font-size: 40px;
  }

  .art-hero__image-placeholder,
  .art-hero__image img {
    height: 250px;
  }

  .art-bloc1 {
    padding: 0 16px 40px;
    border-radius: 24px 24px 0 0;
    margin-top: -42px;
  }

  /* Fix 4: Résumé IA — less padding and reduce content top padding */
  .art-content {
    padding-top: 42px;
    order: 1;
  }

  .art-summary-ai {
    padding: 10px 12px;
    margin-bottom: 0;
    flex-direction: column;
    gap: 8px;
  }

  .art-layout {
    padding: 0 16px;
  }

  .art-content h2 {
    font-size: 32px;
    margin-top: 40px;
    scroll-margin-top: 180px;
  }

  .art-content h3 {
    font-size: 24px;
    margin-top: 32px;
  }

  .art-sources {
    padding: 24px;
    border-radius: var(--radius-lg);
    word-wrap: anywhere;
  }

  /* Fix 6: Pour aller plus loin — padding bottom before footer */
  .art-related {
    padding: 40px 16px 80px;
  }

  .art-related__inner {
    gap: 40px;
  }

  .art-related__heading {
    width: 100%;
  }

  .art-related__grid {
    max-width: 100%;
  }

  /* Fix 5: Sidebar doctor + share — show below article on mobile */
  .art-bloc1__inner {
    flex-direction: column;
  }

  .art-sidebar {
    display: block;
    position: relative;
    left: auto;
    top: auto;
    bottom: auto;
    pointer-events: auto;
    order: 2;
    width: 100%;
    margin-top: 24px;
  }

  .art-sidebar__sticky {
    position: relative;
    top: auto;
    width: 100%;
    padding-top: 0;
    padding-bottom: 0;
  }

  /* Hide TOC from sidebar on mobile (shown separately as horizontal bar) */
  .art-sidebar .toc {
    display: none;
  }

}
