/* ============================================================
   NEWS & EVENTS CSS
   Extends styles.css — uses same CSS variables, patterns & components
   ============================================================ */

/* ============================================================
   SHARED: Page Header Banner (news/events listing pages)
   ============================================================ */
.page-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 7rem 0 4rem;           /* top padding accounts for fixed navbar */
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255,255,255,.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,.1) 0%, transparent 50%);
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 80"><path fill="%23f5f5f5" fill-opacity="1" d="M0,64L80,58.7C160,53,320,43,480,42.7C640,43,800,53,960,53.3C1120,53,1280,43,1360,37.3L1440,32L1440,80L1360,80C1280,80,1120,80,960,80C800,80,640,80,480,80C320,80,160,80,80,80L0,80Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    height: 80px;
}

.page-header h1 {
    font-size: 3rem;
    color: var(--white);
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0,0,0,.3);
    margin-bottom: .8rem;
    animation: fadeInUp .8s ease-out;
}

.page-header p {
    font-size: 1.2rem;
    color: rgba(255,255,255,.9);
    position: relative;
    z-index: 1;
    animation: fadeInUp .8s ease-out .2s both;
}

/* ============================================================
   SHARED: Back Button (detail pages)
   ============================================================ */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: .8rem 1.8rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    margin: 2rem 0;
    transition: all .3s ease;
    box-shadow: var(--shadow);
}

.btn-back:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    color: var(--white);
}

/* ============================================================
   SHARED: Read More Button
   ============================================================ */
.btn-read-more {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    font-size: .95rem;
    transition: all .3s ease;
    padding: .5rem 0;
}

.btn-read-more:hover {
    color: var(--secondary-color);
    gap: .9rem;
}

/* ============================================================
   SHARED: No Records Message
   ============================================================ */
.no-records {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    padding: 3rem;
    grid-column: 1 / -1;
    background: var(--white);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

/* ============================================================
   SHARED: Pagination Wrapper
   ============================================================ */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.pagination-wrapper .pagination {
    gap: .5rem;
}

.pagination-wrapper .page-link {
    border-radius: 10px;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transition: all .3s ease;
}

.pagination-wrapper .page-item.active .page-link,
.pagination-wrapper .page-link:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: transparent;
    color: var(--white);
}

/* ============================================================
   NEWS — HOME PREVIEW SECTION
   ============================================================ */
.news-section {
    padding: 5rem 0;
    background: var(--light);
}

.news-section .section-title {
    margin-bottom: .5rem;
}

/* ============================================================
   NEWS — LISTING PAGE
   ============================================================ */
.news-list-section {
    padding: 3rem 0 5rem;
    background: var(--light);
}

/* ============================================================
   NEWS — CARD (shared between home preview & listing)
   ============================================================ */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.news-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all .3s ease;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

/* Card image */
.news-image {
    width: 100%;
    height: 210px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, rgba(68,41,116,.08), rgba(26,136,68,.08));
}

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

.news-card:hover .news-image img {
    transform: scale(1.06);
}

/* Card body */
.news-body {
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Category pill */
.news-category {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    font-size: .78rem;
    font-weight: 600;
    padding: .3rem .9rem;
    border-radius: 25px;
    margin-bottom: .9rem;
    letter-spacing: .03em;
}

.news-body h4 {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: .7rem;
    line-height: 1.5;
}

.news-body > p {
    color: var(--text-light);
    line-height: 1.75;
    flex: 1;
    margin-bottom: 1.2rem;
}

/* Footer row inside card */
.news-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--light);
    padding-top: 1rem;
    margin-top: auto;
}

.news-footer small {
    color: var(--text-light);
    font-size: .85rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.news-footer small i {
    color: var(--secondary-color);
}

/* ============================================================
   NEWS — DETAIL / ARTICLE PAGE
   ============================================================ */
.news-detail-section {
    padding: 2rem 0 5rem;
    background: var(--light);
}

.news-article,
.event-article {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 3rem;
}

/* Hero image on detail page */
.article-image {
    width: 100%;
    max-height: 450px;
    overflow: hidden;
}

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

/* Article header block */
.article-header {
    padding: 2.5rem 2.5rem 0;
}

.article-header h1 {
    font-size: 2.2rem;
    color: var(--primary-color);
    line-height: 1.4;
    margin: .8rem 0 1rem;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--light);
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--text-light);
    font-size: .95rem;
}

.article-meta span i {
    color: var(--secondary-color);
}

/* Rich text body content */
.article-body {
    padding: 2rem 2.5rem 2.5rem;
    color: var(--text-dark);
    line-height: 1.9;
    font-size: 1.05rem;
}

.article-body p {
    margin-bottom: 1.2rem;
}

.article-body h2,
.article-body h3 {
    color: var(--primary-color);
    margin: 1.8rem 0 .8rem;
}

.article-body ul,
.article-body ol {
    padding-right: 1.5rem;   /* RTL friendly */
    margin-bottom: 1.2rem;
}

.article-body li {
    margin-bottom: .5rem;
}

.article-body img {
    max-width: 100%;
    border-radius: 12px;
    margin: 1.2rem 0;
    box-shadow: var(--shadow);
}

/* ============================================================
   EVENTS — HOME PREVIEW SECTION
   ============================================================ */
.events-section {
    padding: 5rem 0;
    background: var(--white);
}

.events-section .section-title {
    margin-bottom: .5rem;
}

/* ============================================================
   EVENTS — LISTING PAGE
   ============================================================ */
.events-list-section {
    padding: 3rem 0 5rem;
    background: var(--light);
}

/* ============================================================
   EVENTS — CARD (shared between home preview & listing)
   ============================================================ */
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.event-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all .3s ease;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
}

.event-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--secondary-color);
}

/* Card image */
.event-image {
    width: 100%;
    height: 210px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, rgba(26,136,68,.08), rgba(68,41,116,.08));
}

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

.event-card:hover .event-image img {
    transform: scale(1.06);
}

/* Card body */
.event-body {
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.event-body h4 {
    font-size: 1.2rem;
    color: var(--primary-color);
    margin: .6rem 0 .8rem;
    line-height: 1.5;
}

.event-body > p {
    color: var(--text-light);
    line-height: 1.75;
    flex: 1;
    margin-bottom: 1.2rem;
}

/* Status badge */
.event-badge {
    display: inline-block;
    font-size: .78rem;
    font-weight: 700;
    padding: .3rem .9rem;
    border-radius: 25px;
    letter-spacing: .04em;
    margin-bottom: .3rem;
}

.badge-primary {
    background: linear-gradient(135deg, var(--primary-color), #6b3fa0);
    color: var(--white);
}

.badge-success {
    background: linear-gradient(135deg, var(--secondary-color), #25a556);
    color: var(--white);
}

.badge-secondary {
    background: #9e9e9e;
    color: var(--white);
}

/* Meta row (date / time / location) */
.event-meta {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--light);
    border-radius: 12px;
}

.event-meta span {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--text-light);
    font-size: .9rem;
}

.event-meta span i {
    color: var(--secondary-color);
    width: 14px;
    text-align: center;
}

/* ============================================================
   EVENTS — DETAIL PAGE
   ============================================================ */
.event-detail-section {
    padding: 2rem 0 5rem;
    background: var(--light);
}

/* Info bar below the article header (date / time / location) */
.event-info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1.2rem 1.5rem;
    background: linear-gradient(135deg, rgba(68,41,116,.06), rgba(26,136,68,.06));
    border-radius: 14px;
    margin: 1rem 0 1.5rem;
    border-right: 4px solid var(--secondary-color);   /* RTL accent */
}

.event-info-bar span {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--text-dark);
    font-size: .95rem;
    font-weight: 500;
}

.event-info-bar span i {
    color: var(--secondary-color);
    font-size: 1rem;
}

/* Register CTA box */
.event-register-box {
    padding: 2rem 2.5rem 2.5rem;
    border-top: 2px solid var(--light);
    display: flex;
    justify-content: center;
}

.btn-lg {
    padding: 1.1rem 3rem;
    font-size: 1.1rem;
    border-radius: 30px;
}

/* ============================================================
   RESPONSIVE — MOBILE
   ============================================================ */
@media (max-width: 768px) {
    .page-header {
        padding: 6rem 0 3rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .news-grid,
    .events-grid {
        grid-template-columns: 1fr;
    }

    .news-image,
    .event-image {
        height: 180px;
    }

    .article-header {
        padding: 1.5rem 1.5rem 0;
    }

    .article-header h1 {
        font-size: 1.6rem;
    }

    .article-body {
        padding: 1.5rem;
    }

    .article-meta,
    .event-info-bar {
        flex-direction: column;
        gap: .8rem;
    }

    .event-register-box {
        padding: 1.5rem;
    }

    .btn-lg {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================================
   LTR OVERRIDES (English layout)
   [html[dir="ltr"]] flips directional styles
   ============================================================ */
html[dir="ltr"] .info-item:hover {
    transform: translateX(5px);
}

html[dir="ltr"] .contact-item:hover {
    transform: translateX(5px);
}

html[dir="ltr"] .event-info-bar {
    border-right: none;
    border-left: 4px solid var(--secondary-color);
}

html[dir="ltr"] .footer-section ul li a:hover {
    margin-right: 0;
    margin-left: 5px;
}

html[dir="ltr"] .article-body ul,
html[dir="ltr"] .article-body ol {
    padding-right: 0;
    padding-left: 1.5rem;
}
