/* ==========================================================
   05-header.css
   Ruby Station header + slide-out menu
   Matches the VEXOS landing header (rubystationnash.com/3d)
   Loaded last (after footers.css) so it wins over master-theme header rules.
   ========================================================== */

/* ------------------------------
   1. Master-theme leftovers — Palm One burger / mobile menu not used
------------------------------ */
.burger,
.mobile_menu_container {
  display: none !important;
}

/* ------------------------------
   2. Header bar (overlays the hero — no background)
------------------------------ */
.rs-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  display: flex;
  align-items: center;
  padding: 16px 16px 0 16px;
  background: none;
  pointer-events: none;
  transition: transform .3s ease;
}
/* Logged-in: sit below the WP admin bar */
.admin-bar .rs-header { top: 10px; }
.admin-bar .rs-menu { top: 10px; }
@media screen and (max-width: 782px) {
  .admin-bar .rs-header { top: 46px; }
  .admin-bar .rs-menu { top: 46px; }
}
/* Hide the WP admin bar search box (theme input styles turn it into a white box) */
#wpadminbar #wp-admin-bar-search { display: none !important; }
.rs-header__left,
.rs-header__right {
  display: flex;
  align-items: center;
  pointer-events: auto;
}
.rs-header__right {
  margin-left: auto;
  gap: 0px;
}

/* Logo tile */
.rs-header__logo {
  display: flex;
  align-items: center;
  height: clamp(42px, 4.5vh, 47px);
  padding: 8px 16px 8px 16px;
  border: 1px solid rgba(26, 30, 33, .1);
  border-radius: 8px;
  background: var(--rs-ui-logo-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  overflow: hidden;
  text-decoration: none;
}
.rs-header__logo img {
  display: block;
  height: 100%;
  width: auto;
  max-width: none;
  object-fit: contain;
}
.rs-header__logo-text {
  font-family: var(--font-serif);
  font-size: 18px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--rs-brown);
}

/* ------------------------------
   3. Shared button sweep (diagonal fill on hover)
------------------------------ */
.rs-btn-brand,
.rs-btn-phone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 1px;
  height: clamp(42px, 4.5vh, 47px);
  border-radius: 8px;
  font-family: var(--font-ui);
  font-size: clamp(15px, 1.2vw, 16px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 1.65px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  transition: .25s ease-out;
}
.rs-btn-brand span,
.rs-btn-phone span {
  position: relative;
  z-index: 2;
}
.rs-header .rs-btn-brand::after,
.rs-header .rs-btn-phone::after {
  content: "";
  position: absolute;
  top: -20%;
  left: -215%;
  width: 209%;
  height: 200%;
  transform: skew(30deg);
  transition: transform .4s cubic-bezier(.3, 1, .8, 1);
  z-index: 1;
}
.rs-header .rs-btn-brand:hover::after,
.rs-header .rs-btn-phone:hover::after {
  transform: translate3d(100%, 0, 0) skew(25deg);
}

/* Inquire Now */
.rs-btn-brand {
  padding: 8px 17px;
  border: 1px solid var(--rs-ui-brand);
  background-color: var(--rs-ui-brand);
  color: var(--rs-ui-light);
}
.rs-header .rs-btn-brand::after {
  background: var(--rs-ui-brand-dark);
}
.rs-btn-brand:hover,
.rs-btn-brand:focus {
  color: var(--rs-ui-light);
}

/* Phone */
.rs-btn-phone {
  padding: 12px 16px;
  border: 1px solid var(--rs-ui-brand);
  background: var(--rs-ui-brand);
  color: var(--rs-ui-light);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.rs-header .rs-btn-phone::after {
  background: var(--rs-ui-brand-dark);
}
.rs-btn-phone:hover,
.rs-btn-phone:focus {
  color: var(--rs-ui-light);
}

/* ------------------------------
   4. Icon pill (share / compare / fullscreen / menu)
------------------------------ */
.rs-icon-pill {
  display: flex;
  align-items: center;
  height: clamp(42px, 4.5vh, 47px);
  border: 1px solid var(--rs-ui-brand);
  border-radius: 8px;
  overflow: hidden;
  background: var(--rs-ui-brand);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
.rs-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: clamp(44px, 5vh, 50px);
  height: 100%;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--rs-ui-light);
  cursor: pointer;
  transition: .25s ease-out;
}
.rs-icon-btn svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rs-icon-btn:hover {
  background: var(--rs-ui-dark-hover);
  color: var(--rs-ui-light);
}
.rs-icon-btn .rs-fs-off { display: none; }
html.rs-is-fullscreen .rs-icon-btn .rs-fs-on { display: none; }
html.rs-is-fullscreen .rs-icon-btn .rs-fs-off { display: block; }
/* Share + Compare live in the slide-out menu, not the header */
.rs-icon-pill [data-rs-share],
.rs-icon-pill .rs-icon-btn--compare {
  display: none;
}

/* Fullscreen — same color and sweep as Inquire Now */
.rs-header .rs-icon-pill [data-rs-fullscreen] {
  position: relative;
  width: clamp(42px, 4.5vh, 47px);
  overflow: hidden;
}
.rs-header .rs-icon-pill [data-rs-fullscreen]:hover {
  background: transparent;
}
.rs-header .rs-icon-pill [data-rs-fullscreen] svg {
  position: relative;
  z-index: 2;
}
.rs-header .rs-icon-pill [data-rs-fullscreen]::after {
  content: "";
  position: absolute;
  top: -20%;
  left: -215%;
  z-index: 1;
  width: 209%;
  height: 200%;
  background: var(--rs-ui-brand-dark);
  transform: skew(30deg);
  transition: transform .4s cubic-bezier(.3, 1, .8, 1);
}
.rs-header .rs-icon-pill [data-rs-fullscreen]:hover::after {
  transform: translate3d(100%, 0, 0) skew(25deg);
}

/* Burger (Latitude 22 style, no background) */
.rs-burger {
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(42px, 4.5vh, 47px);
  padding: 0 0 0 clamp(8px, 1vw, 16px);
  border: 0;
  background: none;
  cursor: pointer;
}
.rs-burger__icon,
.rs-burger__icon::before,
.rs-burger__icon::after {
  display: block;
  width: clamp(36px, 4vw, 46px);
  height: 2.65px;
  background-color: var(--rs-eggshell);
  transition: background-color .3s ease;
}
.rs-burger__icon {
  position: relative;
}
.rs-burger__icon::before,
.rs-burger__icon::after {
  content: "";
  position: absolute;
  left: 0;
}
.rs-burger__icon::before {
  top: -10px;
}
.rs-burger__icon::after {
  top: 10px;
}
.rs-burger {
  transition: opacity .25s ease-out;
}
.rs-burger:hover {
  opacity: .7;
}

/* Share confirmation toast */
.rs-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 3000;
  transform: translate(-50%, 20px);
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--rs-ui-ink);
  color: var(--rs-ui-light);
  font-family: var(--font-ui);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.rs-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ------------------------------
   5. Slide-out menu — full screen, stacked links (Latitude 22 style)
------------------------------ */
.rs-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0 clamp(20px, 10vw, 150px);
  overflow: hidden;
  background: #231812e3;
  transform: translateX(110%);
  visibility: hidden;
  transition: transform .2s ease-in-out, visibility .2s ease-in-out;
  will-change: transform;
}
.rs-menu.is-open {
  transform: translateX(0);
  visibility: visible;
}
.rs-menu__overlay {
  display: none;
}
html:has(.rs-menu.is-open) {
  overflow: hidden;
}

/* Close (X) */
.rs-menu__close {
  position: absolute;
  top: 26px;
  right: 36px;
  z-index: 3;
  width: clamp(44px, 7vh, 50px);
  height: clamp(44px, 5vh, 50px);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: transform .25s ease-in-out;
}
.rs-menu__close:hover {
  transform: rotate(180deg);
}
.rs-menu__close span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 2.75px;
  background: var(--rs-cream-2, #ebebd3);
  transform: translate(-50%, -50%) rotate(45deg);
}
.rs-menu__close span:last-child {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* Link list — vertically centered, scrolls if taller than the screen */
.rs-menu__nav {
  width: 100%;
  max-height: 100%;
  margin: auto 0;
  padding: 10vh 0;
  overflow-y: auto;
}
.rs-menu__nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.rs-menu__item {
  width: fit-content;
  position: relative;
}
/* Phone-only items (header buttons moved into the menu at ≤600px) */
.rs-menu__item--mobile,
.rs-menu__item--availability {
  display: none;
}
.rs-menu__item > a,
.rs-menu__toggle {
  display: flex;
  align-items: center;
  gap: 16px;
  width: auto;
  padding: clamp(4px, 1.2vw, 10px) 0;
  border: 0;
  background: transparent;
  color: var(--rs-cream-2, #ebebd3);
  font-family: var(--font-sans, 'Jost', sans-serif);
  font-size: clamp(26px, 3vh, 30px);
  font-weight: 300;
  line-height: 1.1;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: color .2s ease-in-out;
}
.rs-menu__item > a:hover,
.rs-menu__toggle:hover,
.rs-menu__item--dropdown.is-open > .rs-menu__toggle {
  color: var(--rs-ui-brand-light, #b18e8a);
}

/* No sweep or master-theme underline inside the menu */
.rs-menu a::after,
.rs-menu a:hover::after,
.rs-menu button::after {
  content: none;
  display: none;
}

/* Icons off; Tours arrow sits after the text and points down */
.rs-menu__item > a svg,
.rs-menu__toggle svg {
  display: none;
}
.rs-menu__toggle .rs-menu__arrow {
  display: block;
  order: 2;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(-90deg);
  transition: transform .2s ease-in-out;
}
.rs-menu__item--dropdown.is-open > .rs-menu__toggle .rs-menu__arrow {
  transform: rotate(90deg);
}

/* Tours — opens as a column to the right; main links don't move */
.rs-menu__item--dropdown,
.rs-menu__group {
  position: relative;
  width: fit-content;
}
.rs-menu__sub,
.rs-menu__group-content {
  display: none;
  position: absolute;
  top: 0;
  left: 100%;
  z-index: 5;
  padding-left: clamp(24px, 4vw, 64px);
}
.rs-menu__sub {
  padding-top: clamp(3px, .6vw, 8px);
}
.rs-menu__item--dropdown.is-open > .rs-menu__sub,
.rs-menu__group.is-open > .rs-menu__group-content {
  display: block;
}
.rs-menu__group-toggle,
.rs-menu__group-content a {
  display: flex;
  align-items: center;
  gap: 12px;
  width: auto;
  padding: clamp(4px, .8vw, 8px) 0;
  border: 0;
  background: transparent;
  color: var(--rs-cream-2, #ebebd3);
  font-family: var(--font-sans, 'Jost', sans-serif);
  font-size: clamp(26px, 3vh, 30px);
  font-weight: 300;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color .2s ease-in-out;
}
.rs-menu__group-content a {
  font-size: clamp(19.5px, 3vh, 24px);
}
.rs-menu__group-toggle:hover,
.rs-menu__group-content a:hover,
.rs-menu__group.is-open > .rs-menu__group-toggle {
  color: var(--rs-ui-brand-light, #b18e8a);
}
.rs-menu__group-toggle svg {
  order: 2;
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(-90deg);
  transition: transform .2s ease-in-out;
}
.rs-menu__group.is-open > .rs-menu__group-toggle svg {
  transform: rotate(90deg);
}

/* ------------------------------
   6. Responsive
------------------------------ */
@media (max-width: 768px) {
  .rs-header {
    padding: 8px 8px 0 8px;
  }
  .rs-header__right {
    gap: 2px;
  }
}
@media (max-width: 1024px) {
  /* Available Residences moves from the header into the menu */
  .rs-btn-brand--availability {
    display: none;
  }
  .rs-menu__item--availability {
    display: block;
  }
}
@media (max-width: 600px) {
  /* Phone: header shows logo + menu button only; everything else is in the menu */
  .rs-btn-phone,
  .rs-btn-brand,
  .rs-icon-pill {
    display: none;
  }
  .rs-menu__item--mobile {
    display: block;
  }
  /* Phone: smaller, tighter menu links so all 12 fit */
  .rs-menu__item > a,
  .rs-menu__toggle {
    font-size: clamp(20px, 2.8vh, 24px);
    line-height: 1.1;
  }
  .rs-menu__group-toggle,
  .rs-menu__group-content a {
    font-size: clamp(20px, 2.8vh, 24px);
    line-height: 1.1;
  }
  .rs-header__logo-text {
    font-size: 14px;
    white-space: nowrap;
  }
  .rs-header__logo {
    padding: 0 8px;
  }
  .rs-header__logo-mark {
    height: 100%;
  }
}

/* ------------------------------
   7. Scroll states (Latitude 22 treatment)
   Top of page: larger bar and logo. After 50px of scroll (body.stick,
   set by init.js) both shrink over .3s.
   Homepage, top of page: burger only, in eggshell.
   Scrolled, and every other page: eggshell bar at 85%, burgundy logo
   + burger, buttons.
------------------------------ */
:root {
  --rs-eggshell: #ebebd3;
  --rs-bar-color: #35241c;
  --rs-bar-opacity: 85%;   /* scrolled / interior bar — lower to see more of the page */
}

/* Large (top of page) */
.rs-header {
  padding-top: 20px;
  transition: transform .3s ease, background-color .3s ease, padding .3s ease;
}
.rs-header__logo {
  height: clamp(52px, 6vh, 64px);
  transition: height .3s ease, background-color .3s ease, border-color .3s ease;
}
body:not(.home):not(.stick) .rs-header {
  padding-bottom: 10px;
}

/* Bar color */
body.stick .rs-header,
body:not(.home) .rs-header {
  background-color: #24160eb3;
}

/* Small (scrolled) */
body.stick .rs-header {
  padding-top: 8px;
  padding-bottom: 8px;
}
body.stick .rs-header__logo {
  height: clamp(32px, 5.5vh, 54px);
}

/* Logo sits straight on the bar (no tile) */
body.stick .rs-header__logo,
body:not(.home) .rs-header__logo {
  border-color: transparent;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Top of homepage: hide everything but the burger */
.rs-header__left,
.rs-icon-pill {
  transition: opacity .3s ease, visibility .3s ease;
}
body.home:not(.stick) .rs-header__left,
body.home:not(.stick) .rs-btn-brand,
body.home:not(.stick) .rs-btn-phone,
body.home:not(.stick) .rs-icon-pill {
  opacity: 0;
  visibility: hidden;
}
body.home:not(.stick) .rs-burger__icon,
body.home:not(.stick) .rs-burger__icon::before,
body.home:not(.stick) .rs-burger__icon::after {
  background-color: var(--rs-eggshell);
}

/* Header buttons: no background; type and icon match the burger */
.rs-header .rs-btn-brand,
.rs-header .rs-btn-phone,
.rs-header .rs-icon-pill {
  border-color: transparent;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.rs-header .rs-btn-brand,
.rs-header .rs-btn-brand:hover,
.rs-header .rs-btn-brand:focus,
.rs-header .rs-btn-phone,
.rs-header .rs-btn-phone:hover,
.rs-header .rs-btn-phone:focus,
.rs-header .rs-icon-pill [data-rs-fullscreen],
.rs-header .rs-icon-pill [data-rs-fullscreen]:hover {
  color: var(--rs-eggshell);
}
.rs-header .rs-btn-brand::after,
.rs-header .rs-btn-brand:hover::after,
.rs-header .rs-btn-phone::after,
.rs-header .rs-btn-phone:hover::after,
.rs-header .rs-icon-pill [data-rs-fullscreen]::after,
.rs-header .rs-icon-pill [data-rs-fullscreen]:hover::after {
  display: none;
}
.rs-header .rs-icon-pill [data-rs-fullscreen]:hover {
  opacity: .7;
}

/* Logo in eggshell: the logo file is used as a mask, so the color is exact */
.rs-header__logo-mark {
  display: block;
  height: 100%;
  background-color: var(--rs-eggshell);
  -webkit-mask: var(--rs-logo) center / contain no-repeat;
  mask: var(--rs-logo) center / contain no-repeat;
}
.rs-header__logo-mark img {
  height: 100%;
  opacity: 0;
}

/* Underline on hover; holds while focused after a click and on the current page */
.rs-header .rs-btn-brand,
.rs-header .rs-btn-phone,
.rs-menu__item > a,
.rs-menu__group-content a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .3em;
  text-decoration-color: transparent;
  transition: text-decoration-color .25s ease-out, color .2s ease-in-out;
}
.rs-header .rs-btn-brand:hover,
.rs-header .rs-btn-brand:focus,
.rs-header .rs-btn-phone:hover,
.rs-header .rs-btn-phone:focus,
.rs-menu__item > a:hover,
.rs-menu__item > a:focus,
.rs-menu__item > a[aria-current="page"],
.rs-menu__group-content a:hover,
.rs-menu__group-content a:focus {
  text-decoration-color: currentColor;
}

/* Burger breathing room: off the right edge and off Fullscreen */
.rs-burger {
  margin-right: clamp(8px, 1.75vw, 24px);
  padding-left: clamp(16px, 2vw, 32px);
}

@media (max-width: 768px) {
  .rs-header {
    padding-top: 14px;
  }
  body:not(.home):not(.stick) .rs-header {
    padding-bottom: 14px;
  }
  body.stick .rs-header {
    padding-top: 8px;
    padding-bottom: 8px;
  }
}
@media (max-width: 600px) {
  /* Phone logo sized by screen width (vh made it near desktop size on tall phones) */
  .rs-header__logo {
    height: clamp(30px, 9vw, 40px);
  }
  body.stick .rs-header__logo {
    height: clamp(26px, 7.5vw, 34px);
  }
}
