/* ============================================
   FICHIER : layout.css
   VERSION : 2026.10.10a
   OBJET   : Structure générale, gestion du thème
             clair/sombre, planning, overlay auth
             et pied de page (#pageFooter ✅ 2026.10.10a).
   ============================================ */

/* --- Structure générale --- */
body {
  margin: 0;
  padding-top: 45px; /* espace réservé pour le header fixe */
}

.content {
  /* ✅ 2026.09.30 : valeur historique conservée telle quelle. Sur ReZoo.html
     (bandeau à 2 lignes repliables) ui.js recalcule le décalage réel et
     l'applique en style inline — voir `appliquerMargeContenu()` dans ui.js.
     proposals.html / admin.html, qui n'ont pas ce bandeau, ne sont pas
     concernés : ils gardent exactement cette valeur. */
  margin-top: 70px;
  padding: 10px;
  width: 100%;
  box-sizing: border-box;
}

.hidden {
  display: none;
}

/* --- Liens en mode clair --- */
body:not([data-theme="dark"]) a {
  color: #0066cc;
  text-decoration: none;
}
body:not([data-theme="dark"]) a:hover {
  text-decoration: underline;
  color: #003399;
}
body:not([data-theme="dark"]) a:visited {
  color: #8844aa;
}

/* --- Harmonisation tableau info (mode clair) ---
   ✅ 2026.08.24-5 : OBSOLÈTE — remplacé par la refonte "fiches info"
   (table.css). Les couleurs/paddings sont désormais gérés par les
   variables --text-main / --card-*. */

/* --- Liens en mode sombre --- */
body[data-theme="dark"] a {
  color: #66ccff;
  text-decoration: none;
}
body[data-theme="dark"] a:hover {
  text-decoration: underline;
  color: #99ddff;
}
body[data-theme="dark"] a:visited {
  color: #cc88ff;
}

/* --- Planning en mode sombre --- */
body[data-theme="dark"] #planning {
  background-color: rgba(17, 17, 17, 0.6);
  color: #eee;
  border-radius: 6px;
  box-shadow: 0 0 8px rgba(0,0,0,0.5);
}

/* --- Planning structure --- */
#planning {
  width: 100%;
  box-sizing: border-box;
}
#planning table {
  width: 100%;
  border-collapse: collapse;
}

/* --- Auth Overlay --- */
.overlay {
  position: fixed;
  top:0; left:0;
  width:100%;
  height: 100dvh;   /* viewport dynamique si supporté */
  height: 100%;     /* fallback */
  background: rgba(0,0,0,0.6);
  display:flex;
  justify-content:center;
  align-items:center;   /* centré par défaut (desktop) */
  z-index: 2000;
}
.overlay.hidden { display:none; }

.overlay-content {
  background:#fff;
  border-radius:8px;
  padding:10px;
  width:400px;
  height:250px;
  position:relative;
  box-shadow:0 0 15px rgba(0,0,0,0.5);
}
.overlay-content iframe {
  width:100%;
  height:100%;
  border:none;
}
.close-btn {
  position:absolute;
  top:5px;
  right:5px;
  background:#cc0000;
  color:#fff;
  border:none;
  border-radius:50%;
  width:28px;
  height:28px;
  cursor:pointer;
  font-weight:bold;
}

/* --- Correctif mobile : éviter le saut clavier --- */
@media (max-width: 768px) {
  .overlay {
    align-items: stretch;
    justify-content: stretch;
  }
  .overlay-content {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
}

/* Quand overlay ouvert, on bloque le scroll du body */
body.overlay-open {
  overflow: hidden;
}

/* --- Pied de page (#pageFooter) ---
   ✅ 2026.10.10a : le pied de page n'avait AUCUNE règle CSS : son texte noir
   (thème clair) posé nu sur le fond d'écran assombri par --bg-overlay était
   quasi illisible, et les liens (text-decoration: none) indistingables du
   texte. On lui donne un fond de carte translucide (comme les fiches info),
   une respiration et des liens VISIBLES, dans les deux thèmes. */
#pageFooter {
  margin-top: 20px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  color: var(--text-main);
  font-size: 0.98em;
  line-height: 1.65;
}
#pageFooter p { margin: 0 0 12px; }
#pageFooter p:last-child { margin-bottom: 0; }
#pageFooter a {
  color: #0052a3;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
#pageFooter a:hover { color: #003366; }

/* Variante sombre : carte translucide + liens accentués */
body[data-theme="dark"] #pageFooter {
  background: rgba(38, 38, 38, 0.88);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  color: var(--dark-text-light);
}
body[data-theme="dark"] #pageFooter a { color: var(--dark-accent); }
body[data-theme="dark"] #pageFooter a:hover { color: #ffe0b0; }
