
:root {
    --spacing-base: 2rem;
    --dialog-height: 600px;
    --dialog-width: 400px;
    --header-height: 100px;
    --hero-margin: calc(50vh - var(--header-height) / 2);
    --gap: 24px;
}

* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}
html {
	background-color: white;
	overflow-x: hidden;
}

:focus-visible, a:hover, summary:hover {
	outline: none;
	background-color: #6495ed;
	box-shadow: 0px 0px 0px 3px cornflowerblue;
	color: black !important;
}


section[id]:focus {
  border: solid cornflowerblue 6px;
}

a {
	transition: background-color 0.3s ease-out;
}

/* Configuration de la structure globale */
html, body {
	margin: 0;
	padding: 0;
	min-height: 100vh;
	/* IMPORTANT : Pas de display: flex ici, sinon le sticky casse ! */
	scroll-behavior: smooth;
}


header {
	text-align: center;
	width: 100%;
	top: 0;
	max-width: 100vw;
}


/* Header Sticky avec compatibilité maximale */
header.sticky {
	
	/* 1. Positionnement */
	position: sticky;
	z-index: 1000;

	/* 2. Hacks Safari (Accélération matérielle) */
	-webkit-transform: translate3d(0, 0, 0);
	transform: translate3d(0, 0, 0);
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
	will-change: transform, top;

}


/* --- Structure générale des colonnes (Mobile-first : empilées) --- */
#page-columns.columns {
		display: grid;
		grid-template-columns: 100%;
		gap: 2rem;
}

.column {
    width: 100%;
    min-width: 0; /* Empêche les débordements de grille */
    height: 100%;
}

/* --- Media Query : À partir d'un grand écran (PC/TV) --- */
@media (min-width: 1024px) {
    #page-columns.columns {
        grid-template-columns: 1fr 35%;
        gap: 3rem;
        align-items: start; /* Évite que les colonnes ne s'étirent en hauteur de manière forcée */
    }
    
    .column .sticky {
        position: sticky;
        top: calc(var(--header-height, 68px) + 60px); /* Distance par rapport au haut de la fenêtre lors du défilement */
        z-index: 10;
        box-shadow: 0px 0px 10px 1px #00000040;
    }
}


@media screen and (min-width: 870px) {
    nav.main-nav > ul {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}

nav.main-nav > ul {
    list-style: none;
    text-align: center;
    padding-left: 0;
	margin: 0;
}

body {
    max-width: 1200px;
    margin: 0 auto;
}


dialog > * {
    position: relative;
}

dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    width: var(--dialog-width);
    margin-left: calc(-0.5 * var(--dialog-width));
    height: var(--dialog-height);
    margin-top: calc(-0.5 * var(--dialog-height));
    max-width: 100vw;
    max-height: 100vh;
}

@media screen and (max-width: 400px) {
	dialog {
	    position: fixed;
	    top: 0;
	    left: 0;
	    width: 100vw;
	    margin-left: 0;
	    height: 100vh;
	    margin-top: 0;
	    max-width: 100vw;
	    max-height: 100vh;
	}
}

dialog iframe {
    margin-left: auto;
    margin-right: auto;
    display: block;
}

dialog .button-close-container {
	position: absolute;
    top: 0;
    right: 0;
    background: transparent;
    color: black;
    
}


/* Style de base du bouton pour créer un conteneur carré et invisible */
dialog button[command="close"] {
	min-width: unset;
	float: right;
    position: relative;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Optionnel : évite les flashs de sélection bleus sur mobile */
    -webkit-tap-highlight-color: transparent; 
}

/* Base commune pour les deux barres de la croix */
dialog button[command="close"]::before,
dialog button[command="close"]::after {
    top: unset;
    left: unset;
    content: '';
    position: absolute;
    width: 20px;          /* Longueur des branches de la croix */
    height: 2px;          /* Épaisseur des branches */
    background-color: #333333; /* Couleur de la croix */
    border-radius: 1px;   /* Adoucit les extrémités des branches */
    transition: background-color 0.2s ease, transform 0.2s ease;
}

/* Rotation de la première barre à 45 degrés */
dialog button[command="close"]::before {
    transform: rotate(45deg);
}

/* Rotation de la seconde barre à -45 degrés (ou 135deg) */
dialog button[command="close"]::after {
    transform: rotate(-45deg);
}

/* --- Effets au Survol / Focus (Accessibilité & UX) --- */

/* Changement de couleur au survol et focus */
dialog button[command="close"]:hover::before,
dialog button[command="close"]:hover::after,
dialog button[command="close"]:focus-visible::before,
dialog button[command="close"]:focus-visible::after {
    background-color: #ff4a4a; /* Devient rouge au survol */
}

/* Un outline propre uniquement pour les utilisateurs au clavier */
dialog button[command="close"]:focus-visible {
    outline: 2px solid #ff4a4a;
    outline-offset: 4px;
    border-radius: 4px;
}

dialog#credits-dialog {
    font-family: monospace;
    font-size: 14px;
    line-height: 24px;
    padding: 12px;
    box-shadow: 0px 0px 20px 5px #00000080;
    background-color: bisque;
}

.dialog-header [command="hide-popover"] {
    float: right;
}

dialog#credits-dialog ul {
    list-style: none;
    padding-left: 0;
}

.dialog-header {
    text-align: center;
	text-transform: uppercase;
	font-size: 20px;
}

.no-js button.codesh-copy {
    display: none;
}
.codesh-block button.codesh-copy, .codesh-group button.codesh-copy, .codesh-block button.codesh-copy:hover, .codesh-group button.codesh-copy:hover {
    color: white;
}

details {
  border-radius: 8px;
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

details[open] {
  background-color: #495f21;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  color: white;
}

summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none; /* Supprime la flèche par défaut sur les navigateurs récents */
  display: flex;
  justify-content: space-between;
  align-content: center;
  user-select: none;
  text-decoration: underline;
}

summary::-webkit-details-marker {
  display: none; /* Compatibilité anciens Safari / Blink */
}

/* Indicateur interactif (+) sous forme de chevron minimaliste */
summary::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 1rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.25s ease-in-out;
  margin-top: 7px;
  margin-right: 8px;
}

/* En rotation au clic (oriente la flèche vers le haut) */
details[open] summary::after {
  transform: rotate(-135deg);
}

/* Espacement du contenu sous la question quand le volet est ouvert */
details[open] summary + * {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid currentColor;
}
dd {
    margin: 0;
}

main dl > div {
    display: flex;
    justify-content: space-between;
}

main dl > div > dd {
    text-align: right;
    max-width: 50%;
}

footer {
    max-width: 100vw;
}


.contact-footer {
  padding-bottom: var(--gap);
  padding-top: var(--gap);
}

footer dl > div {
}

footer dl > div > dd {
	margin-bottom: var(--gap);
}

footer > .columns > :last-child {
    text-align: center;
}

@media (min-width: 550px) {
	footer > .columns, footer > .columns dl {
		display: grid;
		flex-direction: row;
		justify-content: stretch;
		align-content: stretch;
		grid-auto-flow: column;
		align-items: baseline;
		gap: var(--gap, 24px);
	}
	footer > .columns > :last-child {
		text-align: right;
	}
}


footer > .columns {
  padding-right: var(--gap);
  padding-left: var(--gap);
  max-width: 1200px;
}


/* UTILITIES */

.warning {
	background-color: #fff3cd;
	color: #856404;
	border: 1px solid #ffeeba;
	padding: 1rem;
	margin-bottom: 1.5rem;
	border-radius: 0.25rem;
	font-family: sans-serif;
}

.center {
    text-align: center;
}

.in-center {
  margin-left: auto;
  margin-right: auto;
  width: fit-content;
}


@media (max-width: 1199px) {
    
	footer .columns > div dl {display: block;}
    
}
