/* ─── CSS VARIABLES (original palette) ─── */
:root, [data-theme="light"] {
    --bg:              #f4f4f4;
    --bg-nav:          rgba(255,255,255,0.2);
    --bg-nav-scrolled: rgba(15,30,30,0.85);
    --surface:         #ffffff;
    --border:          rgba(255,255,255,0.4);
    --border-solid:    #e0dcd4;
    --text-primary:    #1d2b2b;
    --text-secondary:  #444;
    --text-muted:      #666;
    --article-text:    #000000;
    --accent:          #1d2b2b;
    --accent-inv:      #f4f4f4;
    --tag-bg:          #e8e4dc;
    --tag-text:        #1d2b2b;
    --toggle-bg:       #1d2b2b;
    --toggle-color:    #f4f4f4;
    --nav-height:      64px;
    --col-width:       760px;
    --transition:      0.4s ease;
}

[data-theme="dark"] {
    --bg:              #0f1e1e;
    --bg-nav:          rgba(15,30,30,0.4);
    --bg-nav-scrolled: rgba(5,10,10,0.92);
    --surface:         #1a2e2e;
    --border:          rgba(255,255,255,0.08);
    --border-solid:    rgba(255,255,255,0.12);
    --text-primary:    #e8e0d0;
    --text-secondary:  #b0a898;
    --text-muted:      #8a9a9a;
    --article-text:    #d4ccc0;
    --accent:          #e8e0d0;
    --accent-inv:      #0f1e1e;
    --tag-bg:          rgba(255,255,255,0.07);
    --tag-text:        #c0b8a8;
    --toggle-bg:       #e8e0d0;
    --toggle-color:    #0f1e1e;
    --nav-height:      64px;
    --col-width:       760px;
    --transition:      0.4s ease;
}

/* ─── RESET ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: 'Playfair Display', Georgia, serif;
    background: var(--bg);
    color: var(--text-primary);
    transition: background var(--transition), color var(--transition);
    line-height: 1.7;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

/* ─── NAV ─── */
nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: var(--bg-nav);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    transition: background var(--transition), border-color var(--transition);
}
nav.scrolled {
    background: var(--bg-nav-scrolled);
}
nav.scrolled .nav-logo {
    color: #ffffff;
}
.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.nav-logo {
    font-family: 'Playfair Display', serif;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--transition);
}
.nav-logo span { color: var(--accent); }
.nav-actions { display: flex; align-items: center; gap: 8px; }

/* Share button */
.btn-share {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    background: var(--toggle-bg);
    color: var(--toggle-color);
    border: none;
    border-radius: 50px;
    font-family: 'Playfair Display', serif;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.2s ease;
    white-space: nowrap;
    user-select: none;
}
.btn-share:hover { opacity: 0.8; transform: scale(1.03); }
.btn-share svg { flex-shrink: 0; }

/* Theme toggle */
.btn-theme {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background: var(--toggle-bg);
    color: var(--toggle-color);
    border: 1px solid transparent;
    border-radius: 50px;
    padding: 8px 18px;
    font-family: 'Playfair Display', serif;
    font-size: 13px;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    user-select: none;
    white-space: nowrap;
}
.btn-theme:hover { opacity: 0.8; transform: scale(1.03); }
.theme-icon {
    width: 15px; height: 15px;
    flex-shrink: 0;
    transition: transform 0.5s ease;
}
[data-theme="dark"] .theme-icon { transform: rotate(180deg); }
.theme-label { display: none; }
@media (min-width: 520px) { .theme-label { display: inline; } }

/* ─── SHARE DROPDOWN ─── */
.share-wrapper { position: relative; }
.share-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg);
    border: 1px solid var(--border-solid);
    border-radius: 10px;
    padding: 6px;
    min-width: 180px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.14);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 200;
}
.share-dropdown.open {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}
.share-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 6px;
    font-family: 'Playfair Display', serif;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: background 0.14s ease, color 0.14s ease;
}
.share-item:hover {
    background: var(--tag-bg);
    color: var(--text-primary);
}
.share-item svg { flex-shrink: 0; opacity: 0.7; }
.share-divider {
    height: 1px;
    background: var(--border-solid);
    margin: 4px 0;
}

/* ─── HERO ─── */
.hero {
    max-width: var(--col-width);
    margin: 0 auto;
    padding: calc(var(--nav-height) + 64px) 8% 0;
}
.article-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Playfair Display', serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 20px;
}
.article-category::before {
    content: '';
    display: block;
    width: 20px; height: 1.5px;
    background: var(--text-muted);
}
.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 48px);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 12px;
    max-width: 800px;
}
.hero-subtitle {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 28px;
    font-weight: 400;
}
.meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 18px 0;
    border-top: 1px solid var(--border-solid);
    border-bottom: 1px solid var(--border-solid);
    margin-bottom: 40px;
}
.meta-author {
    display: flex;
    align-items: center;
    gap: 9px;
}
.avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--toggle-bg);
    color: var(--toggle-color);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Playfair Display', serif;
    font-size: 0.9rem;
    font-weight: 700;
    flex-shrink: 0;
}
.author-name {
    font-family: 'Playfair Display', serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}
.meta-sep { color: var(--border-solid); font-size: 1rem; }
.meta-info {
    font-family: 'Playfair Display', serif;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.meta-tag {
    margin-left: auto;
    background: var(--tag-bg);
    color: var(--tag-text);
    font-family: 'Playfair Display', serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 4px 10px;
    border-radius: 4px;
}

/* ─── FEATURED IMAGE ─── */
.featured-img {
    width: 100%;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 52px;
    background: var(--tag-bg);
}
.featured-img img {
    width: 100%;
    display: block;
    transition: opacity 0.3s ease;
}

/* ─── ARTICLE BODY ─── */
.article-body {
    max-width: var(--col-width);
    margin: 0 auto;
    padding: 0 7%;
}
.article-body p {
    font-family: 'Times New Roman', Times, serif;
    font-size: 20px;
    line-height: 1.9;
    letter-spacing: 0.3px;
    color: var(--article-text);
    margin-bottom: 15px;
    transition: color var(--transition);
}
.article-body strong {
    font-weight: 700;
    color: var(--text-primary);
}

/* Pull quote */
.pull-quote {
    border-left: 3px solid var(--text-muted);
    padding: 16px 0 16px 28px;
    margin: 2.4em 0;
}
.pull-quote p {
    font-family: serif !important;
    font-size: 1.3rem !important;
    font-style: italic !important;
    line-height: 1.6 !important;
    color: var(--text-primary) !important;
    margin-bottom: 0 !important;
    letter-spacing: 0 !important;
}

/* Question block */
.questions-block {
    background: var(--tag-bg);
    border-radius: 5px;
    padding: 28px 32px;
    margin: 2em 0;
}
.questions-block p {
    font-family:  serif !important;
    font-style: italic !important;
    font-size: 1.08rem !important;
    margin-bottom: 0.7em !important;
    line-height: 1.6 !important;
    color: var(--text-primary) !important;
    letter-spacing: 0 !important;
}
.questions-block p:last-child { margin-bottom: 0 !important; }

/* ─── CLOSING LINE ─── */
.closing-line {
    border-top: 1px solid var(--border-solid);
    margin: 48px 0 16px;
    padding-top: 28px;
    font-family: 'Playfair Display', serif;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

/* ─── BOTTOM IMAGE ─── */
.bottom-section {
    max-width: var(--col-width);
    margin: 48px auto 80px;
    padding: 0 7%;
}
.bottom-section img {
    width: 100%;
    border-radius: 5px;
    display: block;
}

/* ─── FOOTER ─── */
footer {
    border-top: 1px solid var(--border-solid);
    padding: 32px 24px;
    text-align: center;
}
.footer-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.footer-text {
    font-family: 'Playfair Display', serif;
    font-size: 0.82rem;
    font-style: italic;
    color: var(--text-muted);
}

/* ─── TOAST ─── */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: var(--toggle-bg);
    color: var(--toggle-color);
    font-family: 'Playfair Display', serif;
    font-size: 0.84rem;
    padding: 10px 20px;
    border-radius: 50px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    white-space: nowrap;
    z-index: 999;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ─── PROGRESS BAR ─── */
.reading-progress {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    height: 2px;
    background: var(--text-primary);
    width: 0%;
    z-index: 99;
    transition: width 0.1s linear;
}

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}
.hero h1         { animation: fadeUp 0.6s ease both; animation-delay: 0.05s; }
.hero-subtitle   { animation: fadeUp 0.6s ease both; animation-delay: 0.14s; }
.meta-row        { animation: fadeUp 0.6s ease both; animation-delay: 0.22s; }
.featured-img    { animation: fadeUp 0.6s ease both; animation-delay: 0.3s; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    .hero h1 { font-size: 32px; }
    .article-body p { font-size: 18px; }
    .theme-label, .share-label { display: none; }
}
