/* === Canada Hyperbarics Custom Styles === */

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Source Sans 3', system-ui, sans-serif; color: #1A2332; line-height: 1.7; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0A1628; }
::-webkit-scrollbar-thumb { background: #2A9D8F; border-radius: 4px; }

/* Noise texture overlay */
.noise-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

/* Gradient mesh backgrounds */
.gradient-mesh-dark {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(42,157,143,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(27,58,92,0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(233,196,106,0.05) 0%, transparent 40%),
        #0A1628;
}
.gradient-mesh-light {
    background:
        radial-gradient(ellipse at 10% 20%, rgba(42,157,143,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 80%, rgba(27,58,92,0.04) 0%, transparent 50%),
        #F0F4F8;
}

/* Layered shadows */
.shadow-surface {
    box-shadow:
        0 1px 2px rgba(27,58,92,0.04),
        0 4px 12px rgba(27,58,92,0.06),
        0 12px 32px rgba(10,22,40,0.04);
}
.shadow-elevated {
    box-shadow:
        0 2px 4px rgba(27,58,92,0.06),
        0 8px 24px rgba(27,58,92,0.1),
        0 24px 48px rgba(10,22,40,0.06);
}
.shadow-floating {
    box-shadow:
        0 4px 8px rgba(27,58,92,0.08),
        0 16px 40px rgba(27,58,92,0.14),
        0 32px 64px rgba(10,22,40,0.08);
}

/* Typography */
.heading-tight { letter-spacing: -0.03em; }
.text-balance { text-wrap: balance; }

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes countUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pressureGauge {
    0% { transform: rotate(-120deg); }
    100% { transform: rotate(var(--gauge-rotation, 30deg)); }
}
.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}
.animate-fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s cubic-bezier(0.16,1,0.3,1), transform 0.7s cubic-bezier(0.16,1,0.3,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Glass nav */
.nav-glass {
    background: rgba(10, 22, 40, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(42,157,143,0.1);
}

/* Interactive states */
.btn-primary {
    background: #2A9D8F;
    color: white;
    transition: transform 0.2s cubic-bezier(0.16,1,0.3,1), opacity 0.2s;
}
.btn-primary:hover { transform: translateY(-1px); opacity: 0.92; }
.btn-primary:focus-visible { outline: 2px solid #E9C46A; outline-offset: 2px; }
.btn-primary:active { transform: translateY(0); opacity: 1; }

.btn-outline {
    border: 1.5px solid rgba(42,157,143,0.5);
    color: #2A9D8F;
    transition: transform 0.2s cubic-bezier(0.16,1,0.3,1), background 0.2s, border-color 0.2s;
}
.btn-outline:hover { background: rgba(42,157,143,0.08); border-color: #2A9D8F; transform: translateY(-1px); }
.btn-outline:focus-visible { outline: 2px solid #E9C46A; outline-offset: 2px; }
.btn-outline:active { transform: translateY(0); background: rgba(42,157,143,0.12); }

/* Nav links */
.nav-link {
    position: relative;
    color: #CBD5E1;
    transition: color 0.2s;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: #2A9D8F;
    transition: width 0.3s cubic-bezier(0.16,1,0.3,1);
}
.nav-link:hover { color: #fff; }
.nav-link:hover::after { width: 100%; }
.nav-link:focus-visible { outline: 1px solid #E9C46A; outline-offset: 4px; border-radius: 2px; }

/* Active nav item */
.current-menu-item .nav-link { color: #fff; }
.current-menu-item .nav-link::after { width: 100%; }

/* Tab system */
.tab-btn { color: #6B7B8D; border-bottom: 2px solid transparent; transition: color 0.2s, border-color 0.2s; }
.tab-btn:hover { color: #1A2332; }
.tab-btn:focus-visible { outline: 2px solid #2A9D8F; outline-offset: 2px; }
.tab-btn.active { color: #2A9D8F; border-bottom-color: #2A9D8F; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.4s cubic-bezier(0.16,1,0.3,1); }

/* Filter pills */
/* Old filter-pill rules removed — consolidated below */

/* Accordion */
.accordion-trigger {
    transition: color 0.2s;
}
.accordion-trigger:hover { color: #2A9D8F; }
.accordion-trigger:focus-visible { outline: 2px solid #2A9D8F; outline-offset: 2px; }
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16,1,0.3,1), opacity 0.3s;
    opacity: 0;
}
.accordion-content.open {
    opacity: 1;
}
.accordion-icon {
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
}
.accordion-trigger.open .accordion-icon {
    transform: rotate(180deg);
}

/* FAQ Category Accordion (level 1) */
.faq-cat-trigger {
    transition: background 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.faq-cat-trigger:hover { background: #F0F4F8; }
.faq-cat-trigger:focus-visible { outline: 2px solid #2A9D8F; outline-offset: 2px; }
.faq-cat-trigger.open { background: #F0F4F8; box-shadow: 0 2px 8px rgba(42,157,143,0.08); }
.faq-cat-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.16,1,0.3,1), opacity 0.3s;
    opacity: 0;
}
.faq-cat-content.open {
    opacity: 1;
}
.faq-cat-icon {
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
}
.faq-cat-trigger.open .faq-cat-icon {
    transform: rotate(180deg);
}

/* Resource Links Category Accordion (level 1) */
.res-cat-trigger {
    transition: background 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.res-cat-trigger:hover { background: #F0F4F8; }
.res-cat-trigger:focus-visible { outline: 2px solid #2A9D8F; outline-offset: 2px; }
.res-cat-trigger.open { background: #F0F4F8; box-shadow: 0 2px 8px rgba(42,157,143,0.08); }
.res-cat-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.16,1,0.3,1), opacity 0.3s;
    opacity: 0;
}
.res-cat-content.open { opacity: 1; }
.res-cat-icon {
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
}
.res-cat-trigger.open .res-cat-icon { transform: rotate(180deg); }

/* Resource Links Province Sub-Accordion (level 2) */
.res-inner-trigger {
    transition: background 0.2s;
    cursor: pointer;
}
.res-inner-trigger:hover { background: rgba(42,157,143,0.04); }
.res-inner-trigger:focus-visible { outline: 2px solid #2A9D8F; outline-offset: 2px; }
.res-inner-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16,1,0.3,1), opacity 0.3s;
    opacity: 0;
}
.res-inner-content.open { opacity: 1; }
.res-inner-icon {
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
}
.res-inner-trigger.open .res-inner-icon { transform: rotate(180deg); }

/* Evidence badges */
.badge-a { background: rgba(42,157,143,0.12); color: #2A9D8F; }
.badge-b { background: rgba(233,196,106,0.15); color: #b8941a; }
.badge-c { background: rgba(107,123,141,0.12); color: #6B7B8D; }
.badge-emerging { background: rgba(27,58,92,0.1); color: #1B3A5C; }

/* Card hover */
.card-hover {
    transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), box-shadow 0.3s;
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(27,58,92,0.12), 0 24px 48px rgba(10,22,40,0.06);
}

/* Province expand */
.province-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.16,1,0.3,1);
}
.province-content.open {
    max-height: 600px;
}

/* Counter animation */
.counter-value {
    font-variant-numeric: tabular-nums;
}

/* Mobile menu */
.mobile-menu {
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
}
.mobile-menu.open {
    transform: translateX(0);
}

/* Hero image */
.hero-bg {
    background-image:
        linear-gradient(to bottom, rgba(10,22,40,0.7) 0%, rgba(10,22,40,0.4) 40%, rgba(10,22,40,0.85) 100%),
        url('../images/canada-landscape.jpg');
    background-size: cover;
    background-position: center;
}

/* Maple leaf icon */
.maple-leaf { color: #E63946; }

/* WordPress admin bar spacing */
body.admin-bar .nav-glass {
    top: 32px;
}
@media screen and (max-width: 782px) {
    body.admin-bar .nav-glass {
        top: 46px;
    }
}

/* Blog category pills */
.blog-cat-pill {
    border: 1px solid #E2E8F0;
    color: #6B7B8D;
    background: transparent;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.blog-cat-pill:hover { border-color: #2A9D8F; color: #2A9D8F; }
.blog-cat-pill:focus-visible { outline: 2px solid #2A9D8F; outline-offset: 2px; }
.blog-cat-pill.active { background: #2A9D8F; color: white; border-color: #2A9D8F; }

/* Research filter pills */
.filter-pill {
    border: 1px solid rgba(255,255,255,0.4) !important;
    color: #ffffff !important;
    background: rgba(255,255,255,0.1);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.filter-pill:hover { border-color: #2A9D8F; color: #2A9D8F; background: rgba(42,157,143,0.12); }
.filter-pill:focus-visible { outline: 2px solid #2A9D8F; outline-offset: 2px; }
.filter-pill.active { background: #2A9D8F; color: white; border-color: #2A9D8F; }

/* Research pagination */
.page-btn {
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.04);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.page-btn:hover { border-color: #2A9D8F; color: #2A9D8F; background: rgba(42,157,143,0.08); }
.page-btn:focus-visible { outline: 2px solid #2A9D8F; outline-offset: 2px; }
.page-btn.active { background: #2A9D8F; color: white; border-color: #2A9D8F; }

/* Citation Widget — matches Study Details card style */
.hbot-citation-widget {
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 0;
    margin: 32px 0;
    overflow: hidden;
}
.hbot-citation-header {
    padding: 16px 20px;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.hbot-citation-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1B3A5C;
    margin: 0;
    letter-spacing: -0.01em;
}
.hbot-citation-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.hbot-tab {
    background: transparent;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    color: #6B7B8D;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 5px 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: all 0.2s ease;
}
.hbot-tab:hover {
    border-color: #2A9D8F;
    color: #2A9D8F;
}
.hbot-tab.active {
    background: #2A9D8F;
    border-color: #2A9D8F;
    color: white;
    font-weight: 600;
}
.hbot-citation-body {
    padding: 20px;
}
.hbot-citation-display {
    background: #F8FAFB;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    color: #1B3A5C;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.82rem;
    line-height: 1.8;
    min-height: 80px;
    padding: 16px 20px;
    user-select: text;
    white-space: pre-wrap;
    word-break: break-word;
}
.hbot-citation-display em {
    font-style: italic;
}
.hbot-copy-btn {
    background: #2A9D8F;
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 14px;
    padding: 10px 24px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.hbot-copy-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}
.hbot-copy-btn.copied {
    background: #22c55e;
}
.hbot-copy-confirm {
    color: #22c55e;
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    margin-left: 12px;
    min-height: 1.2em;
}
@media (max-width: 480px) {
    .hbot-copy-btn { width: 100%; justify-content: center; }
    .hbot-citation-header { flex-direction: column; align-items: flex-start; }
}

/* Study summary HTML sections */
.study-summary h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0A1628;
    letter-spacing: -0.01em;
    margin: 1.25rem 0 0.4rem 0;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid rgba(42,157,143,0.15);
}
.study-summary h3:first-child {
    margin-top: 0;
}
.study-summary p {
    margin: 0 0 0.5rem 0;
    color: #1A2B3C;
}
.study-summary p:last-child {
    margin-bottom: 0;
}

/* Blog post content tables */
.single-post .entry-content table,
.post-content table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(10,22,40,0.06), 0 4px 12px rgba(10,22,40,0.04);
    margin: 1.5rem 0;
}
.single-post .entry-content thead,
.post-content thead {
    background: #0A1628;
}
.single-post .entry-content thead th,
.post-content thead th {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #F0F4F8;
    text-align: left;
    padding: 0.75rem 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.single-post .entry-content tbody td,
.post-content tbody td {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.875rem;
    color: #1A2B3C;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #E2E8F0;
}
.single-post .entry-content tbody tr:last-child td,
.post-content tbody tr:last-child td {
    border-bottom: none;
}
.single-post .entry-content tbody tr:hover,
.post-content tbody tr:hover {
    background: rgba(42,157,143,0.03);
}

/* Print stylesheet */
@media print {
    #main-nav, .no-print, footer, .hbot-feedback,
    .gradient-mesh-dark, .gradient-mesh { display: none !important; }
    body, article { background: white !important; color: #000 !important; }
    article { padding-top: 0 !important; }
    .study-summary h3 { border-bottom-color: #ccc; }
    a { color: #000 !important; text-decoration: none !important; }
    .bg-white, .bg-cold-white, .bg-ice-white { background: white !important; border-color: #ddd !important; }
    * { box-shadow: none !important; }
    @page { margin: 2cm; }
}

/* Nearest facility pulse */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 currentColor; }
    70% { box-shadow: 0 0 0 8px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
