/* 
   Healing with Attia - Core Styles
   Modern, Soft, Professional
*/

/* Google Fonts loaded via preload in HTML — no blocking @import */

/* ── Font metric overrides — eliminates font-swap CLS ─────────────────────
   These @font-face declarations make system fallback fonts (Arial, Georgia)
   occupy the exact same space as Inter and Lora before they load.
   Result: zero layout shift when web fonts swap in.                       */
@font-face {
    font-family: 'Inter-fallback';
    src: local('Arial');
    ascent-override: 90%;
    descent-override: 22%;
    line-gap-override: 0%;
    size-adjust: 107%;
}
@font-face {
    font-family: 'Lora-fallback';
    src: local('Georgia');
    ascent-override: 91%;
    descent-override: 24%;
    line-gap-override: 0%;
    size-adjust: 102%;
}


:root {
    /* Color Palette */
    --color-primary: #2d7a6a; /* darkened from #8cc6b7 for WCAG AA 5:1 contrast */
    /* Soft Mint */
    --color-primary-dark: #1e5c4e; /* darkened from #6ba89a for WCAG AA 7.6:1 contrast */
    --color-secondary: #a3c4f3;
    /* Soft Light Blue */
    --color-accent: #e6e6fa;
    /* Lavender */
    --color-background: #fdfdfd;
    /* Off White */
    --color-surface: #ffffff;
    --color-text: #2c3e50;
    --color-text-light: #595f6b; /* darkened from #6c757d for WCAG AA footer contrast */
    --color-success: #2ecc71;
    --color-whatsapp: #25d366;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Skip to content (accessibility) */
.skip-to-content {
    position: absolute;
    top: -100%;
    left: 1rem;
    background: var(--color-primary-dark);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    z-index: 9999;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-to-content:focus {
    top: 0.5rem;
}

/* Section label — replaces decorative h5 use */
.section-label {
    color: var(--color-primary-dark);
    font-family: 'Inter', 'Inter-fallback', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

/* Screen-reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Lora', 'Lora-fallback', serif;
    color: var(--color-text);
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
}

h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    line-height: 1.2;
}

h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
}

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

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

/* Utilities */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.text-center {
    text-align: center;
}

.text-primary {
    color: var(--color-primary);
}

.bg-surface {
    background-color: var(--color-surface);
}

.bg-soft {
    background-color: #f8fbfb;
}

.section {
    padding: var(--spacing-lg) 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 2rem;
    border-radius: var(--radius-full);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: 'Inter', sans-serif;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
    background: transparent;
}

.btn-outline:hover {
    background-color: var(--color-primary);
    color: white;
}

.btn-sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

.btn-whatsapp {
    background-color: var(--color-whatsapp);
    color: #0a3d22; /* dark green — WCAG AA 8:1 contrast on #25D366 */
}

.btn-whatsapp:hover {
    background-color: #1bcf58;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Navigation */
.navbar {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    font-family: 'Lora', 'Lora-fallback', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-primary-dark);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a:not(.btn) {
    font-weight: 500;
    color: var(--color-text);
}

.nav-links a:not(.btn):hover {
    color: var(--color-primary);
}

/* Mobile Menu */
.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    /* Touch-friendly: minimum 44×44px target, no tap delay */
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    border-radius: var(--radius-sm);
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 1.5rem 2rem;
        box-shadow: var(--shadow-md);
        text-align: center;
        z-index: 999;
        gap: 0.75rem;
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-toggle {
        display: flex; /* flex so icon centres inside the 44px target */
    }
}

/* Floating WhatsApp */
.floating-whatsapp {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--color-whatsapp);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: var(--shadow-lg);
    z-index: 1001;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-whatsapp:hover {
    transform: scale(1.1);
}

.floating-whatsapp::after {
    content: 'Chat Now';
    position: absolute;
    right: 70px;
    background: white;
    color: var(--color-text);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

.floating-whatsapp:hover::after {
    opacity: 1;
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

/* Components */
.card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.icon-box {
    width: 60px;
    height: 60px;
    background: var(--color-accent);
    color: var(--color-primary-dark);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

footer {
    background: #eef2f5;
    padding: var(--spacing-lg) 0 2rem;
    margin-top: var(--spacing-xl);
}

@media (max-width: 768px) {
    /* --- Layout spacing --- */
    .section {
        padding: 2.5rem 0;
    }

    footer {
        margin-top: 2rem;
        padding: 2rem 0 1.5rem;
    }

    /* --- Typography --- */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }

    /* --- Reduce large gaps in flex layouts when stacked vertically --- */
    [style*="gap: 4rem"] { gap: 2rem !important; }
    [style*="gap: 3rem"] { gap: 1.5rem !important; }

    /* --- Fix fixed-height image frames (therapist photos) --- */
    [style*="height:380px"],
    [style*="height: 380px"],
    [style*="height:400px"],
    [style*="height: 400px"] {
        height: 240px !important;
    }

    /* --- Fix blog card images --- */
    [style*="height: 300px"],
    [style*="height:300px"] {
        height: 180px !important;
    }

    /* --- Fix hero image: height:100% collapses when flex wraps --- */
    header img[style*="height: 100%"],
    header img[style*="height:100%"] {
        height: auto !important;
        min-height: 200px;
        width: 100% !important;
    }

    /* --- Ensure all buttons meet 44px touch target --- */
    .btn {
        min-height: 44px;
    }

    /* --- Floating WhatsApp: tighten position, hide tooltip --- */
    .floating-whatsapp {
        bottom: 1.2rem;
        right: 1.2rem;
        width: 52px;
        height: 52px;
        font-size: 1.6rem;
    }

    .floating-whatsapp::after {
        display: none;
    }

    /* --- Hero section padding override (inline styles use !important) --- */
    header.section {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }

    /* --- Prevent any flex CTA row from overflowing narrow screens --- */
    [style*="display: flex"][style*="gap: 1rem"],
    [style*="display: flex"][style*="gap: 1.5rem"] {
        flex-wrap: wrap !important;
    }

}

/* Extra-small phones (≤ 400px) */
@media (max-width: 400px) {
    .logo {
        font-size: 1.2rem;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.4rem; }
}
/* Font Awesome font-display: swap — eliminates FOIT on icon fonts */
@font-face {
    font-family: 'Font Awesome 6 Free';
    font-display: swap;
    font-weight: 900;
    src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/webfonts/fa-solid-900.woff2') format('woff2');
}
@font-face {
    font-family: 'Font Awesome 6 Brands';
    font-display: swap;
    font-weight: 400;
    src: url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/webfonts/fa-brands-400.woff2') format('woff2');
}

/* Small phones (<=400px): card grids with 280-320px track minimums cannot fit
   the ~256px content width — collapse them to a single column instead of overflowing */
@media (max-width: 400px) {
    [style*="minmax(280px"],
    [style*="minmax(300px"],
    [style*="minmax(320px"] {
        grid-template-columns: 1fr !important;
    }
}
