/**
 * Article Tools Refsam - Frontend styles.
 * All classes start with: artref
 */

/* ===== بطاقة الكاتب والناشر والمحرر ===== */
.artref-byline {
	direction: rtl;
	margin: 0 0 30px;
	padding: 16px 20px;
	border: 1px solid #e2e2e2;
	border-inline-start: 4px solid #d43a3a;
	border-radius: 10px;
	background: linear-gradient(135deg, #ffffff, #f7f7f9);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
	font-family: inherit;
	/* إضافة انتقال سلس لجميع الخصائص المتغيرة */
	transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* تأثير hover ثلاثي الأبعاد */
.artref-byline:hover {
	transform: translateY(-6px) scale(1.01);
	box-shadow:
		0 20px 40px rgba(0, 0, 0, 0.25),
		0 10px 20px rgba(0, 0, 0, 0.15),
		0 4px 8px rgba(0, 0, 0, 0.08);
	/* يمكن إضافة تغيير لون الحدود لإبراز الحركة */
	border-color: #000;
}

.artref-byline-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
}

.artref-byline-info {
	flex: 1 1 auto;
	min-width: 180px;
}

.artref-byline-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 4px 0;
}

.artref-byline-label {
	display: inline-block;
	min-width: 52px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.3px;
	color: #8a8a8a;
}

.artref-byline-value {
	font-size: 14px;
	font-weight: 600;
	color: #222222;
}

.artref-byline-author {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

.artref-byline-avatar img {
	display: block;
	width: 120px;
	height: 120px;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid #ffffff;
	box-shadow: 0 0 0 2px #d43a3a, 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* اسم الكاتب: شارة بارزة (نافر) أسفل الصورة */
.artref-byline-name {
	display: inline-block;
	max-width: 100%;
	padding: 6px 14px;
	border-radius: 8px;
	font-weight: 800;
	line-height: 1.4;
	text-align: center;
	color: #ffffff;
	background-color: #d43a3a;
	text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25), 0 3px 6px rgba(0, 0, 0, 0.35);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 3px 8px rgba(0, 0, 0, 0.3);
	transition: transform 0.15s ease;
}

.artref-byline-name:hover {
	transform: translateY(-2px);
}

/* ===== عداد مشاهدات المقال ===== */
.artref-views-items {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 0 0 20px;
}

.artref-views-item {
	display: flex;
	align-items: center;
	gap: 3px;
	padding: 3px;
	border: 1px solid #ececec;
	border-radius: 6px;
	background: #fafafa;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
	white-space: nowrap;
}

.artref-views-label {
	font-size: 11px;
	font-weight: 600;
	color: #8a8a8a;
}

.artref-views-eye {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
	color: #d43a3a;
}

.artref-views-eye svg {
	display: block;
	width: 14px;
	height: 14px;
}

.artref-views-value {
	font-size: 13px;
	font-weight: 800;
	color: #d43a3a;
	unicode-bidi: plaintext;
}

/* ===== العلامة المائية ===== */
.artref-watermark {
	position: absolute;
	z-index: 5;
	height: auto;
	max-width: none;
	pointer-events: none;
	opacity: 0.75;
	line-height: 0;
}

.artref-watermark-top-left {
	top: 12px;
	left: 12px;
}

.artref-watermark-top-right {
	top: 12px;
	right: 12px;
}

.artref-watermark-bottom-left {
	bottom: 12px;
	left: 12px;
}

.artref-watermark-bottom-right {
	bottom: 12px;
	right: 12px;
}

/* ===== معرض الصور والسلايدر ===== */
.artref-gallery-wrap,
.artref-slider {
	margin: 1.5em 0;
}

.artref-gallery-title {
	display: inline-block;
	margin: 0 0 14px;
	font-weight: 800;
	line-height: 1.4;
}

/* شبكة المعرض: 3 أعمدة شاشات كبيرة / 2 متوسطة / 1 موبايل */
.artref-gallery-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	align-items: start;
	gap: 12px;
}

/* البطاقة: عرض عمود الشبكة، وارتفاعها هو ارتفاع الصورة (رقم الناشر) */
.artref-gallery-item {
	display: block;
	margin: 0;
	overflow: hidden;
	border-radius: 12px;
	background: #f2f2f2;
	border: 1px solid #e6e6e6;
	box-shadow:
		0 3px 8px rgba(0, 0, 0, 0.08),
		0 1px 2px rgba(0, 0, 0, 0.05);
	transition:
		transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
		box-shadow 0.3s ease,
		border-color 0.3s ease;
}

/* الوضع 100%: الصورة على عرض البطاقة كاملاً، وارتفاعها هو رقم الناشر (مع اقتصاص) */
.artref-gallery-item img {
	display: block;
	width: 100%;
	height: var(--atr-gallery-height, 250px);
	object-fit: cover;
	transition: transform 0.45s ease;
}

.artref-gallery-item:hover {
	transform: translateY(-8px) scale(1.03);
	border-color: #000;
	box-shadow:
		0 24px 48px rgba(0, 0, 0, 0.25),
		0 12px 24px rgba(0, 0, 0, 0.16),
		0 5px 10px rgba(0, 0, 0, 0.08);
}

.artref-gallery-item:hover img {
	transform: scale(1.07);
}

/* وضع auto: الصورة بارتفاعها الثابت وعرضها الطبيعي، موسّطة أفقياً.
   الصورة الرأسية تتوسط البطاقة ويبقى فراغ على الجانبين دون اقتصاص. */
.artref-gallery-wrap[data-width="auto"] .artref-gallery-item img {
	width: auto;
	height: var(--atr-gallery-height, 250px);
	max-width: none;
	margin: 0 auto;
}

@media (max-width: 900px) {
	.artref-gallery-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.artref-gallery-grid {
		grid-template-columns: repeat(1, 1fr);
	}
}

/* السلايدر: حاوية قابلة لإعادة التحجيم */
.artref-slider-viewport {
	position: relative;
	overflow: hidden;
	resize: both;
	min-width: 240px;
	min-height: 160px;
	direction: ltr;
	border-radius: 12px;
	background: #000;
	border: 1px solid #e6e6e6;
	box-shadow:
		0 8px 20px rgba(0, 0, 0, 0.2),
		0 2px 6px rgba(0, 0, 0, 0.1);
	transition: box-shadow 0.3s ease, transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.artref-slider:hover .artref-slider-viewport {
	transform: translateY(-4px) scale(1.01);
	box-shadow:
		0 28px 54px rgba(0, 0, 0, 0.28),
		0 12px 24px rgba(0, 0, 0, 0.18);
}

.artref-slider-track {
	display: flex;
	align-items: stretch;
	height: 100%;
	transition: transform 0.5s ease;
}

.artref-slide {
	flex: 0 0 100%;
	min-width: 100%;
	height: 100%;
}

.artref-slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* وضع auto: الصورة تملأ ارتفاع الحاوية كاملاً بعرضها الطبيعي وتتوسط أفقياً */
.artref-slider[data-width="auto"] .artref-slide img {
	width: auto;
	height: 100%;
	max-width: 100%;
	margin: 0 auto;
}

.artref-slider-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.45);
	color: #ffffff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.artref-slider-arrow:hover {
	background: rgba(0, 0, 0, 0.7);
}

.artref-slider-prev {
	left: 10px;
}

.artref-slider-next {
	right: 10px;
}

@media (max-width: 600px) {
	.artref-byline-meta {
		flex-direction: column-reverse;
		align-items: flex-start;
	}
}

/* ===== أزرار حجم الخط العائمة (+ / -) ===== */
.artref-fontctl {
	position: fixed;
	top: 50%;
	left: 50%;
	z-index: 99999;
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 6px;
	border-radius: 999px;
	direction: ltr;
	box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
	user-select: none;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translate(-50%, -50%) scale(0.9);
	transition:
		opacity 0.3s ease,
		transform 0.3s ease,
		visibility 0.3s ease,
		background-color 0.3s ease,
		color 0.3s ease;
}

.artref-fontctl.is-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translate(-50%, -50%) scale(1);
}

.artref-fontctl button {
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.22);
	color: inherit;
	font-family: inherit;
	font-size: 24px;
	font-weight: 800;
	line-height: 1;
	cursor: pointer;
	transition: transform 0.15s ease, background-color 0.15s ease;
}

.artref-fontctl button:hover {
	transform: scale(1.12);
	background: rgba(255, 255, 255, 0.35);
}

.artref-fontctl button:active {
	transform: scale(0.94);
}
