/* La Clau — premium interaction and editorial layout for apartment detail pages. */

:root {
  --detail-ink: #211f1c;
  --detail-deep: #20231f;
  --detail-gold: #b8905a;
  --detail-gold-light: #d7b27b;
  --detail-paper: #fcfaf6;
  --detail-warm: #f2ede5;
  --detail-line: rgba(104, 82, 56, 0.16);
  --detail-radius: 24px;
  --detail-radius-small: 16px;
  --detail-shadow: 0 28px 80px rgba(58, 44, 28, 0.13);
  --detail-shadow-hover: 0 34px 88px rgba(58, 44, 28, 0.19);
  --detail-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  scroll-padding-top: 96px;
}

body {
  overflow-x: clip;
}

main {
  overflow: clip;
}

.nav {
  background: rgba(252, 250, 246, 0.82);
  box-shadow: 0 1px 0 var(--detail-line);
  transition:
    background-color 280ms ease,
    box-shadow 280ms ease;
}

.nav.is-scrolled {
  background: rgba(252, 250, 246, 0.94);
  box-shadow: 0 16px 42px rgba(45, 36, 26, 0.09);
}

.nav .btn,
.booking-card .btn {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}

.nav .btn::after,
.booking-card .btn::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-110%) skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: transform 650ms var(--detail-ease);
  pointer-events: none;
}

@media (hover: hover) {
  .nav .btn:hover::after,
  .booking-card .btn:hover::after {
    transform: translateX(110%) skewX(-18deg);
  }
}

/* Hero — larger photographic presence and editorial hierarchy. */
.hero {
  position: relative;
  min-height: calc(100svh - 76px);
  display: grid;
  align-items: center;
  padding-block: clamp(70px, 8vw, 118px);
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -16rem;
  left: -13rem;
  width: 40rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(215, 178, 123, 0.18), transparent 68%);
  pointer-events: none;
}

.hero .container,
.section .container {
  width: min(1320px, calc(100% - 64px));
}

.hero-grid {
  grid-template-columns: minmax(360px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(48px, 7vw, 112px);
}

.hero-grid > div {
  position: relative;
  z-index: 2;
}

.hero h1 {
  max-width: 680px;
  margin-bottom: 26px;
  font-size: clamp(4rem, 6.2vw, 6.8rem);
  line-height: 0.88;
  letter-spacing: -0.055em;
}

.hero .lead {
  max-width: 610px;
  color: #68615a;
  font-size: clamp(1rem, 1.18vw, 1.14rem);
  line-height: 1.75;
}

.hero-media {
  position: relative;
  height: clamp(560px, 68svh, 790px);
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(184, 144, 90, 0.24);
  border-radius: 30px;
  box-shadow: var(--detail-shadow);
  transform: translateZ(0);
}

.hero-media::before {
  content: "LA CLAU  ·  SORT";
  position: absolute;
  z-index: 2;
  right: 24px;
  bottom: 24px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(32, 35, 31, 0.34);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 62%, rgba(21, 22, 19, 0.2));
  pointer-events: none;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.02) brightness(0.97);
  transform: translate3d(0, var(--detail-parallax, 0), 0) scale(1.035);
  transition:
    transform 1100ms var(--detail-ease),
    filter 500ms ease;
}

@media (hover: hover) {
  .hero-media:hover img {
    filter: saturate(1) contrast(1.03) brightness(1);
    transform: translate3d(0, var(--detail-parallax, 0), 0) scale(1.075);
  }
}

.quick-facts {
  gap: 0;
  margin-top: 38px;
  padding: 5px;
  overflow: hidden;
  border: 1px solid rgba(184, 144, 90, 0.2);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.54);
  box-shadow: 0 20px 54px rgba(58, 44, 28, 0.1);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.quick-facts div {
  min-width: 0;
  padding: 20px 18px;
  border: 0;
  border-right: 1px solid var(--detail-line);
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
  transition:
    background-color 260ms ease,
    transform 260ms var(--detail-ease);
}

.quick-facts div:last-child {
  border-right: 0;
}

.quick-facts strong {
  font-size: clamp(1.9rem, 2.4vw, 2.55rem);
  font-variant-numeric: tabular-nums;
}

.quick-facts span {
  display: block;
  overflow-wrap: anywhere;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.45;
}

@media (hover: hover) {
  .quick-facts div:hover {
    z-index: 1;
    background: rgba(184, 144, 90, 0.1);
    transform: translateY(-2px);
  }
}

/* Content rhythm and cards. */
.section {
  position: relative;
  padding-block: clamp(92px, 10vw, 150px);
}

main > .section:nth-of-type(2),
main > .section:nth-of-type(4) {
  background:
    radial-gradient(circle at 94% 8%, rgba(215, 178, 123, 0.11), transparent 28rem),
    rgba(255, 255, 255, 0.34);
}

main > .section:nth-of-type(3) {
  background:
    linear-gradient(180deg, rgba(235, 227, 216, 0.72), rgba(247, 243, 237, 0.72)),
    var(--detail-warm);
}

.section h2 {
  max-width: 850px;
  margin-bottom: 24px;
  font-size: clamp(2.8rem, 4.6vw, 5.1rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.section h2::after {
  content: "";
  display: block;
  width: 72px;
  height: 12px;
  margin-top: 22px;
  background:
    radial-gradient(circle at 36px 50%, transparent 2px, var(--detail-gold) 2.5px 4px, transparent 4.5px),
    linear-gradient(var(--detail-gold), var(--detail-gold)) 0 50% / 30px 1px no-repeat,
    linear-gradient(var(--detail-gold), var(--detail-gold)) 42px 50% / 30px 1px no-repeat;
}

.split {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.48fr);
  gap: clamp(56px, 8vw, 120px);
}

.split > div > .lead {
  max-width: 760px;
  margin-bottom: 36px;
  line-height: 1.78;
}

.info-list {
  counter-reset: detail-card;
  gap: 14px;
}

.info-card {
  position: relative;
  min-height: 98px;
  display: grid;
  align-content: center;
  padding: 24px 28px 24px 82px;
  overflow: hidden;
  border-radius: var(--detail-radius-small);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 16px 46px rgba(58, 44, 28, 0.07);
  transition:
    transform 280ms var(--detail-ease),
    box-shadow 280ms ease,
    border-color 280ms ease;
}

.info-card::before {
  counter-increment: detail-card;
  content: "0" counter(detail-card);
  position: absolute;
  top: 50%;
  left: 24px;
  color: var(--detail-gold);
  font-family: var(--font-cormorant);
  font-size: 1.5rem;
  line-height: 1;
  transform: translateY(-50%);
}

.info-card::after {
  content: "";
  position: absolute;
  top: 22px;
  bottom: 22px;
  left: 61px;
  width: 1px;
  background: var(--detail-line);
}

.info-card strong {
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.info-card span {
  line-height: 1.55;
}

@media (hover: hover) {
  .info-card:hover {
    border-color: rgba(184, 144, 90, 0.32);
    box-shadow: 0 24px 60px rgba(58, 44, 28, 0.12);
    transform: translateX(6px);
  }
}

.booking-card {
  top: 112px;
  overflow: hidden;
  padding: clamp(28px, 3vw, 38px);
  border: 1px solid rgba(184, 144, 90, 0.2);
  border-radius: var(--detail-radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--detail-shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.booking-card::before {
  content: "";
  position: absolute;
  top: -90px;
  right: -90px;
  width: 190px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(215, 178, 123, 0.24), transparent 70%);
  pointer-events: none;
}

.booking-card h3 {
  font-size: clamp(2rem, 2.6vw, 2.8rem);
}

.booking-card p:not(.eyebrow),
.booking-card .note {
  color: #6d665f;
  line-height: 1.65;
}

.booking-form {
  gap: 14px;
}

.booking-card input,
.booking-card select {
  min-height: 52px;
  border-radius: 6px;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.booking-card input:focus,
.booking-card select:focus {
  border-color: var(--detail-gold);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(184, 144, 90, 0.14);
}

.booking-card .btn {
  min-height: 54px;
  margin-top: 4px;
}

/* Large bento gallery. */
.gallery-grid,
.gallery-grid.gallery-grid-duplex {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: clamp(230px, 22vw, 330px);
  gap: 14px;
  margin-top: 44px;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.gallery-grid figure,
.gallery-grid.gallery-grid-duplex figure {
  position: relative;
  grid-column: span 4;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(184, 144, 90, 0.18);
  border-radius: 20px;
  background: #d8ccbb;
  box-shadow: 0 18px 48px rgba(58, 44, 28, 0.1);
  cursor: zoom-in;
  isolation: isolate;
  transition:
    transform 380ms var(--detail-ease),
    box-shadow 380ms ease,
    border-color 380ms ease;
}

.gallery-grid figure:first-child,
.gallery-grid.gallery-grid-duplex figure:first-child {
  grid-column: span 8;
  grid-row: span 2;
}

.gallery-grid figure:nth-child(4),
.gallery-grid figure:nth-child(5),
.gallery-grid.gallery-grid-duplex figure:nth-child(4),
.gallery-grid.gallery-grid-duplex figure:nth-child(5),
.gallery-grid.gallery-grid-duplex figure:nth-child(9),
.gallery-grid.gallery-grid-duplex figure:nth-child(10),
.gallery-grid.gallery-grid-duplex figure:last-child {
  grid-column: span 6;
}

.gallery-grid figure::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(20, 21, 18, 0.5));
  opacity: 0.5;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) contrast(1.015);
  transform: scale(1.01);
  transition:
    transform 700ms var(--detail-ease),
    filter 400ms ease;
}

.gallery-index,
.gallery-expand {
  position: absolute;
  z-index: 2;
  bottom: 18px;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.gallery-index {
  left: 20px;
  font-family: var(--font-cormorant);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.gallery-expand {
  right: 20px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.gallery-expand::after {
  content: "+";
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  font-size: 0.85rem;
}

.gallery-grid figure:focus-visible {
  outline: 3px solid rgba(184, 144, 90, 0.62);
  outline-offset: 4px;
}

@media (hover: hover) {
  .gallery-grid figure:hover {
    z-index: 2;
    border-color: rgba(184, 144, 90, 0.42);
    box-shadow: var(--detail-shadow-hover);
    transform: translateY(-6px);
  }

  .gallery-grid figure:hover::after {
    opacity: 0.78;
  }

  .gallery-grid figure:hover img {
    filter: saturate(1.04) contrast(1.02);
    transform: scale(1.065);
  }
}

/* Amenities with a consistent line-icon language. */
.amenities {
  gap: 18px;
  margin-top: 42px;
}

.amenity-card {
  position: relative;
  min-height: 240px;
  padding: 34px;
  overflow: hidden;
  border: 1px solid var(--detail-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 18px 52px rgba(58, 44, 28, 0.08);
  transition:
    transform 320ms var(--detail-ease),
    box-shadow 320ms ease,
    border-color 320ms ease;
}

.amenity-card::after {
  content: "";
  position: absolute;
  right: -74px;
  bottom: -80px;
  width: 180px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(215, 178, 123, 0.2), transparent 68%);
  transition: transform 450ms var(--detail-ease);
  pointer-events: none;
}

.amenity-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 38px;
  border: 1px solid rgba(184, 144, 90, 0.32);
  border-radius: 50%;
  color: var(--detail-gold);
  background: rgba(184, 144, 90, 0.07);
}

.amenity-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.amenity-card h3,
.amenity-card p,
.amenity-icon {
  position: relative;
  z-index: 1;
}

.amenity-card h3 {
  margin-bottom: 14px;
  font-size: clamp(1.7rem, 2vw, 2.15rem);
}

.amenity-card p {
  max-width: 34ch;
  line-height: 1.65;
}

@media (hover: hover) {
  .amenity-card:hover {
    border-color: rgba(184, 144, 90, 0.34);
    box-shadow: 0 28px 68px rgba(58, 44, 28, 0.13);
    transform: translateY(-7px);
  }

  .amenity-card:hover::after {
    transform: scale(1.28);
  }
}

/* Accessible fullscreen gallery. */
.apartment-lightbox[hidden] {
  display: none;
}

.apartment-lightbox {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 22px;
  background: rgba(20, 21, 18, 0.92);
  color: #fff;
  opacity: 0;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: opacity 240ms ease;
}

.apartment-lightbox.is-open {
  opacity: 1;
}

.lightbox-topbar,
.lightbox-captionbar {
  width: min(1400px, 100%);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.lightbox-topbar {
  min-height: 54px;
}

.lightbox-brand,
.lightbox-count {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.lightbox-count {
  color: rgba(255, 255, 255, 0.62);
  font-variant-numeric: tabular-nums;
}

.lightbox-close,
.lightbox-nav {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms var(--detail-ease);
}

.lightbox-close svg,
.lightbox-nav svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.lightbox-stage {
  position: relative;
  width: min(1400px, 100%);
  min-height: 0;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  align-items: center;
  gap: 24px;
}

.lightbox-visual {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.lightbox-image {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100svh - 190px);
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 38px 100px rgba(0, 0, 0, 0.42);
  opacity: 1;
  transform: scale(1);
  transition:
    opacity 180ms ease,
    transform 280ms var(--detail-ease);
}

.lightbox-image.is-switching {
  opacity: 0;
  transform: scale(0.985);
}

.lightbox-captionbar {
  min-height: 62px;
  justify-content: center;
  text-align: center;
}

.lightbox-caption {
  max-width: 70ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.lightbox-close:hover,
.lightbox-nav:hover,
.lightbox-close:focus-visible,
.lightbox-nav:focus-visible {
  border-color: rgba(215, 178, 123, 0.72);
  outline: none;
  background: rgba(184, 144, 90, 0.22);
  transform: scale(1.05);
}

body.lightbox-open {
  overflow: hidden;
}

/* Scroll reveal: activated only when JavaScript is available. */
.apartment-enhanced .detail-reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition:
    opacity 700ms var(--detail-ease),
    transform 700ms var(--detail-ease);
  transition-delay: var(--detail-delay, 0ms);
}

.apartment-enhanced .detail-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Responsive composition. */
@media (max-width: 1050px) {
  .hero-grid {
    grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr);
    gap: 48px;
  }

  .hero h1 {
    font-size: clamp(3.6rem, 7vw, 5.5rem);
  }

  .hero-media {
    height: clamp(520px, 62svh, 680px);
  }
}

@media (max-width: 900px) {
  .hero {
    min-height: auto;
  }

  .hero .container,
  .section .container {
    width: min(100% - 40px, 760px);
  }

  .hero-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    gap: 40px;
  }

  .hero-media {
    height: clamp(520px, 76vw, 720px);
  }

  .booking-card {
    position: static;
  }

  .gallery-grid,
  .gallery-grid.gallery-grid-duplex {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: clamp(250px, 48vw, 380px);
  }

  .gallery-grid figure,
  .gallery-grid.gallery-grid-duplex figure,
  .gallery-grid figure:nth-child(4),
  .gallery-grid figure:nth-child(5),
  .gallery-grid.gallery-grid-duplex figure:nth-child(4),
  .gallery-grid.gallery-grid-duplex figure:nth-child(5),
  .gallery-grid.gallery-grid-duplex figure:nth-child(9),
  .gallery-grid.gallery-grid-duplex figure:nth-child(10),
  .gallery-grid.gallery-grid-duplex figure:last-child {
    grid-column: span 1;
  }

  .gallery-grid figure:first-child,
  .gallery-grid.gallery-grid-duplex figure:first-child {
    grid-column: span 2;
    grid-row: span 2;
  }
}

@media (max-width: 620px) {
  html {
    scroll-padding-top: 76px;
  }

  .hero {
    padding-block: 50px 72px;
  }

  .hero .container,
  .section .container {
    width: min(100% - 24px, 560px);
  }

  .hero h1 {
    margin-bottom: 20px;
    font-size: clamp(3rem, 15vw, 4.3rem);
  }

  .hero-media {
    height: clamp(390px, 116vw, 560px);
    border-radius: 20px;
  }

  .hero-media::before {
    right: 14px;
    bottom: 14px;
    padding: 8px 10px;
    font-size: 0.5rem;
  }

  .quick-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 28px;
    border-radius: 16px;
  }

  .quick-facts div {
    padding: 16px 9px;
    text-align: center;
  }

  .quick-facts strong {
    font-size: 1.75rem;
  }

  .quick-facts span {
    font-size: 0.58rem;
    letter-spacing: 0.02em;
  }

  .section {
    padding-block: 78px;
  }

  .section h2 {
    font-size: clamp(2.5rem, 12vw, 3.55rem);
  }

  .split {
    gap: 46px;
  }

  .info-card {
    min-height: 92px;
    padding: 20px 18px 20px 68px;
  }

  .info-card::before {
    left: 19px;
  }

  .info-card::after {
    left: 52px;
  }

  .booking-card {
    border-radius: 20px;
  }

  .gallery-grid,
  .gallery-grid.gallery-grid-duplex {
    grid-template-columns: 1fr;
    grid-auto-rows: clamp(300px, 104vw, 470px);
    gap: 12px;
    margin-top: 34px;
  }

  .gallery-grid figure,
  .gallery-grid.gallery-grid-duplex figure,
  .gallery-grid figure:first-child,
  .gallery-grid.gallery-grid-duplex figure:first-child {
    grid-column: 1;
    grid-row: span 1;
    border-radius: 16px;
  }

  .amenities {
    gap: 12px;
    margin-top: 32px;
  }

  .amenity-card {
    min-height: 220px;
    padding: 28px;
  }

  .amenity-icon {
    margin-bottom: 30px;
  }

  .apartment-lightbox {
    padding: 12px;
  }

  .lightbox-stage {
    grid-template-columns: 1fr;
  }

  .lightbox-nav {
    position: absolute;
    z-index: 3;
    top: 50%;
    width: 46px;
    height: 46px;
    transform: translateY(-50%);
    background: rgba(20, 21, 18, 0.52);
  }

  .lightbox-nav:hover,
  .lightbox-nav:focus-visible {
    transform: translateY(-50%) scale(1.04);
  }

  .lightbox-prev {
    left: 6px;
  }

  .lightbox-next {
    right: 6px;
  }

  .lightbox-image {
    max-height: calc(100svh - 160px);
    border-radius: 6px;
  }

  .lightbox-captionbar {
    min-height: 46px;
  }

  .lightbox-caption {
    font-size: 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-media img,
  .gallery-grid img,
  .gallery-grid figure,
  .info-card,
  .amenity-card,
  .apartment-lightbox,
  .lightbox-image,
  .detail-reveal,
  .nav .btn::after,
  .booking-card .btn::after {
    transition: none !important;
    animation: none !important;
  }

  .apartment-enhanced .detail-reveal {
    opacity: 1;
    transform: none;
  }
}
