/* Premium CSS Design System for AGK2 Theme */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
    /* DEFAULT: Dark Mode Palette */
    --bg-primary: #0b0f19;
    --bg-secondary: #131b2e;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent-color: #818cf8;
    --accent-hover: #6366f1;
    --accent-light: #1e1b4b;
    --border-color: #1e293b;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.2);
    --card-shadow-hover: 0 20px 25px -5px rgb(0 0 0 / 0.3);
    
    /* Layout */
    --max-width: 1200px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

/* Light mode overrides */
:root.light, html.light, html.light body, body.light, .light {
    --bg-primary: #f8fafc !important;
    --bg-secondary: #ffffff !important;
    --text-primary: #0f172a !important;
    --text-secondary: #475569 !important;
    --accent-color: #6366f1 !important;
    --accent-hover: #4f46e5 !important;
    --accent-light: #e0e7ff !important;
    --border-color: #e2e8f0 !important;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05) !important;
    --card-shadow-hover: 0 20px 25px -5px rgb(0 0 0 / 0.05), 0 8px 10px -6px rgb(0 0 0 / 0.01) !important;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.3;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.25s ease;
}

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

/* Header & Navigation (Glassmorphic) */
.site-header {
    background: var(--bg-secondary);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 100;
    padding: 1rem 0;
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.logo a {
    font-size: clamp(1.15rem, 3.5vw, 1.5rem);
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    word-break: break-word;
}

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

.search-form {
    flex: 1;
    max-width: 450px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.25s ease;
    box-shadow: inset 0 2px 4px 0 rgba(0,0,0,0.02);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px var(--accent-light), inset 0 2px 4px 0 rgba(0,0,0,0.02);
    background-color: var(--bg-secondary);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.nav-links {
    display: flex;
    gap: 1.25rem;
    align-items: center;
}

.nav-item {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.9rem;
    white-space: nowrap;
}

.nav-item:hover, .nav-item.active {
    color: var(--accent-color);
}

@media (max-width: 768px) {
    .site-header {
        padding: 0.75rem 0;
    }
    .header-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0 1rem;
    }
    .logo {
        text-align: center;
        width: 100%;
    }
    .logo a {
        justify-content: center;
    }
    .search-form {
        max-width: 100%;
        width: 100%;
        order: 2;
    }
    .nav-links {
        justify-content: center;
        gap: 1rem;
        flex-wrap: wrap;
        order: 3;
    }
}

/* Main Content Wrapper */
.site-content {
    flex: 1;
    max-width: var(--max-width);
    width: 100%;
    margin: 2rem auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2.5rem;
}

@media (max-width: 1024px) {
    .site-content {
        grid-template-columns: 1fr;
    }
}

/* Feed & Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.post-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
    border-color: rgba(99, 102, 241, 0.2);
}

.card-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background-color: var(--border-color);
    overflow: hidden;
}

.card-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.post-card:hover .card-img-wrapper img {
    transform: scale(1.05);
}

.card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-title {
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.card-title a {
    color: var(--text-primary);
}

.card-title a:hover {
    color: var(--accent-color);
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Sidebar Styling */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.widget {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
}

.widget-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-light);
    color: var(--text-primary);
}

.widget-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    list-style: none;
}

.widget-list a {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.widget-list a:hover {
    color: var(--accent-color);
    transform: translateX(3px);
}

/* Article/Post Page Aesthetics */
.article-container {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2.5rem;
    box-shadow: var(--card-shadow);
}

@media (max-width: 768px) {
    .article-container {
        padding: 1.5rem;
    }
}

.article-header {
    margin-bottom: 2rem;
}

.article-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.25rem;
}

.author-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.author-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: var(--border-color);
    object-fit: cover;
}

.article-body {
    font-size: 1.1rem;
    color: var(--text-primary);
    line-height: 1.75;
}

.article-body p {
    margin-bottom: 1.5rem;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 1.5rem 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.gallery-grid img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: var(--card-shadow);
}

.gallery-grid img:hover {
    transform: scale(1.04);
    box-shadow: var(--card-shadow-hover);
}

/* Call to Action Box */
.cta-box {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: #ffffff;
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    margin: 2.5rem 0;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

.cta-box a {
    background-color: #ffffff;
    color: var(--accent-color);
    padding: 0.85rem 2rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    display: inline-block;
    margin-top: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.cta-box a:hover {
    background-color: var(--bg-primary);
    color: var(--accent-hover);
    transform: translateY(-2px);
}

/* Partner Resources Box */
.partner-box {
    background-color: var(--bg-primary);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-top: 3rem;
}

.partner-box ul {
    list-style: none;
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem;
}

.partner-box li a {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.partner-box li a:hover {
    color: var(--accent-color);
}

/* Footer Styling */
.site-footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: auto;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--accent-color);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99;
}

.back-to-top.active {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: var(--accent-hover);
    transform: translateY(-3px);
}
