/* Costa Tropical Real Estate — "about us" heading and the town photo cards
   under the Golden Property grid on the homepage (page 7864).
   Block markup source: site/pages/home-about.html. Colours and type come from
   the Costa Estates design tokens (--cse-*), which the plugin prints on every
   page; see the plugin's docs/DESIGN.md. */

body.home {
  overflow-x: clip;
}

/* Astra pads every top-level group in .entry-content; these bands line up
   with the Golden Property grid above instead, so the page keeps one edge. */
body.home .entry-content > .wp-block-group.ct-h {
  --ct-h-band: clamp(48px, 7vw, 96px);
  position: relative;
  isolation: isolate;
  margin: 0;
  padding: var(--ct-h-band) 0;
  font-family: var(--cse-font);
  font-size: max(1rem, 16px);
  line-height: 1.65;
  color: var(--cse-text, #44504e);
}

/* Full-bleed grounds behind the content column. */
.home .ct-h::before {
  content: "";
  position: absolute;
  inset: 0 calc(50% - 50vw);
  z-index: -1;
  background: var(--cse-surface, #fff);
}

body.home .entry-content > .wp-block-group.ct-h-regions {
  padding-bottom: 48px;
}

.home .ct-h-regions::before {
  background: var(--cse-surface-alt, #f4f0e8);
}

.home .ct-h p {
  margin: 0 0 16px;
}

.home .ct-h > :last-child,
.home .ct-h p:last-child {
  margin-bottom: 0;
}

/* ------------------------------------------------------------------ type */

.home .ct-h h2 {
  font-family: var(--cse-font-display);
  font-optical-sizing: auto;
  color: var(--cse-ink, #12201f);
  text-transform: none;
}

.home .ct-h .ct-h-title {
  max-width: 20ch;
  margin: 0 0 16px;
  font-size: clamp(30px, 3.2vw, 40px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.home .ct-h .ct-h-lead {
  max-width: 40rem;
  font-size: max(1.0625rem, 17px);
}

.home .ct-h .ct-h-textlink {
  margin-top: 8px;
  font-size: 15px;
  font-weight: 600;
}

.home .ct-h-textlink a {
  display: inline-block;
  margin-inline: -6px;
  padding: 10px 6px;
  color: var(--cse-primary, #0f5563);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.home .ct-h-textlink a:hover {
  color: var(--cse-primary-hover, #0a4350);
}

.home .ct-h-textlink a:focus-visible {
  outline: 2px solid var(--cse-primary, #0f5563);
  /* Inside the tap padding, clear of the letters and the underline. */
  outline-offset: -4px;
  border-radius: 2px;
}

/* ----------------------------------------------------------------- about */

.home .ct-h-about__text {
  max-width: 40rem;
}

/* ---------------------------------------------------------- town cards */

.home .ct-h .ct-h-places {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.home .ct-h-place {
  margin: 0;
}

.home .ct-h-place a {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: var(--cse-radius-lg, 10px);
  background: var(--cse-slate, #0f2a2c);
  color: var(--cse-on-dark, #f4f0e8);
  text-decoration: none;
  isolation: isolate;
}

.home .ct-h-place img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Shade the lower part so the name reads on any photo. */
.home .ct-h-place a::after {
  content: "";
  position: absolute;
  inset: 40% 0 0;
  z-index: -1;
  background: linear-gradient(to top, color-mix(in srgb, var(--cse-slate, #0f2a2c) 82%, transparent), transparent);
}

.home .ct-h-place__text {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  display: grid;
  gap: 2px;
}

.home .ct-h-place__name {
  text-wrap: balance;
  font-family: var(--cse-font-display);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--cse-on-dark, #f4f0e8);
}

.home .ct-h-place__area {
  text-wrap: balance;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.3;
  color: color-mix(in srgb, var(--cse-on-dark, #f4f0e8) 85%, transparent);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .home .ct-h-place img {
    transition: transform 600ms var(--cse-ease, ease);
  }

  .home .ct-h-place a:hover img {
    transform: scale(1.04);
  }
}

.home .ct-h-place a:focus-visible {
  outline: 3px solid var(--cse-primary, #0f5563);
  outline-offset: 3px;
}

/* Photo credits the licences ask for: present, but quiet. */
.home .ct-h .ct-h-credits {
  max-width: 72ch;
  margin: 24px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--cse-muted, #5e6967);
}

.home .ct-h-credits a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

/* Narrow phones: two cards of about 150 px; keep town names on one line. */
@media (max-width: 380px) {
  .home .ct-h-place__text {
    left: 12px;
    right: 10px;
    bottom: 12px;
  }

  .home .ct-h-place__name {
    font-size: 18px;
  }
}

/* --------------------------------------------------------------- tablets+ */

@media (min-width: 600px) {
  .home .ct-h .ct-h-places {
    gap: 16px;
  }
}

@media (min-width: 768px) {
  .home .ct-h .ct-h-places {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 922px) {
  /* Heading on the left, text on the right: a short, calm band. */
  .home .ct-h-about {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: clamp(48px, 6vw, 96px);
    align-items: start;
  }

  .home .ct-h-about .ct-h-title {
    margin-bottom: 0;
  }

  .home .ct-h .ct-h-places {
    gap: 24px;
  }

  .home .ct-h-place__text {
    left: 20px;
    right: 20px;
    bottom: 18px;
  }

  .home .ct-h-place__name {
    font-size: 24px;
  }

  /* 4:5 so both rows of towns fit on one desktop screen. */
  .home .ct-h-place a {
    aspect-ratio: 4 / 5;
  }
}

/* The yellow stripe under the last band sits flush, as it does under the grid. */
body.home .entry-content > .ct-h-regions + hr.wp-block-separator {
  margin-top: 0;
}

