/* --- Import des polices --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

/* --- Déclarations exactes issues de Transfonter --- */
@font-face {
    font-family: 'BDRmono 2006';
    src: url('fonts/BDRmono2006-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'BDRmono 2006';
    src: url('fonts/BDRmono2006.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: block;
}

@font-face {
    font-family: 'BDRmono 2006';
    src: url('fonts/BDRmono2006-Light.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: block;
}

:root {
  --accent-color: #c62828; /* Rouge d'accentuation optimisé pour le contraste WCAG (Accessibilité 100%) */
  --text-color: #111111;
  --bg-color: #ffffff;
  --font-mono: 'BDRmono 2006', monospace, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --max-width: 1140px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--text-color);
  background-color: var(--bg-color);
  font-size: 11px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  cursor: crosshair;
}

a {
  color: inherit;
  text-decoration: none;
  cursor: crosshair;
  transition: color 0.15s ease, background-color 0.15s ease;
}

p a, li a, .body-link {
  color: var(--text-color);
  cursor: crosshair;
}

p a:hover, li a:hover, .body-link:hover {
  color: var(--accent-color);
}

.site-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 60px 20px 40px 20px;
  overflow-x: hidden;
}

/* --- En-tête / Header & Menu --- */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 60px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: normal;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  position: relative;
}

.brand a {
  color: var(--accent-color);
  font-weight: normal;
  cursor: crosshair;
}

.brand a:hover {
  color: var(--accent-color);
  background-color: transparent;
}

.main-nav {
  display: flex;
  align-items: center;
}

.main-nav a {
  margin-left: 12px;
  color: var(--accent-color);
  padding: 3px 3px 3px 6px;
  line-height: 1;
  display: inline-block;
  font-weight: normal;
  letter-spacing: 0.05em;
  cursor: crosshair;
}

.main-nav a:hover,
.main-nav a.active {
  background-color: var(--accent-color);
  color: #ffffff;
}

.main-nav a.external-link {
  background-color: transparent !important;
  color: var(--text-color);
  padding: 3px 3px 3px 6px;
  display: inline-block;
  transition: color 0.15s ease;
}

.main-nav a.external-link:hover {
  background-color: transparent !important;
  color: var(--accent-color) !important;
}

.menu-toggle-btn {
  display: none;
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: normal;
  color: var(--accent-color);
  text-transform: uppercase;
  cursor: crosshair;
  padding: 0;
  margin: 0;
  line-height: 1;
}

/* --- Grille de Réalisations Asymétrique (Accueil) --- */
.projects-grid {
  column-count: 3;
  column-gap: 32px;
  margin-bottom: 60px;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
}

.project-card {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin-bottom: 48px;
  display: inline-block;
  width: 100%;
}

.project-card a {
  display: block;
  text-decoration: none;
  cursor: crosshair;
}

.project-card img {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 12px;
  transition: opacity 0.15s ease;
}

.project-card img:hover {
  opacity: 0.85;
}

.project-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
}

/* Palier intermédiaire fluide pour les réalisations */
@media (max-width: 1200px) {
  .projects-grid {
    column-count: 3;
    column-gap: 24px;
  }
}

@media (max-width: 1024px) {
  .projects-grid {
    column-count: 2;
  }
}

@media (max-width: 600px) {
  .projects-grid {
    column-count: 2;
    column-gap: 12px;
  }
}

/* --- Grille Galerie Projet & Dessins/Maquettes --- */
.project-detail-grid {
  column-count: 4;
  column-gap: 24px;
  width: 100%;
  max-width: 100%;
  margin-bottom: 40px;
}

.project-detail-grid img {
  width: 100%;
  height: auto;
  display: inline-block;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin-bottom: 24px;
  transition: opacity 0.15s ease;
}

.project-detail-grid img:hover {
  opacity: 0.85;
}

@media (max-width: 1200px) {
  .project-detail-grid {
    column-count: 3;
    column-gap: 20px;
  }
}

@media (max-width: 900px) {
  .project-detail-grid {
    column-count: 2;
    column-gap: 16px;
  }
}

@media (max-width: 600px) {
  .project-detail-grid {
    column-count: 2;
    column-gap: 12px;
  }
  .project-detail-grid img {
    margin-bottom: 12px;
  }
}

/* --- Cartouche Technique & Sections Repliables --- */
.project-meta-cartridge {
  margin-top: 40px;
  margin-bottom: 40px;
  width: 100%;
  max-width: 100%;
  border-top: 1px solid #111;
  border-bottom: 1px solid #111;
  padding: 20px 0;
}

.project-meta-cartridge h2 {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 16px;
  letter-spacing: 0.05em;
}

.meta-grid p {
  margin-bottom: 6px;
  font-family: var(--font-body);
  font-weight: 300;
}

.collapsible-section {
  width: 100%;
  max-width: 100%;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 16px;
}

.collapse-toggle-btn {
  width: 100%;
  background: none;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 0;
  color: var(--text-color);
  cursor: crosshair;
  transition: color 0.15s ease;
}

.collapse-toggle-btn:hover {
  color: var(--accent-color);
}

.collapse-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease-in-out, opacity 0.25s ease-in-out;
  opacity: 0;
  padding-bottom: 0;
  font-family: var(--font-body);
  font-weight: 300;
}

.collapse-content.active {
  max-height: 4000px;
  opacity: 1;
  padding-bottom: 20px;
}

.collapse-content p {
  margin-bottom: 12px;
  color: #333;
}

/* --- Tableau Récapitulatif --- */
.projects-table-section {
  font-family: var(--font-mono);
  position: relative;
  margin-top: 40px;
  width: 100%;
  max-width: 100%;
}

.projects-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 11px;
  font-family: var(--font-mono);
  table-layout: auto;
}

.projects-table th {
  font-family: var(--font-mono);
  font-weight: bold;
  color: #111;
  padding-bottom: 10px;
  border-bottom: 1px solid #111111;
  vertical-align: bottom;
  padding-right: 18px;
}

.projects-table td {
  font-family: var(--font-mono);
  padding: 6px 18px 6px 0;
  border-bottom: 1px solid transparent;
  color: #111;
}

.projects-table td:nth-child(4) {
  font-family: var(--font-mono);
  font-weight: normal;
}

.accent-link {
  color: var(--accent-color);
  background-color: transparent;
  padding: 0;
  font-weight: normal;
  cursor: crosshair;
}

.accent-link:hover {
  color: #111111;
  background-color: transparent;
}

/* --- Page Portrait & Contact --- */
.portrait-info-light {
  font-family: var(--font-mono);
  font-size: 11px;
}

.portrait-info-light p {
  font-family: var(--font-mono);
}

.portrait-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 60px;
}

.portrait-img img {
  width: 100%;
  height: auto;
  display: block;
}

.portrait-content {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 11px;
  line-height: 1.6;
}

.portrait-block {
  margin-bottom: 24px;
}

.portrait-block h2 {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.portrait-block ul {
  list-style: none;
}

.portrait-block li {
  margin-bottom: 6px;
}

.pfe-link-container {
  margin: 32px 0;
}

.pfe-link {
  font-family: var(--font-mono);
  color: var(--text-color);
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  cursor: crosshair;
}

.pfe-link:hover {
  color: var(--accent-color);
  background-color: transparent;
}

.contact-form {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 450px;
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: 11px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-form label {
  font-family: var(--font-mono);
}

/* MODIFICATION : Application de la police Inter Regular sur les champs de saisie */
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 8px 0;
  border: none;
  border-bottom: 1px solid #111;
  font-family: var(--font-body);
  font-weight: 400; /* Inter Regular */
  font-size: 11px;
  outline: none;
  background: transparent;
  cursor: crosshair;
}

.contact-form button {
  background: transparent;
  border: 1px solid #111;
  padding: 8px 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  align-self: flex-start;
  cursor: crosshair;
}

.contact-form button:hover {
  background: #111;
  color: #fff;
}

/* Style pour le statut d'envoi du formulaire (ENVOYÉ ! en BDR mono bold rouge) */
#form-status {
  margin-top: 15px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700; /* Bold */
  color: var(--accent-color); /* Rouge */
  display: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Page Mentions Légales --- */
.legal-content {
  width: 100%;
  max-width: 100%;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 11px;
  line-height: 1.6;
}

.legal-content h1 {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 32px;
}

.legal-content h2 {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: bold;
  margin-top: 24px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.legal-block {
  margin-bottom: 32px;
}

.legal-block p {
  margin-bottom: 2px;
  color: #111;
}

/* --- Footer Structuré Unifié --- */
.main-footer {
  margin-top: 80px;
  padding-top: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.main-footer a, .main-footer span {
  color: var(--text-color);
  cursor: crosshair;
}

.main-footer a:hover {
  color: var(--accent-color);
}

.main-footer a.active {
  background-color: var(--text-color);
  color: var(--bg-color);
  padding: 3px 3px 3px 6px;
  display: inline-block;
}

.order-link {
  color: var(--text-color);
  cursor: crosshair;
}

.order-link:hover {
  color: var(--accent-color);
}

/* --- Lightbox / Diaporama --- */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.98);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.lightbox.active {
  display: flex;
}

.lightbox-close-btn {
  position: fixed;
  top: 60px;
  right: max(20px, calc((100vw - var(--max-width)) / 2 + 20px));
  font-family: var(--font-mono);
  font-weight: normal;
  font-size: 12px;
  color: var(--accent-color);
  background: var(--bg-color);
  border: none;
  line-height: 1;
  padding: 3px 3px 3px 6px;
  margin: 0;
  text-transform: uppercase;
  cursor: crosshair;
  transition: opacity 0.15s ease;
  z-index: 1030;
}

.lightbox-close-btn:hover {
  opacity: 0.7;
}

.lightbox-img-container {
  max-width: 68vw;
  max-height: calc(100vh - 240px);
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 60px auto 0 auto;
}

.lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 240px);
  object-fit: contain;
}

@media (min-width: 1025px) {
  .lightbox-img-container img.is-portrait {
    max-width: none;
    max-height: 100vh;
    height: 100vh;
    width: auto;
  }
}

.lightbox-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-weight: 300;
  font-size: 26px;
  color: var(--accent-color);
  background: none;
  border: none;
  user-select: none;
  padding: 10px;
  margin: 0;
  cursor: crosshair;
  transition: opacity 0.15s ease;
  z-index: 1020;
}

.lightbox-btn:hover {
  opacity: 0.7;
}

#lightbox-prev {
  left: max(20px, calc((100vw - var(--max-width)) / 2 + 20px));
}

#lightbox-next {
  right: max(20px, calc((100vw - var(--max-width)) / 2 + 20px));
}

@media (width: 1024px) and (height: 600px) {
  .lightbox-close-btn {
    top: 60px;
  }
  .lightbox-img-container {
    max-height: calc(100vh - 120px);
    margin-top: 30px;
  }
  .lightbox img,
  .lightbox-img-container img.is-portrait {
    max-height: calc(100vh - 120px);
  }
}

/* --- Version Mobile --- */
@media (max-width: 768px) {
  body {
    font-size: 12px;
  }

  .site-container {
    max-width: 100vw;
    padding: 30px 15px 20px 15px;
  }

  .main-header {
    margin-bottom: 30px;
  }

  .projects-table {
    font-size: 10px;
  }

  .hide-on-mobile {
    display: none;
  }

  .menu-toggle-btn {
    display: block;
    font-size: 12px;
    line-height: 1;
    position: relative;
    z-index: 1020;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-color);
    flex-direction: column;
    align-items: flex-end;
    border: 1px solid #111;
    padding: 10px;
    gap: 8px;
    z-index: 999;
  }

  .main-nav.active {
    display: flex;
  }

  .main-nav a {
    margin-left: 0;
    font-size: 12px;
  }

  .portrait-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
  }

  .portrait-content {
    order: 1;
  }

  .portrait-img {
    order: 2;
  }

  .lightbox {
    padding: 0;
    z-index: 2000;
  }

  .lightbox-close-btn {
    position: absolute;
    top: 33.5px;
    right: 15px;
    font-size: 12px;
    font-family: var(--font-mono);
    font-weight: normal;
    color: var(--accent-color);
    background: var(--bg-color);
    border: none;
    line-height: 1;
    padding: 0;
    margin: 0;
    z-index: 2010;
  }

  .lightbox-img-container {
    max-width: 100vw;
    max-height: calc(100vh - 120px);
    width: 100%;
    margin: 30px auto 0 auto;
  }

    .lightbox img {
    max-width: 100%;
    max-height: calc(100vh - 120px);
    width: 100%;
    object-fit: contain;
  }

  .lightbox-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    padding: 10px;
    z-index: 2010;
    font-weight: 300;
  }

  #lightbox-prev {
    left: 10px;
  }

  #lightbox-next {
    right: 10px;
  }
}