/* ═══════════════════════════════════════════════════════════════════
   SERVICE PAGES — Article & Section Styling
   Design : High-end editorial with Double-Bezel cards
   Vibe : Soft Structuralism + scroll-reveal
   ═══════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────
   MAIN CONTENT CONTAINER
   ───────────────────────────────────────────────────────────────── */
main {
  position: relative;
  z-index: 2;
  background: var(--bg);
  min-height: 100vh;
  padding: 0;
}

/* Sections avec padding généreux */
main > section {
  padding: clamp(4rem, 8vw, 7rem) var(--x);
  border-bottom: 1px solid var(--border-soft);
}

main > section:last-child {
  border-bottom: none;
}

/* ─────────────────────────────────────────────────────────────────
   SECTION HERO (Service pages)
   ───────────────────────────────────────────────────────────────── */
.service-hero {
  padding: clamp(3rem, 6vw, 5rem) var(--x);
  background: linear-gradient(
    135deg,
    var(--bg),
    rgba(45, 106, 79, 0.02)
  );
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.service-hero h2 {
  font-family: var(--f-serif);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 1.25rem;
  line-height: 1.15;
  opacity: 0;
  animation: slideUpBlur var(--t-x) var(--spring) 0.2s forwards;
}

.service-hero p {
  font-size: var(--t-lg);
  color: var(--muted);
  line-height: 1.8;
  max-width: 52rem;
  opacity: 0;
  animation: slideUpBlur var(--t-x) var(--spring) 0.35s forwards;
}

.service-hero p + p {
  margin-top: 1.25rem;
  animation-delay: 0.45s;
}

/* ─────────────────────────────────────────────────────────────────
   SECTION HEADINGS (H2)
   ───────────────────────────────────────────────────────────────── */
section h2 {
  font-family: var(--f-serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  line-height: 1.2;
  position: relative;
  padding-bottom: 0.75rem;
}

/* Subtle underline accent under h2 */
section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: clamp(3rem, 15vw, 6rem);
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--accent),
    transparent
  );
  border-radius: 2px;
  opacity: 0;
  animation: slideRight var(--t-slow) var(--spring) 0.3s forwards;
}

/* ─────────────────────────────────────────────────────────────────
   PARAGRAPHS & TEXT
   ───────────────────────────────────────────────────────────────── */
p {
  font-size: var(--t-md);
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 1.25rem;
  opacity: 0;
  animation: fadeUp var(--t-slow) var(--spring) 0.4s forwards;
}

/* ─────────────────────────────────────────────────────────────────
   GRID LAYOUTS (problems-grid, services-grid, etc.)
   ───────────────────────────────────────────────────────────────── */
.problems-grid,
.services-grid,
.criteria-grid,
.options-grid,
.detail-card,
.issues-grid,
.causes-grid,
.causes-list,
.contracts-grid,
.problems-grid,
.scenarios-grid,
.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin: clamp(2rem, 4vw, 3.5rem) 0;
}

/* Larger layouts on desktop */
@media (min-width: 1024px) {
  .problems-grid,
  .services-grid,
  .criteria-grid,
  .causes-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .options-grid,
  .scenarios-grid,
  .causes-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .contracts-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Tablet adjustment */
@media (max-width: 1023px) and (min-width: 768px) {
  .problems-grid,
  .services-grid,
  .criteria-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ─────────────────────────────────────────────────────────────────
   ARTICLE CARD (Double-Bezel architecture)
   Problems, services, causes, options, etc.
   ───────────────────────────────────────────────────────────────── */
article {
  /* Outer shell (Double-Bezel) */
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(45, 106, 79, 0.06),
    transparent
  );
  border: 1px solid var(--border-soft);
  border-radius: var(--r-2xl);
  backdrop-filter: blur(12px);

  /* Inner content */
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: calc(var(--r-2xl) - 1px);
  padding: clamp(1.5rem, 4vw, 2.25rem);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 1px 3px rgba(0, 0, 0, 0.03);

  transition:
    all var(--t-slow) var(--spring);

  opacity: 0;
  transform: translateY(20px) scale(0.98);
  animation: cardReveal var(--t-x) var(--spring) forwards;

  cursor: pointer;
}

/* Stagger animation for each article card */
section > .problems-grid article:nth-child(1),
section > .services-grid article:nth-child(1),
section > .criteria-grid article:nth-child(1),
section > .causes-grid article:nth-child(1),
section > .options-grid article:nth-child(1) {
  animation-delay: 0.15s;
}
section > .problems-grid article:nth-child(2),
section > .services-grid article:nth-child(2),
section > .criteria-grid article:nth-child(2),
section > .causes-grid article:nth-child(2),
section > .options-grid article:nth-child(2) {
  animation-delay: 0.23s;
}
section > .problems-grid article:nth-child(3),
section > .services-grid article:nth-child(3),
section > .criteria-grid article:nth-child(3),
section > .causes-grid article:nth-child(3) {
  animation-delay: 0.31s;
}
section > .problems-grid article:nth-child(4),
section > .services-grid article:nth-child(4),
section > .causes-grid article:nth-child(4),
section > .options-grid article:nth-child(3) {
  animation-delay: 0.39s;
}
section > .problems-grid article:nth-child(5),
section > .services-grid article:nth-child(5) {
  animation-delay: 0.47s;
}
section > .problems-grid article:nth-child(6),
section > .services-grid article:nth-child(6) {
  animation-delay: 0.55s;
}

/* Hover state — elevated + glow */
article:hover {
  border-color: var(--accent-light);
  background: var(--surface-2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 8px 24px rgba(45, 106, 79, 0.15),
    0 2px 8px rgba(0, 0, 0, 0.04);
  transform: translateY(-6px) scale(1.01);
}

html.dark article:hover {
  background: var(--surface-2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 8px 24px rgba(82, 183, 136, 0.10),
    0 2px 8px rgba(0, 0, 0, 0.20);
}

/* ─────────────────────────────────────────────────────────────────
   ARTICLE INTERNALS (h3, p, etc.)
   ───────────────────────────────────────────────────────────────── */
article h3 {
  font-family: var(--f-serif);
  font-size: var(--t-lg);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.3;
  transition:
    color var(--t-base) var(--spring);
}

article:hover h3 {
  color: var(--accent);
}

article p {
  font-size: var(--t-sm);
  color: var(--muted);
  line-height: 1.7;
  opacity: 1;
  animation: none;
}

/* ─────────────────────────────────────────────────────────────────
   LISTS (Ordered & Unordered)
   ───────────────────────────────────────────────────────────────── */
ol, ul {
  margin: clamp(1.5rem, 3vw, 2.5rem) 0;
  padding-left: 0;
  list-style: none;
}

/* Exclure la navbar du margin */
.nav-links {
  margin: 0 !important;
  padding: 0 !important;
}

/* Ordered lists with custom counters */
ol {
  counter-reset: item;
}

ol li {
  counter-increment: item;
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  padding-left: 0;
}

ol li::before {
  content: counter(item);
  font-family: var(--f-serif);
  font-size: var(--t-xl);
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    var(--accent-pale),
    rgba(45, 106, 79, 0.05)
  );
  border: 1px solid var(--accent-light);
  border-radius: 50%;
  opacity: 0;
  animation: popIn var(--t-slow) var(--spring) forwards;
}

ol li:nth-child(1)::before { animation-delay: 0.15s; }
ol li:nth-child(2)::before { animation-delay: 0.23s; }
ol li:nth-child(3)::before { animation-delay: 0.31s; }
ol li:nth-child(4)::before { animation-delay: 0.39s; }
ol li:nth-child(5)::before { animation-delay: 0.47s; }
ol li:nth-child(6)::before { animation-delay: 0.55s; }

ol li strong {
  color: var(--text);
  font-weight: 600;
}

/* Unordered lists with custom icons */
ul li {
  display: flex;
  gap: 1rem;
  /*margin-bottom: 1.25rem;*/
  padding-left: 0;
  font-size: var(--t-sm);
  line-height: 1.8;
  opacity: 0;
  animation: slideInLeft var(--t-slow) var(--spring) forwards;
}

ul li:nth-child(1) { animation-delay: 0.1s; }
ul li:nth-child(2) { animation-delay: 0.16s; }
ul li:nth-child(3) { animation-delay: 0.22s; }
ul li:nth-child(4) { animation-delay: 0.28s; }
ul li:nth-child(5) { animation-delay: 0.34s; }
ul li:nth-child(6) { animation-delay: 0.40s; }
ul li:nth-child(7) { animation-delay: 0.46s; }

/* IMPORTANT: Appliquer UNIQUEMENT au contenu principal, pas à la navbar */
main ul li::before {
  content: '→';
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
  font-size: var(--t-lg);
}

ul li strong {
  color: var(--text);
  font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────────
   DETAIL CARD (Service details, features)
   ───────────────────────────────────────────────────────────────── */
.detail-card {
  grid-column: auto;
}

.detail-card h3 {
  font-family: var(--f-sans);
  font-size: var(--t-md);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-card p {
  font-size: var(--t-sm);
}

/* ─────────────────────────────────────────────────────────────────
   CTA SECTIONS
   ───────────────────────────────────────────────────────────────── */
.cta-section {
  text-align: center;
  padding: clamp(4rem, 8vw, 6rem) var(--x);
  background: linear-gradient(
    135deg,
    var(--accent-pale),
    rgba(45, 106, 79, 0.03)
  );
  border-radius: var(--r-2xl);
  margin: clamp(3rem, 6vw, 5rem) 0;
}

.cta-section h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 0.75rem;
  animation: none;
}

.cta-section h2::after {
  display: none;
}

.cta-section > p {
  font-size: var(--t-lg);
  color: var(--text);
  margin-bottom: clamp(2rem, 4vw, 3rem);
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
  animation: none;
}

/* ─────────────────────────────────────────────────────────────────
   CTA BUTTONS
   ───────────────────────────────────────────────────────────────── */
.cta-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 2vw, 1.5rem);
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.125rem 2rem;
  border-radius: var(--r-pill);
  font-size: var(--t-md);
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: none;
  transition:
    all var(--t-slow) var(--spring);
  box-shadow: var(--sh-in), var(--sh-md);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  opacity: 0;
  animation: slideUpBlur var(--t-x) var(--spring) 0.5s forwards;
}

.btn-primary:hover {
  background: var(--accent-mid);
  box-shadow: var(--sh-in), var(--sh-lg);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--surface);
  color: var(--accent);
  border: 2px solid var(--accent);
  opacity: 0;
  animation: slideUpBlur var(--t-x) var(--spring) 0.6s forwards;
}

.btn-secondary:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--sh-in), var(--sh-lg);
  transform: translateY(-2px);
}

/* ─────────────────────────────────────────────────────────────────
   PRICING CARDS
   ───────────────────────────────────────────────────────────────── */
.pricing-card {
  padding: clamp(2rem, 4vw, 2.75rem);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-2xl);
  text-align: center;
  box-shadow: var(--sh-in), var(--sh-sm);
  transition: all var(--t-slow) var(--spring);
}

.pricing-card h3 {
  font-family: var(--f-serif);
  font-size: var(--t-xl);
  margin-bottom: 1rem;
}

.pricing-card .price {
  font-family: var(--f-serif);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.pricing-card p {
  font-size: var(--t-sm);
  margin-bottom: 0;
}

.pricing-card:hover {
  border-color: var(--accent-light);
  box-shadow: var(--sh-in), var(--sh-lg);
  transform: translateY(-4px);
}

/* ─────────────────────────────────────────────────────────────────
   ANIMATIONS
   ───────────────────────────────────────────────────────────────── */
@keyframes slideUpBlur {
  from {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes slideRight {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ─────────────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .problems-grid,
  .services-grid,
  .criteria-grid,
  .causes-grid,
  .options-grid,
  .scenarios-grid {
    grid-template-columns: 1fr;
  }

  .contracts-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cta-buttons {
    flex-direction: column;
    width: 100%;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
  }

  article h3 {
    font-size: var(--t-md);
  }

  section h2 {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
  }
}

/* ─────────────────────────────────────────────────────────────────
   DARK MODE
   ───────────────────────────────────────────────────────────────── */
html.dark article {
  background: var(--surface);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 1px 3px rgba(0, 0, 0, 0.16);
}

html.dark .cta-section {
  background: linear-gradient(
    135deg,
    var(--accent-light),
    rgba(82, 183, 136, 0.03)
  );
}

html.dark ol li::before {
  background: linear-gradient(
    135deg,
    var(--accent-light),
    rgba(82, 183, 136, 0.05)
  );
  border-color: var(--accent-light);
}
