/* ==========================================================================
   Your Counselling Practice - GLOBAL STYLES
   A calm, modern, nature-inspired design system.
   ========================================================================== */

/* --- 1. CSS VARIABLES (DESIGN SYSTEM) --- */
:root {
    /* Primary Palette */
    --deep-forest: #2F4F3A;
    --soft-moss: #8FAF9A;
    --warm-stone: #E9E5DF;
    --calm-linen: #F7F5F1;
    --charcoal: #2A2A2A;
    
    /* Secondary & Accent Palette */
    --earth-brown: #C7B8A4;
    --soft-sage: #DDE3DE;
    --muted-copper: #B58A63;
    --white: #FFFFFF;

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lora', serif;

    /* Spacing Scale (8pt grid system) */
    --space-8: 8px;
    --space-12: 12px;
    --space-16: 16px;
    --space-24: 24px;
    --space-32: 32px;
    --space-48: 48px;
    --space-64: 64px;

    /* Transitions & UI Details */
    --transition-soft: all 0.3s ease-in-out;
    --radius-soft: 8px;
    --radius-button: 6px;
    --shadow-soft: 0 4px 16px rgba(42, 42, 42, 0.06);
}

/* --- 2. CSS RESET & BASE STYLES --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--calm-linen);
    color: var(--charcoal);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

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

/* --- 3. ACCESSIBILITY --- */
a:focus-visible, 
button:focus-visible {
    outline: 2px solid var(--soft-moss);
    outline-offset: 4px;
}

/* --- 4. TYPOGRAPHY --- */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--deep-forest);
    font-weight: 400;
    line-height: 1.25;
    margin-bottom: var(--space-24);
}

h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); }
h2 { font-size: clamp(2rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 1.75rem); }

p { margin-bottom: var(--space-24); }

a {
    color: var(--deep-forest);
    text-decoration: underline;
    text-decoration-color: var(--soft-moss);
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    transition: var(--transition-soft);
}

a:hover { color: var(--soft-moss); }

/* --- 5. LAYOUT & GRID --- */
.cb-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-24);
}

.cb-section { padding: var(--space-64) 0; }

@media (min-width: 768px) {
    .cb-section { padding: 96px 0; }
}

.cb-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-48);
    align-items: center;
}

@media (min-width: 768px) {
    .cb-grid-2 { grid-template-columns: 1fr 1fr; gap: var(--space-64); }
}

/* --- 6. COMPONENTS: BUTTONS --- */
.cb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-size: 17px;
    font-weight: 500;
    padding: 14px 24px;
    border-radius: var(--radius-button);
    text-decoration: none !important;
    transition: var(--transition-soft);
    cursor: pointer;
    border: none;
}

.cb-btn-primary { background-color: var(--deep-forest); color: var(--white); }
.cb-btn-primary:hover { background-color: #243d2c; transform: translateY(-2px); }

/* --- 7. NAVIGATION (FIXED) --- */
.cb-header {
    background-color: var(--calm-linen);
    padding: 16px 0;
    border-bottom: 1px solid var(--warm-stone);
    position: sticky;
    top: 0;
    z-index: 1000; /* High enough to stay above content */
}

.cb-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Hide desktop nav on mobile by default */
.cb-desktop-nav {
    display: none; 
}

/* Show desktop nav and hide hamburger on large screens */
@media (min-width: 1024px) {
    .cb-desktop-nav {
        display: flex;
        align-items: center;
        gap: 32px;
    }
    .cb-mobile-toggle {
        display: none !important;
    }
}

.cb-nav-list {
    display: flex;
    gap: 24px;
    list-style: none;
    align-items: center;
}

.cb-nav-link {
    font-family: var(--font-body);
    font-size: 17px;
    color: var(--charcoal);
    text-decoration: none;
    transition: var(--transition-soft);
}

.cb-nav-link:hover {
    color: var(--deep-forest);
    text-decoration: underline;
    text-decoration-color: var(--soft-moss);
}

/* --- 8. MOBILE PANEL & OVERLAY --- */
.cb-mobile-toggle {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1100; /* Higher than the header */
    position: relative;
    pointer-events: auto; /* Ensures it's clickable */
}

.cb-hamburger-line {
    width: 28px;
    height: 3px; /* Slightly thicker for better visibility */
    background-color: var(--deep-forest);
    transition: var(--transition-soft);
    pointer-events: none; /* Let the click pass through to the button */
}

.cb-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(42, 42, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-soft);
}

.cb-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.cb-mobile-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 360px;
    
    /* THE FIXES: */
    height: 100vh;           /* Force it to fill the full viewport height */
    height: 100dvh;          /* Better support for mobile browser address bars */
    overflow-y: auto;        /* Allows vertical scrolling if the menu is long */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling for iOS Safari */
    
    background-color: var(--calm-linen);
    z-index: 1101;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 32px;
    display: flex;
    flex-direction: column;
}

/* Ensure the list inside doesn't get cut off by bottom padding */
.cb-mobile-nav {
    flex-grow: 1;
    padding-bottom: 60px; /* Extra breathing room at the bottom of the list */
}

.cb-mobile-panel.is-open {
    right: 0;
}

.cb-mobile-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.cb-mobile-close {
    font-size: 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--deep-forest);
}

.cb-mobile-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.cb-mobile-link {
    font-family: var(--font-heading);
    font-size: 24px;
    text-decoration: none;
    color: var(--charcoal);
}

/* --- 9. UTILITIES --- */
.text-center { text-align: center; }
.w-full { width: 100%; }
.mt-32 { margin-top: 32px; }

/* DROPDOWN STYLES (Desktop Only) */
@media (min-width: 1024px) {
    .cb-dropdown-parent { position: relative; }
    .cb-dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        background: white;
        min-width: 220px;
        padding: 16px 0;
        border-radius: 8px;
        box-shadow: var(--shadow-soft);
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: var(--transition-soft);
    }
    .cb-dropdown-parent:hover .cb-dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    .cb-dropdown-link {
        display: block;
        padding: 10px 24px;
        text-decoration: none;
        font-size: 16px;
    }
}