/* ===== StoryPluck - Main Stylesheet ===== */
/* A clean, readable, book-inspired design */

:root {
    --bg: #faf7f2;
    --bg-card: #ffffff;
    --text: #2c2c2c;
    --text-muted: #6b6b6b;
    --accent: #8b5e3c;
    --accent-light: #c49a7a;
    --accent-dark: #5a3a22;
    --border: #e8e0d4;
    --gold: #d4a548;
    --shadow: rgba(0, 0, 0, 0.06);
    --font-body: 'Georgia', 'Times New Roman', serif;
    --font-heading: 'Georgia', 'Times New Roman', serif;
    --disclaimer-bg: #f0ebe3;
    --toggle-icon: "\1F319"; /* crescent moon */
}

/* ===== Dark Mode — keeps brown/tan tones, just dimmed ===== */
body.dark-mode {
    --bg: #1f1a14;
    --bg-card: #2a231b;
    --text: #e0d5c5;
    --text-muted: #a09480;
    --accent: #c49a7a;
    --accent-light: #8b6e55;
    --accent-dark: #d4a548;
    --border: #3d3226;
    --gold: #d4a548;
    --shadow: rgba(0, 0, 0, 0.3);
    --disclaimer-bg: #2a231b;
    --toggle-icon: "\2600"; /* sun */
}

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

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.8;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ===== Dark Mode Toggle Button ===== */
#dark-toggle {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.35rem 0.75rem;
    border-radius: 5px;
    margin-left: 0.5rem;
    line-height: 1;
    transition: background 0.2s, transform 0.2s;
    vertical-align: middle;
}
#dark-toggle:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}
#dark-toggle::before {
    content: var(--toggle-icon);
}
body.dark-mode #dark-toggle {
    background: rgba(0,0,0,0.25);
    border-color: rgba(255,255,255,0.15);
}

/* ===== Header ===== */
header {
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    color: white;
    padding: 1.5rem 1rem;
    text-align: center;
    border-bottom: 3px solid var(--gold);
    transition: background 0.3s ease;
}

header h1 {
    font-size: 2rem;
    font-weight: normal;
    letter-spacing: 2px;
    margin-bottom: 0.3rem;
}

header h1 a {
    color: white;
    text-decoration: none;
}

header p.tagline {
    font-style: italic;
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 0.8rem;
}

header p.tagline em {
    color: var(--gold);
    font-style: italic;
}

/* ===== Navigation ===== */
nav {
    margin-top: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

nav a {
    color: white;
    text-decoration: none;
    margin: 0 0.8rem;
    font-size: 0.9rem;
    padding: 0.3rem 0.8rem;
    border-radius: 3px;
    transition: background 0.2s;
}

nav a:hover {
    background: rgba(255,255,255,0.15);
}

/* ===== Main Content - 3 Column Layout ===== */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 160px 1fr 300px;
    gap: 1.5rem;
    align-items: start;
}

.main-content {
    min-width: 0;
}

/* ===== Sticky Sidebars ===== */
.sidebar-sticky {
    position: sticky;
    top: 1.5rem;
}

.sidebar-sticky .card {
    margin-bottom: 1rem;
}

.sidebar-left .ad-placeholder {
    min-height: 600px;
    padding: 1rem;
    margin: 0;
}

.sidebar-right .ad-placeholder {
    min-height: 250px;
    margin: 1rem 0 0 0;
}

/* ===== Hide sidebars on small screens ===== */
@media (max-width: 900px) {
    main {
        grid-template-columns: 1fr;
    }
    .sidebar-left, .sidebar-right {
        display: none;
    }
}

/* Medium screens: story + right sidebar only */
@media (min-width: 901px) and (max-width: 1100px) {
    main {
        grid-template-columns: 1fr 300px;
    }
    .sidebar-left {
        display: none;
    }
}

/* ===== Card ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow);
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* ===== Story Header ===== */
.story-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    transition: border-color 0.3s ease;
}

.story-header .day-badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 0.2rem 0.8rem;
    border-radius: 3px;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.story-header h2 {
    font-size: 1.6rem;
    color: var(--accent-dark);
    margin-bottom: 0.3rem;
    transition: color 0.3s ease;
}

.story-header .meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

.story-header .genres {
    margin-top: 0.5rem;
}

.genre-tag {
    display: inline-block;
    background: var(--accent-light);
    color: white;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    margin: 0.15rem;
    font-style: normal;
}

/* ===== Story Body ===== */
.story-body {
    font-size: 1.05rem;
    line-height: 1.9;
    text-align: justify;
}

.story-body p {
    margin-bottom: 1rem;
    text-indent: 1.5rem;
}

.story-body p:first-of-type {
    text-indent: 0;
}

/* ===== AI Disclaimer ===== */
.disclaimer {
    background: var(--disclaimer-bg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--gold);
    padding: 0.8rem 1rem;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 1.5rem;
    font-style: italic;
    transition: background 0.3s ease, border-color 0.3s ease;
}

/* ===== Today's Story Preview ===== */
.preview-text {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s;
    font-family: var(--font-body);
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: 1px solid var(--accent-dark);
}

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

.btn-secondary {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-secondary:hover {
    background: var(--accent);
    color: white;
}

.btn-gold {
    background: var(--gold);
    color: white;
    border: 1px solid #b8912e;
}

.btn-gold:hover {
    background: #b8912e;
}

/* ===== Premium Section ===== */
.premium-box {
    background: linear-gradient(135deg, #faf6ee, #f0ebe0);
    border: 2px solid var(--gold);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    margin: 2rem 0;
}

body.dark-mode .premium-box {
    background: linear-gradient(135deg, #2a231b, #332a20);
}

.premium-box h3 {
    color: var(--accent-dark);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.premium-box .price {
    font-size: 1.8rem;
    color: var(--gold);
    margin: 0.5rem 0;
}

.premium-box .price small {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.premium-box ul {
    list-style: none;
    margin: 1rem 0;
}

.premium-box ul li {
    padding: 0.3rem 0;
    font-size: 0.95rem;
}

.premium-box ul li::before {
    content: "✓ ";
    color: var(--gold);
}

/* ===== Archive ===== */
.archive-list {
    list-style: none;
}

.archive-list li {
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.3s ease;
}

.archive-list li:last-child {
    border-bottom: none;
}

.archive-list .story-title {
    font-size: 1rem;
}

.archive-list .story-title a {
    color: var(--accent);
    text-decoration: none;
}

.archive-list .story-title a:hover {
    text-decoration: underline;
}

.archive-list .story-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.archive-list .genres {
    font-size: 0.8rem;
}

/* ===== About Page ===== */
.about-section h3 {
    color: var(--accent-dark);
    margin: 1.5rem 0 0.5rem;
    font-size: 1.2rem;
}

.about-section p {
    margin-bottom: 1rem;
}

/* ===== Footer ===== */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
    transition: border-color 0.3s ease;
}

footer a {
    color: var(--accent);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* ===== Ad placeholder ===== */
.ad-placeholder {
    background: #f5f5f5;
    border: 1px dashed #ccc;
    border-radius: 4px;
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 1.5rem 0;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dark-mode .ad-placeholder {
    background: transparent;
    border-color: #3d3226;
}

/* AdSense tags are invisible until approval — show a subtle placeholder */
ins.adsbygoogle {
    display: block !important;
    background: #f5f5f5;
    border: 1px dashed #ddd;
    border-radius: 4px;
    min-height: 90px;
}
body.dark-mode ins.adsbygoogle {
    background: transparent;
    border-color: #3d3226;
}
.sidebar-left ins.adsbygoogle {
    min-height: 600px;
}
.sidebar-right ins.adsbygoogle {
    min-height: 250px;
}
.main-content ins.adsbygoogle {
    margin: 1.5rem 0;
    min-height: 120px;
}

/* ===== Sidebar Ad Label ===== */
.sidebar-ad-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-align: center;
}

/* ===== Responsive: small screens ===== */
@media (max-width: 600px) {
    header h1 { font-size: 1.5rem; }
    main { padding: 0 0.8rem; }
    .card { padding: 1.2rem; }
    .story-body { font-size: 1rem; }
    nav a { margin: 0 0.4rem; font-size: 0.8rem; }
}
