/* =========================================================
   VARIABLES
   ========================================================= */
:root {
  --bg: #f6f5f2;
  --paper: #ffffff;
  --text: #2b2b2b;
  --text-light: #666;
  --border: #ddd;
  --accent: #8b0000;
  --menu-bg: #f0eee9;
  --menu-hover: #e3e1dc;
}

/* =========================================================
   BASE
   ========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  margin: 0;
  max-width: 100%;
}

body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.6;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  text-align: center;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
}

.logo {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: contain;
  background: #000;
  padding: 1.5rem 0;
  margin: 0 auto 1.5rem;
}

.site-header h1 {
  margin: 0;
  font-size: 3rem;
}

.site-header h2 {
  margin: .5rem 0 0;
  font-size: 1.3rem;
  color: var(--text-light);
}

/* ===== LANGUAGE SWITCH ===== */
.lang-switch {
  display: flex;
  justify-content: center;
  gap: .6rem;
  margin-top: .8rem;
}

.lang-switch img {
  height: 22px;
}

/* =========================================================
   MENU DESKTOP
   ========================================================= */
#menu-toggle {
  display: none;
}

nav {
  background: var(--menu-bg);
  border-bottom: 1px solid var(--border);
}

.main-menu {
  display: flex;
  justify-content: center;
  gap: 2rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.main-menu > li {
  position: relative;
}

.main-menu a,
.menu-accordion > span {
  display: block;
  padding: .9rem 1.3rem;
  font-size: .95rem;
  text-transform: uppercase;
  color: var(--text);
  cursor: pointer;
}

.main-menu a:hover,
.menu-accordion > span:hover {
  background: var(--menu-hover);
}

/* =========================================================
   SOUS-MENUS
   ========================================================= */
.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--paper);
  min-width: 240px;
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--border);
  z-index: 200;
}

.menu-accordion.open .submenu {
  display: block;
}

.submenu a {
  padding: .8rem 1rem;
  display: block;
  color: var(--text-light);
}

.submenu a:hover {
  background: var(--menu-hover);
  color: var(--text);
}

/* =========================================================
   CONTENU
   ========================================================= */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.section {
  background: var(--paper);
  padding: 2.5rem;
  margin-bottom: 3rem;
  border: 1px solid var(--border);
}

.section h2 {
  margin-top: 0;
  font-size: 2rem;
}

/* =========================================================
   TABLEAUX (FIX COMPLET)
   ========================================================= */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  border-radius: 4px;
  overflow: hidden;
}

th,
td {
  border: 1px solid #999;
  padding: 10px;
}

thead {
  background: #e4f0f5;
}

tbody tr:nth-child(even) {
  background: #f5f5f5;
}

th {
  text-align: left;
  font-weight: bold;
}

/* =========================================================
   GALERIES
   ========================================================= */
.carousel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.carousel img {
  width: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}

.carousel img:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
}

/* =========================================================
   VIEWER
   ========================================================= */
#viewer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

#viewer.hidden {
  display: none;
}

#viewer img {
  max-width: 90%;
  max-height: 80%;
  transition: transform .2s;
}

.viewer-controls {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 1002;
}

.viewer-controls button {
  width: 26px;
  height: 26px;
  background: #111;
  color: #fff;
  border: 1px solid #666;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#zoom-in,
#zoom-out,
#toggle-desc {
  border-radius: 4px;
}

#close {
  border-radius: 50%;
  background: var(--accent);
}

/* DESCRIPTION */
#description {
  position: fixed;
  bottom: 40px;
  background: rgba(255,255,255,.95);
  padding: 1.2rem;
  border-radius: 6px;
  max-width: 70%;
  text-align: center;
  z-index: 1003;
}

/* =========================================================
   FORMULAIRE
   ========================================================= */
form {
  max-width: 600px;
  margin: auto;
}

.form-row {
  display: flex;
  gap: 12px;
}

input, textarea {
  width: 100%;
  padding: .8rem;
  margin: .6rem 0;
  border: 1px solid var(--border);
}

textarea {
  min-height: 140px;
}

button:not(#menu-toggle) {
  padding: .7rem 2.5rem;
  border-radius: 30px;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
}

#menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 2.4rem;
  cursor: pointer;
  margin: 1rem auto;
  color: var(--text);
  padding: 0;
}

/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 768px) {

  #menu-toggle {
    display: block;
  }

  nav {
    position: fixed;
    inset: 0;
    transform: translateX(-100%);
    transition: transform .3s ease;
    background: var(--paper);
    padding-top: 5rem;
    z-index: 1000;
  }

  nav.open {
    transform: translateX(0);
  }

  .main-menu {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }

  .submenu {
    position: static;
    border: none;
  }

  .form-row {
    flex-direction: column;
  }

  .logo {
    height: 110px;
  }
}