/* Article reading page. The site uses body.dark-mode for the light theme. */

.reader-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 8px 16px;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    padding-top: max(8px, env(safe-area-inset-top));
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: var(--bg, #0e0e10);
    position: sticky;
    top: 0;
    z-index: 20;
}

.article-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
}

.reader-bar .icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text, #fff);
    text-decoration: none;
    cursor: pointer;
}

.reader-bar .wordmark {
    margin-right: auto;
    color: var(--text, #fff);
    font-weight: 700;
    letter-spacing: -0.04em;
    font-size: 1.02rem;
    text-decoration: none;
}

.reader-bar .wordmark span {
    color: var(--accent, #ff4d4d);
}

.reader-bar .listen-article-wrap {
    width: auto;
    margin: 0;
}

.reader-sheet {
    width: min(680px, 100%);
    margin: 0 auto;
    padding: 22px 20px calc(36px + env(safe-area-inset-bottom));
}

.article-kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
}

.source-badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background: #c41230;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.kicker-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.kicker-text .source-name {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    text-shadow: none;
    margin: 0;
    color: var(--text, #fff);
}

.kicker-text .category {
    color: var(--accent, #ff4d4d);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.article-reader h1 {
    font-family: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
    font-weight: 700;
    font-size: clamp(1.7rem, 1.05rem + 2.5vw, 2.65rem);
    line-height: 1.14;
    letter-spacing: -0.02em;
    margin: 0 0 16px;
    color: var(--text, #fff);
    text-align: left;
}

.article-byline {
    margin: 0;
    font-weight: 600;
    font-size: 0.98rem;
}

.article-meta-line {
    margin: 3px 0 0;
    color: var(--text-muted, #a1a1aa);
    font-size: 0.86rem;
}

.article-meta-line time {
    color: inherit;
}

.reader-sheet .story-reactions {
    margin: 16px 0 22px;
    max-width: 100%;
    min-width: 0;
}

.hero {
    margin: 0 -20px 8px;
}

.hero img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #1a1a1d;
}

.hero figcaption,
.inline-photo figcaption {
    margin: 8px 0 18px;
    padding: 0 20px;
    color: var(--text-muted, #a1a1aa);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.8rem;
    line-height: 1.45;
}

.article-body {
    font-family: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
    font-size: 1.125rem;
    line-height: 1.7;
    max-width: 68ch;
    color: var(--text, #f4f4f5);
}

.article-body > p:first-of-type {
    font-size: 1.22rem;
    line-height: 1.55;
}

.article-body p {
    margin: 0 0 1.75em;
    font-size: 1.125rem;
    line-height: 1.7;
}

.article-body > p:first-of-type {
    font-size: 1.22rem;
}

.article-body h2,
.article-body h3,
.article-body h4 {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin: 2.1em 0 0.75em;
}

.article-body h3 {
    font-size: 1.28rem;
}

.article-body a {
    font-weight: 600;
    text-underline-offset: 2px;
}

.article-body ul,
.article-body ol {
    margin: 0.2em 0 1.75em;
    padding-left: 1.25em;
}

.article-body li {
    margin: 0.45em 0;
}

.article-body li::marker {
    color: var(--accent, #ff4d4d);
}

.article-body .pullquote {
    margin: 0 0 1.75em;
    padding: 2px 0 2px 16px;
    border-left: 3px solid var(--accent, #ff4d4d);
}

.article-body .pullquote p {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.55;
    font-style: italic;
}

.article-body .pullquote footer {
    margin-top: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-style: normal;
    font-size: 0.8rem;
    color: var(--text-muted, #a1a1aa);
}

.inline-photo {
    margin: 0 0 1.75em;
}

.inline-photo img,
.article-body img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 14px;
    margin: 0;
}

.inline-photo figcaption {
    padding: 0;
}

.article-body .credit {
    color: var(--text-muted, #a1a1aa);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.88rem;
}

.original {
    margin-top: 0.4rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.original p {
    margin: 0 0 12px;
    color: var(--text-muted, #a1a1aa);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.92rem;
}

.original strong {
    color: var(--text, #fff);
    font-weight: 700;
}

.reader-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.reader-actions .cta,
.reader-actions .ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    text-decoration: none;
    cursor: pointer;
}

.reader-actions .cta {
    background: #d61f26;
    color: #fff;
    border: 0;
}

.reader-actions .ghost {
    background: transparent;
    color: var(--text, #fff);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.yt-player {
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin: 0 0 24px;
}

.yt-player iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 640px) {
    .reader-actions {
        flex-direction: column;
    }

    .reader-actions .cta,
    .reader-actions .ghost {
        width: 100%;
    }
}

@media (min-width: 760px) {
    .reader-sheet {
        padding-top: 36px;
    }

    .hero {
        margin: 4px 0 8px;
        border-radius: 18px;
        overflow: hidden;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    }

    .hero figcaption {
        padding: 10px 2px 0;
    }
}

/* Light theme is body.dark-mode. Beat the global black/blue !important rules. */
body.dark-mode .reader-bar {
    background: #fff !important;
    border-bottom-color: #e4e4e4;
}

body.dark-mode .reader-bar .icon-btn,
body.dark-mode a.icon-btn {
    background: #fff !important;
    color: #111 !important;
    border-color: rgba(0, 0, 0, 0.12);
}

body.dark-mode .reader-bar .wordmark,
body.dark-mode a.wordmark {
    color: #111 !important;
}

body.dark-mode .reader-bar .wordmark span {
    color: #c4122f !important;
}

body.dark-mode .source-badge {
    color: #fff !important;
}

body.dark-mode .kicker-text .category {
    color: #c4122f !important;
}

body.dark-mode .article-meta-line,
body.dark-mode .article-meta-line time,
body.dark-mode .hero figcaption,
body.dark-mode .inline-photo figcaption,
body.dark-mode .article-body .pullquote footer,
body.dark-mode .article-body .credit,
body.dark-mode .original p,
body.dark-mode .reactions-label {
    color: #555 !important;
}

body.dark-mode .original strong,
body.dark-mode .article-reader h1,
body.dark-mode .article-byline,
body.dark-mode .kicker-text .source-name {
    color: #111 !important;
}

body.dark-mode a.cta,
body.dark-mode #donate-bar a {
    color: #fff !important;
    background: #c4122f !important;
    text-decoration: none;
}

#donate-bar a {
    color: #fff !important;
}

body.dark-mode .reader-actions .ghost {
    color: #111 !important;
    border-color: rgba(0, 0, 0, 0.15);
}

body.dark-mode .hero img {
    background: #e7e4de;
}

body.dark-mode .original {
    border-top-color: rgba(0, 0, 0, 0.1);
}
