/**
 * Orbit Grid System & Block Styles
 * Premium Design - Jannah Style
 */

/* ==========================================
   BLOCK HEADERS
   ========================================== */
.orbit-block {
    margin-bottom: 50px;
}

.block-head {
    margin-bottom: 25px;
    border-bottom: 2px solid #eee;
    position: relative;
    display: flex;
    align-items: center;
}

.block-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    background: var(--color-primary);
    color: #fff;
    padding: 8px 15px;
    display: inline-block;
    position: relative;
    line-height: 1;
}

.block-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    /* Align with bottom border container */
    left: 100%;
    /* Arrow to right (LTR) - Adjust for RTL */
    border-width: 0 10px 34px 0;
    /* Slanted edge */
    border-style: solid;
    border-color: transparent transparent var(--color-primary) transparent;
    /* This needs tweak for perfect shape */
    display: none;
    /* Simplify for now */
}


/* RTL Support for Title */
[dir="rtl"] .block-head {
    /* ... */
}


/* ==========================================
   HERO SECTION
   ========================================== */
.orbit-hero-section {
    margin-bottom: 40px;
}

.orbit-hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    /* Main (Big) | Sub (Small) */
    gap: 3px;
    /* Minimal gap for magazine look */
    height: 500px;
    /* Fixed height for Hero */
    overflow: hidden;
}

.hero-main-post {
    grid-row: span 2;
    position: relative;
    height: 100%;
}

.hero-sub-posts {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 3px;
    height: 100%;
}

/* Card Common Styles */
.hero-card {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.card-link {
    display: block;
    height: 100%;
    position: relative;
    color: white;
}

.card-image-wrapper {
    height: 100%;
    width: 100%;
    position: relative;
}

.hero-img,
.sub-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-link:hover .hero-img,
.card-link:hover .sub-img {
    transform: scale(1.1);
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
}

.card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 25px;
    z-index: 2;
    pointer-events: none;
    /* Let clicks pass to link */
}

/* Big Card Specifics */
.big-card .card-title {
    font-size: 28px;
    font-weight: 800;
    color: white;
    margin-bottom: 10px;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.big-card .card-meta {
    font-size: 13px;
    opacity: 0.9;
    color: #eee;
}

.cat-badge {
    background: var(--color-primary);
    color: white;
    padding: 3px 10px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: inline-block;
}

/* Small Card Specifics */
.small-card .card-content {
    padding: 15px;
}

.small-card .card-title {
    font-size: 16px;
    font-weight: 700;
    color: white;
    margin: 0;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ==========================================
   GRID BLOCK
   ========================================== */
.orbit-grid-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.grid-card {
    background: #fff;
    border-radius: 8px;
    /* Rounded Cards */
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    /* Soft Shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.grid-card:hover {
    transform: translateY(-5px);
    /* Lift Up Effect */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.grid-card .card-image-wrapper {
    height: 200px;
    position: relative;
}

.grid-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.grid-card:hover .grid-img {
    transform: scale(1.05);
}

.grid-card .card-content {
    padding: 20px;
    position: relative;
    /* Reset position for grid cards */
    background: white;
    color: var(--color-text);
}

.grid-card .card-cats {
    margin-bottom: 10px;
}

.grid-card .cat-link {
    color: var(--color-primary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
}

.grid-card .card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
    color: var(--color-text);
    transition: color 0.2s;
}

.grid-card:hover .card-title {
    color: var(--color-primary);
}

.grid-card .card-excerpt {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.6;
}

.grid-card .card-meta {
    font-size: 12px;
    color: #999;
    padding-top: 15px;
    border-top: 1px solid #f5f5f5;
    display: flex;
    justify-content: space-between;
}


/* ==========================================
   LIST BLOCK
   ========================================== */
.orbit-list-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.list-card {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    border-radius: 6px;
    padding: 10px;
    transition: all 0.2s;
}

.list-card:hover {
    background: #fafafa;
}

.list-link {
    display: flex;
    gap: 15px;
    text-decoration: none;
    color: inherit;
    align-items: center;
}

.list-image-wrapper {
    width: 100px;
    height: 75px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
}

.list-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-content {
    flex: 1;
}

.list-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 5px;
    line-height: 1.4;
    transition: color 0.2s;
}

.list-card:hover .list-title {
    color: var(--color-primary);
}

.list-meta {
    font-size: 11px;
    color: #888;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 900px) {
    .orbit-hero-grid {
        height: auto;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }

    .hero-main-post {
        grid-row: auto;
        height: 300px;
        /* Force height on mobile */
    }

    .hero-sub-posts {
        grid-template-columns: 1fr 1fr;
        /* 2 cols on mobile for subs */
        grid-template-rows: auto;
        height: 150px;
    }
}

@media (max-width: 600px) {
    .hero-main-post {
        height: 250px;
    }

    .big-card .card-title {
        font-size: 20px;
    }

    .hero-sub-posts {
        height: auto;
        display: none;
        /* Hide subs on very small screens? or Stack them */
    }

    .orbit-grid-wrapper {
        grid-template-columns: 1fr;
        /* Full width cards on mobile */
    }
}