/*
Theme Name: Horizon Base
Theme URI: https://ironwooddigital.io/horizon-base
Author: Ironwood Digital
Author URI: https://ironwooddigital.io
Description: An accessible, card-based WordPress theme for clinics, practitioners and health & wellness sites. Calm clinical palette, generous reading measure, one main column with an optional rail.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: horizon-base
Tags: medical, health, clinic, accessibility-ready, custom-logo, custom-menu, one-column, right-sidebar, threaded-comments
*/

/* ============================================================
   Horizon Base — design tokens
   ============================================================ */
:root {
    --hb-ink:        #21333f;
    --hb-ink-soft:   #566b78;
    --hb-line:       #e3eaef;
    --hb-paper:      #f3f7f9;
    --hb-surface:    #ffffff;
    --hb-care:       #15788a;   /* primary clinical teal */
    --hb-care-deep:  #0f5b69;
    --hb-care-tint:  #e7f3f5;
    --hb-vital:      #2f9e6f;   /* secondary accent */
    --hb-shadow:     0 1px 2px rgba(33,51,63,.06), 0 6px 20px rgba(33,51,63,.05);
    --hb-radius:     12px;
    --hb-measure:    68ch;
    --hb-gap:        clamp(1.25rem, 2.5vw, 2.25rem);
    --hb-stack:      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--hb-stack);
    font-size: 17px;
    line-height: 1.7;
    color: var(--hb-ink);
    background: var(--hb-paper);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--hb-care); text-decoration: none; }
a:hover, a:focus { color: var(--hb-care-deep); text-decoration: underline; }

img { max-width: 100%; height: auto; }

h1, h2, h3, h4 { line-height: 1.25; color: var(--hb-ink); font-weight: 650; }

/* ============================================================
   Top bar / brand / navigation
   ============================================================ */
.hb-topbar {
    background: var(--hb-surface);
    border-bottom: 1px solid var(--hb-line);
    box-shadow: 0 1px 0 rgba(33,51,63,.02);
    position: sticky;
    top: 0;
    z-index: 50;
}
.hb-topbar__inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: .85rem var(--hb-gap);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.hb-brand__link {
    font-size: 1.28rem;
    font-weight: 750;
    letter-spacing: -.01em;
    color: var(--hb-ink);
}
.hb-brand__link:hover { text-decoration: none; color: var(--hb-care-deep); }
.hb-brand img { display: block; max-height: 56px; width: auto; }

.hb-burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 42px;
    height: 38px;
    padding: 8px;
    background: var(--hb-care-tint);
    border: 1px solid var(--hb-line);
    border-radius: 9px;
    cursor: pointer;
}
.hb-burger__bar { display: block; height: 2px; background: var(--hb-care-deep); border-radius: 2px; }

.hb-nav__list, .hb-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: .35rem;
}
.hb-menu a {
    display: block;
    padding: .5rem .8rem;
    border-radius: 8px;
    color: var(--hb-ink-soft);
    font-weight: 550;
    font-size: .98rem;
}
.hb-menu a:hover { background: var(--hb-care-tint); color: var(--hb-care-deep); text-decoration: none; }
.hb-menu .current-menu-item > a,
.hb-menu .current_page_item > a { color: var(--hb-care-deep); background: var(--hb-care-tint); }

/* submenus */
.hb-menu li { position: relative; }
.hb-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: .35rem;
    position: absolute;
    left: 0;
    top: 100%;
    min-width: 220px;
    background: var(--hb-surface);
    border: 1px solid var(--hb-line);
    border-radius: 10px;
    box-shadow: var(--hb-shadow);
    display: none;
}
.hb-menu li:hover > .sub-menu { display: block; }
.hb-menu .sub-menu a { color: var(--hb-ink); }
/* Footer dropdowns open upward (the footer sits at the page bottom, so a downward
   submenu would fall off-screen). */
.hb-footer .hb-menu .sub-menu { top: auto; bottom: 100%; }
/* Nested (2nd-level+) submenus fly out to the side instead of stacking on their
   parent submenu — e.g. More > Committees > pages. */
.hb-menu .sub-menu .sub-menu { top: 0; left: 100%; }
.hb-footer .hb-menu .sub-menu .sub-menu { top: auto; bottom: 0; }
/* Caret hints: down for top-level dropdowns, right-chevron for fly-out submenus. */
.hb-menu .menu-item-has-children > a::after { content: " \25BE"; font-size: .8em; opacity: .65; }
.hb-menu .sub-menu .menu-item-has-children > a::after { content: " \203A"; float: right; opacity: .65; }

/* ============================================================
   Frame / layout
   ============================================================ */
.hb-canvas { min-height: 60vh; }
.hb-layout {
    max-width: 1120px;
    margin: 0 auto;
    padding: var(--hb-gap);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--hb-gap);
}
.hb-layout.has-rail { grid-template-columns: minmax(0, 1fr) 300px; }
.hb-primary { min-width: 0; }

/* ============================================================
   Cards (feed) + page/post records
   ============================================================ */
.hb-card, .hb-page, .hb-post, .hb-empty, .veyra-fossil-content {
    background: var(--hb-surface);
    border: 1px solid var(--hb-line);
    border-radius: var(--hb-radius);
    box-shadow: var(--hb-shadow);
    padding: clamp(1.4rem, 3vw, 2.6rem);
    margin: 0 0 var(--hb-gap);
}
.hb-card { padding: 0; overflow: hidden; }
.hb-card__media img { display: block; width: 100%; height: auto; }
.hb-card__title { font-size: 1.5rem; margin: 1.4rem 1.6rem .4rem; }
.hb-card__title a { color: var(--hb-ink); }
.hb-card__title a:hover { color: var(--hb-care-deep); text-decoration: none; }
.hb-card__byline { margin: 0 1.6rem .8rem; color: var(--hb-ink-soft); font-size: .9rem; }
.hb-card__dot { margin: 0 .45rem; color: var(--hb-line); }
.hb-card__excerpt { margin: 0 1.6rem; color: var(--hb-ink-soft); }
.hb-card__more {
    display: inline-block;
    margin: 1rem 1.6rem 1.6rem;
    font-weight: 600;
    color: var(--hb-care);
}

.hb-page__title, .hb-post__title { font-size: clamp(1.7rem, 3.5vw, 2.3rem); margin: 0 0 1.1rem; }
.hb-page__title { padding-bottom: 1rem; border-bottom: 3px solid var(--hb-care-tint); }

/* ============================================================
   Long-form content typography (injected pages)
   ============================================================ */
/* Full width by default: content fills its column (the whole container on the
   default/full-width template; the narrower column on the Right Sidebar template).
   --hb-measure is kept for any opt-in narrow reading layout. */
.hb-page__body, .hb-post__body, .veyra-fossil-content {
    max-width: none;
}
.hb-page__body p, .hb-post__body p, .veyra-fossil-content p { margin: 0 0 1.15em; }
.hb-page__body h1, .hb-page__body h2, .hb-page__body h3,
.hb-post__body h2, .hb-post__body h3,
.veyra-fossil-content h1, .veyra-fossil-content h2, .veyra-fossil-content h3 {
    margin: 1.8em 0 .5em;
}
.hb-page__body h2, .hb-post__body h2, .veyra-fossil-content h2 { font-size: 1.5rem; }
.hb-page__body h3, .hb-post__body h3, .veyra-fossil-content h3 { font-size: 1.2rem; }
.hb-page__body ul, .hb-page__body ol,
.hb-post__body ul, .hb-post__body ol,
.veyra-fossil-content ul, .veyra-fossil-content ol { margin: 0 0 1.15em 1.3em; }
.hb-page__body li, .veyra-fossil-content li { margin: .3em 0; }
.hb-page__body img, .hb-post__body img, .veyra-fossil-content img { border-radius: 8px; }
.hb-page__body blockquote, .veyra-fossil-content blockquote {
    margin: 1.4em 0;
    padding: .6em 1.2em;
    border-left: 4px solid var(--hb-care);
    background: var(--hb-care-tint);
    border-radius: 0 8px 8px 0;
    color: var(--hb-ink);
}
.hb-page__body table, .veyra-fossil-content table { border-collapse: collapse; width: 100%; margin: 1.3em 0; }
.hb-page__body th, .hb-page__body td,
.veyra-fossil-content th, .veyra-fossil-content td { border: 1px solid var(--hb-line); padding: .55em .8em; text-align: left; }
.hb-page__body th, .veyra-fossil-content th { background: var(--hb-care-tint); }
.veyra-fossil-content h1:first-child { margin-top: 0; }

/* ============================================================
   Empty state + pagination + rail
   ============================================================ */
.hb-empty__title { margin: 0 0 .5rem; }
.hb-pager, .pagination, .nav-links { margin-top: var(--hb-gap); display: flex; gap: .4rem; flex-wrap: wrap; }
.nav-links .page-numbers {
    display: inline-block;
    padding: .5rem .85rem;
    border: 1px solid var(--hb-line);
    border-radius: 8px;
    background: var(--hb-surface);
    color: var(--hb-ink);
}
.nav-links .page-numbers.current { background: var(--hb-care); color: #fff; border-color: var(--hb-care); }

.hb-rail .hb-widget {
    background: var(--hb-surface);
    border: 1px solid var(--hb-line);
    border-radius: var(--hb-radius);
    box-shadow: var(--hb-shadow);
    padding: 1.3rem 1.4rem;
    margin: 0 0 var(--hb-gap);
}
.hb-widget__title { margin: 0 0 .8rem; font-size: 1.05rem; color: var(--hb-care-deep); }
.hb-rail ul { list-style: none; margin: 0; padding: 0; }
.hb-rail li { padding: .35rem 0; border-bottom: 1px solid var(--hb-line); }

/* ============================================================
   Footer
   ============================================================ */
.hb-footer {
    margin-top: clamp(2rem, 5vw, 4rem);
    background: var(--hb-ink);
    color: #c4d3da;
}
.hb-footer__inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 1.6rem var(--hb-gap);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: .92rem;
}
.hb-footer a { color: #fff; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
    .hb-layout.has-rail { grid-template-columns: minmax(0, 1fr); }
    .hb-burger { display: flex; }
    .hb-nav {
        display: none;
        position: absolute;
        left: 0; right: 0; top: 100%;
        background: var(--hb-surface);
        border-bottom: 1px solid var(--hb-line);
        box-shadow: var(--hb-shadow);
        padding: .6rem var(--hb-gap) 1rem;
    }
    .hb-nav.hb-nav--open { display: block; }
    .hb-nav__list, .hb-menu { flex-direction: column; align-items: stretch; gap: .15rem; }
    .hb-menu .sub-menu { position: static; display: block; box-shadow: none; border: 0; padding-left: 1rem; }
    .hb-topbar__inner { position: relative; }
}

.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(1px,1px,1px,1px);
    white-space: nowrap;
}
