/* BASE STYLES & VARIABLES */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&display=swap');

:root {
    --navy-blue: #0a192f;
    --navy-blue-light: #112240;
    --lighthouse-gold: #f59e0b;
    --lighthouse-sun: #fbbf24;
    --seafoam: #ADC9C5;

    --bg-main: #f0f7f4;
    /* Soft, ADHD-friendly muted sage green */
    --bg-card: #ffffff;
    --text-main: #334155;
    --text-muted: #64748b;
    --border-light: #e2e8f0;

    /* Lighthouse Brand Colors - Green Series */
    --forest-green: #1b4332;
    --forest-green-dark: #132a1f;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6,
.font-serif,
.article-title {
    font-family: 'Playfair Display', serif;
    color: var(--navy-blue);
}

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

/* GLOBAL NAV */
.global-nav {
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
}

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

.nav-left,
.nav-right {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-link:hover,
.nav-link.active {
    color: var(--lighthouse-gold);
}

.nav-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.logo-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid var(--forest-green);
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-text {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--forest-green);
}

/* PAGE HEADER */
.page-header {
    background: linear-gradient(to bottom, #ffffff, var(--bg-main));
    padding: 2rem 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.page-header p {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* MAIN LAYOUT */
.diaries-wrapper {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
}

.articles-feed {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* FEATURED ARTICLE (HEADLINE SPACE) */
.featured-article {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-article:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.featured-image-wrapper {
    width: 100%;
    aspect-ratio: 21 / 9;
    overflow: hidden;
    position: relative;
}

.featured-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.featured-article:hover .featured-image-wrapper img {
    transform: scale(1.05);
}

.featured-content {
    padding: 2.5rem;
}

.featured-meta {
    font-size: 0.85rem;
    color: var(--lighthouse-gold);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.featured-tag {
    background: #fef3c7;
    color: #b45309;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
}

.featured-title {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.featured-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.read-more {
    font-weight: 600;
    color: var(--forest-green);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.featured-article:hover .read-more {
    color: var(--lighthouse-gold);
    gap: 1rem;
}


/* GRID OF OLDER ARTICLES */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.article-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.card-image-wrapper {
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-meta {
    font-size: 0.75rem;
    color: var(--lighthouse-gold);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.card-title {
    font-size: 1.3rem;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* MODAL SYSTEM */
.modal-overlay {
    visibility: hidden;
    opacity: 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(31, 54, 44, 0.85);
    /* brand dark overlay */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.show {
    visibility: visible;
    opacity: 1;
}

.modal-content {
    background: var(--bg-card);
    width: 90%;
    max-width: 800px;
    height: 90vh;
    /* Don't take full screen height */
    max-height: 95vh;
    border-radius: 16px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    overflow-x: hidden;

    transform: translateY(20px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.show .modal-content {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: sticky;
    top: 20px;
    float: right;
    right: 20px;
    width: 40px;
    height: 40px;
    background: var(--bg-main);
    color: var(--text-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1010;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    line-height: 1;
}

.modal-close:hover {
    background: var(--forest-green);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 0 1rem;
}

/* STYLING APPLIED TO THE RAW BOT HTML INSIDE THE MODAL */
#modal-body > .bot-article-content {
    display: none;
    /* Everything hidden by default until active */
    padding: 2rem 3rem 4rem;
}

.article-inner-body {
    display: block !important;
}

.bot-article-content .article-container {
    /* override the bot's shadow/padding as it's already in a modal */
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
}

.bot-article-content .lh-header,
.bot-article-content .article-footer {
    display: none !important;
}

.bot-article-content .article-title {
    font-size: 3rem !important;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.bot-article-content .subtitle {
    font-size: 1.2rem !important;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.bot-article-content .meta {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 2rem;
    letter-spacing: normal;
    text-transform: none;
}

.bot-article-content .article-image {
    width: 100%;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.bot-article-content .image-caption {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
    margin-top: -1rem;
    margin-bottom: 2rem;
}

.bot-article-content .dropcap {
    float: left;
    font-family: 'Playfair Display', serif;
    font-size: 4.5rem;
    line-height: 4rem;
    padding-top: 0.25rem;
    padding-right: 0.75rem;
    color: var(--forest-green);
}

.bot-article-content p {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
}

.bot-article-content h2 {
    font-size: 2rem;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
}

.bot-article-content .callout-insight {
    border-left: 4px solid var(--forest-green);
    background-color: #f0fdf4; /* light green from screenshot */
    padding: 2.5rem;
    margin: 3rem 0;
    border-radius: 4px 16px 16px 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.bot-article-content .callout-insight h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: var(--forest-green-dark);
    font-weight: 700;
}

.bot-article-content .callout-insight h3::before {
    content: '💡'; /* Lightbulb icon from screenshot */
    font-size: 1.2rem;
}

.bot-article-content .strategy-box {
    background: #fff7ed;
    border-radius: 12px;
    padding: 2rem;
    margin: 2.5rem 0;
}

.bot-article-content .strategy-box h3 {
    color: #c2410c;
    margin-bottom: 1.5rem;
}

/* NEW COMPONENT: Quote Box */
.bot-article-content .quote-box,
.article-inner-body .quote-box {
    background: #f8fafc;
    border-left: 6px solid var(--lighthouse-sun);
    padding: 2.5rem 3.5rem;
    margin: 3rem 0;
    border-radius: 0 12px 12px 0;
    text-align: left;
}

.bot-article-content .quote-box h2,
.article-inner-body .quote-box h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem;
    color: var(--forest-green);
    font-style: italic;
    margin-bottom: 0.75rem;
    border-bottom: none;
    background: none;
    padding: 0;
    line-height: 1.4;
}

.bot-article-content .quote-box p,
.article-inner-body .quote-box p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 0;
    opacity: 0.9;
}

.bot-article-content .cta-box {
    background: #1b4332;
    color: white;
    padding: 4rem 3rem;
    border-radius: 20px;
    text-align: center;
    margin: 2rem 0;
}

.bot-article-content .cta-box h3 {
    color: var(--lighthouse-sun); /* match the bright gold in screenshot */
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.bot-article-content .cta-box p {
    font-size: 1.2rem;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto 1.5rem;
    color: #f1f5f9;
}

.bot-article-content .cta-box p em {
    color: var(--lighthouse-sun);
    font-weight: 600;
    font-style: italic;
    display: block;
    margin-top: 2rem;
}

/* TYPOGRAPHICAL CONTRAST: Section Headers */
.bot-article-content h2, 
.bot-article-content .section-header {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.8rem;
    margin: 3.5rem 0 1.5rem;
    color: var(--forest-green-dark);
    border-bottom: none;
}

.bot-article-content .divider-sun {
    text-align: center;
    margin: 2.5rem 0;
    position: relative;
}

.bot-article-content .divider-sun::after {
    content: '☀️';
    font-size: 1.25rem;
    background: white;
    padding: 0 1rem;
    position: relative;
    z-index: 10;
}

.bot-article-content .divider-sun::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
    z-index: 1;
}

/* EMAIL SIGNUP CARD (Matching user example) */
.bot-article-content .subscribe-card {
    background: #f8fafc;
    padding: 3rem 2rem;
    border-radius: 12px;
    margin-top: 3rem;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.bot-article-content .subscribe-card h4 {
    color: var(--forest-green);
    margin-bottom: 0.75rem;
    font-weight: 700;
    font-size: 1.5rem;
}

.bot-article-content .subscribe-card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1rem;
}

.bot-article-content .btn-subscribe {
    display: inline-block;
    background: var(--lighthouse-gold);
    color: white;
    padding: 1rem 3rem;
    border-radius: 40px;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
    transition: transform 0.2s;
}

.bot-article-content .btn-subscribe:hover {
    transform: translateY(-2px);
}

/* SIDEBAR WIDGETS */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-widget {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.sidebar-widget h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.sidebar-widget p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.btn-primary {
    display: block;
    text-align: center;
    background: var(--forest-green);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: var(--forest-green-dark);
}

.series-list {
    list-style: none;
}

.series-list li {
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.series-list li a {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    color: var(--text-main);
    font-weight: 500;
}

.series-list li a:hover {
    color: var(--lighthouse-gold);
    padding-left: 0.5rem;
}

.arrow {
    color: var(--lighthouse-gold);
    transition: transform 0.2s;
}

.series-list li a:hover .arrow {
    transform: translateX(5px);
}

/* MODERN BOTTOM CTA (Glassmorphism Light Aesthetic) */
.bottom-cta-wrapper {
    padding: 2rem 2rem 5rem;
}

.bottom-cta-card {
    background: linear-gradient(135deg, rgba(173, 201, 197, 0.15), rgba(251, 191, 36, 0.1));
    border-radius: 24px;
    padding: 4.5rem 2rem;
    text-align: center;
    max-width: 1000px;
    margin: 0 auto;
    border: 1px solid rgba(251, 191, 36, 0.2);
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.03);
}

.cta-blur-1 {
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    background: rgba(251, 191, 36, 0.2);
    filter: blur(50px);
    border-radius: 50%;
}

.cta-blur-2 {
    position: absolute;
    bottom: -80px;
    right: -50px;
    width: 250px;
    height: 250px;
    background: rgba(173, 201, 197, 0.3);
    filter: blur(60px);
    border-radius: 50%;
}

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

.bottom-cta-content h2 {
    font-family: 'Playfair Display', serif;
    color: var(--forest-green);
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.bottom-cta-content p {
    color: var(--text-main);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
}

.btn-cta-gold {
    display: inline-block;
    background: var(--lighthouse-gold);
    color: white;
    padding: 0.9rem 2.5rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    transition: transform 0.2s, background 0.3s;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-cta-gold:hover {
    transform: translateY(-2px);
    background: #d97706;
}

/* FOOTER */
.global-footer {
    background: #4a5d58; /* Deep Sage */
    color: white;
    padding: 4rem 2rem 2rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 2rem;
}

.footer-brand h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.footer-brand p {
    color: var(--seafoam);
    font-size: 0.9rem;
}

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

.footer-links a {
    color: var(--seafoam);
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    color: var(--seafoam);
    font-size: 0.8rem;
}

/* MEDIA QUERIES */
@media (max-width: 1024px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
}

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

    .page-header h1 {
        font-size: 2.5rem;
    }

    .footer-container {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }

    .bot-article-content {
        padding: 1.5rem 1rem 3rem;
    }

    .modal-content {
        width: 95%;
    }
}