/* CSS Variables for Theming */
:root {
    /* Light Theme (Kawaii/Pastel) */
    --bg-color: #fdfbf7;
    /* Creamy White */
    --text-color: #5d5d5d;
    /* Soft Gray */
    --accent-color: #ffcede;
    /* Soft Pink/Peach */
    --secondary-accent: #ffeaa7;
    /* Soft Yellow */
    --card-bg: rgba(255, 255, 255, 0.8);
    --shadow-color: rgba(255, 206, 222, 0.4);
    --button-bg: #ff9ff3;
    --button-text: #ffffff;

    --font-main: 'Quicksand', sans-serif;
    --transition-speed: 0.3s;
}

/* Dark Theme (Soft Slate/Purple) */
body.dark-mode {
    --bg-color: #2e2e3e;
    /* Dark Slate */
    --text-color: #f0f0f0;
    /* Soft White */
    --accent-color: #a29bfe;
    /* Soft Purple */
    --secondary-accent: #6c5ce7;
    /* Deeper Purple */
    --card-bg: rgba(45, 52, 54, 0.8);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --button-bg: #a29bfe;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color var(--transition-speed), color var(--transition-speed);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 50px;
    width: auto;
    object-fit: contain;
}

#theme-toggle {
    background: var(--button-bg);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease, background-color var(--transition-speed);
    box-shadow: 0 4px 10px var(--shadow-color);
}

#theme-toggle:hover {
    transform: scale(1.1) rotate(10deg);
}

/* Main Content */
main {
    flex: 1;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Cards (Glassmorphism-ish) */
.glass-card {
    background: var(--card-bg);
    border-radius: 25px;
    padding: 40px;
    box-shadow: 0 8px 24px var(--shadow-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: background-color var(--transition-speed), box-shadow var(--transition-speed);
}

/* Typography & Decorations */
h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--text-color);
    border-bottom: 3px solid var(--accent-color);
    display: inline-block;
    padding-bottom: 5px;
}

.highlight {
    color: var(--button-bg);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: auto;
}

/* Responsive */
@media (max-width: 600px) {
    .main-header {
        padding: 20px;
    }

    .glass-card {
        padding: 30px 20px;
    }

    h1 {
        font-size: 2rem;
    }
}

/* Article Typography */
.about-section h2 {
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 25px;
}

.about-section h3 {
    font-size: 1.25rem;
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--accent-color);
    font-weight: 700;
}

.about-section p {
    margin-bottom: 15px;
    text-align: justify;
}

.about-section blockquote {
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-left: 5px solid var(--accent-color);
    border-radius: 10px;
    font-style: italic;
    color: var(--text-color);
}

body.dark-mode .about-section blockquote {
    background: rgba(0, 0, 0, 0.2);
}


/* Card Layout specific */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 60px;
    /* Added spacing as requested */
}

.post-card {
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px var(--shadow-color);
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.post-date {
    font-size: 0.8rem;
    opacity: 0.6;
    background: var(--secondary-accent);
    color: #333;
    padding: 2px 10px;
    border-radius: 12px;
    align-self: flex-start;
}

.post-card h3 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--text-color);
    line-height: 1.3;
}

.excerpt {
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.8;
}

.read-more {
    font-size: 0.9rem;
    color: var(--button-text);
    background: var(--button-bg);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    align-self: flex-start;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.read-more:hover {
    opacity: 0.9;
}

/* Detail View */
.hidden {
    display: none !important;
}

.back-btn {
    background: none;
    border: none;
    font-size: 1rem;
    color: var(--text-color);
    cursor: pointer;
    margin-bottom: 20px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.back-btn:hover {
    color: var(--button-bg);
}

.detail-date {
    display: block;
    margin-bottom: 20px;
    opacity: 0.6;
    font-style: italic;
}

/* Poem Illustration */
.poem-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.poem-img {
    max-width: 100%;
    border-radius: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.poem-content {
    max-width: 600px;
    margin: 0 auto;
}