/* =========================================================
   الموقع الإلكتروني للمدرسة — تصميم عصري نظيف
   الألوان والخط يتم تعيينهم من لوحة التحكم عبر المتغيرات
   ========================================================= */
:root {
    --primary: #0f766e;
    --secondary: #f59e0b;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #ffffff;
    --soft: #f8fafc;
    --radius: 18px;
    --shadow: 0 10px 30px rgba(15, 23, 42, .07);
    --font: 'Tajawal', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.8; font-size: 16px; }
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .5em; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.section { padding: 84px 0; }
.section.soft { background: var(--soft); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.section-head h2 { font-size: clamp(26px, 3.2vw, 38px); font-weight: 800; }
.section-head p { color: var(--muted); font-size: 18px; margin: 0; }
.eyebrow { display: inline-block; color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, white); padding: 4px 14px; border-radius: 99px; font-weight: 700; font-size: 14px; margin-bottom: 12px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 26px; border-radius: 99px; font-weight: 800; font-family: inherit; font-size: 16px; border: 2px solid transparent; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--secondary); color: #1f1300; box-shadow: 0 8px 20px color-mix(in srgb, var(--secondary) 35%, transparent); }
.btn-dark { background: var(--primary); color: #fff; }
.btn-ghost { border-color: rgba(255,255,255,.7); color: #fff; }
.btn-outline { border-color: var(--primary); color: var(--primary); background: transparent; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 800; font-size: 18px; }
.brand img { height: 48px; width: auto; }
.brand .logo-fallback { width: 46px; height: 46px; border-radius: 14px; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: 26px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--ink); font-weight: 600; padding: 8px 12px; border-radius: 10px; }
.nav a:hover, .nav a.active { background: var(--soft); color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.lang-switch { font-weight: 700; color: var(--muted); padding: 8px 10px; }
.dropdown { position: relative; }
.dropdown > button { background: none; border: 1px solid var(--line); border-radius: 99px; padding: 9px 16px; font-family: inherit; font-weight: 700; cursor: pointer; color: var(--ink); display: flex; gap: 6px; align-items: center; }
.dropdown-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); min-width: 190px; padding: 8px; display: none; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a { display: flex; gap: 8px; align-items: center; color: var(--ink); padding: 9px 12px; border-radius: 10px; font-weight: 600; }
.dropdown-menu a:hover { background: var(--soft); color: var(--primary); }
.menu-toggle { display: none; background: none; border: 0; font-size: 30px; color: var(--ink); cursor: pointer; }

/* ---------- Hero ---------- */
.hero { position: relative; color: #fff; background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 60%, #0f172a)); overflow: hidden; }
.hero.has-image { background-size: cover; background-position: center; }
.hero.has-image::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15,23,42,.35), rgba(15,23,42,.75)); }
[dir="ltr"] .hero.has-image::before { background: linear-gradient(270deg, rgba(15,23,42,.35), rgba(15,23,42,.75)); }
.hero .container { position: relative; padding-top: 110px; padding-bottom: 120px; }
.hero-content { max-width: 640px; }
.hero h1 { font-size: clamp(32px, 5vw, 56px); font-weight: 900; margin-bottom: 18px; }
.hero p { font-size: clamp(17px, 2vw, 20px); opacity: .92; margin-bottom: 30px; }
.hero .tagline { display: inline-block; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); padding: 5px 16px; border-radius: 99px; font-weight: 700; margin-bottom: 18px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-shape { position: absolute; inset-inline-start: -120px; bottom: -160px; width: 420px; height: 420px; border-radius: 50%; background: rgba(255,255,255,.07); }

/* ---------- Stats ---------- */
.stats-wrap { margin-top: -54px; position: relative; z-index: 2; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; gap: 10px; }
.stat { text-align: center; padding: 8px; border-inline-end: 1px solid var(--line); }
.stat:last-child { border: 0; }
.stat i { font-size: 30px; color: var(--primary); }
.stat .num { font-size: 34px; font-weight: 900; color: var(--ink); line-height: 1.2; }
.stat .label { color: var(--muted); font-weight: 600; }

/* ---------- Cards grid ---------- */
.grid { display: grid; gap: 22px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card .icon { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; font-size: 30px; color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, white); margin-bottom: 16px; }
.card h3 { font-size: 20px; font-weight: 800; }
.card p { color: var(--muted); margin: 0; }

.stage { padding: 0; overflow: hidden; }
.stage .cover { height: 190px; background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 85%, white), var(--primary)); display: grid; place-items: center; color: #fff; font-size: 64px; }
.stage .cover img { width: 100%; height: 100%; object-fit: cover; }
.stage .body { padding: 24px; }

/* ---------- Testimonials ---------- */
.quote { position: relative; }
.quote .mark { font-size: 44px; color: var(--secondary); line-height: 1; }
.quote .who { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.quote .avatar { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; background: var(--soft); display: grid; place-items: center; color: var(--primary); font-weight: 800; font-size: 20px; }
.quote .who strong { display: block; }
.quote .who span { color: var(--muted); font-size: 14px; }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.gallery figure { margin: 0; border-radius: 14px; overflow: hidden; aspect-ratio: 1; position: relative; }
.gallery figure:first-child { grid-column: span 2; grid-row: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery figure:hover img { transform: scale(1.06); }
.gallery figcaption { position: absolute; inset-inline: 0; bottom: 0; padding: 10px 14px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.6)); font-weight: 600; }

/* ---------- News ---------- */
.post { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.post .thumb { height: 200px; background: var(--soft); display: grid; place-items: center; color: var(--primary); font-size: 50px; }
.post .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post .body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.post .date { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.post h3 a { color: var(--ink); }
.post .more { margin-top: auto; font-weight: 800; }

/* ---------- Branches ---------- */
.branch { display: flex; gap: 16px; align-items: flex-start; }
.branch .icon { flex-shrink: 0; margin: 0; }

/* ---------- FAQ ---------- */
.faq { max-width: 820px; margin: 0 auto; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 22px; margin-bottom: 12px; }
.faq summary { cursor: pointer; font-weight: 800; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 24px; color: var(--primary); line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq details p { color: var(--muted); margin: 12px 0 0; }

/* ---------- CTA ---------- */
.cta { border-radius: 26px; padding: 56px; color: #fff; background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 55%, #0f172a)); display: flex; align-items: center; justify-content: space-between; gap: 24px; background-size: cover; background-position: center; position: relative; overflow: hidden; }
.cta h2 { font-size: clamp(24px, 3vw, 34px); font-weight: 900; }
.cta p { opacity: .9; margin: 0; font-size: 18px; }

/* ---------- Contact + form ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 30px; align-items: start; }
.info-list { list-style: none; padding: 0; margin: 0 0 20px; }
.info-list li { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px dashed var(--line); }
.info-list i { font-size: 24px; color: var(--primary); }
.map { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.map iframe { width: 100%; height: 260px; border: 0; display: block; }
.form-card { background: #fff; border-radius: 22px; box-shadow: var(--shadow); padding: 32px; border-top: 5px solid var(--secondary); }
.form-card h3 { font-size: 24px; font-weight: 900; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 15px; }
.field input, .field select, .field textarea { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; font-family: inherit; font-size: 16px; background: #fff; color: var(--ink); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 15%, transparent); }
.field .error { color: #dc2626; font-size: 14px; margin-top: 4px; }
.hp { position: absolute !important; inset-inline-start: -9999px; height: 0; overflow: hidden; }
.form-note { color: var(--muted); font-size: 13px; text-align: center; margin: 10px 0 0; }

/* ---------- Page / article ---------- */
.page-hero { background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 60%, #0f172a)); color: #fff; padding: 64px 0; }
.page-hero h1 { font-size: clamp(28px, 4vw, 44px); font-weight: 900; margin: 0; }
.page-hero .crumbs { opacity: .8; margin-bottom: 6px; }
.page-hero .crumbs a { color: #fff; }
.prose { max-width: 820px; margin: 0 auto; font-size: 18px; }
.prose img { border-radius: 14px; margin: 20px 0; }
.prose h2, .prose h3 { margin-top: 1.4em; }
.cover-image { border-radius: var(--radius); margin-bottom: 30px; width: 100%; max-height: 460px; object-fit: cover; }
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 40px; list-style: none; padding: 0; flex-wrap: wrap; }
.pagination .page-link { display: block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.pagination .active .page-link { background: var(--primary); color: #fff; border-color: var(--primary); }

.center-box { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 60px 20px; }
.center-box .big-icon { font-size: 80px; color: var(--primary); }

/* ---------- Footer ---------- */
.site-footer { background: #0b1220; color: #cbd5e1; padding: 64px 0 24px; margin-top: 0; }
.site-footer h4 { color: #fff; font-size: 18px; margin-bottom: 16px; }
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 36px; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; }
.socials { display: flex; gap: 10px; flex-wrap: wrap; }
.socials a { width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.08); display: grid; place-items: center; font-size: 22px; }
.socials a:hover { background: var(--primary); }
.copyright { border-top: 1px solid rgba(255,255,255,.08); margin-top: 40px; padding-top: 20px; text-align: center; font-size: 14px; }

.whatsapp-float { position: fixed; bottom: 22px; inset-inline-start: 22px; z-index: 60; width: 60px; height: 60px; border-radius: 50%; background: #25d366; color: #fff; display: grid; place-items: center; font-size: 34px; box-shadow: 0 10px 25px rgba(37, 211, 102, .45); }
.whatsapp-float:hover { transform: scale(1.06); }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; border-radius: 12px; padding: 14px 18px; margin-bottom: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .stat:nth-child(2) { border: 0; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
    .menu-toggle { display: block; }
    .nav { position: absolute; top: 76px; inset-inline: 0; background: #fff; flex-direction: column; align-items: stretch; padding: 12px 20px 20px; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); display: none; }
    .nav.open { display: flex; }
    .header-actions .btn-apply { display: none; }
    .grid-3, .grid-2, .contact-grid { grid-template-columns: 1fr; }
    .gallery { grid-template-columns: repeat(2, 1fr); }
    .cta { flex-direction: column; text-align: center; padding: 40px 24px; }
    .section { padding: 64px 0; }
}
@media (max-width: 560px) {
    .grid-4, .form-row, .footer-grid { grid-template-columns: 1fr; }
    .brand span { display: none; }
    .hero .container { padding-top: 80px; padding-bottom: 100px; }
    .stat .num { font-size: 28px; }
    .form-card { padding: 22px; }
}
