:root {
  --midnight: #1a2045;
  --navy: #263168;
  --brass: #1f7e9e;
  --brass-light: #3a9fbe;
  --brass-pale: #dff0f6;
  --parchment: #ffffff;
  --parchment-dark: #e8e8e8;
  --ink: #1a1a1a;
  --ink-light: #5a5a5a;
  --ink-faint: #9a9a9a;
  --white: #ffffff;
  --shadow: rgba(38,49,104,0.08);
  --shadow-lg: rgba(38,49,104,0.18);
  --font-display: 'Oswald', sans-serif;
  --font-body: 'Open Sans', sans-serif;
  --radius: 6px;
  --radius-lg: 10px;
  --max-w: 1280px;
  --transition: 0.25s ease;
}

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

body {
  font-family: var(--font-body);
  background: var(--parchment);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* === HEADER === */
.site-header {
  background: var(--midnight);
  color: var(--parchment);
  padding: 2rem 2rem;
  text-align: center;
  position: relative;
}
.site-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.site-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 400;
  letter-spacing: 0.03em;
}
.site-header h1 span { color: var(--brass-light); }
.subtitle {
  font-size: 0.85rem;
  color: var(--brass-pale);
  opacity: 0.7;
  margin-top: 0.3rem;
  letter-spacing: 0.02em;
}

/* === STATS === */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 3rem;
  padding: 1rem 2rem;
  background: var(--white);
  border-bottom: 1px solid var(--parchment-dark);
}
.stat { text-align: center; }
.stat-num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--navy);
}
.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

/* === CARROUSEL HERO === */
.hero-carousel {
  position: relative;
  max-width: var(--max-w);
  margin: 1.5rem auto;
  padding: 0 2rem;
  height: 320px;
  overflow: hidden;
  border-radius: var(--radius-lg);
}
.carousel-track { position: relative; width: 100%; height: 100%; }
.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.carousel-slide.active { opacity: 1; }
.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
}
.carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3rem 1.5rem 1.2rem;
  background: linear-gradient(transparent, rgba(10,22,40,0.8));
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1.2rem;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.carousel-num {
  color: var(--brass-light);
  font-weight: 600;
  margin-right: 0.5rem;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.2);
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-btn:hover { background: rgba(255,255,255,0.4); }
.carousel-btn.prev { left: 2.5rem; }
.carousel-btn.next { right: 2.5rem; }
.carousel-dots {
  position: absolute;
  bottom: 1rem;
  right: 1.5rem;
  display: flex;
  gap: 6px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: background var(--transition);
}
.dot.active { background: var(--brass-light); }

/* === CONTROLES === */
.controls {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.2rem 2rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: nowrap;
  align-items: center;
}
.search-box {
  flex: 1;
  min-width: 160px;
  position: relative;
}
.search-box input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.5rem;
  border: 1px solid var(--parchment-dark);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.88rem;
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.search-box input:focus {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(196,151,59,0.1);
}
.search-box svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
  width: 16px;
  height: 16px;
}
.filter-group {
  display: flex;
  gap: 0.4rem;
}
.filter-group select {
  padding: 0.55rem 0.5rem;
  border: 1px solid var(--parchment-dark);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.78rem;
  background: var(--white);
  cursor: pointer;
  outline: none;
  color: var(--ink-light);
  width: 112px;
  text-overflow: ellipsis;
  overflow: hidden;
}
.filter-group select:focus { border-color: var(--brass); }
.view-controls {
  display: flex;
  border: 1px solid var(--parchment-dark);
  border-radius: var(--radius);
  overflow: hidden;
}
.view-btn {
  padding: 0.55rem 1rem;
  border: none;
  background: var(--white);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--ink-light);
  transition: all var(--transition);
}
.view-btn.active {
  background: var(--navy);
  color: var(--white);
}
.result-count {
  font-size: 0.8rem;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* === LEGENDE === */
.legende-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--parchment-dark);
  background: var(--white);
  color: var(--navy);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.legende-btn.active,
.legende-btn:hover { background: var(--navy); color: var(--white); border-color: var(--navy); }
.legende {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1rem 2rem;
  background: #f0f4f8;
  border-left: 3px solid var(--navy);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 0.5rem;
}
.legende-note {
  font-size: 0.8rem;
  color: var(--ink-light);
  margin-bottom: 0.6rem;
  font-style: italic;
}
.legende-liste {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.5rem;
  font-size: 0.78rem;
  color: var(--ink);
}
.legende-liste li strong { color: var(--navy); }

/* === GRILLE === */
.grid {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.2rem;
}

/* === CARTE === */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid rgba(0,0,0,0.04);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px var(--shadow-lg);
}
.card-img {
  position: relative;
  aspect-ratio: 4/3;
  background: var(--parchment-dark);
  overflow: hidden;
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .card-img img { transform: scale(1.05); }
.placeholder-img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--ink-faint);
  opacity: 0.3;
}
.card-badge {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: var(--brass);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
}
.card-num {
  position: absolute;
  bottom: 0.5rem;
  left: 0.6rem;
  background: var(--navy);
  color: var(--white);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
}
.card-body { padding: 1rem 1.1rem 1.1rem; }
.card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.3rem;
  line-height: 1.3;
}
.card-desc {
  font-size: 0.8rem;
  color: var(--ink-light);
  line-height: 1.5;
  margin-bottom: 0.6rem;
}
.card-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tag {
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.tag-cote { background: var(--brass-pale); color: var(--brass); }
.tag-fab { background: #e8f0fe; color: var(--navy); }

/* === LISTE === */
.list {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem 2rem;
}
.list-item {
  display: flex;
  gap: 1.2rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--parchment-dark);
  cursor: pointer;
  transition: background var(--transition);
}
.list-item:hover { background: rgba(196,151,59,0.03); }
.list-thumb {
  width: 90px;
  height: 68px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--parchment-dark);
}
.list-thumb img { width: 100%; height: 100%; object-fit: cover; }
.placeholder-img-sm {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--ink-faint);
  opacity: 0.3;
}
.list-info { flex: 1; min-width: 0; }
.list-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
}
.list-num {
  color: var(--brass);
  font-weight: 600;
  margin-right: 0.4rem;
}
.list-desc {
  font-size: 0.8rem;
  color: var(--ink-light);
  margin: 0.15rem 0 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* === PAS DE RESULTATS === */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--ink-faint);
  font-size: 0.95rem;
}

/* === PAGINATION === */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  padding: 1.5rem 2rem 2.5rem;
}
.page-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--parchment-dark);
  background: var(--white);
  cursor: pointer;
  font-size: 1rem;
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.page-btn:hover:not(:disabled) {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.page-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.page-info {
  font-size: 0.85rem;
  color: var(--ink-light);
  min-width: 100px;
  text-align: center;
}

/* === DETAIL VIEW === */
.detail-view {
  max-width: 750px;
  margin: 1.5rem auto;
  padding: 0 2rem 2rem;
  cursor: pointer;
}
.detail-retour {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  margin-bottom: 1.2rem;
  border: 1px solid var(--parchment-dark);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--navy);
  transition: all var(--transition);
}
.detail-retour:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.detail-inner {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(10,22,40,0.12);
  overflow: hidden;
  cursor: default;
}
.detail-gallery {
  position: relative;
  background: var(--parchment-dark);
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.detail-gallery img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.detail-body {
  padding: 1.5rem 2rem 2rem;
}
.placeholder-gallery {
  color: var(--ink-faint);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .detail-view { padding: 0 1rem 1.5rem; }
  .detail-body { padding: 1rem 1.2rem 1.5rem; }
}
.gallery-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.2);
  color: var(--white);
  font-size: 1.8rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.gallery-btn:hover { background: rgba(255,255,255,0.4); }
.gallery-btn.prev { left: 0.8rem; }
.gallery-btn.next { right: 0.8rem; }
.gallery-counter {
  position: absolute;
  bottom: 0.8rem;
  right: 0.8rem;
  background: rgba(10,22,40,0.6);
  color: var(--white);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}
.modal-body { padding: 1.5rem 2rem 2rem; }
.modal-num {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--brass);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--navy);
  margin: 0.2rem 0 1rem;
  line-height: 1.3;
}
.modal-section { margin-bottom: 1.2rem; }
.modal-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin-bottom: 0.25rem;
}
.modal-section p {
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.7;
}
.badge-mh {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.3rem 0.75rem;
  background: #b8860b;
  color: #fff;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.doc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.doc-list li { margin-bottom: 0.4rem; }
.doc-list a {
  font-size: 0.9rem;
  color: var(--navy);
  text-decoration: underline;
}
.doc-list a:hover { color: var(--midnight); }

.wp-link {
  display: inline-block;
  margin-bottom: 1.2rem;
  padding: 0.5rem 1rem;
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  font-size: 0.85rem;
  text-decoration: none;
  transition: background var(--transition);
}
.wp-link:hover { background: var(--midnight); }

.modal-meta {
  display: flex;
  gap: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--parchment-dark);
  flex-wrap: wrap;
}
.meta-item { display: flex; flex-direction: column; }
.meta-value { font-size: 0.9rem; font-weight: 500; color: var(--navy); }

/* === FOOTER === */
.site-footer {
  text-align: center;
  padding: 1.5rem 2rem;
  font-size: 0.75rem;
  color: var(--ink-faint);
  border-top: 1px solid var(--parchment-dark);
  background: var(--white);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .controls { padding: 1rem; }
  .grid { padding: 0 1rem 1.5rem; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.8rem; }
  .card-body { padding: 0.7rem 0.8rem 0.8rem; }
  .card-title { font-size: 0.95rem; }
  .card-desc { display: none; }
  .hero-carousel { height: 220px; padding: 0 1rem; }
  .modal { margin: 0.5rem; max-height: 95vh; }
  .modal-body { padding: 1rem 1.2rem 1.5rem; }
  .stats-bar { gap: 1.5rem; }
  .filter-group { width: 100%; }
  .filter-group select { flex: 1; }
}

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .hero-carousel { height: 180px; }
  .carousel-caption { font-size: 0.9rem; }
}

/* === PAGE EXPORT === */
.export-container {
  max-width: 780px;
  margin: 2rem auto;
  padding: 0 1.5rem 3rem;
  width: 100%;
}

.panel {
  background: var(--white);
  border: 2px solid var(--parchment-dark);
  border-top: 4px solid var(--navy);
  padding: 1.5rem 1.8rem;
  margin-bottom: 1.5rem;
}
.panel-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: 0.03em;
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--parchment-dark);
}

.filters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}
.filter-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.filter-label {
  font-size: 1rem;
  color: var(--ink);
  font-weight: 600;
}
.filter-row select {
  padding: 0.7rem 0.9rem;
  border: 2px solid var(--parchment-dark);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}
.filter-row select:focus { border-color: var(--navy); }
.filter-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding-top: 1.2rem;
}
.filter-item input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--navy);
  cursor: pointer;
  flex-shrink: 0;
}
.filter-item label {
  font-size: 1rem;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  font-weight: 500;
}

.counter {
  margin-top: 1.4rem;
  padding: 1rem 1.5rem;
  background: var(--brass-pale);
  border: 2px solid var(--brass);
  border-radius: 4px;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.counter-num {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1;
}
.counter-label {
  font-size: 1.05rem;
  color: var(--ink);
}

.export-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem 1.2rem;
  border: none;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.4;
  text-align: center;
}
.btn svg { flex-shrink: 0; }
.btn-pdf { background: var(--navy); color: var(--white); }
.btn-pdf:hover:not(:disabled) { background: var(--midnight); }
.btn-pdf-detail { background: var(--midnight); color: var(--white); }
.btn-pdf-detail:hover:not(:disabled) { background: #0f1530; }
.btn-excel { background: #1e7e34; color: var(--white); }
.btn-excel:hover:not(:disabled) { background: #155724; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.progress-wrap { margin-top: 1.4rem; display: none; }
.progress-wrap.visible { display: block; }
.progress-label { font-size: 1rem; color: var(--ink-light); margin-bottom: 0.5rem; }
.progress-bar-bg { height: 10px; background: var(--parchment-dark); border-radius: 4px; overflow: hidden; }
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--brass-light));
  border-radius: 4px;
  transition: width 0.2s ease;
  width: 0%;
}

.error-msg {
  display: none;
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: 4px;
  padding: 1rem 1.4rem;
  font-size: 1rem;
  color: #856404;
  margin-bottom: 1.5rem;
}
.error-msg.visible { display: block; }
.loading-state { text-align: center; padding: 3rem; color: var(--ink-faint); font-size: 1rem; }
.loading-spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--parchment-dark);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 0.8rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 620px) {
  .filters-grid { grid-template-columns: 1fr; }
  .export-grid { grid-template-columns: 1fr; }
  .export-container { padding: 0 1rem 2rem; }
  .panel { padding: 1.2rem 1.2rem; }
  .btn { font-size: 1rem; padding: 0.9rem; }
}
