/**
 * Section Projects — shortcode [bold_portfolio]
 * Thème enfant Phlox.
 */

.bp-section {
  --bp-bg: #00235a;
  --bp-bg-text: #1e3c6f;
  --bp-accent: #b79a72;
  --bp-title: #ffffff;
  --bp-text: #a8b3c9;
  --bp-gap: 30px;

  position: relative;
  overflow: hidden;
  padding: 90px 0 100px;
  background-color: var(--bp-bg);
  color: var(--bp-text);
}

.bp-section.bp-skin-light {
  --bp-bg: #ffffff;
  --bp-bg-text: #f1f2f5;
  --bp-title: #1c2233;
  --bp-text: #565969;
}

.bp-inner {
  position: relative;
  z-index: 2;
  max-width: 1670px;
  margin: 0 auto;
  padding: 0 30px;
}

/* --- Titre filigrane --- */

.bp-bg-text {
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  z-index: 1;
  pointer-events: none;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
}

.bp-bg-text span {
  display: inline-block;
  padding-left: 4.3%;
  font-size: clamp(64px, 12vw, 180px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--bp-bg-text);
}

/* --- En-tête --- */

.bp-head {
  margin-bottom: 46px;
}

.bp-subtitle {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bp-accent);
}

.bp-title {
  margin: 0;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.1;
  color: var(--bp-title);
}

/* --- Liste --- */

.bp-list {
  position: relative;
}

.bp-track {
  display: grid;
  grid-template-columns: repeat(var(--bp-cols, 4), minmax(0, 1fr));
  gap: var(--bp-gap);
}

.bp-cols-1 {
  --bp-cols: 1;
}
.bp-cols-2 {
  --bp-cols: 2;
}
.bp-cols-3 {
  --bp-cols: 3;
}
/* .bp-cols-4 { */
/* --bp-cols: 4; */
/* } */
/* .bp-cols-5 { */
/* --bp-cols: 5; */
/* } */

/* Mode slider : défilement horizontal avec accrochage. */

.bp-is-slider .bp-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
}

.bp-is-slider .bp-track::-webkit-scrollbar {
  display: none;
}

.bp-is-slider .bp-item {
  flex: 0 0
    calc((100% - (var(--bp-cols, 3) - 1) * var(--bp-gap)) / var(--bp-cols, 3));
  scroll-snap-align: start;
}

/* --- Carte --- */

.bp-item {
  position: relative;
  margin: 0;
}

.bp-item-inner {
  height: 100%;
}

.bp-media {
  position: relative;
  display: block;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.18);
}

.bp-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--bp-bg);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.bp-item:hover .bp-media::after {
  opacity: 0.25;
}

.bp-media img,
.bp-img-placeholder {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1100 / 673;
  object-fit: cover;
  transition:
    transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 0.5s ease;
}

.bp-img-placeholder {
  background-color: rgba(255, 255, 255, 0.06);
}

.bp-item:hover .bp-img {
  transform: scale(1.05);
}

.bp-img-hover {
  position: absolute;
  inset: 0;
  opacity: 0;
  height: 100%;
}

.bp-item:hover .bp-img-hover {
  opacity: 1;
}

.bp-text {
  padding: 26px 0 0;
}

.bp-cats {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.bp-cat {
  color: var(--bp-accent);
  text-decoration: none;
}

.bp-cat + .bp-cat::before {
  content: ", ";
  color: var(--bp-text);
}

.bp-cat:hover {
  opacity: 0.75;
}

.bp-item-title {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.3;
}

.bp-item-title a {
  color: var(--bp-title);
  text-decoration: none;
  transition: color 0.3s ease;
}

.bp-item-title a:hover {
  color: var(--bp-accent);
}

.bp-meta {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.04em;
  opacity: 0.75;
}

.bp-excerpt {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--bp-text);
}

.bp-readmore {
  margin: 0;
}

.bp-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--bp-title);
}

.bp-btn-line {
  display: block;
  width: 30px;
  height: 1px;
  background-color: var(--bp-accent);
  transition: width 0.3s ease;
}

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

.bp-btn:hover .bp-btn-line {
  width: 46px;
}

/* --- Navigation --- */

.bp-nav {
  display: flex;
  gap: 12px;
  margin-top: 40px;
}

.bp-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 0;
  background: none;
  color: var(--bp-title);
  cursor: pointer;
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease,
    opacity 0.3s ease;
}

.bp-skin-light .bp-arrow {
  border-color: rgba(28, 34, 51, 0.2);
}

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

.bp-arrow:hover {
  border-color: var(--bp-accent);
  background-color: var(--bp-accent);
  color: #ffffff;
}

.bp-arrow[disabled] {
  opacity: 0.3;
  cursor: default;
}

.bp-arrow:focus-visible {
  outline: 2px solid var(--bp-accent);
  outline-offset: 3px;
}

/* --- Responsive --- */

@media (max-width: 1024px) {
  .bp-section {
    padding: 70px 0 80px;
  }
  .bp-cols-4,
  .bp-cols-5 {
    --bp-cols: 3;
  }
}

@media (max-width: 768px) {
  .bp-cols-3,
  .bp-cols-4,
  .bp-cols-5 {
    --bp-cols: 2;
  }
  .bp-inner {
    padding: 0 16px;
  }
}

@media (max-width: 560px) {
  .bp-section {
    --bp-gap: 20px;
  }
  .bp-cols-2,
  .bp-cols-3,
  .bp-cols-4,
  .bp-cols-5 {
    --bp-cols: 1;
  }
  .bp-bg-text span {
    opacity: 0.6;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bp-is-slider .bp-track {
    scroll-behavior: auto;
  }
  .bp-media img {
    transition: none;
  }
}
