/* ============================================================
   Cloud Psychiatry — Shared Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── CSS Variables ── */
:root {
    --primary-sage: #7A9B8E;
    --primary-deep: #4A6B5E;
    --primary-light: #A8C4BA;
    --accent-warm: #B8956A;
    --accent-warm-light: #D4B08C;
    --neutral-light: #F8F9F7;
    --neutral-cream: #FAF8F5;
    --neutral-mid: #E2E8E5;
    --neutral-border: #D0D9D5;
    --text-primary: #2C3E3A;
    --text-secondary: #5A6B66;
    --text-muted: #8A9B96;
    --white: #FFFFFF;
    --shadow-soft: 0 4px 20px rgba(74, 107, 94, 0.08);
    --shadow-medium: 0 8px 30px rgba(74, 107, 94, 0.12);
    --shadow-strong: 0 16px 48px rgba(74, 107, 94, 0.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 32px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', -apple-system, sans-serif;
    color: var(--text-primary);
    line-height: 1.7;
    background: var(--neutral-cream);
    /* overflow-x on body alone breaks position:sticky on mobile;
       handled instead with max-width on inner containers */
}

/* Prevent horizontal scroll from wide decorative elements only —
   NOT applied to .section/.fade-in-section, since overflow-x:clip
   on those interferes with the IntersectionObserver fade-in on mobile
   and can leave sections permanently invisible. */
.hero, .page-hero, .footer, .header nav {
    max-width: 100vw;
    overflow-x: clip;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    line-height: 1.25;
    color: var(--text-primary);
}

a {
    color: var(--primary-deep);
    transition: var(--transition);
}

    a:hover {
        color: var(--primary-sage);
    }

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ── Layout Utilities ── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.container--wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 5rem 2rem;
    position: relative;
}

.section--alt {
    background: var(--white);
}

.section--dark {
    background: var(--primary-deep);
    color: var(--white);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-tag {
    display: inline-block;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--primary-sage);
    margin-bottom: 1rem;
    background: rgba(122, 155, 142, 0.12);
    padding: 0.4rem 1rem;
    border-radius: 50px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
    color: var(--primary-deep);
}

.section-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto;
    font-weight: 300;
    line-height: 1.8;
}

/* ── Buttons ── */
.btn {
    padding: 0.875rem 1.875rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    border: 2px solid transparent;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.btn--primary {
    background: linear-gradient(135deg, var(--primary-sage), var(--primary-deep));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(122, 155, 142, 0.3);
    border-color: transparent;
}

    .btn--primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(122, 155, 142, 0.4);
        color: var(--white);
    }

.btn--secondary {
    background: transparent;
    color: var(--primary-deep);
    border-color: var(--primary-sage);
}

    .btn--secondary:hover {
        background: var(--primary-sage);
        color: var(--white);
        transform: translateY(-2px);
    }

.btn--ghost {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
}

    .btn--ghost:hover {
        background: rgba(255, 255, 255, 0.25);
        color: var(--white);
        transform: translateY(-2px);
    }

/* ── Header / Navigation ── */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    border-bottom: 1px solid var(--neutral-mid);
}

    .header.scrolled {
        box-shadow: var(--shadow-medium);
    }

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-sage), var(--primary-deep));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.logo-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

    .logo-text span {
        display: block;
        font-size: 0.65rem;
        font-family: 'DM Sans', sans-serif;
        font-weight: 400;
        letter-spacing: 1.5px;
        text-transform: uppercase;
        color: var(--text-muted);
    }

/* Nav Links */
.nav-links {
    display: flex;
    gap: 0.25rem;
    list-style: none;
    align-items: center;
}

    .nav-links a {
        text-decoration: none;
        color: var(--text-secondary);
        font-weight: 400;
        font-size: 0.9rem;
        letter-spacing: 0.2px;
        transition: var(--transition);
        padding: 0.5rem 0.875rem;
        border-radius: var(--radius-sm);
        position: relative;
    }

        .nav-links a:hover {
            color: var(--primary-deep);
            background: rgba(122, 155, 142, 0.08);
        }

        .nav-links a.active {
            color: var(--primary-deep);
            font-weight: 500;
        }

            .nav-links a.active::after {
                content: '';
                position: absolute;
                bottom: 2px;
                left: 0.875rem;
                right: 0.875rem;
                height: 2px;
                background: var(--primary-sage);
                border-radius: 2px;
            }

    .nav-links .nav-cta a {
        background: linear-gradient(135deg, var(--primary-sage), var(--primary-deep));
        color: var(--white);
        padding: 0.5rem 1.25rem;
        border-radius: var(--radius-sm);
        font-weight: 500;
    }

        .nav-links .nav-cta a:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(122, 155, 142, 0.35);
            color: var(--white);
            background: linear-gradient(135deg, var(--primary-sage), var(--primary-deep));
        }

        .nav-links .nav-cta a.active::after {
            display: none;
        }

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

/* ── Page Hero (reusable for inner pages) ── */
.page-hero {
    background: linear-gradient(135deg, #E8F0ED 0%, #F8F9F7 60%, #EEF2F0 100%);
    padding: 5rem 2rem 4rem;
    position: relative;
    overflow: hidden;
    text-align: center;
}

    .page-hero::before {
        content: '';
        position: absolute;
        inset: 0;
        background: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h60v60H0z' fill='none'/%3E%3Ccircle cx='30' cy='30' r='1' fill='rgba(122,155,142,0.12)'/%3E%3C/svg%3E");
        opacity: 0.6;
    }

    .page-hero .container {
        position: relative;
        z-index: 1;
    }

.page-hero__tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--primary-sage);
    background: rgba(122, 155, 142, 0.12);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    margin-bottom: 1.25rem;
}

.page-hero__title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--primary-deep);
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, var(--primary-deep), var(--primary-sage));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-hero__subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.8;
    font-weight: 300;
}

/* ── Cards ── */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--neutral-mid);
    transition: var(--transition);
    overflow: hidden;
}

    .card:hover {
        transform: translateY(-6px);
        box-shadow: var(--shadow-strong);
    }

/* Service Cards */
.service-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--neutral-mid);
    transition: var(--transition);
}

    .service-card:hover {
        transform: translateY(-8px);
        box-shadow: var(--shadow-strong);
        border-color: var(--primary-light);
    }

.service-icon {
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, rgba(122,155,142,0.15), rgba(74,107,94,0.1));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(122, 155, 142, 0.2);
}

.service-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    color: var(--primary-deep);
}

.service-card p {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 0.95rem;
}

/* ── Portal Cards ── */
.portal-card {
    background: var(--white);
    padding: 3rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-medium);
    border: 2px solid var(--neutral-mid);
    transition: var(--transition);
    text-align: center;
}

    .portal-card:hover {
        transform: translateY(-6px);
        border-color: var(--primary-sage);
        box-shadow: var(--shadow-strong);
    }

.portal-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-sage), var(--primary-deep));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 2rem;
    margin: 0 auto 1.75rem;
}

.portal-card h3 {
    font-size: 1.9rem;
    margin-bottom: 1rem;
    color: var(--primary-deep);
}

.portal-card p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.8;
}

/* ── Contact Section ── */
.contact-section {
    background: var(--neutral-light);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.contact-info-panel {
    background: var(--white);
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--neutral-mid);
}

    .contact-info-panel h3 {
        font-size: 1.75rem;
        color: var(--primary-deep);
        margin-bottom: 2rem;
        padding-bottom: 1rem;
        border-bottom: 2px solid var(--neutral-mid);
    }

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--neutral-light);
}

    .contact-item:last-child {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
    }

.contact-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(122,155,142,0.15), rgba(74,107,94,0.08));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    border: 1px solid rgba(122, 155, 142, 0.2);
}

.contact-details h4 {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.contact-details p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.contact-details a {
    color: var(--primary-deep);
    text-decoration: none;
    font-weight: 500;
}

    .contact-details a:hover {
        color: var(--primary-sage);
    }

.contact-details .note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.contact-crisis {
    color: var(--primary-deep) !important;
    font-weight: 500;
}

.map-panel {
    background: var(--neutral-mid);
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--neutral-border);
    position: relative;
}

.map-panel-placeholder {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

    .map-panel-placeholder p {
        margin-top: 1rem;
        font-size: 0.9rem;
    }

/* ── Hours Card ── */
.hours-card {
    background: linear-gradient(135deg, var(--primary-deep), var(--primary-sage));
    color: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    margin-top: 2rem;
}

    .hours-card h4 {
        color: var(--white);
        font-size: 1.25rem;
        margin-bottom: 1.25rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

.hours-row {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    font-size: 0.9rem;
}

    .hours-row:last-child {
        border-bottom: none;
    }

    .hours-row .day {
        color: rgba(255,255,255,0.75);
    }

    .hours-row .time {
        color: var(--white);
        font-weight: 500;
    }

/* ── Footer ── */
.footer {
    background: var(--primary-deep);
    color: var(--white);
    padding: 4rem 2rem 2rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 2.5rem;
}

.footer-brand h3 {
    font-size: 1.4rem;
    color: var(--white);
    margin-bottom: 1rem;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.footer-col h4 {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    margin-bottom: 1.25rem;
}

.footer-links {
    list-style: none;
}

    .footer-links li {
        margin-bottom: 0.75rem;
        color: rgba(255, 255, 255, 0.7);
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .footer-links a {
        color: rgba(255, 255, 255, 0.75);
        text-decoration: none;
        transition: var(--transition);
    }

        .footer-links a:hover {
            color: var(--white);
        }

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
}

    .footer-contact-item a {
        color: rgba(255, 255, 255, 0.75);
        text-decoration: none;
    }

        .footer-contact-item a:hover {
            color: var(--white);
        }

.disclaimer {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 2rem;
}

    .disclaimer strong {
        color: rgba(255,255,255,0.75);
    }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.85rem;
    flex-wrap: wrap;
    gap: 1rem;
}

    .footer-bottom a {
        color: rgba(255, 255, 255, 0.55);
        text-decoration: none;
    }

        .footer-bottom a:hover {
            color: var(--white);
        }

/* ── Animations ── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in-section {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s ease-out, transform 0.65s ease-out;
}

    .fade-in-section.is-visible {
        opacity: 1;
        transform: translateY(0);
    }

/* ── Stat Cards ── */
.stat-card {
    text-align: center;
    padding: 2rem 1.5rem;
    background: var(--neutral-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--neutral-mid);
    transition: var(--transition);
}

    .stat-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-soft);
    }

.stat-number {
    font-size: 2.5rem;
    font-family: 'Cormorant Garamond', serif;
    color: var(--primary-sage);
    font-weight: 600;
    margin-bottom: 0.4rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 600;
}

/* ── Prepare / Info Boxes ── */
.info-box {
    background: rgba(122, 155, 142, 0.08);
    border: 1px solid rgba(122, 155, 142, 0.25);
    border-left: 4px solid var(--primary-sage);
    border-radius: var(--radius-md);
    padding: 2rem 2.5rem;
}

    .info-box h4 {
        color: var(--primary-deep);
        margin-bottom: 1rem;
        font-size: 1.15rem;
    }

    .info-box ul {
        color: var(--text-secondary);
        line-height: 2;
        padding-left: 1.25rem;
    }

        .info-box ul li {
            margin-bottom: 0.25rem;
        }

/* ── Responsive ── */
@media (max-width: 1100px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 1024px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Keep nav pinned to top on mobile */
    .header {
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 1.5rem 1rem;
        box-shadow: var(--shadow-medium);
        gap: 0.25rem;
        border-top: 1px solid var(--neutral-mid);
    }

        .nav-links.active {
            display: flex;
        }

        .nav-links a {
            padding: 0.75rem 1rem;
            width: 100%;
        }

    .mobile-menu-btn {
        display: block;
    }

    .section {
        padding: 3rem 1rem;
    }

    .container,
    .container--wide {
        padding: 0 1rem;
        max-width: 100%;
    }

    .section-header {
        margin-bottom: 2.5rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    /* Don't force full-width on every button — only standalone ones */
    .hero-buttons .btn,
    .portal-card .btn,
    .cta-banner .btn {
        width: 100%;
        justify-content: center;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    /* Portal cards stack cleanly */
    .portal-grid {
        grid-template-columns: 1fr;
    }

    /* Service cards stack */
    .services-grid {
        grid-template-columns: 1fr;
    }

    /* Why grid stacks */
    .why-grid {
        grid-template-columns: 1fr;
    }

    /* Welcome stats stay 2 col on mobile */
    .welcome-stats {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0.875rem 1rem;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .logo-text span {
        display: none; /* hide subtitle on very small screens */
    }

    .page-hero {
        padding: 3.5rem 1rem 2.5rem;
    }

    .portal-card {
        padding: 2rem 1.25rem;
    }

    .contact-info-panel {
        padding: 2rem 1.25rem;
    }

    .hours-card {
        padding: 1.75rem 1.25rem;
    }

    .section-title {
        font-size: 1.75rem;
    }
}
