/* =========================================================
   Blue Lagoon Resort Koh Chang — Map page
   Rebuilt from https://www.bluelagoonkohchang.com/projects-8-1
   Colors and spacing mirror the original Wix theme; type matches the new site.
   ========================================================= */

/* ---------- Montserrat + Noto Sans Thai: the same fonts as the rest of the website ---------- */
@font-face {
  font-family: 'Montserrat';
  src: url('../assets/fonts/montserrat-latin-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Montserrat';
  src: url('../assets/fonts/montserrat-latin-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Montserrat';
  src: url('../assets/fonts/montserrat-latin-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Montserrat';
  src: url('../assets/fonts/montserrat-latin-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Noto Sans Thai';
  src: url('../assets/fonts/noto-sans-thai-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Noto Sans Thai';
  src: url('../assets/fonts/noto-sans-thai-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Noto Sans Thai';
  src: url('../assets/fonts/noto-sans-thai-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Noto Sans Thai';
  src: url('../assets/fonts/noto-sans-thai-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC;
}

/* ---------- Theme tokens (taken from the original Wix theme) ---------- */
:root {
  --color-cream: #f3e8d8;        /* --color_11  */
  --color-sage: #7e9770;         /* --color_12  */
  --color-sage-border: #96a785;  /* booking bar border */
  --color-ink: #000000;          /* --color_15  */
  --color-ink-soft: #3d3a36;     /* --color_25  */
  --header-height: 101px;
  /* One family everywhere, matching the main site (src/styles/global.css). */
  --font-body: 'Montserrat', 'Noto Sans Thai', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-display: var(--font-body);
  --font-map: var(--font-body);

  /* Semantic aliases used by the 3D map + preview card. They follow the
     --color-* tokens, so switching the theme repaints everything at once. */
  --cream: var(--color-cream);
  --cream-line: #e6d8c4;
  --green: var(--color-sage);
  --green-line: var(--color-sage-border);
  --green-deep: #5f7a55;
  --ink: var(--color-ink);
  --ink-soft: var(--color-ink-soft);
  --surface-raised: #f8f0e4;
  --hairline: rgba(61, 58, 54, 0.16);
  --muted: rgba(61, 58, 54, 0.74);
  --shadow: rgba(61, 58, 54, 0.16);
  --swatch-ring: rgba(61, 58, 54, 0.3);
  --card-head-bg: #4c6542;
  --card-head-ink: #f8f0e3;
  --card-head-muted: rgba(248, 240, 227, 0.86);
  --scrim: rgba(24, 30, 22, 0.55);
  --action-bg: #546e4a;
  --action-bg-hover: #47603f;
  --action-ink: #f8f0e3;
}

/* ---------- Night palette ---------- */
html[data-theme='dark'] {
  --color-cream: #1a201a;
  --color-sage: #0d120d;
  --color-sage-border: #33402f;
  --color-ink: #ece9de;
  --color-ink-soft: #cfd3c4;

  --cream-line: #2c352b;
  --green-deep: #7e9c70;
  --surface-raised: #222a22;
  --hairline: rgba(146, 168, 132, 0.32);
  --muted: rgba(224, 228, 213, 0.62);
  --shadow: rgba(0, 0, 0, 0.5);
  --swatch-ring: rgba(236, 233, 222, 0.28);
  --card-head-bg: #263126;
  --card-head-ink: #f0eee4;
  --card-head-muted: rgba(240, 238, 228, 0.64);
  --scrim: rgba(4, 7, 4, 0.7);
  --action-bg: #47603f;
  --action-bg-hover: #55754a;
  --action-ink: #f0f3e8;
  color-scheme: dark;
}

html { color-scheme: light; }

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100%;
  background: var(--color-sage);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.79;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.menu-open { overflow: hidden; }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--color-ink);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Shell ---------- */
.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: relative;
  z-index: 50;
  height: var(--header-height);
  background: var(--color-cream);
}

/* Logo — original: 170×92 at top 4px, anchored to the 980px design grid */
.site-header .logo {
  position: absolute;
  top: 4px;
  left: max(20px, calc((100vw - 980px) / 2 - 187px));
  display: block;
  width: 170px;
  height: 92px;
}

.site-header .logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Desktop navigation — original: 715px block ending 320px from the right edge */
.primary-nav {
  position: absolute;
  top: 40px;
  right: 320px;
  height: 30px;
}

.primary-nav__list {
  display: flex;
  align-items: center;
  height: 30px;
}

.primary-nav a {
  display: inline-block;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 400;
  line-height: 30px;
  white-space: nowrap;
  color: var(--color-ink);
  transition: color 0.4s ease 0s;
}

.primary-nav > ul > li > a:hover,
.primary-nav > ul > li > a:focus-visible,
.primary-nav .has-dropdown:hover > a,
.primary-nav .has-dropdown:focus-within > a {
  color: var(--color-ink-soft);
}

.primary-nav .is-current > a { color: var(--color-ink-soft); }

/* Bungalows dropdown (cream panel, right aligned to its parent item) */
.has-dropdown { position: relative; }

.dropdown {
  position: absolute;
  top: 37px;
  right: 0;
  z-index: 60;
  display: none;
  width: 221px;
  margin: 0;
  padding: 0;
  background: var(--color-cream);
}

.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown,
.has-dropdown.is-open .dropdown { display: block; }

.dropdown a {
  display: block;
  padding: 0 10px;
  font-size: 14px;
  line-height: 29px;
  white-space: nowrap;
  color: var(--color-ink);
  transition: color 0.4s ease 0s;
}

.dropdown a:hover,
.dropdown a:focus-visible { color: var(--color-ink-soft); }

/* The original template right-aligns the four family-house entries */
.dropdown li:nth-child(n + 15) a { text-align: right; }

/* Header social icons — original: 50×20 at top 45px, 80px from the right */
.social {
  display: flex;
  align-items: center;
  gap: 10px;
}

.social--header {
  position: absolute;
  top: 45px;
  right: 80px;
  width: 50px;
  height: 20px;
}

.social img {
  width: 20px;
  height: 20px;
  object-fit: cover;
}

.social a { display: block; }

/* Hamburger — only used below the desktop breakpoint */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 26px;
  height: 2.5px;
  background: var(--color-ink);
  border-radius: 0;
}

/* =========================================================
   BOOKING BAR (live widget from the booking engine)
   ========================================================= */
.booking-band { background: transparent; }

#be-search-form {
  display: block;
  width: 100%;
  min-width: 320px;
  min-height: 96px;
  margin: 0 0 1px;
  background: var(--color-cream);
  border: solid var(--color-sage-border);
  border-width: 2px 0;
}

/* The booking engine injects <div><iframe/></div>; the original theme caps
   the widget at 1396px and centres it inside the full-bleed cream band. */
#be-search-form > div {
  max-width: 1396px;
  margin: 0 auto;
}

/* The booking widget has two phone layouts: a clean single column only when
   the iframe is narrower than ~305px, and a cramped two-column one above
   that. Cap the injected wrapper so phones always get the clean one. */
@media (max-width: 430px) {
  #be-search-form > div {
    max-width: 330px;
    padding: 0;
  }
}

/* The Hopen booking engine injects a dismissible "Save on your stay" promo
   widget fixed to the bottom of the viewport (z-index 2147483641). On this
   page it covers the map legend and the footer, so it is suppressed; the
   promo-code field in the booking bar still works. */
.tl-widgets-container { display: none !important; }

/* =========================================================
   MAP — the band itself is styled in css/map3d.css
   ========================================================= */

/* =========================================================
   BOOKING PAGE — /booking
   Same chrome as the map page, with the engine's full results
   view where the map normally sits.
   ========================================================= */
.booking-page {
  padding: 0 0 72px;
  background: var(--color-cream);
}

.booking-page__head {
  padding: 34px 20px 40px;
  text-align: center;
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--color-ink);
}

#be-booking-form {
  display: block;
  width: calc(100% - 30px);
  max-width: 1338px;
  min-width: 320px;
  min-height: auto;
  margin: 0 auto;
  background: transparent;
}

/* The engine injects <div><iframe/></div>. Its own responsive rules keep the
   room grid readable down to ~320px, so we only cap the wrapper. */
#be-booking-form > div {
  max-width: 1338px;
  margin: 0 auto;
}

@media (max-width: 767px) {
  .booking-page { padding-bottom: 48px; }
  .booking-page__head { padding: 22px 16px 26px; }
  .page-title { font-size: 32px; }
}

@media (max-width: 430px) {
  #be-booking-form {
    width: 100%;
    min-width: 0;
  }
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  padding: 24px 20px 29px;
  background: var(--color-cream);
  text-align: center;
}

.footer-email {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.875;
}

.footer-email a { color: var(--color-ink); }

.social--footer {
  justify-content: center;
  width: 80px;
  margin: 0 auto;
}

/* =========================================================
   NIGHT MODE — page chrome
   The live booking widget is a cross-origin iframe, so it keeps the
   resort's cream palette; in dark mode it floats as a light card.
   ========================================================= */
html[data-theme='dark'] .logo img {
  filter: invert(1) hue-rotate(180deg) saturate(0.9);
}

html[data-theme='dark'] .social img {
  filter: invert(1);
}

html[data-theme='dark'] .primary-nav a:hover,
html[data-theme='dark'] .primary-nav a:focus-visible,
html[data-theme='dark'] .primary-nav .is-current > a,
html[data-theme='dark'] .dropdown a:hover,
html[data-theme='dark'] .dropdown a:focus-visible {
  color: #b7c9a9;
}

html[data-theme='dark'] .site-header,
html[data-theme='dark'] .site-footer {
  border-color: rgba(146, 168, 132, 0.22);
}

html[data-theme='dark'] .booking-band {
  padding: 16px clamp(12px, 2.99vw, 43px) 15px;
  background: var(--color-sage);
}

html[data-theme='dark'] #be-search-form {
  max-width: 1440px;
  margin: 0 auto;
  /* The booking widget is a cross-origin iframe whose "BOOK ONLINE" label
     uses dark text and a transparent background.  Dark mode turns the band
     dark green, which swallows the label, so the widget always sits on a
     cream panel of its own (literal colour: the cream token is inverted in
     dark mode). */
  background: #fbf5ea;
  border-width: 1px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}


/* =========================================================
   COMPACT DESKTOP  (1024px – 1279px)
   Keeps the desktop header readable on smaller laptop screens,
   where the original fixed 980px layout clips the logo.
   ========================================================= */
@media (min-width: 1024px) and (max-width: 1279px) {
  .site-header {
    display: flex;
    align-items: center;
    padding: 0 24px;
  }

  .site-header .logo {
    position: static;
    flex: 0 0 auto;
    width: 150px;
    height: 81px;
  }

  .primary-nav {
    position: static;
    margin-left: auto;
    height: 30px;
  }

  .social--header {
    position: static;
    margin-left: 24px;
  }
}

/* =========================================================
   TABLET & MOBILE  (< 1024px)
   Mirrors the original mobile layout: centred logo, social icons
   bottom-left, hamburger bottom-right, cream menu overlay.
   ========================================================= */
@media (max-width: 1023px) {
  .site-header {
    height: 121px;
    padding: 0;
  }

  .site-header .logo {
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    /* the original mobile grid is a 320px design that scales with the phone */
    width: clamp(120px, 37.5vw, 146px);
    height: auto;
  }

  .site-header .logo img {
    height: auto;
    aspect-ratio: 340 / 184;
  }

  .primary-nav { display: none; }

  .social--header {
    top: 75px;
    left: 16px;
    right: auto;
  }

  .menu-toggle {
    display: flex;
    position: absolute;
    top: 60px;
    right: 16px;
  }

  /* --- Footer (original mobile metrics) --- */
  .site-footer { padding: 34px 20px 37px; }

  .footer-email {
    margin-bottom: 19px;
    font-size: 14px;
  }
}

/* =========================================================
   MOBILE / TABLET MENU  (cream full-screen panel)
   ========================================================= */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--color-cream);
}

.mobile-menu[hidden] { display: none; }

.mobile-menu__panel {
  position: relative;
  min-height: 100%;
  padding: 18px 24px 56px;
}

.mobile-menu__close {
  position: absolute;
  top: 18px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.mobile-nav {
  max-width: 420px;
  margin: 0 auto;
  padding-top: 34px;
}

.mobile-nav__list > li > a,
.mobile-nav__row > a {
  display: block;
  padding: 0 8px;
  font-size: 20px;
  font-weight: 400;
  line-height: 56px;
  text-align: center;
  color: var(--color-ink);
}

.mobile-nav__list > li > a[aria-current='page'] { color: var(--color-ink-soft); }

.mobile-nav__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.mobile-nav__row > a { flex: 0 1 auto; }

.mobile-nav__expand {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-ink);
  cursor: pointer;
  transition: transform 0.25s ease;
}

.mobile-nav__expand svg { display: block; }
.mobile-nav__expand[aria-expanded='true'] { transform: rotate(180deg); }

.mobile-nav__submenu {
  padding: 2px 0 16px;
}

.mobile-nav__submenu[hidden] { display: none; }

.mobile-nav__submenu a {
  display: block;
  padding: 0 8px;
  font-size: 15px;
  line-height: 38px;
  text-align: center;
  color: var(--color-ink-soft);
}

@media (min-width: 700px) {
  .mobile-menu__panel { padding: 24px 40px 64px; }
  .mobile-nav { padding-top: 40px; }

  .mobile-nav__list > li > a,
  .mobile-nav__row > a {
    font-size: 22px;
    line-height: 62px;
  }

  .mobile-nav__submenu a {
    font-size: 16px;
    line-height: 42px;
  }
}
