/*
Theme Name: عالم الصغار
Theme URI: https://wqar.kids
Author: wqardata
Description: قالب فيديوهات للأطفال منقول من موقع wqar.kids: فيديوهات درايف ويوتيوب، مجموعات وتصنيفات، مقاطع قصيرة، إذاعة أناشيد، أذكار الصباح والمساء، نافذة الأذان ومواقيت الصلاة، وإشعارات. قالب مستقل بلا إضافات، مع أداة استيراد من الموقع القديم.
Version: 3.8.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: wqar-kids
Tags: rtl-language-support, video, custom-colors, custom-logo
*/

/* ───────── الرموز ───────── */
:root {
  color-scheme: light;
  --bg: #f2f6f4;
  --surface: #ffffff;
  --ink: #10263a;
  --mute: #5b6f7f;
  --line: #d9e3de;
  --accent: #087a68;
  --accent-ink: #ffffff;
  --soft: color-mix(in srgb, var(--accent) 10%, var(--surface));
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --top: 60px;
  --side: 232px;
  --font: "Readex Pro", system-ui, "Segoe UI", Tahoma, sans-serif;
  --quran: "Amiri", "Traditional Arabic", serif;
  --focus: color-mix(in srgb, var(--accent) 60%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1a24; --surface: #172635; --ink: #e8f0f4; --mute: #93a8b6; --line: #243749; --accent: #2cc4a8; --accent-ink: #06231d;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1a24; --surface: #172635; --ink: #e8f0f4; --mute: #93a8b6; --line: #243749; --accent: #2cc4a8; --accent-ink: #06231d;
}

/* ───────── الأساس ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 12px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.7 var(--font); }
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.icon { flex: none; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: var(--r-sm); }
.skip:focus { top: 10px; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ───────── المقاطع القصيرة ───────── */
.is-shorts .main { background: #000; }
.shorts { height: calc(100vh - var(--top)); overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; }
.shorts::-webkit-scrollbar { display: none; }
.shorts .empty { color: #bbb; text-align: center; padding: 60px 20px; }
.short { position: relative; height: calc(100vh - var(--top)); scroll-snap-align: start; scroll-snap-stop: always; display: grid; place-items: center; }
.short__frame { position: relative; height: 100%; max-height: 100%; aspect-ratio: 9 / 16; max-width: 100%; background: #111; overflow: hidden; }
.short__frame img, .short__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.short__info { position: absolute; inset-inline-start: 0; bottom: 0; width: min(100%, calc((100vh - var(--top)) * 9 / 16)); left: 50%; transform: translateX(-50%); padding: 40px 72px 18px 16px; color: #fff; background: linear-gradient(transparent, rgb(0 0 0 / .75)); pointer-events: none; }
.short__info h2 { margin: 0; font-size: 1.05rem; line-height: 1.4; }
.short__info a { pointer-events: auto; color: #fff; }
.short__info a + a { opacity: .8; font-size: .9rem; }
.short__acts { position: absolute; bottom: 90px; display: grid; gap: 14px; inset-inline-end: max(12px, calc(50% - (100vh - var(--top)) * 9 / 32 + 10px)); }
.act--round { flex-direction: column; gap: 2px; padding: 10px; border-radius: 18px; background: rgb(255 255 255 / .14); color: #fff; box-shadow: none; font-size: .78rem; backdrop-filter: blur(6px); }
.act--round:hover { background: rgb(255 255 255 / .25); color: #fff; }

/* ───────── الإذاعة ───────── */

/* ───────── الأذكار ───────── */
.tabs { display: flex; gap: 6px; background: var(--surface); padding: 5px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); width: fit-content; margin-bottom: 18px; }
.tab { padding: 8px 20px; border-radius: 999px; font-weight: 500; }
.tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.adhkar__progress { color: var(--mute); margin: 0 0 10px; }
.dhikr { background: var(--surface); border-radius: 22px; padding: 22px 22px 18px; margin-bottom: 14px; box-shadow: inset 0 0 0 1px var(--line); transition: opacity .3s; }
.dhikr__text { font-family: var(--quran); font-size: 1.45rem; line-height: 2.1; margin: 0; }
.dhikr__note { color: var(--mute); font-size: .88rem; margin: 8px 0 0; }
.dhikr__count { margin-top: 14px; width: 100%; border: 0; border-radius: 16px; padding: 10px; background: var(--soft); display: grid; justify-items: center; }
.dhikr__count span { font-size: 1.6rem; font-weight: 700; color: var(--accent); line-height: 1.2; }
.dhikr__count small { color: var(--mute); font-size: .8rem; }
.dhikr__count:active { transform: scale(.985); }
.dhikr.is-done { opacity: .55; }
.dhikr.is-done .dhikr__count { background: var(--accent); }
.dhikr.is-done .dhikr__count span, .dhikr.is-done .dhikr__count small { color: var(--accent-ink); }
.adhkar__done { text-align: center; font-weight: 600; color: var(--accent); font-size: 1.15rem; margin: 22px 0; }

/* ───────── المواقيت ───────── */
.prayer__next { text-align: center; padding: 26px 16px; border-radius: 26px; background: var(--accent); color: var(--accent-ink); }
.prayer__next p { margin: 0; }
.prayer__count { font-size: clamp(2.2rem, 1.6rem + 3vw, 3.4rem); font-weight: 700; direction: ltr; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.prayer__list { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 8px; }
.prayer__list li { display: flex; justify-content: space-between; padding: 14px 18px; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 500; }
.prayer__list li[aria-current] { box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent); }
.prayer__loc, .prayer__hint { color: var(--mute); font-size: .9rem; }

/* ───────── التنزيلات ───────── */
.dl { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.dl__item { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 8px; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.dl__item img { aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-md); }
.dl__title { font-weight: 600; }

/* ───────── ترقيم الصفحات ───────── */
.pagination, .nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 30px; }
.page-numbers { padding: 6px 14px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.page-numbers.current { background: var(--accent); color: var(--accent-ink); box-shadow: none; }

/* ───────── نوافذ وطبقات ───────── */
.dlg { border: 0; border-radius: 22px; padding: 0; background: var(--surface); color: var(--ink); width: min(440px, 92vw); box-shadow: 0 30px 80px rgb(0 0 0 / .3); }
.dlg::backdrop { background: rgb(0 0 0 / .45); }
.dlg__body { padding: 22px; }
.dlg__body h2 { margin: 0 0 12px; font-size: 1.2rem; }
.radio-line { display: flex; gap: 8px; align-items: center; padding: 5px 0; }
.field { display: grid; gap: 4px; margin-top: 12px; }
.field span { font-weight: 500; font-size: .92rem; }
.field textarea { border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 12px; background: var(--bg); resize: vertical; }
.dlg__acts { display: flex; gap: 8px; margin-top: 16px; }

.toast { position: fixed; inset-inline: 0; bottom: 90px; margin-inline: auto; width: fit-content; max-width: 90vw; z-index: 90; background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: .93rem; animation: up .25s ease; }
.toast--out { opacity: 0; transition: opacity .35s; }
@keyframes up { from { transform: translateY(12px); opacity: 0; } }

.bubble {
  position: fixed; inset-inline-start: 16px; bottom: 18px; z-index: 80; width: min(380px, calc(100vw - 32px));
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: 22px; padding: 16px 18px; box-shadow: 0 20px 50px rgb(0 0 0 / .2); animation: up .3s ease;
}
.bubble + .bubble { bottom: 150px; }
.bubble__text { margin: 0 0 10px; font-weight: 500; }
.bubble__acts { display: flex; flex-wrap: wrap; gap: 6px; }

/* نافذة الأذان: سماء الغروب خلف المسجد، العنصر الوحيد الجريء في القالب. */
.adhan {
  position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(120% 80% at 50% 110%, #f6c177 0%, #e07a5f 28%, #3d405b 64%, #1b1f3a 100%);
  color: #fff; animation: fade .4s ease;
}
@keyframes fade { from { opacity: 0; } }
.adhan__card { text-align: center; max-width: 520px; }
.adhan__img { width: min(260px, 60vw); margin: 0 auto 18px; filter: drop-shadow(0 12px 30px rgb(0 0 0 / .35)); }
.adhan__text { font-size: clamp(1.3rem, 1rem + 1.5vw, 1.8rem); font-weight: 700; line-height: 1.5; margin: 0 0 14px; }
.adhan__count { font-size: 3rem; font-weight: 700; margin: 0; direction: ltr; font-variant-numeric: tabular-nums; }
.adhan__sub { margin: 0 0 18px; opacity: .8; }
.adhan__acts, .adhan__parent { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.adhan .btn { background: #fff; color: #1b1f3a; }
.adhan .btn--ghost { background: rgb(255 255 255 / .16); color: #fff; }


/* صفحات القالب داخل .main (كما في الموقع القديم: بلا غلاف إضافي) */
.wk-page { display: block; }
.empty-state { padding: 48px 20px; text-align: center; }
.empty-state p { color: var(--mute); margin-top: 8px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.grid-end { height: 1px; }
.home-blocks > div > .grid--home + .grid--home { margin-top: 0; }
body { font-family: var(--font); }

/* ───────── شريط المشرف العائم (بديل شريط ووردبريس) ───────── */
.wkbar { position: fixed; z-index: 45; inset-inline-start: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; justify-items: start; gap: 10px; }
.wkbar__btn { position: relative; width: 48px; height: 48px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 40%, transparent), 0 2px 6px rgb(0 0 0 / .18); transition: transform .15s; }
.wkbar__btn:hover { transform: scale(1.06); }
.wkbar.is-open .wkbar__btn svg { transform: rotate(60deg); transition: transform .25s; }
.wkbar__dot { position: absolute; top: 4px; inset-inline-end: 4px; width: 11px; height: 11px; border-radius: 50%; background: #ffb02e; border: 2px solid var(--accent); }
.wkbar__menu { order: -1; min-width: 230px; padding: 8px; border-radius: 18px; border: 1px solid var(--line); box-shadow: 0 18px 44px rgb(0 0 0 / .22);
  background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%); animation: wkbar-in .18s ease-out; }
.wkbar__menu[hidden] { display: none; }
.wkbar__menu a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; font-size: .93rem; color: var(--ink); }
.wkbar__menu a:hover { background: var(--surface); color: var(--accent); }
.wkbar__hot { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent) !important; font-weight: 600; }
.wkbar__out { color: var(--mute) !important; }
.wkbar__who { display: flex; align-items: center; gap: 10px; padding: 6px 10px 10px; margin: 0 0 4px; border-bottom: 1px solid var(--line); }
.wkbar__who img { border-radius: 50%; }
.wkbar__who span { display: grid; line-height: 1.3; }
.wkbar__who small { color: var(--mute); font-size: .78rem; }
@keyframes wkbar-in { from { opacity: 0; transform: translateY(8px) scale(.97); } }
@media (max-width: 899px) { .wkbar { bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom, 0px)); inset-inline-start: 12px; } .wkbar__btn { width: 44px; height: 44px; } }
@media print { .wkbar { display: none; } }
