/* Modern & Premium Design Overhaul */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #52b506;
    --primary-dark: #167f06;
    --text-main: #111827;
    --text-muted: #6b7280;
    --bg-body: #f3f4f6;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

/* Header */
header {
    background: linear-gradient(135deg, #52b506 0%, #167f06 100%);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 0 5%;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    top: 0;
    z-index: 1000;
}

.site-title a {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-weight: 500;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: #ffffff;
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #ffffff;
}

/* Main Layout */
.main-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    grid-template-areas: "sidebar content";
    min-height: calc(100vh - 70px);
    max-width: 1400px;
    margin: 0 auto;
    gap: 0;
}

/* Sidebar */
.sidebar {
    grid-area: sidebar;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 30px 20px;

    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
}

.sidebar h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    margin-bottom: 20px;
    font-weight: 600;
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sidebar-list a {
    display: block;
    padding: 3px 8px;
    /* Minimal padding */
    margin: 0;
    line-height: 1.2;
    color: var(--text-main);
    font-size: 0.95rem;
    border-radius: var(--radius);
    transition: background 0.2s, padding-left 0.2s;
}

.sidebar-list a:hover {
    background: #eff6ff;
    color: var(--primary);
    padding-left: 20px;
}

/* Content Area */
.content {
    grid-area: content;
    padding: 40px 50px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 3rem 0 1.5rem;
    display: flex;
    align-items: center;
}

h2::before {
    content: '';
    display: block;
    width: 6px;
    height: 24px;
    background: var(--primary);
    margin-right: 12px;
    border-radius: 3px;
}

.intro-text p,
.post-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #4b5563;
    max-width: 800px;
}

/* Cards */
.hot-grid,
.latest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.card-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.card-content {
    padding: 15px;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-text {
    margin-top: 3rem;
}

/* Detail Images */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    margin-top: 2rem;
}

.detail-img-card {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
    cursor: pointer;
    background-color: #ffffff;
}

.detail-img-card img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.detail-img-card:hover {
    transform: scale(1.02);
}

/* Image Page Actions */
.image-detail-container {
    max-width: 900px;
}

.main-image {
    width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    background-color: transparent;
    /* Dark background for better viewing */
}

.image-actions {
    margin-top: 30px;
    display: flex;
    gap: 20px;
}

.btn {
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
    transition: background 0.2s, transform 0.1s;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    background: #fff;
    margin-top: 60px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--primary);
}

/* Mobile */
@media (max-width: 768px) {
    .main-container {
        display: flex;
        flex-direction: column;
    }

    .sidebar {
        height: auto;
        position: static;
        overflow-y: visible;
        border-right: none;
        border-top: 1px solid var(--border-color);
        padding: 20px;
        order: 2;
        /* Sidebar at bottom */
    }

    .content {
        padding: 30px 20px;
        order: 1;
    }

    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow-md);
        gap: 15px;
    }

    .nav-links a {
        color: var(--text-main);
        /* Black/Dark on mobile white background */
    }

    .nav-links.active {
        display: flex;
    }

    .sidebar-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        /* 2 cols for links on mobile */
        gap: 10px;
    }

    .sidebar-list a {
        background: white;
        border: 1px solid var(--border-color);
        text-align: center;
        padding: 10px;
        word-break: break-word;
        font-size: 0.9rem;
    }

    .detail-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .detail-img-card img {
        width: 100%;
        height: 300px;
        max-height: none;
        object-fit: cover;
        background: transparent;
    }

    .hot-grid,
    .latest-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    h1 {
        font-size: 2rem;
    }
}