/* Aït El Mansour — styles principaux */
:root {
  --color-bg: #faf7f2;
  --color-surface: #ffffff;
  --color-text: #1c1917;
  --color-muted: #57534e;
  --color-accent: #b45309;
  --color-accent-dark: #92400e;
  --color-teal: #0f766e;
  --color-teal-dark: #115e59;
  --color-border: #e7e5e4;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(28, 25, 23, 0.08);
  --shadow-hover: 0 12px 40px rgba(28, 25, 23, 0.12);
  --header-h: 72px;
  --max: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  background-image:
    linear-gradient(135deg, rgba(180, 83, 9, 0.04) 0%, transparent 50%),
    linear-gradient(225deg, rgba(15, 118, 110, 0.05) 0%, transparent 45%);
  min-height: 100vh;
}

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

a {
  color: var(--color-teal-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-accent);
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
}

.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.logo span {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--font-body);
  color: var(--color-muted);
  letter-spacing: 0;
}

/* Accueil — titre du site plus lisible en haut à gauche */
.page-home {
  --header-h: 88px;
}

.page-home .site-header {
  height: auto;
  min-height: var(--header-h);
}

.page-home .site-header .inner {
  min-height: calc(var(--header-h) - 4px);
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.page-home .logo {
  font-size: clamp(1.35rem, 3.2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.page-home .logo span {
  font-size: clamp(0.82rem, 1.8vw, 1rem);
  font-weight: 600;
  color: var(--color-muted);
  margin-top: 0.2rem;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--color-text);
}

.nav-toggle .bar {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  margin: 6px 0;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle[aria-expanded="true"] .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.nav-list {
  display: flex;
  gap: 0.25rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav-list a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* Hero */
.hero {
  padding: 3rem 0 4rem;
}

.hero-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr 1.05fr;
    gap: 3rem;
  }
}

.hero-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-teal-dark);
  background: rgba(15, 118, 110, 0.12);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.hero-lead {
  font-size: 1.125rem;
  color: var(--color-muted);
  margin: 0 0 1.75rem;
  max-width: 38ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75rem 1.35rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:focus-visible {
  outline: 2px solid var(--color-teal);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(160deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
  color: #fff;
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 2px solid var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.hero-visual {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-hover);
  aspect-ratio: 4 / 3;
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(180, 83, 9, 0.15) 0%,
    transparent 40%,
    rgba(15, 118, 110, 0.12) 100%
  );
  pointer-events: none;
}

/* Éditions */
.edition-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.edition-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  margin: 0;
}

.edition-title sup {
  font-size: 0.55em;
}

.edition-desc {
  max-width: 65ch;
  margin: 0 0 1.75rem;
  color: var(--color-muted);
  font-size: 1.05rem;
}

/* Projet */
.projet-h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.projet-subtitle {
  font-size: 1.05rem;
  color: var(--color-teal-dark);
  font-weight: 600;
  margin: 0 0 1.5rem;
}

@media (min-width: 640px) {
  .cards--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .cards--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Mosaic strip decoration */
.mosaic-strip {
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    #c2410c 0px,
    #c2410c 12px,
    #ea580c 12px,
    #ea580c 24px,
    #0d9488 24px,
    #0d9488 36px,
    #fbbf24 36px,
    #fbbf24 48px
  );
  opacity: 0.85;
}

/* Sections */
.section {
  padding: 3.5rem 0;
}

.section-alt {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 2.5rem;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.section-head p {
  margin: 0;
  color: var(--color-muted);
}

/* Cards */
.cards {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}

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

.card-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
}

.card p {
  margin: 0;
  font-size: 0.98rem;
  color: var(--color-muted);
}

/* Gallery */
.gallery {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
  .gallery {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

.gallery-thumb {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: block;
  width: 100%;
  background: var(--color-border);
}

.gallery-thumb:hover,
.gallery-thumb:focus-visible {
  transform: scale(1.02);
  box-shadow: var(--shadow-hover);
  outline: none;
}

.gallery-thumb:focus-visible {
  outline: 2px solid var(--color-teal);
  outline-offset: 3px;
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  vertical-align: middle;
}

/* Event highlight */
.event-banner {
  background: linear-gradient(135deg, var(--color-teal-dark) 0%, #134e4a 100%);
  color: #ecfdf5;
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: grid;
  gap: 1.5rem;
  box-shadow: var(--shadow-hover);
}

@media (min-width: 768px) {
  .event-banner {
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 2.5rem;
  }
}

.event-banner h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin: 0 0 0.5rem;
  color: #fff;
}

.event-banner .dates {
  font-size: 1.125rem;
  font-weight: 700;
  color: #fde68a;
  margin-bottom: 0.75rem;
}

.event-banner ul {
  margin: 0;
  padding-left: 1.25rem;
}

.event-banner li {
  margin-bottom: 0.35rem;
}

.event-banner .meta {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-top: 1rem;
}

.event-banner .btn {
  align-self: start;
}

/* Page hero small */
.page-hero {
  padding: 2.5rem 0 2rem;
  text-align: center;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  margin: 0 0 0.75rem;
}

.page-hero p {
  margin: 0 auto;
  max-width: 52ch;
  color: var(--color-muted);
}

/* Contact */
.contact-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.contact-card {
  background: var(--color-surface);
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.contact-card h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0 0 1rem;
}

.contact-location-inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .contact-location-inner {
    flex-direction: row;
    align-items: stretch;
    gap: 1.5rem;
  }

  .contact-location-text {
    flex: 0 1 40%;
    min-width: 0;
  }

  .contact-location-aside {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }
}

.contact-card--location .contact-list {
  margin-bottom: 0;
}

.contact-location-aside .contact-map {
  flex: 1 1 auto;
  min-height: 200px;
}

.contact-map {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 10;
  min-height: 200px;
  max-height: 280px;
}

@media (min-width: 640px) {
  .contact-card--location .contact-map {
    max-height: none;
    min-height: 220px;
    aspect-ratio: 4 / 3;
  }
}

.contact-map iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.contact-map-link {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.contact-list li {
  margin-bottom: 0.75rem;
  padding-left: 0;
}

.contact-list strong {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  margin-bottom: 0.25rem;
}

/* Page Histoire */
.history-prose {
  max-width: 70ch;
}

.history-prose p {
  margin: 0 0 1.1rem;
  color: var(--color-text);
}

.history-prose p:last-child {
  margin-bottom: 0;
}

.history-h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--color-text);
}

.history-lead {
  font-size: 0.98rem;
  color: var(--color-muted);
  margin-bottom: 1.25rem !important;
}

.history-timeline {
  margin: 0;
  padding-left: 1.35rem;
}

.history-timeline li {
  margin-bottom: 1.15rem;
}

.history-timeline li:last-child {
  margin-bottom: 0;
}

.history-timeline strong {
  color: var(--color-teal-dark);
}

.sources-intro {
  font-size: 0.95rem;
  color: var(--color-muted);
  margin: 0 0 1.25rem;
  max-width: 65ch;
}

.sources-list {
  margin: 0;
  padding-left: 1.5rem;
  max-width: 75ch;
}

.sources-list li {
  margin-bottom: 1rem;
  padding-left: 0.35rem;
  line-height: 1.55;
}

.sources-list li::marker {
  font-weight: 700;
  color: var(--color-accent);
}

.sources-list a {
  word-break: break-word;
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding: 2.5rem 0;
  background: #292524;
  color: #e7e5e4;
}

.site-footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  text-align: center;
}

@media (min-width: 640px) {
  .site-footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.site-footer .logo {
  color: #fafaf9;
}

.site-footer .logo span {
  color: #a8a29e;
}

.site-footer .hashtags {
  font-size: 0.85rem;
  color: #a8a29e;
}

.site-footer a {
  color: #fde68a;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(28, 25, 23, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: min(100%, 1200px);
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

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

/* Responsive nav */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s, opacity 0.25s, visibility 0.25s;
  }

  .nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-list a {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
