/* Import Computer Modern Serif */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,600;1,600&display=swap');

html {
    scroll-behavior: smooth;
}

.dashboard-container {
    max-width: 1100px;
    /* Slightly wider to fit 3 cards easily */
    margin: 0 auto;

    /* FIX 1: Add top padding to clear the navbar */
    padding-top: 100px;
    padding-bottom: 40px;
    padding-left: 20px;
    padding-right: 20px;

    background-color: #f8f9fa;
    border-radius: 8px;
}

.math-font {
    font-family: 'Cormorant Garamond', 'Times New Roman', serif;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.pane {
    background: #fff;
    border: none;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pane.featured-pane,
.pane.recent-list-pane {
    padding: 25px;
}

.pane.tag-pane {
    padding: 0;
}

.pane-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.pane:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.dashboard-top {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 25px;
    margin-bottom: 40px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.featured-image {
    width: 100%;
    height: 220px;
    background-size: cover;
    background-position: center;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.2);
    font-size: 5rem;
    overflow: hidden;
}

.pane-label {
    margin: 0 0 15px 0;
    font-size: 1.6rem;
    color: #2d2d2d;
}

.featured-pane .pane-label {
    background-color: #2e7d32;
    /* Green for Latest Post */
    color: white;
    margin: -25px -25px 20px -25px;
    padding: 15px 25px;
    border-radius: 6px 6px 0 0;
}

.recent-list-pane .pane-label {
    background-color: #1565c0;
    /* Blue for Most recent posts */
    color: white;
    margin: -25px -25px 20px -25px;
    padding: 15px 25px;
    border-radius: 6px 6px 0 0;
}

/* --- FIXED HEADER STYLING --- */
.tag-header {
    background: linear-gradient(135deg, #4b6cb7, #182848);
    color: white;

    /* 1. Increase height to show the image */
    height: 140px;

    padding: 15px 20px;
    display: flex;
    justify-content: space-between;

    /* 2. Align text to bottom so it doesn't float in the middle of the art */
    align-items: flex-end;

    margin: 0;
}

.tag-header h3 {
    margin: 0;
    font-size: 1.6rem;
    color: #2d2d2d;
    /* Dark text for sketch covers */
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    /* Glow to make text readable over drawings */
}

.tag-header .count {
    color: #555;
    background: rgba(255, 255, 255, 0.8);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.leaf-icon {
    height: 12px;
    width: auto;
    opacity: 0.8;
}

.tag-post-list {
    margin-bottom: 15px;
    padding-left: 20px;
}

.pane-footer {
    margin-top: auto;
    font-size: 0.9rem;
    color: #008AFF;
    text-decoration: none;
    font-weight: 600;
}

/* --- LINK STYLING --- */
.featured-link,
.recent-list-pane ul li a,
.tag-post-list li a {
    color: #2d2d2d;
    text-decoration: none;
    transition: color 0.2s ease;
}

.featured-link:hover,
.recent-list-pane ul li a:hover,
.tag-post-list li a:hover {
    color: #008AFF;
    text-decoration: none;
}

@media (max-width: 768px) {
    .dashboard-top {
        grid-template-columns: 1fr;
    }
}

/* --- DARK MODE STYLES --- */
body.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

body.dark-mode .dashboard-container {
    background-color: #121212;
}

body.dark-mode .pane {
    background-color: #1e1e1e;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

body.dark-mode .pane-label {
    color: #e0e0e0;
}

body.dark-mode .tag-header h3 {
    color: #e0e0e0;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

body.dark-mode .featured-link,
body.dark-mode .recent-list-pane ul li a,
body.dark-mode .tag-post-list li a {
    color: #e0e0e0;
}

body.dark-mode .featured-link:hover,
body.dark-mode .recent-list-pane ul li a:hover,
body.dark-mode .tag-post-list li a:hover {
    color: #64b5f6;
}

body.dark-mode .excerpt {
    color: #b0b0b0;
}

body.dark-mode .read-more,
body.dark-mode .pane-footer {
    color: #64b5f6;
}

body.dark-mode .navbar-custom {
    background-color: #1e1e1e;
    border-bottom: 1px solid #333;
}

body.dark-mode .navbar-custom .navbar-brand,
body.dark-mode .navbar-custom .nav-link {
    color: #e0e0e0;
}

body.dark-mode .navbar-custom .nav-link:hover {
    color: #64b5f6;
}

/* Adjust the tag header count badge in dark mode */
body.dark-mode .tag-header .count {
    background: rgba(30, 30, 30, 0.8);
    color: #e0e0e0;
}

/* Invert the leaf icon brightness if needed, or keep it as is */
body.dark-mode .leaf-icon {
    filter: invert(1);
}