/* =====================================================
   Sea Sky Samui Villas — homepage
   Follows the Oliver's Travels homepage structure,
   sharing the design language of villa-pages/.
   ===================================================== */

/* Design tokens (palette, radius, shadow) now live in tokens.css,
   loaded before this file on every page — edit colours there. */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--navy);
  font-family: "Manrope", sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { display: block; }
a { color: inherit; }

h1, h2, h3 {
  font-family: "Fraunces", serif;
  font-weight: 500;
  margin: 0;
}

/* ---------- header ---------- */

.hm-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 4vw;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.hm-brand a {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Logo image (replaces text brand) */
.hm-logo { height: 58px; width: auto; display: block; }
.hm-logo--light { display: none; }   /* default (solid nav): show dark version */
/* Homepage: over the hero the nav is transparent -> use the white-text logo */
.hm-home .hm-nav:not(.is-solid) .hm-logo--light { display: block; }
.hm-home .hm-nav:not(.is-solid) .hm-logo--dark  { display: none; }

.hm-brand-mark {
  font-family: "Fraunces", serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--navy);
}

.hm-brand-sub {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--navy-soft);
}

.hm-links { display: flex; gap: 28px; }

.hm-links a {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
}

.hm-links a:hover { color: var(--coral); }

.hm-nav-cta {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--wa-green);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 22px;
  border-radius: 999px;
}

.hm-nav-cta:hover { background: var(--wa-green-dark); }

.wa-icon { width: 17px; height: 17px; flex: none; }

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

.hm-hero {
  position: relative;
  min-height: 100vh;
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  padding: 22vh 5vw 6vh;
}

.hm-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 30, 42, 0.42) 0%, rgba(10, 30, 42, 0.18) 45%, rgba(10, 30, 42, 0.52) 100%);
}

.hm-hero > * { position: relative; }

.hm-hero h1 {
  color: #fff;
  font-size: clamp(2.6rem, 6.4vw, 5.2rem);
  line-height: 1.0;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 34px rgba(0, 0, 0, 0.4);
}

.hm-hero h1 em {
  font-style: italic;
  font-weight: 400;
}

.hm-hero-sub {
  color: #f0ece2;
  font-size: clamp(1rem, 1.6vw, 1.22rem);
  margin: 22px 0 0;
  max-width: 34ch;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.45);
}

/* search-style villa finder */

.hm-finder {
  margin-top: 30px;
  display: flex;
  align-items: stretch;
  gap: 0;
  background: rgba(18, 30, 42, 0.34);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.30);
  border-radius: 999px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.32);
  width: fit-content;
  max-width: min(560px, 100%);
  padding: 5px 5px 5px 4px;
  text-align: left;
  transition: background 700ms ease, border-color 700ms ease,
    box-shadow 700ms ease, padding 950ms cubic-bezier(.45, 0, .25, 1),
    backdrop-filter 700ms ease;
}

/* fields wrapper — animates open/closed */
.hm-finder-fields {
  display: flex;
  align-items: stretch;
  overflow: hidden;
  max-width: 460px;
  opacity: 1;
  transition: max-width 950ms cubic-bezier(.45, 0, .25, 1),
    opacity 620ms ease 260ms;
}

/* collapsed: just the magnifying-glass button */
.hm-finder--collapsed {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
}

.hm-finder--collapsed .hm-finder-fields {
  max-width: 0;
  opacity: 0;
  transition: max-width 680ms cubic-bezier(.5, 0, .3, 1),
    opacity 360ms ease;
}

.hm-finder--collapsed .hm-finder-btn {
  margin-left: 0;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.38);
}

/* expand triggers — hover (pointer devices), keyboard focus, or tap-open (touch) */
.hm-finder--collapsed.is-open,
.hm-finder--collapsed:focus-within {
  background: rgba(18, 30, 42, 0.34);
  border-color: rgba(255, 255, 255, 0.30);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  padding: 5px 5px 5px 4px;
}

.hm-finder--collapsed.is-open .hm-finder-fields,
.hm-finder--collapsed:focus-within .hm-finder-fields {
  max-width: 460px;
  opacity: 1;
  transition: max-width 950ms cubic-bezier(.45, 0, .25, 1),
    opacity 620ms ease 260ms;
}

.hm-finder--collapsed.is-open .hm-finder-btn,
.hm-finder--collapsed:focus-within .hm-finder-btn {
  margin-left: 8px;
  box-shadow: none;
}

.hm-finder-field {
  padding: 8px 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.28);
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;   /* clip content while the pill is mid-expand (no reflow) */
}

.hm-finder-field label {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;   /* never wrap to a 2nd/3rd line during the reveal */
}

.hm-finder-field select {
  border: none;
  outline: none;
  background: transparent;
  font-family: "Manrope", sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  padding: 2px 0;
  cursor: pointer;
  white-space: nowrap;
  max-width: 100%;
  text-overflow: ellipsis;
}

.hm-finder-field select option { color: var(--navy); }

.hm-finder-btn {
  flex: 0 0 auto;
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  border: none;
  cursor: pointer;
  text-decoration: none;
  margin-left: 8px;
  transition: background 300ms ease, color 300ms ease, transform 300ms ease,
    margin-left 760ms cubic-bezier(.45, 0, .25, 1),
    box-shadow 700ms ease;
}

.hm-finder-btn:hover { background: var(--navy); color: #fff; transform: scale(1.05); }

/* ---------- quick categories: full-bleed carousel ---------- */

.hm-cats-section { padding: 70px 0 0; }

.hm-cats-head {
  padding: 0 4vw 28px;
}

.hm-cats-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }

.hm-cats {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.hm-cats::-webkit-scrollbar { display: none; }

.hm-cat {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: min(88vh, 860px);
  scroll-snap-align: start;
  display: flex;
  align-items: flex-start;
  text-decoration: none;
  background-size: cover;
  background-position: center;
}

.hm-cat::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 30, 42, 0.55) 0%, rgba(10, 30, 42, 0.12) 38%, rgba(10, 30, 42, 0) 60%);
  transition: background 0.3s ease;
}

.hm-cat:hover::before {
  background: linear-gradient(180deg, rgba(10, 30, 42, 0.65) 0%, rgba(10, 30, 42, 0.25) 45%, rgba(10, 30, 42, 0.1) 100%);
}

.hm-cat-body {
  position: relative;
  padding: 44px 38px;
}

.hm-cat-title {
  font-family: "Fraunces", serif;
  font-weight: 500;
  color: #fff;
  font-size: clamp(1.7rem, 2.6vw, 2.5rem);
  margin: 0 0 14px;
  text-shadow: 0 1px 20px rgba(0, 0, 0, 0.3);
}

.hm-cat-link {
  display: inline-block;
  color: #fff;
  font-size: clamp(0.95rem, 1.2vw, 1.15rem);
  font-weight: 600;
  padding-bottom: 6px;
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35);
}

/* ---------- trust band (Only the unforgettable) ---------- */

.hm-trust {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6vw;
  align-items: center;
  padding: 90px 8vw;
  background: var(--sky);
}

.hm-trust-words {
  font-family: "Fraunces", serif;
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  line-height: 1.02;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.hm-trust-words span { display: block; }
.hm-trust-words .accent { color: var(--coral); font-style: italic; text-transform: none; }

.hm-trust-copy p {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--navy-soft);
  margin: 0 0 22px;
  max-width: 560px;
}

.hm-trust-chips { display: flex; flex-wrap: wrap; gap: 10px; }

.hm-trust-chips span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 0.82rem;
  font-weight: 700;
}

.hm-trust-chips .tick { width: 15px; height: 15px; color: var(--sea); }

/* ---------- promo band ---------- */

.hm-promo {
  background: var(--navy-deep);
  color: #ecf3f5;
  text-align: center;
  padding: 76px 6vw;
}

.hm-promo-kicker {
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #f3c14b;
  font-weight: 800;
  margin: 0 0 14px;
}

.hm-promo h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  color: #fff;
  margin-bottom: 16px;
}

.hm-promo p {
  max-width: 560px;
  margin: 0 auto 30px;
  font-size: 1rem;
  line-height: 1.7;
  color: #bcd2da;
}

.hm-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--wa-green);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.98rem;
  padding: 15px 28px;
  border-radius: 999px;
}

.hm-wa:hover { background: var(--wa-green-dark); }
.hm-wa .wa-icon { width: 20px; height: 20px; }

/* ---------- areas marquee ---------- */

.hm-areas { padding: 70px 0 10px; overflow: hidden; }

.hm-areas-head {
  text-align: center;
  padding: 0 4vw 34px;
}

.hm-areas-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }

.hm-marquee {
  display: flex;
  gap: 48px;
  white-space: nowrap;
  animation: hm-scroll 36s linear infinite;
  width: max-content;
  padding: 10px 0 26px;
}

.hm-marquee span {
  font-family: "Fraunces", serif;
  font-size: clamp(1.6rem, 3.4vw, 2.6rem);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--navy);
  opacity: 0.85;
}

.hm-marquee .dot { color: var(--coral); }

@keyframes hm-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.hm-areas-cta { text-align: center; padding: 8px 0 40px; }

.hm-link {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--coral);
  text-decoration: none;
  border-bottom: 2px solid var(--coral);
  padding-bottom: 3px;
}

/* ---------- handpicked story + villas ---------- */

.hm-story {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6vw;
  align-items: center;
  padding: 80px 6vw 40px;
}

.hm-story-media {
  position: relative;
}

.hm-story-media img {
  width: 100%;
  height: 460px;
  object-fit: cover;
  border-radius: var(--radius);
}

.hm-story-media img.overlap {
  position: absolute;
  width: 55%;
  height: 240px;
  right: -8%;
  bottom: -14%;
  border: 6px solid var(--cream);
  border-radius: var(--radius);
}

.hm-kicker {
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 800;
  margin: 0 0 12px;
}

.hm-story-copy h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  margin-bottom: 18px;
}

.hm-story-copy p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--navy-soft);
  margin: 0 0 16px;
  max-width: 540px;
}

/* villa cards */

.hm-villas { padding: 60px 4vw 30px; }

.hm-villas-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}

.hm-villas-head h2 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); }

.hm-villa-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.hm-villa-card {
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hm-villa-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.hm-villa-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.hm-villa-card:hover img { transform: scale(1.04); }

.hm-villa-body { padding: 18px 22px 22px; }

.hm-villa-area {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 800;
  margin: 0 0 6px;
}

.hm-villa-body h3 { font-size: 1.35rem; margin-bottom: 6px; color: var(--navy); }

.hm-villa-meta {
  font-size: 0.84rem;
  color: var(--navy-soft);
  margin: 0;
}

/* ---------- contact band (replaces newsletter) ---------- */

.hm-contact {
  text-align: center;
  padding: 90px 6vw;
}

.hm-contact h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  margin-bottom: 14px;
}

.hm-contact h2 em { font-style: italic; color: var(--coral); }

.hm-contact p {
  max-width: 520px;
  margin: 0 auto 30px;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--navy-soft);
}

/* ---------- footer ---------- */

.hm-footer {
  background: var(--navy-deep);
  color: #bcd2da;
  padding: 54px 4vw 30px;
}

.hm-footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.hm-footer .hm-brand-mark { color: #fff; }
.hm-footer .hm-brand-sub { color: #7fa2b0; }
.hm-footer-logo { display: block; height: 92px; width: auto; margin-bottom: 4px; }

.hm-footer-about {
  font-size: 0.88rem;
  line-height: 1.65;
  color: #9fbcc7;
  max-width: 300px;
  margin: 14px 0 0;
}

.hm-footer h4 {
  font-family: "Manrope", sans-serif;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7fa2b0;
  margin: 0 0 14px;
}

.hm-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.hm-footer ul a {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: #d7e5ea;
}

.hm-footer ul a:hover { color: #fff; }

.hm-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 24px;
  font-size: 0.78rem;
}

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

@media (max-width: 1080px) {
  .hm-villa-grid { grid-template-columns: 1fr 1fr; }
  .hm-footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .hm-links { display: none; }

  .hm-hero { min-height: 100vh; padding: 18vh 6vw 5vh; }

  .hm-finder { flex-direction: column; border-radius: 26px; padding: 8px; align-items: stretch; width: 100%; }
  .hm-finder-fields { flex-direction: column; width: 100%; max-width: none; max-height: 320px; transition: max-height 950ms cubic-bezier(.45, 0, .25, 1), opacity 620ms ease 260ms; }
  .hm-finder-field { border-right: none; border-bottom: 1px solid rgba(255, 255, 255, 0.22); }
  .hm-finder-btn { width: 100%; height: 52px; border-radius: 16px; margin-left: 0; margin-top: 8px; }

  /* collapsed on mobile: round icon button only */
  .hm-finder--collapsed { flex-direction: row; width: fit-content; border-radius: 999px; padding: 0; }
  .hm-finder--collapsed .hm-finder-fields { max-height: 0; max-width: 0; transition: max-height 680ms cubic-bezier(.5, 0, .3, 1), opacity 360ms ease; }
  .hm-finder--collapsed .hm-finder-btn { width: 58px; height: 58px; border-radius: 50%; margin-top: 0; }

  /* mobile expand (tap-open or focus): back to the stacked card */
  .hm-finder--collapsed.is-open,
  .hm-finder--collapsed:focus-within { flex-direction: column; width: 100%; border-radius: 26px; padding: 8px; }
  .hm-finder--collapsed.is-open .hm-finder-fields,
  .hm-finder--collapsed:focus-within .hm-finder-fields { flex-direction: column; max-height: 320px; max-width: none; }
  .hm-finder--collapsed.is-open .hm-finder-btn,
  .hm-finder--collapsed:focus-within .hm-finder-btn { width: 100%; height: 52px; border-radius: 16px; margin-top: 8px; margin-left: 0; }

  .hm-cat { flex: 0 0 86vw; height: 66vh; }
  .hm-cat-body { padding: 28px 24px; }

  .hm-trust { grid-template-columns: 1fr; gap: 30px; padding: 60px 6vw; }

  .hm-story { grid-template-columns: 1fr; }
  .hm-story-media img.overlap { display: none; }
  .hm-story-media img { height: 300px; }

  .hm-villa-grid { grid-template-columns: 1fr; }

  .hm-footer-top { grid-template-columns: 1fr; }
}

/* ===== Guest reviews (homepage testimonials) ===== */
.hm-reviews { padding: 90px 6vw; background: var(--cream); }
.hm-reviews[hidden] { display: none; }
.hm-reviews-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.hm-reviews-head h2 {
  font-family: "Fraunces", serif; font-weight: 500; color: var(--navy);
  font-size: clamp(1.8rem, 3.2vw, 2.4rem); margin: 8px 0 0; line-height: 1.15;
}
.hm-reviews-head h2 em { font-style: italic; color: var(--coral); }
.hm-reviews-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px; max-width: 1080px; margin: 0 auto;
}
.hm-review-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 32px 28px; box-shadow: var(--shadow); margin: 0;
  display: flex; flex-direction: column; gap: 16px;
}
.hm-review-stars { color: var(--gold); letter-spacing: 3px; margin: 0; font-size: 0.95rem; }
.hm-review-card blockquote {
  margin: 0; font-family: "Fraunces", serif; font-size: 1.15rem; line-height: 1.55; color: var(--navy-deep);
}
.hm-review-card figcaption { color: var(--navy-soft); font-size: 0.9rem; font-weight: 700; }

/* ===== Homepage: transparent nav over the hero, solid on scroll ===== */
.hm-home .hm-nav {
  position: fixed;
  left: 0;
  right: 0;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  transition: background 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}
.hm-home .hm-nav:not(.is-solid) .hm-brand-mark,
.hm-home .hm-nav:not(.is-solid) .hm-brand-sub,
.hm-home .hm-nav:not(.is-solid) .hm-links a {
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.30);
}
.hm-home .hm-nav.is-solid {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 24px rgba(17, 58, 79, 0.09);
}
