/* SportCorico — Release Guides — feuille de style partagée
 * Palette issue de sportcorico-flutter-app/lib/constants.dart
 */

:root {
  /* Couleurs SportCorico */
  --primary: #00225f;          /* ThemeColors.primary */
  --primary-dark: #00183f;     /* primary 700 */
  --primary-mid: #11367c;      /* lowPrimary */
  --primary-light: #d8e4ff;    /* secondary */
  --primary-bg: #f5f7fc;       /* lightBackground */
  --accent: #BB0936;           /* gradientColorsPrimary[0] */
  --accent-dark: #95072b;
  --accent-light: #fde6ec;
  --success: #009062;          /* darkGreen */
  --warning: #e9b940;
  --warning-light: #fdf5dd;
  --info: #2ab6f5;
  --info-light: #e3f5ff;
  --bg: #f5f7fc;
  --card: #ffffff;
  --text: #00225f;
  --text-soft: #1a2a4a;
  --text-muted: #6b7a99;
  --border: #e3e7ec;
  --shadow: 0 2px 12px rgba(0, 34, 95, 0.07);
  --radius: 12px;
  --sidebar-w: 280px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
  overflow-wrap: break-word;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; }

/* Hero — bleu primary uni */
.hero {
  background: var(--primary);
  color: #fff;
  padding: 40px 32px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero .logo {
  height: 56px;
  width: auto;
  display: block;
  margin: 0 0 22px;
}
.hero .badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.hero h1 {
  margin: 0 0 12px;
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.hero p {
  margin: 0 auto;
  font-size: 17px;
  opacity: 0.92;
  max-width: 700px;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px;
  gap: 32px;
}

/* Sidebar */
aside {
  position: sticky;
  top: 24px;
  align-self: start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
aside h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin: 0 0 14px;
  font-weight: 700;
}
aside nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
aside nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
}
aside nav a:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}
aside nav a.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-left-color: var(--primary);
}
aside nav .icon {
  font-size: 18px;
  width: 22px;
  text-align: center;
}

/* Main */
main { min-width: 0; }
section.chapter {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  scroll-margin-top: 24px;
}
section.chapter > header {
  margin-bottom: 20px;
}
section.chapter h2 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
}
section.chapter h2 .ch-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 10px;
  font-size: 22px;
}
section.chapter > header > p {
  color: var(--text-muted);
  margin: 0;
  font-size: 15px;
}

.feature {
  border-top: 1px solid var(--border);
  padding-top: 28px;
  margin-top: 28px;
}
.feature:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 8px;
}
.feature h3 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.feature h3::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}
.feature p {
  margin: 8px 0 12px;
  color: var(--text);
}
.feature p.lead {
  color: var(--text-muted);
  margin-top: 0;
}
.feature p strong { color: var(--text); }
.feature ul {
  margin: 8px 0 14px;
  padding-left: 22px;
  color: var(--text);
}
.feature ul li { margin-bottom: 4px; }
.feature ul li strong { color: var(--text); }

/* Tags */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.tag.new { background: var(--accent-light); color: var(--accent-dark); }
.tag.admin { background: var(--primary-light); color: var(--primary); }
.tag.mobile { background: var(--info-light); color: #0a7fb8; }

/* Path / Where to find */
.where {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  background: #f3f5f8;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  max-width: 100%;
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 12px;
}
.where strong { color: var(--text); font-weight: 600; }
.where .arrow { color: var(--text-muted); opacity: 0.6; }

/* Steps */
ol.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 14px 0;
}
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 40px;
  margin-bottom: 12px;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

/* Callouts */
.callout {
  border-left: 3px solid var(--info);
  background: var(--info-light);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  margin: 14px 0;
  font-size: 14px;
}
.callout.warning {
  border-left-color: var(--warning);
  background: var(--warning-light);
}
.callout.tip {
  border-left-color: var(--primary);
  background: var(--primary-light);
}
.callout strong { display: inline; }
.callout .label {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 4px;
  color: #0a7fb8;
}
.callout.warning .label { color: #8a6500; }
.callout.tip .label { color: var(--primary); }

/* Screenshots */
.screens {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.screens.single {
  grid-template-columns: 1fr;
  max-width: 720px;
  justify-items: start;
}
.screens.mobile {
  grid-template-columns: repeat(auto-fit, minmax(200px, 240px));
  justify-content: start;
}
.screens figure {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fafbfc;
  cursor: zoom-in;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.screens figure:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 34, 95, 0.12);
}
.screens img {
  width: 100%;
  height: auto;
  display: block;
}
/* Captures issues de l'app mobile : largeur cadrée, hauteur contenue */
.screens figure.mobile-screen { max-width: 240px; margin: 0; }
.screens figure.mobile-screen img {
  max-height: 420px;
  width: 100%;
  object-fit: contain;
  object-position: top;
  background: #fafbfc;
}
.screens.single figure.mobile-screen { max-width: 260px; margin: 0; }
.screens figcaption {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: #fff;
  line-height: 1.4;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 30, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  cursor: zoom-out;
}
.lightbox.open { display: flex; flex-direction: column; }
.lightbox img {
  max-width: 95vw;
  max-height: calc(100vh - 160px);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox .close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  z-index: 1010;
}

/* Navigation entre captures d'une même section */
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1010;
  transition: background 0.15s ease, transform 0.15s ease;
}
.lb-nav:hover { background: rgba(255, 255, 255, 0.28); }
.lb-nav:active { transform: translateY(-50%) scale(0.92); }
.lb-nav[hidden] { display: none; }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }

/* Bandeau bas : légende + compteur */
.lb-info {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: min(720px, 90vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 1010;
  pointer-events: none;
}
.lb-info[hidden] { display: none; }
.lb-info > * { pointer-events: auto; }
.lb-caption {
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.lb-caption[hidden] { display: none; }
.lb-counter {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.lb-counter[hidden] { display: none; }

@media (max-width: 560px) {
  .lb-nav { width: 44px; height: 44px; }
  .lb-prev { left: 10px; }
  .lb-next { right: 10px; }
}

/* Inline UI labels */
.ui {
  background: #f3f5f8;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 7px;
  font-size: 0.92em;
  font-weight: 500;
  color: var(--text);
  white-space: normal;
  word-break: keep-all;
}

/* Footer */
footer {
  text-align: center;
  padding: 32px 16px 48px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ============================================
 * FAB sommaire mobile + bottom-sheet
 * Style inspiré FloatingActionButton Flutter
 * ============================================ */
.toc-fab {
  display: none;
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 34, 95, 0.35), 0 2px 6px rgba(0, 34, 95, 0.2);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 900;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.toc-fab:hover { background: var(--primary-mid); }
.toc-fab:active { transform: scale(0.94); box-shadow: 0 3px 8px rgba(0, 34, 95, 0.3); }

.toc-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 24, 63, 0.5);
  z-index: 950;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.toc-backdrop.open { display: block; opacity: 1; }

.toc-sheet {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--card);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 30px rgba(0, 24, 63, 0.25);
  z-index: 960;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.3, 0.7, 0.3, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
.toc-sheet.open { display: block; transform: translateY(0); }

.toc-sheet-handle {
  width: 40px;
  height: 4px;
  background: #d4d8e0;
  border-radius: 2px;
  margin: 10px auto 4px;
}
.toc-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px 4px;
}
.toc-sheet-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}
.toc-sheet-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}
.toc-sheet-close:hover { background: var(--primary-bg); color: var(--text); }

.toc-sheet-nav ul {
  list-style: none;
  margin: 4px 0 12px;
  padding: 8px 12px 12px;
}
.toc-sheet-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  border-left: 3px solid transparent;
}
.toc-sheet-nav a:hover { background: var(--primary-bg); }
.toc-sheet-nav a.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  border-left-color: var(--primary);
}
.toc-sheet-nav .icon { font-size: 20px; width: 24px; text-align: center; }

/* Activation du FAB en mode tablette/mobile */
@media (max-width: 900px) {
  .toc-fab { display: flex; }
}

/* Responsive */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 20px;
  }
  aside { position: static; max-height: none; }
  .hero { padding: 36px 20px 40px; }
  .hero h1 { font-size: 28px; }
  section.chapter { padding: 22px; }
  section.chapter h2 { font-size: 22px; }
}

/* Mobile : éviter tout débordement horizontal */
@media (max-width: 560px) {
  .layout { padding: 12px; gap: 16px; }
  .hero { padding: 28px 16px 32px; }
  .hero .logo { height: 44px; margin-bottom: 16px; }
  .hero h1 { font-size: 24px; }
  .hero p { font-size: 15px; }

  section.chapter { padding: 18px 16px; }
  section.chapter h2 { font-size: 20px; gap: 10px; }
  section.chapter h2 .ch-icon { width: 38px; height: 38px; font-size: 19px; }

  .feature h3 { font-size: 17px; }

  .screens { grid-template-columns: 1fr; gap: 12px; }
  .screens.mobile { grid-template-columns: 1fr; }
  .screens figure.mobile-screen,
  .screens.single figure.mobile-screen { max-width: 100%; margin: 0 auto; }
  .screens figure.mobile-screen img { max-height: 70vh; }

  ol.steps > li { padding-left: 36px; }
  ol.steps > li::before { width: 24px; height: 24px; font-size: 12px; }

  .where { font-size: 12px; padding: 6px 10px; }
}
