/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Montserrat:wght@300;400;500;600&display=swap');

:root {
  --c-bg: #f5f2ed;
  --c-surface: #ffffff;
  --c-text: #3a3533;
  --c-text-light: #7e7872;
  --c-primary: #8b2942;
  --c-primary-hover: #6d1f33;
  --c-danger: #b33;
  --c-danger-hover: #922;
  --c-border: #d5d0c9;
  --c-accent: #e8e3db;
  --c-sidebar-bg: #3d1520;
  --c-sidebar-text: #e8ddd0;
  --c-sidebar-border: #5a2535;
  --c-sidebar-active-bg: #4e1f2e;
  --sidebar-width: 280px;
  --c-primary-faint: rgba(139,41,66,0.10);
  --c-gold-line: rgba(139,41,66,0.25);
  --radius: 4px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --font-display: 'Cormorant Garamond', Georgia, serif;
}

body {
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--c-bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  color: var(--c-text);
  line-height: 1.6;
  font-weight: 300;
}

a { color: var(--c-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--c-primary-hover); }

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

/* ===== Page Shell — Sidebar + Main ===== */
.page-shell {
  display: flex;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--c-sidebar-bg);
  color: var(--c-sidebar-text);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border-right: 4px solid var(--c-sidebar-border);
}

.sidebar-header {
  border-bottom: 4px solid var(--c-sidebar-border);
  background: var(--c-sidebar-bg);
}
.sidebar-logo {
  padding: 2rem 1.25rem 1.25rem;
  text-align: center;
}
.sidebar-logo img {
  max-width: 180px;
  margin: 0 auto;
}
.sidebar-logo a:hover { text-decoration: none; }
.mobile-menu-toggle { display: none; }

.sidebar-nav {
  flex: 1;
  padding: 1.25rem 0 0.5rem;
}

/* Nav tree */
.nav-tree {
  list-style: none;
  padding: 0;
  margin: 0;
}
.nav-tree-item > a {
  display: flex;
  align-items: center;
  padding: 0.45rem 1.25rem;
  color: var(--c-sidebar-text);
  font-size: 0.95rem;
  font-weight: 300;
  border-left: 3px solid transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.nav-tree-item > a:hover {
  background: rgba(255,255,255,0.06);
  color: #f0d0a0;
  text-decoration: none;
}
.nav-tree-item > a.active {
  background: var(--c-sidebar-active-bg);
  border-left-color: #f0d0a0;
  font-weight: 400;
  color: #f0d0a0;
}
.nav-chevron {
  margin-left: auto;
  font-size: 0.85rem;
  opacity: 0.4;
  display: inline-block;
  transition: transform 0.25s ease;
}
.nav-chevron.open {
  transform: rotate(90deg);
}
.nav-tree-children {
  list-style: none;
  padding-left: 1rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.25s ease;
  opacity: 0;
}
.nav-tree-children.expanded {
  max-height: 500px;
  opacity: 1;
}
.nav-tree-children a {
  font-size: 0.88rem;
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
  color: rgba(232,221,208,0.65);
}
.nav-tree-children a:hover {
  color: var(--c-sidebar-text);
}
.nav-tree-children a.active {
  color: #f0d0a0;
}

/* Sidebar footer */
.sidebar-footer {
  padding: 1rem 1.25rem;
  font-size: 0.75rem;
  color: rgba(232,221,208,0.45);
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: auto;
}
.sidebar-footer p { margin-bottom: 0.15rem; }
.sidebar-footer a { color: rgba(232,221,208,0.65); }
.sidebar-footer a:hover { color: #f0d0a0; }

/* ===== Language Switcher (top-right of main content) ===== */
.lang-switcher {
  position: absolute;
  top: 10px;
  right: 20px;
  display: flex;
  gap: 0.75rem;
  z-index: 50;
}
.lang-switcher a {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--c-text-light);
}
.lang-switcher a.active {
  color: var(--c-primary);
  text-decoration: underline;
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  position: relative;
  padding: 2.5rem;
  max-width: none;
  min-width: 0;
  margin: 0 auto;
}
.main-content-home {
  max-width: none;
  padding: 0;
}
.main-content-home .lang-switcher a {
  color: var(--c-text);
}
.main-content-home .lang-switcher a.active {
  color: var(--c-primary);
}

/* ===== Home Hero ===== */
.home-hero {
  height: 100vh;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.05) 0%,
    rgba(0,0,0,0.02) 40%,
    rgba(0,0,0,0.25) 75%,
    rgba(0,0,0,0.5) 100%
  );
  pointer-events: none;
}
.home-overlay {
  text-align: center;
  color: #fff;
  padding: 2rem 3rem;
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.home-overlay h1 {
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 400;
  letter-spacing: 3px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
  margin-bottom: 0.75rem;
}
.home-overlay h4 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  font-style: italic;
  text-shadow: 0 1px 12px rgba(0,0,0,0.5);
  opacity: 0.9;
  letter-spacing: 1px;
}

/* News card on homepage */
.news-card {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: flex-start;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  text-align: left;
  max-width: 360px;
  align-self: flex-start;
  animation: news-fade-in 0.8s ease both;
  animation-delay: 1.5s;
  transition: background 0.2s, border-color 0.2s;
}
.news-card-label {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.55);
  width: 100%;
}
.news-card:hover {
  background: rgba(0,0,0,0.55);
  border-color: rgba(255,255,255,0.25);
  text-decoration: none;
}
.news-card-image {
  width: 110px;
  min-width: 110px;
  border-radius: 4px;
  overflow: hidden;
}
.news-card-image img {
  width: 100%;
  height: 80px;
  object-fit: cover;
}
.news-card-body h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: #fff;
}
.news-card-body p {
  font-size: 0.85rem;
  line-height: 1.5;
  color: rgba(255,255,255,0.8);
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card-body a,
.news-card-body span {
  font-size: 0.8rem;
  color: #fff;
  font-weight: 500;
}
@keyframes news-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  color: var(--c-text);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 400;
  text-align: center;
}
.btn:hover { background: #f5f5f5; text-decoration: none; }
.btn-sm { padding: 0.25rem 0.6rem; font-size: 0.8rem; }
.btn-primary {
  background: var(--c-primary);
  color: white;
  border-color: var(--c-primary);
}
.btn-primary:hover { background: var(--c-primary-hover); }
.btn-danger {
  background: var(--c-danger);
  color: white;
  border-color: var(--c-danger);
}
.btn-danger:hover { background: var(--c-danger-hover); }

/* ===== Loading & Error ===== */
.loading { text-align: center; padding: 2rem; color: var(--c-text-light); }
.toast {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  padding: 0.6rem 1.25rem;
  background: #2e7d32;
  color: white;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-size: 0.95rem;
  font-weight: 400;
  z-index: 900;
  animation: toast-in 0.25s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.error-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #fde8e8;
  border: 1px solid #f5c6c6;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  color: var(--c-danger);
}
.error-banner button {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--c-danger);
}
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--c-text-light);
  font-style: italic;
}

/* ===== Public Content Rendering ===== */
.article-page h1 {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 400;
  margin-bottom: 2rem;
  text-align: center;
  color: var(--c-text);
  letter-spacing: 1px;
}
.article-page h1::after {
  content: "";
  display: block;
  width: 60px;
  height: 2px;
  background: var(--c-primary);
  margin: 0.75rem auto 0;
}
.article-banner {
  margin: -2.5rem -2.5rem 1.5rem;
  overflow: hidden;
  max-height: 400px;
}
.article-banner img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  display: block;
}
.article-content {
  max-width: 1060px;
  margin: 0 auto;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.article-content::after {
  content: "";
  display: block;
  clear: both;
}
.content-text p {
  margin-bottom: 1.15rem;
  line-height: 1.75;
}
.content-text:first-child p:first-child::first-letter {
  font-family: var(--font-display);
  font-size: 3.4em;
  float: left;
  line-height: 0.8;
  padding-right: 0.08em;
  padding-top: 0.05em;
  color: var(--c-primary);
  font-weight: 600;
}
/* Timeline */
.content-timeline {
  border-left: 2px solid var(--c-gold-line);
  margin-left: 0.5rem;
  padding-left: 0;
}
.timeline-entry {
  display: flex;
  gap: 1rem;
  padding: 0.6rem 0 0.6rem 1.25rem;
  position: relative;
  line-height: 1.6;
}
.timeline-entry::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.95rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-primary);
}
.timeline-year {
  font-weight: 500;
  color: var(--c-primary);
  min-width: 6.5rem;
  flex-shrink: 0;
  white-space: nowrap;
}
.timeline-desc {
  color: var(--c-text);
}

.content-heading {
  font-family: var(--font-display);
  margin: 2.5rem 0 1.25rem;
  font-weight: 500;
  color: var(--c-primary);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--c-gold-line);
  clear: both;
  letter-spacing: 0.5px;
}

/* Figures with float */
.content-figure {
  margin: 1.25rem 0;
  clear: both;
}
.content-figure:not(.figure-left):not(.figure-right) {
  padding-top: 1.5rem;
}
.content-figure:not(.figure-left):not(.figure-right) img {
  margin: 0 auto;
}
.content-figure:not(.figure-left):not(.figure-right) {
  text-align: center;
}
.content-figure:not(.figure-left):not(.figure-right) figcaption {
  display: inline-block;
}
.content-figure img {
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.content-figure figcaption {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--c-text-light);
  margin-top: 0.5rem;
  font-style: italic;
  padding-left: 0.6rem;
  border-left: 2px solid var(--c-gold-line);
}
.content-figure.figure-left,
.content-figure.figure-right {
  max-width: 38%;
}
.content-figure.figure-left img,
.content-figure.figure-right img {
  max-height: 360px;
  object-fit: cover;
}
.content-figure.figure-left {
  float: left;
  margin: 0.25em 2rem 0.75rem 0;
}
.content-figure.figure-right {
  float: right;
  margin: 0.25em 0 0.75rem 2rem;
}

/* Image rows (side by side — like .ba in Grav) */
.content-image-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin: 1.5rem 0;
  clear: both;
}
.content-image-row .image-row-item {
  flex: 0 1 calc(50% - 1rem);
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.content-image-row.cols-3 .image-row-item {
  flex-basis: calc(33.333% - 1.4rem);
}
.content-image-row.cols-4 .image-row-item {
  flex-basis: calc(25% - 1.5rem);
}
.content-image-row img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.content-image-row figcaption {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--c-text-light);
  margin-top: 0.5rem;
  font-style: italic;
  padding-left: 0.6rem;
  border-left: 2px solid var(--c-gold-line);
}

/* File download links */
.content-file {
  margin: 0.75rem 0;
}
.content-file a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  background: var(--c-accent);
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.content-file a:hover { text-decoration: none; opacity: 0.8; }

/* Hero page type */
.hero-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #555;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}
.hero-overlay {
  text-align: center;
  color: white;
  padding: 3rem;
  width: 100%;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.hero-title {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 400;
  letter-spacing: 2px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

/* Gallery page content */
.gallery-page h1 { font-family: var(--font-display); margin-bottom: 1.5rem; font-weight: 400; letter-spacing: 1px; }
.gallery-page-content h1 { font-family: var(--font-display); margin-bottom: 1.5rem; font-weight: 400; letter-spacing: 1px; }

/* Gallery search */
.gallery-search { margin-bottom: 1rem; }
.gallery-search-input {
  width: 100%;
  padding: 0.6rem 1rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--c-surface);
}
.gallery-search-input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 2px rgba(139,41,66,0.2);
}

/* Gallery tag filter */
.gallery-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}
.gallery-tags .tag-chip.active {
  background: var(--c-primary);
  color: white;
}

/* Actualités feature card */
/* ===== Actualités Feed ===== */
.actualites-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}
.actualites-feed-item {
  display: flex;
  background: var(--c-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  color: var(--c-text);
  transition: transform 0.15s, box-shadow 0.15s;
}
.actualites-feed-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  text-decoration: none;
}
.actualites-feed-image {
  width: 200px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--c-accent);
}
.actualites-feed-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.actualites-feed-info {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.actualites-feed-info h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}
.actualites-feed-info p {
  font-size: 0.9rem;
  color: var(--c-text-light);
  margin-bottom: 0.25rem;
}
.actualites-feed-info .photo-count {
  font-size: 0.85rem;
  color: var(--c-text-light);
}

/* ===== Gallery — Album Grid ===== */
.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.album-card {
  background: var(--c-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
  color: var(--c-text);
}
.album-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  text-decoration: none;
}
.album-card-image { aspect-ratio: 4/3; overflow: hidden; background: var(--c-accent); }
.album-card-image img { width: 100%; height: 100%; object-fit: cover; }
.album-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 3rem;
  opacity: 0.3;
}
.album-card-info { padding: 0.75rem 1rem; }
.album-card-info h3 { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 0.25rem; font-weight: 500; }
.photo-count { font-size: 0.85rem; color: var(--c-text-light); }

/* ===== Album View — Photo Grid ===== */
.album-header { margin-bottom: 1.5rem; }
.album-header h1 { font-family: var(--font-display); margin-top: 0.5rem; font-weight: 400; letter-spacing: 1px; }
.album-description { color: var(--c-text-light); margin-top: 0.5rem; }
.album-header .album-tags { margin-top: 0.5rem; }
.back-link { font-size: 0.9rem; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}
.photo-card {
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--c-surface);
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}
.photo-card:hover { transform: scale(1.02); }
.photo-card img { aspect-ratio: 4/3; width: 100%; object-fit: cover; }
.photo-caption {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--c-text-light);
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  text-align: center;
}
.lightbox-content img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  margin: 0 auto;
}
.lightbox-close {
  position: absolute;
  top: -3rem;
  right: 0;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
}
.lightbox-caption { font-family: var(--font-display); font-style: italic; color: #ccc; margin-top: 0.75rem; font-size: 1.05rem; }
.lightbox-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-top: 1rem;
  color: #ccc;
}
.lightbox-prev, .lightbox-next {
  background: none;
  border: none;
  color: white;
  font-size: 1rem;
  cursor: pointer;
}
.lightbox-prev:hover, .lightbox-next:hover { color: #fff; }

/* ===== Admin ===== */
.admin-page { }
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.admin-header h1 { flex: 1; font-weight: 400; }
.admin-header-actions { display: flex; gap: 0.5rem; }
.btn-preview.active {
  background: var(--c-primary);
  color: white;
  border-color: var(--c-primary);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--c-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.admin-table th, .admin-table td {
  padding: 0.75rem 1rem;
  text-align: left;
}
.admin-table tr { border-bottom: 1px solid var(--c-border); }
.admin-table tr:last-child { border-bottom: none; }
.admin-table th {
  background: var(--c-accent);
  font-weight: 500;
  font-size: 0.9rem;
}
.admin-table td:nth-child(2) { width: 5rem; text-align: center; }
.admin-table td:nth-child(3) { white-space: nowrap; }
.admin-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }

/* ===== Page Tree (admin) ===== */
.page-tree {
  background: var(--c-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.page-tree-item {
  border-bottom: 1px solid var(--c-border);
  cursor: grab;
  transition: opacity 0.2s;
}
.page-tree-item:last-child { border-bottom: none; }
.page-tree-item.dragging { opacity: 0.4; }
.page-tree-row {
  display: flex;
  align-items: center;
  padding: 0.6rem 0.75rem;
  gap: 0.75rem;
}
.page-tree-drag {
  color: var(--c-text-light);
  font-size: 1rem;
  cursor: grab;
  user-select: none;
}
.page-tree-title { flex: 1; font-weight: 400; }
.page-tree-type {
  font-size: 0.8rem;
  color: var(--c-text-light);
  padding: 0.15rem 0.5rem;
  background: var(--c-accent);
  border-radius: 4px;
}
.page-tree-actions { display: flex; gap: 0.4rem; }
.page-tree-hint {
  font-size: 0.8rem;
  color: var(--c-text-light);
  font-style: italic;
}
.page-tree-children { border-top: 1px solid var(--c-border); }
.page-tree-children .page-tree-item { border-bottom: 1px solid rgba(0,0,0,0.05); }

/* ===== Forms ===== */
.album-form { max-width: 600px; }
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
  font-size: 0.9rem;
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--c-surface);
}
.form-group textarea { min-height: 80px; resize: vertical; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 2px rgba(139,41,66,0.2);
}
.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  width: auto;
  cursor: pointer;
}
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.form-row { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.form-row input { flex: 1; }

/* ===== Upload Section ===== */
.upload-section {
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--c-surface);
  border: 2px dashed var(--c-border);
  border-radius: var(--radius);
}
.upload-section h3 { margin-bottom: 0.75rem; font-weight: 400; }
.uploading { margin-left: 0.75rem; color: var(--c-text-light); }
.upload-progress {
  display: inline-block;
  margin-left: 0.75rem;
  color: var(--c-text-light);
  font-size: 0.9rem;
}
.upload-toast {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: var(--radius);
  color: #2e7d32;
  font-size: 0.9rem;
}

/* ===== Admin Photo Grid ===== */
.drag-hint {
  font-size: 0.85rem;
  color: var(--c-text-light);
  margin: 0.75rem 0;
}
.admin-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.admin-photo-card {
  background: var(--c-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: grab;
  transition: opacity 0.2s;
}
.admin-photo-card.dragging { opacity: 0.4; }
.admin-photo-card img { aspect-ratio: 4/3; width: 100%; object-fit: cover; }
.photo-info { padding: 0.75rem; }
.photo-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.cover-badge {
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  background: var(--c-accent);
  border-radius: 4px;
  color: var(--c-text-light);
}

/* ===== Caption Edit ===== */
.caption-display { cursor: pointer; font-size: 0.85rem; min-height: 1.5em; }
.caption-placeholder { color: var(--c-text-light); font-style: italic; }
.caption-edit { display: flex; flex-direction: column; gap: 0.4rem; }

/* ===== Snapshots ===== */
.snapshot-create {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.5rem;
}
.snapshot-label-input {
  flex: 1;
  max-width: 350px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
}
.snapshot-label-input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 2px rgba(139,41,66,0.2);
}
.snapshot-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.snapshot-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--c-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.snapshot-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.snapshot-date {
  font-size: 0.9rem;
  color: var(--c-text);
}
.snapshot-label {
  font-size: 0.8rem;
  color: var(--c-text-light);
  font-style: italic;
}
.snapshot-actions {
  display: flex;
  gap: 0.5rem;
}
.caption-edit input {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  font-size: 0.85rem;
}
.caption-actions { display: flex; gap: 0.4rem; }

/* ===== Block Editor ===== */
.block-list h3 { margin-bottom: 0.75rem; font-weight: 400; }
.block-wrapper {
  margin-bottom: 0.75rem;
  cursor: grab;
  transition: opacity 0.2s;
}
.block-wrapper.dragging { opacity: 0.4; }
.block-editor {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 0.75rem;
}
.block-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.block-type-badge {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  background: var(--c-accent);
  border-radius: 4px;
  color: var(--c-text-light);
}
.block-header .btn-danger { margin-left: auto; }
.block-header select {
  padding: 0.2rem 0.4rem;
  font-size: 0.8rem;
  border: 1px solid var(--c-border);
  border-radius: 4px;
}
.block-editor .form-group { margin-bottom: 0.5rem; }
.block-editor .form-group label { font-size: 0.8rem; }
.block-editor textarea {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
}
.block-editor input[type="text"] {
  width: 100%;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--c-border);
  border-radius: 4px;
  font-size: 0.9rem;
}
.block-image-preview { margin: 0.5rem 0; }
.block-image-preview img { max-height: 200px; border-radius: var(--radius); }
.block-image-upload { margin: 0.5rem 0; }
.block-file-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
  font-size: 0.9rem;
}
.image-row-preview {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.5rem 0;
}
.image-row-thumb { position: relative; width: 120px; }
.image-row-thumb img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 4px;
}
.image-row-thumb .btn-danger {
  position: absolute;
  top: 2px;
  right: 2px;
  padding: 0 0.3rem;
  font-size: 0.7rem;
}
.hero-preview { margin: 0.5rem 0; }
.hero-preview img { max-height: 200px; border-radius: var(--radius); margin-bottom: 0.5rem; }
.add-block-section { margin-top: 1rem; }
.add-block-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.75rem;
  background: var(--c-surface);
  border: 2px dashed var(--c-border);
  border-radius: var(--radius);
}

/* ===== Actualités Card ===== */
.actualites-card {
  background: var(--c-surface);
  border: 2px solid var(--c-primary);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.actualites-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.actualites-header h2 {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--c-primary);
}
.archive-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--c-border);
}
.archive-form h3 {
  font-weight: 400;
  margin-bottom: 0.75rem;
}

/* ===== Tag Chips ===== */
.tag-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}
.tag-chip {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: var(--c-accent);
  border-radius: 12px;
  font-size: 0.8rem;
  color: var(--c-text-light);
  cursor: pointer;
  transition: background 0.15s;
}
.tag-chip:hover {
  background: var(--c-primary);
  color: white;
}
.album-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}
.album-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  background: var(--c-accent);
  border-radius: 12px;
  font-size: 0.8rem;
  color: var(--c-text-light);
}

/* ===== Login Page ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-bg);
}
.login-card {
  background: var(--c-surface);
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 380px;
  text-align: center;
}
.login-logo {
  margin-bottom: 1.5rem;
}
.login-logo img {
  max-width: 160px;
  margin: 0 auto;
}
.login-card h1 {
  font-size: 1.4rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  color: var(--c-text);
}
.login-card .form-group {
  text-align: left;
}
.login-error {
  padding: 0.5rem 0.75rem;
  background: #fde8e8;
  border: 1px solid #f5c6c6;
  border-radius: var(--radius);
  color: var(--c-danger);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* ===== HR ===== */
hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 1.5rem 0;
}

/* ===== Map ===== */
.content-map {
  height: 400px;
  border-radius: var(--radius);
  margin: 1.5rem 0;
  box-shadow: var(--shadow);
  z-index: 0;
}

/* ===== Analytics ===== */
.analytics-period { display: flex; gap: 0.35rem; }
.analytics-content { display: flex; flex-direction: column; gap: 1.5rem; }
.analytics-summary { display: flex; gap: 1rem; }
.analytics-stat-card {
  background: var(--c-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  text-align: center;
}
.analytics-stat-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 500;
  color: var(--c-primary);
}
.analytics-stat-label {
  font-size: 0.85rem;
  color: var(--c-text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.analytics-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 200px;
  padding: 0.5rem 0;
  background: var(--c-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  overflow-x: auto;
}
.analytics-bar-col {
  flex: 1;
  min-width: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  height: 100%;
}
.analytics-bar-value {
  font-size: 0.65rem;
  color: var(--c-text-light);
  min-height: 1em;
}
.analytics-bar-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
}
.analytics-bar {
  width: 100%;
  background: var(--c-primary);
  border-radius: 2px 2px 0 0;
  min-height: 1px;
  transition: height 0.3s;
}
.analytics-bar-label {
  font-size: 0.55rem;
  color: var(--c-text-light);
  white-space: nowrap;
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  height: 3.5rem;
  overflow: hidden;
}
.analytics-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--c-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.analytics-table th, .analytics-table td {
  padding: 0.6rem 1rem;
  text-align: left;
}
.analytics-table tr { border-bottom: 1px solid var(--c-border); }
.analytics-table tr:last-child { border-bottom: none; }
.analytics-table th {
  background: var(--c-accent);
  font-weight: 500;
  font-size: 0.85rem;
}
.analytics-count { text-align: right; font-weight: 500; }
.analytics-langs {
  background: var(--c-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.analytics-lang-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.analytics-lang-name {
  min-width: 5.5rem;
  font-size: 0.85rem;
  font-weight: 500;
}
.analytics-lang-bar-track {
  flex: 1;
  height: 1.1rem;
  background: var(--c-accent);
  border-radius: 3px;
  overflow: hidden;
}
.analytics-lang-bar {
  height: 100%;
  background: var(--c-primary);
  border-radius: 3px;
  transition: width 0.3s;
}
.analytics-lang-pct {
  min-width: 5rem;
  font-size: 0.8rem;
  color: var(--c-text-light);
  text-align: right;
}

/* ===== Tablet ===== */
@media (min-width: 769px) and (max-width: 1024px) {
  .album-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .page-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: none;
  }
  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    border-bottom: 4px solid var(--c-sidebar-border);
  }
  .sidebar-logo { padding: 0.75rem 0; }
  .sidebar-logo img { max-width: 180px; }
  .mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--c-sidebar-text);
    cursor: pointer;
    padding: 0.5rem;
  }
  .sidebar-nav {
    display: none;
    padding: 0.25rem 0;
    border-bottom: 4px solid var(--c-sidebar-border);
  }
  .sidebar-nav.mobile-open { display: block; }
  .nav-tree-item > a { padding: 0.5rem 1.25rem; font-size: 1rem; }
  .sidebar-footer { display: none; }
  .main-content { padding: 1.5rem; margin: 0; width: 100%; }
  .main-content-home { padding: 0; }
  .article-banner { margin: -1.5rem -1.5rem 1rem; max-height: 250px; }
  .article-banner img { height: 250px; }
  .lang-switcher { top: 5px; right: 10px; }
  .album-grid { grid-template-columns: 1fr; }
  .actualites-feed-item { flex-direction: column; }
  .actualites-feed-image { width: 100%; aspect-ratio: 16/9; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .admin-photo-grid { grid-template-columns: 1fr; }
  .admin-header { flex-direction: column; align-items: flex-start; }
  .content-figure.figure-left,
  .content-figure.figure-right {
    float: none;
    max-width: 100%;
    margin: 1rem 0;
  }
  .content-image-row { flex-direction: column; }
  .timeline-entry { flex-direction: column; gap: 0.15rem; }
  .timeline-year { min-width: auto; }
  .form-row { flex-direction: column; }
  .home-overlay { padding: 1.5rem 1.5rem 2.5rem; }
  .home-overlay h1 { font-size: 2.4rem; letter-spacing: 2px; }
  .home-overlay h4 { font-size: 1.1rem; }
  .news-card { flex-direction: column; max-width: 100%; align-self: center; }
  .news-card-image { width: 100%; min-width: 100%; }
  .news-card-image img { height: 100px; }
}
