/* ─── HealthiiPeople Header v1.0.0 ─── */

/* ─── Light Theme Support ───
   Any page with [healthiipeople_header] gets the light theme treatment.
   We do NOT force dark backgrounds — instead we work with a light
   WordPress site. We only hide theme header/footer and clear container
   backgrounds so our custom layout takes full control. */

/* Hide theme header/footer/breadcrumbs regardless of template */
body .site-header,
body .site-footer,
body .page-header,
body .entry-header,
body .ast-breadcrumbs-wrapper,
body .hfe-header,
body .hfe-footer,
body header.entry-header,
body .elementor-location-header,
body .elementor-location-footer,
.page-title-section,
.page-header,
.entry-header,
.site-below-footer-wrap,
.ast-footer-overlay,
.site-above-footer-wrap {
    display: none !important;
}

/* Keep wrapper/container backgrounds transparent so our sections shine through */
body .site-content,
body .page .site-content,
body .entry-content,
body .elementor,
body .elementor-section,
body .elementor-widget-wrap,
body .elementor-element,
body .elementor-inner,
body .elementor-section-wrap,
body .elementor-widget-container,
.elementor-page,
.elementor-page body,
main,
#content,
#main,
.site-main,
.content-area,
article,
.page-content {
    background: transparent !important;
    background-color: transparent !important;
}

/* Kill any theme footer bars (but NOT our custom .hpf-footer) */
body footer:not(.hpf-footer),
body .site-footer,
body .ast-footer-overlay,
body .site-below-footer-wrap {
    background: transparent !important;
    color: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Remove any container padding that creates unwanted white space */
body .site-content > .ast-container,
body .site-content > .container,
body .content-area,
main.site-main {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Fix Elementor container backgrounds — let our page sections control color */
.elementor-element.e-con.e-parent,
.elementor-element.e-con {
    background-color: transparent !important;
}

.elementor-shape-bottom {
    display: none !important;
}

/* ─── CSS Variables ─── */
:root {
    --hp-primary: #0A2E4D;
    --hp-primary-light: #123D63;
    --hp-accent: #00A6A0;
    --hp-accent-hover: #008F8A;
    --hp-accent-glow: rgba(0, 166, 160, 0.2);
    --hp-accent-soft: rgba(0, 166, 160, 0.08);
    --hp-coral: #E85D75;
    --hp-coral-soft: rgba(232, 93, 117, 0.08);
    --hp-bg: #FFFFFF;
    --hp-bg-alt: #F7F8FA;
    --hp-bg-dark: #0A1628;
    --hp-surface: #FFFFFF;
    --hp-border: #E5E7EB;
    --hp-border-hover: #D1D5DB;
    --hp-text: #1A1A2E;
    --hp-text-muted: #6B7280;
    --hp-text-faint: #9CA3AF;
    --hp-radius: 12px;
    --hp-radius-sm: 10px;
}

/* ─── Header Bar ─── */
.hp-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100% !important;
    max-width: 100% !important;
    z-index: 9990;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    border-bottom: 1px solid rgba(229, 231, 235, 0.7);
    font-family: 'General Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box !important;
    margin-left: 0 !important;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.hp-header.hp-scrolled {
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.06);
}

/* Push page content below the fixed header */
body {
    padding-top: 72px !important;
}

/* When WP admin bar is showing (logged-in admin), offset the header */
body.admin-bar .hp-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .hp-header {
        top: 46px;
    }
}

.hp-header-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 28px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ─── Left: Logo ─── */
.hp-header-left { display: flex; align-items: center; }

.hp-logo-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--hp-text);
    transition: opacity 0.2s;
}

.hp-logo-link:hover { opacity: 0.85; }

.hp-logo-icon { flex-shrink: 0; }

.hp-logo-text {
    font-family: 'Satoshi', 'General Sans', sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: var(--hp-primary);
    letter-spacing: -0.01em;
}

.hp-logo-text strong {
    font-weight: 800;
    color: var(--hp-accent);
}

/* ─── Desktop Navigation ─── */
.hp-desktop-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.hp-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--hp-text-muted);
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
}

.hp-nav-link:hover {
    color: var(--hp-primary);
    background: var(--hp-bg-alt);
}

/* Dropdown */
.hp-nav-dropdown {
    position: relative;
}

.hp-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    min-width: 220px;
    background: var(--hp-surface);
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(8px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    z-index: 100;
}

.hp-nav-dropdown:hover .hp-dropdown-menu,
.hp-nav-dropdown:focus-within .hp-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.hp-dropdown-link {
    display: block;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--hp-text);
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}

.hp-dropdown-link:hover {
    background: var(--hp-accent-soft);
    color: var(--hp-accent);
}

/* ─── Header Right: Buttons + Hamburger ─── */
.hp-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 32px;
    border-radius: var(--hp-radius-sm);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    font-family: inherit;
    border: none;
    gap: 8px;
}

.hp-btn--accent {
    background: var(--hp-accent);
    color: #fff;
    box-shadow: 0 2px 12px rgba(0, 166, 160, 0.25);
}

.hp-btn--accent:hover {
    background: var(--hp-accent-hover);
    box-shadow: 0 4px 20px rgba(0, 166, 160, 0.35);
    transform: translateY(-1px);
}

.hp-btn--ghost {
    background: transparent;
    color: var(--hp-primary);
    border: 1.5px solid var(--hp-border);
}

.hp-btn--ghost:hover {
    border-color: var(--hp-accent);
    color: var(--hp-accent);
    background: var(--hp-accent-soft);
}

.hp-btn--ghost-header {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--hp-text-muted);
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-radius-sm);
    background: transparent;
    transition: all 0.15s;
    text-decoration: none;
}

.hp-btn--ghost-header:hover {
    border-color: var(--hp-accent);
    color: var(--hp-accent);
}

.hp-btn--accent-header {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: var(--hp-accent);
    border: 1px solid var(--hp-accent);
    border-radius: var(--hp-radius-sm);
    box-shadow: 0 1px 8px rgba(0, 166, 160, 0.2);
    transition: all 0.15s;
    text-decoration: none;
}

.hp-btn--accent-header:hover {
    background: var(--hp-accent-hover);
    box-shadow: 0 2px 16px rgba(0, 166, 160, 0.3);
    transform: translateY(-1px);
}

/* ─── Hamburger Button ─── */
.hp-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-radius-sm);
    cursor: pointer;
    padding: 0;
    transition: border-color 0.15s ease, background 0.15s ease;
    flex-shrink: 0;
}

.hp-hamburger:hover {
    border-color: var(--hp-accent);
    background: var(--hp-accent-soft);
}

.hp-hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--hp-text);
    border-radius: 1px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
}

/* Hamburger → X animation */
.hp-hamburger.hp-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hp-hamburger.hp-open span:nth-child(2) { opacity: 0; }
.hp-hamburger.hp-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── Mobile Sidebar Overlay ─── */
.hp-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 9991;
    background: rgba(10, 22, 40, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.hp-sidebar-overlay.hp-visible { opacity: 1; visibility: visible; }

/* ─── Mobile Sidebar ─── */
.hp-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 9992;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    background: var(--hp-surface);
    border-left: 1px solid var(--hp-border);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: 'General Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--hp-text);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.1);
}

.hp-sidebar.hp-open { transform: translateX(0); }

.hp-sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--hp-border);
    flex-shrink: 0;
}

.hp-sidebar-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--hp-text);
}

.hp-sidebar-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-radius-sm);
    color: var(--hp-text-muted);
    cursor: pointer;
    padding: 0;
    transition: all 0.15s;
}

.hp-sidebar-close:hover { color: var(--hp-accent); border-color: var(--hp-accent); }

.hp-sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }

.hp-nav-group { padding: 8px 24px 16px; }
.hp-nav-group + .hp-nav-group { border-top: 1px solid var(--hp-border); padding-top: 16px; }

.hp-nav-heading {
    font-size: 10px;
    font-weight: 700;
    color: var(--hp-text-faint);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
    padding: 0 12px;
}

.hp-sidebar-link {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--hp-text);
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
}

.hp-sidebar-link:hover { background: var(--hp-accent-soft); color: var(--hp-accent); }

.hp-sidebar-ctas { display: flex; flex-direction: column; gap: 10px; }

.hp-sidebar-footer {
    padding: 18px 24px;
    border-top: 1px solid var(--hp-border);
    flex-shrink: 0;
}

.hp-sidebar-copy { font-size: 11px; color: var(--hp-text-faint); }

/* ─── Prevent body scroll when sidebar open ─── */
body.hp-sidebar-open { overflow: hidden !important; }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    .hp-desktop-nav { display: none; }
    .hp-hamburger { display: flex; }
    .hp-btn--ghost-header { display: none; }
}

@media (max-width: 768px) {
    body { padding-top: 64px !important; }
    .hp-header-inner { height: 64px; padding: 0 20px; }
}

@media (max-width: 480px) {
    body { padding-top: 58px !important; }
    .hp-header-inner { height: 58px; padding: 0 16px; }
    .hp-logo-icon { width: 30px; height: 30px; }
    .hp-logo-text { font-size: 16px; }
    .hp-btn--accent-header { padding: 7px 14px; font-size: 12px; }
}

/* ─── Selection color ─── */
::selection { background: rgba(0, 166, 160, 0.2); color: var(--hp-text); }

/* ─── Focus visible for keyboard nav ─── */
:focus-visible {
    outline: 2px solid var(--hp-accent);
    outline-offset: 2px;
}
