/* ==========================================================================
   Site header (templates/base.html)
   Slim contact bar + sticky frosted main bar. Gold accent from the logo,
   brand purple for the booking action (matches footer & contact page).
   ========================================================================== */

.site-header {
  --hd-ink: #171b24;
  --hd-muted: #676459;
  --hd-line: rgba(23, 27, 36, 0.08);
  --hd-primary: #1f2a44;
  --hd-primary-hover: #151d31;
  --hd-primary-soft: rgba(31, 42, 68, 0.08);
  --hd-gold: #b8903f;
  --hd-dark: #0a0e17;

  position: sticky;
  top: 0;
  /* above Bootstrap's offcanvas backdrop (1040) so the mobile menu inside the
     header isn't covered by it; still below modals (1055) */
  z-index: 1045;
}

/* style.css removes the container's side padding site-wide; restore it here */
.site-header .container {
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  padding-right: calc(var(--bs-gutter-x) * 0.5);
}

/* ---------- Top contact bar (desktop) ---------- */

.hd-topbar {
  background: var(--hd-dark);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.82rem;
  transition: margin-top 0.25s ease;
}

.hd-topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 2.5rem;
}

/* desktop: the top bar scrolls away, the main bar stays pinned */
@media (min-width: 992px) {
  .site-header {
    top: -2.5rem;
  }
}

.hd-topbar ul {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hd-topbar a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.hd-topbar a:hover {
  color: #fff;
}

.hd-topbar i {
  color: #d9b66a;
  margin-right: 0.4rem;
}

.hd-topbar .hd-social a {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
}

.hd-topbar .hd-social i {
  margin: 0;
  color: inherit;
}

.hd-topbar .hd-social a:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ---------- Main bar ---------- */

.hd-main {
  position: relative;
  isolation: isolate;
  border-bottom: 1px solid var(--hd-line);
  transition: box-shadow 0.25s ease;
}

/* Frosted background lives on a pseudo-element: backdrop-filter on .hd-main
   itself would trap the fixed-position mobile menu inside the header bar. */
.hd-main::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  transition: background-color 0.25s ease;
}

.site-header.is-scrolled .hd-main {
  box-shadow: 0 10px 30px -18px rgba(23, 27, 36, 0.35);
}

.site-header.is-scrolled .hd-main::before {
  background: rgba(255, 255, 255, 0.94);
}

.hd-main .navbar {
  padding: 0;
}

.hd-main .container {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 5rem;
  transition: min-height 0.25s ease;
}

.site-header.is-scrolled .hd-main .container {
  min-height: 4.25rem;
}

/* ---------- Brand ---------- */

.hd-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-right: auto;
  color: var(--hd-ink);
  text-decoration: none;
}

.hd-brand:hover {
  color: var(--hd-ink);
}

/* the logo file has wide transparent margins: crop into the badge */
.hd-logo {
  display: grid;
  place-items: center;
  flex: none;
  width: 3rem;
  height: 3rem;
  overflow: hidden;
  border-radius: 0.8rem;
  background: #fff;
  box-shadow: 0 0 0 1px var(--hd-line), 0 6px 16px -8px rgba(23, 27, 36, 0.35);
  transition: width 0.25s ease, height 0.25s ease;
}

.hd-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.9);
}

.site-header.is-scrolled .hd-logo {
  width: 2.6rem;
  height: 2.6rem;
}

.hd-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.hd-brand-name {
  font-family: var(--bs-heading-font-family, "Playfair Display", Georgia, serif);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.hd-brand-sub {
  margin-top: 0.25rem;
  color: var(--hd-gold);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ---------- Navigation (desktop) ---------- */

@media (min-width: 992px) {
  .site-header .hd-nav {
    gap: 0.15rem;
  }

  .site-header .hd-nav > .nav-item > .nav-link {
    position: relative;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    color: var(--hd-ink);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.2;
    transition: color 0.2s ease, background-color 0.2s ease;
  }

  .site-header .hd-nav > .nav-item > .nav-link:hover,
  .site-header .hd-nav > .nav-item.show > .nav-link {
    background: var(--hd-primary-soft);
    color: var(--hd-primary);
  }

  /* active page: gold dot under the label */
  .site-header .hd-nav > .nav-item > .nav-link.active {
    color: var(--hd-primary);
  }

  .site-header .hd-nav > .nav-item > .nav-link.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0.1rem;
    width: 0.3rem;
    height: 0.3rem;
    margin-left: -0.15rem;
    border-radius: 50%;
    background: var(--hd-gold);
  }

  .site-header .hd-nav .dropdown-toggle::after {
    display: none; /* replaced by the chevron icon */
  }

  .site-header .hd-nav .hd-chevron {
    display: inline-block;
    margin-left: 0.2rem;
    font-size: 0.7rem;
    transition: transform 0.2s ease;
  }

  .site-header .hd-nav .dropdown:hover .hd-chevron,
  .site-header .hd-nav .dropdown.show .hd-chevron {
    transform: rotate(180deg);
  }

  .site-header .hd-nav .dropdown-menu {
    min-width: 16rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
    border: 1px solid var(--hd-line);
    border-radius: 1rem;
    box-shadow: 0 24px 48px -20px rgba(23, 27, 36, 0.35);
  }

  /* the last menu ("More") opens leftwards, so it never runs past the screen edge */
  .site-header .hd-nav > .nav-item:last-child > .dropdown-menu {
    left: auto;
    right: 0;
  }

  /* invisible bridge so the hover menu doesn't close in the gap */
  .site-header .hd-nav .dropdown-menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -0.75rem;
    height: 0.75rem;
  }
}

.site-header .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.65rem;
  color: var(--hd-ink);
  font-size: 0.93rem;
  white-space: normal;
}

.site-header .dropdown-item i {
  color: var(--hd-muted);
  font-size: 1rem;
}

.site-header .dropdown-item:hover,
.site-header .dropdown-item:focus,
.site-header .dropdown-item.active {
  background: var(--hd-primary-soft);
  color: var(--hd-primary);
}

.site-header .dropdown-item:hover i,
.site-header .dropdown-item.active i {
  color: var(--hd-primary);
}

.site-header .dropdown-divider {
  margin: 0.4rem 0.25rem;
  border-color: var(--hd-line);
}

.site-header .dropdown-item.hd-view-all {
  justify-content: space-between;
  color: var(--hd-primary);
  font-weight: 600;
}

/* Small laptops / landscape tablets (992–1199px): the full menu + "Book a stay" don't fit,
   so tighten spacing instead of letting the button spill off-screen */
@media (min-width: 992px) and (max-width: 1199.98px) {
  .site-header .hd-nav {
    gap: 0;
  }

  .site-header .hd-nav > .nav-item > .nav-link {
    padding: 0.5rem 0.55rem;
    font-size: 0.88rem;
  }

  .hd-brand {
    gap: 0.55rem;
  }

  .hd-brand-name {
    font-size: 1.02rem;
  }

  .hd-brand-sub {
    letter-spacing: 0.14em;
  }

  .site-header .hd-actions .hd-book {
    padding: 0.62rem 1rem;
    font-size: 0.86rem;
  }
}

/* ---------- Actions ---------- */

.hd-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.hd-call {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--hd-ink);
  text-decoration: none;
  line-height: 1.15;
}

.hd-call:hover {
  color: var(--hd-primary);
}

.hd-call .hd-call-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--hd-primary-soft);
  color: var(--hd-primary);
}

.hd-call small {
  display: block;
  color: var(--hd-muted);
  font-size: 0.72rem;
}

.hd-call strong {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.site-header .hd-book {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  background: var(--hd-primary);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 10px 24px -12px rgba(31, 42, 68, 0.9);
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.site-header .hd-book:hover {
  background: var(--hd-primary-hover);
  color: #fff;
  transform: translateY(-1px);
}

.hd-toggler {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--hd-line);
  border-radius: 50%;
  background: #fff;
  color: var(--hd-ink);
  font-size: 1.35rem;
}

.site-header a:focus-visible,
.site-header button:focus-visible {
  outline: 2px solid var(--hd-primary);
  outline-offset: 2px;
}

/* ---------- Mobile / tablet menu (offcanvas below 992px) ---------- */

@media (max-width: 991.98px) {
  .hd-main .container {
    min-height: 4.25rem;
  }

  .hd-logo {
    width: 2.6rem;
    height: 2.6rem;
  }

  .site-header .offcanvas-lg {
    width: min(22rem, 88vw);
    border-left: 0;
    background: #fff;
  }

  .hd-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--hd-line);
    color: var(--hd-ink);
  }

  .hd-menu-body {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem 1.5rem;
    overflow-y: auto;
  }

  .site-header .hd-nav > .nav-item > .nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 0.25rem;
    border-bottom: 1px solid var(--hd-line);
    color: var(--hd-ink);
    font-family: var(--bs-heading-font-family, "Playfair Display", Georgia, serif);
    font-size: 1.05rem;
    font-weight: 600;
  }

  .site-header .hd-nav > .nav-item > .nav-link.active {
    color: var(--hd-primary);
  }

  .site-header .hd-nav .dropdown-toggle::after {
    display: none;
  }

  .site-header .hd-nav .hd-chevron {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
  }

  .site-header .hd-nav .dropdown-toggle.show .hd-chevron {
    transform: rotate(180deg);
  }

  .site-header .hd-nav .dropdown-menu {
    margin: 0.25rem 0 0.5rem;
    padding: 0.25rem;
    border: 0;
    border-radius: 0.85rem;
    background: #f7f5f0;
    box-shadow: none;
  }

  .hd-menu-contact {
    margin-top: 1.5rem;
    padding: 1.1rem;
    border-radius: 1rem;
    background: #f7f5f0;
    font-size: 0.9rem;
  }

  .hd-menu-contact a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--hd-ink);
    text-decoration: none;
    overflow-wrap: anywhere;
  }

  .hd-menu-contact a + a {
    margin-top: 0.6rem;
  }

  .hd-menu-contact i {
    color: var(--hd-gold);
  }

  .hd-menu-body .hd-book {
    justify-content: center;
    margin-top: 1rem;
    padding: 0.9rem 1.3rem;
  }
}

/* Mobile bar: the hotel name comes from Admin > Office Information, so a long one shortens
   with "…" instead of pushing the buttons onto a second row. (Not on desktop, where the
   brand must keep its full width next to the menu.) */
@media (max-width: 991.98px) {
  .hd-brand,
  .hd-brand-text {
    min-width: 0;
  }

  .hd-brand-name {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Phones: logo, name, Book and menu must share one row (they wrapped to two at 360–375px) */
@media (max-width: 400px) {
  .hd-main .container {
    flex-wrap: nowrap;
    gap: 0.5rem;
  }

  .hd-brand {
    gap: 0.55rem;
  }

  .hd-logo,
  .site-header.is-scrolled .hd-logo {
    width: 2.4rem;
    height: 2.4rem;
  }

  .hd-brand-sub {
    display: none;
  }

  .hd-brand-name {
    font-size: 1rem;
  }

  .hd-actions {
    flex: none;
    gap: 0.4rem;
  }

  .hd-actions .hd-book {
    padding: 0.55rem 0.85rem;
    font-size: 0.85rem;
  }

  .hd-actions .hd-toggler {
    width: 2.5rem;
    height: 2.5rem;
  }
}

/* Very small phones (320px): the Book button becomes icon-only; the label stays for screen readers */
@media (max-width: 359.98px) {
  .hd-actions .hd-book {
    padding: 0.6rem;
  }

  .hd-actions .hd-book > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header *,
  .site-header *::before,
  .site-header *::after {
    transition: none !important;
  }
}
