/**
 * DPSSIM Gallery + News Gallery frontend styles. All scoped to .dpssim-scope.
 */

/* ---------- Category cards ---------- */
.dpssim-scope .dpssim-gallery-cards {
	display: grid;
	grid-template-columns: repeat(var(--dpssim-cols, 3), 1fr);
	gap: 24px;
}
.dpssim-scope .dpssim-gallery-card {
	background: #ffffff;
	border: 1px solid #e4e9f4;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 6px 20px rgba(13, 30, 90, 0.06);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	display: flex;
	flex-direction: column;
}
.dpssim-scope .dpssim-gallery-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 14px 32px rgba(13, 30, 90, 0.12);
}
.dpssim-scope .dpssim-gallery-card-media,
.dpssim-scope .dpssim-gallery-item,
.dpssim-scope .dpssim-news-featured-media,
.dpssim-scope .dpssim-news-card-media {
	display: block;
	position: relative;
	overflow: hidden;
	background: var(--dpssim-soft, #eef4ff);
}
.dpssim-scope .dpssim-gallery-card-media img,
.dpssim-scope .dpssim-gallery-item img,
.dpssim-scope .dpssim-news-featured-media img,
.dpssim-scope .dpssim-news-card-media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.dpssim-scope .dpssim-gallery-noimg {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #9fb0d4;
}
.dpssim-scope .dpssim-gallery-noimg svg { width: 42px; height: 42px; }
.dpssim-scope .dpssim-gallery-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.dpssim-scope .dpssim-gallery-card-title { margin: 0; font-size: 18px; line-height: 1.3; color: var(--dpssim-primary, #30369d); }
.dpssim-scope .dpssim-gallery-card-count { margin: 0; font-size: 13px; color: #6b7aa0; }
.dpssim-scope .dpssim-gallery-open,
.dpssim-scope .dpssim-news-view {
	margin-top: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: #2F3096;
	color: #ffffff !important;
	border: 2px solid #2F3096;
	border-radius: 8px;
	padding: 10px 16px;
	min-height: 44px;
	font-weight: 700;
	font-size: 14px;
	text-decoration: none;
	line-height: 1.2;
	transition: all 0.3s ease;
	align-self: flex-start;
}
.dpssim-scope .dpssim-gallery-open span,
.dpssim-scope .dpssim-news-view span { color: inherit; }
.dpssim-scope .dpssim-gallery-open:hover,
.dpssim-scope .dpssim-gallery-open:focus,
.dpssim-scope .dpssim-news-view:hover,
.dpssim-scope .dpssim-news-view:focus {
	background: #F4B500;
	border-color: #F4B500;
	color: #0d1e5a !important;
	transform: translateY(-1px);
}
.dpssim-scope .dpssim-gallery-open:focus-visible,
.dpssim-scope .dpssim-news-view:focus-visible { outline: 3px solid #0d1e5a; outline-offset: 2px; }
.dpssim-scope .dpssim-gallery-open .dpssim-ic { width: 16px; height: 16px; }

/* ---------- Category / news detail ---------- */
.dpssim-scope .dpssim-gallery-detail-head { margin-bottom: 20px; }
.dpssim-scope .dpssim-gallery-detail-title { margin: 12px 0 6px; color: var(--dpssim-primary, #30369d); font-size: 26px; }
.dpssim-scope .dpssim-gallery-detail-desc { margin: 0; color: #52627f; max-width: 760px; }
.dpssim-scope .dpssim-gallery-back {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #ffffff;
	color: var(--dpssim-primary, #30369d) !important;
	border: 2px solid var(--dpssim-primary, #30369d);
	border-radius: 8px;
	padding: 9px 16px;
	min-height: 44px;
	font-weight: 700;
	font-size: 14px;
	text-decoration: none;
	transition: all 0.3s ease;
}
.dpssim-scope .dpssim-gallery-back:hover,
.dpssim-scope .dpssim-gallery-back:focus {
	background: #F4B500;
	border-color: #F4B500;
	color: #0d1e5a !important;
}
.dpssim-scope .dpssim-gallery-back:focus-visible { outline: 3px solid #0d1e5a; outline-offset: 2px; }

.dpssim-scope .dpssim-gallery-grid {
	display: grid;
	grid-template-columns: repeat(var(--dpssim-cols, 3), 1fr);
	gap: 16px;
}
.dpssim-scope .dpssim-gallery-item { border-radius: 12px; cursor: zoom-in; border: 1px solid #e4e9f4; }
.dpssim-scope .dpssim-gallery-item:focus-visible { outline: 3px solid var(--dpssim-accent, #f2b900); outline-offset: 2px; }

/* ---------- Lightbox ---------- */
body.dpssim-no-scroll { overflow: hidden; }
.dpssim-gallery-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(8, 16, 42, 0.92);
	padding: 24px;
}
.dpssim-gallery-lightbox.is-open { display: flex; }
.dpssim-gallery-lb-inner {
	position: relative;
	max-width: 96vw;
	max-height: 92vh;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
}
.dpssim-gallery-figure { margin: 0; text-align: center; max-width: 88vw; }
.dpssim-gallery-lb-img { max-width: 88vw; max-height: 82vh; width: auto; height: auto; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.dpssim-gallery-lb-cap { color: #eaf0ff; font-size: 14px; margin-top: 12px; }
.dpssim-gallery-close,
.dpssim-gallery-prev,
.dpssim-gallery-next {
	position: absolute;
	background: rgba(255, 255, 255, 0.12);
	color: #ffffff;
	border: none;
	border-radius: 50%;
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s ease;
}
.dpssim-gallery-close:hover,
.dpssim-gallery-prev:hover,
.dpssim-gallery-next:hover { background: #F4B500; color: #0d1e5a; }
.dpssim-gallery-close:focus-visible,
.dpssim-gallery-prev:focus-visible,
.dpssim-gallery-next:focus-visible { outline: 3px solid #F4B500; outline-offset: 2px; }
.dpssim-gallery-close[disabled],
.dpssim-gallery-prev[disabled],
.dpssim-gallery-next[disabled] { opacity: 0.35; cursor: default; }
.dpssim-gallery-close { top: -8px; right: -8px; }
.dpssim-gallery-prev { left: -8px; top: 50%; transform: translateY(-50%); }
.dpssim-gallery-next { right: -8px; top: 50%; transform: translateY(-50%); }

/* ---------- News featured ---------- */
.dpssim-scope .dpssim-news-featured {
	display: grid;
	grid-template-columns: 1.15fr 1fr;
	gap: 26px;
	align-items: center;
	background: #ffffff;
	border: 1px solid #e4e9f4;
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 8px 26px rgba(13, 30, 90, 0.08);
	margin-bottom: 30px;
}
.dpssim-scope .dpssim-news-featured-media { border-radius: 0; height: 100%; }
.dpssim-scope .dpssim-news-featured-body { padding: 26px 28px 26px 4px; }
.dpssim-scope .dpssim-news-featured-title { margin: 10px 0 8px; font-size: 24px; color: var(--dpssim-primary, #30369d); line-height: 1.25; }
.dpssim-scope .dpssim-news-featured-desc { margin: 0 0 16px; color: #52627f; }
.dpssim-scope .dpssim-news-date {
	display: inline-block;
	background: var(--dpssim-soft, #eef4ff);
	color: var(--dpssim-primary, #30369d);
	border-radius: 999px;
	padding: 4px 12px;
	font-size: 12px;
	font-weight: 700;
	border-left: 3px solid var(--dpssim-accent, #f2b900);
}

/* ---------- News slider ---------- */
.dpssim-scope .dpssim-news-slider { position: relative; display: flex; align-items: center; gap: 8px; }
.dpssim-scope .dpssim-news-viewport { overflow: hidden; flex: 1; }
.dpssim-scope .dpssim-news-track { display: flex; gap: 20px; transition: transform 0.35s ease; }
.dpssim-scope .dpssim-news-card {
	flex: 0 0 calc((100% - (var(--dpssim-news-pv, 3) - 1) * 20px) / var(--dpssim-news-pv, 3));
	background: #ffffff;
	border: 1px solid #e4e9f4;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 6px 18px rgba(13, 30, 90, 0.06);
	display: flex;
	flex-direction: column;
}
.dpssim-scope .dpssim-news-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.dpssim-scope .dpssim-news-card-title { margin: 4px 0 0; font-size: 16px; color: var(--dpssim-primary, #30369d); line-height: 1.3; }
.dpssim-scope .dpssim-news-view-small {
	margin-top: 10px;
	padding: 8px 14px;
	min-height: 40px;
	font-size: 13px;
}
.dpssim-scope .dpssim-news-arrow {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 2px solid var(--dpssim-primary, #30369d);
	background: #ffffff;
	color: var(--dpssim-primary, #30369d);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all 0.2s ease;
}
.dpssim-scope .dpssim-news-arrow:hover { background: #F4B500; border-color: #F4B500; color: #0d1e5a; }
.dpssim-scope .dpssim-news-arrow:focus-visible { outline: 3px solid #0d1e5a; outline-offset: 2px; }
.dpssim-scope .dpssim-news-arrow[disabled] { opacity: 0.35; cursor: default; }
.dpssim-scope .dpssim-news-slider.dpssim-news-static .dpssim-news-arrow { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.dpssim-scope .dpssim-gallery-cards { grid-template-columns: repeat(2, 1fr); gap: 18px; }
	.dpssim-scope .dpssim-gallery-grid { grid-template-columns: repeat(2, 1fr); }
	.dpssim-scope .dpssim-news-featured { grid-template-columns: 1fr; }
	.dpssim-scope .dpssim-news-featured-media { aspect-ratio: 16/9 !important; }
	.dpssim-scope .dpssim-news-featured-body { padding: 20px 22px; }
}
@media (max-width: 600px) {
	.dpssim-scope .dpssim-gallery-cards { grid-template-columns: 1fr; }
	.dpssim-scope .dpssim-gallery-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
	.dpssim-scope .dpssim-gallery-open,
	.dpssim-scope .dpssim-news-view,
	.dpssim-scope .dpssim-gallery-back { min-height: 46px; }
	.dpssim-gallery-close { top: 4px; right: 4px; }
	.dpssim-gallery-prev { left: 2px; }
	.dpssim-gallery-next { right: 2px; }
	.dpssim-gallery-prev, .dpssim-gallery-next { width: 44px; height: 44px; }
}
@media (max-width: 360px) {
	.dpssim-scope .dpssim-gallery-grid { grid-template-columns: 1fr; }
}
