/* =========================================================
   home.css — เฉพาะหน้าแรก
   ========================================================= */

/* ---------- Hero ---------- */
.hero { padding: .75rem; }
.hero__frame {
  position: relative; isolation: isolate; overflow: hidden; display: flex;
  min-height: min(calc(100svh - 1.5rem), 960px); padding-block: 8rem 2.5rem;
  border-radius: var(--radius-lg); background: var(--c-navy); color: #fff;
}
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__bg { width: 100%; height: 100%; animation: kenburns 22s ease-out both; }
.hero__frame::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgb(7 26 51 / .6) 0%, rgb(7 26 51 / .25) 45%, transparent 70%),
    linear-gradient(180deg, rgb(7 26 51 / .5) 0%, rgb(7 26 51 / 0) 30%, rgb(7 26 51 / .1) 55%, rgb(7 26 51 / .82) 100%);
}
@keyframes kenburns { from { transform: scale(1.18); } to { transform: scale(1); } }
.hero__inner { display: flex; flex-direction: column; justify-content: flex-end; gap: 2.5rem; }
.hero__kicker { display: inline-flex; align-items: center; gap: .75rem; font-size: var(--fs-xs); letter-spacing: .24em; text-transform: uppercase; color: rgb(255 255 255 / .85); }
.hero__kicker span { width: 40px; height: 1px; background: currentColor; }
.hero__title { max-width: 980px; font-size: clamp(3rem, 1.6rem + 5.4vw, 6.25rem); line-height: 1.1; color: #fff; }
.hero__title .accent { color: var(--c-aqua); }
.hero__title .h-th { margin-top: 1.5rem; color: rgb(255 255 255 / .85); }
.hero__title .line { display: block; overflow: hidden; padding-bottom: .08em; }
.hero__title .line > span { display: inline-block; }
.js .hero__title .line > span { transform: translateY(110%); animation: line-up 1.2s var(--ease-out) forwards; }
.js .hero__title .line:nth-child(1) > span { animation-delay: var(--hero-delay, .15s); }
.js .hero__title .line:nth-child(2) > span { animation-delay: calc(var(--hero-delay, .15s) + .12s); }
.js .hero__title .line:nth-child(3) > span { animation-delay: calc(var(--hero-delay, .15s) + .24s); }
.js .hero__kicker, .js .hero__bottom, .js .hero__title .h-th { opacity: 0; animation: fade-up 1.2s var(--ease-out) calc(var(--hero-delay, .15s) + .45s) forwards; }
@keyframes line-up { to { transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.hero__bottom { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem; }
.hero__stats { display: flex; align-items: stretch; }
.hero__stats li { display: grid; gap: .35rem; padding-inline: clamp(1.25rem, 1rem + 1.2vw, 2.25rem); }
.hero__stats li:first-child { padding-left: 0; }
.hero__stats li + li { border-left: 1px solid rgb(255 255 255 / .25); }
.hero__stats strong { display: inline-flex; align-items: baseline; gap: .3rem; font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.5rem); font-weight: 200; line-height: 1; color: #fff; }
.hero__stats strong small { font-size: .9rem; font-weight: var(--fw-light); opacity: .8; }
.hero__stats .icon { width: .55em; height: .55em; color: #F5B301; align-self: center; }
.hero__stats span { font-size: var(--fs-xs); letter-spacing: .06em; color: rgb(255 255 255 / .7); }

.hero-search {
  display: flex; align-items: center; gap: 1rem; padding: .45rem .45rem .45rem 1.25rem;
  border: 1px solid rgb(255 255 255 / .3); border-radius: 12px;
  background: rgb(255 255 255 / .12); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.hero-search__field { display: grid; min-width: 150px; }
.hero-search__field span { font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; color: rgb(255 255 255 / .7); }
.hero-search__field input { min-height: 40px; padding: 0; border: 0; background: transparent; color: #fff; font-weight: var(--fw-regular); color-scheme: dark; outline: none; }
.hero-search__field input:focus-visible { outline: 2px solid var(--c-aqua); outline-offset: 4px; border-radius: 4px; } /* เห็นกรอบเมื่อใช้คีย์บอร์ด */

.hero__scroll { position: absolute; right: calc(2rem - 8px); top: 50%; display: grid; place-items: center; width: 44px; height: 56px; } /* พื้นที่กด 44px, รูปเมาส์วาดด้วย ::before */
.hero__scroll::before { content: ""; position: absolute; inset: 5px 8px; border: 1px solid rgb(255 255 255 / .5); border-radius: 99px; }
.hero__scroll span { width: 3px; height: 8px; border-radius: 3px; background: #fff; animation: scroll-dot 1.8s var(--ease) infinite; }
@keyframes scroll-dot { 0% { transform: translateY(-8px); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(10px); opacity: 0; } }

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(3rem, 2rem + 5vw, 7rem); align-items: center; }
.about__text { display: grid; gap: 1.5rem; justify-items: start; }
.about__text .eyebrow { margin-bottom: -.5rem; }

.about__media { position: relative; padding: 0 0 4rem 3rem; }
.about__img { overflow: hidden; border-radius: var(--radius); }
.about__img img { width: 100%; height: 100%; }
.about__img--main { position: relative; aspect-ratio: 4 / 5; }
.about__img--sub { position: absolute; left: 0; bottom: 0; width: 44%; aspect-ratio: 1; border: 8px solid #fff; border-radius: calc(var(--radius) + 8px); box-shadow: var(--shadow); }


/* ---------- Riverside (วิวลำธาร) ---------- */
.riverside { padding-top: 0; }
.riverside__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; grid-template-rows: repeat(2, clamp(170px, 16vw, 230px)); gap: 1rem; }
.riverside__item { position: relative; margin: 0; overflow: hidden; border-radius: var(--radius); }
.riverside__item:first-child { grid-row: span 2; }
.riverside__item img { width: 100%; height: 100%; }
/* แถวรูปสนามเด็กเล่น (4 รูปเท่ากัน) */
.riverside__grid--row { grid-template-columns: repeat(4, 1fr); grid-template-rows: clamp(200px, 20vw, 280px); margin-top: 1rem; }
.riverside__grid--row .riverside__item:first-child { grid-row: auto; }
.riverside__item figcaption {
  position: absolute; left: 1rem; bottom: 1rem; z-index: 6; padding: .35rem .8rem;
  font-size: var(--fs-xs); color: #fff; background: rgb(7 26 51 / .45);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-radius: 8px;
}
@media (max-width: 991px) {
  .riverside__grid { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
  .riverside__item { height: clamp(200px, 30vw, 260px); }
  .riverside__item:first-child { grid-column: span 2; height: clamp(280px, 46vw, 400px); }
  .riverside__grid--row { grid-template-columns: 1fr 1fr; }
  .riverside__grid--row .riverside__item:first-child { grid-column: auto; height: clamp(200px, 30vw, 260px); }
}


/* ---------- Experience ---------- */
.experience { background: var(--c-navy); color: #fff; }
.experience h2 { color: #fff; }
.experience .accent { color: var(--c-aqua); }
.experience .eyebrow { color: var(--c-aqua); }
.experience__grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(3rem, 2rem + 5vw, 7rem); align-items: center; }
.experience__list { margin-top: 2.5rem; border-top: 1px solid rgb(255 255 255 / .12); }
.experience__item {
  display: grid; grid-template-columns: 3.5rem 1fr; gap: 1rem; padding: 1.5rem 0;
  border-bottom: 1px solid rgb(255 255 255 / .12); cursor: pointer; outline: none;
}
.experience__num { font-family: var(--font-display); font-size: 1.25rem; font-style: italic; color: rgb(255 255 255 / .35); transition: color .4s; }
.experience__item h3 { font-size: var(--fs-h3); font-weight: var(--fw-light); color: rgb(255 255 255 / .45); transition: color .4s var(--ease), transform .5s var(--ease-out); }
.experience__item p { display: grid; max-height: 0; overflow: hidden; color: rgb(255 255 255 / .6); opacity: 0; transition: max-height .6s var(--ease-out), opacity .5s, margin .5s; }
.experience__item.is-active h3, .experience__item:hover h3 { color: #fff; transform: translateX(8px); }
.experience__item:focus-visible { outline: 2px solid var(--c-aqua); outline-offset: 4px; }
.experience__item.is-active .experience__num { color: var(--c-aqua); }
.experience__item.is-active p { max-height: 6rem; margin-top: .5rem; opacity: 1; }
.experience__media { position: relative; aspect-ratio: 5 / 6; overflow: hidden; border-radius: var(--radius-lg); }
.experience__media img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transform: scale(1.1); transition: opacity .9s var(--ease-out), transform 1.6s var(--ease-out); }
.experience__media img.is-active { opacity: 1; transform: none; }

/* ---------- Featured villa ---------- */
.feature { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: center; }
.feature__main { position: relative; display: block; min-height: 560px; overflow: hidden; border-radius: var(--radius-lg); }
.feature__main img { position: absolute; inset: 0; width: 100%; height: 100%; }
.feature__overlay { position: absolute; inset: auto 0 0; display: grid; gap: .5rem; padding: clamp(1.5rem, 1rem + 2vw, 2.5rem); color: #fff; background: linear-gradient(0deg, rgb(7 26 51 / .9), transparent); }
.feature__chip { display: inline-flex; align-items: center; gap: .35rem; width: fit-content; padding: .25rem .8rem; font-size: var(--fs-xs); border: 1px solid rgb(255 255 255 / .4); border-radius: var(--radius-ui); backdrop-filter: blur(8px); }
.feature__side { display: flex; flex-direction: column; gap: 1.25rem; }
.feature__side .eyebrow { margin-bottom: -.5rem; }
.feature__thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: .75rem; }
.feature__thumbs img { width: 100%; aspect-ratio: 5 / 4; border-radius: var(--radius-sm); transition: transform .5s var(--ease-out); }
.feature__thumbs img:hover { transform: scale(1.05) rotate(-1deg); }
.feature__actions { display: flex; flex-wrap: wrap; gap: .75rem; padding-top: .5rem; }

/* ---------- CTA ---------- */
.cta { padding: 0 .75rem var(--section); }
.cta__frame { position: relative; isolation: isolate; display: grid; place-items: center; min-height: clamp(480px, 70vh, 680px); overflow: hidden; border-radius: var(--radius-lg); text-align: center; }
.cta__frame > img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; }
.cta__frame::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at center, rgb(7 26 51 / .55), rgb(7 26 51 / .75)); }
.cta__content { display: grid; justify-items: center; gap: 1.25rem; max-width: 720px; padding: 3rem var(--gutter); color: #fff; }
.cta__content .eyebrow { margin: 0; color: var(--c-aqua); }
.cta__content h2 { font-size: clamp(2.5rem, 1.5rem + 4vw, 5rem); color: #fff; }
.cta__content .accent { color: var(--c-aqua); }
.cta__content p { color: rgb(255 255 255 / .8); }
.cta__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: .5rem; }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .about__grid, .experience__grid, .feature { grid-template-columns: 1fr; }
  .about__media { width: 100%; max-width: 560px; margin-inline: auto; }
  .feature__main { min-height: 420px; }
  .experience__media { aspect-ratio: 4 / 3; order: -1; }
  .hero__scroll { display: none; }
}
@media (max-width: 767px) {
  .experience__item.is-active h3, .experience__item:hover h3 { transform: none; }
  .experience__item { grid-template-columns: 2.5rem 1fr; }
}
@media (max-width: 575px) {
  .hero__frame { padding-bottom: 1.5rem; }
  .hero__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; width: 100%; }
  .hero__stats li { padding-inline: 0; }
  .hero__stats li + li { border-left: 0; }
  .hero__stats strong { font-size: 1.75rem; }
  .hero__stats strong small { font-size: .75rem; }
  .hero__stats span { font-size: .6875rem; letter-spacing: 0; line-height: 1.35; }
  /* ช่องวันที่ + ปุ่ม เรียงแนวตั้ง กดง่าย */
  .hero-search { flex-wrap: wrap; gap: .5rem; padding: .75rem; border-radius: var(--radius); }
  .hero-search__field { flex: 1 1 100%; padding-inline: .25rem; }
  .hero-search .btn { flex: 1 1 100%; }
  /* ป้ายชื่อรูปพื้นที่ส่วนกลาง */
  .riverside__item figcaption { left: .6rem; right: .6rem; bottom: .6rem; width: fit-content; max-width: calc(100% - 1.2rem); padding: .3rem .6rem; font-size: .6875rem; line-height: 1.35; }
  .about__media { padding: 0 0 3rem 1.5rem; }
}
.hero-search .btn { border-radius: 8px; }
@media (max-width: 375px) {
  .riverside__grid { grid-template-columns: 1fr; }
  .riverside__item, .riverside__item:first-child { grid-column: auto; height: 200px; }
  .hero__stats strong { font-size: 1.5rem; }
}
