/* ============================================================
 * Heat & Birch — site navigation + footer
 * Sticky header, click dropdowns, mobile drawer, site footer.
 *
 * Ported from the Lapland Trip Planner theme on 2026-11-06 (same markup and
 * behaviour, this site's palette). The palette repeats the --hb-* tokens that
 * front-page.php declares inline, so the header looks the same on the homepage
 * and on articles, where that inline block does not exist.
 * ============================================================ */

:root {
    --hb-smoke:       #1c1815;
    --hb-cedar:       #a86a3a;
    --hb-cedar-dark:  #8a5329;
    --hb-amber:       #d99240;
    --hb-birch-cream: #f4ede3;
    --hb-paper:       #faf6ef;
    --hb-muted:       #6b625a;
    --hb-muted-light: #9a8f84;
    --hb-line:        #d9cfc1;
    --hb-header-h:    64px;
}

/* ---- Skip link (a11y) ---- */
.hb-skip {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--hb-smoke);
    color: #fff;
    padding: 10px 16px;
    z-index: 10000;
}
.hb-skip:focus { left: 8px; top: 8px; }

/* ---- Site shell ---- */
.hb-site { background: var(--hb-paper); }
#content.hb-content { min-height: 60vh; }

/* ============================================================
 * STICKY HEADER
 * ============================================================ */
.hb-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--hb-paper);
    border-bottom: 1px solid var(--hb-line);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
body.admin-bar .hb-header { top: 32px; }
@media (max-width: 782px) {
    body.admin-bar .hb-header { top: 46px; }
}

.hb-header__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: var(--hb-header-h);
    display: flex;
    align-items: center;
    gap: 32px;
}

/* ---- Brand ---- */
.hb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--hb-smoke);
    flex-shrink: 0;
}
.hb-brand__logo {
    width: 30px;
    height: 30px;
    border-radius: 7px;
}
.hb-brand__wordmark {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: 23px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.2px;
    white-space: nowrap;
}
/* Upright on purpose: Fraunces' italic ampersand is ornate enough to be
   misread at this size. The cedar colour carries the accent instead. */
.hb-brand__wordmark em {
    font-style: normal;
    color: var(--hb-cedar);
}

/* ============================================================
 * DESKTOP NAV BAR
 * ============================================================ */
.hb-nav { flex: 1; }
.hb-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: flex-end;
    gap: 4px;
}
.hb-nav__item {
    position: relative;
}
.hb-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 0;
    padding: 10px 14px;
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    color: var(--hb-smoke);
    text-decoration: none;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.hb-nav__link:hover {
    background: var(--hb-birch-cream);
    color: var(--hb-smoke);
}
.hb-nav__caret {
    transition: transform 0.2s;
}
.hb-nav__trigger[aria-expanded="true"] .hb-nav__caret {
    transform: rotate(180deg);
}

/* Active section */
.hb-nav__item.is-active > .hb-nav__link {
    color: var(--hb-cedar-dark);
}
.hb-nav__item.is-active > .hb-nav__link::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 6px;
    height: 2px;
    background: var(--hb-amber);
    border-radius: 2px;
}

/* ---- Dropdown panels ---- */
.hb-panel {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: #fff;
    border: 1px solid var(--hb-line);
    border-radius: 12px;
    box-shadow: 0 20px 50px -20px rgba(28, 24, 21, 0.25);
    padding: 12px;
    z-index: 110;
}
.hb-panel[hidden] { display: none; }

/* Flat dropdown */
.hb-panel--flat {
    min-width: 320px;
}
.hb-panel__list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.hb-panel__item a {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--hb-smoke);
    transition: background 0.15s;
}
.hb-panel__item a:hover {
    background: var(--hb-birch-cream);
}
.hb-panel__label {
    display: block;
    font-size: 15px;
    font-weight: 500;
}
.hb-panel__note {
    display: block;
    font-size: 12px;
    color: var(--hb-muted-light);
    margin-top: 2px;
}
.hb-panel__see-all {
    margin-top: 4px;
    border-top: 1px solid var(--hb-line);
    padding-top: 6px;
}
.hb-panel__see-all a {
    display: block;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--hb-cedar-dark);
    text-decoration: none;
    border-radius: 8px;
}
.hb-panel__see-all a:hover {
    background: var(--hb-birch-cream);
}

/* ============================================================
 * MOBILE BURGER + RESPONSIVE
 * ============================================================ */
.hb-burger {
    display: none;
    background: none;
    border: 0;
    padding: 8px;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    margin-left: auto;
}
.hb-burger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--hb-smoke);
    border-radius: 2px;
    transition: transform 0.2s;
}

@media (max-width: 960px) {
    .hb-nav { display: none; }
    .hb-burger { display: flex; }
    .hb-header__inner { gap: 16px; padding: 0 16px; }
    .hb-brand__wordmark { font-size: 18px; }
}

/* ============================================================
 * MOBILE DRAWER
 * ============================================================ */
.hb-drawer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    justify-content: flex-end;
}
.hb-drawer[hidden] { display: none; }
body.admin-bar .hb-drawer { top: 32px; }
@media (max-width: 782px) {
    body.admin-bar .hb-drawer { top: 46px; }
}

.hb-drawer__overlay {
    position: absolute;
    inset: 0;
    background: rgba(28, 24, 21, 0.5);
    backdrop-filter: blur(2px);
    animation: hbFade 0.2s ease-out;
}
.hb-drawer__panel {
    position: relative;
    width: min(82%, 400px);
    height: 100%;
    background: #fff;
    box-shadow: -20px 0 60px -20px rgba(28, 24, 21, 0.4);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: hbSlideIn 0.25s ease-out;
}
@keyframes hbFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes hbSlideIn {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}
.hb-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--hb-line);
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}
.hb-drawer__title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 18px;
    color: var(--hb-smoke);
}
.hb-drawer__close {
    background: none;
    border: 0;
    padding: 6px;
    color: var(--hb-smoke);
    cursor: pointer;
    border-radius: 6px;
}
.hb-drawer__close:hover { background: var(--hb-birch-cream); }

.hb-drawer__list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}
.hb-drawer__item {
    border-bottom: 1px solid var(--hb-line);
}
.hb-drawer__item:last-child { border-bottom: 0; }

.hb-drawer__link,
.hb-drawer__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: 0;
    padding: 18px 20px;
    font: inherit;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--hb-smoke);
    text-decoration: none;
    cursor: pointer;
    text-align: left;
}
.hb-drawer__item.is-active > .hb-drawer__link,
.hb-drawer__item.is-active > .hb-drawer__trigger {
    color: var(--hb-cedar-dark);
}
.hb-drawer__caret { transition: transform 0.2s; }
.hb-drawer__trigger[aria-expanded="true"] .hb-drawer__caret {
    transform: rotate(180deg);
}

.hb-drawer__sub {
    background: var(--hb-birch-cream);
    padding: 4px 20px 16px;
}
.hb-drawer__sub[hidden] { display: none; }
.hb-drawer__sub ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.hb-drawer__sub li a {
    display: block;
    padding: 10px 0;
    font-size: 15px;
    color: var(--hb-smoke);
    text-decoration: none;
    border-bottom: 1px solid rgba(228, 224, 219, 0.6);
}
.hb-drawer__sub li:last-child a { border-bottom: 0; }
.hb-drawer__see-all a {
    color: var(--hb-cedar-dark);
    font-weight: 600;
    font-size: 13px;
}

.hb-drawer__group {
    margin-top: 14px;
}
.hb-drawer__group:first-child { margin-top: 4px; }
.hb-drawer__group-heading {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--hb-muted-light);
    margin-bottom: 4px;
}

/* ---- Body scroll lock when drawer open ---- */
html.hb-drawer-open { overflow: hidden; }

/* ---- Focus styles ---- */
.hb-nav__link:focus-visible,
.hb-drawer__link:focus-visible,
.hb-drawer__trigger:focus-visible,
.hb-drawer__close:focus-visible,
.hb-burger:focus-visible,
.hb-panel a:focus-visible,
.hb-footer__list a:focus-visible {
    outline: 2px solid var(--hb-amber);
    outline-offset: 2px;
}

/* ============================================================
 * SITE FOOTER
 * Rendered by footer.php. Carries the only crawlable anchors to
 * the legal pages and the cluster hubs.
 * ============================================================ */
.hb-footer {
    background: var(--hb-smoke);
    color: var(--hb-paper);
    margin-top: 64px;
    padding: 48px 24px 24px;
}
.hb-footer__inner {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 32px;
}
.hb-footer__col { min-width: 0; }
.hb-footer__heading {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--hb-amber);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.hb-footer__list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.hb-footer__list li { margin: 0; }
.hb-footer__list a {
    display: block;
    padding: 5px 0;
    font-size: 14px;
    color: var(--hb-paper);
    text-decoration: none;
}
.hb-footer__list a:hover {
    color: var(--hb-amber);
    text-decoration: underline;
}
.hb-footer__legal {
    max-width: 1120px;
    margin: 32px auto 0;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.hb-footer__legal p {
    margin: 0;
    font-size: 13px;
    color: var(--hb-muted-light);
}

@media (max-width: 860px) {
    .hb-footer__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}
@media (max-width: 460px) {
    .hb-footer__inner { grid-template-columns: 1fr; }
}

/* ---- Guards against the parent theme ----
 * Kadence styles every <a> and <button> inside the page shell. These keep the
 * header, drawer and footer on their own colours whatever the Customizer says. */
.hb-header a,
.hb-header a:hover,
.hb-drawer a,
.hb-footer a { box-shadow: none; }
.hb-header button,
.hb-drawer button {
    box-shadow: none;
    text-transform: none;
    letter-spacing: normal;
}
.hb-header button:hover,
.hb-header button:focus,
.hb-drawer button:hover,
.hb-drawer button:focus { box-shadow: none; }
.hb-nav__link,
.hb-nav__link:hover,
.hb-nav__link:focus { color: var(--hb-smoke); }
.hb-nav__trigger:hover,
.hb-nav__trigger:focus { background: var(--hb-birch-cream); }
.hb-burger,
.hb-burger:hover,
.hb-burger:focus { background: none; }
.hb-drawer__trigger,
.hb-drawer__trigger:hover,
.hb-drawer__trigger:focus { background: none; color: var(--hb-smoke); }
.hb-drawer__close,
.hb-drawer__close:focus { background: none; color: var(--hb-smoke); }
.hb-drawer__close:hover { background: var(--hb-birch-cream); color: var(--hb-smoke); }

/* Kadence still prints its own (now trigger-less) mobile drawer from wp_footer. */
#mobile-drawer { display: none !important; }

/* ---- Heat & Birch specifics ---- */

/* The last dropdown would run off the right edge next to the search pill. */
.hb-nav__item:last-child .hb-panel { left: auto; right: 0; }

/* The homepage ends on a full-width band, so no gap above the footer there. */
body.home .hb-footer { margin-top: 0; }

.hb-footer { font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; }
.hb-footer__brand {
    font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
    font-size: 22px;
    font-weight: 500;
    line-height: 1.2;
}
.hb-footer__legal p.hb-footer__brand { color: var(--hb-paper); font-size: 22px; margin-bottom: 8px; }
.hb-footer__brand em { font-style: normal; color: var(--hb-amber); }
.hb-footer__legal p { max-width: 720px; margin: 0 0 6px; line-height: 1.55; }
.hb-footer__legal a {
    color: var(--hb-paper);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.hb-footer__legal a:hover { color: var(--hb-amber); }
.hb-footer__legal p.hb-footer__meta { margin-top: 16px; }
.hb-footer__meta span { margin: 0 4px; }
