/* =========================================================
   Baan Silom – Home page
   Built on Bootstrap 6 (alpha). Bootstrap puts its own rules
   in CSS cascade layers, so these unlayered rules win without
   needing !important.
   ========================================================= */

/* ---------- 1. Design tokens ---------- */
:root {
  --brand-green:      #77881c;   /* brand olive green (menus, hovers) */
  --brand-text:       #333;
  --white-88:      rgba(255, 255, 255, .88);
  --black-80:      rgba(0, 0, 0, .8);
  --site-width:    930px;

  --font-body:     "DBHelvethaicaXLiExtv3_2", "CordiaNewRegular", Tahoma, sans-serif;
  --font-script:   "ManhattanDarlingRegular", "CordiaNewRegular", Tahoma, cursive;
  --font-label:    "Lato", "Gotham-Book", "Helvetica Neue", Arial, sans-serif;

}

/* ---------- 2. Base ---------- */
html { background-color: #fff; }

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 20px;
  color: var(--brand-text);
  background: url("../images/ui/bg.jpg") repeat-x center bottom;
  background-color: #fff;
}

a { color: #000; text-decoration: none; }
a:hover { color: var(--brand-green); }

h1 {
  margin: 0 0 10px;
  padding: 0 0 15px;
  font-family: var(--font-script);
  font-size: 45px;
  font-weight: 400;
  line-height: 40px;
  text-align: center;
  color: inherit;
  /* small ornament under every heading */
  background: url("../images/ui/bg-h1.png") no-repeat center bottom;
}

/* Fixed-width centred column used by header, main and footer */
.site-container {
  position: relative;
  width: 100%;
  max-width: var(--site-width);
  min-width: 320px;
  margin-inline: auto;
  padding-inline: 0;
}

/* ---------- 3. Header ---------- */
#header { margin-top: 50px; }

.company-logo {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 100;
}
.company-logo img { display: block; width: 122px; height: auto; }

.banner img { display: block; }

/* ---------- 4. Navigation ---------- */
/* .navbar is a size container in BS6; it spans the whole header
   width so `md:navbar-expand` switches at a 768px-wide header. */
.main-nav {
  --bs-navbar-bg: transparent;
  --bs-navbar-min-height: 0;
  --bs-navbar-padding-y: 0;

  position: absolute;
  top: 15px;
  left: 0;
  right: 0;
  z-index: 100;
  justify-content: flex-end;
  padding-right: 15px;
  text-transform: uppercase;
  pointer-events: none;            /* let clicks reach the logo underneath */
}
.main-nav > * { pointer-events: auto; }

.slimmenu { gap: 0; margin: 0; padding: 0; list-style: none; }
.slimmenu .nav-item { position: relative; display: block; }

.slimmenu .nav-link {
  display: block;
  padding: 10px;
  font-size: 18px;
  line-height: 18px;
  color: #000;
  text-align: center;
}
.slimmenu .nav-link:hover { color: #000; }
.slimmenu .nav-home img { display: block; height: 18px; width: auto; }

/* Submenus */
.submenu {
  margin: 0;
  padding: 0;
  list-style: none;
  text-transform: none;
}
.submenu .menu-item {
  display: block;
  padding: 10px 10px 10px 25px;
  color: #fff;
  text-align: left;
  background: var(--brand-green);
}
.submenu .menu-item:hover { color: #fff; }

/* Chevron button that opens a submenu (mobile only) */
.sub-collapser { display: none; }

/* --- Desktop: horizontal menu, submenus open on hover/focus --- */
@container (width >= 768px) {
  .main-nav .main-menu.collapse {   /* always visible when expanded */
    display: block;
    block-size: auto;
    overflow: visible;              /* BS6 .collapse clips; let dropdowns show */
  }
  .main-nav .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 999;
    display: none;
    min-width: 180px;
    block-size: auto;
    overflow: visible;
  }
  .main-nav .submenu-end { left: auto; right: 0; }
  .main-nav .has-sub:hover > .submenu,
  .main-nav .has-sub:focus-within > .submenu { display: block; }
}

/* --- Mobile: "MainMenu" bar + stacked green list --- */
.menu-collapser {
  position: relative;
  width: 100%;
  height: 40px;
  padding: 0 10px;
  font-size: 150%;
  line-height: 40px;
  text-align: left;
  text-transform: none;
  color: var(--brand-green);
  background: #fff;
  border: 1px solid var(--brand-green);
  border-radius: 0;
}
.menu-collapser:focus { box-shadow: none; }
.collapse-button { position: absolute; top: 7px; right: 10px; }
.icon-bar {
  display: block;
  width: 30px;
  height: 5px;
  margin: 2px 0;
  border-radius: 1px;
  background: var(--brand-green);
}

@container (width < 768px) {
  .main-menu { width: 100%; }
  .slimmenu .nav-item { background: var(--brand-green); }
  .slimmenu .nav-link { padding: 7px 0; font-size: 110%; }
  .slimmenu .nav-home img { margin-inline: auto; }

  .sub-collapser {
    position: absolute;
    top: 0;
    right: 0;
    display: block;
    width: 40px;
    height: 32px;
    padding: 0;
    color: #fff;
    background: none;
    border: 0;
  }
  .sub-collapser i { transition: transform .2s; }
  .sub-collapser[aria-expanded="true"] i { transform: rotate(90deg); }

  .submenu { border-top: 1px solid #fff; }
  .submenu .menu-item {
    padding: 7px 0;
    text-align: center;
    background: #000;
    border-bottom: 1px solid #fff;
  }
}

/* ---------- 5. Content boxes ---------- */
#main .site-container { min-height: 500px; }

/* Image + text row (white 88% panel) */
.box-image {
  display: flex;
  margin-top: 5px;
  background: var(--white-88);
}
.box-image .cell-image {
  flex: 0 0 60%;
  overflow: hidden;
}
.box-image .cell-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.box-image .cell-text {
  flex: 1;
  align-self: center;
  padding: 20px 3%;
  text-align: justify;
}
.box-image-right .cell-image { order: 2; }   /* image on the right */
.box-image .more { text-align: right; margin: 0; }

/* Black 80% panel (Registration, Gallery) */
.box-black {
  margin-top: 5px;
  padding: 25px;
  text-align: center;
  color: #fff;
  background: var(--black-80);
}
.box-black h1 { margin: 0; padding: 0 0 10px; background: none; }
.box-black p { margin-bottom: 0; }
.box-black a { color: #fff; }
.box-black a:hover { color: var(--brand-green); }

/* ---------- 6. Gallery carousel ---------- */
.gallery-box .gallery-title { padding: 5px 0; }
.gallery-box .see-all { display: inline-block; margin-bottom: 15px; }

.gallery-carousel { position: relative; }
.gallery-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.gallery-track::-webkit-scrollbar { display: none; }

.gallery-item {
  flex: 0 0 calc((100% - 40px) / 5);   /* 5 photos visible */
  height: 150px;
  scroll-snap-align: start;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }

.gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 10;
  padding: 0;
  font-size: 26px;
  color: #fff;
  background: none;
  border: 0;
  transform: translateY(-50%);
}
.gallery-nav.prev { left: -22px; }
.gallery-nav.next { right: -22px; }
.gallery-nav:hover { color: var(--brand-green); }

/* ---------- 7. Footer ---------- */
#footer { padding: 5px 0; }
.footer-box {
  margin-top: 10px;
  margin-bottom: 15px;
  padding: 15px 20px;
  background: var(--white-88);
}
#footer h5 {
  margin-bottom: 6px;
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: #000;
}
#footer ul { margin: 0 0 15px; padding: 0; list-style: none; }
#footer .social-title { margin-top: 20px; }
#footer .social a { padding-right: 5px; font-size: 20px; }

#backToTop {
  position: fixed;
  right: 5px;
  bottom: 27px;
  z-index: 200;
  font-size: 140%;
  color: #fff;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s, visibility .3s;
}
#backToTop.show { opacity: 1; visibility: visible; }

/* ---------- 8. Dark header (store pages: menu over a photo) ---------- */
@container (width >= 768px) {
  .header-dark .slimmenu .nav-link,
  .header-dark .slimmenu .nav-link:hover { color: #fff; }
}

/* Current page in the menu */
.slimmenu .menu-item[aria-current="page"] { text-decoration: underline; }

/* ---------- 9. Shared panels ---------- */
.boxwhite {
  margin-top: 5px;
  padding: 30px 15px;
  background: var(--white-88);
}

/* Full-width image pages (Special Promotion, Parking Fee) */
.image-page { margin-top: 5px; text-align: center; }
.image-page img { display: block; width: 100%; height: auto; }

/* ---------- 10. Store pages ---------- */
/* Picker: round thumbnails that switch the store below (Bootstrap tabs) */
.store-picker {
  padding: 3%;
  background: var(--white-88);
}
.store-thumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.store-thumb {
  display: block;
  width: 150px;
  padding: 0;
  font-family: var(--font-script);
  text-align: center;
  color: #000;
  background: none;
  border: 0;
  cursor: pointer;
}
.store-thumb .title { display: block; padding-bottom: 10px; font-size: 130%; }
.store-thumb img {
  display: block;
  width: 150px;
  height: 150px;
  object-fit: cover;
  border: 3px solid transparent;
  border-radius: 50%;
  transition: border-color .2s, opacity .2s;
}
.store-thumb:not(.active) img { opacity: .75; }
.store-thumb.active img,
.store-thumb:hover img { border-color: var(--brand-green); opacity: 1; }

.store-intro {
  max-width: 42%;
  margin: 20px auto 0;
  text-align: justify;
}

/* Hero photo with white text on the left */
.store-detail .tab-pane { margin-top: 5px; }
.store-hero { position: relative; overflow: hidden; color: #fff; }
.store-hero::after {               /* darkening filter */
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .3);
}
.store-hero-img { display: block; width: 100%; height: auto; }
.store-hero-text {
  position: absolute;
  top: 50%;
  left: 8%;
  z-index: 1;
  width: 400px;
  text-align: justify;
  transform: translateY(-50%);
}
.store-hero-text h1 {
  background-image: url("../images/ui/bg-h1-white.png");
}

/* Signature text + contact badge */
.store-info {
  padding: 5%;
  background: var(--white-88);
}
.store-info h2 {
  margin: 0;
  font-family: var(--font-script);
  font-size: 45px;
  line-height: 40px;
  text-align: center;
}
.store-info .subheadline {
  margin-bottom: 30px;
  font-weight: bold;
  text-align: center;
  text-transform: uppercase;
}
.store-info-body { display: flex; gap: 2%; }
.features { flex: 0 0 73%; text-align: justify; }
.feature {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}
.feature p { margin: 0; }
.feature-icon { flex: 0 0 auto; }
.feature-icon img { display: block; max-width: 140px; height: auto; }

.store-aside { flex: 1; text-align: center; }
.store-logo { width: 100%; max-width: 110px; height: auto; margin-bottom: 20px; }

.contact-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 145px;
  min-height: 275px;
  margin: 0 auto;
  padding: 55px 8px 20px;
  line-height: 1.15;
  color: #fff;
  background: url("../images/ui/contact-bg.png") no-repeat center top;
}
.contact-badge .headline { margin-top: 4px; text-transform: uppercase; }
.contact-badge .room strong { display: block; font-weight: normal; }
.contact-badge .phone { padding: 8px 0; font-size: 120%; font-weight: bold; color: #d2872e; }
.contact-badge .hours { margin-bottom: 4px; font-size: 75%; }
.contact-badge .website {
  margin-top: 6px;
  padding: 0 10px;
  font-size: 90%;
  color: #d2872e;
  border: 2px solid #d2872e;
  border-radius: 4px;
}
.contact-badge .website:hover { color: #fff; background: #d2872e; }

/* Mosaic gallery: 35% | 10% | 20% | 35% */
.store-gallery {
  position: relative;
  display: grid;
  grid-template-columns: 35fr 10fr 20fr 35fr;
  margin-top: 5px;
  border: 1px solid #000;
  background: #000;
}
.store-gallery .mosaic-col { display: grid; }
.store-gallery a { display: block; overflow: hidden; border: 1px solid #000; }
.store-gallery a img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.store-gallery a:hover img { transform: scale(1.05); }
.store-gallery .mosaic-col-1 a, .store-gallery .mosaic-col-4 a { height: 210px; }
.store-gallery .mosaic-col-2 a { height: 70px; }
.store-gallery .mosaic-col-3 a { height: 105px; }
.store-gallery .gallery-badge {
  position: absolute;
  top: 50%;
  left: 45%;
  width: 118px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* ---------- 11. Directories ---------- */
.floor-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 0 15px;
  padding: 0;
  list-style: none;
}
.floor-tabs a {
  display: block;
  padding: 0 15px;
  font-weight: bold;
  border: 1px solid;
}
.floor-tabs a.active,
.floor-tabs a:hover { color: #fff; background: #555; border-color: #555; }

.floorplan-image { display: block; cursor: zoom-in; }
.floorplan-image img { display: block; width: 100%; height: auto; }

.floorplan { margin-top: 30px; row-gap: 6px; }
.unit .locker {
  display: block;
  padding: 2px 5px;
  font-weight: 700;
  color: #fff;
  background: #555;
}
.unit .detail { display: block; padding: 2px 0; }

/* ---------- 12. Blog ---------- */
.blog-list { padding: 50px 20px; }
.blog-item { margin-bottom: 30px; align-items: center; }
.blog-item img { display: block; width: 100%; height: auto; margin: 10px 0; }
.blog-item h2,
.blog-single .article-title {
  font-size: 36px;
  line-height: 1.2;
  border-bottom: 1px solid;
}
.blog-item h2 a { color: #000; }
.blog-item h2 a:hover { color: var(--brand-green); }
.more-link { display: block; text-align: right; }

.blog-single { padding: 20px; font-size: 20px; line-height: 1.35; }
.blog-single h3 { margin-top: 20px; font-size: 26px; font-weight: bold; }
.blog-single img { display: block; width: 100%; height: auto; margin: 10px auto; }
.back-link { margin: 20px 0 0; }

/* ---------- 13. Privacy & policy ---------- */
.policy { padding: 20px 25px 30px; }
.policy .policy-title {
  padding: 0 0 10px;
  font-family: var(--font-body);
  font-size: 30px;
  line-height: 1.2;
  text-align: left;
  background: none;
  border-bottom: 1px solid #ccc;
}
.policy h2 { margin: 25px 0 10px; font-size: 24px; }
.policy p, .policy li { text-align: justify; }
.policy hr { margin: 30px 0; }

/* ---------- 14. Lightbox (Bootstrap 6 dialog) ---------- */
.lightbox {
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.lightbox::backdrop { background: rgba(0, 0, 0, .85); }
.lightbox-image { display: block; max-width: 100%; max-height: 85vh; margin: 0 auto; }
.lightbox .btn-close {
  position: absolute;
  top: -40px;
  right: 0;
  filter: invert(1);
  opacity: 1;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  padding: 10px;
  font-size: 30px;
  color: #fff;
  background: none;
  border: 0;
  transform: translateY(-50%);
}
.lightbox-nav.prev { left: -50px; }
.lightbox-nav.next { right: -50px; }
.lightbox-nav[hidden] { display: none; }

/* ---------- 15. Responsive ---------- */
/* Narrow desktop: shrink logo + menu so they don't overlap */
@media (max-width: 929.98px) {
  #header {
    margin-top: 0;
    padding-top: 10px;
    background: url("../images/ui/bg.jpg") repeat-x center top;
  }
  .company-logo { left: 10px; top: 10px; }
  .company-logo img { width: 90px; }
  .slimmenu .nav-link { padding-inline: 7px; font-size: 16px; }
}

/* Mobile: logo centred, menu bar below it, boxes stacked */
@media (max-width: 767.98px) {
  body { font-size: 17px; }
  h1 { font-size: 36px; }

  .company-logo {
    position: relative;
    top: 0;
    left: 0;
    display: block;
    width: 20%;
    min-width: 80px;
    margin: 0 auto;
  }
  .company-logo img { width: 100%; }

  .main-nav {
    position: relative;
    top: 0;
    margin: 10px 0;
    padding-right: 0;
  }
  .slimmenu .nav-link { padding-inline: 0; font-size: 18px; }

  .box-image { flex-direction: column; }
  .box-image .cell-image { flex-basis: auto; order: 0; }
  .box-image .cell-text { padding: 20px; }

  .gallery-carousel { margin-inline: 15px; }
  .gallery-item { flex-basis: calc((100% - 20px) / 3); }

  .store-intro { max-width: 100%; }
  .store-hero-text { width: 84%; font-size: 15px; line-height: 1.2; }
  .store-hero-text h1 { margin-bottom: 5px; }
  .store-info-body { flex-direction: column; gap: 30px; }
  .feature { flex-direction: column; text-align: justify; }
  .feature-icon { order: -1; }
  .store-gallery .mosaic-col-1 a, .store-gallery .mosaic-col-4 a { height: 140px; }
  .store-gallery .mosaic-col-2 a { height: 46px; }
  .store-gallery .mosaic-col-3 a { height: 70px; }
  .store-gallery .gallery-badge { width: 80px; }

  .blog-item h2, .blog-single .article-title { font-size: 28px; }
  .policy .policy-title { font-size: 24px; }
  .lightbox-nav.prev { left: 0; }
  .lightbox-nav.next { right: 0; }
}

@media (max-width: 479.98px) {
  .gallery-item { flex-basis: calc((100% - 10px) / 2); }
  .store-hero-text p { display: none; }   /* too little room over the photo */
}
