:root {
    /* Base Variables (Shared) */
    --accent: #7C3AED;
    --accent-hover: #6D28D9;
    --white: #FFFFFF;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

[data-theme="light"],
:root:not([data-theme="dark"]) {
    --primary: #F8FAFC;
    --bg-secondary: #F1F5F9;
    --text-light: #0F172A;
    --text-muted: #475569;
    --glass: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(15, 23, 42, 0.1);
    --card-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
    --logo-color: #0A192F;
    --logo-url: url('../images/nlp-ni-logo-light.png');
    --hero-overlay: linear-gradient(rgba(248, 250, 252, 0.85), rgba(248, 250, 252, 0.7));
    /* Navy */
    color-scheme: light;
}

[data-theme="dark"] {
    --primary: #0A192F;
    --bg-secondary: #050C16;
    --text-light: #F8FAFC;
    --text-muted: #94A3B8;
    --glass: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.15);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --logo-color: #FFFFFF;
    --logo-url: url('../images/nlp-ni-logo-dark.png');
    --hero-overlay: linear-gradient(rgba(10, 25, 47, 0.9), rgba(10, 25, 47, 0.75));
    color-scheme: dark;
}

.hero-content,
.hero-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

html {
    font-size: 100%;
}

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

h1,
h2,
h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header & Nav */
header {
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background: var(--primary);
    opacity: 0.98;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--logo-color);
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    gap: 1.2rem;
    list-style: none;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-links a {
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-light);
    opacity: 0.8;
    position: relative;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    opacity: 1;
    color: var(--accent);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Buttons */
.btn {
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    display: inline-block;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(124, 58, 237, 0.3);
}

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

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

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    background: var(--hero-overlay), url('https://transformingpeople.com/wp-content/uploads/2021/02/TPA-Background.jpg');
    background-size: cover;
    background-position: center;
    text-align: center;
}

.hero-content h1,
.page-header h1,
.hero-small h1,
.hero-text h1,
.article-hero h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    line-height: 1.1;
    width: 100%;
}

.hero-content p,
.page-header p,
.hero-small p,
.hero-text p,
.article-hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* Glass Cards */
.glass-card {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    transition: var(--transition);
}

.glass-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
}

/* Sections */
section {
    padding: 8rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-title p {
    color: var(--text-muted);
}

/* Grid System */
.grid,
.article-grid,
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
}

.article-grid {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 992px) {
    .article-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .article-grid {
        grid-template-columns: 1fr;
    }
}

/* Form Styles */
.form-section {
    background: var(--hero-overlay), url('https://nlpnorthernireland.com/wp-content/uploads/2021/04/NLP-Northern-Ireland-Logo-312x94.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

input,
select,
textarea {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: 10px;
    color: var(--text-light);
    /* Fixed from --white to support theme switching */
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.1);
}

.checkbox-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.95rem;
    cursor: pointer;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* Article Cards */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
}

.article-card {
    position: relative;
    overflow: hidden;
    padding: 0;
    height: 400px;
    border: none;
    border-radius: 20px;
}

.article-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.article-card .content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2.5rem 2rem;
    background: linear-gradient(to bottom, rgba(10, 25, 47, 0) 0%, rgba(10, 25, 47, 0.8) 20%, rgba(10, 25, 47, 0.98) 100%);
    color: white;
    z-index: 2;
    text-align: left;
}

.article-card:hover img {
    transform: scale(1.05);
}

.article-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.article-card p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card .btn {
    display: none;
}

.badge {
    background: var(--accent);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 0.8rem;
}

.featured-series {
    border: 1px solid rgba(124, 58, 237, 0.3);
}

.featured-series:hover {
    border-color: var(--accent);
}

/* Testimonial Page Styles */
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Changed from 3 to 2 cards */
    gap: 2.5rem;
}

@media (max-width: 992px) {
    .testimonial-grid {
        grid-template-columns: 1fr;
    }
}

/* Global Section Backgrounds */
.article-hero,
.hero-small,
.page-header {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 0;
    background: var(--hero-overlay), url('https://transformingpeople.com/wp-content/uploads/2021/02/TPA-Background.jpg') !important;
    background-size: cover !important;
    background-position: center !important;
    color: var(--text-light) !important;
    flex-direction: column;
}

.article-hero h1,
.hero-small h1,
.page-header h1 {
    color: var(--text-light) !important;
}

.testimonial-card {
    background: var(--glass);
    padding: 2.5rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.testimonial-card img {
    width: 100%;
    height: 180px;
    border-radius: 12px;
    object-fit: cover;
    object-position: center;
    border: 2px solid var(--glass-border);
    margin-bottom: 0.5rem;
}

.testimonial-card blockquote {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-light);
}

.testimonial-author {
    font-weight: 700;
    color: var(--accent);
}

/* Newsletter Section */
.newsletter-section {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 4rem;
    text-align: center;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    max-width: 500px;
    margin: 2rem auto 0;
}

.newsletter-form input {
    flex-grow: 1;
}

@media (max-width: 600px) {
    .newsletter-form {
        flex-direction: column;
    }
}

/* Footer */
footer {
    padding: 4rem 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    text-align: center;
}

/* Responsive */
@media (max-width: 992px) {
    .grid {
        grid-template-columns: 1fr !important;
        gap: 3rem;
    }

    #story .grid {
        grid-template-columns: 1fr !important;
    }

    .practitioner-content .grid {
        grid-template-columns: 1fr !important;
    }

    .hero-content h1 {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 15px;
    }

    .container {
        padding: 0 1.5rem;
    }

    header {
        padding: 1rem 0;
    }

    nav {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        display: none;
    }

    .hero {
        padding: 6rem 0;
        height: auto;
        min-height: 80vh;
    }

    .hero-content h1,
    .page-header h1,
    .hero-small h1,
    .hero-text h1,
    .article-hero h1 {
        font-size: 2.5rem;
    }

    .hero-btns {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .hero-btns .btn {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }

    section {
        padding: 5rem 0;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
    }

    .glass-card {
        padding: 1.5rem;
    }

    /* Fix for "The Mission Today" sidebar stacking */
    #story .grid>div:first-child,
    #story .grid>div:nth-child(2) {
        order: 1;
    }

    #story .grid>.glass-card:last-child {
        order: 2;
        position: static;
    }

    /* Form improvements */
    form .grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {

    .hero-content h1,
    .page-header h1,
    .hero-small h1,
    .hero-text h1,
    .article-hero h1 {
        font-size: 2rem;
    }

    .logo {
        font-size: 1rem;
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    align-items: center;
    justify-content: center;
    cursor: default;
}

.modal.active {
    display: flex !important;
}

.modal-content {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 1);
    object-fit: contain;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 3rem;
    font-weight: 200;
    cursor: pointer;
    line-height: 1;
}

/* Brevo Form Overrides */
.sib-form:not(.glass-card) {
    background: transparent !important;
    padding: 0 !important;
}

.sib-form {
    text-align: left !important;
}

.sib-form-container {
    padding: 0 !important;
    background: transparent !important;
    width: 100% !important;
    max-width: 400px !important;
    /* Limit width */
}

#sib-container {
    background: transparent !important;
    border: none !important;
    max-width: 100% !important;
    padding: 0 !important;
    text-align: left !important;
}

#sib-container .sib-form-block p {
    display: none;
}

#sib-container .entry__label {
    display: block !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    color: var(--text-muted) !important;
    margin-bottom: 0.5rem !important;
}

#sib-container .entry__field {
    margin-bottom: 1.5rem !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

#sib-container .input,
#sib-container select,
#sib-container textarea {
    width: 100% !important;
    padding: 1rem !important;
    border-radius: 10px !important;
    background: var(--glass) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-light) !important;
    font-family: inherit !important;
    font-size: 1rem !important;
    transition: var(--transition) !important;
    height: auto !important;
    line-height: normal !important;
    box-shadow: none !important;
    outline: none !important;
}

#sib-container .input:focus,
#sib-container select:focus,
#sib-container textarea:focus {
    border-color: var(--accent) !important;
    background: rgba(255, 255, 255, 0.1) !important;
}

#sib-container .btn-primary {
    width: 100% !important;
    padding: 1rem 2rem !important;
    border-radius: 50px !important;
    background: var(--accent) !important;
    color: var(--white) !important;
    font-weight: 700 !important;
    border: none !important;
    cursor: pointer !important;
    transition: var(--transition) !important;
}

.sib-form-message-panel {
    border-radius: 12px !important;
    margin-bottom: 1rem !important;
}

/* Hide reCAPTCHA badge */
.grecaptcha-badge {
    visibility: hidden !important;
}

.recaptcha-disclaimer {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 1rem;
    line-height: 1.4;
    text-align: center;
}

.recaptcha-disclaimer a {
    color: var(--accent);
    text-decoration: none;
}

@media (max-width: 600px) {
    .footer-newsletter {
        max-width: 100%;
    }
}