:root {
  --primary: #e63946;
  --overlay: rgba(0, 0, 0, 0.6);
  --text-light: #ffffff;
  --accent: #25d366;
}
* {
  box-sizing: border-box;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  background-color: var(--fond-page);
  color: var(--text-light);
  line-height: 1.6;
}
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  background-color: var(--fond-section);
  padding: 0;
  backdrop-filter: blur(10px);
}
header .header-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex-wrap: wrap;
}
header img {
  height: 105px;
  width: auto;
}
nav {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}
nav a {
  color: var(--primary); /* Links are red by default */
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: color 0.2s;
}
nav a:hover {
  color: #c5303d; /* Darker red on hover */
}
nav a:not(.whatsapp) {
  margin-right: 1rem;
}
nav a.whatsapp {
  color: var(--accent);
  font-size: 2.5rem; /* Increased font size for better visibility */
  position: relative; /* Kept for z-index or other properties if needed in future */
  vertical-align: middle;
  /* Removed top and left properties for flexbox alignment */
}


@keyframes calmFlames {
  0%, 100% { transform: translateY(5px); opacity: 0.6; }
  50% { transform: translateY(-5px); opacity: 0.9; }
}
main {
  max-width: 900px; /* Slightly reduced for better readability */
  margin: auto;
  margin-top: 120px;
  padding: 2rem;
}
section {
  padding: 3rem 0;
  border-bottom: 1px solid #333;
}
section:last-of-type {
  border-bottom: none;
}
h1, h2 {
  color: var(--primary);
  font-size: 2.2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 2.5rem;
  margin-top: 0;
}

.services ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  text-align: left; /* Ensure text is aligned left within grid items */
}
.services li::before {
  content: "\2714\0020";
  color: var(--primary);
  font-weight: bold;
}
.box {
  background-color: transparent;
  padding: 0;
  border-radius: 0;
}
.contact input, .contact textarea {
  width: 100%;
  padding: 15px;
  margin: 10px 0;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  background-color: var(--fond-input);
  color: var(--input-text-color);
  transition: border-color 0.3s;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
}
.contact input:focus, .contact textarea:focus {
    outline: none;
    border-color: var(--primary);
}
.contact button {
  background-color: var(--primary);
  color: white;
  padding: 15px 30px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: background-color 0.3s;
  display: block; /* Make button block level */
  width: auto;
  margin: 20px auto 0; /* Center the button */
}
.contact button:hover {
    background-color: #c5303d;
}
.avis blockquote {
  margin: 1.5rem auto;
  padding-left: 1.5rem;
  border-left: 3px solid var(--primary);
  font-style: italic;
  max-width: 70ch; /* Limit width for better readability */
  text-align: center;
}
.zone p, .zone h2, #qui h2 {
    text-align: center;
}
#qui > div {
    max-width: 70ch;
    margin: 0 auto;
    text-align: center;
}
footer {
  text-align: center;
  background-color: var(--fond-section);
  color: #aaa;
  padding: 2rem 1rem;
}
footer a {
  color: var(--primary);
  text-decoration: none;
  margin: 0 0.5rem;
}

.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay);
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.popup-content {
  background: var(--fond-element-ui);
  color: var(--main-text-color);
  max-width: 800px; /* Increased width for better readability */
  max-height: 80vh;
  overflow-y: auto;
  padding: 2rem;
  border-radius: 8px;
  position: relative;
  border: 1px solid #34495e;
}

.popup-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.popup-content a:hover {
    color: #c5303d;
}

.popup-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  transform: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--main-text-color);
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--primary);
  cursor: pointer;
  z-index: 10001;
}

/* Generic helper */
.center {
  text-align: center;
}

/* --- Style for Réalisations Page --- */
.realisations-page h1 {
  margin-bottom: 1.25rem; /* Reduced from 2.5rem */
}

.project-section {
  /* This class is now primarily a semantic hook. */
  /* The <section> tag itself provides the main layout styling (padding, border-bottom). */
  margin-bottom: 0; /* Reset margin */
}

.project-description {
  max-width: 80ch;
  margin: 0 auto 2rem;
  line-height: 1.6;
  color: var(--main-text-color);
}

.photos .avant, .photos .apres {
  flex: 1;
}

.photos h3 {
  text-align: center;
  margin-bottom: 1rem;
}

.photos .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.5rem;
}

.photos .grid img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.photos .grid img:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px var(--primary);
}


.image-pair-headers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    text-align: center;
}

/* --- Lightbox Styles --- */
.lightbox-overlay {
  display: none;
  position: fixed;
  z-index: 10001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: var(--overlay);
  animation: fadeIn 0.5s;
}

.lightbox-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 95%;
  max-height: 95%;
  display: inline-block; /* Shrink to fit content */
}

.lightbox-content {
  display: block;
  max-width: 100%;
  max-height: 100%;
  animation: zoomIn 0.5s forwards;
  transform-origin: center center;
}

.lightbox-close {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(40%, -40%);
  background: var(--fond-element-ui);
  color: var(--primary);
  border: 2px solid #fff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 22px;
  font-weight: bold;
  line-height: 28px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s ease-out, background-color 0.2s;
}

.lightbox-close:hover,
.lightbox-close:focus {
  transform: translate(40%, -40%) scale(1.1);
  background-color: var(--primary);
  color: #fff;
}

#lightbox-caption {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  text-align: center;
  color: #ccc;
  padding: 10px 0;
  position: absolute;
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes zoomIn {
  from { transform: scale(0.8); }
  to { transform: scale(1); }
}

/* --- Styles for Réalisations Page Layout --- */
.photos {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.photos .avant, .photos .apres {
  flex: 1;
}

.image-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
    border-bottom: 1px solid #444;
    padding-bottom: 1.5rem;
}

.image-item-wrapper {
    width: 100%;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--fond-section);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}


.image-item-wrapper:hover,
.image-item-wrapper:focus-within {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 24px -18px rgba(0, 0, 0, 0.45);
    transform: translateY(-1px);
}

.image-item-wrapper > img.lightbox-trigger {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.image-item-wrapper > img.lightbox-trigger:hover {
    transform: scale(1.05);
}

.image-item-wrapper > img.composed-image {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.25);
}

@media (max-width: 768px) {
    .photos {
        flex-direction: column;
    }
}


.image-placeholder {
    display: flex;
    width: 100%;
    aspect-ratio: 3 / 4;
    background-color: var(--fond-section);
    border: 2px dashed var(--primary);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    align-items: center;
    justify-content: center;
}

.image-placeholder.is-static {
    cursor: default;
    pointer-events: none;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.12);
    background-color: var(--fond-section);
    transition: none;
    transform: none;
}

.image-placeholder:hover,
.image-placeholder:focus {
    background-color: rgba(230, 57, 70, 0.08);
    border-color: rgba(230, 57, 70, 0.8);
    transform: scale(1.02);
}

.image-placeholder.is-static::before {
    content: '';
}

.image-placeholder::before {
    content: '+';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary);
    font-size: 4rem; /* Taille de l'icône, ajustable */
    font-weight: bold;
    line-height: 1;
}

@media (max-width: 768px) {
    header .header-container {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
    }

    header img {
        height: 80px; /* Logo plus petit sur mobile */
    }

    nav {
        gap: 1rem; /* Moins d'espace entre les liens de nav */
    }

    main {
        margin-top: 180px; /* Dégagement pour le header qui est plus haut */
        padding: 1rem;
    }

    h1, h2 {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }

}
