/* ============================================================
   ARTICLE PAGES — PBGC
   Covers: Story, Petit Format, Asso, Voix d'Ateliers, Revue de Presse
   Depends on: design-system.css (tokens, reset)
   ============================================================ */


/* === 1. SHARED ARTICLE LAYOUT === */

.article-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.article-grid {
  display: grid;
  gap: 40px;
}
@media (min-width: 1024px) {
  .article-grid {
    grid-template-columns: 1fr 280px;
  }
}

.article-body {
  max-width: 720px;
}
.article-body h2 {
  font-family: var(--font-titre);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  border-top: 2px solid var(--support);
  padding-top: 24px;
  margin: 2em 0 .8em;
  position: relative;
}
.article-body h2::after {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--gradient);
}
.article-body h3 {
  font-family: var(--font-titre);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 1.5em 0 .6em;
}
.article-body p {
  font-family: var(--font-corps);
  font-size: 17px;
  line-height: 1.75;
  margin-bottom: 1.5em;
}
.article-body strong {
  font-weight: 600;
}
.article-body ul,
.article-body ol {
  padding-left: 24px;
  margin-bottom: 1.5em;
}
.article-body ul {
  list-style: disc;
}
.article-body ol {
  list-style: decimal;
}
.article-body li {
  margin-bottom: 8px;
  line-height: 1.7;
}
.article-body a {
  color: var(--vert);
  text-decoration: underline;
  text-decoration-color: rgba(3, 129, 104, .3);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--transition);
}
.article-body a:hover {
  text-decoration-color: var(--vert);
}

.article-title {
  font-family: var(--font-titre);
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.2;
  letter-spacing: -.02em;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--texte-light);
  margin-bottom: 36px;
}

.meta-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--support);
  flex-shrink: 0;
  overflow: hidden;
}
.meta-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.meta-badge {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-goutte-alt);
  background: rgba(3, 129, 104, .1);
  color: var(--vert);
}

.article-page .breadcrumb {
  font-weight: 500;
  margin-bottom: 20px;
}
.article-page .breadcrumb a {
  color: var(--texte-light);
}
.article-page .breadcrumb .current {
  color: var(--texte);
}

.article-page .progress-bar {
  z-index: 999;
  transition: width .2s linear;
}

.lettrine::first-letter {
  float: left;
  font-family: var(--font-titre);
  font-size: 4em;
  font-weight: 800;
  line-height: .8;
  color: var(--vert);
  margin: 0 12px 0 0;
}


/* === 2. HERO ARTICLE === */

.hero-article {
  position: relative;
  overflow: hidden;
  margin-bottom: 0;
}
@media (min-width: 1280px) {
  .hero-article,
  .hero-photo,
  .hero-full {
    margin-left: -90px;
    width: calc(100% + 90px);
  }
}
.hero-article img {
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 70vh;
  object-fit: cover;
  display: block;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .85) 0%, rgba(0, 0, 0, .4) 40%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(24px, 5vw, 60px);
}
.hero-rub-tag {
  display: inline-flex;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  color: #fff;
  border-radius: var(--radius-goutte-alt);
  margin-bottom: 12px;
  align-self: flex-start;
  max-width: 90%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-overlay h1 {
  color: #fff;
  font-family: var(--font-titre);
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.2;
  max-width: 800px;
  letter-spacing: -.02em;
}
.hero-chapo {
  color: rgba(255, 255, 255, .85);
  font-family: var(--font-corps);
  font-style: italic;
  font-size: 18px;
  line-height: 1.6;
  max-width: 640px;
  margin-top: 12px;
}

/* Petit Format variant */
.article-page--petit .hero-article img {
  aspect-ratio: 21/9;
  max-height: 40vh;
}
.article-page--petit .hero-overlay h1 {
  font-size: clamp(1.4rem, 3.5vw, 2.2rem);
}


/* === 4. INTERACTIVE TERMS === */

.term {
  color: var(--vert);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: help;
  background: none;
  border: none;
  font: inherit;
  padding: 0;
  transition: color .2s, background .2s;
}
.term:hover {
  color: var(--cyan);
  background: rgba(3, 129, 104, .06);
}
.term.active {
  color: var(--cyan);
  background: rgba(0, 150, 187, .1);
  border-radius: 4px;
  padding: 0 2px;
  margin: 0 -2px;
}


/* === 5. DEFINITION SIDEBAR === */

.def-sidebar {
  position: sticky;
  top: 140px;
  align-self: start;
}
.def-panel {
  background: var(--fond-carte);
  border: 1px solid var(--support);
  border-radius: var(--radius-goutte);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all .4s ease;
  position: relative;
}
.def-panel-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 24px 16px;
  color: var(--texte-light);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.5;
}
.def-panel-empty .hint-icon {
  font-size: 28px;
  line-height: 1;
  opacity: .6;
}
.def-panel-empty .hint-term {
  color: var(--vert);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.def-content {
  display: none;
}
.def-content.active {
  display: block;
}
.def-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--fond-alt);
  border: none;
  cursor: pointer;
  color: var(--texte-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all var(--transition);
}
.def-close:hover {
  background: var(--vert);
  color: #fff;
}
.def-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}
.def-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(3, 129, 104, .1);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.def-term-name {
  font-family: var(--font-titre);
  font-weight: 600;
  font-size: 15px;
}
.def-term-cat {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 3px 8px;
  border-radius: var(--radius-goutte-alt);
  background: rgba(3, 129, 104, .08);
  color: var(--vert);
  display: inline-block;
}
.def-text {
  font-family: var(--font-corps);
  font-size: 14px;
  line-height: 1.7;
  color: var(--texte-light);
}
.def-link {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--vert);
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition);
}
.def-link:hover {
  color: var(--cyan);
}

/* === 6. CTA WIDGET === */

.cta-widget {
  background: var(--gradient);
  border-radius: var(--radius-goutte);
  padding: 24px;
  margin-top: 24px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.cta-widget::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 40' preserveAspectRatio='none'%3E%3Cpath d='M0,40 L0,20 Q100,0 200,20 Q300,40 400,20 L400,40Z' fill='white' opacity='.06'/%3E%3C/svg%3E") no-repeat bottom/cover;
}
.cta-widget * {
  position: relative;
  z-index: 1;
}
.cta-widget h4 {
  font-family: var(--font-titre);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}
.cta-widget p {
  font-family: var(--font-ui);
  font-size: 13px;
  opacity: .88;
  margin-bottom: 14px;
}
.btn-soutenir {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: #fff;
  color: var(--vert);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-goutte-alt);
  transition: all var(--transition);
  text-decoration: none;
}
.btn-soutenir:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}


/* === 7. TERM TOOLTIP (mobile) === */

.term-tooltip {
  position: fixed;
  bottom: -100%;
  left: 0;
  right: 0;
  background: var(--fond-carte);
  border-top: 1px solid var(--support);
  border-radius: 20px 20px 0 0;
  padding: 24px;
  z-index: 2000;
  transition: bottom .3s ease;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, .15);
}
.term-tooltip.active {
  bottom: 0;
}
.term-tooltip .def-close {
  position: absolute;
  top: 12px;
  right: 12px;
}


/* === 8. ARTICLE IMAGES === */

.article-img {
  margin: 40px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}
.article-img img {
  width: 100%;
  height: auto;
  display: block;
}
.article-img figcaption {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--texte-light);
  padding: 12px 0;
  text-align: center;
}

/* Full bleed */
.article-img-full {
  margin: 40px calc(-50vw + 50%);
  width: 100vw;
  border-radius: 0;
}

/* Medium */
.article-img-medium {
  max-width: 520px;
  margin: 40px auto;
}

/* Small / float */
.article-img-small {
  float: right;
  max-width: 280px;
  margin: 0 0 24px 24px;
}

/* Inline */
.article-img-inline {
  display: inline;
  vertical-align: middle;
  border-radius: 4px;
}

/* Viewfinder overlay on article images */
.article-img.vf-overlay::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 2px solid var(--rub-color, rgba(3, 129, 104, .6));
  border-radius: 4px;
  z-index: 3;
  pointer-events: none;
  opacity: .6;
  clip-path: polygon(
    0 0, 20px 0, 20px 2px, 2px 2px, 2px 20px, 0 20px,
    0 100%, 0 calc(100% - 20px), 2px calc(100% - 20px), 2px calc(100% - 2px), 20px calc(100% - 2px), 20px 100%,
    100% 100%, calc(100% - 20px) 100%, calc(100% - 20px) calc(100% - 2px), calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) calc(100% - 20px), 100% calc(100% - 20px),
    100% 0, 100% 20px, calc(100% - 2px) 20px, calc(100% - 2px) 2px, calc(100% - 20px) 2px, calc(100% - 20px) 0
  );
}


/* === 9. PULL-QUOTE === */

.pull-quote {
  border-left: 3px solid var(--vert);
  padding: 20px 24px;
  margin: 40px 0;
  background: rgba(3, 129, 104, .04);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.pull-quote blockquote {
  font-family: var(--font-corps);
  font-style: italic;
  font-size: 19px;
  line-height: 1.6;
  position: relative;
  padding-left: 20px;
}
.pull-quote blockquote::before {
  content: '\201C';
  font-family: var(--font-titre);
  font-size: 60px;
  color: var(--vert);
  opacity: .3;
  position: absolute;
  top: -12px;
  left: -8px;
  line-height: 1;
}
.pull-quote cite {
  font-family: var(--font-ui);
  font-size: 13px;
  font-style: normal;
  color: var(--texte-light);
  display: block;
  margin-top: 12px;
}

/* === 12. VIDEO & AUDIO BLOCKS === */

.video-block {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 40px 0;
  background: #000;
}
.video-block::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 2px solid var(--rub-color, rgba(255, 255, 255, .4));
  border-radius: 4px;
  z-index: 3;
  pointer-events: none;
  clip-path: polygon(
    0 0, 20px 0, 20px 2px, 2px 2px, 2px 20px, 0 20px,
    0 100%, 0 calc(100% - 20px), 2px calc(100% - 20px), 2px calc(100% - 2px), 20px calc(100% - 2px), 20px 100%,
    100% 100%, calc(100% - 20px) 100%, calc(100% - 20px) calc(100% - 2px), calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) calc(100% - 20px), 100% calc(100% - 20px),
    100% 0, 100% 20px, calc(100% - 2px) 20px, calc(100% - 2px) 2px, calc(100% - 20px) 2px, calc(100% - 20px) 0
  );
}
.video-block img,
.video-block video {
  width: 100%;
  display: block;
}
.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .6);
  border: 2px solid #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  z-index: 5;
  transition: transform var(--transition), background var(--transition);
}
.video-play:hover {
  transform: translate(-50%, -50%) scale(1.1);
  background: rgba(3, 129, 104, .8);
}
.video-caption {
  font-family: var(--font-ui);
  font-size: 13px;
  text-align: center;
  padding: 12px 0;
  color: var(--texte-light);
}

.audio-block {
  background: var(--fond-alt);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 40px 0;
  display: flex;
  gap: 16px;
  align-items: center;
}
.audio-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
}
.audio-info {
  flex: 1;
  min-width: 0;
}
.audio-title {
  font-family: var(--font-titre);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}
.audio-meta {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--texte-light);
}
.audio-bar {
  flex: 1;
  height: 4px;
  background: var(--support);
  border-radius: 4px;
  margin-top: 12px;
  position: relative;
  overflow: hidden;
}
.audio-bar::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 35%;
  height: 100%;
  background: var(--gradient);
  border-radius: 4px;
}

/* === 14. SOURCES === */

.sources-block {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--support);
}
.sources-block h3 {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 16px;
}
.sources-block ul {
  list-style: none;
  padding: 0;
}
.sources-block li {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--texte-light);
  margin-bottom: 8px;
  padding-left: 16px;
  position: relative;
}
.sources-block li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--support);
}
.sources-block li a {
  color: var(--vert);
  transition: color var(--transition);
}
.sources-block li a:hover {
  color: var(--cyan);
}

.sources-compact {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--texte-light);
  margin: 24px 0;
}
.sources-compact a {
  color: var(--vert);
  transition: color var(--transition);
}
.sources-compact a:hover {
  color: var(--cyan);
}


/* === 15. SHARE BLOCK === */

.share-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
}
.share-label {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--texte-light);
}
.share-btns {
  display: flex;
  gap: 8px;
}
.share-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: transform .2s;
}
.share-btn:hover {
  transform: scale(1.1);
}
.share-btn--fb { background: #1877F2; }
.share-btn--tw { background: #1DA1F2; }
.share-btn--wa { background: #25D366; }
.share-btn--mail { background: var(--texte-light); }
.share-btn--copy { background: var(--vert); }


/* === 16. RELATED ARTICLES === */

.related-section {
  padding: 48px 0 0;
}
.related-title {
  font-family: var(--font-titre);
  font-weight: 600;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 768px) {
  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.card-related {
  background: var(--fond-carte);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid var(--support);
}
.card-related:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.card-related-img {
  aspect-ratio: 16/10;
  overflow: hidden;
}
.card-related-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.card-related:hover .card-related-img img {
  transform: scale(1.05);
}
.card-related-body {
  padding: 16px;
}
.card-related-tag {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}
.card-related-title {
  font-family: var(--font-titre);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-related-meta {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--texte-light);
  margin-top: 8px;
}

/* === 20. RESPONSIVE === */

@media (max-width: 768px) {
  .article-grid {
    grid-template-columns: 1fr;
  }
  .def-sidebar {
    display: none;
  }
  .article-img-small {
    float: none;
    max-width: 100%;
    margin: 40px 0;
  }
}

@media (max-width: 480px) {
  .article-page {
    padding: 0 16px 80px;
  }
  .hero-overlay {
    padding: 20px;
  }
  .share-block {
    flex-wrap: wrap;
  }
}


/* === ARTICLE BODY IMAGES — full width inside content === */

.article-body img {
  max-width: 100%;
  height: auto;
  display: block;
}
.article-body figure,
.article-body .wp-block-image {
  margin: 24px 0;
  max-width: 100%;
}
.article-body figure img,
.article-body .wp-block-image img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  display: block;
}
.article-body .wp-block-image figcaption,
.article-body figure figcaption {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--texte-light);
  padding: 8px 0;
  text-align: center;
}
/* WP columns in articles */
.article-body .wp-block-columns {
  display: flex;
  gap: 24px;
  margin: 24px 0;
}
.article-body .wp-block-column {
  flex: 1;
}
@media (max-width: 768px) {
  .article-body .wp-block-columns {
    flex-direction: column;
  }
}
/* Source attribution */
.source-attribution {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color, #e5e5e5);
  font-size: 14px;
  color: var(--texte-light, #888);
}
/* YouTube embeds in articles */
.article-body .wp-block-embed-youtube {
  margin: 24px 0;
}
.article-body .wp-block-embed__wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}
.article-body .wp-block-embed__wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
}
