/* ====== Modal Window Exif Data ====== */
.exif-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
}

.exif-content {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  animation: fadeIn 0.3s ease;
}

.exif-close {
  float: right;
  font-size: 24px;
  cursor: pointer;
}

.exif-content h3 {
  margin-top: 0;
  text-align: center;
  color: #333;
}

.exif-item {
  border-bottom: 1px solid #eee;
  padding: 6px 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}


/* ====== Base / Reset léger ====== */
* { box-sizing: border-box; }
html, body { height: 100%; }

body {
	font-family: Arial, sans-serif;
	margin: 0;
	background: #f7f7f7;
	color: #333;
	line-height: 1.5;
}

p {
    display: block;
    margin-block-start: 0.5em;
    margin-block-end: 0.5em;
    margin-inline-start: 0px;
    margin-inline-end: 0px;
}

 h1, h2, h3, h4, h5 {
	display: block;
    margin-block-start: 0.5em;
    margin-block-end: 0.5em;
    margin-inline-start: 0px;
    margin-inline-end: 0px;
    font-weight: bold;
    unicode-bidi: isolate;
 }

/* ====== Layout principal ====== */
main {
	margin: auto;
	padding: 2em;
	padding-top: 1em; /* ajuster selon la hauteur réelle du header */
	max-width: 1240px;   /* largeur max demandée */
	min-height: calc(100% - 3em);
	background-color: #004488;
	background-image: url('../IMAGES/nederland.jpg');
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
	color: aliceblue;
}

footer {
	height:3em;
	background: #eee;
	padding: 1em;
	text-align: center;
	margin-top: 0;
	color: #555;
}

/* ====== Header + Logo + Tabs ====== */
header {
	position: sticky; /* fixe le header en haut */
	display: flex;
	top: 0;
	left: 0;
	width: 100%;
	max-width: 1240px;
	margin:auto;
	z-index: 1000; /* au-dessus du reste */
	box-shadow: 0 2px 5px rgba(0,0,0,0.1);
	justify-content: space-between;
	align-items: flex-end;   /* colle le contenu en bas du header */
	color: #004488;
	background-color: white;
	padding: 0.5em 2em 0;      /* padding bas = 0 pour coller les onglets en bas */
	flex-wrap: wrap;         /* permet retour à la ligne si nécessaire */
}

/* Bloc gauche : logo + texte */
.header-left {
	display: flex;
	align-items: center;      /* aligne logo + texte verticalement */
	gap: 15px;
/*	width: 712px;*/
	margin-bottom: 5px;       /* petite marge si le menu passe à droite/ligne suivante */
}

div.logo {
  height: 70px;
  display: block;
}

img#logo {
	object-fit: contain;
    height: 100%;
    width: auto;
}

img#tree {
	position: relative;
    cursor: pointer;
    max-height: 22em;
    margin: 0 auto;
    left: 50%;
    margin-left: -11em;
}

.fadeout {
    opacity: 0;
    transition: opacity .4s ease;
}

/*place and center login in the logo:*/
#logoLoginContainer {
	display:flex;
	justify-content:center;
	width:100%;"
}

#loginForm {
	display: block;
    max-width: 20em;
    position: relative;
    margin: auto;
    top: -48em;
}

input#email {
	margin-top: 7px;
}

input#password {
	margin-top: 16px;
}

button#loginSubmitBtn {
	margin-top: 17px;
    margin-left: 7em;
}



/* Bloc logos tab association*/
div#logoContainer {
	height:131px;
	width:100%;
}
div#Logo1, div#Logo2 {
	position:relative;
	display: block;
	float:left;
	height: 100%;
	width:33.333%;
}

div#Logo2 {
	text-align:center;
	float:right;
}

.header-text {
  display: flex;
  flex-direction: column;   /* empile nom + slogan */
  justify-content: center;  /* centre verticalement par rapport au logo */
}

.header-text h1 {
  margin: 0;
  font-size: 1.5em;
  line-height: 1.2;
}

.header-text p {
  margin: 0;
  font-size: 0.9em;
  line-height: 1.2;
}

/* ====== Nav Tabs horizontaux ====== */
nav {
  display: flex;
  justify-content: center;
  gap: 5px;
  flex-wrap: nowrap;         /* reste horizontal */
  overflow-x: auto;          /* scroll horizontal si trop d’onglets */
  -webkit-overflow-scrolling: touch;
  align-self: flex-end;      /* colle le nav en bas du header */
  width: 100%;
}

/* Si tu préfères le nav à droite du header, commente width:100% ci-dessus et décommente la ligne suivante */
/* nav { width: auto; }*/

nav a {
  padding: 0.2em 0.4em;
  color: #004488;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid #fff;
  border-bottom: none;       /* effet onglet posé sur la ligne blanche */
  border-radius: 12px 12px 0 0;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;       /* évite le retour à la ligne dans un onglet */
}

nav a:hover {
  background: #fff;
  color: #DB3D3D;
}

nav a.active {
  background: #fff;
  color: #DB3D3D;
  font-weight: 700;
}

/* ====== Cartes / blocs ====== */
.card {
  background: #ABA6A6;                /* conserve ta couleur d’origine */
  color: #222;
  padding: 0.5em;
  margin: 0.6em 0 0.6em 0;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.card h1 {
	margin: 0 0 0 0;
}

div#historique h2, div#historique h4 {
	text-align: center;
}

/* ====== Formulaires ====== */
form label {
  display: block;
  margin: 0 0 0.5em 0;
  font-weight: 600;
}

div.page-header {
	position:relative;
	display:inline-block;
	float:left;
	margin-right:2em;
}

/* upload form and button*/
div.uploadform {
	position:relative;
	display:inline-block;
	border: 1px solid grey;
	border-radius:6px;
	width: 43em;
}

form#uploadForm {
	width:100%
}

/*page admin*/
div#title h2 {
	display:inline-block;
	width:8em;
}

div#title form {
	display:inline-block;
	width:9em;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
textarea,
select {
  width: 100%;
  padding: 0.5em 0.6em;
  margin: 4px 0 4px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  font: inherit;
}

textarea { resize: vertical; min-height: 100px; }

button,
input[type="submit"] {
  background: #2980b9;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.7em 1.2em;
  margin-bottom:4px;
  cursor: pointer;
  font-weight: 600;
}

button:hover,
input[type="submit"]:hover {
  background: #3498db;
}

/* Input natif caché */
input[type="file"][hidden] {
  display: none;
}

/* Bouton fichier */
.file-input-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
  opacity: 0;
}
.upload-btn {
  display: inline-block;
  padding: 0.3em 0.8em;
  background: #2980b9;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  margin-right: 10px;
}
.upload-btn:hover {
  background: #3498db;
}

/* Nom du fichier */
.file-name {
  margin-left: 10px;
  font-size: 0.9em;
  color: #555;
  font-style: italic;
}

/* Bouton submit */
.submit-btn {
  margin-left: 15px;
  padding: 10px 18px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 500;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: background 0.3s, transform 0.2s;
}

.submit-btn:hover {
  background: #218838;
  transform: translateY(-2px);
}

/*multiple upload*/
#previewList {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.preview-item {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 5px;
  width: 150px;
  text-align: center;
  font-size: 0.9em;
  background: #fafafa;
}
.preview-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
}
.progress {
  height: 6px;
  background: #eee;
  border-radius: 3px;
  margin-top: 5px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: #4caf50;
  transition: width 0.2s;
}

/* Petits boutons inline dans les tableaux admin */
form.inline { display: inline; }
button.linklike {
  background: transparent;
  color: #DB3D3D;
  border: 1px solid #DB3D3D;
}
button.linklike:hover {
  background: #DB3D3D;
  color: #fff;
}

/* ====== Alertes ====== */
.alert {
  padding: 0.7em;
  border-radius: 6px;
  margin-bottom: 1em;
  font-weight: 600;
}

.alert.success { background: #d4edda; color: #155724; }
.alert.error   { background: #f8d7da; color: #721c24; }
.alert.info    { background: #cce5ff; color: #004085; }

/* ====== Tableaux (admin) ====== */
table {
  width: 100%;
  color: cornflowerblue;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

th, td {
  padding: 5px 6px;
  border: 1px solid #e5e5e5;
  vertical-align: top;
  word-break: break-word;
}

th {
  background: #f1f1f1;
  text-align: left;
}

#imageTable tbody tr, #articleTable tbody tr {
    display: none;
}
#imageTable tbody tr:nth-child(-n+2),  #articleTable tbody tr:nth-child(-n+2) {
    display: table-row; /* Les 2 premières visibles */
}

/* Conteneur scrollable pour les table */
.table-scroll {
    max-height: 70vh;      /* hauteur visible */
    overflow-y: auto;      /* scroll vertical uniquement */
    border: 1px solid #ccc;
    border-radius: 6px;
}

/* Fixer le header du tableau */
#imageTable thead th, #articleTable thead th {
    position: sticky;
    top: 0;
    background: #f8f8f8;     /* couleur sous le texte */
    z-index: 10;
}

/* Un peu de style utile */
#imageTable, #articleTable {
    width: 100%;
    border-collapse: collapse;
}

#imageTable th,
#imageTable td
#articleTable th,
#articleTable td {
    padding: 8px;
    border-bottom: 1px solid #ddd;
}

/* ====== Galéries ====== */
.gallery, .articlesGallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.thumb, .articleThumb {
  position: relative;
  display: block;
  cursor: pointer;
  overflow: hidden;
  border-radius: 10px;
}

.thumb img, .articleThumb img {
  width: 100%;
  max-height:138px;
  display: block;
  transition: transform 0.3s ease;
  object-fit:cover;
}

.articleThumb img {
	max-height:248px;
}
 
.thumb:hover img, .articleThumb:hover img {
  transform: scale(1.05);
}

.thumb:hover .thumb-caption {
  opacity: 1;
}

.thumb-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  text-align: center;
  padding: 5px;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.month-separator {
  grid-column: 1 / -1;
  text-align: left;
  font-weight: bold;
  font-size: 1.1em;
  margin: 15px 0 5px;
  color: #555;
  border: 1px solid #ccc;
  border-bottom;unset;
  background-color: aliceblue;
}

.btn-sort {
  background: #2a6;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 10px;
}

.btn-sort:hover {
  background: #249;
}

/* gallery articles pdf*/
.pdf-gallery { /*in tab articles*/
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(149px, 1fr));
    gap: 12px;
}

.pdf-thumb {
    position: relative;
    width: 100%;
    cursor: pointer;
    text-align: center;
	border: 1px solid #ccc;
	border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    margin-bottom: 8px;
}

.pdf-thumb canvas {
    width: 100%;
    height: auto;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.pdf-caption {
    margin-top: 0.3em;
    font-size: 0.85em;
    color: #333;
}

.pdf-item {
    text-align: center;
}

.lightbox {
	position:fixed;
	inset:0; background:rgba(0,0,0,0.85);
	display:flex;
	align-items:center;
	justify-content:center; z-index:9999;
}
.lightbox[style*="display:none"] { /* respect inline display */
	display:none;
}

.lightbox figure {
	position:relative;
	max-width:90%;
	max-height:90%;
	margin:0;
	display:flex;
	flex-direction:column;
	align-items:center;
}
.lightbox img {
	max-width:100%;
	max-height:80vh;
	border-radius:8px;
	box-shadow:0 4px 15px rgba(0,0,0,0.5);
}
.lightbox figcaption {
	margin-top:10px;
	color:#fff;
	text-align:center;
	font-size:1rem;
}

.lightbox .close {
  position: absolute;
  top: 15px;
  right: 25px;
  font-size: 40px;
  color: white;
  text-decoration: none;
  cursor: pointer;
  font-weight: bold;
  z-index: 1001;
}
.lightbox .close:hover {
  color: #ccc;
}

.lightbox .nav {
	position:absolute;
	top:50%;
	transform:translateY(-50%);
	background:none;
	border:none;
	font-size:2.6rem;
	color:#fff;
	cursor:pointer;
	padding:0 18px;
}
.lightbox .prev {
	left:18px;
}
.lightbox .next {
	right:18px;
}

#toggle-order {
  margin: 10px 0;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: #007bff;
  color: white;
  cursor: pointer;
  font-size: 14px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
#toggle-order:hover {
  background: #0056b3;
}

/* Responsive mobile */
@media (max-width: 768px) {
  .thumb-container {
    width: calc(50% - 10px); /* 2 images par ligne */
  }
}

@media (max-width: 480px) {
  .thumb-container {
    width: 100%; /* 1 image par ligne */
  }
}

/* video galery */
.video-gallery video {
  max-height: 300px;
  width: 100%;
  object-fit: contain; /* pour que la vidéo ne soit pas déformée */
}

div#videoGrid {
	display:grid;
	grid-template-columns:repeat(auto-fill,minmax(224px,1fr));
	gap:12px;"
}

figure {
    display: block;
    margin-block-start: 0.2em;
    margin-block-end: 0.2em;
    margin-inline-start: 10px;
    margin-inline-end: 10px;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* affichage message en haut à droite de l'écran */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: #d4edda; /* vert pour succès */
  color: #155724;
  padding: 10px 14px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  font-size: 14px;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.toast.show {
  opacity: 1;
}

.fade-out {
  transition: opacity 0.5s ease, height 0.5s ease, margin 0.5s ease, padding 0.5s ease;
  opacity: 0;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
}

/* Container bulletins list*/
.bulletins-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 15px;
}

.bulletin-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border:1px solid lightblue;
  border-radius:999px;
}

.bulletin-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #6c63ff, #5348d8);
  color: white;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 500;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s, background 0.3s;
}

.bulletin-btn:hover {
  background: linear-gradient(135deg, #7c73ff, #6550e0);
  transform: translateY(-2px);
}

.delete-bulletin {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #c0392b;
  transition: transform 0.2s;
}

.delete-bulletin:hover {
  transform: scale(1.2);
  color: #e74c3c;
}


/* ====== Responsive (ipad ≤ 1240px) ====== */
@media (max-width: 1240px) {
	div#assLogo2 {
		display:none;
	}
}
	
/* ====== Responsive (mobile ≤ 768px) ====== */
@media (max-width: 768px) {
  header {
    align-items: flex-start;  /* le header passe en colonne */
	}
	.header-left {
		margin-bottom: 10px;
	}
	.logo {
		height: 75px;
	}
  /* Les tabs restent horizontaux avec scroll si besoin (grâce à overflow-x) */
	nav {
		justify-content: flex-start;
	}
	main { 
		padding: 120px 0.4em;
	}
}

.modal {
	background: grey;
    color: #eee;
    padding: 20px;
    border-radius: 12px;
    width: 420px;
    max-width: 95%;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    display: none;
}

.modal-content {
    background: #ABA6A6;
	color: #222;
    padding: 20px;
    border-radius: 8px;
    min-width: 300px;
    text-align: center;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    cursor: pointer;
    font-size: 20px;
}

.btn.ghost {
	background: #444;
}

.btn.ghost:hover {
	background: #333;
}
.readonly-field {
    background: #f0f0f0;
    border: 1px solid #ccc;
    padding: 6px 8px;
    width: 100%;
    border-radius: 4px;
    margin-bottom: 10px;
}

