/* ==========================================================================
   HOMEPAGE CSS - POLYBITS THEME
   Magazine-style homepage layout
   ========================================================================== */

/* ==========================================
   HOME CONTAINER
   ========================================== */
.home-magazine {
    padding: 40px 0 80px;
}

@media (max-width: 767px) {
    .home-magazine {
        padding: 24px 0 60px;
    }
}

/* ==========================================
   HERO SECTION
   ========================================== */
.hero-section {
    margin-bottom: 60px;
}

.hero-post {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    min-height: 500px;
    display: flex;
    align-items: flex-end;
}

@media (max-width: 767px) {
    .hero-post {
        min-height: 400px;
        border-radius: 16px;
    }
}

.hero-image-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.9) 0%,
            rgba(0, 0, 0, 0.5) 50%,
            rgba(0, 0, 0, 0.2) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 40px;
    max-width: 700px;
}

@media (max-width: 767px) {
    .hero-content {
        padding: 24px;
    }
}

.hero-category {
    display: inline-block;
    padding: 6px 14px;
    background: var(--accent-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.hero-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    color: #fff;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.hero-title a:hover {
    color: var(--accent-light);
}

.hero-excerpt {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 16px;
}

@media (max-width: 767px) {
    .hero-excerpt {
        display: none;
    }
}

.hero-meta {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

/* ==========================================
   SECTION HEADER
   ========================================== */
.home-section {
    margin-bottom: 60px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    margin: 0;
    color: var(--text-primary);
}

.title-icon {
    font-size: 28px;
}

.section-link {
    font-family: var(--font-heading);
    font-size: 14px;
    color: var(--accent-primary);
    text-decoration: none;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.section-link:hover {
    color: var(--accent-secondary);
    transform: translateX(4px);
}

/* ==========================================
   POSTS GRID
   ========================================== */
.posts-grid {
    display: grid;
    gap: 24px;
}

.posts-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.posts-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 991px) {

    .posts-grid-4,
    .posts-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575px) {

    .posts-grid-4,
    .posts-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   POST CARD COMPACT
   ========================================== */
.post-card-compact {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.post-card-compact:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.card-image-link {
    display: block;
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card-compact:hover .card-image {
    transform: scale(1.05);
}

.card-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image-placeholder svg {
    width: 40px;
    height: 40px;
    color: #ccc;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.post-card-compact:hover .card-overlay {
    opacity: 1;
}

.card-content {
    padding: 20px;
}

.card-category {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    text-decoration: none;
}

.card-category:hover {
    color: var(--accent-secondary);
}

.card-title {
    font-size: 16px;
    line-height: 1.3;
    margin-bottom: 12px;
}

.card-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.card-title a:hover {
    color: var(--accent-primary);
}

.card-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ==========================================
   CATEGORY SECTION LAYOUT
   ========================================== */
.category-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
}

@media (max-width: 767px) {
    .category-layout {
        grid-template-columns: 1fr;
    }
}

/* Category Featured Post */
.category-featured-post {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    min-height: 350px;
    display: flex;
    flex-direction: column;
}

.category-featured-image {
    position: relative;
    flex: 1;
    display: block;
}

.category-featured-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.category-featured-post:hover .category-featured-image img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 60%);
}

.placeholder-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
}

.category-featured-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    z-index: 1;
}

.category-featured-title {
    font-size: 20px;
    color: #fff;
    margin-bottom: 8px;
    line-height: 1.3;
}

.category-featured-title a {
    color: inherit;
    text-decoration: none;
}

.category-featured-title a:hover {
    color: var(--accent-light);
}

.category-featured-excerpt {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
    line-height: 1.5;
}

@media (max-width: 767px) {
    .category-featured-excerpt {
        display: none;
    }
}

.category-featured-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* Category Side Posts */
.category-posts-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.category-side-post {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.category-side-post:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-sm);
}

.side-post-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
}

.side-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.side-post-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.side-post-title {
    font-size: 14px;
    font-family: var(--font-heading);
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 8px;
}

.side-post-title a {
    color: var(--text-primary);
    text-decoration: none;
}

.side-post-title a:hover {
    color: var(--accent-primary);
}

.side-post-date {
    font-size: 12px;
    color: var(--text-muted);
}

/* ==========================================
   LOAD MORE BUTTON
   ========================================== */
.load-more-container {
    text-align: center;
    margin-top: 40px;
}

.btn-large {
    padding: 16px 48px;
    font-size: 18px;
}

/* ==========================================
   CATEGORY ARCHIVE PAGE
   ========================================== */
.category-archive {
    padding: 40px 0 80px;
}

.category-header {
    text-align: center;
    margin-bottom: 48px;
    padding: 40px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border-radius: 20px;
    color: #fff;
}

.category-header .category-title {
    font-size: clamp(2rem, 5vw, 3rem);
    color: #fff;
    margin-bottom: 12px;
}

.category-header .category-description {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
}

.category-header .category-count {
    display: inline-block;
    margin-top: 16px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 14px;
}