:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #64706d;
  --soft: #f4f1e8;
  --paper: #fffdf7;
  --line: #e4decd;
  --green: #0f3f34;
  --green-2: #14604d;
  --gold: #b9944c;
  --gold-soft: #e6d7ae;
  --night: #10233b;
  --white: #ffffff;
  --shadow: 0 22px 70px rgba(23, 33, 31, 0.13);
  --radius: 8px;
  font-family: "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

/* L'attribut hidden doit toujours masquer l'élément, y compris quand une
   classe utilitaire (ex. .button, .portal-camera) impose son propre
   display : sans ce !important, ces classes (origine "author") l'emportent
   sur la règle native [hidden] { display: none } (origine "user agent"). */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(185, 148, 76, 0.08), transparent 32rem),
    var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    linear-gradient(30deg, rgba(15, 63, 52, 0.05) 12%, transparent 12.5%, transparent 87%, rgba(15, 63, 52, 0.05) 87.5%, rgba(15, 63, 52, 0.05)),
    linear-gradient(150deg, rgba(15, 63, 52, 0.05) 12%, transparent 12.5%, transparent 87%, rgba(15, 63, 52, 0.05) 87.5%, rgba(15, 63, 52, 0.05));
  background-size: 42px 72px;
}

a {
  color: var(--green-2);
  text-decoration: none;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  background: var(--green);
  color: var(--white);
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 1rem;
}

.container,
.public-nav,
.footer-inner {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 253, 247, 0.92);
  border-bottom: 1px solid rgba(228, 222, 205, 0.78);
  backdrop-filter: blur(18px);
}

.public-nav {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.brand-logo {
  width: 46px;
  height: auto;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.15;
}

.brand strong {
  font-size: 1.5rem;
}

.brand small {
  max-width: 13rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.nav-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.nav-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.nav-button span,
.nav-button span::before,
.nav-button span::after {
  width: 18px;
  height: 2px;
  display: block;
  background: var(--green);
  content: "";
}

.nav-button span::before {
  transform: translateY(-6px);
}

.nav-button span::after {
  transform: translateY(4px);
}

.nav-links {
  position: absolute;
  top: 72px;
  left: 1rem;
  right: 1rem;
  display: none;
  padding: 0.75rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.nav-toggle:checked ~ .nav-links {
  display: grid;
}

.nav-links a,
.nav-links button.nav-admin {
  padding: 0.85rem 0.9rem;
  color: var(--green-2);
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
}

.nav-links a:hover,
.nav-links button.nav-admin:hover {
  background: rgba(15, 63, 52, 0.07);
}

/* Le bouton "Déconnexion" (pèlerin connecté) remplace le lien "Espace
   organisateur" : display:contents laisse le <button> se comporter comme un
   enfant direct de .nav-links (même flex/grid que les <a> voisins). */
.nav-admin-form {
  display: contents;
}

.nav-links button.nav-admin {
  font: inherit;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
}

.nav-admin {
  color: var(--green-2) !important;
}

.nav-portal {
  background: var(--green-2);
  color: var(--white) !important;
  border: 1px solid var(--green-2);
  box-shadow: 0 10px 24px rgba(15, 63, 52, 0.22);
}

.nav-portal:hover {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 12px 28px rgba(15, 63, 52, 0.3);
}

/* Bouton rond flottant "Espace pèlerin", toujours visible (voir base.html),
   même couleur que .nav-portal — juste une présentation différente. */
.pilgrim-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 30;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green-2);
  color: var(--white);
  box-shadow: 0 14px 34px rgba(15, 63, 52, 0.35);
  transition: transform 0.2s ease, background 0.2s ease;
}

.pilgrim-fab:hover {
  background: var(--green);
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(15, 63, 52, 0.4);
}

.hero-section {
  position: relative;
  min-height: calc(100svh - 72px);
  display: grid;
  align-items: end;
  isolation: isolate;
  overflow: hidden;
  background: var(--green);
  color: var(--white);
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-media img,
.hero-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-section::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(15, 63, 52, 0.18), rgba(15, 63, 52, 0.88)),
    linear-gradient(90deg, rgba(16, 35, 59, 0.7), transparent 68%);
}

.hero-content {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 7rem 0 3rem;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--gold);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero-eyebrow {
  font-size: clamp(1rem, 3.6vw, 1.5rem);
  letter-spacing: 0.16em;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

.hero-content h1,
.page-hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(40px, 150px, 91px); /*clamp(2.55rem, 11vw, 5.7rem);*/
  line-height: 0.96;
  letter-spacing: 0;
}

/* Titre de la page d'accueil uniquement (pas .page-hero, utilisé par
   d'autres pages) : la version desktop ci-dessus reste inchangée, ce
   titre est simplement trop grand sur petit écran. */
@media (max-width: 699px) {
  .hero-content h1 {
    font-size: clamp(1.8rem, 8vw, 2.5rem);
  }
}

.hero-lead {
  max-width: 620px;
  margin: 1.3rem 0 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1.02rem, 4vw, 1.35rem);
}

.hero-actions,
.cta-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
}

.hero-cta {
  margin-top: 1.4rem;
}

.hero-actions {
  margin-top: 1.6rem;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
}

.button-primary {
  background: var(--gold);
  color: #17120a;
}

/* CTA pèlerin de la page d'accueil : doit se démarquer nettement des
   autres actions (plus grand, ombre marquée, couleur pleine). */
.button-cta {
  min-height: 56px;
  padding: 0.95rem 1.75rem;
  background: var(--green-2);
  color: var(--white);
  font-size: 1.05rem;
  box-shadow: 0 14px 34px rgba(15, 63, 52, 0.35);
}

.button-cta:hover {
  background: var(--green);
}

.button-light {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.32);
}

.section-band,
.content-section,
.cta-section {
  padding: 4rem 0;
}

.section-band {
  background: var(--soft);
}

.section-heading {
  max-width: 680px;
  margin-bottom: 1.6rem;
}

.section-heading.centered {
  margin-inline: auto;
  text-align: center;
}

.section-heading h2,
.cta-inner h2 {
  margin: 0;
  color: var(--green);
  font-size: clamp(1.85rem, 7vw, 3.25rem);
  line-height: 1.03;
  letter-spacing: 0;
}

.section-heading p:not(.eyebrow),
.cta-inner p {
  color: var(--muted);
}

.feature-grid {
  display: grid;
  gap: 0.9rem;
}

.delegate-feature {
  display: grid;
  gap: 1.1rem;
  align-items: center;
  margin: 0 0 1.1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.82);
  box-shadow: 0 12px 38px rgba(23, 33, 31, 0.06);
}

.delegate-feature img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  object-fit: cover;
  object-position: center top;
}

.delegate-feature h3 {
  margin: 0;
  color: var(--green);
  font-size: clamp(1.45rem, 6vw, 2.3rem);
  line-height: 1.08;
}

.delegate-feature p:last-child {
  margin: 0.85rem 0 0;
  color: var(--muted);
}

.feature-card,
.structure-card,
.structure-accordion,
.legal-summary,
.legal-content,
.search-panel,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.82);
  box-shadow: 0 12px 38px rgba(23, 33, 31, 0.06);
}

.feature-card {
  padding: 1.25rem;
}

.feature-number {
  color: var(--gold);
  font-weight: 800;
}

.feature-card h3,
.timeline-list h3,
.structure-card h2,
.legal-content h2 {
  margin: 0.35rem 0 0.4rem;
  color: var(--green);
  font-size: 1.1rem;
}

.feature-card p,
.timeline-list p,
.structure-card p,
.legal-content p {
  margin: 0;
  color: var(--muted);
}

.two-column,
.two-column-reverse,
.legal-layout,
.structures-layout {
  display: grid;
  gap: 1.5rem;
}

.timeline-list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-list li {
  position: relative;
  padding: 1.1rem 1.1rem 1.1rem 3.1rem;
  border-left: 2px solid var(--gold);
  background: linear-gradient(90deg, rgba(185, 148, 76, 0.09), transparent);
}

.timeline-list li::before {
  content: counter(list-item);
  position: absolute;
  left: 0.9rem;
  top: 1.05rem;
  width: 1.5rem;
  height: 1.5rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: var(--gold-soft);
  font-size: 0.75rem;
  font-weight: 700;
}

.muted-section {
  background: #f8f6ee;
}

/* --- Bloc image + texte détaillé (ex. étapes des démarches) --- */

.content-image {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  align-self: start;
}

.content-copy h3 {
  margin: 2rem 0 0.75rem;
  color: var(--green);
  font-size: 1.2rem;
}

.content-copy h3:first-child {
  margin-top: 0;
}

.content-copy p {
  margin: 0 0 1rem;
}

.content-copy ol,
.content-copy ul {
  margin: 0 0 1.5rem;
  padding-left: 0;
  list-style: none;
}

.content-copy li {
  position: relative;
  margin-bottom: 0.5rem;
}

.content-copy li:last-child {
  margin-bottom: 0;
}

/* Étapes numérotées de premier niveau (badge rond, voir plus bas) : sous-
   listes à puces exclues via l'enfant direct ">" pour ne pas hériter du
   padding/badge pensé pour les grands numéros. */
.content-copy ol > li {
  padding-left: 2.75rem;
  min-height: 1.7rem;
  margin-bottom: 0.75rem;
}

.content-copy ol > li::before {
  content: counter(list-item);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.7rem;
  height: 1.7rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--night);
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 6px 14px rgba(16, 35, 59, 0.3);
}

/* Sous-titre d'une étape numérotée (ex. "Tawaf al-Qudum...") suivi de sa
   propre liste à puces. */
.content-copy ol > li > strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--ink);
}

.content-copy ol > li > ul {
  margin: 0;
}

/* Listes à puces (Ziarras, piliers, types de Hajj...) : puce discrète plutôt
   que le badge rond, réservé aux étapes numérotées de premier niveau. */
.content-copy ul > li {
  padding-left: 1.35rem;
}

.content-copy ul > li::before {
  content: "●";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--gold);
  font-size: 1.6rem;
  line-height: 1;
}

.calendar-list {
  max-width: 820px;
  display: grid;
  gap: 0.85rem;
  margin: 0 auto 1rem;
}

.calendar-list article {
  display: grid;
  gap: 0.45rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.82);
  box-shadow: 0 12px 38px rgba(23, 33, 31, 0.05);
}

.calendar-list time {
  color: var(--green);
  font-weight: 800;
}

.calendar-list p {
  margin: 0;
  color: var(--muted);
}

.cta-section {
  background: var(--green);
  color: var(--white);
}

.cta-inner {
  justify-content: space-between;
}

.cta-inner h2 {
  color: var(--white);
}

.cta-inner p {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.75);
}

.page-hero {
  background: var(--green);
  color: var(--white);
}

.compact-hero {
  padding: 4rem 0 3rem;
  background:
    linear-gradient(135deg, rgba(185, 148, 76, 0.16), transparent 24rem),
    var(--green);
}

.compact-hero p:not(.eyebrow) {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.78);
}

.legal-summary {
  padding: 1.1rem;
  height: fit-content;
  background: var(--green);
  color: var(--white);
}

.legal-summary p {
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.72);
}

.legal-content {
  padding: 1.2rem;
}

.legal-content h2 + p {
  margin-top: 0.35rem;
}

.legal-content h2:not(:first-child) {
  margin-top: 1.6rem;
}

.search-panel {
  position: sticky;
  top: 88px;
  z-index: 2;
  padding: 1rem;
}

.search-panel label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--green);
  font-weight: 700;
}

.search-panel input {
  width: 100%;
  min-height: 48px;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  font: inherit;
}

.search-panel input:focus {
  outline: 3px solid rgba(185, 148, 76, 0.25);
  border-color: var(--gold);
}

.search-count {
  min-height: 1.4rem;
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.structure-list {
  display: grid;
  gap: 0.9rem;
}

.structure-card {
  padding: 1.1rem;
}

.structure-card[hidden] {
  display: none;
}

.structure-main h2 {
  margin-top: 0.2rem;
}

.structure-id {
  color: var(--gold);
  font-size: 0.78em;
  font-weight: 800;
}

.structure-main {
  display: flex;
  flex-direction: column;
}

.structure-details {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 0;
}

.structure-main-details {
  margin-top: 1.5rem;
}

.structure-details div {
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   Accordéon des structures (page publique) : seuls #id + nom sont visibles
   fermé, tout le reste (représentant, WhatsApp, regroupement...) n'apparaît
   qu'au clic sur le <summary>. Classes dédiées pour ne pas perturber
   .structure-card, réutilisée telle quelle par le choix de structure de
   l'espace pèlerin (clic sur toute la card pour sélectionner, sans repli).
   -------------------------------------------------------------------------- */

.structure-accordion {
  padding: 0;
  overflow: hidden;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.structure-accordion[hidden] {
  display: none;
}

.structure-accordion[open] {
  background: rgba(185, 148, 76, 0.09);
  border-color: var(--gold);
}

.structure-accordion-summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.1rem;
  color: var(--green);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.structure-accordion-summary::-webkit-details-marker {
  display: none;
}

.structure-accordion-summary::after {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  margin-left: auto;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.structure-accordion[open] .structure-accordion-summary::after {
  transform: rotate(-135deg);
}

.structure-accordion-summary:hover {
  background: rgba(15, 63, 52, 0.05);
}

.structure-accordion-name {
  overflow-wrap: anywhere;
}

.structure-accordion-body {
  padding: 0 1.1rem 1.1rem;
}

.structure-accordion-body p {
  margin: 0;
  color: var(--muted);
}

.structure-details dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.structure-details dd {
  margin: 0.1rem 0 0;
  font-weight: 600;
}

.muted-text {
  color: var(--muted);
  font-weight: 400;
}

.empty-state {
  padding: 2rem 1rem;
  text-align: center;
}

.site-footer {
  padding: 2rem 0;
  background: #101b1a;
  color: rgba(255, 255, 255, 0.78);
}

.footer-inner {
  display: grid;
  gap: 1.2rem;
}

.footer-inner strong {
  color: var(--white);
}

.footer-inner p {
  margin: 0.25rem 0 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.82);
}

.footer-copy {
  color: rgba(255, 255, 255, 0.55);
}

@media (min-width: 700px) {
  .container,
  .public-nav,
  .footer-inner,
  .hero-content {
    width: min(1120px, calc(100% - 3rem));
  }

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

  .delegate-feature {
    grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
    gap: 1.4rem;
    padding: 1.2rem;
  }

  .structure-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.8fr);
    gap: 1.5rem;
  }

  .structure-card .structure-details {
    margin: 0;
  }

  .structure-card .structure-main-details {
    margin-top: auto;
  }
}

@media (min-width: 960px) {
  .nav-button {
    display: none;
  }

  .nav-links {
    position: static;
    display: flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .nav-links a,
  .nav-links button.nav-admin {
    padding: 0.55rem 0.7rem;
    font-size: 0.92rem;
  }

  .nav-admin {
    border: 1px solid var(--line);
    background: var(--white);
  }

  .nav-portal {
    padding-inline: 0.95rem;
  }

  .hero-content {
    padding-bottom: 5rem;
  }

  .two-column,
  .legal-layout,
  .structures-layout {
    grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
    align-items: start;
  }

  /* Même formule que .two-column ci-dessus (donc même largeur d'image),
     colonnes inversées : texte à gauche (large), image à droite (étroite). */
  .two-column-reverse {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.42fr);
  }

  .sticky-heading {
    position: sticky;
    top: 104px;
  }

  .legal-content {
    padding: 2rem;
  }

  .footer-inner {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
  }
}

@media (max-width: 420px) {
  .brand small {
    display: none;
  }

  .hero-actions .button,
  .cta-inner .button {
    width: 100%;
  }
}
