/* Reader Page Specific Styles */

.reader-header {
    padding-top: 40px;
    margin-bottom: 2rem;
}

.reader-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
    line-height: 1.1;
    color: var(--color-text-main);
}

.reader-subheading {
    font-size: 1.1rem;
    color: #666;
    max-width: 800px;
    line-height: 1.5;
}

/* Light / Dark Mode Toggle */
.theme-toggle-container {
    padding-top: 100px;
    /* offset fixed nav */
    margin-bottom: 1rem;
}

.theme-toggle-btn {
    background: none;
    border: 1px solid var(--color-celestial-silver);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-main);
    transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
    background: var(--color-bg-light);
}

/* Summary Section */
.reader-summary-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
    align-items: center;
}

/* When there is no summary, the image takes full width but remains constrained */
.reader-summary-block.no-summary {
    grid-template-columns: 1fr;
    justify-items: center;
}

.reader-summary-block.no-summary .summary-image {
    max-width: 800px;
    width: 100%;
}

.summary-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #444;
}

.summary-text h3 {
    font-family: var(--font-body);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    color: var(--color-text-main);
    font-weight: 700;
}

.summary-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* Main Content Wrapper (leaves room for ads on sides) */
.reader-content-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 4rem;
    position: relative;
}

.reader-main-article {
    max-width: 65ch;
    /* Optimal reading width */
    width: 100%;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.15rem;
    line-height: 1.8;
    color: #222;
}

.reader-main-article h2,
.reader-main-article h3 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--color-text-main);
}

.reader-main-article h2 {
    font-size: 1.8rem;
}

.reader-main-article p {
    margin-bottom: 1.5rem;
}

.reader-main-article img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 2rem 0;
}

/* Blockquote Styling */
.reader-main-article blockquote {
    border-left: 4px solid #292929;
    /* Medium-style dark border */
    padding-left: 1.5rem;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 1.5rem;
    font-style: italic;
    font-size: 1.25rem;
    color: #555;
}

/* Lists */
.reader-main-article ul,
.reader-main-article ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.reader-main-article ul {
    list-style-type: disc;
}

.reader-main-article ol {
    list-style-type: decimal;
}

.reader-main-article li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}


/* AdSense Sidebars placeholders */
.ad-sidebar {
    width: 150px;
    display: none;
    /* hidden on small screens */
    flex-shrink: 0;
}


/* Buttons */
.btn--outline {
    background-color: transparent;
    border: 2px solid var(--color-midnight-blue);
    color: var(--color-midnight-blue);
    transition: all 0.2s ease;
}

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

/* Related Articles */
.related-articles {
    padding: 4rem 0;
    border-top: 1px solid var(--color-celestial-silver);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.related-card img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.related-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    color: var(--color-text-main);
    text-decoration: none;
    display: block;
}

.related-card-author {
    font-size: 0.85rem;
    color: #888;
}

/* Dark Mode Variables */
body.dark-mode {
    --color-primary: #121212;
    --color-text-main: #b3b3b3;
    /* Softer grey */
    --color-text-light: #888;
    --color-bg-light: #1e1e1e;
    --color-celestial-silver: #333;
    background-color: var(--color-primary);
    color: var(--color-text-main);
}

body.dark-mode .reader-subheading,
body.dark-mode .summary-text,
body.dark-mode .reader-main-article {
    color: #a3a3a3;
    /* Even softer grey for long-form reading */
}

body.dark-mode .theme-toggle-btn {
    border-color: #555;
}


body.dark-mode .reader-main-article blockquote {
    border-left-color: #777;
    color: #ccc;
}


body.dark-mode .btn--outline {
    border-color: #ccc;
    color: #ccc;
}

body.dark-mode .btn--outline:hover {
    background-color: #ccc;
    color: #121212;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .reader-summary-block {
        gap: 2rem;
    }
}

@media (min-width: 1300px) {
    .ad-sidebar {
        display: block;
    }

    .reader-content-wrapper {
        justify-content: space-between;
        gap: 6rem;
    }
}

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

    .related-grid {
        grid-template-columns: 1fr;
    }

    .reader-header {
        padding-top: 0px;
    }

    .theme-toggle-container {
        padding-top: 80px;
    }
}