/* =========================================================
   Danat Al Uloom Private School — main stylesheet
   Matches the Glory International Schools homepage template.
   Logical properties (inline-start/end) so ?lang=ar mirrors to RTL.
   ========================================================= */
:root {
    --header-h: 85px;
    --gold: #d4a017;            /* logo text / accents */
    --text: #444;
    --heading: #333;
    --link: #1aa1e1;            /* survey link */
    --footer-bg: #1d1d1d;
    --footer-bottom: #1a1a1a;
    --footer-link: #3cb1d4;
    --cal-red: #990000;
    --cal-gold: #f7c35f;
    --cal-num: #663399;
    --cal-other: #b8864e;
    --sans: Arial, Helvetica, sans-serif;
    --body: 'Open Sans', Arial, sans-serif;
    --serif: Georgia, 'Times New Roman', serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--body);
    font-size: 16px;
    line-height: 30px;
    color: var(--text);
    background: #fff;
    overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; transition: color .2s ease; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 15px; }

/* ================= HEADER ================= */
.site-header {
    position: fixed;
    top: 0;
    inset-inline: 0;
    z-index: 1000;
    height: var(--header-h);
    background: rgba(255, 255, 255, .7);
    transition: background .3s ease, box-shadow .3s ease;
}
.site-header.scrolled,
body.inner .site-header {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}
body.inner .site-main { padding-top: var(--header-h); }

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-inline: 35px 60px;
}

.logo { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.logo-emblem { width: 100%;
    height: 100%; object-fit: contain; }
.logo-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: var(--serif);
    font-weight: 700;
    color: var(--gold);
    line-height: 1.35;
    margin-top: -6px;
}
.logo-en { font-size: 13px; letter-spacing: -.2px; }
.logo-ar { font-size: 13px; font-family: Tahoma, Arial, sans-serif; }
.logo-short { font-size: 15px; margin-top: 2px; }

.menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; }
.menu > li { position: relative; }
.menu-link {
    display: flex;
    align-items: center;
    gap: 9px;
    height: var(--header-h);
    padding-inline: 8.5px;
    font-family: var(--sans);
    font-size: 16px;
    color: #333;
    white-space: nowrap;
}
.menu-link i { font-size: 11px; color: #333; }
.menu > li:hover > .menu-link,
.menu > li:hover > .menu-link i { color: var(--gold); }

.sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 100%;
    inset-inline-start: 0;
    min-width: 230px;
    background: #fff;
    border-top: 3px solid var(--gold);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}
.menu > li:hover > .sub-menu,
.menu > li:focus-within > .sub-menu { opacity: 1; visibility: visible; }
.sub-menu a {
    display: block;
    padding: 7px 20px;
    font-family: var(--sans);
    font-size: 14px;
    line-height: 22px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}
.sub-menu li:last-child a { border-bottom: 0; }
.sub-menu a:hover { background: #f8f8f8; color: var(--gold); }
.menu > li:nth-last-child(-n+2) > .sub-menu { inset-inline-start: auto; inset-inline-end: 0; }

.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: none;
    border: 0;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 0;
}
.nav-toggle span { display: block; width: 26px; height: 2px; background: #333; transition: .3s ease; }
.nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.nav-overlay { display: none; }

/* ================= HERO SLIDER ================= */
.hero-slider {
    position: relative;
    height: 44vw;
    max-height: 100vh;
    min-height: 260px;
    overflow: hidden;
    background: #222;
}
.slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease;
}
.slide.active { opacity: 1; }
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 40px;
    height: 40px;
    border: 0;
    background: rgba(0, 0, 0, .5);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    opacity: 0;
    transition: opacity .3s ease, background .3s ease;
}
.hero-slider:hover .slider-arrow { opacity: 1; }
.slider-arrow:hover { background: #000; }
.slider-arrow.prev { left: 20px; }
.slider-arrow.next { right: 20px; }

/* ================= ABOUT ================= */
.about-section { padding: 30px 0 60px; }
.about-section .container { max-width: 1200px; }
.about-title {
    font-family: var(--sans);
    font-size: 40px;
    line-height: 1.2;
    color: var(--heading);
    text-align: center;
    text-transform: uppercase;
    margin-bottom: 25px;
}
.about-section p { margin: 0 0 20px; text-align: justify; }
.survey-note { color: #333; }
.survey-note a { color: var(--link); }
.survey-note a:hover { color: #0b7cb5; }

/* ================= CHAIRMAN ================= */
.chairman-section { background: #000; padding: 30px 0 35px; }
.chairman-inner {
    display: grid;
    grid-template-columns: 1fr 480px;
    gap: 135px;
    align-items: start;
    padding-inline: 105px 25px;
}
.chairman-title {
    font-family: var(--sans);
    font-size: 40px;
    line-height: 1.2;
    color: #fff;
    text-align: center;
    text-transform: uppercase;
    margin: 18px 0 25px;
}
.chairman-text p {
    font-family: var(--sans);
    font-size: 16px;
    line-height: 30px;
    color: #ddd;
    text-align: justify;
    margin: 0 0 15px;
}
.chairman-photo img { width: 100%; height: auto; }

/* ================= SIX BOXES ================= */
.boxes-section { padding: 90px 15px 40px; }
.boxes-grid {
    max-width: 1165px;
    margin-inline: auto;
    display: grid;
    grid-template-columns: repeat(3, 350px);
    justify-content: space-between;
    row-gap: 40px;
}
.home-box {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 350 / 220;
    overflow: hidden;
    background: #ddd;
}
.home-box img { width: 100%; height: 100%; object-fit: cover; }
.box-caption {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(40, 32, 60, .72);
    font-family: var(--serif);
    font-weight: 700;
    font-size: 34px;
    letter-spacing: .5px;
    color: #e3cc8f;
    text-shadow: 1px 2px 2px rgba(0, 0, 0, .8);
    white-space: nowrap;
    transition: background .3s ease;
}
.home-box:hover .box-caption { background: rgba(40, 32, 60, .88); }

/* ================= ACCREDITATION ================= */
.accreditation-section { padding: 0 30px 5px; }
.accreditation-title {
    font-family: var(--sans);
    font-size: 40px;
    line-height: 1.2;
    color: #222;
    margin-bottom: 20px;
}
.accreditation-row {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}
.acc-item { width: 263px; aspect-ratio: 263 / 175; }
.acc-item img { width: 100%; height: 100%; object-fit: contain; }

/* ================= FOOTER ================= */
.site-footer { color: #fff; font-family: var(--body); }
.footer-widgets {
    padding: 95px 0 40px;
    background:
        linear-gradient(rgba(29, 29, 29, .93), rgba(29, 29, 29, .93)),
        url('../img/footer-bg.jpg') center / cover no-repeat;
}
.footer-grid {
    display: grid;
    grid-template-columns: 350px 445px 1fr;
    column-gap: 30px;
    padding-inline: 8.7vw 6vw;
}
.footer-grid > .footer-col:nth-child(2) { margin-inline-start: 48px; }
.sew-login img { width: 350px; max-width: 100%; height: auto; }

/* Calendar (white box, table inside, like the template) */
.calendar-box { background: #fff; padding: 2px; width: 445px; max-width: 100%; }
.calendar {
    width: 326px;
    max-width: 100%;
    border-collapse: collapse;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 11px;
    text-align: center;
}
.cal-head th { background: var(--cal-red); color: #fff; height: 46px; font-size: 13px; font-weight: 700; }
.cal-head .cal-nav { color: #fff; font-size: 15px; font-weight: 700; display: block; }
.cal-head .cal-nav:hover { color: var(--cal-gold); }
.cal-days th { background: var(--cal-gold); color: #333; font-weight: 700; height: 25px; }
.calendar td {
    height: 40px;
    border: 1px solid #ddd;
    color: var(--cal-num);
}
.calendar td.other { color: var(--cal-other); }
.calendar td.today { background: var(--cal-gold); color: #fff; }

/* Contact list */
.contact-list { list-style: none; margin: 8px 0 0; padding: 0; }
.contact-list li {
    display: grid;
    grid-template-columns: 22px 1fr;
    column-gap: 25px;
    margin-bottom: 14px;
}
.contact-list p { margin: 0; font-size: 14px; line-height: 24px; text-align: center; }
.contact-list a { color: #fff; }
.contact-list a:hover { color: var(--footer-link); }
.contact-list .mail-link { color: var(--footer-link); }
.c-icon {
    width: 22px;
    height: 22px;
    margin-top: 2px;
    border-radius: 50%;
    background: #3a3a3a;
    border: 1px solid #4a4a4a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #fff;
}
.c-icon-mail { background: #6b6e3c; border-color: #7d8046; }

.footer-copyright { background: var(--footer-bottom); border-top: 1px solid #333; padding: 20px 0; }
.copyright-inner {
    padding-inline: 16.6vw 6vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.copyright-inner p { margin: 0; font-size: 13px; line-height: 20px; color: #fff; }
.copyright-inner p a { color: var(--footer-link); }
.social { display: flex; gap: 10px; }
.social a {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    transition: opacity .2s ease;
}
.social a:hover { opacity: .85; color: #fff; }
.s-fb { background: #3b5998; }
.s-tw { background: #55acee; }
.s-ig { background: #3f729b; }
.s-yt { background: #cd201f; }

/* Mail login tab */
.mail-login-tab {
    position: fixed;
    bottom: 0;
    inset-inline-end: 8px;
    z-index: 900;
    background: rgba(60, 60, 60, .92);
    color: #fff;
    font-family: var(--body);
    font-size: 16px;
    line-height: 1;
    padding: 7px 22px 8px;
    border-radius: 6px 6px 0 0;
}
.mail-login-tab:hover { background: #222; color: #fff; }

/* ================= RESPONSIVE ================= */
@media (max-width: 1400px) {
    .footer-grid { padding-inline: 30px; justify-content: space-between; }
    .footer-grid > .footer-col:nth-child(2) { margin-inline-start: 0; }
    .copyright-inner { padding-inline: 30px; }
    .chairman-inner { padding-inline: 60px 25px; gap: 60px; }
}

@media (max-width: 1250px) {
    .boxes-grid { grid-template-columns: repeat(3, 1fr); column-gap: 30px; }
    .box-caption { font-size: clamp(20px, 2.6vw, 34px); }
    .footer-grid { grid-template-columns: 1fr 1fr; row-gap: 40px; }
    .footer-col:last-child { grid-column: 1 / -1; max-width: 520px; justify-self: center; width: 100%; }
}

@media (max-width: 1150px) {
    .header-inner { padding-inline: 20px; }
    .nav-toggle { display: flex; }
    .main-nav {
        position: fixed;
        top: 0;
        inset-inline-end: 0;
        width: 300px;
        max-width: 85vw;
        height: 100vh;
        background: #fff;
        overflow-y: auto;
        z-index: 1100;
        padding-top: 20px;
        box-shadow: 0 0 20px rgba(0, 0, 0, .25);
        transform: translateX(105%);
        transition: transform .3s ease;
    }
    [dir="rtl"] .main-nav { transform: translateX(-105%); }
    .main-nav.open { transform: translateX(0) !important; }
    .nav-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1050;
        background: rgba(0, 0, 0, .5);
        opacity: 0;
        visibility: hidden;
        transition: .3s ease;
    }
    .nav-overlay.show { opacity: 1; visibility: visible; }
    body.nav-open { overflow: hidden; }
    body.nav-open .site-header { z-index: 1200; }

    .menu { flex-direction: column; align-items: stretch; }
    .menu-link {
        height: auto;
        justify-content: space-between;
        padding: 13px 22px;
        border-bottom: 1px solid #eee;
    }
    .sub-menu,
    .menu > li:nth-last-child(-n+2) > .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        border-top: 0;
        background: #f7f7f7;
        max-height: 0;
        overflow: hidden;
        transition: max-height .35s ease;
    }
    .menu > li.open > .sub-menu { max-height: 600px; }
    .menu > li.open > .menu-link i { transform: rotate(180deg); }
    .sub-menu a { padding-inline-start: 36px; }
}

@media (max-width: 991px) {
    .chairman-inner { grid-template-columns: 1fr; gap: 25px; padding-inline: 20px; }
    .chairman-photo { max-width: 480px; margin-inline: auto; }
    .boxes-section { padding-top: 60px; }
    .boxes-grid { grid-template-columns: repeat(2, 1fr); gap: 25px; }
    .box-caption { font-size: clamp(20px, 3.6vw, 32px); }
    .copyright-inner { flex-direction: column; text-align: center; padding-inline: 15px; }
    .footer-grid { padding-inline: 15px; }
}

@media (max-width: 767px) {
    :root { --header-h: 72px; }
    .logo-emblem { width: 60px; height: 60px; }
    .logo-en, .logo-ar { font-size: 11px; }
    .logo-short { font-size: 13px; }
    .about-title, .chairman-title, .accreditation-title { font-size: 28px; }
    .about-section p, .chairman-text p { font-size: 15px; line-height: 27px; }
    .accreditation-section { padding-inline: 15px; }
    .acc-item { width: calc(50% - 15px); }
    .footer-widgets { padding-top: 60px; }
    .footer-grid { grid-template-columns: 1fr; justify-items: center; }
    .footer-col { width: 100%; display: flex; justify-content: center; }
    .calendar { width: 100%; }
    .calendar-box { width: 100%; max-width: 445px; }
    .social a { width: 46px; height: 46px; font-size: 18px; }
}

@media (max-width: 575px) {
    .boxes-grid { grid-template-columns: 1fr; max-width: 400px; }
    .box-caption { font-size: 28px; height: 50px; }
    .mail-login-tab { font-size: 14px; padding: 6px 16px; }
}

/* =========================================================
   ADDITIONS — language switch, active menu, inner pages
   ========================================================= */

/* Arabic font */
[dir="rtl"] body,
[dir="rtl"] .menu-link,
[dir="rtl"] .sub-menu a,
[dir="rtl"] .about-title,
[dir="rtl"] .chairman-title,
[dir="rtl"] .chairman-text p,
[dir="rtl"] .accreditation-title,
[dir="rtl"] .box-caption,
[dir="rtl"] .media-caption,
[dir="rtl"] .page-banner-title { font-family: 'Cairo', Tahoma, sans-serif; }
[dir="rtl"] .about-section p,
[dir="rtl"] .chairman-text p { line-height: 32px; }
[dir="rtl"] .back-link i,
[dir="rtl"] .breadcrumb .sep i,
[dir="rtl"] .slider-arrow i,
[dir="rtl"] .lb-prev i,
[dir="rtl"] .lb-next i { transform: scaleX(-1); }

/* Active menu item */
.menu > li.is-active > .menu-link,
.menu > li.is-active > .menu-link i { color: var(--gold); }
.sub-menu a.is-active { color: var(--gold); background: #faf6ea; font-weight: 600; }

/* Language switch (last menu item) */
.lang-item { margin-inline-start: 10px; }
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 13px;
    border: 1px solid var(--gold);
    border-radius: 3px;
    color: #333;
    font-family: 'Cairo', var(--sans);
    font-size: 14px;
    line-height: 1.4;
    white-space: nowrap;
}
.lang-switch i { color: var(--gold); }
.lang-switch:hover { background: var(--gold); color: #fff; }
.lang-switch:hover i { color: #fff; }

/* ---------- Page banner ---------- */
.page-banner {
    background:
        linear-gradient(rgba(0, 0, 0, .78), rgba(0, 0, 0, .78)),
        url('../img/footer-bg.jpg') center / cover no-repeat;
    color: #fff;
    padding: 45px 0 38px;
    text-align: center;
}
.page-banner-title {
    font-family: var(--sans);
    font-size: 40px;
    line-height: 1.2;
    text-transform: uppercase;
    color: #fff;
    margin-bottom: 12px;
}
.breadcrumb { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; font-size: 14px; line-height: 1.6; }
.breadcrumb a { color: #e3cc8f; }
.breadcrumb a:hover { color: #fff; }
.breadcrumb .sep { color: #888; font-size: 11px; }
.breadcrumb .current { color: #ddd; }

.inner-section { padding: 60px 0 70px; }
.empty-note {
    text-align: center;
    color: #777;
    background: #f7f7f7;
    border: 1px dashed #ddd;
    padding: 40px 20px;
    margin: 0;
}
.empty-note i { color: var(--gold); margin-inline-end: 6px; }
.empty-note a { color: var(--link); }

/* ---------- Vision & Mission ---------- */
.vm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 25px;
}
.vm-title {
    font-family: var(--sans);
    font-size: 24px;
    color: var(--heading);
    text-transform: uppercase;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--gold);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.vm-title i { color: var(--gold); font-size: 20px; }
.vm-item p { margin: 0; text-align: justify; }

.vm-section { padding: 50px 0 70px; }
.vm-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 35px; margin-top: 10px; }
.vm-card {
    position: relative;
    background: #fff;
    border: 1px solid #e6e6e6;
    border-top: 4px solid var(--gold);
    padding: 45px 35px 35px;
    text-align: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .05);
}
.vm-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: #000;
    color: var(--gold);
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.vm-card-title {
    font-family: var(--sans);
    font-size: 28px;
    color: var(--heading);
    text-transform: uppercase;
    margin-bottom: 15px;
}
.vm-card p { margin: 0; text-align: justify; }

/* ---------- Back bar (folder / album name with arrow) ---------- */
.back-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--sans);
    font-size: 24px;
    color: var(--heading);
}
.back-link i {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #000;
    color: var(--gold);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .2s ease, color .2s ease;
}
.back-link:hover { color: var(--gold); }
.back-link:hover i { background: var(--gold); color: #fff; }
.back-sub { color: #888; font-size: 14px; }
.back-sub i { color: var(--gold); }

/* ---------- Folder / album / video cards (template box style) ---------- */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 35px 30px;
}
.media-card { display: block; color: inherit; }
.media-thumb {
    position: relative;
    display: block;
    aspect-ratio: 350 / 220;
    overflow: hidden;
    background: #ddd;
}
.media-thumb img,
.media-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; pointer-events: none; }
.media-card:hover .media-thumb img,
.media-card:hover .media-thumb video { transform: scale(1.06); }
.media-caption {
    display: block;
    background: rgba(40, 32, 60, .92);
    color: #e3cc8f;
    font-family: var(--serif);
    font-weight: 700;
    font-size: 20px;
    line-height: 1.35;
    text-align: center;
    padding: 12px 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background .3s ease;
}
.media-card:hover .media-caption { background: #28203c; }
.media-badge {
    position: absolute;
    top: 10px;
    inset-inline-start: 10px;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    padding: 6px 10px;
    border-radius: 3px;
}
.media-badge i { color: var(--gold); margin-inline-end: 3px; }
.media-badge.yt i { color: #ff3b3b; }
.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .6);
    border: 2px solid #fff;
    color: #fff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 4px;
    transition: background .3s ease, transform .3s ease;
}
.video-card:hover .play-btn { background: var(--gold); transform: translate(-50%, -50%) scale(1.08); }

/* ---------- Photos inside an album ---------- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}
.photo-item {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #eee;
}
.photo-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.photo-zoom {
    position: absolute;
    inset: 0;
    background: rgba(40, 32, 60, .55);
    color: #fff;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .3s ease;
}
.photo-item:hover img { transform: scale(1.08); }
.photo-item:hover .photo-zoom,
.photo-item:focus-visible .photo-zoom { opacity: 1; }

/* ---------- Lightbox (photos + videos) ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, .92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 70px;
}
.lightbox[hidden] { display: none; }
.lb-stage { max-width: 100%; max-height: 100%; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 0 30px rgba(0, 0, 0, .6); }
.lb-stage .lb-video { width: min(1100px, 100%); aspect-ratio: 16 / 9; max-height: 100%; background: #000; }
.lb-stage .lb-video iframe,
.lb-stage .lb-video video { width: 100%; height: 100%; border: 0; display: block; }
.lb-stage video.lb-portrait { width: auto; height: 100%; max-width: 100%; margin-inline: auto; }
.lb-close, .lb-prev, .lb-next {
    position: absolute;
    background: none;
    border: 0;
    color: #fff;
    cursor: pointer;
    transition: color .2s ease;
}
.lb-close { top: 10px; right: 20px; font-size: 44px; line-height: 1; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); font-size: 34px; width: 50px; height: 70px; }
.lb-prev { left: 10px; }
.lb-next { right: 10px; }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { color: var(--gold); }
.lb-caption {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    text-align: center;
    color: #ddd;
    font-size: 15px;
    padding-inline: 20px;
}
body.lb-open { overflow: hidden; }

/* ---------- News ---------- */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}
.news-card {
    display: flex;
    flex-direction: column;
    height: 560px;                 /* every card the same size */
    background: #fff;
    border: 1px solid #e6e6e6;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .05);
    transition: box-shadow .3s ease, transform .3s ease;
}
.news-card:hover { box-shadow: 0 10px 26px rgba(0, 0, 0, .1); transform: translateY(-3px); }
.news-image { position: relative; height: 220px; flex-shrink: 0; overflow: hidden; background: #eee; }
.news-image img { width: 100%; height: 100%; object-fit: cover; }
.news-date {
    position: absolute;
    bottom: 0;
    inset-inline-start: 0;
    background: rgba(40, 32, 60, .92);
    color: #e3cc8f;
    font-size: 13px;
    line-height: 1;
    padding: 9px 14px;
}
.news-body { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 20px 22px 22px; }
.news-title {
    font-family: var(--sans);
    font-size: 19px;
    line-height: 1.4;
    color: var(--heading);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;                 /* always two lines tall */
    flex-shrink: 0;
}
[dir="rtl"] .news-title { font-family: 'Cairo', Tahoma, sans-serif; }
.news-desc {
    flex: 1;
    min-height: 0;
    overflow-y: auto;              /* scroll up/down to read the full text */
    font-size: 15px;
    line-height: 26px;
    color: #555;
    padding-inline-end: 8px;
    padding-top: 12px;
    border-top: 2px solid var(--gold);
    scrollbar-width: thin;
    scrollbar-color: var(--gold) #f1f1f1;
}
.news-desc::-webkit-scrollbar { width: 6px; }
.news-desc::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
.news-desc::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }
.news-desc p { margin: 0 0 10px; }
.news-desc:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Contact ---------- */
.contact-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-bottom: 55px; }
.contact-card {
    background: #1d1d1d;
    color: #ddd;
    text-align: center;
    padding: 35px 25px 30px;
    border-bottom: 4px solid var(--gold);
}
.contact-card h3 { color: #fff; font-family: var(--sans); font-size: 21px; margin-bottom: 10px; }
[dir="rtl"] .contact-card h3 { font-family: 'Cairo', Tahoma, sans-serif; }
.contact-card p { margin: 0; font-size: 15px; line-height: 27px; }
.contact-card a { color: #fff; }
.contact-card a:hover { color: var(--gold); }
.cc-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 15px;
    border-radius: 50%;
    border: 2px solid var(--gold);
    color: var(--gold);
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; align-items: start; }
.contact-layout.no-map { grid-template-columns: minmax(0, 860px); justify-content: center; }
.section-heading { font-family: var(--sans); font-size: 30px; color: var(--heading); margin-bottom: 22px; }
.contact-layout.no-map .section-heading { text-align: center; }
[dir="rtl"] .section-heading { font-family: 'Cairo', Tahoma, sans-serif; }

.contact-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; color: #333; margin-bottom: 6px; line-height: 1.4; }
.form-group .req { color: #c0392b; }
.form-group input,
.form-group textarea {
    width: 100%;
    font-family: inherit;
    font-size: 15px;
    color: #333;
    background: #fafafa;
    border: 1px solid #ddd;
    border-radius: 2px;
    padding: 11px 14px;
    transition: border-color .2s ease, background .2s ease;
}
[dir="rtl"] .form-group input[dir="ltr"] { text-align: right; }
.form-group textarea { resize: vertical; min-height: 140px; line-height: 1.6; }
.form-group input:focus,
.form-group textarea:focus { outline: none; border-color: var(--gold); background: #fff; }
.form-group.has-error input,
.form-group.has-error textarea { border-color: #c0392b; background: #fff8f7; }
.field-error { display: block; color: #c0392b; font-size: 13px; line-height: 1.5; margin-top: 5px; }
.hp-field { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.btn-send {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #000;
    color: #fff;
    border: 0;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    padding: 13px 34px;
    cursor: pointer;
    transition: background .2s ease;
}
.btn-send i { color: var(--gold); transition: color .2s ease; }
.btn-send:hover { background: var(--gold); }
.btn-send:hover i { color: #fff; }
.btn-send[disabled] { opacity: .6; cursor: wait; }
.alert { padding: 13px 16px; margin-bottom: 20px; font-size: 15px; line-height: 1.6; border-inline-start: 4px solid; }
.alert-success { background: #edf7ee; color: #24683a; border-color: #2e8b4a; }
.alert-error { background: #fdf0ef; color: #a5281b; border-color: #c0392b; }
.contact-map iframe { width: 100%; height: 470px; border: 0; display: block; }

/* ---------- Responsive (additions) ---------- */
@media (max-width: 1150px) {
    .lang-item { margin: 0; padding: 18px 22px; }
    .lang-switch { padding: 7px 16px; }
}
@media (max-width: 991px) {
    .vm-grid, .vm-cards { grid-template-columns: 1fr; gap: 30px; }
    .contact-cards { grid-template-columns: 1fr 1fr; }
    .contact-layout { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
    .page-banner { padding: 32px 0 28px; }
    .page-banner-title { font-size: 28px; }
    .inner-section, .vm-section { padding: 40px 0 50px; }
    .vm-card { padding: 35px 22px 25px; }
    .vm-card-title { font-size: 24px; }
    .back-link { font-size: 20px; }
    .media-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 25px 20px; }
    .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .news-grid { grid-template-columns: 1fr; }
    .news-card { height: 540px; }
    .contact-cards { grid-template-columns: 1fr; gap: 20px; }
    .contact-form .form-row { grid-template-columns: 1fr; gap: 0; }
    .section-heading { font-size: 25px; }
    .lightbox { padding: 55px 10px; }
    .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; }
    .lb-caption { bottom: 25px; padding-inline: 70px; }
}
.hero-slider .slider-arrow {
    display: none !important;
}
.video-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 15px;         
    background: #fff;
}

.school-video {
    display: block;
    width: auto;               
    height: auto;
    max-width: 100%;            
    max-height: 80vh;         
    border-radius: 8px;        
    box-shadow: 0 8px 30px rgba(0,0,0,.15);
}
/* =========================================================
   Danat Al Uloom — responsive fixes (paste at the END of assets/css/style.css)
   ========================================================= */

/* ---------- Homepage hero (index.php uses .hero-slider with one image) ---------- */
.hero-slider {
    position: relative;
    height: 44vw;
    max-height: 100vh;
    min-height: 300px;
    overflow: hidden;
    background: #222;
}
.hero-slider .slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease;
}
.hero-slider .slide.active { opacity: 1; }
/* Only one image now, so the arrows have nothing to do */
.hero-slider .slider-arrow { display: none !important; }

/* ---------- Homepage video ---------- */
.video-section:has(.school-video) {
    display: flex;
    justify-content: center;
    padding: 50px 20px;
    background: #f5f3f9;
}
.school-video {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 80vh;            /* tall phone videos never fill more than the screen */
    margin: 0 auto;
    background: #000;
    border-radius: 14px;
    border-bottom: 4px solid var(--gold);
    box-shadow: 0 20px 45px -18px rgba(40, 32, 60, .5);
    object-fit: contain;
}

/* ---------- Footer: map and "Get directions" under the contact details ---------- */
.footer-col:last-child { flex-direction: column; align-items: center; }
.footer-col:last-child .contact-list,
.footer-col:last-child .footer-map { width: 100%; }

/* Comfortable tap size for small links */
.map-directions,
.cc-directions {
    min-height: 44px;
    padding: 0 6px;
}

/* ---------- Phones and small tablets ---------- */
@media (max-width: 767px) {
    .hero-slider { height: 62vw; min-height: 240px; }
    .video-section:has(.school-video) { padding: 30px 14px; }
    .school-video { max-height: 75vh; border-radius: 10px; }

    /* Footer calendar: larger numbers and arrows */
    .calendar { font-size: 13px; }
    .cal-head th { height: 50px; font-size: 15px; }
    .cal-head .cal-nav {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        font-size: 18px;
    }
    .calendar td { height: 42px; }
    .cal-days th { height: 30px; }

    /* Footer map a bit shorter on phones */
    .footer-map iframe { height: 190px; }

    /* Form fields: 16px stops iPhones from zooming in when a field is tapped */
    .form-group input,
    .form-group textarea { font-size: 16px; }
    .btn-send { width: 100%; justify-content: center; min-height: 48px; }

    /* Long emails / links never push the page sideways */
    .contact-card p,
    .contact-list p { overflow-wrap: anywhere; }

    /* Menu drawer: bigger tap rows */
    .menu-link { min-height: 48px; }
    .lang-switch { min-height: 44px; padding: 8px 18px; }
}

@media (max-width: 400px) {
    .hero-slider { min-height: 210px; }
    .about-title, .chairman-title, .page-banner-title { font-size: 24px; }
    .contact-card { padding: 28px 18px 24px; }
}

/* Landscape phones: keep the hero and video inside the screen */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-slider { height: 100vh; min-height: 0; }
    .school-video { max-height: 85vh; }
}
