/* Classic Header (Site Parts) - copied verbatim from the #header-bottom
 * rules in assets/css/global/header.css. header-bottom-02, mobile menu, and
 * search overlay are separate components, intentionally not duplicated here. */

/* #header already paints this background site-wide; repainting it here lets a
 * block-level override diverge. classic-header-render.php only sets these vars
 * when a block field is overridden, or when previewing in the canvas (which
 * has no #header ancestor). */
#header-bottom {
  background: rgba(var(--wpt-menu-colour), var(--wpt-menu-transparency-level));
}

#logo-wrapper a {
  display: block;
  padding: 5px 0;
  text-decoration: none;
}

html.header-version-2 #logo-wrapper a {
  padding-right: 30px;
}

#header-bottom .wpt-container-fluid > .wpt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 80px;
}

html.header-version-2 #header-bottom .wpt-container-fluid > .wpt-row {
  min-height: 115px;
}

#logo-wrapper a img {
  width: auto;
  max-height: 70px;
}

#logo-wrapper a img[src*=".svg"] {
  height: 100%;
  width: 100%;
}

/* ---------- Desktop Menu Styling ---------- */
#letterbox #menu-wrapper {
  font-size: 0.875em;
}

#menu-wrapper ul.menu {
  display: flex;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}

#menu-wrapper ul.menu > li {
  padding: 0;
  margin: 0;
  list-style: none;
  position: relative;
  text-align: left;
  white-space: nowrap;
}

#menu-wrapper ul.menu > li > a,
.book-online-button a {
  display: block;
  padding: 10px 20px;
  text-transform: uppercase;
  text-decoration: none;
  transition-duration: 300ms;
  color: var(--wpt-menu-text-colour);
  line-height: 24px;
  text-align: center;
}

html.menu-text-case-title-case
  #menu-wrapper
  ul.menu
  > li:not(.book-online-button):not(#book-online-button)
  > a {
  text-transform: capitalize;
}

html.menu-text-case-none
  #menu-wrapper
  ul.menu
  > li:not(.book-online-button):not(#book-online-button)
  > a {
  text-transform: none;
}

/* #header-bottom-scoped mirrors of the html.menu-text-case-* rules above.
 * - 3 ids beats 2, so a block override wins over the site-wide <html> class.
 * - Also the only source in the editor canvas, which never gets that class.
 * - uppercase gets one too: it has no site-wide rule, just the base above. */
#header-bottom.menu-text-case-uppercase
  #menu-wrapper
  ul.menu
  > li:not(.book-online-button):not(#book-online-button)
  > a {
  text-transform: uppercase;
}

#header-bottom.menu-text-case-title-case
  #menu-wrapper
  ul.menu
  > li:not(.book-online-button):not(#book-online-button)
  > a {
  text-transform: capitalize;
}

#header-bottom.menu-text-case-none
  #menu-wrapper
  ul.menu
  > li:not(.book-online-button):not(#book-online-button)
  > a {
  text-transform: none;
}

html.header-version-2 #menu-wrapper ul.menu > li > a {
  font-size: 16px;
  font-weight: var(--wpt-primary-font-weight);
}

#letterbox #menu-wrapper ul.menu > li > a {
  padding: 10px 12px;
}

#menu-wrapper ul.menu > li#book-online-button a,
#menu-wrapper ul.menu > li.book-online-button a,
.book-online-button a {
  color: #fff;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 10px 30px;
  background: var(--wpt-primary-booking-button-colour) !important;
  text-transform: uppercase;
}

html.header-version-2 .book-online-button a {
  white-space: nowrap;
  font-size: 14px;
}

html.header-version-2 .book-online-button a:hover {
  box-shadow: inset 0 0 0 100vw rgb(0 0 0 / 10%);
}

html.header-version-2 .book-online-button a:before {
  content: "\f133";
  font-family: "Font Awesome 6 Pro";
  font-weight: 400;
  margin-right: 10px;
}

html.header-version-2 #menu-wrapper ul.menu > li#book-online-button,
html.header-version-2 #menu-wrapper ul.menu > li.book-online-button {
  display: none;
}

html.rounded-corners-true #menu-wrapper ul.menu > li#book-online-button a,
html.rounded-corners-true #menu-wrapper ul.menu > li.book-online-button a,
html.rounded-corners-true .book-online-button a {
  border-radius: 25px;
}

html.rounded-corners-standard #menu-wrapper ul.menu > li#book-online-button a,
html.rounded-corners-standard #menu-wrapper ul.menu > li.book-online-button a,
html.rounded-corners-standard .book-online-button a {
  border-radius: 6px;
}

/* Editor/preview-only mirrors of the two rules above - see the
 * menu-text-case-* mirrors further up for why these are needed. */
#header-bottom.rounded-corners-true #menu-wrapper ul.menu > li#book-online-button a,
#header-bottom.rounded-corners-true #menu-wrapper ul.menu > li.book-online-button a,
#header-bottom.rounded-corners-true .book-online-button a {
  border-radius: 25px;
}

#header-bottom.rounded-corners-standard #menu-wrapper ul.menu > li#book-online-button a,
#header-bottom.rounded-corners-standard #menu-wrapper ul.menu > li.book-online-button a,
#header-bottom.rounded-corners-standard .book-online-button a {
  border-radius: 6px;
}

#menu-wrapper ul.menu > li#book-online-button > a:hover,
#menu-wrapper ul.menu > li.book-online-button > a:hover {
  box-shadow: inset 0 0 0 100vw rgba(0, 0, 0, 0.1);
}

#book-online-button a,
.book-online-button a {
  position: relative;
}

#menu-wrapper ul.menu > li > a::before {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 20px;
  right: 20px;
  height: 3px;
  transition-duration: 300ms;
  opacity: 0;
  background-color: var(--wpt-primary-booking-button-colour);
}

#menu-wrapper ul.menu > li.current-menu-item > a::before {
  opacity: 1;
  bottom: 4px;
}

/* header.css only grows #menu-wrapper via `html.header-version-2 #header nav`,
 * and the canvas iframe never gets that class - so nav stays content-width
 * there and align-desktop-menu-right has no room to act. */
#menu-wrapper {
  flex-grow: 1;
}

#block-system-main-menu {
  flex-grow: 1;
}

#menu-wrapper ul.menu > li > ul.menu li > a::before {
  background: transparent !important;
}

#menu-wrapper ul.menu > li:hover > a::before {
  bottom: 4px;
  opacity: 1;
  background-color: var(--wpt-primary-booking-button-colour);
}

#menu-wrapper ul.menu > li#book-online-button a::before,
#menu-wrapper ul.menu > li.book-online-button a::before {
  content: unset;
}

#menu-wrapper .content > ul.menu > li ul.menu {
  display: block;
  position: absolute;
  top: -5050px;
  background: #fff;
  min-width: 100%;
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.19),
    0 6px 6px rgba(0, 0, 0, 0.23);
  opacity: 0;
  transition: opacity ease 0.6s;
  padding: 5px 0;
}

#menu-wrapper .content > ul.menu > li:hover > ul.menu {
  display: block;
  opacity: 1;
  top: 100%;
}

#menu-wrapper .content > ul.menu > li > a + ul.menu li > a {
  color: #333;
  padding: 5px 20px;
  font-size: 0.875em;
  position: relative;
  white-space: nowrap;
  text-align: left;
}

#menu-wrapper .content > ul.menu > li > a + ul.menu li > a::before {
  content: "\f054";
  position: absolute;
  bottom: unset;
  left: 20px;
  font-family: "Font Awesome 6 Pro";
  font-weight: 800;
  opacity: 0;
  transition-duration: 300ms;
  background: transparent;
  color: var(--wpt-primary-colour) !important;
  text-align: left;
}

#menu-wrapper .content > ul.menu > li > a + ul.menu li > a:hover {
  padding-left: 30px;
  background: transparent;
}

/* Mobile search toggle - rendered by this block for header-version-2 */
@media only screen and (max-width: 900px) {
  .mobi-icon-search i {
    margin-right: 15px;
  }
}

@media only screen and (min-width: 901px) {
  .mobi-icon-search-label {
    display: none;
  }
}

/*
Menu hide script - "More" overflow collapsing, driven by JS-added body
classes counting how many #menu-wrapper items fit
*/
body.menu-hide-1:not(.menu-open)
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(2) {
  display: none;
}

body:not(.menu-open).menu-hide-2
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(2),
body:not(.menu-open).menu-hide-2
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(3) {
  display: none;
}

body:not(.menu-open).menu-hide-3
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(2),
body:not(.menu-open).menu-hide-3
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(3),
body:not(.menu-open).menu-hide-3
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(4) {
  display: none;
}

body:not(.menu-open).menu-hide-4
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(2),
body:not(.menu-open).menu-hide-4
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(3),
body:not(.menu-open).menu-hide-4
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(4),
body:not(.menu-open).menu-hide-4
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(5) {
  display: none;
}

body:not(.menu-open).menu-hide-5
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(2),
body:not(.menu-open).menu-hide-5
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(3),
body:not(.menu-open).menu-hide-5
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(4),
body:not(.menu-open).menu-hide-5
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(5),
body:not(.menu-open).menu-hide-5
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(6) {
  display: none;
}

body:not(.menu-open).menu-hide-6
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(2),
body:not(.menu-open).menu-hide-6
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(3),
body:not(.menu-open).menu-hide-6
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(4),
body:not(.menu-open).menu-hide-6
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(5),
body:not(.menu-open).menu-hide-6
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(6),
body:not(.menu-open).menu-hide-6
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(7) {
  display: none;
}

body:not(.menu-open).menu-hide-7
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(2),
body:not(.menu-open).menu-hide-7
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(3),
body:not(.menu-open).menu-hide-7
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(4),
body:not(.menu-open).menu-hide-7
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(5),
body:not(.menu-open).menu-hide-7
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(6),
body:not(.menu-open).menu-hide-7
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(7),
body:not(.menu-open).menu-hide-7
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(8) {
  display: none;
}

body:not(.menu-open).menu-hide-8
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(2),
body:not(.menu-open).menu-hide-8
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(3),
body:not(.menu-open).menu-hide-8
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(4),
body:not(.menu-open).menu-hide-8
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(6),
body:not(.menu-open).menu-hide-8
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(7),
body:not(.menu-open).menu-hide-8
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(8),
body:not(.menu-open).menu-hide-8
  #menu-wrapper
  > div
  > div
  > ul
  > *:nth-last-child(9) {
  display: none;
}

body:not(.menu-open).menu-hide-all #menu-wrapper > div > div > ul > * {
  display: none;
}

html.header-version-2 #header #header-bottom .wpt-container-fluid > .wpt-row {
  transition: 0.5s ease;
}

html.header-version-2
  #header.scroll
  #header-bottom
  .wpt-container-fluid
  > .wpt-row {
  min-height: 70px;
}

html.header-version-2 #menu-wrapper .content > ul.menu > li > a + ul.menu {
  border-top: 3px solid var(--wpt-primary-colour);
  margin-top: -7px;
  margin-left: 18px;
}

html.header-version-2 #menu-wrapper .content > ul.menu > li > a:after {
  transition: all 0.2s ease;
}

html.header-version-2 #menu-wrapper .content ul.menu ul.menu {
  top: calc(100% + 7px);
  opacity: 0;
  transition: all 0.2s ease 0.5s;
  pointer-events: none;
  visibility: hidden;
  z-index: 1;
}

html.header-version-2 #menu-wrapper .content .menu > li:hover > .menu,
html.header-version-2
  #menu-wrapper
  .content
  .menu
  > li:hover
  > a:hover
  + .menu {
  -webkit-transition-delay: 0s;
  -moz-transition-delay: 0s;
  -ms-transition-delay: 0s;
  -o-transition-delay: 0s;
  transition-delay: 0s;
}

html.header-version-2 #menu-wrapper .content .menu > li > a:hover + .menu,
html.header-version-2 #menu-wrapper .content .menu > li:hover > .menu,
html.header-version-2 #menu-wrapper .content .menu > li.open > .menu {
  top: 100%;
  opacity: 1;
  pointer-events: all;
  visibility: visible;
  z-index: 10;
}

html.header-version-2 #menu-wrapper .content > ul.menu ul.menu ul.menu {
  left: calc(100% - 5px);
  top: -0px;
}

html.header-version-2
  #menu-wrapper
  ul.menu
  > li.menu-item-has-children
  > a:after {
  content: "\f078";
  font-family: "Font Awesome 6 Pro";
  padding-left: 15px;
  font-weight: 400;
  font-size: 12px;
}

html.header-version-2 #menu-wrapper ul.menu > li.menu-item-has-children li > a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

html.header-version-2
  #menu-wrapper
  ul.menu
  > li.menu-item-has-children
  li.menu-item-has-children
  > a:after {
  content: "\f054";
}

.align-desktop-menu-right .menu.js-dt-menu {
  justify-content: end;
}

/* The rule above only turns alignment on, so a block explicitly set to "not
 * aligned right" needs this to beat a site-wide ancestor class. */
#header-bottom:not(.align-desktop-menu-right) .menu.js-dt-menu {
  justify-content: flex-start;
}

.header-version-2
  #header
  #menu-wrapper
  #block-system-main-menu
  > .content
  > .menu
  > li {
  height: 0;
  visibility: hidden;
}

.header-version-2
  #header
  #menu-wrapper
  #block-system-main-menu
  > .content
  > .menu
  > li.visible {
  height: auto !important;
  visibility: visible !important;
}

.header-version-2 #header-bottom .book-online-button {
  margin-left: auto;
}

.header-version-2
  #header-bottom
  .menu
  > li:not(.menu-item-park-page):not(.menu-item-more)
  > .menu
  > li
  > .menu
  > .menu-item-has-children
  > a::after {
  content: none;
}

html.header-overlay-true #header .menu > li > a,
html.header-overlay-true #header .menu > li > .nav-link {
  color: #fff;
  transition: color 0.4s ease;
}

html.header-overlay-true #header .mobi-icon-search {
  color: #fff;
  transition: color 0.4s ease;
}

html.header-overlay-true #header .book-online-button a {
  border: 2px solid rgba(255, 255, 255, 0.8);
  color: #fff;
  border-radius: 50px;
  transition:
    background 0.3s ease,
    color 0.3s ease;
}

html.header-overlay-true #header .book-online-button a:hover {
  background: #fff;
  color: #000;
}

html.header-overlay-true #header.scroll .menu > li > a,
html.header-overlay-true #header.scroll .menu > li > .nav-link {
  color: inherit;
}

html.header-overlay-true #header.scroll .mobi-icon-search {
  color: inherit;
}

html.header-overlay-true #header.scroll .book-online-button a {
  border-color: transparent;
  color: inherit;
}

html.header-overlay-true #header.scroll .book-online-button a:hover {
  background: inherit;
  color: inherit;
}
