﻿/* ===== REGLEMENTATION PAGE — SPECIFIC STYLES ===== */

/* Hero */
.regl-hero {
  position: relative;
  min-height: 400px;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.regl-hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.05);
  transition: transform 8s ease;
}
.regl-hero:hover .regl-hero__bg { transform: scale(1); }
.regl-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(29,53,87,.85) 0%, rgba(69,123,157,.65) 100%);
}
.regl-hero__content {
  position: relative;
  z-index: 2;
  color: #fff;
  padding-top: 6rem;
  padding-bottom: 3rem;
}
.regl-hero__content .hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.15);
  border: 1.5px solid rgba(255,255,255,.3);
  border-radius: var(--radius-full);
  padding: .35rem 1rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.regl-hero__content h1 {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-family: 'Merriweather', serif;
  margin-bottom: 1rem;
  max-width: 720px;
}
.regl-hero__content p {
  font-size: 1.1rem;
  opacity: .9;
  max-width: 600px;
  margin-bottom: 1.75rem;
}
.regl-hero__ctas { display: flex; flex-wrap: wrap; gap: .75rem; }
.regl-hero__ctas .btn-secondary {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.4);
}
.regl-hero__ctas .btn-secondary:hover { background: rgba(255,255,255,.25); }

/* Summary cards */
.regl-summary {
  background: #f8f9fa;
  padding: 2.5rem 0;
  border-bottom: 1px solid #e9ecef;
}
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.summary-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border-left: 4px solid transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: transform .2s, box-shadow .2s;
}
.summary-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.1); }
.summary-card--warning { border-left-color: #f4a261; }
.summary-card--danger  { border-left-color: #e63946; }
.summary-card--info    { border-left-color: #457b9d; }
.summary-card--success { border-left-color: #2a9d8f; }
.summary-card__icon { font-size: 2rem; margin-bottom: .5rem; }
.summary-card h3 { font-size: .95rem; font-weight: 700; margin-bottom: .5rem; color: var(--color-secondary); }
.summary-card p { font-size: .875rem; color: #495057; margin: 0; }

/* Layout */
.regl-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2.5rem;
  padding-top: 2.5rem;
  padding-bottom: 3rem;
  align-items: start;
}
.regl-main { min-width: 0; }
.regl-main section { margin-bottom: 3.5rem; }
.regl-main h2 {
  font-family: 'Merriweather', serif;
  font-size: 1.6rem;
  color: var(--color-secondary);
  margin-bottom: 1.25rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid #e9ecef;
}
.regl-main h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-secondary);
  margin: 1.5rem 0 .75rem;
}
.regl-main p { color: #495057; line-height: 1.8; margin-bottom: 1rem; }

/* Table of contents */
.table-of-contents {
  background: #f0f4f8;
  border-left: 4px solid var(--color-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
}
.toc-title { font-weight: 700; color: var(--color-secondary); margin-bottom: .75rem; font-size: 1rem; }
.toc-list { list-style: decimal; padding-left: 1.25rem; display: flex; flex-direction: column; gap: .4rem; }
.toc-list a { color: var(--color-primary); font-size: .9rem; text-decoration: none; }
.toc-list a:hover { text-decoration: underline; }

/* Alerts */
.regl-alert {
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: .9rem;
  line-height: 1.6;
}
.regl-alert--info { background: #e3f2fd; border-left: 4px solid #1976d2; color: #0d47a1; }
.regl-alert--tip  { background: #e8f5e9; border-left: 4px solid #2e7d32; color: #1b5e20; }
.regl-alert--warn { background: #fff8e1; border-left: 4px solid #f57f17; color: #e65100; }

/* Tables */
.regl-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.25rem 0;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.regl-table-scroll-hint {
  display: none;
  text-align: center;
  font-size: .75rem;
  color: #888;
  margin-bottom: .4rem;
  letter-spacing: .03em;
}
.regl-table { width: 100%; border-collapse: collapse; font-size: .82rem; background: #fff; }
.regl-table thead tr { background: var(--color-secondary); color: #fff; }
.regl-table th { padding: .6rem .75rem; text-align: left; font-weight: 600; white-space: nowrap; }
.regl-table td { padding: .5rem .75rem; border-bottom: 1px solid #e9ecef; vertical-align: middle; }
.regl-table .row-highlight td { background: #f8f9fa; }
.regl-table--europe th:not(:first-child), .regl-table--europe td:not(:first-child) { text-align: center; }
.table-note { font-size: .8rem; color: #6c757d; margin-top: .5rem; font-style: italic; }

/* Badges */
.badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.4;
}
.badge--danger  { background: #fde8e8; color: #c0392b; }
.badge--warning { background: #fff3e0; color: #b45309; }
.badge--info    { background: #e3f2fd; color: #1565c0; }
.badge--success { background: #e8f5e9; color: #2e7d32; }

/* Equipment grid */
.eq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}
.eq-card {
  border: 2px solid #e9ecef;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
  transition: border-color .2s, transform .2s;
}
.eq-card:hover { transform: translateY(-3px); }
.eq-card--required { border-color: #e63946; background: #fff5f5; }
.eq-card--optional { border-color: #dee2e6; background: #f8f9fa; }
.eq-card__icon { font-size: 2rem; display: block; margin-bottom: .5rem; }
.eq-card h3 { font-size: .9rem; font-weight: 700; color: var(--color-secondary); margin-bottom: .5rem; }
.eq-card p { font-size: .8rem; color: #495057; margin: 0 0 .75rem; }

/* DIN 13164 grid */
.din-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: .75rem;
  margin: 1.25rem 0;
}
.din-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: var(--radius-md);
  padding: .75rem 1rem;
}
.din-qty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  font-size: .85rem;
  font-weight: 700;
  flex-shrink: 0;
}
.din-name { font-size: .875rem; color: #495057; }

/* Timeline */
.timeline { position: relative; padding-left: 2rem; margin: 1.5rem 0; }
.timeline::before { content: ''; position: absolute; left: .5rem; top: 0; bottom: 0; width: 2px; background: #dee2e6; }
.timeline-item { position: relative; margin-bottom: 2rem; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.625rem;
  top: .35rem;
  width: .875rem;
  height: .875rem;
  border-radius: 50%;
  background: var(--color-secondary);
  border: 2.5px solid #fff;
  box-shadow: 0 0 0 2px var(--color-secondary);
}
.timeline-item--current::before { background: var(--color-primary); box-shadow: 0 0 0 2px var(--color-primary); }
.timeline-date { font-size: .8rem; font-weight: 700; color: var(--color-primary); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .3rem; }
.timeline-content h3 { font-size: 1rem; font-weight: 700; color: var(--color-secondary); margin-bottom: .35rem; }
.timeline-content p { font-size: .875rem; margin: 0; color: #495057; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 1rem; }
.faq-item {
  border: 1px solid #e9ecef;
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow .2s;
}
.faq-item[open] { box-shadow: 0 4px 16px rgba(0,0,0,.08); border-color: var(--color-primary); }
.faq-question {
  cursor: pointer;
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: var(--color-secondary);
  font-size: .95rem;
  background: #f8f9fa;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}
.faq-question::after { content: '+'; font-size: 1.25rem; color: var(--color-primary); transition: transform .2s; }
.faq-item[open] .faq-question::after { transform: rotate(45deg); }
.faq-question:hover { background: #eef1f4; }
.faq-answer { padding: 1rem 1.25rem; font-size: .9rem; color: #495057; line-height: 1.7; }
.faq-answer p { margin: 0 0 .75rem; }
.faq-answer p:last-child { margin: 0; }

/* Affiliate banner */
.affiliate-banner {
  background: linear-gradient(135deg, var(--color-secondary) 0%, #457b9d 100%);
  color: #fff;
  padding: 3rem 0;
  margin-top: 2rem;
}
.affiliate-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.affiliate-banner-text h2 { font-family: 'Merriweather', serif; font-size: 1.4rem; margin-bottom: .5rem; }
.affiliate-banner-text p { opacity: .88; margin: 0; }
.btn-white { background: #fff; color: var(--color-secondary); font-weight: 700; padding: .85rem 1.75rem; border-radius: var(--radius-full); text-decoration: none; transition: transform .2s, box-shadow .2s; }
.btn-white:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.25); }

/* Breadcrumb */
.breadcrumb-nav { padding: 1rem 0 .5rem; }
.breadcrumb { display: flex; align-items: center; gap: .5rem; list-style: none; font-size: .875rem; padding: 0; margin: 0; }
.breadcrumb li:not(:last-child)::after { content: '/'; color: #adb5bd; margin-left: .5rem; }
.breadcrumb a { color: var(--color-primary); text-decoration: none; }
.breadcrumb [aria-current="page"] { color: #6c757d; }

/* Active page button */
.btn-reglementation.active-page { background: rgba(255,255,255,.25); border-color: rgba(255,255,255,.6); font-weight: 700; }

/* Reading progress */
.reading-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--color-primary);
  width: 0%;
  transition: width .1s;
}

/* Tableau responsive */
@media (max-width: 900px) {
  .regl-table-scroll-hint { display: block; }
  .regl-table { font-size: .78rem; }
  .regl-table th, .regl-table td { padding: .45rem .6rem; }
  .badge { font-size: .68rem; padding: .15rem .4rem; }
}

/* ===== MODE SOMBRE ===== */
[data-theme="dark"] .regl-summary {
  background: var(--color-surface);
  border-bottom-color: var(--color-border);
}
[data-theme="dark"] .summary-card {
  background: #1a1d27;
  box-shadow: none;
  border-color: var(--color-border);
}
[data-theme="dark"] .summary-card h3 { color: #e2e8f0; }
[data-theme="dark"] .summary-card p  { color: var(--color-text-muted); }

[data-theme="dark"] .regl-main h2 {
  color: #e2e8f0;
  border-bottom-color: var(--color-border);
}
[data-theme="dark"] .regl-main h3  { color: #e2e8f0; }
[data-theme="dark"] .regl-main p   { color: var(--color-text-muted); }

[data-theme="dark"] .table-of-contents {
  background: #0f1724;
  border-left-color: var(--color-primary);
}
[data-theme="dark"] .toc-title { color: #e2e8f0; }

[data-theme="dark"] .regl-alert--info { background: #0d1e30; border-left-color: #457b9d; color: #94a3b8; }
[data-theme="dark"] .regl-alert--tip  { background: #0d2510; border-left-color: #2e7d32; color: #6fcf97; }
[data-theme="dark"] .regl-alert--warn { background: #2a1d0a; border-left-color: #f57f17; color: #fbbf24; }

[data-theme="dark"] .regl-table { background: #1a1d27; }
[data-theme="dark"] .regl-table-wrapper { box-shadow: none; }
[data-theme="dark"] .regl-table thead tr { background: #252836; }
[data-theme="dark"] .regl-table td { border-bottom-color: var(--color-border); color: var(--color-text-muted); }
[data-theme="dark"] .regl-table .row-highlight td { background: #14161f; }
[data-theme="dark"] .table-note { color: var(--color-text-muted); }

[data-theme="dark"] .badge--danger  { background: #3a1010; color: #f48080; }
[data-theme="dark"] .badge--warning { background: #2a1d0a; color: #fbbf24; }
[data-theme="dark"] .badge--info    { background: #0d1e30; color: #94a3b8; }
[data-theme="dark"] .badge--success { background: #0d2510; color: #6fcf97; }

[data-theme="dark"] .eq-card {
  border-color: var(--color-border);
  background: #1a1d27;
}
[data-theme="dark"] .eq-card--required { background: #1e1010; border-color: var(--color-primary); }
[data-theme="dark"] .eq-card--optional { background: #1a1d27; border-color: var(--color-border); }
[data-theme="dark"] .eq-card h3 { color: #e2e8f0; }
[data-theme="dark"] .eq-card p  { color: var(--color-text-muted); }

[data-theme="dark"] .din-item {
  background: #1a1d27;
  border-color: var(--color-border);
}
[data-theme="dark"] .din-name { color: var(--color-text-muted); }

[data-theme="dark"] .timeline::before { background: var(--color-border); }
[data-theme="dark"] .timeline-item::before { border-color: var(--color-bg); }
[data-theme="dark"] .timeline-content h3 { color: #e2e8f0; }
[data-theme="dark"] .timeline-content p  { color: var(--color-text-muted); }

[data-theme="dark"] .faq-item { border-color: var(--color-border); }
[data-theme="dark"] .faq-question {
  background: #1a1d27;
  color: #e2e8f0;
}
[data-theme="dark"] .faq-question:hover { background: #252836; }
[data-theme="dark"] .faq-answer { color: var(--color-text-muted); }

[data-theme="dark"] .breadcrumb [aria-current="page"] { color: var(--color-text-muted); }
[data-theme="dark"] .breadcrumb li:not(:last-child)::after { color: var(--color-text-muted); }

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 2.75rem;
  height: 2.75rem;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(230,57,70,.4);
  transition: transform .2s, box-shadow .2s;
  z-index: 90;
}
.back-to-top:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(230,57,70,.5); }

/* Responsive */
@media (max-width: 1024px) {
  .regl-layout { grid-template-columns: 1fr; }
  .sidebar { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
}
@media (max-width: 640px) {
  .regl-hero__ctas { flex-direction: column; }
  .eq-grid { grid-template-columns: 1fr 1fr; }
  .din-grid { grid-template-columns: 1fr; }
  .affiliate-banner-inner { flex-direction: column; text-align: center; }
  .summary-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .summary-cards { grid-template-columns: 1fr; }
  .eq-grid { grid-template-columns: 1fr; }
}
