/* Cinderella's header (includes/header.inc, assets/js/header.js), on every page.
   A sage top row over the cream menu row with its gold menu bar; the sign hangs from the top over both rows. Scrolling:
   the top row slides away and the sign docks into the menu row at once; much further down the menu row shrinks
   (two measured thresholds, so it never bounces). Sizes of the visible sign come from the logo file: its pixels
   start 2.5% of the height in from the left and 1.5% down, and reach the foot. */

:root {
  --cc-top-h: 44px;
  --cc-menu-h: 96px;
  --cc-menu-h-c: 70px;
  --cc-rule: 3px;
  --header-h: calc(var(--cc-top-h) + var(--cc-menu-h));
  --cc-logo-h: 155px;   /* round 11 (Joshua): 155px from 1400px wide; same top and left, so it grows down and right */
  --cc-logo-top: 6px;
  /* docked and shrunk (rounds 11-12, Joshua): the whole sign, ribbon included, inside the bar, the space under the
     ribbon (above the gold rule) equal to the space over the sign, as measured in the pixels
     (_tools/check-sign-pixels.py). -y is where the sign's visible top sits in the bar; it starts 1.5% down its image
     and the ribbon ends 98.8% down */
  --cc-dock-h: 85px; --cc-dock-y: 6px;
  --cc-stuck-h: 59.5px; --cc-stuck-y: 5px;
  --cc-sage: #5F7F6B;
  --cc-sage-dd: #3E5A48;
  --cc-ink-green: #2E4537;
  --cc-gold: #D8B35A;
  --cc-cream: #FAFAF7;
  --cc-ease: cubic-bezier(.23, 1, .32, 1);
}
html { scroll-padding-top: calc(var(--cc-menu-h-c) + 16px); }
html.cc-growing, html.cc-gliding { overflow-anchor: none; }
html.cc-nav-open { overflow: hidden; }
.cc-no-anim, .cc-no-anim * { transition: none !important; }

.cc-skip { position: absolute; left: 12px; top: -100px; z-index: 2000; padding: 10px 16px; border-radius: 8px;
  background: var(--cc-cream); color: var(--cc-sage-dd); font: 600 17px/1 "Poppins", sans-serif; }
.cc-skip:focus { top: 10px; }

.cc-header { position: sticky; top: calc(var(--cc-top-h) * -1); z-index: 1000; transition: box-shadow .3s var(--cc-ease); }
.cc-header.is-stuck { box-shadow: 0 8px 26px rgba(40, 55, 40, .18); }
.cc-header ul { list-style: none; margin: 0; padding: 0; }
.cc-ico { width: 18px; height: 18px; flex: none; display: block; }

/* top row */
.cc-top {
  height: var(--cc-top-h); overflow: hidden; color: #fff;
  background: linear-gradient(180deg, #5A7C66 0%, #52745E 100%);   /* white 4.7-5.2:1 everywhere (round 26; was #5E806A at the top, 4.4:1) */
  font: 600 17px/1 "Open Sans", sans-serif;
}
.cc-top-inner { display: flex; align-items: center; justify-content: flex-end; height: 100%; }
.cc-top-list { display: flex; align-items: center; gap: 30px; height: 100%; }
.cc-top-link { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.cc-top-link .cc-ico { color: #F2D891; }
.cc-top a, .cc-top .protectEmail { color: #fff !important; font-weight: 600 !important; text-decoration: none; }
.cc-top a:hover { text-decoration: underline; text-underline-offset: .22em; }

/* menu row */
.cc-bar { position: relative; height: var(--cc-menu-h); background: var(--cc-cream); transition: height .3s var(--cc-ease); }
.cc-bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--cc-rule);
  background: linear-gradient(180deg, #E2C273, #C9A247); pointer-events: none; }
.cc-header.is-stuck .cc-bar { height: var(--cc-menu-h-c); }
.cc-bar-inner { position: relative; display: flex; align-items: center; height: calc(100% - var(--cc-rule)); }

.cc-brand {
  position: absolute; z-index: 2; display: block;
  left: calc(12px - var(--cc-logo-h) * .025);
  top: calc(var(--cc-logo-top) - var(--cc-top-h));
  height: var(--cc-logo-h);
  filter: drop-shadow(0 6px 10px rgba(30, 40, 30, .22));
  transition: top .3s var(--cc-ease), left .3s var(--cc-ease), height .3s var(--cc-ease), filter .3s;
}
.cc-brand img { display: block; width: auto; height: 100%; max-width: none; }
.cc-header.is-docked .cc-brand {
  height: var(--cc-dock-h); left: calc(12px - var(--cc-dock-h) * .025);
  top: calc(var(--cc-dock-y) - var(--cc-dock-h) * .015);
  filter: drop-shadow(0 4px 8px rgba(30, 40, 30, .18));
}
.cc-header.is-stuck .cc-brand {
  height: var(--cc-stuck-h); left: calc(12px - var(--cc-stuck-h) * .025);
  top: calc(var(--cc-stuck-y) - var(--cc-stuck-h) * .015);
}

/* the menu (round 8, Joshua's pick): one gold button framed like the site's .cc-btn (Book Your Campsite): rounded
   ends, a thin light keyline just inside the edge, a darker gold edge underneath and a soft shadow. Round 9 (Joshua's
   pick, white words): bold white Poppins 700 on #B29033, the colour closest to the site's #D8B35A (CIEDE2000 10.5)
   that passes WCAG AA with white as large bold text (3.0:1; bold 21px and 20px count as large, which needs 3:1). It
   can't be any lighter. The current page a near-white #FAFAF7 tile with sage words; the item pointed at outlined in stitching. Stay With Us drops a
   list framed the same way, right-aligned, rising into place. Items 46px (45px at 1200-1399), labels centred on their
   capitals (measured, _tools/check-label-centering.py). Structure here; the look is for 1200px and wider only (under
   that, the Menu panel below). The plain old-site menu and the gliding highlight are in _backup/. */
.cc-nav { margin-left: auto; }
.cc-link {
  display: flex; align-items: center; margin: 0; border: 0; background: none; cursor: pointer; white-space: nowrap;
  font-family: "Poppins", sans-serif; text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.cc-chev { display: none; }
.cc-has-sub { position: relative; }
.cc-sub a { display: block; white-space: nowrap; font-family: "Poppins", sans-serif; text-decoration: none; }
@media (min-width: 1200px) {
  .cc-menu {
    display: flex; align-items: center; gap: 3px; padding: 6px; border-radius: 10px; background: #B29033;
    box-shadow: inset 0 0 0 3px #B29033, inset 0 0 0 4px rgba(255, 240, 200, .5);   /* no shadow or dark edge under the bar (round 15, Joshua) */
  }
  .cc-link {
    padding: 8px 15px 7px; border-radius: 6px; background: transparent;   /* centred on the capitals, not the descenders (measured) */
    font-size: 21px; font-weight: 700; line-height: 30px; letter-spacing: .01em; color: #fff;   /* 45px: the menu (57px) then sits on a whole pixel in the 93px and 67px rows */
    transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
  }
  /* hover (rounds 13-14, Joshua): a touch darker than the bar (#A98830, white 3.4:1), with the bar's stitched line drawn round the item at its edges (both
     sides, and the bar's very top and bottom) instead of a darker shade; the gold also hides the bar's inner stitch there */
  .cc-link:hover, .cc-has-sub:hover > .cc-link, .cc-has-sub.is-open > .cc-link {
    background: #A98830; color: #fff;
    /* pressed in (round 16): the stitch on top, a soft shade along the inside top, a faint light line along the inside foot */
    box-shadow: inset 0 0 0 1px rgba(255, 240, 200, .5), inset 0 3px 6px rgba(70, 48, 5, .38), inset 0 -2px 3px rgba(255, 240, 200, .22);
  }
  .cc-link[aria-current="page"], .cc-has-sub.is-current > .cc-link {
    background: #FAFAF7; color: #3E5A48;   /* 7.3:1 */
    box-shadow: 0 1px 2px rgba(60, 45, 10, .28), 0 3px 9px rgba(60, 45, 10, .24), inset 0 0 0 1px rgba(255, 255, 255, .7);   /* raised a little off the bar */
    position: relative; z-index: 1;
  }
  .cc-link:focus-visible { outline: 2px solid #3E5A48; outline-offset: 2px; }
  .cc-sub {
    /* left-aligned with Stay With Us (round 39, Joshua): the list's words start where the link's word starts; the offset
       is the link's left padding minus the list's own (6px) and its items' (14px; 18px from 1540) */
    position: absolute; left: calc(var(--cc-sub-x, -5px) + 5.5px);   /* +5.5: measured so the letters line up, not the boxes */ top: calc(100% + 6px); z-index: 99; margin: 0; padding: 6px; border-radius: 10px;
    background: #B29033;
    box-shadow: inset 0 0 0 3px #B29033, inset 0 0 0 4px rgba(255, 240, 200, .5), 0 2px 0 #8C7026, 0 12px 26px rgba(60, 50, 20, .24);
    opacity: 0; visibility: hidden; transition: opacity .3s, top .3s, visibility .3s;
  }
  .cc-has-sub:hover > .cc-sub, .cc-has-sub.is-open > .cc-sub, .cc-has-sub:focus-within > .cc-sub { opacity: 1; top: 100%; visibility: visible; }   /* touching the bar, no gap (round 17, Joshua) */
  .cc-sub li + li { margin-top: 2px; }
  .cc-sub a {
    padding: 9px 14px 8px; border-radius: 6px; background: transparent;
    font-size: 20px; font-weight: 700; line-height: 30px; color: #fff; transition: background-color .18s ease, color .18s ease;
  }
  .cc-sub a:hover, .cc-sub a:focus-visible { background: #A98830; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 240, 200, .5), inset 0 3px 6px rgba(70, 48, 5, .38), inset 0 -2px 3px rgba(255, 240, 200, .22); }
  .cc-sub a[aria-current="page"] { background: #FAFAF7; color: #3E5A48; box-shadow: 0 1px 0 rgba(110, 85, 20, .55); }
  .cc-sub a:focus-visible { outline: 2px solid #3E5A48; outline-offset: -2px; }
}
@media (min-width: 1200px) and (max-width: 1399px) {
  .cc-link { padding: 8px 10px 7px; font-size: 20px; line-height: 30px; letter-spacing: 0; }
  .cc-sub { --cc-sub-x: -10px; }   /* 45px; bold words: tighter so they fit beside the sign */
}
/* larger where there's room (round 10, Joshua: "mostly the left/right padding", the text a little): the page container
   grows in steps (Bootstrap: 1320px from 1400, 1500px from 1540), so the menu does too, keeping clear of the sign
   (hanging: 59px at 1200-1399, 67px at 1400-1539, 123px from 1540; _tools/check-menu-fit.py) */
@media (min-width: 1400px) {
  .cc-link { padding-left: 17px; padding-right: 17px; }
  .cc-sub { --cc-sub-x: -3px; }
}
@media (min-width: 1540px) {
  .cc-menu { gap: 4px; padding: 7px; }
  .cc-link { padding-left: 23px; padding-right: 23px; font-size: 22px; }
  .cc-sub a { padding-left: 18px; padding-right: 18px; font-size: 21px; }
  .cc-sub { --cc-sub-x: -1px; }
}
.cc-nav-contact { display: none; }

.cc-toggle { display: none; }
.cc-scrim[hidden] { display: none; }

/* 1200-1399: a little less room */
@media (max-width: 1399px) {
  :root { --cc-logo-h: 128px; }   /* still hangs well below the menu; makes room for the bold words (round 9) */
}

/* under 1200: the Menu button and a panel from the right */
@media (max-width: 1199px) {
  :root { --cc-menu-h: 86px; --cc-menu-h-c: 66px; --cc-logo-h: 130px; --cc-dock-h: 76px; --cc-dock-y: 5px; --cc-stuck-h: 55px; --cc-stuck-y: 5px; }
  .cc-toggle {
    display: inline-flex; align-items: center; gap: 10px; margin-left: auto; padding: 8px 0 8px 10px;   /* the word's right edge on the container's, like the top row's */
    border: 0; background: none; cursor: pointer; color: var(--cc-ink-green);
    font: 600 19px/1 "Poppins", sans-serif; -webkit-tap-highlight-color: transparent;
    position: relative; z-index: 1102;
  }
  .cc-toggle svg { width: 30px; height: 30px; }
  .cc-toggle-close, .cc-toggle[aria-expanded="true"] .cc-toggle-open { display: none; }
  .cc-toggle[aria-expanded="true"] .cc-toggle-close { display: block; }
  .cc-toggle:focus-visible { outline: 3px solid var(--cc-sage-dd); outline-offset: 2px; border-radius: 8px; }
  .cc-nav {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 1101; width: min(420px, 100%); margin: 0;
    padding: calc(var(--cc-menu-h) + 6px) 26px 32px; overflow-y: auto; overscroll-behavior: contain;
    background: var(--cc-cream); box-shadow: -18px 0 44px rgba(30, 40, 30, .25);
    transform: translateX(105%); visibility: hidden;
    transition: transform .3s var(--cc-ease), visibility 0s linear .3s;
  }
  .cc-nav::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--cc-gold); }
  .cc-nav.is-open { transform: none; visibility: visible; transition: transform .3s var(--cc-ease); }
  .cc-nav:focus { outline: none; }
  .cc-menu { display: block; padding: 0; background: none; box-shadow: none; border-radius: 0; }
  .cc-menu > li { border-bottom: 1px solid rgba(95, 127, 107, .2); }
  .cc-link { gap: .3em; width: 100%; padding: 17px 4px; font-size: 22px; font-weight: 500; line-height: 1; color: var(--cc-ink-green); }
  .cc-link:hover, .cc-link:focus-visible { background: none; color: var(--cc-sage-dd); }
  .cc-link[aria-current="page"] { background: none; box-shadow: none; color: var(--cc-sage-dd); font-weight: 600; }
  .cc-link[aria-current="page"]::before { content: ""; width: 6px; height: 1.1em; margin-right: 6px; border-radius: 3px; background: var(--cc-gold); }
  .cc-has-sub.is-current > .cc-link { background: none; box-shadow: none; }
  /* Stay With Us in the panel (round 35, Joshua): closed until pressed; open, or on one of its pages, it's bold with the
     gold bar like the current page, and its chevron turns */
  .cc-sub-toggle { cursor: pointer; justify-content: flex-start; }
  .cc-chev { display: block; width: .8em; height: .8em; margin-left: auto; color: var(--cc-sage); transition: transform .2s var(--cc-ease); }
  .cc-has-sub:hover .cc-chev { transform: none; }
  .cc-has-sub.is-open > .cc-sub-toggle .cc-chev { transform: rotate(180deg); }
  .cc-has-sub.is-open > .cc-sub-toggle, .cc-has-sub.is-current > .cc-sub-toggle { color: var(--cc-sage-dd); font-weight: 600; }
  .cc-has-sub.is-open > .cc-sub-toggle::before, .cc-has-sub.is-current > .cc-sub-toggle::before {
    content: ""; width: 6px; height: 1.1em; margin-right: 6px; border-radius: 3px; background: var(--cc-gold); }
  .cc-sub, .cc-has-sub:hover > .cc-sub, .cc-has-sub:focus-within > .cc-sub {
    display: none; position: static; min-width: 0; padding: 0 0 12px 14px; background: none; box-shadow: none;
    opacity: 1; visibility: inherit; transform: none; transition: none;
  }
  .cc-has-sub.is-open > .cc-sub { display: block; }
  .cc-sub::before { display: none; }
  .cc-sub a { padding: 12px 10px; border-radius: 8px; font-size: 20px; font-weight: 500; line-height: 1.1; color: var(--cc-ink-green); }
  .cc-sub a:hover { color: var(--cc-sage-dd); }
  .cc-sub a[aria-current="page"] { background: rgba(216, 179, 90, .28); box-shadow: none; font-weight: 600; }
  .cc-nav-contact { display: block; margin-top: 24px; }
  .cc-nav-contact li { display: flex; align-items: center; gap: 12px; padding: 10px 2px; font: 600 18px/1.4 "Open Sans", sans-serif; color: var(--cc-ink-green); }
  .cc-nav-contact a, .cc-nav-contact .protectEmail { display: inline-flex; align-items: center; gap: 12px; color: var(--cc-ink-green) !important; text-decoration: none; }
  .cc-nav-contact .cc-ico { width: 22px; height: 22px; color: var(--cc-sage); }
  .cc-nav-addr { padding-left: 34px; font-weight: 400; }
  .cc-scrim { position: fixed; inset: 0; z-index: 1100; background: rgba(30, 40, 30, .45); }
  html.cc-nav-open .cc-header { z-index: 1101; }
}

/* phones: a shorter top row with the phone and email as icons beside the hanging sign */
@media (max-width: 767px) {
  :root { --cc-top-h: 38px; --cc-menu-h: 72px; --cc-menu-h-c: 62px; --cc-logo-h: min(100px, calc((100vw - 24px - 118px) / 2.78)); --cc-dock-h: 61.5px; --cc-dock-y: 5px; --cc-stuck-h: 50.5px; --cc-stuck-y: 5px; }
  .cc-top-list { gap: 4px; }
  .cc-top-link span { display: none; }
  .cc-top-link { position: relative; justify-content: center; width: 36px; height: 34px; }
  .cc-top-link .cc-ico { width: 20px; height: 20px; }
  .cc-top-mail { position: relative; }
  .cc-top-list > li:last-child .cc-top-link, .cc-top-list > li.cc-top-mail { justify-content: flex-end; }   /* the last icon's right edge over the Menu word's */
  .cc-top-mail .protectEmail, .cc-top-mail a { position: absolute; inset: 0; font-size: 0 !important; color: transparent !important; }
  .cc-toggle { font-size: 18px; gap: 8px; }
  .cc-toggle svg { width: 28px; height: 28px; }
  .cc-nav { padding-top: calc(var(--cc-top-h) + var(--cc-menu-h) + 4px); }
}
