/* ==========================================================================
   LAYOUT
   Navbar, Hero, Footer, Go-to-top
   ========================================================================== */

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

.navbar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 7.5rem;
  background-color: var(--color-surface-tertiary);
  transition:
    height var(--transition-base),
    box-shadow var(--transition-base);
  z-index: 0;
}

.navbar.is-scrolled::before {
  height: 100%;
  box-shadow: var(--shadow-soft);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  position: relative;
  min-height: 7.5rem;
  padding-block: var(--space-sm);
}

.navbar.is-scrolled .navbar__inner {
  min-height: 6rem;
  padding-block: var(--space-xs);
}

.navbar__logo {
  position: absolute;
  left: var(--container-padding-x);
  top: 0;
  z-index: 1;
  line-height: 0;
}

.navbar__logo img {
  height: 13rem;
  width: auto;
  transition: height var(--transition-base);
}

.navbar.is-scrolled .navbar__logo img {
  height: 6rem;
}

.navbar__toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 4.4rem;
  height: 4.4rem;
  border: 0.15rem solid var(--color-gold);
  z-index: 1100;
}

.navbar__toggle-bar {
  display: block;
  width: 60%;
  height: 0.2rem;
  background-color: var(--color-gold);
  transition:
    transform var(--transition-base),
    opacity var(--transition-base);
}

.navbar__toggle[aria-expanded="true"] .navbar__toggle-bar:nth-child(1) {
  transform: translateY(0.7rem) rotate(45deg);
}

.navbar__toggle[aria-expanded="true"] .navbar__toggle-bar:nth-child(2) {
  opacity: 0;
}

.navbar__toggle[aria-expanded="true"] .navbar__toggle-bar:nth-child(3) {
  transform: translateY(-0.7rem) rotate(-45deg);
}

.navbar__menu {
  display: flex;
  gap: var(--space-md);
  position: relative;
  z-index: 1;
}

.navbar__menu a {
  color: var(--color-cream-soft);
  font-family: var(--font-body);
  text-transform: uppercase;
  font-size: var(--fs-xsmall);
  font-weight: 600;
  letter-spacing: 0.05rem;
  transition: color var(--transition-base);
}

.navbar__menu a:hover,
.navbar__menu a.is-active {
  color: var(--color-gold);
}

@media (max-width: 900px) {
  .navbar::before {
    height: 5rem;
  }

  .navbar__inner {
    min-height: 5rem;
  }

  .navbar__logo img {
    height: 8rem;
  }

  .navbar.is-scrolled .navbar__logo img {
    height: 5rem;
  }

  .navbar.is-scrolled .navbar__inner {
    min-height: 5rem;
  }

  .navbar__toggle {
    display: flex;
  }

  .navbar__menu {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(28rem, 80vw);
    background-color: var(--color-navy-darker);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: var(--space-lg);
    gap: var(--space-md);
    transform: translateX(100%);
    transition: transform var(--transition-base);
    box-shadow: -0.4rem 0 1.5rem rgba(0, 0, 0, 0.3);
  }

  .navbar__menu.is-open {
    transform: translateX(0);
  }
}

@media (min-width: 901px) {
  .navbar__toggle {
    display: none;
  }
}

/* ---------- Hero ---------- */
/* artwork เปลี่ยนจาก background-image เป็น <img class="hero__artwork"> แยกชั้น
   จัด .hero เป็น flex คอลัมน์: ข้อความอยู่บน / artwork เกาะขอบล่างด้วย margin-top:auto
   ผลคือข้อความไม่มีทางทับ artwork และภาพสมส่วนเต็มความกว้างทุกจอ (ไม่พึ่ง vh) */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 50vh;
  text-align: center;
  background-color: var(--color-surface-primary);
  color: var(--color-white);
  overflow: hidden;
}

/* artwork: เต็มความกว้างเสมอ, เกาะขอบล่าง, สัดส่วนคงที่ทุกอุปกรณ์ */
.hero__artwork-wrap {
  display: block;
  width: 100%;
  margin-top: auto; /* ดัน artwork ลงไปเกาะขอบล่าง เว้นระยะจากข้อความด้านบน */
  line-height: 0; /* กันช่องว่างใต้ภาพจาก inline element */
  animation: heroArtworkRise 1.5s ease-out 0.15s both;
}

.hero__artwork {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
}

/* ตำแหน่งข้อความคงเดิม อยู่ด้านบน — ไม่แตะ padding */
.hero__content {
  position: relative;
  z-index: 2;
  padding-top: 10rem;
  padding-bottom: var(--space-sm);
}

.hero__title {
  font-size: var(--fs-hero-subtitle);
  color: var(--color-gold-soft);
  letter-spacing: 0.2rem;
  line-height: 1.3;
  margin-bottom: var(--space-sm);
  text-shadow: 0 0.1rem 0 var(--color-black);
  animation: heroFadeRise 1s ease-out 0.45s both;
}

.hero__text {
  font-family: var(--font-heading);
  font-size: var(--fs-hero-text);
  line-height: 1.5;
  color: var(--color-cream);
  max-width: 60rem;
  margin-inline: auto;
  animation: heroFadeRise 1s ease-out 0.7s both;
}

/* แสงทองกวาดผ่านทางเดียว: ซ้าย→ขวา แล้วหยุดพักก่อนวนใหม่ (auto loop)
   1 รอบ = 10วิ : ช่วงกวาด ~2.5วิ (0–25%) + ช่วงพักนิ่ง ~7.5วิ (25–100%) */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(197, 171, 132, 0.12) 47%,
    rgba(218, 200, 172, 0.26) 50%,
    rgba(197, 171, 132, 0.12) 53%,
    transparent 70%
  );
  background-size: 250% 100%;
  background-repeat: no-repeat;
  background-position: 200% 0;
  animation: heroSweepLoop 10s ease-in-out 1s infinite;
}

@keyframes heroArtworkRise {
  from {
    opacity: 0;
    transform: translateY(3rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroFadeRise {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroSweepLoop {
  0% {
    background-position: 200% 0;
  } /* เริ่มนอกจอฝั่งขวา */
  25% {
    background-position: -60% 0;
  } /* กวาดออกฝั่งซ้ายจนสุด ~2.5วิ */
  100% {
    background-position: -60% 0;
  } /* พักค้างไว้ ~7.5วิ แล้ววนใหม่ */
}

/* เคารพผู้ใช้ที่ตั้งค่าไม่ชอบภาพเคลื่อนไหว (accessibility) */
@media (prefers-reduced-motion: reduce) {
  .hero__artwork-wrap,
  .hero__artwork,
  .hero__title,
  .hero__text,
  .hero::after {
    animation: none;
  }
}

@media (min-width: 576px) {
  .hero__text {
    line-height: 1.7;
  }
}

@media (min-width: 1200px) {
  .hero__content {
    padding-top: 14rem;
    padding-bottom: var(--space-xs);
  }
}

/* ---------- Page Banner (sub-pages: about, lookbook, contact, etc.) ---------- */
.page-banner {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background-color: var(--color-navy-dark);
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
  padding-top: 10rem;
  overflow: hidden; /* คุมแสงกวาดไม่ให้ล้นขอบ banner */
}

.page-banner__title {
  position: relative;
  z-index: 2;
  font-size: var(--fs-page-title);
  color: var(--color-white);
  letter-spacing: 0.15rem;
  text-shadow: 0 0.2rem 0.1rem var(--color-black);
  padding-block: var(--space-lg);
  animation: heroFadeRise 1s ease-out 0.4s both;
}

/* แสงทองกวาดผ่าน page-banner (ใช้เอฟเฟกต์เดียวกับ hero) — ทำงานบน background ได้เลย
   จังหวะเดียวกัน: กวาด ~2.5วิ แล้วพัก ~7.5วิ วนอัตโนมัติ (10วิ/รอบ) */
.page-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    100deg,
    transparent 30%,
    rgba(197, 171, 132, 0.12) 47%,
    rgba(218, 200, 172, 0.26) 50%,
    rgba(197, 171, 132, 0.12) 53%,
    transparent 70%
  );
  background-size: 250% 100%;
  background-repeat: no-repeat;
  background-position: 200% 0;
  animation: heroSweepLoop 10s ease-in-out 1s infinite;
}

@media (prefers-reduced-motion: reduce) {
  .page-banner__title,
  .page-banner::after {
    animation: none;
  }
}

@media (min-width: 376px) {
  .page-banner__title {
    padding-block: var(--space-2xl);
  }
}

@media (min-width: 1024px) {
  .page-banner {
    min-height: 100vh;
  }
}
/* ---------- Footer ---------- */
.footer {
  background-color: var(--color-surface-primary);
  color: var(--color-gold-soft);
  text-align: center;
  padding-block: var(--space-lg);
}

.footer__logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.footer__logos img {
  height: 6rem;
  width: auto;
}

.footer__badge img {
  max-width: 24rem;
  margin-inline: auto;
  margin-bottom: var(--space-md);
}

.footer__tagline {
  text-transform: capitalize;
  font-size: var(--fs-md);
}

.footer__bottom {
  background-color: var(--color-navy-deepest);
  border-top: 0.1rem ridge rgba(89, 85, 113, 0.5);
  text-align: center;
  padding-block: var(--space-md);
}

.footer__bottom p {
  color: rgba(225, 224, 232, 0.64);
  font-size: var(--fs-small);
  letter-spacing: 0.1rem;
}

/* ---------- Go to top ---------- */
.go-to-top {
  position: fixed;
  right: var(--space-md);
  bottom: var(--space-md);
  width: 4.8rem;
  height: 4.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-gold);
  color: var(--color-navy-dark);
  border-radius: 50%;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  visibility: hidden;
  transform: translateY(1rem);
  transition:
    opacity var(--transition-base),
    transform var(--transition-base),
    background-color var(--transition-base);
  z-index: 900;
}

.go-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.go-to-top:hover {
  background-color: var(--color-gold-light);
}

.go-to-top svg {
  width: 2rem;
  height: 2rem;
}
