/* ============================================
   FICHE RÉFÉRENCE — Archiprogramme
   ============================================ */

body.single-reference {
  padding-top: 0 !important;
}

.ap-single-ref {
  background: var(--ap-nuit, #0D0D0D);
  overflow-x: clip;
}

.ap-single-ref__body,
.ap-single-ref__gallery,
.ap-single-ref__nav {
  background: var(--ap-carnet, #EFE9DD);
}

/* ═══════════ HERO ═══════════ */
.ap-single-ref__hero {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 480px;
  overflow: hidden;
}

.ap-single-ref__hero-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: transform 8s ease;
}

.ap-single-ref__hero:hover .ap-single-ref__hero-img {
  transform: scale(1.03);
}

.ap-single-ref__hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 35%, rgba(0,0,0,0.72) 100%);
  display: flex;
  align-items: flex-end;
}

.ap-single-ref__hero-content {
  padding: 0 clamp(28px, 5vw, 72px) clamp(28px, 4vw, 56px);
  max-width: 960px;
}

.ap-single-ref__cat {
  display: inline-block !important;
  font-family: 'DM Sans', sans-serif !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.12em !important;
  color: var(--ap-carnet, #EFE9DD) !important;
  background-color: var(--ap-signal, #EA6928) !important;
  padding: 3px 8px !important;
  margin-bottom: 14px !important;
}

.ap-single-ref__title {
  font-family: 'Epilogue', sans-serif !important;
  font-size: 86px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  color: #ffffff !important;
  line-height: 1 !important;
  margin: 0 0 -0.2em !important;
  padding: 0 !important;
  display: block !important;
}

/* ═══════════ BODY (infos + contenu côte à côte) ═══════════ */
.ap-single-ref__body {
  background: var(--ap-carnet, #EFE9DD);
}

.ap-single-ref__body-inner {
  display: grid;
  grid-template-columns: clamp(200px, 28%, 320px) 1fr;
  gap: clamp(40px, 6vw, 96px);
  padding: clamp(40px, 6vw, 80px) clamp(24px, 5vw, 72px);
}

/* ── Meta (colonne gauche) ── */
.ap-single-ref__meta {
  display: flex !important;
  flex-direction: column !important;
  gap: 28px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.ap-single-ref__meta-item {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
}

.ap-single-ref__meta dt {
  font-family: 'DM Sans', sans-serif !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.12em !important;
  color: var(--ap-sable, #BDAD94) !important;
}

.ap-single-ref__meta dd {
  font-family: 'DM Sans', sans-serif !important;
  font-size: clamp(15px, 1.2vw, 18px) !important;
  font-weight: 400 !important;
  color: var(--ap-nuit, #0D0D0D) !important;
  margin: 0 !important;
  line-height: 1.45 !important;
}

/* ── Contenu (colonne droite) ── */
.ap-single-ref__content-label {
  font-family: 'DM Sans', sans-serif !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.12em !important;
  color: var(--ap-sable, #BDAD94) !important;
  margin: 0 0 6px !important;
  padding: 0 !important;
}

.ap-single-ref__content p:not(.ap-single-ref__content-label),
.ap-single-ref__content li {
  font-family: 'DM Sans', sans-serif !important;
  font-size: clamp(15px, 1.2vw, 18px) !important;
  line-height: 1.7 !important;
  color: var(--ap-nuit, #0D0D0D) !important;
}

.ap-single-ref__content p:not(.ap-single-ref__content-label) {
  margin: 0 0 1.2em !important;
}

.ap-single-ref__content p:not(.ap-single-ref__content-label):last-child {
  margin-bottom: 0 !important;
}

/* ═══════════ GALERIE / SLIDER ═══════════ */
.ap-single-ref__gallery {
  padding: clamp(24px, 3vw, 40px) 0 clamp(40px, 6vw, 80px);
}

.ap-single-ref__slider {
  position: relative;
  overflow-x: clip;
}

.ap-single-ref__slider-track {
  display: flex;
  gap: 12px;
  padding-left: clamp(24px, 5vw, 72px);
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  cursor: grab;
  user-select: none;
}

.ap-single-ref__slider-track img {
  pointer-events: none;
}

.ap-single-ref__slide {
  flex: 0 0 calc(46% - 8px);
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.ap-single-ref__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.ap-single-ref__slide:hover img {
  transform: scale(1.04);
}

/* Slider controls (arrows) */
.ap-single-ref__slider-controls {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  padding-left: clamp(24px, 5vw, 72px);
}

.ap-single-ref__slider-prev,
.ap-single-ref__slider-next {
  width: 56px !important;
  height: 56px !important;
  border: 2px solid var(--ap-nuit, #0D0D0D) !important;
  background: transparent !important;
  background-color: transparent !important;
  color: var(--ap-nuit, #0D0D0D) !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background 0.2s, color 0.2s, border-color 0.2s !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

.ap-single-ref__slider-prev:hover,
.ap-single-ref__slider-next:hover {
  background: var(--ap-nuit, #0D0D0D) !important;
  background-color: var(--ap-nuit, #0D0D0D) !important;
  color: #ffffff !important;
  border-color: var(--ap-nuit, #0D0D0D) !important;
}

.ap-single-ref__slider-prev:disabled,
.ap-single-ref__slider-next:disabled {
  opacity: 0.25 !important;
  cursor: default !important;
  background: transparent !important;
  background-color: transparent !important;
}

.ap-single-ref__slider-prev svg,
.ap-single-ref__slider-next svg {
  display: block;
  flex-shrink: 0;
}

/* ═══════════ NAVIGATION PREV / NEXT ═══════════ */
.ap-single-ref__nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: clamp(40px, 5vw, 64px) clamp(24px, 5vw, 72px);
}

.ap-single-ref__nav-prev {
  justify-self: start;
}

.ap-single-ref__nav-next {
  justify-self: end;
}

.ap-single-ref__nav-all {
  font-family: 'DM Sans', sans-serif !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.12em !important;
  color: var(--ap-signal, #EA6928) !important;
  text-decoration: none !important;
  text-align: center;
  transition: color 0.2s;
  white-space: nowrap;
}

.ap-single-ref__nav-all:hover {
  color: var(--ap-nuit, #0D0D0D) !important;
}

.ap-single-ref__nav-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none !important;
  color: var(--ap-nuit, #0D0D0D) !important;
  font-family: 'Epilogue', sans-serif !important;
  transition: color 0.2s;
  max-width: 280px;
}

.ap-single-ref__nav-link--right {
  align-items: flex-end;
  text-align: right;
}

.ap-single-ref__nav-link:hover {
  color: var(--ap-signal, #EA6928) !important;
}

.ap-single-ref__nav-arrow {
  display: block;
  color: var(--ap-signal, #EA6928) !important;
  line-height: 1;
}

.ap-single-ref__nav-arrow svg {
  display: block;
}

.ap-single-ref__nav-label {
  font-family: 'DM Sans', sans-serif !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.1em !important;
  color: var(--ap-sable, #BDAD94) !important;
}


/* Compensation barre d'admin WordPress */
.admin-bar .ap-single-ref__hero {
  height: calc(100vh - 32px);
}
@media (max-width: 782px) {
  .admin-bar .ap-single-ref__hero {
    height: calc(100vh - 46px);
  }
}

/* ═══════════ Responsive ═══════════ */
@media (max-width: 1024px) {
  .ap-single-ref__slide {
    flex: 0 0 calc(60% - 8px);
  }
}

@media (max-width: 768px) {
  .ap-single-ref__hero {
    height: 100vh;
  }

  .ap-single-ref__title {
    font-size: clamp(36px, 9vw, 86px) !important;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .ap-single-ref__hero-content {
    padding-bottom: clamp(24px, 4vw, 40px);
  }

  .ap-single-ref__body-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .ap-single-ref__slide {
    flex: 0 0 calc(80% - 8px);
  }

  .ap-single-ref__nav {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 16px;
    padding: clamp(32px, 5vw, 48px) clamp(20px, 4vw, 40px);
  }

  .ap-single-ref__nav-all {
    grid-column: 1 / -1;
    order: -1;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(13,13,13,0.1);
  }

  .ap-single-ref__nav-link {
    max-width: 100%;
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .ap-single-ref__hero {
    height: 100vh;
    min-height: 320px;
  }

  .ap-single-ref__title {
    font-size: clamp(28px, 8vw, 86px) !important;
  }

  .ap-single-ref__slide {
    flex: 0 0 88%;
  }

  .ap-single-ref__meta {
    grid-template-columns: 1fr 1fr !important;
  }

}
