/* Add custom CSS styles below */ 

/* ==========================================================================
   RAED THEME - FIXED BANNER EDGE-TO-EDGE, SHARP CORNERS & GAP CORRECTION
   ========================================================================== */

/* 1. Eliminate left/right white spaces & force sharp corners */
.s-block--fixed-banner,
.s-block--fixed-banner .container,
.s-block--fixed-banner .banner--fixed,
.s-block--fixed-banner a {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0 !important;
    border-radius: 0px !important; /* Force perfectly sharp square corners */
}

/* 2. Strip rounding and distortion from the image itself */
.s-block--fixed-banner img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    object-fit: cover !important; /* Prevents squishing */
    border-radius: 0px !important; /* Overrides any inherited roundness on the asset */
}

/* 3. Remove weird gaps above and below the banner section */
.s-block--fixed-banner {
    margin-top: 0px !important;
    margin-bottom: 0px !important;
    padding-top: 0px !important;
    padding-bottom: 0px !important;
}

/* Wipe out orphaned spacing from immediate sibling blocks */
.s-block--fixed-banner + .s-block,
div:has(> .s-block--fixed-banner) {
    margin-top: 0px !important;
    padding-top: 0px !important;
}

/* 4. Mobile responsive layout behavior */
@media (max-width: 767px) {
    .s-block--fixed-banner img {
        min-height: 140px !important; /* Prevents the banner from shrinking into a tiny strip */
        object-fit: cover !important; 
        object-position: center !important; /* Keeps the text/focus centered on mobile */
        border-radius: 0px !important;
    }
}

/* ==========================================================================
   RAED THEME - CATEGORY GRID (FULL SIZE PC / 50% COMPACT MOBILE)
   ========================================================================== */

/* 1. Global Wrapper Spacing and Row Alignment */
.grid.md\:grid-cols-3.two-row {
    display: flex !important;
    flex-wrap: wrap !important;
    flex-direction: row !important;
    justify-content: center !important; /* Beautifully centers the 5th box */
    align-items: stretch !important;
    gap: 24px !important;
    max-width: 1200px !important;
    margin: 5rem auto !important; /* Premium margins on top and bottom */
    padding: 0 15px !important;
}

/* 2. Desktop / PC Layout Enforcement (RESTORED TO PREVIOUS FULL SIZE) */
@media (min-width: 768px) {
    .grid.md\:grid-cols-3.two-row .banner-entry {
        display: block !important;
        position: relative !important;
        /* Exact math calculation for 2 items per row with a 24px gap */
        width: calc((100% - 24px) / 2) !important;
        flex: 0 0 calc((100% - 24px) / 2) !important;
        
        /* Restored to full premium height */
        height: 340px !important; 
        min-height: 340px !important;
        
        background-size: cover !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
        border-radius: 14px !important;
        overflow: hidden !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03) !important;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease !important;
    }

    .grid.md\:grid-cols-3.two-row .banner-entry:hover {
        transform: translateY(-6px) !important;
        box-shadow: 0 16px 32px rgba(163, 146, 116, 0.12) !important;
    }
}

/* 3. Universal Text & Overlay Corrections */
.grid.md\:grid-cols-3.two-row .banner-entry::before {
    content: "" !important;
    position: absolute !important;
    inset: 0 !important;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.1) 100%) !important;
    z-index: 1 !important;
    pointer-events: none !important;
}

.grid.md\:grid-cols-3.two-row .banner-entry__text {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    padding: 20px 24px !important;
    text-align: right !important; /* Perfect Arabic orientation */
    z-index: 2 !important;
    box-sizing: border-box !important;
}

.grid.md\:grid-cols-3.two-row .banner__title {
    color: #ffffff !important;
    font-size: 1.45rem !important;
    font-weight: 700 !important;
    margin-bottom: 4px !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

.grid.md\:grid-cols-3.two-row .banner__description {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 0.95rem !important;
    font-weight: 400 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

/* 4. Mobile Layout Preservation (KEEPS 50% HEIGHT REDUCTION) */
@media (max-width: 767px) {
    .grid.md\:grid-cols-3.two-row {
        margin: 2.5rem auto !important;
        gap: 12px !important;
        padding: 0 12px !important;
    }
    
    .grid.md\:grid-cols-3.two-row .banner-entry {
        display: block !important;
        position: relative !important;
        width: calc((100% - 12px) / 2) !important;
        flex: 0 0 calc((100% - 12px) / 2) !important;
        
        /* 2/1 ratio keeps it clean and exactly half-height on mobile screens */
        aspect-ratio: 2 / 1 !important; 
        
        background-size: cover !important;
        background-position: center !important;
        border-radius: 12px !important;
        overflow: hidden;
    }
    
    .grid.md\:grid-cols-3.two-row .banner-entry__text {
        padding: 10px 12px !important;
    }
    
    .grid.md\:grid-cols-3.two-row .banner__title {
        font-size: 1.05rem !important;
    }
    
    .grid.md\:grid-cols-3.two-row .banner__description {
        font-size: 0.72rem !important;
    }
}