/**
 * Shared pieces for the page widgets.
 *
 * Sits on top of chrome.css, which provides the reset and the colour
 * variables (--main, --surface, --line, --soft) on every `.roghan-w`.
 * Layout is driven by two variables the widget controls write:
 * --roghan-cols (items per row) and --roghan-gap (space between them).
 */

.roghan-w {
	--roghan-cols: 4;
	--roghan-gap: 20px;
	--roghan-radius: 14px;
	--ink: #1f2a3a;
	color: var(--ink);
	font-size: 14px;
	line-height: 1.8;
}

.roghan-w [hidden] { display: none !important; }

/* ---------- grid ---------- */

.roghan-grid {
	display: grid;
	grid-template-columns: repeat(var(--roghan-cols), minmax(0, 1fr));
	gap: var(--roghan-gap);
}

/* ---------- card ---------- */

.roghan-card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: var(--roghan-radius);
	background: #fff;
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.roghan-card:hover {
	border-color: color-mix(in srgb, var(--main) 35%, var(--line));
	box-shadow: 0 10px 30px -18px rgba(24, 54, 97, .45);
}

.roghan-card-media {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	background: var(--surface);
}

.roghan-card-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .35s ease;
}

.roghan-card:hover .roghan-card-media img { transform: scale(1.04); }

.roghan-card-body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 6px;
	padding: 14px 16px 16px;
}

.roghan-card-title {
	margin: 0;
	color: var(--ink);
	font-size: 14.5px;
	font-weight: 700;
	line-height: 1.7;
}

.roghan-card-title a { color: inherit; }
.roghan-card-title a:hover { color: var(--main); }

.roghan-card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	color: var(--soft);
	font-size: 12px;
}

.roghan-card-text {
	margin: 0;
	color: var(--soft);
	font-size: 13px;
	line-height: 1.9;
}

.roghan-card-foot {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: auto;
	padding-top: 8px;
}

/* ---------- buttons ---------- */

.roghan-wbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 40px;
	padding: 9px 18px;
	border: 1px solid var(--main);
	border-radius: 10px;
	background: var(--main);
	color: #fff !important;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	text-decoration: none !important;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}

.roghan-wbtn:hover,
.roghan-wbtn:focus-visible {
	background: color-mix(in srgb, var(--main) 82%, #000);
	border-color: color-mix(in srgb, var(--main) 82%, #000);
}

.roghan-wbtn:focus-visible { outline: 2px solid var(--main); outline-offset: 2px; }

.roghan-wbtn:disabled,
.roghan-wbtn[aria-disabled="true"] {
	opacity: .5;
	cursor: not-allowed;
}

.roghan-wbtn.is-ghost {
	background: transparent;
	color: var(--main) !important;
}

.roghan-wbtn.is-ghost:hover { background: var(--main); color: #fff !important; }

.roghan-wbtn.is-block { width: 100%; }

.roghan-wbtn svg,
.roghan-wbtn i { flex: 0 0 auto; }

/* ---------- badges ---------- */

.roghan-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 10px;
	border-radius: 999px;
	background: var(--surface);
	color: var(--main);
	font-size: 11.5px;
	font-weight: 700;
	line-height: 1.8;
}

.roghan-badge.is-stopped { background: #fdecec; color: #b42318; }

.roghan-card-media .roghan-badge {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
}

/* ---------- stars ---------- */

.roghan-stars { display: inline-flex; gap: 2px; color: #f5a524; }
.roghan-stars svg { width: 15px; height: 15px; }
.roghan-stars .is-empty { color: #d7dce4; }

/* ---------- carousel ---------- */

.roghan-carousel { position: relative; }

.roghan-carousel-track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - (var(--roghan-cols) - 1) * var(--roghan-gap)) / var(--roghan-cols));
	gap: var(--roghan-gap);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.roghan-carousel-track::-webkit-scrollbar { display: none; }

.roghan-carousel-slide {
	min-width: 0;
	scroll-snap-align: start;
}

.roghan-carousel.is-fade .roghan-carousel-track {
	display: grid;
	grid-auto-flow: row;
	grid-auto-columns: auto;
	grid-template-columns: 100%;
	overflow: hidden;
}

.roghan-carousel.is-fade .roghan-carousel-slide {
	grid-area: 1 / 1;
	opacity: 0;
	visibility: hidden;
	transition: opacity .6s ease, visibility .6s;
}

.roghan-carousel.is-fade .roghan-carousel-slide.is-active,
.roghan-carousel.is-fade:not(.is-ready) .roghan-carousel-slide:first-child {
	opacity: 1;
	visibility: visible;
}

.roghan-carousel-nav {
	position: absolute;
	top: 50%;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin-top: -20px;
	padding: 0;
	border: 1px solid var(--line);
	border-radius: 50%;
	background: #fff;
	color: var(--main);
	box-shadow: 0 6px 18px -10px rgba(0, 0, 0, .4);
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease, opacity .2s ease;
}

.roghan-carousel-nav:hover { background: var(--main); color: #fff; }
.roghan-carousel-nav:disabled { opacity: .35; cursor: default; }
.roghan-carousel-nav[data-carousel-prev] { right: -8px; }
.roghan-carousel-nav[data-carousel-next] { left: -8px; }

.roghan-carousel-dots {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-top: 16px;
}

.roghan-carousel-dot {
	width: var(--roghan-dot, 8px);
	height: var(--roghan-dot, 8px);
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: var(--roghan-dot-color, #c9d1dd);
	cursor: pointer;
	transition: width .25s ease, background-color .25s ease;
}

.roghan-carousel-dot.is-active {
	width: calc(var(--roghan-dot, 8px) * 3);
	background: var(--roghan-dot-active, var(--main));
}

/* ---------- marquee ---------- */

.roghan-marquee { overflow: hidden; }

.roghan-marquee-track {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: var(--roghan-gap);
	width: max-content;
}

.roghan-marquee.is-running .roghan-marquee-track {
	animation: roghan-marquee var(--roghan-marquee-duration, 30s) linear infinite;
}

.roghan-marquee.pause-on-hover:hover .roghan-marquee-track { animation-play-state: paused; }

/* The page reads right to left, so the strip travels towards the right. */
@keyframes roghan-marquee {
	from { transform: translateX(0); }
	to { transform: translateX(calc(50% + var(--roghan-gap) / 2)); }
}

[dir="ltr"] .roghan-marquee.is-running .roghan-marquee-track { animation-direction: reverse; }

/* ---------- accordion ---------- */

.roghan-acc-item {
	border-bottom: 1px solid var(--line);
}

.roghan-acc-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	padding: 14px 0;
	border: 0;
	background: none;
	color: var(--ink);
	font: inherit;
	font-weight: 700;
	text-align: right;
	cursor: pointer;
}

/* The theme's and Elementor's own button styles (dark fill, white text) must not reach the questions. */
.roghan-w .roghan-faq .roghan-acc-toggle,
.roghan-w .roghan-faq .roghan-acc-toggle:hover,
.roghan-w .roghan-faq .roghan-acc-toggle:focus,
.roghan-w .roghan-faq .roghan-acc-toggle:active {
	display: flex !important;
	width: 100% !important;
	min-width: 0;
	margin: 0;
	padding: 14px 0;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	text-transform: none;
	text-align: right;
	text-decoration: none;
	color: var(--ink);
}

.roghan-w .roghan-faq .roghan-acc-toggle:focus-visible { outline: 2px solid var(--main, #183661); outline-offset: 2px; }
.roghan-w .roghan-faq .roghan-faq-q { margin: 0; font-size: inherit; line-height: inherit; }
.roghan-acc-title { flex: 1 1 auto; min-width: 0; text-align: right; }

.roghan-acc-icon {
	flex: 0 0 auto;
	display: inline-flex;
	transition: transform .25s ease;
}

.roghan-acc-icon .is-open-icon { display: none; }
.roghan-acc-item.is-open .roghan-acc-icon .is-open-icon { display: inline-flex; }
.roghan-acc-item.is-open .roghan-acc-icon .is-closed-icon { display: none; }
.roghan-acc-item.is-open .roghan-acc-icon.is-rotate { transform: rotate(180deg); }

.roghan-acc-panel { padding: 0 0 16px; color: var(--soft); }

/* ---------- tabs ---------- */

.roghan-tabs-strip {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	border-bottom: 1px solid var(--line);
}

.roghan-tabs-strip.is-center { justify-content: center; }
.roghan-tabs-strip.is-full > * { flex: 1 1 0; }

.roghan-tab-btn {
	position: relative;
	padding: 12px 18px;
	border: 0;
	background: none;
	color: var(--soft);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.roghan-tab-btn::after {
	content: '';
	position: absolute;
	right: 0;
	bottom: -1px;
	left: 0;
	height: var(--roghan-tab-line, 2px);
	background: var(--roghan-tab-line-color, var(--main));
	transform: scaleX(0);
	transition: transform .25s ease;
}

.roghan-tab-btn.is-active { color: var(--main); }
.roghan-tab-btn.is-active::after { transform: scaleX(1); }

.roghan-tab-panel { display: none; padding: 20px 0; }
.roghan-tab-panel.is-active { display: block; }

.roghan-tab-mobile-btn { display: none; }

@media (max-width: 767px) {
	.roghan-tabs.is-mobile-accordion .roghan-tabs-strip { display: none; }

	.roghan-tabs.is-mobile-accordion .roghan-tab-mobile-btn {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
		padding: 14px 0;
		border: 0;
		border-bottom: 1px solid var(--line);
		background: none;
		color: var(--ink);
		font: inherit;
		font-weight: 700;
		cursor: pointer;
	}

	.roghan-tabs.is-mobile-accordion .roghan-tab-mobile-btn::after {
		content: '+';
		font-size: 18px;
		line-height: 1;
	}

	.roghan-tabs.is-mobile-accordion .roghan-tab-mobile-btn.is-active { color: var(--main); }
	.roghan-tabs.is-mobile-accordion .roghan-tab-mobile-btn.is-active::after { content: '−'; }
}

/* ---------- lightbox ---------- */

.roghan-lock { overflow: hidden; }

.roghan-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px 64px;
	background: rgba(10, 18, 30, .92);
	direction: rtl;
}

.roghan-lightbox-figure { margin: 0; max-width: 100%; max-height: 100%; }

.roghan-lightbox-figure img {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 80px);
	object-fit: contain;
	border-radius: 8px;
}

.roghan-lightbox button {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.roghan-lightbox button:hover { background: rgba(255, 255, 255, .25); }
.roghan-lightbox-close { top: 16px; left: 16px; }
.roghan-lightbox-prev { top: 50%; right: 12px; margin-top: -22px; }
.roghan-lightbox-next { top: 50%; left: 12px; margin-top: -22px; }
.roghan-lightbox.is-single .roghan-lightbox-prev,
.roghan-lightbox.is-single .roghan-lightbox-next { display: none; }

@media (max-width: 767px) {
	.roghan-lightbox { padding: 60px 12px; }
}

/* ---------- toast ---------- */

.roghan-toast {
	position: fixed;
	bottom: 90px;
	left: 50%;
	z-index: 999999;
	padding: 10px 18px;
	border-radius: 10px;
	background: #1f2a3a;
	color: #fff;
	font-size: 13px;
	opacity: 0;
	pointer-events: none;
	transform: translate(-50%, 10px);
	transition: opacity .2s ease, transform .2s ease;
	direction: rtl;
}

.roghan-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- empty state ---------- */

.roghan-w-empty {
	padding: 18px;
	border: 1px dashed var(--line);
	border-radius: 12px;
	color: var(--soft);
	font-size: 13px;
	text-align: center;
}

@media (prefers-reduced-motion: reduce) {
	.roghan-w *,
	.roghan-w *::before,
	.roghan-w *::after {
		transition: none !important;
		animation: none !important;
	}
}
