/*
 * مدرسة المنار الأهلية — عرض المعرض والأخبار والفعاليات
 * ---------------------------------------------------------------
 * كل ما في هذا الملف محصور داخل ‎.mn-wrap‎ ، فلا يمسّ القالب الأصلي:
 * الترويسة والتذييل وبقية الصفحات تبقى كما هي حرفاً بحرف.
 *
 * الألوان مأخوذة من متغيّرات القالب نفسها (‎--thm-primary‎ وأخواتها)
 * التي يضبطها ‎layout/index.php‎ من إعدادات الموقع، فتغييرُ لون
 * الموقع من لوحة التحكم يغيّر هذه الصفحات معه دون تعديل هنا.
 */

.mn-wrap {
	direction: rtl;
	text-align: right;
	font-family: 'Tajawal', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;

	--mn-radius: 14px;
	--mn-ink: #1f2933;
	--mn-muted: #6b7784;
	--mn-line: #e6eaef;
	--mn-surface: #ffffff;
	--mn-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
	--mn-shadow-lift: 0 2px 6px rgba(16, 24, 40, .06), 0 18px 40px rgba(16, 24, 40, .12);
	--mn-accent: var(--thm-primary, #c0392b);
}

.mn-wrap a {
	transition: color .2s ease;
}

/*
 * ‎style.css‎ يفرض ‎font-family: 'Lato'‎ على ‎h1…h6‎ بمحدِّد عنصرٍ مجرّد،
 * ومحدِّد العنصر يغلب الوراثة مهما علا الأب. و«لاتو» خطٌّ لاتيني لا
 * حروف عربية فيه، فيسقط كل عنوان إلى خط النظام وحده — وهذا سبب
 * اختلاف شكل العناوين عن نصّها. السطر التالي يعيدها إلى الوراثة.
 */
.mn-wrap h1,
.mn-wrap h2,
.mn-wrap h3,
.mn-wrap h4,
.mn-wrap h5,
.mn-wrap h6 {
	font-family: inherit;
}

/* فتات الخبز: النص عربي، فليقرأ من اليمين */
.mn-crumb {
	direction: rtl;
	text-align: right;
	font-family: 'Tajawal', 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Arial, sans-serif;
}

/* الفاصل كان يُزاح يميناً وهو ترتيب سطرٍ لاتيني */
.mn-crumb li + li::before {
	padding-right: 0;
	padding-left: 10px;
}

.mn-crumb .list-inline-item:not(:last-child) {
	margin-right: 0;
	margin-left: .5rem;
}

/* ---------- عنوان القسم ---------- */

.mn-head {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0 0 24px;
}

.mn-head h2,
.mn-head h3 {
	margin: 0;
	font-size: 26px;
	font-weight: 800;
	line-height: 1.5;
	color: var(--mn-ink);
}

.mn-head::after {
	content: "";
	flex: 1 1 auto;
	height: 1px;
	background: var(--mn-line);
}

.mn-count {
	flex: 0 0 auto;
	font-size: 13px;
	font-weight: 600;
	color: var(--mn-muted);
	background: #f3f5f8;
	border-radius: 999px;
	padding: 5px 13px;
	white-space: nowrap;
}

.mn-intro {
	margin: -8px 0 26px;
	font-size: 15.5px;
	line-height: 2;
	color: var(--mn-muted);
}

/* ---------- شبكة تتكيّف وحدها ---------- */

.mn-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 288px), 1fr));
	gap: 26px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.mn-hide {
	display: none !important;
}

/* ---------- البطاقة ---------- */

.mn-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--mn-surface);
	border: 1px solid var(--mn-line);
	border-radius: var(--mn-radius);
	overflow: hidden;
	box-shadow: var(--mn-shadow);
	transition: transform .25s ease, box-shadow .25s ease;
}

.mn-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--mn-shadow-lift);
}

.mn-card__media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	background: #eef1f5;
	overflow: hidden;
}

/* متصفح قديم لا يعرف aspect-ratio: نسبة محفوظة بالحشو */
@supports not (aspect-ratio: 16 / 10) {
	.mn-card__media {
		height: 0;
		padding-top: 62.5%;
	}
}

.mn-card__media img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .6s ease;
}

.mn-card:hover .mn-card__media img {
	transform: scale(1.06);
}

/* يظهر خلف الصورة، فإن تعذّر تحميلها بقي مكانها معلَّماً لا فارغاً */
.mn-card__ph {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 38px;
	color: #b6c0cc;
}

.mn-card__body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex: 1 1 auto;
	padding: 18px 18px 20px;
}

.mn-card__title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.6;
}

.mn-card__title a {
	color: var(--mn-ink);
	text-decoration: none;
}

.mn-card__title a:hover {
	color: var(--mn-accent);
	text-decoration: none;
}

.mn-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 13px;
	color: var(--mn-muted);
}

.mn-card__meta li {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.mn-card__meta i {
	color: var(--mn-accent);
	opacity: .85;
}

.mn-card__text {
	margin: 0;
	font-size: 14.5px;
	line-height: 1.9;
	color: var(--mn-muted);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.mn-card__foot {
	margin-top: auto;
	padding-top: 6px;
}

/* ---------- شارة التاريخ وشارة الحالة ---------- */

.mn-date {
	position: absolute;
	top: 12px;
	right: 12px;
	min-width: 58px;
	padding: 7px 10px;
	text-align: center;
	line-height: 1;
	background: rgba(255, 255, 255, .95);
	border-radius: 10px;
	box-shadow: 0 4px 14px rgba(16, 24, 40, .18);
}

.mn-date b {
	display: block;
	font-size: 19px;
	font-weight: 800;
	color: var(--mn-accent);
}

.mn-date span {
	display: block;
	margin-top: 4px;
	font-size: 11.5px;
	font-weight: 600;
	color: var(--mn-muted);
}

.mn-flag {
	position: absolute;
	top: 12px;
	left: 12px;
	padding: 5px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	color: #fff;
	background: var(--mn-accent);
	box-shadow: 0 4px 14px rgba(16, 24, 40, .2);
}

.mn-flag.is-live {
	background: #16a34a;
}

.mn-flag.is-soon {
	background: #2563eb;
}

.mn-flag.is-done {
	background: #7b8794;
}

/* ---------- الأزرار ---------- */

.mn-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 18px;
	border: 0;
	border-radius: 999px;
	background: var(--mn-accent);
	color: #fff !important;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: filter .2s ease, transform .2s ease;
}

.mn-btn:hover,
.mn-btn:focus {
	filter: brightness(1.1);
	transform: translateY(-1px);
	color: #fff !important;
	text-decoration: none;
}

.mn-btn--ghost {
	background: transparent;
	color: var(--mn-accent) !important;
	border: 1px solid currentColor;
}

.mn-btn--ghost:hover,
.mn-btn--ghost:focus {
	background: var(--mn-accent);
	color: #fff !important;
	filter: none;
}

/* ---------- مرشّح التصنيفات ---------- */

.mn-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	list-style: none;
	margin: 0 0 26px;
	padding: 0;
}

.mn-filter a {
	display: inline-block;
	padding: 8px 18px;
	border: 1px solid var(--mn-line);
	border-radius: 999px;
	background: #fff;
	color: var(--mn-ink);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: all .2s ease;
}

.mn-filter a:hover {
	border-color: var(--mn-accent);
	color: var(--mn-accent);
	text-decoration: none;
}

.mn-filter a.is-active {
	background: var(--mn-accent);
	border-color: var(--mn-accent);
	color: #fff;
}

/* ---------- بلاطات الصور والفيديو داخل الألبوم ---------- */

.mn-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 235px), 1fr));
	gap: 16px;
}

.mn-tile {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	border-radius: 12px;
	overflow: hidden;
	background: #eef1f5;
}

@supports not (aspect-ratio: 4 / 3) {
	.mn-tile {
		height: 0;
		padding-top: 75%;
	}
}

.mn-tile img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .6s ease;
}

.mn-tile:hover img,
.mn-tile:focus img {
	transform: scale(1.07);
}

.mn-tile__ph {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 30px;
	color: #b6c0cc;
}

.mn-tile__veil {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(to top, rgba(10, 15, 22, .55), rgba(10, 15, 22, 0) 60%);
	opacity: 0;
	transition: opacity .3s ease;
}

.mn-tile:hover .mn-tile__veil,
.mn-tile:focus .mn-tile__veil {
	opacity: 1;
}

.mn-tile__veil i {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 54px;
	height: 54px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .94);
	color: var(--mn-accent);
	font-size: 20px;
	transform: scale(.8);
	transition: transform .3s ease;
}

.mn-tile:hover .mn-tile__veil i,
.mn-tile:focus .mn-tile__veil i {
	transform: scale(1);
}

/*
 * الفيديو لا ينتظر مرور الفأرة: علامة التشغيل ظاهرة دائماً،
 * وإلا بدا كصورة ساكنة على الجوال حيث لا وجود لـ hover أصلاً.
 */
.mn-tile--video .mn-tile__veil {
	opacity: 1;
	background: linear-gradient(to top, rgba(10, 15, 22, .5), rgba(10, 15, 22, .12));
}

.mn-tile--video .mn-tile__veil i {
	transform: scale(1);
	background: #ff0000;
	color: #fff;
}

.mn-tile__tag {
	position: absolute;
	top: 10px;
	right: 10px;
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(10, 15, 22, .72);
	color: #fff;
	font-size: 11.5px;
	font-weight: 700;
}

/* ---------- لا يوجد محتوى ---------- */

.mn-empty {
	grid-column: 1 / -1;
	padding: 54px 20px;
	text-align: center;
	border: 1px dashed var(--mn-line);
	border-radius: var(--mn-radius);
	background: #fafbfc;
	color: var(--mn-muted);
	font-size: 15px;
}

.mn-empty i {
	display: block;
	margin-bottom: 12px;
	font-size: 40px;
	color: #c3ccd6;
}

/* ---------- ترقيم الصفحات ---------- */

.mn-pager {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin-top: 34px;
}

.mn-pager a,
.mn-pager strong,
.mn-pager b {
	display: inline-block;
	min-width: 38px;
	padding: 7px 12px;
	border: 1px solid var(--mn-line);
	border-radius: 9px;
	background: #fff;
	color: var(--mn-ink);
	font-weight: 600;
	text-align: center;
	text-decoration: none;
}

.mn-pager a:hover {
	border-color: var(--mn-accent);
	color: var(--mn-accent);
	text-decoration: none;
}

.mn-pager strong,
.mn-pager b {
	background: var(--mn-accent);
	border-color: var(--mn-accent);
	color: #fff;
}

/* ---------- صفحة الخبر / الفعالية ---------- */

.mn-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 32px;
	align-items: start;
}

.mn-article {
	background: #fff;
	border: 1px solid var(--mn-line);
	border-radius: var(--mn-radius);
	overflow: hidden;
	box-shadow: var(--mn-shadow);
}

.mn-article__media {
	position: relative;
	aspect-ratio: 16 / 7;
	background: #eef1f5;
}

@supports not (aspect-ratio: 16 / 7) {
	.mn-article__media {
		height: 0;
		padding-top: 43.75%;
	}
}

.mn-article__media img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mn-article__body {
	padding: 26px;
}

.mn-article h1 {
	margin: 0 0 14px;
	font-size: 27px;
	font-weight: 800;
	line-height: 1.55;
	color: var(--mn-ink);
}

.mn-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 20px;
	padding: 0;
	list-style: none;
}

.mn-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 13px;
	border-radius: 999px;
	background: #f3f5f8;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--mn-ink);
}

.mn-chip i {
	color: var(--mn-accent);
}

.mn-prose {
	font-size: 16px;
	line-height: 2.05;
	color: #39434f;
}

.mn-prose p {
	margin: 0 0 15px;
}

.mn-prose img {
	max-width: 100%;
	height: auto;
	border-radius: 10px;
}

.mn-prose table {
	max-width: 100%;
}

.mn-side {
	position: sticky;
	top: 20px;
	padding: 20px;
	background: #fff;
	border: 1px solid var(--mn-line);
	border-radius: var(--mn-radius);
	box-shadow: var(--mn-shadow);
}

.mn-side h4 {
	margin: 0 0 14px;
	font-size: 18px;
	font-weight: 800;
	color: var(--mn-ink);
}

.mn-side ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mn-side li {
	padding: 12px 0;
	border-bottom: 1px dashed var(--mn-line);
}

.mn-side li:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.mn-side a {
	display: block;
	color: var(--mn-ink);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.75;
	text-decoration: none;
}

.mn-side a:hover {
	color: var(--mn-accent);
	text-decoration: none;
}

.mn-when {
	display: block;
	margin-top: 5px;
	font-size: 12.5px;
	color: var(--mn-muted);
}

/* ---------- الشاشات الصغيرة ---------- */

@media (max-width: 991px) {
	.mn-layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.mn-side {
		position: static;
	}
}

@media (max-width: 575px) {
	.mn-wrap {
		padding-bottom: 36px;
	}

	.mn-grid {
		gap: 18px;
	}

	.mn-head {
		gap: 10px;
		margin-bottom: 18px;
	}

	.mn-head h2,
	.mn-head h3 {
		font-size: 21px;
	}

	.mn-card__body {
		padding: 15px;
	}

	.mn-article__body {
		padding: 18px;
	}

	.mn-article h1 {
		font-size: 22px;
	}

	.mn-tiles {
		grid-template-columns: repeat(auto-fill, minmax(min(100%, 148px), 1fr));
		gap: 10px;
	}

	.mn-tile__veil i {
		width: 44px;
		height: 44px;
		font-size: 16px;
	}

	.mn-filter {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		padding-bottom: 6px;
	}

	.mn-filter li {
		flex: 0 0 auto;
	}
}

@media (prefers-reduced-motion: reduce) {

	.mn-wrap *,
	.mn-wrap *::before,
	.mn-wrap *::after {
		transition: none !important;
		animation: none !important;
	}
}
