:root {
  --bg: #eef5fb;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --ink: #151515;
  --muted: #5f6f80;
  --line: rgba(68, 98, 128, 0.14);
  --brand: #202020;
  --brand-dark: #0d0d0d;
  --accent: #5b7694;
  --accent-soft: #dce8f3;
  --accent-earth: #5b7694;
  --success: #2a7d4f;
  --danger: #730202;
  --shadow: 0 24px 60px rgba(58, 86, 112, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at top left, rgba(188, 214, 239, 0.5), transparent 34%),
    linear-gradient(180deg, #e6f0f8 0%, #f4f8fc 48%, #ffffff 100%);
  background-size: 120% 120%;
  animation: pageGlow 18s ease-in-out infinite alternate;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

.shell {
  width: min(1680px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 80px;
  flex: 1;
}

.hero,
.page-header,
.form-card,
.table-card,
.review-card,
.expo-card,
.stat-card,
.login-card {
  backdrop-filter: blur(12px);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero,
.page-header,
.login-card {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 32px;
  border-radius: var(--radius-xl);
}

.login-card {
  max-width: 680px;
  flex-direction: column;
}

.hero h1,
.page-header h1,
.login-card h1 {
  margin: 8px 0 12px;
  font-size: clamp(2.6rem, 4vw, 4.6rem);
  line-height: 0.95;
  max-width: 11ch;
}

.hero-copy {
  flex: 1;
  min-width: 0;
}

.hero h1 {
  max-width: none;
  font-size: clamp(2.6rem, 4vw, 4.6rem);
  white-space: nowrap;
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
}

.lede,
.section-copy {
  margin: 0;
  color: var(--muted);
  max-width: 58ch;
  line-height: 1.6;
}

.hero .lede {
  max-width: none;
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero-actions,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}

.hero-actions {
  justify-content: flex-end;
  flex: 0 0 auto;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.72;
  cursor: wait;
  transform: none;
}

.button-primary {
  background: var(--brand);
  color: white;
  box-shadow: 0 14px 28px rgba(140, 84, 35, 0.18);
}

.button-secondary {
  background: #e8f0f7;
  color: var(--ink);
}

.button-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}

.button-danger {
  background: #7b1f1f;
  color: #fff;
  box-shadow: 0 14px 28px rgba(123, 31, 31, 0.18);
}

.button-danger:hover {
  background: #681818;
}

.button-small {
  padding: 8px 12px;
  font-size: 0.88rem;
}

.stats-grid,
.cards-grid,
.review-grid,
.legal-grid {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cards-grid,
.legal-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.cards-grid-expos {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.review-grid {
  grid-template-columns: 1fr;
}

.review-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-card {
  padding: 24px;
  border-radius: var(--radius-lg);
}

.stat-card span {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
}

.stat-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.section-head {
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
}

.section-head h2,
.review-card h2 {
  margin: 8px 0 0;
  font-size: clamp(1.5rem, 2vw, 2.4rem);
}

.expo-card,
.review-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: auto;
  width: 100%;
  min-width: 0;
  background:
    linear-gradient(180deg, rgba(241, 247, 252, 0.88) 0%, rgba(255, 255, 255, 0.92) 100%);
  transition: box-shadow 240ms ease, border-color 240ms ease;
  animation: riseIn 760ms ease both;
}

.expo-card {
  aspect-ratio: auto;
  display: grid;
  grid-template-rows: auto 250px auto;
}

.expo-card-link-card {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.review-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 40px rgba(58, 86, 112, 0.14);
  border-color: rgba(91, 118, 148, 0.22);
}

.review-card-selected {
  border-color: rgba(91, 118, 148, 0.55);
  box-shadow: 0 0 0 2px rgba(91, 118, 148, 0.16), 0 22px 40px rgba(58, 86, 112, 0.14);
}

.expo-card:hover {
  box-shadow: 0 18px 34px rgba(58, 86, 112, 0.12);
  border-color: rgba(91, 118, 148, 0.18);
}

.expo-card-link-card:hover,
.expo-card-link-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 18px 34px rgba(58, 86, 112, 0.12);
  border-color: rgba(91, 118, 148, 0.24);
}

.expo-card-link-card:focus-visible {
  outline: 2px solid rgba(91, 118, 148, 0.45);
  outline-offset: 2px;
}

.expo-visual,
.review-visual {
  min-height: 250px;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: linear-gradient(180deg, rgba(227, 238, 248, 0.92) 0%, rgba(243, 248, 252, 0.96) 100%);
  display: flex;
  overflow: hidden;
}

.expo-card-top {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 22px 14px;
  background: linear-gradient(180deg, rgba(242, 247, 252, 0.98) 0%, rgba(236, 243, 250, 0.92) 100%);
}

.expo-date-banner {
  display: inline-flex;
  align-self: flex-start;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(91, 118, 148, 0.12);
  color: #2b4661;
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.expo-city-banner {
  color: #5b7694;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
}

.expo-visual img,
.review-visual img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 250px;
  object-fit: contain;
  object-position: center;
  background: transparent;
  transition: transform 220ms ease;
}

.expo-visual-button,
.review-visual-button {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  margin: 0;
  cursor: pointer;
}

.expo-visual-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.expo-visual-button:hover img,
.expo-visual-link:hover img,
.review-visual-button:hover img {
  transform: scale(1.04);
}

.expo-visual-empty,
.review-visual-empty {
  color: var(--muted);
}

.expo-visual-label,
.review-visual-label {
  color: var(--muted);
  font-size: 0.95rem;
}

.expo-body,
.review-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  overflow: visible;
  background:
    linear-gradient(180deg, rgba(247, 251, 254, 0.8) 0%, rgba(255, 255, 255, 0.9) 100%);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(110, 148, 184, 0.12);
  color: var(--accent);
  font-size: 0.9rem;
}

.pill-status {
  background: rgba(110, 148, 184, 0.16);
  color: var(--brand-dark);
}

.expo-card h3,
.review-card h3 {
  margin: 0 0 12px;
  font-size: 1.35rem;
  line-height: 1.2;
}

.expo-card h3 {
  display: block;
  overflow: visible;
  min-height: 0;
}

.expo-title-link {
  color: inherit;
  text-decoration: none;
}

.expo-title-link:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}

.expo-card p,
.review-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.expo-card > .expo-body > p,
.expo-summary {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 1rem;
  line-height: 1.55;
  min-height: calc(1rem * 1.55 * 2);
  max-height: calc(1rem * 1.55 * 2);
  text-overflow: ellipsis;
}

.expo-meta {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  font-size: 0.95rem;
}

.expo-meta div {
  display: grid;
  gap: 4px;
}

.expo-meta dt {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.expo-meta dd {
  margin: 0;
}

.link-break,
.link-break a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.expo-card .expo-meta dd,
.expo-card .expo-meta a {
  max-width: 100%;
}

.expo-card .expo-meta a {
  display: inline-block;
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
  white-space: normal;
}

.expo-detail-link {
  font-weight: 600;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.95rem;
}

.breadcrumb a {
  color: #2b4661;
  font-size: 1.08rem;
  font-weight: 800;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.22em;
}

.detail-layout {
  display: grid;
  gap: 24px;
}

.detail-header,
.detail-card,
.detail-content,
.detail-visual {
  backdrop-filter: blur(12px);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px;
}

.detail-header h1 {
  margin: 10px 0 12px;
  font-size: clamp(2.1rem, 4vw, 3.6rem);
  line-height: 1.05;
}

.detail-lede {
  margin: 0;
  max-width: 72ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.9fr);
  gap: 24px;
  align-items: start;
}

.detail-main {
  display: grid;
  gap: 24px;
}

.detail-visual {
  margin: 0;
  padding: 18px;
  background: linear-gradient(180deg, rgba(227, 238, 248, 0.92) 0%, rgba(243, 248, 252, 0.96) 100%);
}

.detail-visual img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 720px;
  object-fit: contain;
  object-position: center;
}

.detail-content,
.detail-card {
  padding: 24px 26px;
}

.detail-content h2,
.detail-card h2 {
  margin: 0 0 14px;
  font-size: 1.4rem;
}

.detail-content p {
  margin: 0;
  line-height: 1.7;
  color: var(--muted);
}

.detail-meta {
  display: grid;
  gap: 14px;
  margin: 0;
}

.detail-meta div {
  display: grid;
  gap: 4px;
}

.detail-meta dt {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.detail-meta dd {
  margin: 0;
  line-height: 1.55;
}

.action-row {
  margin-top: auto;
  padding-top: 18px;
}

.action-row-compact {
  margin-top: 0;
  padding-top: 0;
  gap: 8px;
}

.table-card,
.form-card {
  margin-top: 20px;
  padding: 16px;
  border-radius: var(--radius-lg);
}

.management-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 460px);
  gap: 24px;
  align-items: start;
}

.management-list {
  min-width: 0;
}

.management-editor {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.editor-head {
  margin-top: 0;
}

.editor-current {
  margin: 8px 0 10px;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 700;
}

.publication-preview {
  min-height: 220px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--line);
  background: linear-gradient(180deg, rgba(227, 238, 248, 0.92) 0%, rgba(243, 248, 252, 0.96) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.publication-preview::before {
  content: "Aucun visuel";
  color: var(--muted);
}

.publication-preview[data-empty="false"]::before {
  display: none;
}

.publication-preview img {
  display: none;
  width: 100%;
  height: 100%;
  max-height: 320px;
  object-fit: contain;
}

.publication-preview[data-empty="false"] img {
  display: block;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.contributor-form {
  display: grid;
  gap: 18px;
}

.contributor-form label {
  display: grid;
  gap: 8px;
}

.two-col {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(80, 47, 19, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px 16px;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.checkbox {
  grid-template-columns: auto 1fr;
  align-items: start;
}

.checkbox input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
}

.input-hint {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.form-feedback {
  margin: 0;
  min-height: 1.4em;
  color: var(--success);
}

.form-feedback[data-state="error"] {
  color: var(--danger);
}

.empty-card .review-body {
  padding: 28px 22px;
}

.site-footer {
  padding: 18px 24px 28px;
  color: var(--muted);
}

.site-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-top: 0;
  padding-bottom: 0;
}

.site-footer a {
  color: inherit;
  font-size: 0.95rem;
}

.site-footer a:hover {
  text-decoration: underline;
}

.image-modal[hidden] {
  display: none;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.image-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 12, 9, 0.7);
}

.image-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(96vw, 1500px);
  max-height: calc(100vh - 20px);
  margin: 10px auto;
  padding: 10px;
  border-radius: var(--radius-lg);
  background: rgba(247, 251, 254, 0.94);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0;
}

.image-modal-dialog img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 60px);
  margin: 0 auto;
  object-fit: contain;
  background: transparent;
  border-radius: var(--radius-md);
}

.image-modal-close {
  align-self: flex-end;
}

.modal-expo-meta h3 {
  margin: 0 0 10px;
  font-size: 1.9rem;
}

.modal-expo-meta p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 900px) {
  .hero,
  .page-header,
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats-grid,
  .cards-grid,
  .two-col,
  .legal-grid,
  .review-grid.compact {
    grid-template-columns: 1fr;
  }

  .management-layout {
    grid-template-columns: 1fr;
  }

  .management-editor {
    position: static;
  }

  .cards-grid.cards-grid-expos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .expo-card {
    min-height: 0;
    grid-template-rows: auto 120px auto;
  }

  .expo-visual,
  .review-visual {
    height: 100%;
    min-height: 120px;
    padding: 8px;
  }

  .expo-visual img,
  .review-visual img {
    max-height: 120px;
  }

  .expo-card-top {
    gap: 6px;
    padding: 10px 10px 8px;
  }

  .expo-date-banner {
    padding: 6px 9px;
    font-size: 0.72rem;
    line-height: 1.25;
  }

  .expo-city-banner {
    font-size: 0.74rem;
  }

  .expo-body,
  .review-body {
    padding: 10px;
  }

  .expo-card h3 {
    font-size: 0.88rem;
    line-height: 1.15;
    margin-bottom: 8px;
  }

  .expo-card > .expo-body > p,
  .expo-summary {
    font-size: 0.76rem;
    line-height: 1.35;
    min-height: calc(0.76rem * 1.35 * 2);
    max-height: calc(0.76rem * 1.35 * 2);
  }

  .expo-meta {
    display: none;
  }

  .site-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1400px) {
  .shell {
    width: min(1280px, calc(100% - 32px));
  }

  .cards-grid-expos {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  .shell {
    width: min(1040px, calc(100% - 28px));
    padding: 24px 0 72px;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
  }

  .section-head h2,
  .review-card h2 {
    font-size: clamp(1.35rem, 2.4vw, 2rem);
  }

  .cards-grid-expos {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .hero h1 {
    white-space: normal;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100%, calc(100% - 24px));
    padding: 18px 0 56px;
  }

  .hero,
  .page-header,
  .login-card,
  .form-card,
  .table-card {
    padding: 20px;
  }

  .hero h1,
  .page-header h1,
  .login-card h1 {
    font-size: clamp(2rem, 9vw, 2.9rem);
  }

  .hero .lede {
    font-size: 0.98rem;
  }

  .section-head {
    margin-top: 28px;
  }

  .section-head h2,
  .review-card h2 {
    font-size: clamp(1.25rem, 7vw, 1.8rem);
  }

  .cards-grid.cards-grid-expos {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .expo-card {
    grid-template-rows: auto 110px auto;
    min-width: 0;
  }

  .expo-card-top {
    gap: 6px;
    padding: 10px 10px 8px;
  }

  .expo-date-banner {
    padding: 6px 9px;
    font-size: 0.72rem;
    line-height: 1.25;
  }

  .expo-city-banner {
    font-size: 0.74rem;
  }

  .expo-visual,
  .review-visual {
    min-height: 110px;
    padding: 8px;
  }

  .expo-visual img,
  .review-visual img {
    max-height: 110px;
  }

  .expo-body,
  .review-body {
    padding: 10px;
  }

  .expo-card .expo-body,
  .expo-card h3,
  .expo-card > .expo-body > p,
  .expo-summary {
    width: 100%;
    max-width: none;
    align-self: stretch;
  }

  .expo-card h3 {
    font-size: 0.88rem;
    line-height: 1.15;
    margin-bottom: 8px;
  }

  .expo-card > .expo-body > p,
  .expo-summary {
    display: block;
    font-size: 0.76rem;
    line-height: 1.35;
    min-height: calc(0.76rem * 1.35 * 3);
    max-height: calc(0.76rem * 1.35 * 3);
    overflow: hidden;
  }

  .expo-meta {
    display: grid;
    gap: 4px;
    margin-top: 8px;
    font-size: 0.72rem;
  }

  .expo-meta dt {
    display: none;
  }

  .expo-meta dd {
    line-height: 1.3;
    color: var(--muted);
  }

  .detail-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .detail-header > div:first-child,
  .detail-main,
  .detail-content,
  .detail-card,
  .detail-aside {
    width: 100%;
    min-width: 0;
  }

  .detail-header .hero-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .detail-header .button {
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }

  .detail-lede,
  .detail-content p {
    width: 100%;
    max-width: none;
  }

  .detail-content p {
    overflow-wrap: anywhere;
  }

  .detail-header,
  .detail-content,
  .detail-card {
    padding: 20px;
  }

  .image-modal-dialog {
    width: min(100vw - 16px, 1500px);
    margin: 8px auto;
    padding: 8px;
  }

  .image-modal-dialog img {
    max-height: calc(100vh - 52px);
  }
}
