/* Main nav mega-menu (template-parts/cc-nav.php + js/cc-nav.js), ported from chillcountry.com's header:
   red bar of parents with chevrons; one peach panel below with an image card + icon links. */

/* Sticky nav: the header sticks, shifted up by the logo band so only the red bar stays in view
   (js/cc-nav.js sets --cc-band-h). The WP admin bar is fixed above 600px wide, so the header sits under it there.
   body overflow-x: clip, not the theme's hidden: hidden makes body a scroll container and disables sticky. */
body { overflow-x: clip; }
#masthead.site-header { position: sticky; top: calc(var(--wp-admin--admin-bar--height, 0px) - var(--cc-band-h, 0px)); z-index: 1000; }
@media (max-width: 600px) { #masthead.site-header { top: calc(0px - var(--cc-band-h, 0px)); } }
.cc-nav__panel { max-height: 0; }
.cc-nav__panel[aria-hidden="false"] { overflow-y: auto; }

/* Top-level items: the <a> rules in chillcountry.css, applied to the <button> parents too */
.cc-red-nav-list > li > .cc-nav__parent {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 4px 8px;
    background: none;
    border: 2px solid transparent;
    border-radius: 20px;
    box-shadow: none !important;
    color: #fff;
    cursor: pointer;
    font-family: "manop-variable", sans-serif;
    font-variation-settings: 'wght' 600, 'wdth' 50;
    font-weight: 600;
    font-size: 24.96px;
    line-height: 1.5;
    white-space: nowrap;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease-in-out;
}
/* the theme forces padding on every button's :focus/:active */
.cc-red-nav-list > li > .cc-nav__parent:focus,
.cc-red-nav-list > li > .cc-nav__parent:active { padding: 4px 8px !important; }
.cc-nav__parent.is-active, .cc-nav__top.is-current { text-decoration: underline; }
@media (hover: hover) { .cc-nav__parent:hover { text-decoration: underline; } }
.cc-nav__chev { display: inline-flex; transition: transform 0.25s ease; }
/* Apparel links offsite: the new-tab icon sits where the others have a chevron */
.cc-red-nav-list > li > .cc-nav__offsite { display: inline-flex !important; align-items: center; gap: 5px; }
.cc-nav__offsite .cc-nav__chev { opacity: 0.85; }
.cc-nav__chev svg { display: block; }
.cc-nav__parent.is-active .cc-nav__chev { transform: rotate(180deg); }

/* The panel: slides open under the bar, in the page flow. CCR white: navy text, red accents, light rules:
   a compact row with the card (image, then a serif headline + short description) on the left and the links on the right. */
.cc-nav__panel {
    --nv-ink: #fff;
    --nv-line: #d9dde0;
    --nv-paper: var(--cc-navy, #002639);
    --nv-dim: #4a5258;
    --nv-brass: var(--cc-red, #c0392b);
    --cc-media-radius: 8px; /* same as the homepage's images and videos */
    position: relative;
    z-index: 99;
    background: var(--nv-ink);
    color: var(--nv-paper);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease-in-out;
    box-shadow: 0 14px 28px rgba(0, 38, 57, 0.18);
}
.cc-nav__mega { max-width: 1100px; margin: 0 auto; padding: 28px 24px; }
.cc-nav__grid { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 48px; align-items: start; justify-content: center; }
.cc-nav__main { min-width: 0; }
.cc-nav__side { min-width: 0; border-left: 1px solid var(--nv-line); padding-left: 48px; }

/* Card: image, then headline + description */
.cc-nav__card { display: block; color: var(--nv-paper) !important; text-decoration: none !important; }
.cc-nav__card-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--cc-media-radius);
    background: #eef0f1;
    animation: cc-nav-pulse 1.4s ease-in-out infinite;
}
.cc-nav__card-media.is-loaded { animation: none; }
@keyframes cc-nav-pulse { 0%, 100% { background-color: #eef0f1; } 50% { background-color: #e1e5e8; } }
@media (prefers-reduced-motion: reduce) { .cc-nav__card-media { animation: none; } }
.cc-nav__card-media img, .cc-nav__card-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
@media (hover: hover) { .cc-nav__card:hover .cc-nav__card-media img, .cc-nav__card:hover .cc-nav__card-media video { transform: scale(1.03); } }
.cc-nav__card-body { display: block; padding-top: 14px; }
.cc-nav__card-title {
    display: block;
    font-family: "Instrument Serif", Georgia, serif;
    font-weight: 400;
    font-size: 26px;
    line-height: 1.1;
    color: var(--nv-paper);
    transition: color 0.15s ease;
}
@media (hover: hover) { .cc-nav__card:hover .cc-nav__card-title { color: var(--nv-brass); } }
.cc-nav__card-desc {
    display: block;
    margin-top: 4px;
    font-family: "Inter Tight", ui-sans-serif, system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    color: var(--nv-dim);
}

/* Links: navy rows with thin rules, red icons */
.cc-nav__links { list-style: none; margin: 0; padding: 0; }
/* the divider is on the <li>: the theme's global a:hover sets border-bottom: none on every link */
.cc-nav__links li { list-style: none; margin: 0; border-bottom: 1px solid var(--nv-line); }
.cc-nav__links li:last-child { border-bottom: 0; }
.cc-nav__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 2px;
    border-bottom: 0 !important;
    color: var(--nv-paper) !important;
    text-decoration: none !important;
    font-family: "Inter Tight", ui-sans-serif, system-ui, sans-serif;
    font-weight: 500;
    font-size: 17px;
    transition: color 0.15s ease;
}
@media (hover: hover) { .cc-nav__link:hover { color: var(--nv-brass) !important; } }
.cc-nav__link .cc-nav__ic { flex-shrink: 0; color: var(--nv-brass); }
.cc-nav__ext { display: inline-flex; margin-left: auto; opacity: 0.4; }
.cc-nav__ext .cc-nav__ic { color: var(--nv-paper); }

/* Phones: same bar (smaller), panel stacks card then links */
@media (max-width: 990px) {
    .cc-red-nav-list > li > .cc-nav__parent,
    .cc-red-nav-list > li > .cc-nav__parent:focus,
    .cc-red-nav-list > li > .cc-nav__parent:active { font-size: 20px !important; padding: 5px 7px !important; line-height: 1.4; gap: 2px; }
    .cc-nav__chev svg { width: 14px; height: 14px; }
}
@media (max-width: 990px) {
    .cc-nav__grid { gap: 32px; }
    .cc-nav__side { padding-left: 32px; }
    .cc-nav__grid { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); }
}
@media (max-width: 768px) {
    .cc-nav__mega { padding: 18px 20px 10px; }
    .cc-nav__grid { grid-template-columns: 1fr; gap: 0; }
    .cc-nav__side { border-left: none; padding-left: 0; margin-top: 16px; border-top: 1px solid var(--nv-line); }
    .cc-nav__card-body { padding-top: 12px; }
    .cc-nav__card-title { font-size: 24px; }
    .cc-nav__link { padding: 14px 2px; }
}
/* five items: tighter spacing on phones so the whole bar fits without scrolling */
@media (max-width: 480px) {
    .cc-red-nav-list > li > a, .cc-red-nav-list > li > .cc-nav__parent,
    .cc-red-nav-list > li > .cc-nav__parent:focus, .cc-red-nav-list > li > .cc-nav__parent:active { font-size: 17px !important; padding: 5px 4px !important; }
    .cc-red-nav .cc-nav__bar { padding-left: 4px !important; padding-right: 4px !important; }
    .cc-nav__chev svg { width: 12px; height: 12px; }
    .cc-red-nav-list > li > .cc-nav__offsite { gap: 3px; }
}
@media (max-width: 374px) {
    .cc-red-nav-list > li > a, .cc-red-nav-list > li > .cc-nav__parent,
    .cc-red-nav-list > li > .cc-nav__parent:focus, .cc-red-nav-list > li > .cc-nav__parent:active { font-size: 16px !important; padding: 4px 2px !important; }
}

/* Subscribe popup (<dialog>) — same palette as the nav panels */
.cc-sub {
    width: min(520px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    margin: auto;
    padding: 40px 36px 32px;
    border: 1px solid #2a2622;
    border-radius: 14px;
    background: #0b0a09;
    color: #f3efe7;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    font-family: "Inter Tight", ui-sans-serif, system-ui, sans-serif;
}
.cc-sub::backdrop { background: rgba(0, 20, 30, 0.6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.cc-sub[open] { animation: cc-sub-in 0.22s ease-out; }
@keyframes cc-sub-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cc-sub[open] { animation: none; } }
.cc-sub__close {
    position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 40px; height: 40px;
    margin: 0; padding: 0 !important; border: 0; border-radius: 50%; background: transparent; color: #b7b0a4; cursor: pointer;
    box-shadow: none !important; -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) { .cc-sub__close:hover { color: #f3efe7; background: rgba(243, 239, 231, 0.08); } }
.cc-sub__eyebrow { margin: 0 0 10px; font-size: 12px; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: #c9a36a; }
.cc-sub__title {
    margin: 0 0 12px; font-family: "Instrument Serif", Georgia, serif !important; font-variation-settings: normal !important;
    font-weight: 400 !important; font-size: 38px !important; line-height: 1.05 !important; color: #f3efe7 !important;
    text-transform: none !important; letter-spacing: -0.005em !important; text-wrap: balance;
}
.cc-sub__text { margin: 0 0 24px; font-size: 16px; line-height: 1.55; color: #b7b0a4; font-family: inherit; font-variation-settings: normal; }
.cc-sub__field { display: flex; gap: 8px; }
.cc-sub__input {
    flex: 1; min-width: 0; height: 50px; padding: 0 16px !important; border: 1px solid #2a2622 !important; border-radius: 999px !important;
    background: #151311 !important; color: #f3efe7 !important; font-family: inherit; font-size: 16px !important; box-shadow: none !important;
}
.cc-sub__input::placeholder { color: #7d776d; }
.cc-sub__input:focus { outline: none; border-color: #f3efe7 !important; }
.cc-sub .cc-sub__submit,
.cc-sub .cc-sub__submit:focus,
.cc-sub .cc-sub__submit:active {
    /* shares the footer form's class (for the signup handler), so undo its 60px arrow-button sizing */
    flex: 0 0 auto; width: auto; min-width: 0; height: 50px; min-height: 0; white-space: nowrap;
    padding: 0 22px !important; margin: 0; border: 0; border-radius: 999px;
    background: #f3efe7; color: #0b0a09; font-family: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
    box-shadow: none !important; -webkit-tap-highlight-color: transparent; transition: background 0.15s ease;
}
@media (hover: hover) { .cc-sub .cc-sub__submit:hover { background: #c9a36a; color: #0b0a09; } }
.cc-sub__submit:disabled { opacity: 0.6; cursor: default; }
.cc-sub .cc-email-signup__message { margin: 12px 4px 0; min-height: 1.4em; font-size: 15px; color: #f3efe7; font-family: inherit; font-variation-settings: normal; }
.cc-sub .cc-email-signup__message--error { color: #f3816e; }
@media (max-width: 480px) {
    .cc-sub { padding: 36px 22px 24px; }
    .cc-sub__title { font-size: 32px !important; }
    .cc-sub__field { flex-direction: column; }
    /* in a column, flex: 1's zero basis overrides the height and collapses the field */
    .cc-sub__input { flex: 0 0 auto; width: 100%; height: 50px !important; min-height: 50px; }
    .cc-sub .cc-sub__submit { width: 100%; }
}

/* Footer columns: on desktop the heading is plain text; on phones each column collapses behind it (footer.php) */
.cc-footer-col h4 .cc-footer-col__toggle,
.cc-footer-col h4 .cc-footer-col__toggle:focus,
.cc-footer-col h4 .cc-footer-col__toggle:active {
    display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 0 !important; border: 0; background: none;
    box-shadow: none !important; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit;
    font-variation-settings: inherit; cursor: default; pointer-events: none; -webkit-tap-highlight-color: transparent;
}
.cc-footer-col__toggle svg { display: none; transition: transform 0.25s ease; }
/* Phones: two columns side by side, every link showing (no tap-to-expand) */
@media (max-width: 600px) {
    .cc-footer-columns { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 28px 16px !important; padding: 28px 0 24px !important; text-align: center; }
    .cc-footer-col h4 { margin: 0 0 10px !important; padding: 0 0 8px !important; font-size: 15px !important; }
    .cc-footer-col ul { display: block; padding: 0 !important; }
    .cc-footer-col ul li { margin-bottom: 8px; }
    .cc-footer-col ul li a { font-size: 15px !important; }
}
}
