/* 1. Unified Theme Variables */
:root {
    --bg-color: #f4f1ea;       /* Light Old Paper */
    --header-bg: rgba(255, 250, 240, 0.8);
    --card-bg: rgba(255, 255, 255, 0.85);
    --accent-color: #800000;   /* Deep Maroon */
    --text-color: #2c2c2c;
    --modal-bg: #fffdf9;
    --border-color: #dcd7c9;
    --shadow: rgba(0, 0, 0, 0.05);
    
    /* Light Mode Shine: Pearly glow */
    --shine-color: rgba(255, 255, 255, 0.9); 
}

/* 2. Dark Mode Variables */
[data-theme="dark"] {
    --bg-color: #1a1a1a;       /* Dark Charcoal */
    --header-bg: rgba(34, 34, 34, 0.9);
    --card-bg: #262626;
    --accent-color: #e0a38d;   /* Soft Copper */
    --text-color: #e0e0e0;
    --modal-bg: #1e1e1e;
    --border-color: #444;
    --shadow: rgba(0, 0, 0, 0.4);
    
    /* Dark Mode Shine: Crisp white highlight */
    --shine-color: rgba(255, 255, 255, 0.2);
}

/* 3. General Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hind Siliguri', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.8;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.logo {
    font-family: 'Galada', cursive;
    font-size: 2.2rem;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 12px;
    /* Space between lotus and text */
    cursor: pointer;
    transition: 0.3s ease;
}

.logo:hover {
    filter: drop-shadow(0 0 8px var(--accent-color));
    transform: translateY(-2px);
}

/* Paper Texture Overlay */
.paper-texture {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('https://www.transparenttextures.com/patterns/handmade-paper.png');
    pointer-events: none;
    z-index: 9999;
    opacity: 0.3;
}

[data-theme="dark"] .paper-texture {
    filter: invert(1);
    opacity: 0.05;
}

/* 4. Header & Navigation */
header {
    padding: 20px 5%;
    background-color: var(--header-bg);
    border-bottom: 1px double var(--accent-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1000px;
    margin: 0 auto;
}

.logo {
    font-family: 'Galada', cursive;
    font-size: 2.2rem;
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: 0.3s;
}

.nav-links a:hover {
    color: var(--accent-color);
}

/* Theme Toggle Button */
.theme-btn {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 5px 12px;
    cursor: pointer;
    border-radius: 50px;
    font-size: 1.1rem;
    transition: 0.3s;
}

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

/* 5. Hero & Content */
.hero {
    text-align: center;
    padding: 80px 20px;
}

.hero h1 {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 15px;
    min-height: 1.2em;
}

.poetry-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* --- High-End Poem Card Styling --- */
.poem-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 40px;
    margin-bottom: 50px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 6px solid var(--accent-color);
    box-shadow: 0 10px 20px var(--shadow);
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Enhanced Shine Animation */
.poem-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        to right, 
        transparent, 
        var(--shine-color), 
        transparent
    );
    transform: skewX(-25deg);
    transition: 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.poem-card:hover::before {
    left: 150%;
}

.poem-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 40px var(--shadow);
    border-left-width: 10px;
}

/* Keep text above the shine */
.poem-title, .author, .excerpt, .read-more {
    position: relative;
    z-index: 2;
}

/* --- Advanced Scroll Reveal Animation --- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px) rotateX(-10deg);
    transition: opacity 0.5s ease-out, transform 0.4s cubic-bezier(0.2, 1, 0.3, 1);
    will-change: transform, opacity;
}

.scroll-reveal.active {
    opacity: 1;
    transform: translateY(0) rotateX(0);
}

.poem-title {
    font-size: 1.8rem;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.author {
    font-style: italic;
    color: #888;
    margin-bottom: 20px;
}

.read-more {
    margin-top: 20px;
    background: transparent;
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    padding: 8px 20px;
    cursor: pointer;
    font-family: 'Hind Siliguri';
    transition: 0.3s;
}

.read-more:hover {
    background: var(--accent-color);
    color: white;
}

/* 6. Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(8px);
}

.modal-content {
    background: var(--modal-bg);
    margin: 5vh auto;
    padding: 50px 40px;
    width: 90%; 
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    border-radius: 4px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    color: var(--text-color);
}

.close-modal {
    position: absolute;
    right: 25px; top: 15px;
    font-size: 35px; cursor: pointer; color: #888;
}

.modal-poem-title { 
    font-family: 'Galada'; 
    color: var(--accent-color); 
    text-align: center; 
    margin-bottom: 10px; 
}

.separator { border: 0; height: 1px; background: var(--border-color); margin-bottom: 20px; }

.modal-poem-body { 
    white-space: pre-line; 
    text-align: center; 
    font-size: 1.25rem; /* Slightly larger for better reading */
    line-height: 2; /*Line hight for better line spacing*/
}

/* 7. Footer */
footer {
    padding: 40px 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

/* 8. Responsive Adjustments */
@media (max-width: 600px) {
    .nav-links li:not(:last-child) { display: none; }
    .hero h1 { font-size: 2.2rem; }
    .poem-card { padding: 30px 20px; }
    
    .modal-content {
        width: 95%; 
        margin: 2vh auto;
        padding: 40px 20px;
        max-height: 96vh;
    }
    
    .modal-poem-body { 
        font-size: 1rem; 
        line-height: 1.7;
    }
}

/* --- Author Section Styling --- */
.author-section {
    max-width: 800px;
    margin: 80px auto;
    padding: 40px;
    background: var(--card-bg);
    border-top: 3px solid var(--accent-color);
    border-radius: 12px;
    box-shadow: 0 10px 30px var(--shadow);
}

.author-container {
    display: flex;
    align-items: center;
    gap: 30px;
}

.author-image img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--accent-color);
    padding: 5px;
    background: var(--bg-color);
}

.author-info h3 {
    font-family: 'Galada', cursive;
    font-size: 2rem;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.author-bio {
    font-size: 1.1rem;
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 20px;
}

.social-links a {
    text-decoration: none;
    color: var(--accent-color);
    font-weight: bold;
    margin-right: 15px;
    font-size: 0.9rem;
    border-bottom: 1px dashed var(--accent-color);
    transition: 0.3s;
}

.social-links a:hover {
    color: var(--text-color);
    border-bottom: 1px solid var(--text-color);
}

/* --- Mobile Responsive for Author --- */
@media (max-width: 600px) {
    .author-container {
        flex-direction: column;
        text-align: center;
    }
    
    .author-image img {
        width: 120px;
        height: 120px;
    }
}


/* Class for Prose (Justified) */
.modal-poem-body.type-prose {
    text-align: justify;
    hyphens: auto;
    padding: 0 10px;
}

/* Mobile tweak for prose */
@media (max-width: 600px) {
    .modal-poem-body.type-prose {
        font-size: 1rem;
        text-align: left;
        /* Justify can sometimes look weird on very narrow screens */
    }
}

/* Prose Specific Body Styles */
.modal-poem-body.type-prose {
    text-align: justify;
    padding: 0 10px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* 6. Pagination UI */
.pagination {
    display: none;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed var(--border-color);
}

.page-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Hind Siliguri';
}

.page-btn:disabled { background: #ccc; cursor: not-allowed; }
#pageNumber { font-weight: bold; color: var(--accent-color); }

/* Page Turning Effects */
.page-turn-right { animation: slideInRight 0.4s forwards; }
.page-turn-left { animation: slideInLeft 0.4s forwards; }

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

.timestamp {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.7;
    /* Makes it look subtle */
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Optional: Add a small clock icon before the date using CSS */
.timestamp::before {
    content: "🕒";
    font-size: 0.8rem;
}

[data-theme="dark"] .timestamp {
    color: var(--accent-color);
    opacity: 0.9;
}