/* =========================================
   HOMEPAGE APP CARD STYLES
   ========================================= */
.bloghash-app-card {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.bloghash-app-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.bloghash-app-card-inner {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

/* Thumbnail */
.bloghash-app-thumbnail {
    flex-shrink: 0;
}

.bloghash-app-thumbnail .app-icon {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    object-fit: cover;
    display: block;
}

/* Content */
.bloghash-app-content {
    flex: 1;
    min-width: 0;
}

/* Tags */
.bloghash-app-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.app-tag {
    background: #f0f0f0;
    color: #666;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Title */
.bloghash-app-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    line-height: 1.3;
    font-weight: 600;
}

.bloghash-app-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}

.bloghash-app-title a:hover {
    color: var(--primary-color, #5bb300);
}

/* Meta (Rating + Downloads) */
.bloghash-app-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
}

/* Rating */
.bloghash-app-rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.bloghash-app-rating .star {
    color: #ddd;
    line-height: 1;
}

.bloghash-app-rating .star.filled {
    color: #ffc107;
}

.bloghash-app-rating .rating-text {
    margin-left: 4px;
    font-weight: 600;
    color: #333;
}

/* Downloads */
.bloghash-app-downloads {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #666;
}

.bloghash-app-downloads svg {
    color: #999;
}

.bloghash-app-downloads span {
    font-weight: 500;
}

/* Responsive */
@media (max-width: 600px) {
    .bloghash-app-thumbnail .app-icon {
        width: 60px;
        height: 60px;
        border-radius: 12px;
    }

    .bloghash-app-title {
        font-size: 14px;
    }

    .bloghash-app-meta {
        font-size: 12px;
    }
}

/* =========================================
   HOMEPAGE SECTIONS & POST GRID
   ========================================= */
.bloghash-homepage-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 30px;
}

/* Override parent theme sidebar restriction */
body:not(.bloghash-no-sidebar) .bloghash-homepage-content,
body.bloghash-has-sidebar .bloghash-homepage-content,
.bloghash-homepage-content#primary,
#primary.bloghash-homepage-content {
    max-width: 90% !important;
    /* width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    float: none !important; */
}

/* Fix for archive/category/page templates */
body.archive #primary.bloghash-homepage-content,
body.category #primary.bloghash-homepage-content,
body.tag #primary.bloghash-homepage-content,
body.page #primary.bloghash-homepage-content {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 auto !important;
    float: none !important;
}

.homepage-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #333;
}

.section-more {
    color: #00d4ff;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: color 0.2s;
}

.section-more:hover {
    color: #00b8db;
}

/* Post Grid - 4 columns desktop, 2 mobile */
.post-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Post Card */
.post-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.post-card a {
    text-decoration: none;
    display: block;
}

.card-thumb {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 55%;
    /* Creates ~16:9 landscape ratio */
    overflow: hidden;
}

.card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .card-img {
    transform: scale(1.05);
}

.card-thumb .no-thumb {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.card-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #00d4ff;
    color: #000;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.card-body {
    padding: 10px 12px;
}

.card-title {
    margin: 0 0 6px 0;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #666;
}

.card-rating {
    font-weight: 500;
}

.card-downloads {
    font-weight: 500;
    color: #888;
}

/* Dark Mode Support */
[data-darkmode=dark] .post-card {
    background: #1e1e2f;
}

[data-darkmode=dark] .card-title {
    color: #fff;
}

[data-darkmode=dark] .card-meta {
    color: #aaa;
}

[data-darkmode=dark] .card-downloads {
    color: #999;
}

[data-darkmode=dark] .section-title {
    color: #fff;
}

[data-darkmode=dark] .section-header {
    border-bottom-color: #333;
}

[data-darkmode=dark] .section-more {
    color: #00d4ff;
}

/* Responsive Grid */
@media (max-width: 1024px) {
    .post-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .post-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .card-thumb {
        height: 140px;
    }

    .card-title {
        font-size: 13px;
        padding: 10px 12px;
    }

    .section-title {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .bloghash-homepage-content {
        padding: 15px;
    }

    .post-grid {
        gap: 10px;
    }

    .card-thumb {
        height: 120px;
    }
}

/* =========================================
   FEATURED GRID HERO STYLES
   ========================================= */
.bloghash-featured-grid-hero {
    padding-top: 10px;
}

.featured-grid-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Large Card */
.featured-large {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    min-height: 420px;
    background: #1a1a2e;
}

.featured-large a {
    display: block;
    height: 100%;
    text-decoration: none;
}

.featured-large .featured-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.featured-large:hover .featured-bg {
    transform: scale(1.05);
}

.featured-large .featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70%;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
}

.featured-large .featured-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 25px;
    color: #fff;
    z-index: 2;
}

.featured-large .featured-tag {
    display: inline-block;
    background: #00d4ff;
    color: #000;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.featured-large .featured-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 12px 0;
    line-height: 1.3;
    color: #fff;
}

.featured-large .featured-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.featured-large .meta-rating,
.featured-large .meta-downloads {
    display: flex;
    align-items: center;
    gap: 5px;
}

.featured-large .meta-rating svg {
    color: #ffc107;
}

/* Small Cards Grid */
.featured-small-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 15px;
}

.featured-small {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    min-height: 200px;
    background: #1a1a2e;
}

.featured-small a {
    display: block;
    height: 100%;
    text-decoration: none;
}

.featured-small .featured-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.featured-small:hover .featured-bg {
    transform: scale(1.08);
}

.featured-small .featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80%;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
}

.featured-small .featured-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    color: #fff;
    z-index: 2;
}

.featured-small .featured-tag {
    display: inline-block;
    background: #00d4ff;
    color: #000;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.featured-small .featured-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-no-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Mobile Slider - Hidden by default */
.featured-mobile-slider {
    display: none;
}

/* Responsive - Tablet: 3 equal cards */
@media (max-width: 1024px) {
    .featured-grid-container {
        grid-template-columns: repeat(3, 1fr);
    }

    .featured-large {
        min-height: 250px;
    }

    /* Make large card same style as small cards */
    .featured-large .featured-title {
        font-size: 16px;
    }

    .featured-large .featured-content {
        padding: 15px;
    }

    .featured-large .featured-meta {
        display: none;
    }

    /* Hide 3rd and 4th small cards, only show 2 small */
    .featured-small-grid .featured-small:nth-child(3),
    .featured-small-grid .featured-small:nth-child(4) {
        display: none;
    }

    .featured-small-grid {
        display: contents;
    }

    .featured-small {
        min-height: 250px;
    }
}

@media (max-width: 768px) {

    /* Hide desktop grid, show mobile slider */
    .featured-grid-desktop {
        display: none;
    }

    .featured-mobile-slider {
        display: block;
        position: relative;
        overflow: hidden;
        padding: 0 15px;
    }

    .slider-track {
        display: flex;
        transition: transform 0.4s ease;
    }

    .slide {
        flex: 0 0 100%;
        position: relative;
        border-radius: 16px;
        overflow: hidden;
        min-height: 250px;
        background: #1a1a2e;
    }

    .slide a {
        display: block;
        height: 100%;
        text-decoration: none;
    }

    .slide-bg {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .slide-overlay {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70%;
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    }

    .slide-content {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 20px;
        color: #fff;
        z-index: 2;
    }

    .slide-tag {
        display: inline-block;
        background: #00d4ff;
        color: #000;
        padding: 4px 12px;
        border-radius: 15px;
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
        margin-bottom: 10px;
    }

    .slide-title {
        font-size: 18px;
        font-weight: 700;
        margin: 0 0 8px 0;
        line-height: 1.3;
        color: #fff;
    }

    .slide-meta {
        display: flex;
        gap: 15px;
        font-size: 13px;
        color: rgba(255, 255, 255, 0.9);
    }

    /* Dots */
    .slider-dots {
        display: flex;
        justify-content: center;
        gap: 8px;
        padding: 15px 0;
    }

    .dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: #ccc;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .dot.active {
        background: #00d4ff;
        transform: scale(1.2);
    }

    .dot:hover {
        background: #00b8db;
    }
}

@media (max-width: 480px) {
    .slide {
        min-height: 220px;
    }

    .slide-title {
        font-size: 16px;
    }

    .slide-content {
        padding: 15px;
    }
}