/* ── COMPOSANTS — ACP ─────────────────────────────────────────────────────── */

/* ── BOUTONS ──────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.625rem 1.25rem;
  border-radius: var(--r-md);
  font-family: var(--font-corps);
  font-size: var(--t-sm);
  font-weight: 600;
  line-height: 1;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--t-fast) var(--ease), transform var(--t-fast), box-shadow var(--t-fast);
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--rouge);
  color: #fff;
  box-shadow: 0 2px 8px rgba(139,26,26,0.3);
}
.btn-primary:hover {
  background: var(--rouge-dark);
  color: #fff;
  box-shadow: 0 4px 16px rgba(139,26,26,0.4);
}

.btn-secondary {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.6);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: #fff;
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--rouge);
  border: 1.5px solid var(--rouge);
}
.btn-outline:hover {
  background: var(--rouge);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--texte);
}
.btn-ghost:hover { background: var(--fond-alt); }

.btn-or {
  background: var(--or);
  color: #fff;
  box-shadow: 0 2px 8px rgba(200,150,42,0.3);
}
.btn-or:hover { background: var(--or-light); color: #fff; }

.btn-sm  { padding: 0.4rem 0.875rem; font-size: var(--t-xs); }
.btn-lg  { padding: 0.875rem 1.75rem; font-size: var(--t-base); }
.btn-xl  { padding: 1rem 2rem; font-size: var(--t-lg); border-radius: var(--r-lg); }

.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--r-md); }

/* ── TAGS / BADGES ────────────────────────────────────────────────────────── */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tag-rouge    { background: var(--rouge-pale); color: var(--rouge); }
.tag-vert     { background: var(--vert-pale);  color: var(--vert-dark); }
.tag-or       { background: var(--or-pale);    color: #7A5A10; }
.tag-muted    { background: var(--fond-alt);   color: var(--muted); border: 1px solid var(--bordure); }
.tag-visite   { background: #EBF2FF; color: #2458B0; }
.tag-conférence { background: var(--rouge-pale); color: var(--rouge); }
.tag-voyage   { background: #F0EBF8; color: #6A3A8C; }

/* ── CARTES ÉVÉNEMENT ─────────────────────────────────────────────────────── */

.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--sp-6);
}

.event-card {
  background: #fff;
  border: 1px solid var(--bordure);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  gap: 0;
  transition: box-shadow var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}

.event-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.event-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  background: var(--rouge);
  color: #fff;
  padding: var(--sp-4) var(--sp-3);
  text-align: center;
}

.event-date .day {
  font-family: var(--font-titre);
  font-size: var(--t-3xl);
  font-weight: 700;
  line-height: 1;
}

.event-date .month {
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 2px;
  opacity: 0.85;
}

.event-body {
  padding: var(--sp-4) var(--sp-5);
  flex: 1;
  min-width: 0;
}

.event-body .tag { margin-bottom: var(--sp-2); }

.event-title {
  font-family: var(--font-titre);
  font-size: var(--t-lg);
  font-weight: 600;
  color: var(--sombre);
  margin-bottom: var(--sp-2);
  line-height: 1.3;
}

.event-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--t-sm);
  color: var(--muted);
}

.event-meta span { display: flex; align-items: center; gap: 6px; }
.event-meta i { font-size: 14px; color: var(--rouge); opacity: 0.7; }

.event-cost {
  margin-top: var(--sp-3);
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--vert-dark);
  background: var(--vert-pale);
  padding: 3px 10px;
  border-radius: var(--r-full);
  display: inline-block;
}

/* ── CARTES GALERIE ───────────────────────────────────────────────────────── */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-5);
}

.gallery-card {
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--sombre);
  position: relative;
  cursor: pointer;
  aspect-ratio: 4/3;
  transition: box-shadow var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}

.gallery-card:hover { box-shadow: var(--shadow-xl); transform: scale(1.02); }

.gallery-card img,
.gallery-card .gallery-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2C1810, #4A2828);
}

.gallery-placeholder i { font-size: 48px; color: rgba(255,255,255,0.15); }

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 50%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--sp-5);
  transition: background var(--t-base) var(--ease);
}

.gallery-card:hover .gallery-overlay {
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 60%);
}

.gallery-title {
  font-family: var(--font-titre);
  font-size: var(--t-lg);
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin-bottom: var(--sp-1);
}

.gallery-count {
  font-size: var(--t-xs);
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.05em;
}

/* ── CARTES CHRONIQUE ─────────────────────────────────────────────────────── */

.chronicles-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.chronicle-card {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  background: #fff;
  border: 1px solid var(--bordure);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-6);
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--t-base), transform var(--t-base), border-color var(--t-base);
}

.chronicle-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
  border-color: var(--rouge);
  text-decoration: none;
  color: inherit;
}

.chronicle-num {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  background: var(--rouge-pale);
  color: var(--rouge);
  font-family: var(--font-titre);
  font-weight: 700;
  font-size: var(--t-xl);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chronicle-body { flex: 1; min-width: 0; }

.chronicle-title {
  font-family: var(--font-titre);
  font-size: var(--t-lg);
  font-weight: 600;
  color: var(--sombre);
  margin-bottom: var(--sp-1);
  line-height: 1.3;
}

.chronicle-meta {
  font-size: var(--t-sm);
  color: var(--muted);
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.chronicle-tags {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-top: var(--sp-2);
}

.chronicle-arrow {
  color: var(--bordure-md);
  font-size: 20px;
  transition: color var(--t-fast), transform var(--t-fast);
}

.chronicle-card:hover .chronicle-arrow {
  color: var(--rouge);
  transform: translateX(3px);
}

/* ── CARTES ACTUALITÉ ─────────────────────────────────────────────────────── */

.news-card {
  background: #fff;
  border: 1px solid var(--bordure);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: box-shadow var(--t-base), transform var(--t-base);
}

.news-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

.news-image {
  aspect-ratio: 16/9;
  background: var(--parchemin-dark);
  overflow: hidden;
}

.news-image img { width: 100%; height: 100%; object-fit: cover; }

.news-body { padding: var(--sp-5); }
.news-date { font-size: var(--t-xs); color: var(--muted); margin-bottom: var(--sp-2); }
.news-title { font-family: var(--font-titre); font-size: var(--t-xl); font-weight: 700; color: var(--sombre); margin-bottom: var(--sp-3); line-height: 1.3; }
.news-excerpt { font-size: var(--t-sm); color: var(--muted); line-height: 1.65; }

/* ── DOSSIERS RECHERCHE ───────────────────────────────────────────────────── */

.dossier-card {
  border-radius: var(--r-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--bordure);
  transition: box-shadow var(--t-base), transform var(--t-base);
}

.dossier-card:hover { box-shadow: var(--shadow-xl); transform: translateY(-4px); }

.dossier-header {
  padding: var(--sp-8);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.dossier-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: rgba(255,255,255,0.9);
  margin-bottom: var(--sp-2);
}

.dossier-title {
  font-family: var(--font-titre);
  font-size: var(--t-2xl);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.dossier-period { font-size: var(--t-sm); color: rgba(255,255,255,0.65); font-weight: 600; letter-spacing: 0.05em; }
.dossier-desc { font-size: var(--t-sm); color: rgba(255,255,255,0.75); line-height: 1.65; }

.dossier-body { padding: var(--sp-6); background: #fff; flex: 1; }

.pub-item {
  border-bottom: 1px solid var(--bordure);
  padding: var(--sp-4) 0;
}

.pub-item:last-child { border-bottom: none; }

.pub-num { font-size: var(--t-xs); color: var(--muted); margin-bottom: var(--sp-1); }
.pub-title { font-family: var(--font-titre); font-size: var(--t-base); font-weight: 600; color: var(--sombre); margin-bottom: var(--sp-2); }
.pub-abs { font-size: var(--t-sm); color: var(--muted); line-height: 1.6; margin-bottom: var(--sp-3); }

.pub-tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-3); }

.pub-actions { display: flex; gap: var(--sp-2); align-items: center; }
.pub-size { font-size: var(--t-xs); color: var(--leger); margin-left: auto; }

/* ── LIGHTBOX ─────────────────────────────────────────────────────────────── */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-base) var(--ease);
}

.lightbox-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--r-md);
  transition: opacity var(--t-fast);
}

.lightbox-caption {
  position: absolute;
  bottom: var(--sp-6);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.75);
  font-size: var(--t-sm);
  text-align: center;
  max-width: 600px;
}

.lightbox-close {
  position: absolute;
  top: var(--sp-5);
  right: var(--sp-5);
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--t-fast);
}

.lightbox-close:hover { background: rgba(255,255,255,0.2); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--t-fast);
}

.lightbox-nav:hover { background: rgba(255,255,255,0.25); }
.lightbox-prev { left: var(--sp-5); }
.lightbox-next { right: var(--sp-5); }

.lightbox-counter {
  position: absolute;
  top: var(--sp-5);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.5);
  font-size: var(--t-sm);
}

/* ── FORMULAIRES ──────────────────────────────────────────────────────────── */

.form-group { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-5); }

label {
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--texte);
}

.form-control {
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--bordure-md);
  border-radius: var(--r-md);
  font-family: var(--font-corps);
  font-size: var(--t-base);
  color: var(--texte);
  background: #fff;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  width: 100%;
}

.form-control:focus {
  outline: none;
  border-color: var(--rouge);
  box-shadow: 0 0 0 3px rgba(139,26,26,0.12);
}

textarea.form-control { resize: vertical; min-height: 120px; line-height: 1.65; }
select.form-control { cursor: pointer; }

.form-hint { font-size: var(--t-xs); color: var(--muted); }

/* ── BARRE DE RECHERCHE ───────────────────────────────────────────────────── */

.search-bar {
  position: relative;
  max-width: 480px;
}

.search-bar input {
  padding-left: 2.75rem;
  padding-right: 3rem;
  border-radius: var(--r-full);
  background: var(--fond-alt);
  border-color: var(--bordure);
}

.search-bar .search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 18px;
  pointer-events: none;
}

.search-bar .search-clear {
  position: absolute;
  right: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  display: none;
}

.search-bar input:not(:placeholder-shown) + .search-icon + .search-clear,
.search-bar input:not(:placeholder-shown) ~ .search-clear { display: block; }

/* ── FILTRES ──────────────────────────────────────────────────────────────── */

.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-8);
}

.filter-btn {
  padding: 6px 16px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--bordure-md);
  background: #fff;
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--t-fast);
}

.filter-btn:hover { border-color: var(--rouge); color: var(--rouge); }
.filter-btn.active { background: var(--rouge); border-color: var(--rouge); color: #fff; }

/* ── DOCUMENT CARD ────────────────────────────────────────────────────────── */

.doc-card {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  background: #fff;
  border: 1px solid var(--bordure);
  border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5);
  transition: box-shadow var(--t-base), border-color var(--t-base);
}

.doc-card:hover { box-shadow: var(--shadow-md); border-color: var(--bordure-md); }

.doc-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  background: #FFF0F0;
  color: var(--rouge);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doc-body { flex: 1; min-width: 0; }
.doc-title { font-weight: 600; color: var(--sombre); font-size: var(--t-base); }
.doc-meta  { font-size: var(--t-xs); color: var(--muted); margin-top: 2px; }

/* ── PAGINATION ───────────────────────────────────────────────────────────── */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: var(--sp-10);
}

.pagination a, .pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--texte);
  text-decoration: none;
  border: 1px solid var(--bordure);
  transition: all var(--t-fast);
}

.pagination a:hover { border-color: var(--rouge); color: var(--rouge); text-decoration: none; }
.pagination .current { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.pagination .ellipsis { border: none; color: var(--muted); }

/* ── ALERTE / NOTICE ──────────────────────────────────────────────────────── */

.alert {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-md);
  font-size: var(--t-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
}

.alert i { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-info    { background: #EBF2FF; border: 1px solid #93B9F0; color: #1A4FA0; }
.alert-success { background: var(--vert-pale); border: 1px solid #7BC09A; color: var(--vert-dark); }
.alert-warn    { background: var(--or-pale); border: 1px solid #E0C060; color: #7A5A10; }
.alert-error   { background: var(--rouge-pale); border: 1px solid #D08080; color: var(--rouge-dark); }

/* ── SPINNER ──────────────────────────────────────────────────────────────── */

@keyframes spin { to { transform: rotate(360deg); } }

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--bordure);
  border-top-color: var(--rouge);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: var(--sp-8) auto;
}

/* ── EMPTY STATE ──────────────────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: var(--sp-16) var(--sp-8);
  color: var(--muted);
}

.empty-state i { font-size: 48px; opacity: 0.3; margin-bottom: var(--sp-4); display: block; }
.empty-state h3 { font-size: var(--t-xl); color: var(--texte); margin-bottom: var(--sp-2); }
.empty-state p  { font-size: var(--t-sm); }

/* ── CARD GÉNÉRIQUE ───────────────────────────────────────────────────────── */

.card {
  background: #fff;
  border: 1px solid var(--bordure);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
}

.card-title {
  font-family: var(--font-titre);
  font-size: var(--t-xl);
  font-weight: 700;
  color: var(--sombre);
  margin-bottom: var(--sp-4);
}

/* ── CONTENU RICHE (HTML depuis DB) ──────────────────────────────────────── */

.prose h2 { font-size: var(--t-2xl); margin-top: var(--sp-8); margin-bottom: var(--sp-4); }
.prose h3 { font-size: var(--t-xl); margin-top: var(--sp-6); margin-bottom: var(--sp-3); }
.prose p  { margin-bottom: var(--sp-4); line-height: 1.75; }
.prose ul, .prose ol { padding-left: var(--sp-6); margin-bottom: var(--sp-4); }
.prose li { margin-bottom: var(--sp-2); line-height: 1.65; }
.prose a  { color: var(--rouge); text-decoration: underline; }
.prose strong { font-weight: 700; }
.prose blockquote {
  border-left: 4px solid var(--or);
  padding-left: var(--sp-5);
  color: var(--muted);
  font-style: italic;
  margin: var(--sp-6) 0;
}

/* ── RESPONSIVE ───────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .events-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .chronicle-card { flex-wrap: wrap; }
  .lightbox-nav { width: 40px; height: 40px; font-size: 18px; }
  .filter-bar { gap: var(--sp-2); }
}
