/* ==========================================================================
   Styles pour les pages légales de Onefiche.fr
   ========================================================================== */

/* --- Variables CSS --- */
:root {
  --bg-color: #f2f2f2;
  --card-bg-color: #ffffff;
  --title-color: #22284a;
  --link-color: #d95000;
  --link-hover-color: #22284a;
  --text-color: #000000;
  --text-secondary-color: #444444;
  --border-color: #dddddd;
  --focus-outline-color: var(--link-color);
  --font-body: "Geologica", sans-serif;
  --font-heading: "Lexend", sans-serif;

  /* Variables pour le bouton Imprimer */
  --button-bg: #cc3f02;
  --button-hover-bg: #822b0c;
  --button-active-bg: #461504;
  --button-text: #ffffff;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.main-header {
  background-color: #ffffff;
  padding: 10px 0;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

.header-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-logo a {
  display: flex;
  align-items: center;
}

.header-logo img {
  width: 200px;
  height: auto;
  display: block;
}

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

.main-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 55px;
}

.main-nav a {
  text-decoration: none;
  color: #22284a;
  font-weight: 450;
  font-size: 16px;
  transition: color 0.3s ease;
  margin-right: 55px;
}

.main-nav a:last-child {
  margin-right: 0;
}

.main-nav a:hover {
  color: var(--link-color);
}

.mobile-toggle {
  display: none;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 10px;
}

.mobile-toggle .bar {
  display: block;
  width: 25px;
  height: 3px;
  background-color: #2c3e50;
  margin: 5px 0;
  transition: 0.4s;
}

/* ==========================================================================
   CORPS DE PAGE
   ========================================================================== */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 100;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  margin: 0;
  padding: 0;
}

.main-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 15px 40px 15px;
}

h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--title-color);
}
h1 {
  font-size: 2.2em;
  text-align: center;
  margin-top: 0.5em;
  margin-bottom: 0.2em;
}
h2 {
  font-size: 1.4em;
  margin-top: 2em;
  margin-bottom: 0.8em;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.3em;
}
h2[id] {
  scroll-margin-top: 90px;
}
h3 {
  font-size: 1.2em;
  margin-top: 1.2em;
  margin-bottom: 0.8em;
}

p,
li {
  margin-bottom: 1em;
}
a {
  color: var(--link-color);
  text-decoration: underline;
  transition: color 0.2s ease;
}
a:hover {
  text-decoration: none;
  color: var(--link-hover-color);
}

.update-date {
  text-align: center;
  font-size: 0.9em;
  color: var(--text-secondary-color);
  font-style: italic;
  margin-top: 0;
  margin-bottom: 2.5em;
}

/* --- Texte d'introduction de la page légale (index.html) --- */
.legal-intro-text {
  max-width: 650px;
  margin: 0 auto 2.5em auto;
  text-align: left;
}

.legal-intro-text p:not(:last-child) {
  margin-bottom: 1em; /* Ajoute un espacement standard entre les paragraphes */
}

/* ==========================================================================
   COMPONENTS
   ========================================================================== */

/* --- Bouton Imprimer --- */
.bottom-right-controls {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
}
.print-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 8px 15px;
  background-color: var(--button-bg);
  color: var(--button-text);
  border: none;
  border-radius: 20px;
  font-family: var(--font-heading);
  font-size: 0.9em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.print-icon {
  width: 1.1em;
  height: 1.1em;
  fill: currentColor;
  flex-shrink: 0;
}
.print-link:hover {
  background-color: var(--button-hover-bg);
  color: var(--button-text);
  text-decoration: none;
}
.print-link:active {
  background-color: var(--button-active-bg);
}

/* --- Fil d'Ariane --- */
.page-header {
  margin-bottom: 0;
  padding-top: 40px;
}
.breadcrumb {
  font-size: 0.9em;
  text-align: center;
  font-family: var(--font-body);
  font-weight: 400;
}
.breadcrumb ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: inline-flex;
  gap: 0.4em;
}
.breadcrumb li {
  display: inline-flex;
  align-items: center;
  color: var(--text-secondary-color);
  margin-bottom: 0;
}
.breadcrumb li:not(:first-child)::before {
  content: ">";
  margin-right: 0.4em;
}
.breadcrumb a {
  text-decoration: none;
}
.breadcrumb a:hover {
  text-decoration: underline;
}

/* --- Sommaire (Table of Contents) --- */
.toc {
  background-color: var(--card-bg-color);
  padding: 1.5em 2em;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  max-width: 900px;
  margin: 2em auto 2.5em;
  box-sizing: border-box;
}
.toc h3 {
  font-size: 1.2em;
  text-align: center;
  margin: 0 0 1.5em 0;
}
.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  column-count: 2;
  column-gap: 40px;
}
.toc li {
  margin-bottom: 1em;
  display: flex;
  align-items: center;
  break-inside: avoid;
}
.toc li:last-child {
  margin-bottom: 0;
}
.toc a {
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 700;
}
.toc li::before {
  content: "";
  display: none;
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23D95000'%3E%3Cpath d='M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  margin-right: 12px;
  flex-shrink: 0;
}
/* On réaffiche l'icône SEULEMENT pour le sommaire de l'index */
.toc.toc-index li::before {
  display: inline-block;
}

/* --- NOUVEAU: Style spécifique pour le sommaire de la page d'accueil --- */
.toc.toc-index {
  width: 440px;
}
.toc.toc-index ul {
  column-count: 1;
}
.toc.toc-index h3 {
  display: none;
}

/* --- Styles pour les Tableaux (CONSERVÉS) --- */
table {
  width: 100%;
  border: 1px solid var(--title-color);
  border-collapse: collapse;
  margin-top: 1.5em;
  margin-bottom: 1.5em;
  font-size: 0.9em;
  background-color: var(--card-bg-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
  display: block;
}

th,
td {
  border: 1px solid var(--title-color);
  padding: 0.6em 0.8em;
  text-align: left;
  vertical-align: top;
}

th {
  background-color: var(--title-color);
  color: var(--bg-color);
  font-weight: 700;
  font-family: var(--font-heading);
}

tbody td:first-child {
  font-weight: 700;
  font-family: var(--font-heading);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 930px) {
  .header-container,
  .main-content {
    padding-left: 15px;
    padding-right: 15px;
  }
}

@media (max-width: 768px) {
  /* --- Styles existants pour le menu burger --- */
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
  }
  .main-nav.is-open {
    max-height: 500px;
  }
  .main-nav a {
    display: block;
    padding: 15px 20px;
    width: 100%;
    text-align: center;
  }
  .mobile-toggle {
    display: block;
  }

  .toc ul {
    column-count: 1;
  }
  .toc.toc-index {
    width: 90%;
  }
  .legal-intro-text {
    width: 90%;
  }
}

/* ==========================================================================
   ACCESSIBILITÉ
   ========================================================================== */
a:focus,
button:focus,
.print-link:focus {
  outline: 2px dashed var(--focus-outline-color);
  outline-offset: 3px;
  text-decoration: none;
}

/* ==========================================================================
   IMPRESSION
   ========================================================================== */
@media print {
  /* On cache les éléments de navigation inutiles à l'impression */
  .main-header,
  .bottom-right-controls,
  .toc,
  .breadcrumb,
  .site-footer {
    display: none;
  }

  /* On réinitialise les styles du corps pour une impression optimale */
  body {
    margin: 1cm;
    padding: 0;
    max-width: 100%;
    color: #000;
    background-color: #fff;
    font-size: 10pt;
  }
  h1,
  h2,
  h3 {
    color: #000;
    page-break-after: avoid;
  }
  a {
    color: #000;
    text-decoration: none;
  }
}

/* ==========================================================================
   FOOTER STYLES
   ========================================================================== */

/* Conteneur principal du footer */
.site-footer {
  background-color: #22284a;
  color: #e1e9f8;
  padding: 60px 0 20px 0;
  font-family: "Geologica", sans-serif;
  position: relative;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Section principale avec les colonnes */
.footer-main {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin-bottom: 40px;
  align-items: flex-start;
}

/* Style commun des colonnes */
.footer-column {
  flex: 1;
  min-width: 220px;
}

/* Colonne "About" avec logo et icônes */
.footer-column.about .footer-logo {
  max-width: 210px;
  margin-bottom: 20px;
}

.social-icons {
  display: flex;
  gap: 15px;
}

.social-icons a {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background-color: transparent;
  border: 1px solid #a9a9b3;
  border-radius: 50%;
  transition: background-color 0.3s, border-color 0.3s;
}

.social-icons a:hover {
  background-color: #d95000; /* Orange au survol */
  border-color: #d95000;
}

.social-icons svg {
  width: 18px;
  height: 18px;
  fill: #ffffff; /* Couleur des icônes SVG */
}

/* Colonnes de liens */
.footer-column.links h4 {
  color: #ffffff; /* Titres en blanc */
  font-family: "Lexend", sans-serif;
  font-size: 1.1em;
  margin-bottom: 20px;
  margin-top: 0;
}

.footer-column.links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column.links li {
  margin-bottom: 12px;
}

.footer-column.links a {
  color: #e1e9f8;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-column.links a:hover {
  color: #ffffff; /* Liens plus clairs au survol */
}

/* Section du bas (séparateur et copyright) */
.footer-bottom {
  text-align: center;
}

.footer-divider,
.footer-divider-top {
  border-top: 1px solid #4a4a5e;
}
.footer-divider {
  margin-bottom: 20px;
}
.footer-divider-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
}

.footer-bottom p {
  margin: 0;
  font-size: 0.9em;
}

/* Bouton d'appel flottant */
.floating-phone-btn {
  position: absolute;
  top: 50%;
  /transform: translateY(-50%);
  right: 30px;
  width: 60px;
  height: 60px;
  background-color: #d95000;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s;
  z-index: 1000;
}

.floating-phone-btn:hover {
  transform: scale(1.2);
}

.floating-phone-btn svg {
  width: 24px;
  height: 24px;
  fill: #ffffff;
}

/* Responsive pour les tablettes et mobiles */
@media (max-width: 768px) {
  .footer-main {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .social-icons {
    justify-content: center;
  }
}

/* Style pour cacher le bouton Imprimer quand le footer est visible */
.bottom-right-controls.hidden-by-footer {
  opacity: 0;
  visibility: hidden;
  transform: translateY(100%); /* Le fait glisser vers le bas */
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}
