/* perso.news - Personalized News */
/* Colors: #3A3A3A, #F7F3EC, #1C1C1C, #FFFDF8, #E8D5B5, #F0EBE0, #8B7355 */
/* Fonts: Libre Baskerville (400,700,italic), Source Serif 4 (400,600,italic), Inconsolata (400,500) */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.75;
    color: #3A3A3A;
    background-color: #FFFDF8;
    overflow-x: hidden;
}

/* Ruled paper background */
#ruled-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 27px,
        #F0EBE0 27px,
        #F0EBE0 28px
    );
    opacity: 0.5;
}

/* Header */
#site-header {
    position: relative;
    z-index: 10;
    padding: 24px 0 0;
    background: #FFFDF8;
}

.header-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.site-logo {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 28px;
    color: #1C1C1C;
    letter-spacing: -0.02em;
}

.logo-dot {
    color: #8B7355;
}

.dateline {
    font-family: 'Inconsolata', monospace;
    font-weight: 400;
    font-size: 13px;
    color: #8B7355;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.dateline.visible {
    opacity: 1;
}

.edition-label {
    font-family: 'Inconsolata', monospace;
    font-weight: 500;
    font-size: 12px;
    color: #8B7355;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid #E8D5B5;
    padding: 4px 12px;
    border-radius: 2px;
}

.header-rule {
    max-width: 1080px;
    margin: 16px auto 0;
    padding: 0 24px;
    border-bottom: 2px solid #1C1C1C;
}

/* Section Rules */
.section-rule {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
    border-bottom: 1px solid #E8D5B5;
}

.footer-rule {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
    border-bottom: 1px solid #E8D5B5;
}

/* Hero */
#hero {
    position: relative;
    z-index: 5;
    min-height: 60vh;
    display: flex;
    align-items: center;
    padding: 64px 0 48px;
}

.hero-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

.hero-topic {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.topic-tag {
    font-family: 'Inconsolata', monospace;
    font-weight: 500;
    font-size: 12px;
    color: #8B7355;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: #F0EBE0;
    padding: 4px 12px;
    border-radius: 2px;
}

.affinity-bar-container {
    display: inline-block;
    width: 80px;
    height: 4px;
    background: #F0EBE0;
    border-radius: 2px;
    overflow: hidden;
}

.affinity-bar-container.small {
    width: 60px;
}

.affinity-bar {
    display: block;
    height: 100%;
    background: #8B7355;
    border-radius: 2px;
    transition: width 0.6s ease-out;
}

.affinity-score {
    font-family: 'Inconsolata', monospace;
    font-size: 12px;
    color: #8B7355;
}

.hero-headline {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 80px;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: #1C1C1C;
    margin-bottom: 24px;
    min-height: 1.05em;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hero-meta.visible {
    opacity: 1;
}

.meta-time {
    font-family: 'Inconsolata', monospace;
    font-size: 13px;
    color: #8B7355;
}

.meta-separator {
    color: #E8D5B5;
}

.meta-source {
    font-family: 'Inconsolata', monospace;
    font-size: 13px;
    color: #8B7355;
}

/* Content Area */
#content {
    position: relative;
    z-index: 5;
    padding: 48px 0 96px;
}

.content-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 5%;
}

.main-column {
    flex: 0 0 65%;
    max-width: 65%;
}

.sidebar {
    flex: 0 0 30%;
    max-width: 30%;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.sidebar.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Article Cards */
.article-card {
    padding: 28px 0;
    border-bottom: 1px solid #F0EBE0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.article-card.visible {
    opacity: 1;
}

.article-featured {
    padding-bottom: 36px;
    border-bottom: 1px solid #E8D5B5;
}

.article-category {
    font-family: 'Inconsolata', monospace;
    font-weight: 500;
    font-size: 11px;
    color: #8B7355;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: block;
    margin-bottom: 8px;
}

.article-title {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 22px;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: #1C1C1C;
    margin-bottom: 10px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.article-title:hover {
    color: #8B7355;
}

.article-title-lg {
    font-size: 28px;
}

.article-excerpt {
    font-family: 'Source Serif 4', serif;
    font-size: 15px;
    line-height: 1.65;
    color: #3A3A3A;
    margin-bottom: 12px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.affinity-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.article-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

/* Pull Quote */
.pull-quote {
    position: relative;
    padding: 48px 0;
    margin: 16px 0;
    border-top: 1px solid #E8D5B5;
    border-bottom: 1px solid #E8D5B5;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.pull-quote.visible {
    opacity: 1;
}

.quote-mark {
    font-family: 'Libre Baskerville', serif;
    font-size: 72px;
    color: #E8D5B5;
    position: absolute;
    top: 12px;
    left: -8px;
    line-height: 1;
}

.pull-quote p {
    font-family: 'Libre Baskerville', serif;
    font-style: italic;
    font-size: 28px;
    line-height: 1.45;
    color: #1C1C1C;
    padding-left: 40px;
    margin-bottom: 12px;
}

.pull-quote cite {
    font-family: 'Inconsolata', monospace;
    font-style: normal;
    font-size: 13px;
    color: #8B7355;
    padding-left: 40px;
}

/* Sidebar */
.sidebar-section {
    margin-bottom: 40px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-section.visible {
    opacity: 1;
}

.sidebar-heading {
    font-family: 'Inconsolata', monospace;
    font-weight: 500;
    font-size: 12px;
    color: #8B7355;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #E8D5B5;
}

/* Topic List */
.topic-list {
    list-style: none;
}

.topic-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #F0EBE0;
}

.topic-name {
    font-family: 'Source Serif 4', serif;
    font-weight: 600;
    font-size: 14px;
    color: #1C1C1C;
}

/* Reading Stats */
.reading-stats {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 0;
    border-bottom: 1px solid #F0EBE0;
}

.stat-key {
    font-family: 'Source Serif 4', serif;
    font-size: 14px;
    color: #3A3A3A;
}

.stat-val {
    font-family: 'Inconsolata', monospace;
    font-size: 13px;
    color: #8B7355;
}

/* Quick Reads */
.quick-reads {
    list-style: none;
}

.quick-reads li {
    padding: 10px 0;
    border-bottom: 1px solid #F0EBE0;
}

.quick-link {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.4;
    color: #1C1C1C;
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
    margin-bottom: 4px;
}

.quick-link:hover {
    color: #8B7355;
}

.quick-meta {
    font-family: 'Inconsolata', monospace;
    font-size: 11px;
    color: #8B7355;
}

/* Footer */
#site-footer {
    position: relative;
    z-index: 5;
    padding: 0 0 48px;
}

.footer-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 24px 24px 0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.footer-logo {
    font-family: 'Libre Baskerville', serif;
    font-weight: 700;
    font-size: 18px;
    color: #1C1C1C;
}

.footer-tagline {
    font-family: 'Source Serif 4', serif;
    font-style: italic;
    font-size: 14px;
    color: #8B7355;
}

.footer-copy {
    font-family: 'Inconsolata', monospace;
    font-size: 12px;
    color: #8B7355;
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-headline {
        font-size: 56px;
    }
}

@media (max-width: 768px) {
    .hero-headline {
        font-size: 40px;
    }

    .content-container {
        flex-direction: column;
    }

    .main-column,
    .sidebar {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .article-row {
        grid-template-columns: 1fr;
    }

    .header-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .header-center {
        order: -1;
    }

    .footer-container {
        flex-direction: column;
        gap: 8px;
    }

    .pull-quote p {
        font-size: 22px;
    }
}
