/* ============================================================
   VOCATIONS — Local multifonctions Mimosas
   Section "vocations" de l'accueil + pages projet /projets/<id>/
   S'appuie sur menu.css (tokens, .btn, .section-title) et
   index.css (.home-contact-band, .home-tour-modal)
   ============================================================ */

:root {
  /* .section-kicker (index.css) référence --gold, jamais défini dans menu.css :
     sans cette valeur le kicker hérite simplement de la couleur du texte. */
  --gold: #C15A00;

  --voc-hotel: #00AEEF;
  --voc-hotel-deep: #007FB0;
  --voc-sante: #E91E8C;
  --voc-sante-deep: #B01268;
  --voc-scolaire: #E8890C;
  --voc-scolaire-deep: #B06400;
  --voc-bureaux: #0097A7;
  --voc-bureaux-deep: #00707C;
}

/* ===== BANDEAU "UN SEUL LOCAL, PLUSIEURS VOCATIONS" ===== */
.local-band {
  background: var(--sand);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: clamp(2.6rem, 5vw, 4rem) 1.5rem;
}

.local-band-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(1.6rem, 4vw, 3.4rem);
  align-items: center;
}

.local-band h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3.2vw, 2.15rem);
  line-height: 1.2;
  color: var(--charcoal);
  margin-bottom: .85rem;
}

html[dir=rtl] .local-band h2 { font-family: var(--font-arabic); }

.local-band p {
  color: var(--muted);
  font-size: clamp(.95rem, 1.6vw, 1.03rem);
  max-width: 56ch;
}

.local-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.local-fact {
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.local-fact-value {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  font-weight: 700;
  color: var(--ocean-deep);
  line-height: 1.1;
}

html[dir=rtl] .local-fact-value { font-family: var(--font-arabic); }

.local-fact-label {
  font-size: .78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: .3rem;
}

/* ===== GRILLE DES VOCATIONS ===== */
.vocations-section {
  padding: clamp(3rem, 6vw, 4.8rem) 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.vocations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 258px), 1fr));
  gap: 1.3rem;
}

.vocation-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform .25s ease, box-shadow .25s ease;
}

@media (hover: hover) {
  .vocation-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
  }
  .vocation-card:hover .vocation-card-media img { transform: scale(1.06); }
}

.vocation-card:focus-visible {
  outline: 3px solid var(--ocean);
  outline-offset: 3px;
}

.vocation-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--charcoal);
}

.vocation-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .6s ease;
}

.vocation-card-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(9, 20, 33, .68) 0%, rgba(9, 20, 33, .12) 52%, transparent 100%);
}

.vocation-card-tag {
  position: absolute;
  top: .8rem;
  inset-inline-start: .8rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: .38rem;
  padding: .32rem .72rem;
  border-radius: 30px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: white;
  background: var(--voc-accent, #00AEEF);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
}

.vocation-card-title {
  position: absolute;
  inset-inline: 1rem;
  bottom: .85rem;
  z-index: 2;
  font-family: var(--font-serif);
  font-size: 1.24rem;
  font-weight: 700;
  color: white;
  line-height: 1.22;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .5);
}

html[dir=rtl] .vocation-card-title { font-family: var(--font-arabic); }

.vocation-card-body {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  flex: 1;
}

.vocation-card-desc {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
}

.vocation-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.vocation-chip {
  font-size: .74rem;
  font-weight: 600;
  padding: .26rem .62rem;
  border-radius: 20px;
  background: var(--sand);
  color: var(--muted);
  border: 1px solid var(--border-subtle);
}

.vocation-card-cta {
  font-size: .85rem;
  font-weight: 700;
  color: var(--voc-accent, #008CC8);
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.vocation-card.is-current {
  border-color: var(--voc-accent, #00AEEF);
  box-shadow: 0 0 0 2px rgba(0, 174, 239, .28), var(--shadow);
}

/* ===== HERO DES PAGES VOCATION ===== */
.vocation-hero {
  position: relative;
  min-height: min(620px, calc(100vh - 92px));
  display: flex;
  align-items: flex-end;
  padding: clamp(4rem, 10vw, 7rem) 1.5rem clamp(2.6rem, 5vw, 4rem);
  background: var(--charcoal);
  color: white;
  overflow: hidden;
}

.vocation-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.vocation-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vocation-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(8, 18, 30, .92) 0%, rgba(8, 18, 30, .58) 44%, rgba(8, 18, 30, .30) 100%),
    linear-gradient(100deg, var(--voc-tint, rgba(0, 174, 239, .34)) 0%, transparent 62%);
}

.vocation-hero-content {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.vocation-kicker {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .38rem .9rem;
  border-radius: 30px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .26);
  backdrop-filter: blur(6px);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.vocation-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5.4vw, 3.4rem);
  line-height: 1.08;
  font-weight: 700;
  margin-bottom: .9rem;
  max-width: 20ch;
  text-shadow: 0 3px 22px rgba(0, 0, 0, .38);
}

html[dir=rtl] .vocation-hero h1 { font-family: var(--font-arabic); }

.vocation-hero h1 em {
  font-style: italic;
  color: var(--voc-accent-light, #7FD9F7);
}

.vocation-hero-lead {
  font-size: clamp(1rem, 2vw, 1.16rem);
  max-width: 60ch;
  color: rgba(255, 255, 255, .92);
  margin-bottom: 1.6rem;
}

.vocation-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
}

.vocation-hero-actions .btn-primary {
  background: var(--voc-accent, #00AEEF);
}

@media (hover: hover) {
  .vocation-hero-actions .btn-primary:hover {
    background: var(--voc-accent-deep, #008CC8);
  }
}

/* ===== CONCEPT + CHIFFRES ===== */
.vocation-concept {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 4.6rem) 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(1.8rem, 4vw, 3.4rem);
  align-items: start;
}

.vocation-concept h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  color: var(--charcoal);
  line-height: 1.2;
  margin-bottom: 1rem;
}

html[dir=rtl] .vocation-concept h2 { font-family: var(--font-arabic); }

.vocation-concept p {
  color: var(--muted);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.vocation-concept .accent-line {
  background: var(--voc-accent, #00AEEF);
  margin: 0 0 1.4rem;
}

html[dir=rtl] .vocation-concept .accent-line { margin: 0 0 1.4rem auto; }

.vocation-kpis {
  display: grid;
  gap: .8rem;
}

.vocation-kpi {
  border-radius: var(--radius);
  padding: 1.05rem 1.2rem;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-inline-start: 4px solid var(--voc-accent, #00AEEF);
}

.vocation-kpi-value {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--charcoal);
  line-height: 1.15;
}

html[dir=rtl] .vocation-kpi-value { font-family: var(--font-arabic); }

.vocation-kpi-label {
  font-size: .85rem;
  color: var(--muted);
  margin-top: .25rem;
}

/* ===== PROGRAMME PAR NIVEAU ===== */
.vocation-program {
  background: var(--sand);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: clamp(3rem, 6vw, 4.6rem) 1.5rem;
}

.vocation-program-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.levels {
  display: grid;
  gap: .7rem;
  margin-top: 2rem;
}

.level-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
}

.level-name {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-weight: 700;
  color: var(--charcoal);
  font-size: .95rem;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 .45rem;
  border-radius: 9px;
  background: var(--voc-accent, #00AEEF);
  color: white;
  font-size: .78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.level-use {
  color: var(--muted);
  font-size: .94rem;
  line-height: 1.55;
}

/* ===== GALERIE ===== */
.vocation-gallery {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 4.6rem) 1.5rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: .85rem;
  margin-top: 2rem;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--sand-dark);
  border: none;
  padding: 0;
  cursor: zoom-in;
  display: block;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}

@media (hover: hover) {
  .gallery-item:hover img { transform: scale(1.07); }
}

.gallery-item:focus-visible {
  outline: 3px solid var(--voc-accent, #00AEEF);
  outline-offset: 3px;
}

.gallery-caption {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 1.6rem .8rem .6rem;
  background: linear-gradient(0deg, rgba(9, 20, 33, .8), transparent);
  color: white;
  font-size: .82rem;
  font-weight: 600;
  text-align: start;
}

/* Lightbox galerie */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  /* Au-dessus de .main-nav (9999), sous .home-tour-modal (100000).
     A 4000 la barre de navigation fixe recouvrait le haut de l'image. */
  z-index: 10000;
  background: rgba(6, 14, 24, .93);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.2rem;
}

.gallery-lightbox.open { display: flex; }

.gallery-lightbox img {
  max-width: min(1100px, 96vw);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .6);
}

.gallery-lightbox-close {
  position: absolute;
  top: 1.1rem;
  inset-inline-end: 1.1rem;
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .3);
  color: white;
  border-radius: 30px;
  padding: .55rem 1.15rem;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
}

.gallery-lightbox-close:hover { background: rgba(255, 255, 255, .28); }

/* ===== BASCULE VERS LES AUTRES VOCATIONS ===== */
.vocation-switch {
  background: #0c2340;
  color: white;
  padding: clamp(3rem, 6vw, 4.6rem) 1.5rem;
}

.vocation-switch-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.vocation-switch .section-title h2 { color: white; }
.vocation-switch .section-title p { color: rgba(255, 255, 255, .74); }

.vocation-switch .vocation-card {
  background: rgba(255, 255, 255, .05);
  border-color: rgba(255, 255, 255, .14);
  color: white;
}

.vocation-switch .vocation-card-desc { color: rgba(255, 255, 255, .74); }

.vocation-switch .vocation-chip {
  background: rgba(255, 255, 255, .09);
  border-color: rgba(255, 255, 255, .16);
  color: rgba(255, 255, 255, .82);
}

.vocation-switch .vocation-card-cta {
  color: var(--voc-accent-light, #7FD9F7);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .local-band-inner,
  .vocation-concept {
    grid-template-columns: 1fr;
  }
  .vocation-hero { min-height: 520px; }
}

@media (max-width: 640px) {
  .level-row {
    grid-template-columns: 1fr;
    gap: .5rem;
  }
  .vocation-hero-actions .btn { flex: 1 1 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .vocation-card,
  .vocation-card-media img,
  .gallery-item img {
    transition: none !important;
  }
}

/* ===== SÉLECTEUR DES QUATRE VISITES ===== */
.tour-picker {
  position: fixed;
  inset: 0;
  /* Au-dessus de .main-nav (9999), sous .home-tour-modal (100000).
     A 3500 la barre de navigation masquait le titre du selecteur. */
  z-index: 10000;
  background: rgba(6, 14, 24, .88);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem);
  overflow-y: auto;
}

.tour-picker.open { display: flex; }

.tour-picker-panel {
  position: relative;
  width: min(940px, 100%);
  background: var(--surface);
  border-radius: 16px;
  padding: clamp(1.6rem, 4vw, 2.6rem);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .5);
  margin: auto;
}

.tour-picker-close {
  position: absolute;
  top: .9rem;
  inset-inline-end: .9rem;
  background: var(--sand);
  border: 1px solid var(--border-subtle);
  color: var(--muted);
  border-radius: 30px;
  padding: .45rem 1.05rem;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
}

.tour-picker-close:hover { background: var(--sand-dark); color: var(--charcoal); }

.tour-picker-head {
  margin-bottom: 1.5rem;
  padding-inline-end: 5rem;
}

.tour-picker-head h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 3.2vw, 2rem);
  color: var(--charcoal);
  line-height: 1.2;
}

html[dir=rtl] .tour-picker-head h2 { font-family: var(--font-arabic); }

.tour-picker-head p {
  color: var(--muted);
  font-size: .95rem;
  margin-top: .5rem;
  max-width: 60ch;
}

.tour-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: .9rem;
}

.tour-pick {
  display: flex;
  flex-direction: column;
  text-align: start;
  background: var(--white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

@media (hover: hover) {
  .tour-pick:hover {
    transform: translateY(-4px);
    border-color: var(--voc-accent, #00AEEF);
    box-shadow: var(--shadow-lg);
  }
  .tour-pick:hover .tour-pick-media img { transform: scale(1.07); }
}

.tour-pick:focus-visible {
  outline: 3px solid var(--voc-accent, #00AEEF);
  outline-offset: 3px;
}

.tour-pick-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--charcoal);
}

.tour-pick-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}

.tour-pick-media::after {
  content: '360°';
  position: absolute;
  inset-inline-end: .5rem;
  bottom: .5rem;
  background: rgba(9, 20, 33, .72);
  color: white;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  padding: .22rem .5rem;
  border-radius: 20px;
}

.tour-pick-tag {
  position: absolute;
  top: .5rem;
  inset-inline-start: .5rem;
  z-index: 2;
  background: var(--voc-accent, #00AEEF);
  color: white;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .22rem .55rem;
  border-radius: 20px;
}

.tour-pick-body {
  display: block;
  padding: .8rem .9rem 1rem;
}

.tour-pick-name {
  display: block;
  font-weight: 700;
  font-size: .95rem;
  color: var(--charcoal);
  line-height: 1.3;
}

.tour-pick-meta {
  display: block;
  font-size: .8rem;
  color: var(--muted);
  margin-top: .3rem;
}

/* Mobile : panneau ancre en haut plutot que centre (il depasse la hauteur
   d'ecran), et titre place sous le bouton Fermer au lieu d'a cote. */
@media (max-width: 640px) {
  .tour-picker {
    align-items: flex-start;
    padding: 1rem .8rem 2rem;
  }
  .tour-picker-panel {
    margin: 0 auto;
    padding: 3.1rem 1.1rem 1.4rem;
    border-radius: 14px;
  }
  .tour-picker-close {
    top: .7rem;
    inset-inline-end: .7rem;
    padding: .4rem .9rem;
  }
  .tour-picker-head {
    padding-inline-end: 0;
    margin-bottom: 1.1rem;
  }
  .tour-picker-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
    gap: .7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tour-pick,
  .tour-pick-media img { transition: none !important; }
}

/* ===== GALERIE : VISIONNEUSE 360° (Pannellum) ===== */

/* Badge sur les vignettes réellement équirectangulaires.
   Pose par markPanoramicItems() apres mesure du ratio naturel. */
.gallery-pano-badge {
  position: absolute;
  top: .55rem;
  inset-inline-end: .55rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .24rem .55rem;
  border-radius: 20px;
  background: var(--voc-accent, #00AEEF);
  color: white;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .04em;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .3);
  pointer-events: none;
}

.gallery-item[data-pano] { cursor: grab; }

.gallery-lightbox-stage {
  position: relative;
  width: min(1100px, 96vw);
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mode image plate : la scene s'ajuste a l'image */
.gallery-lightbox:not(.is-pano) .gallery-lightbox-stage {
  width: auto;
}

.gallery-pano {
  display: none;
  width: min(1100px, 96vw);
  height: min(620px, 76vh);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .6);
  background: #0b1622;
}

.gallery-lightbox.is-pano .gallery-pano { display: block; }
.gallery-lightbox.is-pano img { display: none; }

.gallery-lightbox-hint {
  margin-top: .9rem;
  color: rgba(255, 255, 255, .78);
  font-size: .82rem;
  font-weight: 600;
  text-align: center;
  min-height: 1.2em;
  pointer-events: none;
}

/* La lightbox empile desormais scene + legende : passage en colonne. */
.gallery-lightbox {
  flex-direction: column;
}

/* Pannellum impose ses propres couleurs de controles : on les aligne
   sur l'accent de la vocation courante. */
.gallery-pano .pnlm-container { background: #0b1622; }

.gallery-pano .pnlm-ctrl {
  background-color: rgba(11, 22, 34, .72);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 6px;
}

.gallery-pano .pnlm-ctrl:hover {
  background-color: var(--voc-accent, #00AEEF);
  border-color: var(--voc-accent, #00AEEF);
}

.gallery-pano .pnlm-load-box {
  background: rgba(11, 22, 34, .9);
  color: white;
}

@media (max-width: 640px) {
  .gallery-pano {
    width: 96vw;
    height: min(58vh, 380px);
  }
  .gallery-lightbox-hint { font-size: .75rem; }
  .gallery-pano-badge { font-size: .62rem; padding: .2rem .45rem; }
}
