/**
 * Articles Shared Styles
 * Extracted from inline styles to reduce duplication across article pages
 */

/* Fade-in animations */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-fade {
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Flicker progressif - comme un problème de connexion */
@keyframes flickerIn {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  25%  { opacity: 0; }
  50%  { opacity: 1; }
  55%  { opacity: 0; }
  70%  { opacity: 1; }
  100% { opacity: 1; }
}

/* Disable fadeIn when using flicker effect */
.article-header:has(.flicker-title),
.article-header:has(.flicker-title) ~ .article-content,
.article-header:has(.flicker-title) ~ .article-content .section,
.article-header:has(.flicker-title) ~ .cta-section,
.article-header:has(.flicker-title) ~ .footer {
  opacity: 1 !important;
  animation: none !important;
}

.flicker-title,
.flicker-text {
  opacity: 1 !important;
  animation: none !important;
}

.flicker-title .char,
.flicker-text .char {
  opacity: 0;
  display: inline-block;
  animation: flickerIn 0.15s steps(1) forwards;
}

.flicker-title .char.space,
.flicker-text .char.space {
  width: 0.3em;
}

/* Initial hidden state for animated elements */
.article-header,
.section,
.cta-section,
.footer {
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards;
}

.article-header {
  animation-delay: 0.1s;
}
.section:nth-child(1) {
  animation-delay: 0.3s;
}
.section:nth-child(2) {
  animation-delay: 0.4s;
}
.section:nth-child(3) {
  animation-delay: 0.5s;
}
.section:nth-child(4) {
  animation-delay: 0.6s;
}
.section:nth-child(5) {
  animation-delay: 0.7s;
}
.section:nth-child(6) {
  animation-delay: 0.8s;
}
.cta-section {
  animation-delay: 0.9s;
}
.footer {
  animation-delay: 1s;
}

/* Smooth transitions for interactive elements */
a,
button {
  transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background-color: #fff;
  min-height: 100vh;
}

/* Navigation */
.navbar {
  background-color: rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(0.1875rem);
  -webkit-backdrop-filter: blur(0.1875rem);
  border: 1px solid rgba(0, 0, 0, 0.05);
  padding: 0.75rem 0.40rem;
  position: fixed;
  width: calc(100% - 16rem);
  left: 8rem;
  right: 8rem;
  top: 1rem;
  z-index: 1000;
  border-radius: 0.5rem;
  transition: background-color 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
}

.nav-container {
  max-width: 100%;
  margin: 0;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Alliance No 2', 'Alliance No. 2', 'Helvetica Neue', Arial, sans-serif !important;
  font-size: 1.5rem;
  font-weight: 400;
  color: #000;
  text-decoration: none;
  letter-spacing: 0.5px;
  font-feature-settings: 'ss01' 1, 'ss02' 1, 'ss03' 1, 'ss04' 1, 'ss05' 1, 'ss06' 1, 'ss07' 1, 'ss08' 1, 'ss09' 1, 'ss10' 1, 'liga' 1, 'kern' 1 !important;
  -webkit-font-feature-settings: 'ss01' 1, 'ss02' 1, 'ss03' 1, 'ss04' 1, 'ss05' 1, 'ss06' 1, 'ss07' 1, 'ss08' 1, 'ss09' 1, 'ss10' 1, 'liga' 1, 'kern' 1 !important;
  -moz-font-feature-settings: 'ss01' 1, 'ss02' 1, 'ss03' 1, 'ss04' 1, 'ss05' 1, 'ss06' 1, 'ss07' 1, 'ss08' 1, 'ss09' 1, 'ss10' 1, 'liga' 1, 'kern' 1 !important;
}

.nav-actions {
  display: flex;
  align-items: center;
}

.nav-button {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  background-color: transparent;
  color: #000;
  border: 1px solid #000;
  border-radius: 0;
  transition: all 0.15s ease;
  font-family: 'Alliance No 2', 'Alliance No. 2', 'Helvetica Neue', Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: 400;
  text-decoration: none;
}

.nav-button.nav-page-btn {
  width: 130px;
  margin-right: -1px;
}

.nav-button.nav-page-btn:hover {
  background-color: #333;
  color: #fff;
  border-color: #333;
}

.nav-button.nav-page-btn.active {
  background: #333;
  color: #fff;
  border-color: #333;
  font-weight: 600;
}

@media (max-width: 1350px) {
  .navbar { width: calc(100% - 8rem); left: 4rem; right: 4rem; }
}
@media (max-width: 1200px) {
  .navbar { width: calc(100% - 4rem); left: 2rem; right: 2rem; }
  .nav-button.nav-page-btn { width: 110px; font-size: 0.8rem; }
  .nav-container { padding: 0 12px; }
}
@media (max-width: 1050px) {
  .navbar { width: calc(100% - 2rem); left: 1rem; right: 1rem; padding: 0.5rem 0.25rem; }
  .nav-button.nav-page-btn { width: 95px; font-size: 0.75rem; height: 38px; }
  .nav-icon-button { width: 38px; height: 38px; }
  .nav-container { padding: 0 8px; }
}
@media (max-width: 900px) {
  .navbar { width: calc(100% - 2rem); left: 1rem; right: 1rem; }
  .nav-button.nav-page-btn { display: none; }
}

.nav-icon-button {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid #000;
  color: #000;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-right: -1px;
}

.nav-icon-button:hover {
  background: #000;
  color: #fff;
}

.nav-icon-button:hover svg {
  stroke: #fff;
}

/* Article Header */
.article-header {
  background: #f8f8f8;
  padding: 10rem 0 5rem;
  margin-top: 80px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid #e0e0e0;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
  z-index: 1;
}

.article-category {
  display: inline-block;
  color: #5b21b6;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  margin-bottom: 1rem;
  font-weight: 600;
  text-transform: uppercase;
}

.article-title {
  font-size: 3.5rem;
  font-weight: 300;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  letter-spacing: -1px;
  color: #000;
}

.article-subtitle {
  font-size: 1.35rem;
  color: #666;
  margin-bottom: 2rem;
  line-height: 1.6;
  font-weight: 300;
}

.article-meta {
  display: flex;
  gap: 2rem;
  font-size: 0.9rem;
  color: #999;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Article Content - Two Column Layout */
.article-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 5rem 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  position: relative;
  background-color: #fff;
}

/* Left Column - Sticky Subtitles */
.subtitles-column {
  flex: 0 0 500px;
  position: sticky;
  top: 100px;
  height: fit-content;
  padding-right: 80px;
}

.subtitles-title {
  font-size: 3.5rem;
  font-weight: 300;
  color: #000;
  margin-bottom: 2rem;
  margin-top: 60px;
  position: relative;
  overflow: visible;
  white-space: normal;
  word-wrap: break-word;
  min-height: 200px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.subtitles-title::before {
  content: "";
  position: absolute;
  top: -1rem;
  left: 0;
  right: 0;
  height: 1px;
  background-color: #e0e0e0;
}

/* Cursor for typewriter effect */
.cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background-color: #000;
  margin-left: 2px;
  vertical-align: text-bottom;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cursor.typing {
  opacity: 1;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

/* Progress bar for sections */
.section-progress {
  position: absolute;
  top: 20px;
  left: 0;
  right: 80px;
  height: 40px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.progress-segment {
  flex: 1;
  height: 3px;
  background: #f0f0f0;
  position: relative;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 2px;
  overflow: hidden;
}

.progress-segment::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #000 0%, #333 100%);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 2px;
}

.progress-segment.active {
  background: #e0e0e0;
}

.progress-segment.active::before {
  width: 100%;
  animation: pulse 2s ease-in-out infinite;
}

.progress-segment.passed {
  background: #e0e0e0;
}

.progress-segment.passed::before {
  width: 100%;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.progress-label {
  position: absolute;
  top: -24px;
  left: 0;
  font-size: 0.7rem;
  color: #b0b0b0;
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: all 0.4s ease;
  opacity: 0.6;
}

.progress-segment.active .progress-label,
.progress-segment.passed .progress-label {
  color: #666;
  opacity: 1;
  transform: translateY(-2px);
}

.progress-segment:first-child .progress-label {
  left: 0;
}

.progress-segment:last-child .progress-label {
  right: 0;
  left: auto;
}

/* Add smooth entrance animation */
.progress-segment {
  animation: slideIn 0.6s ease-out forwards;
  opacity: 0;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scaleX(0);
  }
  to {
    opacity: 1;
    transform: scaleX(1);
  }
}

.progress-segment:nth-child(1) { animation-delay: 0.1s; }
.progress-segment:nth-child(2) { animation-delay: 0.2s; }
.progress-segment:nth-child(3) { animation-delay: 0.3s; }
.progress-segment:nth-child(4) { animation-delay: 0.4s; }
.progress-segment:nth-child(5) { animation-delay: 0.5s; }
.progress-segment:nth-child(6) { animation-delay: 0.6s; }
.progress-segment:nth-child(7) { animation-delay: 0.7s; }

/* Subtitle items hidden */
.subtitle-item {
  display: none;
}

/* Right Column - Main Content */
.content-column {
  flex: 1;
  min-width: 0;
}

.section {
  margin-bottom: 6rem;
  scroll-margin-top: 120px;
}

.section h2 {
  font-size: 2.5rem;
  font-weight: 400;
  margin-bottom: 2rem;
  color: #000;
  position: relative;
  padding-left: 0;
  letter-spacing: -0.02em;
}

.section h3 {
  font-size: 1.5rem;
  font-weight: 500;
  margin: 2rem 0 1rem;
  color: #000;
}

.section p {
  color: #666;
  margin-bottom: 1.5rem;
  line-height: 1.8;
  font-size: 1.05rem;
}

.article-signature {
  font-weight: 600;
  color: #000;
  margin-top: 2rem;
  font-style: italic;
}

/* Reset and style ALL unordered lists */
.section ul {
  list-style: none;
  margin: 1rem 0 1.5rem;
  padding: 0;
  margin-left: 0;
}

/* Standalone UL (after OL) gets standard padding */
.section > ul,
.section ol + ul {
  padding-left: 2.5rem;
}

/* Nested UL inside OL LI already inherits the 2.5rem from parent, so no extra padding */
.section ol li ul {
  padding-left: 0;
  margin-left: 0;
}

/* Style ALL list items uniformly */
.section ul li {
  color: #666;
  margin-bottom: 0.75rem;
  margin-left: 0;
  padding-left: 25px;
  position: relative;
  line-height: 1.8;
  font-size: 1.05rem;
  list-style: none;
}

/* Bullet positioning */
.section ul li::before {
  content: "\2022";
  position: absolute;
  left: 0;
  color: #5b21b6;
  font-weight: 600;
  font-size: 1.2rem;
}

.section ol {
  list-style: none;
  margin-bottom: 1.5rem;
  counter-reset: item;
}

.section ol > li {
  color: #666;
  margin-bottom: 1rem;
  padding-left: 2.5rem;
  position: relative;
  line-height: 1.8;
  font-size: 1.05rem;
  counter-increment: item;
}

.section ol > li::before {
  content: counter(item) ".";
  position: absolute;
  left: 0;
  color: #5b21b6;
  font-weight: 600;
}

/* Highlight Box */
.highlight-box {
  background-color: #f8f5ff;
  border-left: 4px solid #b19cd9;
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 0 8px 8px 0;
}

.highlight-box p {
  color: #333;
  margin-bottom: 0;
}

/* Strong text styling */
strong {
  color: #000;
  font-weight: 600;
}

/* Footer */
.footer {
  background-color: #fff;
  padding: 3rem 0;
  margin-top: 5rem;
  border-top: 1px solid #e0e0e0;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  text-align: center;
}

.footer-content p {
  color: #999;
  font-size: 0.875rem;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.footer-nav a {
  color: #555;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s;
}

.footer-nav a:hover {
  color: #000;
}

/* Responsive Design */
@media (max-width: 1400px) {
  .article-content {
    padding: 5rem 80px;
  }
}

@media (max-width: 1024px) {
  .article-content {
    flex-direction: column;
    gap: 2rem;
    padding: 5rem 40px;
  }

  .subtitles-column {
    display: none;
  }

  .content-column {
    flex: 1;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 0;
  }

  .nav-container {
    padding: 5vw;
    padding-top: calc(5vw + env(safe-area-inset-top));
    justify-content: flex-start;
  }

  .nav-logo a {
    gap: 3vw;
    font-size: 6vw;
  }

  .nav-logo a span {
    font-size: 6vw;
    font-weight: 500;
  }

  .nav-logo img {
    width: 8vw;
    height: 8vw;
  }

  .nav-actions {
    display: none;
  }

  .article-content {
    padding: 3rem 20px;
  }
  .article-header {
    padding: 8rem 0 4rem;
  }

  .article-title {
    font-size: 2.5rem;
  }

  .article-subtitle {
    font-size: 1.1rem;
  }

  .article-meta {
    flex-direction: column;
    gap: 1rem;
  }

  .section h2 {
    font-size: 1.75rem;
  }
}

/* ========================================
   Related Articles Section
   ======================================== */

.related-articles {
  width: 100%;
  flex-basis: 100%;
  margin-top: 4rem;
  padding: 3rem 0;
  border-top: 1px solid #e0e0e0;
}

.related-articles h2 {
  font-size: 1.5rem;
  font-weight: 500;
  color: #1a1a1a;
  margin-bottom: 2rem;
  text-align: center;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.related-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.related-card:hover {
  background: #fff;
  border-color: #1a1a1a;
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.related-category {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #666;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.related-title {
  font-size: 1rem;
  font-weight: 500;
  color: #1a1a1a;
  line-height: 1.4;
}

.related-card:hover .related-title {
  color: #000;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .related-articles {
    margin-top: 2rem;
    padding: 2rem 0;
    overflow: hidden;
  }

  .related-articles h2 {
    font-size: 1.25rem;
    padding: 0 1rem;
    margin-bottom: 1.5rem;
  }

  /* Carousel style for related articles on mobile */
  .related-grid {
    display: flex;
    gap: 1rem;
    padding: 0 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
  }

  .related-grid::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }

  .related-card {
    flex: 0 0 75vw;
    min-width: 75vw;
    padding: 1.25rem;
    scroll-snap-align: center;
    scroll-snap-stop: always;
  }

  /* Show hint that more cards exist */
  .related-card:first-child {
    margin-left: calc((100vw - 75vw) / 2 - 1rem);
  }

  .related-card:last-child {
    margin-right: calc((100vw - 75vw) / 2 - 1rem);
  }
}
