/* A Place to Feel at Home block
   Figma: Life In Our Homes Campaign — node 35:535 */

.place-home {
  position: relative;
  overflow: hidden;
  background-color: #fff5eb;
  padding-top: 4.5rem;
  padding-bottom: 4.5rem;
}

/* Remove the global "section+section { margin-top: 70px }" gap — the design
   runs these bands flush. */
section + .place-home {
  margin-top: 0;
}

/* Daisy illustration, bottom-left. The design hangs it 12px off the left edge
   of the page and paints it behind the section content, so the gallery covers
   whatever it overlaps. */
.place-home__decoration {
  position: absolute;
  left: -12px;
  bottom: 0;
  z-index: 0;
  width: 163px;
  pointer-events: none;
}

.place-home__decoration img {
  display: block;
  width: 100%;
  height: auto;
}

/* The design stacks heading, copy, gallery and CTA in a centred column with a
   uniform 32px rhythm. */
.place-home__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  text-align: center;
}

.place-home__heading {
  margin: 0;
  font-family: 'pp-hatton', Georgia, 'Times New Roman', serif;
  font-weight: 200;
  font-size: clamp(2rem, 4vw, 2.8125rem);
  line-height: 1.1;
  color: #006d8f;
}

.place-home__heading em {
  font-style: italic;
  font-weight: 200;
}

.place-home__intro {
  max-width: 918px;
  margin: 0 auto;
  font-family: 'gesta', sans-serif;
  font-weight: 400;
  font-size: 0.9375rem;
  line-height: normal;
  color: #1c1c1c;
}

/* The design separates paragraphs with a blank line; 1.125rem reproduces that
   gap without the editor having to type empty paragraphs. */
.place-home__intro p {
  margin: 0 0 1.125rem;
}

.place-home__intro > :last-child {
  margin-bottom: 0;
}

.place-home__intro a {
  color: #006d8f;
  text-decoration: underline;
}

.place-home__intro a:hover,
.place-home__intro a:focus {
  text-decoration: none;
}

/* Gallery — three across, 22px apart. The aspect ratio is the design's
   348 x 450 tile, so the images keep their proportions as the container
   narrows instead of being locked to a fixed height. */
.place-home__gallery {
  width: 100%;
  margin: 0;
}

.place-home__gallery:not(.slick-initialized) {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.place-home__item {
  margin: 0;
}

.place-home__item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 348 / 450;
  object-fit: cover;
}

/* Optional CTA. The section sits on cream, so this uses the design's on-light
   button (teal fill, cream label) rather than the hero's inverted pairing. */
.place-home__btn.btn.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 11px 20px;
  background-color: #006d8f;
  border: 0;
  border-radius: 0;
  font-family: 'gesta', sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 25px;
  letter-spacing: 0.266px;
  text-transform: capitalize;
  white-space: nowrap;
  color: #fff5eb;
  box-shadow: none;
}

.place-home__btn.btn.btn-primary:hover,
.place-home__btn.btn.btn-primary:focus {
  background-color: #005775;
  color: #fff5eb;
}

.place-home__btn.btn.btn-primary .icon {
  display: inline-flex;
  width: 14px;
  height: 11px;
  margin: 0;
  padding: 0;
}

.place-home__btn.btn.btn-primary .icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Tablet keeps the three-across layout from the design. */
@media (max-width: 991px) {
  .place-home {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }

  .place-home__inner {
    gap: 1.5rem;
  }

  /* Below this width the content column reaches the viewport edge, leaving no
     margin for the illustration to sit in without fouling the gallery. */
  .place-home__decoration {
    display: none;
  }
}

/* Mobile: one image at a time. Galleries of three or fewer stay as a plain
   stack (no Slick is initialised for them). */
@media (max-width: 767px) {
  .place-home__gallery:not(.slick-initialized) {
    grid-template-columns: 1fr;
  }
}

/* Slick carousel — only ever active below 768px, see place-to-feel-at-home.php */
.place-home__gallery.slick-initialized {
  position: relative;
}

/* Slick has no gap of its own, so pad each slide and pull the track back by the
   same amount to reproduce the grid's 22px spacing. */
.place-home__gallery .slick-list {
  margin: 0 -11px;
}

.place-home__gallery .slick-slide {
  height: auto;
  padding: 0 11px;
}

/* One image per slide on mobile, so it should run full width. */
@media (max-width: 767px) {
  .place-home__gallery .slick-list {
    margin: 0;
  }

  .place-home__gallery .slick-slide {
    padding: 0;
  }
}

.place-home__gallery .slick-dots {
  position: static;
  margin: 1rem 0 0;
  padding: 0;
  line-height: 0;
}

.place-home__gallery .slick-dots li button:before {
  color: #006d8f;
  opacity: 0.35;
  font-size: 8px;
}

.place-home__gallery .slick-dots li.slick-active button:before {
  color: #006d8f;
  opacity: 1;
}

.place-home__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  transform: translateY(-50%);
  background-color: #fff5eb;
  border: 0;
  color: #006d8f;
}

.place-home__nav--prev {
  left: 10px;
}

.place-home__nav--next {
  right: 10px;
}

.place-home__nav:hover,
.place-home__nav:focus {
  background-color: #006d8f;
  color: #fff5eb;
}

.place-home__nav.slick-disabled {
  opacity: 0.4;
  pointer-events: none;
}
