/* =====================================================================
   EROFISC – Eric Rodberg, comptable & fiscaliste
   Feuille de style moderne & responsive
   Palette : dérivée du lavande d'origine (#CCCCFF), modernisée
   ===================================================================== */

:root {
  --lavande-fonce: #7d80e8;
  --lavande: #a9abf0;
  --lavande-clair: #e2e3fb;
  --lavande-pale: #f2f2fd;
  --blanc: #ffffff;
  --encre: #23263f;
  --encre-douce: #5b5f7d;
  --navy: #2a3170;
  --accent: #5b6cff;
  --accent-hover: #4453d6;
  --accent-soft: #e9ecff;
  --ombre: 0 12px 34px rgba(60, 66, 150, 0.16);
  --ombre-legere: 0 3px 10px rgba(60, 66, 150, 0.08);
  --rayon: 16px;
  --rayon-petit: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background:
    radial-gradient(1000px 500px at 85% -10%, #d6d7fb 0%, transparent 60%),
    linear-gradient(165deg, #dedefc 0%, #c6c7f5 55%, #b8baf0 100%) fixed;
  color: var(--encre);
  font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  padding: 28px 16px;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-hover);
}

a:visited {
  color: var(--accent);
}

/* ---------------------------------------------------------------------
   Carte principale
   --------------------------------------------------------------------- */
.page {
  max-width: 1120px;
  margin: 0 auto;
  /* Plus de fond blanc global : l'en-tête et le corps sont des blocs
     distincts, et le fond lavande de la page transparaît entre eux. */
  background: transparent;
}

/* ---------------------------------------------------------------------
   En-tête : logo | sigle | coordonnées
   Le bandeau d'en-tête reprend la couleur de fond du logo (#CCCCFF) et se
   fond dans le fond lavande de la page : plus de "cadre blanc" autour du
   logo. Il est séparé du corps par un espace où l'on voit le fond.
   --------------------------------------------------------------------- */
.site-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 22px;
  margin-bottom: 26px;
  background:
    radial-gradient(90% 130% at 50% -40%, rgba(91, 108, 255, 0.20) 0%, rgba(91, 108, 255, 0) 65%),
    linear-gradient(180deg, #d9d9ff 0%, #CCCCFF 60%, #c6c6fa 100%);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  position: relative;
  z-index: 1;
  flex-wrap: wrap;
}

/* Les images du logo sont sur fond blanc : le mode "multiply" fusionne ce
   blanc avec le fond lavande de l'en-tête, supprimant l'aura blanche. */
.site-header .brand img {
  mix-blend-mode: multiply;
  display: block;
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1 1 auto;
  min-width: 260px;
}

.site-header .brand img.logo {
  max-width: 280px;
  height: auto;
}

.site-header .brand img.sigle {
  max-width: 120px;
  height: auto;
}

.site-header .coords {
  margin-left: auto;
  text-align: right;
  font-family: 'Bookman Old Style', Georgia, 'Times New Roman', serif;
}

.coords-title {
  font-weight: bold;
  color: var(--navy);
  font-style: italic;
  line-height: 1.5;
}

.coords-email {
  font-style: italic;
  margin-top: 6px;
  color: var(--encre-douce);
}

/* ---------------------------------------------------------------------
   Zone principale : contenu + navigation
   Le corps est une carte blanche distincte de l'en-tête : le fond lavande
   de la page est visible dans l'espace qui les sépare.
   --------------------------------------------------------------------- */
.layout {
  display: grid;
  grid-template-columns: 1fr 290px;
  align-items: stretch;
  background: var(--blanc);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  overflow: hidden;
}

.content-cell {
  padding: 34px 40px;
  min-width: 0;
}

/* ---------------------------------------------------------------------
   Hauteur de corps constante (pages du menu principal)
   La page la plus haute du menu est « Outils et téléchargements »
   (707 px en affichage 2 colonnes). On fixe une hauteur minimale sur
   les pages pour que le corps reste identique quelle que soit l'option.
   --------------------------------------------------------------------- */
.layout--fixed .content-cell {
  display: flex;
  flex-direction: column;
}

/* En 2 colonnes : hauteur minimale = hauteur naturelle d'« Outils » */
@media (min-width: 1081px) {
  .layout--fixed .content-cell {
    min-height: 715px;
  }
}

/* ---------------------------------------------------------------------
   Navigation latérale
   --------------------------------------------------------------------- */
.sidebar {
  background: linear-gradient(180deg, var(--lavande-clair), var(--lavande-pale));
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e4e5fb;
}

.sidebar ul.nav {
  list-style: none;
}

.sidebar ul.nav li {
  margin-bottom: 10px;
}

.sidebar ul.nav li a {
  display: block;
  padding: 11px 15px;
  background: var(--blanc);
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--rayon-petit);
  border: 1px solid #dcddf8;
  box-shadow: var(--ombre-legere);
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

.sidebar ul.nav li a:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  transform: translateX(3px);
}

.sidebar .nav-photo {
  margin: 24px auto 0;
  text-align: center;
}

.sidebar .nav-photo img {
  border-radius: var(--rayon-petit);
  box-shadow: var(--ombre-legere);
  max-width: 100%;
  height: auto;
}

.sidebar .nav-updated {
  margin-top: auto;
  padding-top: 26px;
  text-align: center;
  font-size: 12px;
  color: var(--encre-douce);
  font-style: italic;
  border-top: 1px dashed #c9cbef;
}

/* ---------------------------------------------------------------------
   Contenu éditorial
   --------------------------------------------------------------------- */
.content-cell h2 {
  font-family: 'Bookman Old Style', Georgia, 'Times New Roman', serif;
  font-size: 22px;
  color: var(--navy);
  margin-bottom: 20px;
  font-weight: bold;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}

.content-cell p.body-text {
  font-family: 'Bookman Old Style', Georgia, 'Times New Roman', serif;
  color: var(--encre);
  font-size: 15px;
  text-align: justify;
  line-height: 1.7;
  margin-bottom: 14px;
}

.content-cell blockquote.body-text {
  margin: 8px 0 18px 18px;
  padding: 12px 20px;
  background: var(--accent-soft);
  border-radius: var(--rayon-petit);
  border-left: 3px solid var(--accent);
}

.content-cell blockquote.body-text p.body-text {
  margin-bottom: 6px;
}

/* Liste du contenu principal (pages "liens") */
.content-cell ul.link-list {
  list-style: square;
  margin: 8px 0 20px 26px;
}

.content-cell ul.link-list li {
  margin-bottom: 13px;
  line-height: 1.6;
}

.content-cell ul.link-list li::marker {
  color: var(--accent);
}

/* ---------------------------------------------------------------------
   Tableaux de liens
   --------------------------------------------------------------------- */
table.links-table,
table.telechargements-table {
  border-collapse: collapse;
  width: 100%;
  margin: 6px 0 14px;
  background: var(--blanc);
  border: 1px solid #e2e3fa;
  border-radius: var(--rayon-petit);
  overflow: hidden;
}

table.links-table tr:nth-child(even),
table.telechargements-table tr:nth-child(even) {
  background: var(--lavande-pale);
}

table.links-table td,
table.telechargements-table td {
  border-top: 1px solid #ececfc;
  border-left: 1px solid #ececfc;
  padding: 11px 15px;
  vertical-align: top;
  width: 50%;
}

table.links-table tr:first-child td,
table.telechargements-table tr:first-child td {
  border-top: none;
}

table.links-table td:first-child,
table.telechargements-table td:first-child {
  border-left: none;
}

table.telechargements-table td.w66 { width: 66%; }
table.telechargements-table td.w34 { width: 34%; }

/* ---------------------------------------------------------------------
   Titre en surplomb (pages "Outils et téléchargements")
   --------------------------------------------------------------------- */
.cell-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.cell-title .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.cell-title .label {
  font-family: 'Bookman Old Style', Georgia, 'Times New Roman', serif;
  font-size: 20px;
  font-style: italic;
  font-weight: bold;
  color: var(--navy);
  text-decoration: underline;
}

/* ---------------------------------------------------------------------
   Espacement
   --------------------------------------------------------------------- */
.content-cell .mt-2 { margin-top: 8px; }
.content-cell .mt-4 { margin-top: 16px; }
.content-cell .mt-6 { margin-top: 24px; }
.content-cell .spacer { height: 8px; }

/* ---------------------------------------------------------------------
   Navigation douce sans rechargement (SPA)
   --------------------------------------------------------------------- */
/* Indique visuellement le lien actif dans le menu */
.sidebar ul.nav li a.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 6px 14px -6px rgba(91, 108, 255, 0.7);
}

/* Fondu d'apparition du contenu lors d'un changement de page */
.content-cell.page-enter {
  animation: pageFade 0.35s ease both;
}

@keyframes pageFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Léger fondu de sortie avant remplacement */
.content-cell.page-leave {
  animation: pageOut 0.18s ease both;
}

@keyframes pageOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* =====================================================================
   Responsive (tablette puis mobile)
   ===================================================================== */
@media (max-width: 1080px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-left: none;
    border-top: 1px solid #e4e5fb;
  }

  .sidebar ul.nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 8px;
  }

  .sidebar ul.nav li {
    margin-bottom: 0;
  }

  .sidebar .nav-photo,
  .sidebar .nav-updated {
    display: none;
  }

  .content-cell {
    padding: 28px 26px;
  }

  /* En une colonne, le corps s'étend naturellement : aucune hauteur figée
     n'est nécessaire, mais on retire la hauteur min. desktop */
  .layout--fixed .content-cell {
    min-height: 0;
  }
}

@media (max-width: 680px) {
  body {
    padding: 8px 6px;
  }

  .page {
    border-radius: 10px;
  }

  .site-header {
    flex-direction: column;
    text-align: center;
    padding: 16px;
    gap: 14px;
  }

  .site-header .brand {
    flex-direction: column;
    min-width: 0;
    gap: 10px;
  }

  .site-header .brand img.logo {
    max-width: 100%;
  }

  .site-header .coords {
    margin-left: 0;
    text-align: center;
  }

  .content-cell {
    padding: 20px 16px;
  }

  .content-cell h2 {
    font-size: 19px;
  }

  .content-cell blockquote.body-text {
    margin-left: 6px;
  }

  table.links-table td,
  table.telechargements-table td {
    display: block;
    width: 100% !important;
    border-left: none;
    border-top: 1px solid #ececfc;
  }

  table.links-table tr:first-child td,
  table.telechargements-table tr:first-child td {
    border-top: none;
  }
}

/* =====================================================================
   Site monopage : affichage des sections (.view)
   Une seule section est visible à la fois (celle qui a la classe "active").
   ===================================================================== */
.views-container {
  display: block;
}

.views-container .view {
  display: none;
}

.views-container .view.active {
  display: block;
}

/* Bouton "Retour aux liens" pour les sous-pages de la section Liens */
.back-to-links {
  display: inline-block;
  margin-bottom: 18px;
  padding: 8px 16px;
  background: var(--accent-soft);
  color: var(--navy);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  border: 1px solid #d0d4fa;
  border-radius: var(--rayon-petit);
  transition: background 0.2s ease, color 0.2s ease;
}

.back-to-links:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* ---------------------------------------------------------------------
   Lien désactivé (adresse devenue indisponible)
   --------------------------------------------------------------------- */
.link-disabled {
  color: var(--encre-douce);
  text-decoration: line-through;
  text-decoration-color: #b6b9d8;
  cursor: not-allowed;
  font-weight: 600;
}

.badge-indispo {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 9px;
  background: #ffe9e9;
  color: #a63d3d;
  border: 1px solid #f2c2c2;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  text-decoration: none;
  vertical-align: middle;
}

/* Encadré d'information (ex. service momentanément indisponible) */
.notice {
  margin: 10px 0 16px;
  padding: 12px 18px;
  background: var(--lavande-pale);
  border-left: 3px solid var(--lavande-fonce);
  border-radius: var(--rayon-petit);
  font-family: 'Bookman Old Style', Georgia, 'Times New Roman', serif;
  font-size: 14px;
  color: var(--encre-douce);
  text-align: left;
  line-height: 1.65;
}
