:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --bg-body: #f8fafc;
    --border-color: #e2e8f0;
    --title-gradient: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.7) 40%, rgba(15, 23, 42, 0.95) 100%);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-hover: 0 12px 24px -6px rgba(15, 23, 42, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-body);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

/* Layout Structure */
.main-layout {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.content-area {
    width: 100%;
}

.post-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* Post Cards Design */
.post-card {
    position: relative;
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.post-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #e2e8f0;
    overflow: hidden;
}

.post-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
    will-change: transform;
}

.post-card:hover .post-image-wrap img {
    transform: scale(1.04);
}

/* Top Meta Overlay */
.image-top-meta {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 6;
}

.category-badge {
    background: var(--primary-color);
    color: #ffffff;
    padding: 4px 10px;
    font-size: 0.68rem;
    border-radius: 20px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.post-date {
    font-size: 0.72rem;
    color: #ffffff;
    font-weight: 600;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 4px 10px;
    border-radius: 20px;
}

.post-date i {
    margin-right: 4px;
}

/* Title Overlay Design */
.image-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 36px 14px 12px 14px;
    background: var(--title-gradient);
    z-index: 2;
}

.image-title-overlay h2 {
    font-size: 1.05rem;
    line-height: 1.35;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
}

.main-card-link {
    color: #ffffff;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-external-content {
    padding: 14px;
    background: #ffffff;
}

.post-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.whole-card-link {
    position: absolute;
    inset: 0;
    z-index: 5;
}

/* Sidebar Styling */
.sidebar-area {
    display: none;
}

.category-sidebar-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 14px 0;
    color: var(--text-main);
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-title i {
    color: var(--primary-color);
}

.sidebar-cat-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-cat-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 8px;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.cat-left-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cat-icon {
    font-size: 0.8rem;
    color: var(--primary-color);
}

.sidebar-cat-list li a:hover {
    background: var(--primary-color);
    color: #ffffff;
}

.sidebar-cat-list li a:hover .cat-icon {
    color: #ffffff;
}

.cat-count {
    font-size: 0.72rem;
    background: #e2e8f0;
    color: var(--text-main);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.sidebar-cat-list li a:hover .cat-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* Ads Holder Styling */
.ad-container {
    background: #f1f5f9;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100px;
    position: relative;
    border: 1px dashed #cbd5e1;
}

.ad-label {
    font-size: 0.62rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    position: absolute;
    top: 4px;
    left: 10px;
}

/* Skeleton Loading Overlay */
.skeleton-page-overlay {
    position: fixed;
    inset: 0;
    background-color: var(--bg-body);
    z-index: 99999;
    padding: 24px 16px;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    opacity: 1;
    visibility: visible;
}

.skeleton-page-overlay.preloader-hidden {
    opacity: 0;
    visibility: hidden;
}

.skeleton-container {
    max-width: 1280px;
    margin: 0 auto;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.skeleton-card {
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    height: 300px;
}

.skeleton-image {
    width: 100%;
    height: 180px;
    background-color: #e2e8f0;
}

.skeleton-content {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skeleton-line {
    height: 12px;
    background-color: #e2e8f0;
    border-radius: 4px;
}

.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-full { width: 85%; }

.animate-pulse {
    animation: skeleton-pulse 1.2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}

/* Media Queries */
@media (min-width: 640px) {
    .post-grid, .skeleton-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .main-layout {
        flex-direction: row;
    }
    .content-area {
        width: 73%;
    }
    .sidebar-area {
        display: block;
        width: 27%;
    }
    .post-grid, .skeleton-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .sidebar-sticky {
        position: sticky;
        top: 88px;
    }
}