/**
 * Page projet — single-portfolio.php
 * Thème enfant Phlox.
 */

.bps-main {
  --bps-dark: #00235a;
  --bps-accent: #b79a72;
  --bps-title: #1c2233;
  --bps-text: #565969;
  --bps-border: rgba(28, 34, 51, 0.12);
}

/* --- Bandeau de titre --- */

.bps-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 370px;
  padding: 120px 0 60px;
  background-color: var(--bps-dark);
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
}

.bps-hero.bps-has-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(0, 22, 89, 0.55);
}

.bps-hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 30px;
  color: #ffffff;
}

.bps-hero-intro {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bps-accent);
}

.bps-hero-title {
  margin: 0;
  font-size: clamp(32px, 4.5vw, 56px);
  line-height: 1.1;
  color: #ffffff;
}

.bps-hero-sub {
  margin: 16px 0 0;
  max-width: 640px;
  font-size: 18px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
}

/* --- Conteneur --- */

.bps-wrap {
  max-width: 1300px;
  margin: 0 auto;
  padding: 70px 30px 90px;
}

/* --- Galerie --- */

.bps-gallery-slider {
  position: relative;
  margin-bottom: 60px;
}

/* Mosaïque : 3 colonnes, toutes les images visibles. */

.bps-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
}

.bps-gallery-cell {
  margin: 0;
}

.bps-gallery-cell a {
  display: block;
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
}

.bps-gallery-cell a::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: rgba(0, 22, 89, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bps-gallery-cell a:hover::after {
  opacity: 1;
}

.bps-gallery-cell .bps-gallery-img {
  aspect-ratio: 4 / 3;
}

.bps-gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.bps-gallery-track::-webkit-scrollbar {
  display: none;
}

.bps-gallery-slide {
  flex: 0 0 100%;
  margin: 0;
  scroll-snap-align: center;
}

.bps-gallery-slide a {
  display: block;
  cursor: zoom-in;
}

.bps-gallery-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1100 / 673;
  object-fit: cover;
}

.bps-gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: none;
  background-color: rgba(0, 35, 90, 0.75);
  color: #ffffff;
  cursor: pointer;
  transition:
    background-color 0.3s ease,
    opacity 0.3s ease;
}

.bps-gallery-arrow svg {
  width: 20px;
  height: 20px;
}

.bps-gallery-prev {
  left: 0;
}

.bps-gallery-next {
  right: 0;
}

.bps-gallery-arrow:hover {
  background-color: var(--bps-accent);
}

.bps-gallery-arrow[disabled] {
  opacity: 0.35;
  cursor: default;
}

.bps-gallery-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.bps-gallery-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 1px solid var(--bps-dark);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease;
}

.bps-gallery-dot.is-active {
  border-color: var(--bps-accent);
  background-color: var(--bps-accent);
}

/* --- Contenu + informations --- */

.bps-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  gap: 60px;
  align-items: start;
}

/* En mode diaporama la galerie est au-dessus : la colonne média disparaît. */

.bps-layout-slider {
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
}

.bps-layout-slider .bps-media-col {
  display: none;
}

.bps-layout-slider .bps-side {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  gap: 60px;
  align-items: start;
}

.bps-layout-slider .bps-title,
.bps-layout-slider .bps-entry {
  grid-column: 1;
}

.bps-layout-slider .bps-info {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.bps-title {
  margin: 0 0 24px;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.25;
  color: var(--bps-title);
}

.bps-layout-slider .bps-title {
  font-size: clamp(26px, 3vw, 38px);
}

.bps-entry {
  font-size: 15px;
  line-height: 1.8;
  color: var(--bps-text);
}

.bps-layout-slider .bps-entry {
  font-size: 16px;
}

.bps-entry > *:first-child {
  margin-top: 0;
}

.bps-entry > *:last-child {
  margin-bottom: 0;
}

.bps-entry img {
  max-width: 100%;
  height: auto;
}

.bps-info {
  margin-top: 40px;
  padding-top: 34px;
  border-top: 1px solid var(--bps-border);
}

.bps-layout-slider .bps-info {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.bps-info-title {
  margin: 0 0 24px;
  font-size: 20px;
  line-height: 1.3;
  color: var(--bps-title);
}

.bps-info-list {
  margin: 0;
}

.bps-info-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--bps-border);
}

.bps-info-item:first-child {
  padding-top: 0;
}

.bps-info-label {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bps-accent);
}

.bps-info-value {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--bps-text);
}

.bps-info-value a {
  color: var(--bps-title);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition:
    color 0.3s ease,
    border-color 0.3s ease;
}

.bps-info-value a:hover {
  color: var(--bps-accent);
  border-bottom-color: var(--bps-accent);
}

.bps-info-back {
  margin: 28px 0 0;
}

.bps-info-back .bp-btn {
  color: var(--bps-title);
}

.bps-info-back .bp-btn:hover {
  color: var(--bps-accent);
}

/* --- Navigation entre projets --- */

.bps-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  margin-top: 70px;
  padding-top: 34px;
  border-top: 1px solid var(--bps-border);
}

.bps-nav-side a {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--bps-title);
  transition: color 0.3s ease;
}

.bps-nav-next {
  justify-self: end;
  text-align: right;
}

.bps-nav-side a:hover {
  color: var(--bps-accent);
}

.bps-nav-arrow svg {
  display: block;
  width: 22px;
  height: 22px;
}

.bps-nav-text {
  display: flex;
  flex-direction: column;
}

.bps-nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bps-accent);
}

.bps-nav-name {
  font-size: 16px;
  line-height: 1.4;
}

.bps-nav-back a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  color: var(--bps-title);
  transition: color 0.3s ease;
}

.bps-nav-back a:hover {
  color: var(--bps-accent);
}

.bps-nav-back svg {
  width: 18px;
  height: 18px;
}

/* --- Projets liés --- */

.bps-related {
  margin-top: 0;
}

/* --- Lightbox --- */

.bps-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background-color: rgba(0, 12, 38, 0.94);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

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

.bps-lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.bps-lightbox button {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: none;
  background: none;
  color: #ffffff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.3s ease;
}

.bps-lightbox button:hover {
  color: var(--bps-accent, #b79a72);
}

.bps-lb-close {
  top: 16px;
  right: 20px;
}

.bps-lb-prev {
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.bps-lb-next {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

/* --- Responsive --- */

@media (max-width: 1024px) {
  .bps-grid,
  .bps-layout-slider,
  .bps-layout-slider .bps-side {
    grid-template-columns: minmax(0, 1fr);
    gap: 44px;
  }
  .bps-layout-slider .bps-info {
    grid-column: 1;
    grid-row: auto;
  }
  .bps-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
  .bps-wrap {
    padding: 50px 30px 70px;
  }
}

@media (max-width: 768px) {
  .bps-hero {
    min-height: 280px;
    padding: 100px 0 40px;
  }
  .bps-hero-inner,
  .bps-wrap {
    padding-left: 16px;
    padding-right: 16px;
  }
  .bps-nav {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 24px;
  }
  .bps-nav-next {
    justify-self: center;
    text-align: center;
  }
  .bps-gallery-arrow {
    width: 42px;
    height: 42px;
  }
  .bps-gallery-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bps-gallery-track {
    scroll-behavior: auto;
  }
}
