/* ==========================================================================
   A single listing's own page

   Same palette and rhythm as the rest of the site. Built so one template can
   carry a hotel, a surf school and a gym without looking like a form: the
   details panel is whatever rows the editor puts in it, so a hotel shows
   seasons and a surf school shows lesson prices.
   ========================================================================== */

.sp-listing-page {
  --lp-teal:      #427c78;
  --lp-teal-deep: #2f5f5c;
  --lp-teal-soft: #eef4f3;
  --lp-ink:       #232c2b;
  --lp-soft:      #5f6f6c;
  --lp-line:      #e2eae8;
  --lp-sand:      #faf8f4;

  background: var(--lp-sand);
  color: var(--lp-ink);
  font-family: "Heebo", sans-serif;
}

.sp-listing-page h1,
.sp-listing-page h2,
.sp-listing-page h3 { margin: 0; color: inherit; text-shadow: none; }

.lp-wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ------------------------------------------------------------------ hero -- */

.lp-hero {
  position: relative;
  min-height: 460px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  isolation: isolate;
  background: var(--lp-teal-soft);
}

.lp-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.lp-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(18, 30, 28, .86) 0%, rgba(18, 30, 28, .35) 55%, rgba(18, 30, 28, .1) 100%);
}

.lp-hero-body { padding: 0 0 44px; color: #fff; }

.lp-eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: #9fd2cc;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.lp-hero h1 {
  font-family: "Amatic SC", cursive;
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 700;
  line-height: .98;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .4);
}

/* ------------------------------------------------------------------ body -- */

.lp-main {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 56px;
  padding: 64px 0 24px;
  align-items: start;
}

.lp-section + .lp-section { margin-top: 48px; }

.lp-h2 {
  margin-bottom: 16px;
  font-family: "Amatic SC", cursive;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1;
  color: var(--lp-teal);
}

.lp-body {
  color: var(--lp-soft);
  font-size: 1.0625rem;
  line-height: 1.8;
}
.lp-body p { margin: 0 0 16px; color: inherit; }

/* --------------------------------------------------------------- photos -- */

.lp-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.lp-photo {
  position: relative;
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--lp-teal-soft);
}

.lp-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .3s ease;
}
.lp-photo:hover img { transform: scale(1.04); }

/* ---------------------------------------------------------- details card -- */

.lp-panel {
  position: sticky;
  top: 24px;
  padding: 28px;
  border: 1px solid var(--lp-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(35, 44, 43, .04), 0 10px 28px rgba(35, 44, 43, .06);
}

.lp-panel + .lp-panel { margin-top: 20px; }

.lp-panel h2 {
  margin-bottom: 18px;
  font-family: "Amatic SC", cursive;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--lp-teal);
}

.lp-rows { list-style: none; margin: 0; padding: 0; }

.lp-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--lp-line);
}
.lp-row:last-child { border-bottom: 0; }

.lp-row-label { color: var(--lp-soft); font-size: .9375rem; }

.lp-row-value {
  color: var(--lp-ink);
  font-size: 1rem;
  font-weight: 600;
  text-align: right;
}

.lp-contact a { color: var(--lp-teal); font-weight: 600; }
.lp-contact a:hover { color: var(--lp-teal-deep); }

.lp-back {
  display: inline-block;
  margin: 8px 0 56px;
  color: var(--lp-teal);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.lp-back::before { content: "\2190  "; }

.lp-empty {
  color: var(--lp-soft);
  font-size: .9375rem;
  font-style: italic;
}

/* ----------------------------------------------------------- responsive -- */

@media (max-width: 900px) {
  .lp-main { grid-template-columns: 1fr; gap: 40px; padding-top: 44px; }
  .lp-panel { position: static; }
  .lp-hero { min-height: 340px; }
  .lp-photos { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .lp-photos { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .lp-photo img { transition: none; }
  .lp-photo:hover img { transform: none; }
}

/* ------------------------------------------------------------- editing -- */

/* Controls exist in the markup for editors only; they stay hidden until
   editing is switched on. */
.lp-row-delete,
.lp-add-row { display: none; }

body.cms-editing .lp-row { position: relative; padding-right: 26px; }

body.cms-editing .lp-row-delete {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  display: block;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #c8503c;
  color: #fff;
  font-size: .8125rem;
  line-height: 1;
  cursor: pointer;
}
body.cms-editing .lp-row-delete:hover { background: #a53d2c; }

body.cms-editing .lp-add-row {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 10px;
  border: 2px dashed rgba(66, 124, 120, .5);
  border-radius: 10px;
  background: rgba(66, 124, 120, .05);
  color: var(--lp-teal);
  font: inherit;
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
}
body.cms-editing .lp-add-row:hover { border-color: var(--lp-teal); background: rgba(66, 124, 120, .1); }

/* The "add photo" tile, shaped like the photos it sits among.

   width and min-height are reset explicitly: this button also carries
   .sp-add-place, whose 260px min-height combined with the 4/3 aspect-ratio
   made the browser derive a 347px width from the height and overflow the
   grid cell. */
body.cms-editing button.lp-photo {
  width: 100%;
  min-height: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  aspect-ratio: 4 / 3;
  border: 2px dashed rgba(66, 124, 120, .5);
  background: rgba(66, 124, 120, .05);
  color: var(--lp-teal);
  cursor: pointer;
}
body.cms-editing button.lp-photo:hover { border-color: var(--lp-teal); background: rgba(66, 124, 120, .1); }

body.cms-editing .lp-photo .sp-edit-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  display: block;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: #c8503c;
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

/* The cover photo control sits over the hero. */
body.cms-editing .lp-hero { position: relative; }
body.cms-editing .lp-hero .sp-edit-photo {
  position: absolute;
  top: 16px;
  right: 16px;
  bottom: auto;
  z-index: 2;
}

/* An empty row still needs something to aim at. */
body.cms-editing [data-cms-detail-field]:empty::before {
  content: attr(data-cms-placeholder);
  opacity: .5;
  font-style: italic;
  font-weight: 400;
}
body.cms-editing [data-cms-detail-field] {
  outline: 1px dashed rgba(66, 124, 120, .55);
  outline-offset: 2px;
  border-radius: 2px;
  min-width: 4ch;
  display: inline-block;
  cursor: text;
}
body.cms-editing [data-cms-detail-field]:focus {
  outline: 2px solid var(--lp-teal);
  background: rgba(255, 255, 255, .7);
}
