/**
 * RTL Homepage Styles for GeneratePress Pro
 * Place in: css/rtl-homepage.css
 */

/* FONT IMPORTS */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;700;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Kufam:wght@700&display=swap');

/* GLOBAL VARIABLES */

.page-template-homepage .grid-container {
	max-width: 100%;
}

.page-template-homepage .site-content .content-area {
	width: 100%;
}

.page-template-homepage .site-main {
	margin: auto;
}

:root {
    --font-family-base: 'Cairo', sans-serif;
    --font-family-title: 'Kufam', sans-serif;
    --color-accent: #d71d4f;
    --brand-color: #0c4668;
    --brand-color-light: #1e628a;
}

/* GLOBAL STYLES */
.rtl-homepage {
    direction: rtl;
    text-align: right;
    font-family: var(--font-family-base);
    width: 100%;
    max-width: 100%;
}

.rtl-homepage .site-main {
    width: 100%;
    max-width: 100%;
}

.rtl-homepage .container {
    max-width: 95%;
    margin: 0 auto;
    padding: 0 20px;
}

.section-spacing {
    margin-bottom: 25px;
}

/* SECTION HEADER STYLE */
.section-heading {
    background: linear-gradient(90deg, var(--brand-color), var(--brand-color-light));
    padding: 20px 30px;
    border-radius: 8px;
    text-align: right;
    box-shadow: 0 5px 20px rgba(12, 70, 104, 0.25);
    margin-bottom: 40px;
}

.section-heading .section-title {
    font-family: var(--font-family-base);
    font-weight: 900;
    direction: rtl;
    color: #fff;
    margin: 0;
    font-size: 1.5rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.section-heading .section-title i {
    color: #fff;
    margin-left: 10px;
}

/* ========================================
   FEATURED POSTS SECTION
======================================== */
.featured-posts-section {
    padding: 15px 0 15px 0;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 7px;
    height: 450px;
}

/* Grid positioning - RTL: 1 large right, 4 stacked left (2x2) */
.featured-card:nth-child(1) { 
    grid-column: 1 / 3; 
    grid-row: 1 / 3; 
}

.featured-card:nth-child(2) { 
    grid-column: 3; 
    grid-row: 1; 
}

.featured-card:nth-child(3) { 
    grid-column: 4; 
    grid-row: 1; 
}

.featured-card:nth-child(4) { 
    grid-column: 3; 
    grid-row: 2; 
}

.featured-card:nth-child(5) { 
    grid-column: 4; 
    grid-row: 2; 
}

/* Featured Card Styles */
.featured-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.featured-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
    position: relative;
}

.featured-posts-section .featured-image {
    position: relative;
    width: 100%;
    height: 100%;
	margin-top: auto;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.featured-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(12, 70, 104, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.featured-content {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    color: white;
    z-index: 2;
    text-align: right;
    direction: rtl;
}

.featured-meta {
    margin-bottom: 10px;
    font-size: 12px;
}

.featured-category {
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 10px;
    border-radius: 4px;
    margin-left: 8px;
    display: inline-block;
}

.featured-title {
    margin: 0;
    background-color: rgb(0 71 112 / 63%);
    padding: 5px;
    border-radius: 11px;
    color: white;
    font-size: 0.90rem;
    font-weight: bold;
    line-height: 1.4;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);

    display: inline-block;      /* shrink-wrap background to text */
    white-space: nowrap;        /* single line */
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;            /* prevent overflow */
    vertical-align: middle;     /* align properly if inline */
    box-sizing: border-box;     /* padding included in width */
}

.featured-large .featured-title,
.featured-card:nth-child(1) .featured-title {
    font-size: 1.4rem;
}

.featured-card:hover .featured-image img {
    transform: scale(1.05);
}

.featured-card:hover .featured-overlay {
    opacity: 1;
}

/* ========================================
   CAROUSEL STYLES
======================================== */
.carousel-container {
    position: relative;
    overflow: hidden;
}

.carousel-wrapper {
    display: flex;
    gap: 20px;
    overflow: hidden;
    padding: 0;
    scroll-behavior: smooth;
}

.carousel-item {
    flex: 0 0 125px;
    background: #ffffff;
    border: 1px solid #e9e9e9;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.carousel-item:hover {
    transform: translateY(-5px);
}

.carousel-image {
    height: 120px;
    overflow: hidden;
}

.carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-content {
    padding: 5px;
    text-align: center;
}

.carousel-category {
    font-size: 12px;
    font-weight: bold;
}

.carousel-category a {
    color: var(--brand-color);
    text-decoration: none;
}

.carousel-title {
    margin: 5px 0 0;
}

.carousel-title a {
    color: #333;
	font-weight: 600;
    text-decoration: none;
    font-size: 13px;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 10;
    width: 80px;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.carousel-container:hover .carousel-arrow {
    opacity: 1;
}

.carousel-arrow.prev {
    right: 0;
    background: radial-gradient(circle at right, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 70%);
}

.carousel-arrow.next {
    left: 0;
    background: radial-gradient(circle at left, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 70%);
}

.carousel-arrow.is-hidden {
    opacity: 0 !important;
    pointer-events: none;
}

/* ========================================
   SOFTWARE GRID STYLES
======================================== */
.software-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.software-card {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.07);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.software-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.1);
}

.software-card__image {
    width: 100%;
    height: 180px;
    object-fit: contain;
}

.software-card__content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.software-card__category {
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 8px;
    display: block;
}

.software-card__category a {
    color: var(--brand-color);
    text-decoration: none;
}

.software-card__title {
    margin-bottom: 10px;
}

.software-card__title a {
    color: #333;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    line-height: 1.4;
}

/* ========================================
   MASONRY GRID FOR REVIEWS
======================================== */
.reviews-masonry-grid {
    column-count: 5;
    column-gap: 20px;
}

.masonry-item {
    width: 100%;
    background: #fff;
    margin-bottom: 20px;
    border-radius: 8px;
    break-inside: avoid;
    text-align: right;
    box-shadow: 0 5px 20px rgba(0,0,0,0.07);
    overflow: hidden;
}

.masonry-item img {
    max-width: 100%;
    display: block;
}

.masonry-item__content {
    padding: 15px;
}

.masonry-item__category {
    font-size: 0.8rem;
    font-weight: bold;
    display: block;
    margin-bottom: 8px;
}

.masonry-item__category a {
    color: var(--brand-color);
    text-decoration: none;
}

.masonry-item__title {
    margin: 0;
}

.masonry-item__title a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
    font-size: 1.1rem;
}

/* ========================================
   ABOUT SECTION
======================================== */

.styled-line {
	border: none;           /* Remove default border */
	height: 4px;            /* Thickness of the line */
	background: linear-gradient(90deg, var(--brand-color), var(--brand-color-light));
	width: 80%;             /* Length of the line */
	margin: 20px auto;      /* Center horizontally with some vertical space */
	border-radius: 2px;     /* Rounded edges */
	box-shadow: 0 0 8px #3498db; /* Glow effect */
}

.about-content {
    background: #fff;
    padding: 30px 40px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.07);
}

.about-content-wrapper {
    max-width: 70%;
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .about-content-wrapper {
        max-width: 80%;
    }
}

@media (max-width: 640px) {
    .about-content-wrapper {
        max-width: 95%;
    }
}

@media (max-width: 480px) {
    .about-content-wrapper {
        max-width: 100%;
        padding: 0 15px;
    }
}

.about-logo {
    text-align: center;
    margin-bottom: 20px;
}

.about-logo img {
	max-width: 200px;
    height: auto;
    background-color: rgb(26 91 130);
    border-radius: 15px;
    padding: 5px 10px;
}

.about-content p {
    font-family: 'Tajawal', sans-serif;
    font-size: 1.2rem;
    line-height: 1.9;
    color: #555;
    margin-bottom: 20px;
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */

/* Tablets */
@media (max-width: 992px) {
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        height: auto;
    }
    
    .featured-card:nth-child(1) { grid-column: 2; grid-row: 1; }
    .featured-card:nth-child(2) { grid-column: 1; grid-row: 1; }
    .featured-card:nth-child(3) { grid-column: 1 / 3; grid-row: 2; }
    .featured-card:nth-child(4) { grid-column: 1 / 3; grid-row: 3; }
    .featured-card:nth-child(5) { grid-column: 2; grid-row: 4; }
    .featured-card:nth-child(6) { grid-column: 1; grid-row: 4; }
    
    .featured-card {
        height: 250px;
    }
    
    .reviews-masonry-grid {
        column-count: 2;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .featured-grid {
        display: flex;
        flex-direction: column;
        height: auto;
    }
    
    .featured-card {
        height: 250px;
        width: 100%;
    }
    
    .carousel-item {
        flex: 0 0 250px;
    }
    
    .software-grid {
        grid-template-columns: 1fr;
    }
    
    .reviews-masonry-grid {
        column-count: 1;
    }
    
    .section-heading .section-title {
        font-size: 1.2rem;
    }
    
    .about-content p {
        font-size: 1.2rem;
    }

    .about-content-wrapper {
        max-width: 90%;
    }
}

/* This is for Jannah theme */

.tie-container #content {
    margin-top: auto;
}