:root {
    --primary-color: #38a169; /* A calming, trustworthy green */
    --secondary-color: #f0fff4; /* Very light green for backgrounds */
    --dark-text-color: #2d3748; /* Dark grey for readability */
    --light-text-color: #718096; /* Lighter grey for subtext */
    --white-color: #ffffff;
    --border-color: #e2e8f0;
    --font-family: 'Lato', sans-serif;
    --shadow-color: rgba(0, 0, 0, 0.05);
    --error-color: #e53e3e; /* Red for errors */
}

html.dark-mode {
    --primary-color: #48bb78; /* Brighter green for dark mode */
    --secondary-color: #1a202c; /* Very dark blue/grey */
    --dark-text-color: #edf2f7; /* Light grey for text */
    --light-text-color: #a0aec0; /* Lighter grey for subtext */
    --white-color: #2d3748; /* Dark grey for card backgrounds etc. */
    --border-color: #4a5568;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --error-color: #fc8181; /* Lighter red for dark mode */
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--dark-text-color);
    background-color: var(--secondary-color);
    font-size: 18px;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background-color: var(--white-color);
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
    position: sticky;
    top: 0;
    z-index: 10;
}

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

.logo {
    height: 50px;
}

/* Theme Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}
.theme-label {
    font-size: 0.9rem;
    color: var(--light-text-color);
    transition: color 0.3s ease;
}
.theme-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}
.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 28px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--primary-color);
}
input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}
input:checked + .slider:before {
    transform: translateX(22px);
}

/* Hero Section */
.hero-section {
    background: url('hero-image.webp') no-repeat center center/cover;
    color: var(--white-color);
    height: 60vh;
    display: flex;
    align-items: center;
    text-align: center;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Dark overlay for text readability */
}

.hero-content {
    position: relative;
    z-index: 1;
}

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

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    color: #e2e8f0;
}

.cta-button {
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 15px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: background-color 0.3s ease;
}

.cta-button:hover {
    background-color: #2f855a;
}
html.dark-mode .cta-button:hover {
    background-color: #38a169;
}

/* Digests Section */
.digests-section {
    padding: 80px 0;
    background-color: var(--secondary-color);
    transition: background-color 0.3s ease;
}

.digests-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
}

.section-subtitle {
    text-align: center;
    color: var(--light-text-color);
    max-width: 700px;
    margin: -40px auto 50px auto;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.digests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.digest-card {
    background-color: var(--white-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 6px var(--shadow-color);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.digest-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.digest-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.digest-card p {
    color: var(--light-text-color);
    font-size: 1rem;
    transition: color 0.3s ease;
}

/* Experts Section */
.experts-section {
    padding: 80px 0;
    background-color: var(--white-color);
    transition: background-color 0.3s ease;
}

.experts-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
}

.experts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    align-items: start;
}

.expert-card {
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.expert-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 20px;
    border: 4px solid var(--white-color);
    box-shadow: 0 4px 10px var(--shadow-color);
}

.expert-card h3 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.expert-card h4 {
    font-size: 1rem;
    font-weight: 400;
    color: var(--light-text-color);
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.expert-card p {
    color: var(--light-text-color);
    font-size: 0.95rem;
    transition: color 0.3s ease;
    line-height: 1.5;
}

/* About Us Section */
.about-us-section {
    padding: 80px 0;
    background-color: var(--white-color);
    transition: background-color 0.3s ease;
}
.about-us-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}
.about-us-section p {
    text-align: center;
    color: var(--light-text-color);
    max-width: 700px;
    margin: 0 auto;
    transition: color 0.3s ease;
}

/* Form Section */
.form-section {
    padding: 80px 0;
    background-color: var(--secondary-color);
    transition: background-color 0.3s ease;
}

.form-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.form-section p {
    text-align: center;
    color: var(--light-text-color);
    margin-bottom: 40px;
    transition: color 0.3s ease;
}

.subscription-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--white-color);
    color: var(--dark-text-color);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.3);
}

.form-group input.error {
    border-color: var(--error-color);
}

.form-group input.error:focus {
    box-shadow: 0 0 0 3px var(--error-color-transparent, rgba(229, 62, 62, 0.3));
}

.error-message {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 5px;
    min-height: 1.2em; /* Prevents layout shift */
}

.privacy-notice {
    max-width: 600px;
    margin: 20px auto 0;
    text-align: center;
    font-size: 0.875rem;
    color: var(--light-text-color);
}

.submit-button {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--white-color);
    background-color: var(--primary-color);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-button:hover {
    background-color: #2f855a;
}
html.dark-mode .submit-button:hover {
    background-color: #38a169;
}

.thank-you-message {
    text-align: center;
    padding: 40px;
    background-color: var(--white-color);
    border-radius: 8px;
    border: 1px solid var(--primary-color);
    max-width: 600px;
    margin: 20px auto 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.thank-you-message h3 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Footer */
.main-footer {
    background-color: #1a202c;
    color: #a0aec0;
    text-align: center;
    padding: 20px 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.footer-nav a {
    color: #a0aec0;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-nav a:hover {
    color: var(--white-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

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

    .hero-content p {
        font-size: 1.1rem;
    }

    .hero-section {
        height: auto;
        padding: 60px 0;
    }

    .digests-section, .form-section, .about-us-section {
        padding: 60px 20px;
    }

    .digests-section h2, .form-section h2, .about-us-section h2, .experts-section h2 {
        font-size: 2rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 15px;
    }
}