/* ==========================================================================
   Shared Site Header & Navigation Overlay
   ========================================================================== */

/* .site-menu-open {
  overflow: hidden;
} */

/* --------------------------------------------------------------------------
   Fixed Header Bar
   -------------------------------------------------------------------------- */
.hdr-info {
  /* position: relative; */
  z-index: 100;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 !important;
  transition: padding 0.3s ease, background-color 0.3s ease;
}

.logo-placeholder,
.overlay-logo {
  display: block;
  width: 110px;
  flex-shrink: 0;
  position: fixed;
  left: 40px;
  top: 40px;
}

.logo-placeholder img,
.overlay-logo img {
  display: block;
  width: 100%;
  height: auto;
}

/* --------------------------------------------------------------------------
   Trigger Button
   -------------------------------------------------------------------------- */
#menuBtn {
  display: flex;
  width: clamp(40px, 3.5vw, 46px);
  height: clamp(40px, 3.5vw, 46px);
  flex-shrink: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.3s, transform 0.2s;
  position: fixed;
  right: 40px;
  top: 40px;
}

#menuBtn:hover {
  transform: scale(1.08);
}

#menuBtn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

#menuBtn.hidden {
  opacity: 0;
  pointer-events: none;
}

#menuBtn span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: #fff;
}

#menuBtn span:nth-child(1),
#menuBtn span:nth-child(3) {
  width: 20px;
}

#menuBtn span:nth-child(2) {
  width: 13px;
}

/* --------------------------------------------------------------------------
   Ripple Effect & Overlay Container
   -------------------------------------------------------------------------- */
/* ── RIPPLE ── */
#ripple {
  position: fixed;
  border-radius: 50%;
  background: var(--dark-blue);
  z-index: 200;
  pointer-events: none;
  transform: scale(0);
  transition: transform 0.75s cubic-bezier(0.7, 0, 0.3, 1);
}


/* ── FULLSCREEN OVERLAY ── */
#menuOverlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  background: var(--navy);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
}

#menuOverlay.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

#menuOverlay:after {
  content: '';
  position: absolute;
  background: url(../../images/logo.png);
  top: 10%;
  right: 0;
  width: 80%;
  height: 80%;
  background-repeat: no-repeat;
  opacity: 0.05;
  background-size: contain;
  z-index: -1;
  margin-left: auto;
  display: flex;
  justify-content: end;
  background-position: right;
}

/* --------------------------------------------------------------------------
   Overlay Top Header
   -------------------------------------------------------------------------- */
.overlay-top {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: right;
  padding: clamp(12px, 1.8vh, 18px) clamp(16px, 3.5vw, 36px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.top-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.5vw, 28px);
}

.top-links a {
  color: rgb(255 255 255 / 78%);
  font-family: "Playfair Display", serif;
  font-size: clamp(0.95rem, 1.1vw, 1.3rem);
  text-decoration: none;
  transition: color 0.2s;
}

.top-links a:hover {
  color: #fff;
}

#closeBtn {
  padding: 4px 0 4px 16px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  cursor: pointer;
  transition: color 0.2s, transform 0.3s;
}

#closeBtn:hover {
  color: #fff;
  transform: rotate(90deg);
}

/* --------------------------------------------------------------------------
   Overlay Body & Navigation Layout
   -------------------------------------------------------------------------- */
.overlay-body {
  display: flex;
  width: min(85%, 1400px);
  margin: 0 auto;
  flex: 1;
  min-height: 0;
  /* Prevents flex children from overflowing viewport height */
  overflow: hidden;
}

#navCol {
  display: flex;
  width: 42%;
  flex-shrink: 0;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding: clamp(16px, 3vh, 40px) clamp(20px, 3.5vw, 56px) clamp(16px, 3vh, 40px) clamp(16px, 2.5vw, 40px);
  overflow: visible;
  /* Prevents browser scrollbar from appearing */
}

.main-hdr {
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-hdr .nav-item {
  text-align: right;
  opacity: 0;
  transform: translateX(-28px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.main-hdr .nav-item.show {
  opacity: 1;
  transform: translateX(0);
}

.main-link {
  display: block;
  width: 100%;
  padding: clamp(4px, 0.8vh, 9px) 0;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.4);
  font-family: "Playfair Display", serif;
  font-size: clamp(1.3rem, 2vw, 2.3rem);
  font-weight: 500;
  line-height: 1.25;
  text-align: right;
  cursor: pointer;
  user-select: none;
  transition: color 0.25s, font-size 0.25s ease-in-out;
}

.main-hdr .nav-item.active .main-link,
.main-link:hover {
  color: #fff;
  /* Hover size scales based on viewport height & width so text doesn't clip on laptops */
  font-size: clamp(1.5rem, min(2.5vw, 4.5vh), 3.2rem);
}

#divider {
  width: 1px;
  flex-shrink: 0;
  margin: clamp(16px, 3vh, 40px) 0;
  background: rgba(255, 255, 255, 0.18);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.65s cubic-bezier(0.7, 0, 0.3, 1) 0.3s;
}

#menuOverlay.open #divider {
  transform: scaleY(1);
}

/* --------------------------------------------------------------------------
   Sub-menu Column
   -------------------------------------------------------------------------- */
#subCol {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.sub-group {
  position: absolute;
  top: 50%;
  right: clamp(16px, 3.5vw, 56px);
  left: clamp(16px, 3.5vw, 56px);
  max-height: 100%;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(18px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  overflow-y: auto;
}

.sub-group.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

.sub-group a {
  display: block;
  padding: clamp(6px, 1.1vh, 10px) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.55);
  font-family: "Playfair Display", serif;
  font-size: clamp(1rem, 1.3vw, 1.5rem);
  letter-spacing: 0.2px;
  text-decoration: none;
  transition: color 0.2s, padding-left 0.2s;
}

.sub-group a:last-child {
  border-bottom: 0;
}

.sub-group a:hover {
  padding-left: 6px;
  color: #fff;
}

.sub-group a[aria-disabled="true"] {
  cursor: default;
  opacity: 0.55;
}

/* --------------------------------------------------------------------------
   Overlay Footer
   -------------------------------------------------------------------------- */
.overlay-footer {
  display: flex;
  flex-shrink: 0;
  justify-content: flex-end;
  gap: clamp(12px, 2vw, 24px);
  padding: clamp(10px, 1.6vh, 16px) clamp(16px, 3.5vw, 36px);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease 0.8s, transform 0.4s ease 0.8s;
}

#menuOverlay.open .overlay-footer {
  opacity: 1;
  transform: translateY(0);
}

.overlay-footer a {
  color: #fff;
  font-size: clamp(0.85rem, 1vw, 1.3rem);
  letter-spacing: 1.5px;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s;
}

.overlay-footer a:hover {
  color: var(--dark-blue);
}

/* ==========================================================================
   Targeted Device & Screen Optimizations
   ========================================================================== */

/* Laptop Resolution Optimization (1366x768, 1300x649, and short height screens) */
@media screen and (max-height: 720px) and (min-width: 768px) {
  .overlay-top {
    padding: 10px 28px;
  }

  .overlay-footer {
    padding: 10px 28px;
  }

  #navCol {
    padding: 16px 36px 16px 20px;
  }

  .main-link {
    padding: 5px 0;
    font-size: clamp(1.2rem, 1.8vw, 1.6rem);
  }

  .main-hdr .nav-item.active .main-link,
  .main-link:hover {
    font-size: clamp(1.5rem, 2.5vw, 2.2rem);
    /* Scaled down to fit 649px height perfectly */
  }

  .sub-group a {
    padding: 6px 0;
    font-size: 1.1rem;
  }

  #divider {
    margin: 16px 0;
  }
}

/* Tablet Screens (Vertical Layout Transition) */
@media (max-width: 767px) {
  .overlay-top {
    padding: 12px 16px;
  }

  .overlay-logo {
    width: 58px;
  }

  .top-links {
    gap: 12px;
  }

  .top-links a {
    display: none;
  }

  .overlay-body {
    width: 100%;
  }

  #navCol {
    width: 48%;
    padding: 24px 18px 24px 12px;
  }

  .main-link,
  .main-hdr .nav-item.active .main-link,
  .main-link:hover {
    font-size: clamp(1rem, 4.2vw, 1.35rem);
  }

  #divider {
    margin: 24px 0;
  }

  .sub-group {
    right: 14px;
    left: 18px;
  }

  .sub-group a {
    padding: 8px 0;
    font-size: 0.92rem;
  }

  .overlay-footer {
    padding: 12px 18px;
  }
}

/* Small Devices / Phones (Up to 480px) */
@media (max-width: 480px) {
  .hdr-info {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  .hdr-info .logo-placeholder {
    width: 55px;
  }

  #menuBtn {
    width: 40px;
    height: 40px;
  }
}

/* Extra Small Devices (Up to 375px) */
@media (max-width: 375px) {
  .hdr-info {
    padding: 8px 12px;
  }

  .hdr-info .logo-placeholder {
    width: 48px;
  }

  #menuBtn {
    width: 38px;
    height: 38px;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

  #ripple,
  #menuOverlay,
  .main-hdr .nav-item,
  #divider,
  .sub-group,
  .overlay-footer,
  #menuBtn,
  #closeBtn,
  .main-link,
  .sub-group a {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}