/* Shared project-detail system: one cinematic hero and an uncropped editorial gallery. */

body.page-template-gallery-detail {
  background: var(--paper);
}

body.page-template-gallery-detail .gallery-hero {
  background: var(--deep);
  color: var(--white);
  min-height: clamp(640px, 88svh, 980px);
  overflow: hidden;
  position: relative;
}

.gallery-hero__media,
.gallery-hero__shade {
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
}

.gallery-hero__media {
  background: #18211e;
}

.gallery-hero__image {
  height: 100%;
  object-fit: cover;
  object-position: center;
  width: 100%;
}

.gallery-hero__shade {
  background:
    linear-gradient(90deg, rgba(7, 12, 10, .82) 0%, rgba(7, 12, 10, .34) 48%, rgba(7, 12, 10, .15) 72%, rgba(7, 12, 10, .34) 100%),
    linear-gradient(0deg, rgba(7, 12, 10, .88) 0%, rgba(7, 12, 10, .22) 52%, rgba(7, 12, 10, .35) 100%);
  pointer-events: none;
}

.gallery-hero__shade > span {
  color: rgba(255, 255, 255, .2);
  font-family: var(--sans);
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .16em;
  position: absolute;
  right: max(32px, calc((100vw - 1540px) / 2));
  top: 50%;
  transform: rotate(90deg) translateX(50%);
  transform-origin: right center;
}

.gallery-hero__content {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: clamp(640px, 88svh, 980px);
  padding-bottom: clamp(64px, 8vw, 118px);
  padding-top: 150px;
  position: relative;
  z-index: 2;
}

.gallery-hero__eyebrow {
  align-items: center;
  color: #d7ba82;
  display: flex;
  font-size: .68rem;
  font-weight: 600;
  gap: 18px;
  letter-spacing: .24em;
  margin-bottom: clamp(26px, 3vw, 42px);
  text-transform: uppercase;
}

.gallery-hero__eyebrow::before {
  background: currentColor;
  content: "";
  height: 1px;
  width: 54px;
}

body.ablaze-luxury-theme .gallery-hero__title {
  color: var(--white);
  font-family: var(--hero-h1-family) !important;
  font-size: var(--hero-h1-size);
  font-style: normal;
  font-weight: var(--hero-h1-weight);
  letter-spacing: var(--hero-h1-letter-spacing);
  line-height: var(--hero-h1-line-height);
  margin: 0;
  max-width: min(1180px, 88%);
  text-wrap: balance;
}

.gallery-hero__meta {
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, .34);
  display: flex;
  font-size: .66rem;
  font-weight: 600;
  justify-content: space-between;
  letter-spacing: .18em;
  margin-top: clamp(34px, 5vw, 62px);
  max-width: min(760px, 100%);
  padding-top: 18px;
  text-transform: uppercase;
}

.gallery-hero__meta > span {
  color: #d7ba82;
}

.gallery-hero__meta a {
  align-items: center;
  display: inline-flex;
  gap: 18px;
  transition: color 180ms ease, gap 180ms ease;
}

.gallery-hero__meta a:hover,
.gallery-hero__meta a:focus-visible {
  color: #d7ba82;
  gap: 24px;
}

section.gallery-detail {
  background: var(--paper);
  padding-block: clamp(90px, 9vw, 156px);
}

.gallery-detail__intro {
  border-bottom: 1px solid rgba(25, 32, 30, .18);
  margin: 0 auto clamp(72px, 8vw, 126px);
  max-width: 920px;
  padding-bottom: clamp(54px, 6vw, 88px);
}

.gallery-detail__header {
  align-items: end;
  border-top: 1px solid rgba(25, 32, 30, .22);
  display: flex;
  gap: 40px;
  justify-content: space-between;
  margin-bottom: clamp(44px, 5vw, 76px);
  padding-top: clamp(34px, 4vw, 54px);
}

.gallery-detail__header h2,
.gallery-detail__empty h2 {
  font-size: clamp(3.2rem, 5.5vw, 6.2rem);
  line-height: .92;
  text-wrap: balance;
}

.gallery-detail__count {
  color: #686c69;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .17em;
  padding-bottom: 9px;
  text-transform: uppercase;
  white-space: nowrap;
}

.gallery-detail__count span {
  color: var(--brass);
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 400;
  letter-spacing: 0;
  margin-right: 10px;
}

.gallery-detail__grid {
  column-count: 3;
  column-gap: clamp(14px, 1.55vw, 26px);
}

.gallery-detail__item {
  break-inside: avoid;
  margin: 0 0 clamp(14px, 1.55vw, 26px);
  overflow: hidden;
  page-break-inside: avoid;
}

.gallery-detail__link {
  background: #d9d3c8;
  display: block;
  overflow: hidden;
  position: relative;
}

.gallery-detail__link:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 5px;
}

.gallery-detail__image {
  height: auto;
  transform: scale(1.001);
  transition: transform 850ms cubic-bezier(.2, .8, .2, 1), filter 550ms ease;
  width: 100%;
}

.gallery-detail__wash {
  background: linear-gradient(0deg, rgba(8, 13, 12, .68) 0%, rgba(8, 13, 12, 0) 42%);
  inset: 0;
  opacity: .18;
  pointer-events: none;
  position: absolute;
  transition: opacity 380ms ease;
}

.gallery-detail__cue {
  align-items: center;
  bottom: 0;
  color: var(--white);
  display: flex;
  font-size: .64rem;
  font-weight: 600;
  justify-content: space-between;
  left: 0;
  letter-spacing: .16em;
  opacity: 0;
  padding: 24px;
  pointer-events: none;
  position: absolute;
  right: 0;
  text-transform: uppercase;
  transform: translateY(8px);
  transition: opacity 280ms ease, transform 380ms cubic-bezier(.2, .8, .2, 1);
}

.gallery-detail__cue span:first-child {
  color: #d7ba82;
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0;
}

.gallery-detail__link:hover .gallery-detail__image,
.gallery-detail__link:focus-visible .gallery-detail__image {
  filter: saturate(.92);
  transform: scale(1.022);
}

.gallery-detail__link:hover .gallery-detail__wash,
.gallery-detail__link:focus-visible .gallery-detail__wash {
  opacity: 1;
}

.gallery-detail__link:hover .gallery-detail__cue,
.gallery-detail__link:focus-visible .gallery-detail__cue {
  opacity: 1;
  transform: translateY(0);
}

.gallery-detail__empty {
  border-top: 1px solid rgba(25, 32, 30, .22);
  padding-block: clamp(46px, 6vw, 86px);
  text-align: center;
}

.gallery-detail__empty .eyebrow {
  margin-bottom: 20px;
}

body.page-template-gallery-detail .contact.section {
  padding-top: clamp(90px, 9vw, 156px);
}

/* Fancybox inherits the same quiet, architectural color system. */
body.page-template-gallery-detail .fancybox__container {
  --fancybox-accent-color: #d7ba82;
  --fancybox-bg: rgba(8, 13, 12, .97);
  --fancybox-color: #fffef9;
  font-family: var(--sans);
}

body.page-template-gallery-detail .fancybox__caption {
  color: #d8dad5;
  font-size: .78rem;
  letter-spacing: .04em;
}

body.page-template-gallery-detail .fancybox__thumbs .carousel__slide .fancybox__thumb::after {
  border-color: #d7ba82;
  border-width: 2px;
  border-radius: 0;
}

body.page-template-gallery-detail .fancybox__thumb {
  border-radius: 0;
}

@media (max-width: 1080px) {
  .gallery-detail__grid {
    column-count: 2;
  }
}

@media (max-width: 760px) {
  body.page-template-gallery-detail .gallery-hero,
  .gallery-hero__content {
    min-height: 82svh;
  }

  .gallery-hero__content {
    padding-bottom: 54px;
    padding-top: 116px;
  }

  body.ablaze-luxury-theme .gallery-hero__title {
    font-size: var(--hero-h1-size-mobile);
    max-width: 100%;
  }

  .gallery-hero__meta {
    margin-top: 34px;
  }

  .gallery-hero__shade > span {
    display: none;
  }

  .gallery-detail__header {
    align-items: start;
    flex-direction: column;
    gap: 20px;
  }

  .gallery-detail__count {
    padding-bottom: 0;
  }

  .gallery-detail__cue {
    opacity: 1;
    padding: 18px;
    transform: none;
  }

  .gallery-detail__wash {
    opacity: .76;
  }
}

@media (max-width: 680px) {
  .gallery-detail__grid {
    column-count: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-hero__meta a,
  .gallery-detail__image,
  .gallery-detail__wash,
  .gallery-detail__cue {
    transition: none;
  }

  .gallery-detail__link:hover .gallery-detail__image,
  .gallery-detail__link:focus-visible .gallery-detail__image {
    transform: none;
  }
}
