/*
Theme Name: Wqar
Theme URI: https://www.wqargroup.com/
Author: Claude
Description: قالب خفيف لموقع مجموعة وقار للمعرفة. يعرض الإصدارات (ملفات PDF مجانية) تلقائيًا في الصفحة الرئيسية.
Version: 1.0.36
Text Domain: wqar
*/

:root {
	--ink: #10302f;
	--sea: #1e5c57;
	--mist: #eef3f2;
	--gold: #c79632;
	--gold-dark: #a97b1f;
	--text: #1b2524;
	--muted: #5b6b69;
	--line: #d5dfdd;
	--radius: 12px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0; background: var(--page-bg, #fff); color: var(--text);
	font: 400 var(--font-size, 17px)/1.85 var(--font-body, "IBM Plex Sans Arabic", Tahoma, Arial, sans-serif);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link-c, var(--sea)); }
h1, h2, h3 { font-family: var(--font-head, "Reem Kufi", "IBM Plex Sans Arabic", Tahoma, sans-serif); line-height: 1.35; margin: 0; }
p { margin: 0 0 .8em; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.wrap { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.center { text-align: center; }

/* الأزرار */
.btn {
	display: inline-block; padding: .55em 1.4em; border-radius: 999px; border: 2px solid transparent;
	font-family: inherit; font-weight: 600; font-size: 1rem; line-height: 1.6; text-decoration: none; cursor: pointer;
}
.btn--gold { background: var(--gold); color: var(--btn-gold-text, var(--ink)); }
.btn--gold:hover { background: var(--gold-dark); color: var(--btn-gold-hover-text, #fff); }
.btn--sea { background: var(--sea); color: var(--btn-sea-text, #fff); }
.btn--sea:hover { background: var(--ink); }
.btn--light { border-color: rgba(255,255,255,.55); color: #fff; }
.btn--light:hover { background: rgba(255,255,255,.12); }
.link { font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin-top: 1rem; }
.actions--center { justify-content: center; }

/* الترويسة */
.site-header { background: var(--header-bg, var(--ink)); color: var(--header-text, #fff); position: sticky; top: 0; z-index: 20; }
/* تعويض شريط لوحة التحكم للمدير: ثابت 32px على سطح المكتب، 46px حتى 782px، ويتحرك مع الصفحة (غير ثابت) حتى 600px */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }
.site-header__in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand { flex: 0 0 auto; }
.brand { display: flex; align-items: center; gap: .7rem; }
.brand a, .brand__name { color: var(--header-text, #fff); text-decoration: none; font: 700 1.3rem var(--font-head, "Reem Kufi", sans-serif); display: inline-block; }
.brand .custom-logo-link { display: block; line-height: 0; }
.brand img, .brand .custom-logo { max-height: var(--logo-h, 48px) !important; width: auto !important; max-width: 60vw; height: auto; display: block; }
.site-footer .custom-logo-link { display: block; line-height: 0; }
.site-footer .footer-logo { max-height: var(--flogo-h, 40px) !important; width: auto !important; max-width: 70vw; height: auto; display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1.4rem; }
.site-nav li { margin: 0; padding: 0; list-style: none; }
.site-nav { display: flex; align-items: center; gap: 1.4rem; }
.site-nav a { color: var(--header-text, #fff); text-decoration: none; font-weight: 500; }
.site-nav a:hover { color: var(--header-hover, var(--gold)); }
.site-nav a.btn--gold { color: var(--btn-gold-text, var(--ink)); }
.site-nav a.btn--gold:hover { color: var(--btn-gold-hover-text, #fff); }
.nav-toggle { display: none; background: none; border: 1px solid rgba(255,255,255,.5); color: var(--header-text, #fff); border-radius: 8px; width: 44px; height: 44px; padding: 0; cursor: pointer; align-items: center; justify-content: center; line-height: 0; }

/* الواجهة */
.hero { background: var(--hero-bg, var(--ink)); color: var(--hero-text, #fff); padding: var(--hero-pt, 56px) 0 var(--hero-pb, 64px); }
.hero__in { display: grid; grid-template-columns: 1fr 1.1fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 5vw, var(--hero-title-max, 58px)); color: var(--hero-text, #fff); }
.hero__text p { font-size: 1.2rem; color: var(--hero-sub, #d7e4e2); max-width: 32ch; margin-top: 1rem; }
.hero .hero-logo, .hero .custom-logo { height: var(--hero-logo-h, 90px) !important; width: auto !important; max-width: 100%; max-height: none !important; margin-bottom: 1rem; }
.hero .custom-logo-link { display: block; line-height: 0; }
.hero--center .hero__in, .hero--text .hero__in { grid-template-columns: 1fr; }
.hero--center .hero__text { text-align: center; }
.hero--center .hero__text p { margin-inline: auto; max-width: 52ch; }
.hero--center .hero-logo { margin-inline: auto; }
.hero--center .actions { justify-content: center; }
.hero--text .hero__text p { max-width: 60ch; }
.hero h1 + .custom-logo-link { margin-top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.feature { background: var(--card-bg, #fff); color: var(--text); border-radius: var(--radius); overflow: hidden; }
.feature__cover { display: block; aspect-ratio: 16/9; background: var(--mist); }
.feature__cover img { width: 100%; height: 100%; object-fit: cover; }
.feature__body { padding: 1.2rem 1.4rem 1.5rem; }
.feature__body h2 { font-size: 1.6rem; }
.feature__body h2 a { color: var(--card-title, var(--ink)); text-decoration: none; }
.badge { display: inline-block; background: var(--mist); color: var(--sea); border-radius: 6px; padding: 0 .7em; font-weight: 600; font-size: .9rem; margin-bottom: .5rem; }
.feature__body .btn--light { border-color: var(--sea); color: var(--sea); }
.feature__body .btn--light:hover { background: var(--mist); }

/* الأقسام */
.section { padding: 3.5rem 0; }
.section--mist { background: var(--mist); }
.section--platforms { background: var(--platforms-bg, var(--mist)); }
#releases { background: var(--releases-bg, transparent); }
.section__title { font-size: clamp(1.7rem, 3.5vw, 2.3rem); color: var(--title-c, var(--ink)); margin-bottom: 1.6rem; }
.follow { background: var(--follow-bg, var(--ink)); }
.follow .section__title { color: #fff; }

/* شبكة الإصدارات */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.card { background: var(--card-bg, #fff); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card__cover { aspect-ratio: 16/9; background: var(--mist); display: block; }
.card__cover img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; flex: 1; }
.card h3 { font-size: 1.25rem; margin-bottom: .4rem; }
.card h3 a { color: var(--card-title, var(--ink)); text-decoration: none; }
.card p { color: var(--muted); font-size: .98rem; line-height: 1.7; }
.card .actions { margin-top: auto; padding-top: .8rem; }
.meta { color: var(--muted); font-size: .92rem; }

/* المنصات */
.platforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 1.5rem; }
.platform { background: var(--card-bg, #fff); border-radius: var(--radius); padding: 1.6rem; text-decoration: none; color: var(--text); display: flex; flex-direction: row; align-items: center; gap: 1.2rem; border-inline-start: 6px solid var(--gold); }
.platforms--pos-left .platform { flex-direction: row-reverse; }
html[dir="ltr"] .platforms--pos-right .platform { flex-direction: row-reverse; }
html[dir="ltr"] .platforms--pos-left .platform { flex-direction: row; }
.platforms--pos-top .platform, .platforms--pos-topc .platform { flex-direction: column; align-items: flex-start; }
.platforms--pos-topc .platform { align-items: center; text-align: center; }
.platforms--pos-topc .platform__body { align-items: center; }
.platforms--pos-topc .platform .btn { align-self: center; }
.platform__body { display: flex; flex-direction: column; gap: .3rem; flex: 1; min-width: 0; }
.platform h3 { font-size: 1.4rem; color: var(--card-title, var(--ink)); }
.platform p { color: var(--muted); }
.platform .btn { align-self: flex-start; margin-top: .5rem; }
.platform__logo { display: block; flex: 0 0 auto; line-height: 0; }
.platform__logo img { height: var(--pf-logo-h, 64px); width: auto; max-width: 100%; object-fit: contain; }
.platforms--dark .platform { background: var(--ink); color: #c8d8d6; }
.platforms--dark .platform h3 { color: #fff; }
.platforms--dark .platform p { color: #c8d8d6; }
.platforms--dark .platform .btn--sea { background: var(--gold); color: var(--ink); }

/* صفحة الإصدار */
.release__top { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: center; padding-block: 3rem; }
.release__cover img { width: 100%; border-radius: var(--radius); }
.release h1 { font-size: clamp(2rem, 4.5vw, 3rem); color: var(--title-c, var(--ink)); }
.lead { font-size: 1.15rem; margin-top: .8rem; }
.note { margin-top: 1.2rem; color: var(--muted); }
.reader { display: none; padding-bottom: 2rem; }
.reader iframe { width: 100%; height: 80vh; border: 1px solid var(--line); border-radius: var(--radius); }
.prose { max-width: 70ch; padding-bottom: 3rem; }
.prose h1, .prose h2, .prose h3 { color: var(--title-c, var(--ink)); margin: 1.4em 0 .5em; }

/* ترقيم الصفحات */
.pagination, .page-numbers { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; list-style: none; padding: 0; }
.page-numbers a, .page-numbers span, a.page-numbers, span.page-numbers { padding: .3em .9em; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.page-numbers .current, span.current { background: var(--sea); color: #fff; border-color: var(--sea); }

/* التذييل */
.site-footer { background: var(--footer-bg, var(--ink)); color: var(--footer-text, #c8d8d6); padding: 1.6rem 0; }
.site-footer__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-footer p { margin: 0; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1.2rem; }
.site-footer a { color: var(--footer-link, #fff); margin-inline-end: 1.2rem; }


/* وسائل التواصل */
.social-icons { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
.follow .social-icons { justify-content: center; gap: 1rem; }
.social-icons .social-link { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; color: var(--social-c, currentColor); text-decoration: none; margin: 0; transition: color .15s, background .15s; }
.social-icons .social-link:hover { color: var(--social-hover, var(--gold)); }
.social-icons .social-icon { width: var(--social-size, 22px); height: var(--social-size, 22px); flex: none; fill: currentColor; }
.social-icons--text .social-link, .social-icons--both .social-link { color: var(--footer-link, currentColor); }
.social--circle .social-link, .social--square .social-link { width: calc(var(--social-size, 22px) * 1.9); height: calc(var(--social-size, 22px) * 1.9); background: var(--social-bg, var(--sea)); }
.social--circle .social-link { border-radius: 50%; }
.social--square .social-link { border-radius: 12px; }
.social--circle .social-link:hover, .social--square .social-link:hover { background: var(--social-hover, var(--gold)); color: var(--ink); }
.site-nav .social-icons { gap: .5rem; }

/* الجوال */
@media (min-width: 768px) { .reader { display: block; } }
@media (max-width: 767px) {
	.btn--desktop { display: none; }
	.hero__in, .release__top { grid-template-columns: 1fr; gap: 2rem; }
	.nav-toggle { display: flex; }
	.brand img, .brand .custom-logo { max-height: var(--logo-h-m, 40px) !important; }
	.site-nav { display: none; flex-direction: column; align-items: stretch; position: absolute; inset-inline: 0; top: 100%; background: var(--header-bg, var(--ink)); padding: 1rem; }
	.site-nav.is-open { display: flex; }
	.site-nav .header-cta { text-align: center; }
	.site-nav ul { flex-direction: column; gap: .8rem; }
	.hero { padding: calc(var(--hero-pt, 56px) * .7) 0 calc(var(--hero-pb, 64px) * .7); }
	.platform__logo img { height: min(var(--pf-logo-h, 64px), 56px); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* صفحة المقالة: بدون غلاف */
.release__top--solo { grid-template-columns: 1fr; }

/* شريط الإعلان والقسم المخصص في الرئيسية */
.announce { background: var(--gold); color: var(--ink); text-align: center; padding: .55rem 1rem; font-size: .95rem; }
.announce a { color: inherit; font-weight: 700; text-decoration: underline; }
.section--home-custom .custom-text { max-width: 70ch; }
.follow__text { margin-bottom: 1rem; }
.follow .follow__text { color: #d7e4e2; }

/* محاذاة نص المقالة يحددها محرر النصوص */
.release__content .prose { max-width: 70ch; margin: 0; }
.prose .has-text-align-center { text-align: center; }
.prose .has-text-align-left { text-align: left; }
.prose .has-text-align-right { text-align: right; }
.prose .alignleft { float: left; margin: 0 1rem 1rem 0; }
.prose .alignright { float: right; margin: 0 0 1rem 1rem; }
.prose .aligncenter { display: block; margin-inline: auto; }

/* بطاقات الإصدارات: شارة وتصنيف */
.card__cover { position: relative; overflow: hidden; }
.card__badge { position: absolute; top: .6rem; inset-inline-start: .6rem; background: var(--gold); color: var(--ink); font-size: .8rem; font-weight: 700; padding: .15em .75em; border-radius: 999px; z-index: 1; line-height: 1.6; }
.card__badge--inline { position: static; display: inline-block; margin-bottom: .5rem; align-self: flex-start; }
.card .card__cat { font-size: .85rem; font-weight: 600; color: var(--sea); margin-bottom: .3rem; }

/* أيقونة زر القائمة (تتحول إلى × عند الفتح) */
.nav-toggle__icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.nav-toggle__icon path { transition: transform .25s ease, opacity .2s ease; transform-box: fill-box; transform-origin: center; }
.nav-toggle[aria-expanded="true"] .l1 { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .l2 { opacity: 0; }
.nav-toggle[aria-expanded="true"] .l3 { transform: translateY(-6px) rotate(-45deg); }

/* ===== الواجهة العلوية: نمط الأنمي ===== */
.hero--anime { --ch: min(var(--hero-char-h, 520px), 26vw); position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; min-height: min(88vh, 780px); background-color: var(--hero-bg, #141111); }
.hero--anime .hero__in { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 2rem; position: relative; z-index: 2; }
.hero--anime h1 { line-height: 1.15; }
.hero--anime .hero__text p:not(.hero__eyebrow) { max-width: 44ch; }
.hero__eyebrow { display: inline-flex; align-items: center; gap: .8rem; margin: 0 0 1rem !important; font-size: .95rem !important; color: var(--hero-sub, #d7e4e2) !important; }
.hero__eyebrow::before { content: ""; width: 34px; height: 2px; background: var(--gold); }
.hero__eyebrow .jp { color: var(--gold); font-family: "Noto Sans JP", "Yu Gothic", "Hiragino Sans", sans-serif; letter-spacing: .08em; }
.hero__enso { position: absolute; z-index: 0; inset-inline-end: -6%; top: 50%; width: min(72vw, 840px); aspect-ratio: 1 / 1; transform: translateY(-50%); opacity: .35; pointer-events: none; }
.hero__enso img { width: 100%; height: 100%; object-fit: contain; display: block; }
.hero__enso--ring { border-radius: 50%; border: clamp(18px, 3vw, 40px) solid rgba(255,255,255,.08); border-block-start-color: transparent; transform: translateY(-50%) rotate(-30deg); opacity: 1; }
.hero__wm { position: absolute; z-index: 1; inset-inline-start: 2%; top: 50%; transform: translateY(-50%); writing-mode: vertical-rl; font: 900 clamp(64px, 10vw, 170px)/1 "Noto Sans JP", "Yu Gothic", "Hiragino Sans", sans-serif; letter-spacing: .1em; color: rgba(255,255,255,.05); white-space: nowrap; pointer-events: none; user-select: none; }
.hero__chars { position: relative; z-index: 2; display: flex; align-items: flex-end; justify-content: center; align-self: end; margin-block-end: calc(var(--hero-pb, 64px) * -1); min-width: 0; }
.hero__chars img { flex: 0 0 auto; width: auto; max-width: none; height: var(--ch); margin-inline-start: calc(var(--ch) * -.16); filter: drop-shadow(0 14px 26px rgba(0,0,0,.55)); }
.hero__chars img:first-child { margin-inline-start: 0; }
.hero__chars img:nth-child(1) { height: calc(var(--ch) * .82); z-index: 1; }
.hero__chars img:nth-child(2) { height: calc(var(--ch) * .95); z-index: 2; }
.hero__chars img:nth-child(3) { height: var(--ch); z-index: 4; }
.hero__chars img:nth-child(4) { height: calc(var(--ch) * .88); z-index: 3; }
@media (max-width: 899px) {
	.hero--anime { --ch: min(var(--hero-char-h, 520px), 44vw, 340px); min-height: 0; }
	.hero--anime .hero__in { grid-template-columns: minmax(0, 1fr); }
	.hero__chars { align-self: auto; }
	.hero__wm { display: none; }
}
