/* http://meyerweb.com/eric/tools/css/reset/
   v2.0 | 20110126
   License: none (public domain)
*/

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
  display: block;
}
body {
  line-height: 1;
}
ol,
ul {
  list-style: none;
}
blockquote,
q {
  quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
  content: "";
  content: none;
}
table {
  border-collapse: collapse;
  border-spacing: 0;
}
/** end reset css**/

/* MODIFICATION : Largeur maximale retirée du body pour le bandeau 100% */
body {
  font-family: "Work Sans";
  font-size: 14px;
  background-color: #fffef8;
}

/* AJOUT : Conteneur global pour centrer le site à 1140px sans bloquer la barre noire */
header,
main,
footer {
  max-width: 1140px;
  margin: auto;
  padding: 0 50px;
  box-sizing: border-box;
}

header {
  display: flex;
  justify-content: space-between;
  margin: 50px auto;
}
section {
  margin: 50px 0;
}

h1 {
  display: flex;
  flex-direction: column;
  font-family: "Syne";
  font-size: 22px;
  font-weight: 800;
  color: #b1663c;
}

h1 > span {
  font-family: "Work Sans";
  font-size: 10px;
  letter-spacing: 0.1em;
}

h2 {
  font-family: "Syne";
  font-weight: 700;
  font-size: 30px;
  color: #1d6154;
}
nav ul {
  display: flex;
  align-items: center;
  list-style-type: none;
}
nav li {
  padding: 0 10px;
  font-size: 1.2em;
}

li:hover {
  color: #b1663c;
}
#introduction {
  display: flex;
  align-items: center;
}
#introduction figure {
  flex: 1;
}
#introduction img {
  display: block;
  margin: auto;
  width: 80%;
}

#introduction article {
  flex: 1;
}
#introduction h2 {
  margin-bottom: 1em;
}

#introduction p {
  margin-bottom: 0.5em;
}

/* MODIFICATION : Nettoyage pour éviter les conflits d'alignement avec le bouton modifier */
#portfolio h2 {
  text-align: center;
}
.gallery {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-column-gap: 20px;
  grid-row-gap: 20px;
}

.gallery img {
  width: 100%;
}
#contact {
  width: 50%;
  margin: auto;
}
#contact > * {
  text-align: center;
}
#contact h2 {
  margin-bottom: 20px;
}
#contact form {
  text-align: left;
  margin-top: 30px;
  display: flex;
  flex-direction: column;
}

#contact input {
  height: 50px;
  font-size: 1.2em;
  border: none;
  box-shadow: 0px 4px 14px rgba(0, 0, 0, 0.09);
}
#contact label {
  margin: 2em 0 1em 0;
}
#contact textarea {
  border: none;
  box-shadow: 0px 4px 14px rgba(0, 0, 0, 0.09);
}

input[type="submit"] {
  font-family: "Syne";
  font-weight: 700;
  color: white;
  background-color: #1d6154;
  margin: 2em auto;
  width: 180px;
  text-align: center;
  border-radius: 60px;
}

footer nav ul {
  display: flex;
  justify-content: flex-end;
  margin: 2em;
}

/* Conteneur des filtres */
.filters {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 30px;
  margin-bottom: 50px;
}

/* Style de base des boutons (Maquette) */
.filter-btn {
  font-family: "Syne";
  font-weight: 700;
  color: #1d6154;
  background-color: white;
  border: 1px solid #1d6154;
  border-radius: 60px;
  padding: 10px 20px;
  text-align: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s ease;
}

/* Style du bouton sélectionné / survolé */
.filter-btn:hover,
.filter-btn.active {
  color: white;
  background-color: #1d6154;
}

/* ==========================================================================
   Navigation & Liens Généraux (Évite le style inline)
   ========================================================================== */

header nav ul li a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

header nav ul li a:hover {
  color: #1d6154;
}

/* Style pour la page active (Mise en valeur dans la navigation) */
header nav ul li a.active {
  font-weight: 600;
  color: #000000;
}

/* ==========================================================================
   Page de Login (Conforme Maquette Figma)
   ========================================================================== */

#login {
  width: 380px;
  margin: 60px auto 140px auto;
  text-align: center;
}

#login h2 {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  font-size: 30px;
  color: #1d6154;
  margin-bottom: 35px;
}

#login-form {
  display: flex;
  flex-direction: column;
  text-align: left;
}

#login-form label {
  font-family: "Work Sans", sans-serif;
  color: #3d3d3d;
  margin-bottom: 10px;
  font-size: 14px;
}

#login-form input[type="email"],
#login-form input[type="password"] {
  font-family: "Work Sans", sans-serif;
  font-size: 16px;
  padding: 15px;
  border: none;
  box-shadow: 0px 4px 14px rgba(0, 0, 0, 0.09);
  margin-bottom: 30px;
  background-color: #ffffff;
}

/* Bouton de soumission "Se connecter" */
#login-form input[type="submit"] {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  color: #ffffff;
  background-color: #1d6154;
  border: none;
  border-radius: 60px;
  padding: 12px 0;
  width: 180px;
  margin: 10px auto 25px auto;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.3s ease;
}

#login-form input[type="submit"]:hover {
  background-color: #0e3f35;
}

/* Lien Mot de passe oublié */
.forgot-password {
  font-family: "Work Sans", sans-serif;
  font-size: 14px;
  color: #3d3d3d;
  text-decoration: underline;
  text-align: center;
  display: block;
  transition: color 0.3s ease;
}

.forgot-password:hover {
  color: #1d6154;
}

/* ==========================================================================
   Styles Mode Édition / Administrateur
   ========================================================================== */

/* CORRECTION : On enleve le !important pour laisser le JavaScript travailler */
.admin-only {
  display: none;
}

/* Bandeau noir tout en haut */
#edition-bar {
  background-color: #000000;
  color: #ffffff;
  width: 100%;
  height: 59px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-family: "Work Sans", sans-serif;
  font-size: 16px;
}

/* Alignement du titre Projets et du bouton Modifier */
.portfolio-title-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  margin-top: 20px;
  margin-bottom: 30px;
}

/* Bouton modifier */
#modify-projects {
  font-family: "Work Sans", sans-serif;
  color: #000000;
  text-decoration: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

#modify-projects:hover {
  opacity: 0.7;
}

/* ==========================================================================
   STYLES DE LA FENÊTRE MODALE
   ========================================================================== */
.modal-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal-wrapper {
  background: #ffffff;
  width: 630px;
  max-width: 100%;
  border-radius: 10px;
  padding: 30px 105px 45px 105px;
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
}

.modal-navigation {
  position: absolute;
  top: 26px;
  left: 26px;
  right: 26px;
  display: flex;
  justify-content: space-between;
}

.modal-navigation button {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #000000;
}

.modal-content-zone h3 {
  font-family: "Work Sans", sans-serif;
  font-size: 26px;
  color: #000000;
  text-align: center;
  margin-bottom: 45px;
  margin-top: 20px;
}

/* Galerie interne */
.modal-gallery {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 40px;
}

.modal-gallery figure {
  position: relative;
}

.modal-gallery img {
  width: 100%;
  height: 100px;
  object-fit: cover;
}

.trash-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #000000;
  color: #ffffff;
  border: none;
  border-radius: 2px;
  padding: 4px 6px;
  font-size: 11px;
  cursor: pointer;
}

/* Séparateur et boutons principaux */
.modal-separator {
  border: 0;
  height: 1px;
  background: #b3b3b3;
  margin-bottom: 30px;
  width: 100%;
}

.modal-btn-main {
  font-family: "Syne", sans-serif;
  font-weight: 700;
  color: #ffffff;
  background-color: #1d6154;
  border: none;
  border-radius: 60px;
  padding: 12px 0;
  width: 237px;
  margin: 0 auto;
  display: block;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
}

.modal-btn-main:disabled {
  background-color: #a7a7a7;
  cursor: not-allowed;
}

/* Formulaire d'ajout */
.upload-box {
  background: #e8f1f0;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  margin-bottom: 30px;
  position: relative;
  min-height: 170px;
  justify-content: center;
}

.upload-icon {
  font-size: 60px;
  color: #b9c9c7;
  margin-bottom: 15px;
}

.upload-btn {
  background: #cbd6dc;
  color: #306685;
  padding: 10px 33px;
  border-radius: 50px;
  font-family: "Work Sans", sans-serif;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 10px;
}

.upload-desc {
  font-size: 10px;
  color: #444444;
}

#image-preview-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #e8f1f0;
  display: flex;
  justify-content: center;
  align-items: center;
}

#image-preview {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

#file-upload {
  display: none;
}

.input-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 20px;
  text-align: left;
}

.input-group label {
  font-family: "Work Sans", sans-serif;
  font-size: 14px;
  color: #3d3d3d;
  margin-bottom: 10px;
}

.input-group input,
.input-group select {
  height: 50px;
  border: none;
  box-shadow: 0px 4px 14px rgba(0, 0, 0, 0.09);
  padding: 0 15px;
  font-family: "Work Sans", sans-serif;
  font-size: 14px;
  background: #ffffff;
}
