﻿/* Figma Node 6002:21178 — Post Text Image caption overlay */

.entry-content,
.article-post-content,
.guide-post-content,
.review-post-content,
.game-post-content,
.mod-post-content,
.news-post-body,
.ncp-post-body,
.gdp-post-body,
.mdp-post-body {
	overflow-wrap: anywhere;
	word-break: normal;
}

.entry-content figure,
.entry-content .wp-block-image,
.entry-content .wp-block-gallery,
.article-post-content figure,
.guide-post-content figure,
.review-post-content figure,
.game-post-content figure,
.mod-post-content figure,
.news-post-body figure,
.ncp-post-body figure,
.gdp-post-body figure,
.mdp-post-body figure {
	max-width: 100%;
}

.entry-content img,
.article-post-content img,
.guide-post-content img,
.review-post-content img,
.game-post-content img,
.mod-post-content img,
.news-post-body img,
.ncp-post-body img,
.gdp-post-body img,
.mdp-post-body img {
	display: block;
	max-width: 100%;
	height: auto;
	object-fit: contain;
}

.entry-content .wp-block-gallery,
.entry-content .blocks-gallery-grid {
	width: 100%;
	max-width: 100%;
	gap: 12px;
}

/* Gallery images: respect the WordPress image size (thumbnail, medium, large, full).
   Use max-width to prevent overflow, but width:auto so the browser renders at
   the actual pixel dimensions of the loaded image.  Cropped galleries (.is-cropped)
   are handled by core WP CSS with width:100% + object-fit:cover. */
.entry-content .wp-block-gallery:not(.is-cropped) img,
.entry-content .blocks-gallery-grid:not(.is-cropped) img {
	max-width: 100%;
	width: auto;
	height: auto;
}

.sc-caption-figure {
	margin: 0;
	padding: 0;
	max-width: 100%;
}

.sc-caption {
	position: relative;
	display: block;
	border-radius: 8px;
	overflow: hidden;
	width: 100%;
}

.sc-caption img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	object-fit: cover;
}

.sc-post-lightbox-trigger {
	cursor: zoom-in;
}

.sc-post-lightbox-trigger:focus-visible {
	outline: 2px solid #1081df;
	outline-offset: 3px;
}

.sc-post-lightbox-open {
	overflow: hidden;
}

.sc-post-lightbox {
	position: fixed;
	inset: 0;
	z-index: 5000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 64px 88px;
	background: rgba(8, 9, 12, 0.92);
	backdrop-filter: blur(8px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 220ms ease, visibility 220ms ease;
}

.sc-post-lightbox[hidden] {
	display: none;
}

.sc-post-lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

.sc-post-lightbox__stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	min-width: 0;
}

.sc-post-lightbox__image {
	display: block;
	width: auto;
	max-width: min(100%, 1280px);
	max-height: calc(100vh - 168px);
	height: auto;
	border-radius: 8px;
	object-fit: contain;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
	opacity: 0;
	transform: scale(0.985);
	transition: opacity 220ms ease, transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sc-post-lightbox__image.is-loaded {
	opacity: 1;
	transform: scale(1);
}

.sc-post-lightbox__close,
.sc-post-lightbox__nav {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(255, 255, 255, 0.16);
	background: rgba(28, 30, 34, 0.9);
	color: #ffffff;
	cursor: pointer;
	font-family: Arial, sans-serif;
	line-height: 1;
	transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.sc-post-lightbox__close:hover,
.sc-post-lightbox__close:focus-visible,
.sc-post-lightbox__nav:hover,
.sc-post-lightbox__nav:focus-visible {
	background: #1081df;
	border-color: #1081df;
	transform: translateY(-1px);
	outline: none;
}

.sc-post-lightbox__close {
	top: 24px;
	right: 24px;
	width: 44px;
	height: 44px;
	border-radius: 8px;
	font-size: 32px;
}

.sc-post-lightbox__nav {
	top: 50%;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	font-size: 42px;
	transform: translateY(-50%);
}

.sc-post-lightbox__nav:hover,
.sc-post-lightbox__nav:focus-visible {
	transform: translateY(calc(-50% - 1px));
}

.sc-post-lightbox__nav--prev {
	left: 24px;
}

.sc-post-lightbox__nav--next {
	right: 24px;
}

.sc-post-lightbox__caption,
.sc-post-lightbox__counter {
	position: absolute;
	font-family: 'Vazir', sans-serif;
	color: #ffffff;
	direction: rtl;
	text-align: center;
}

.sc-post-lightbox__caption {
	left: 50%;
	bottom: 24px;
	max-width: min(760px, calc(100vw - 48px));
	margin: 0;
	padding: 10px 14px;
	border-radius: 8px;
	background: rgba(28, 30, 34, 0.86);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.6;
	transform: translateX(-50%);
}

.sc-post-lightbox__counter {
	top: 30px;
	left: 50%;
	padding: 6px 10px;
	border-radius: 999px;
	background: rgba(28, 30, 34, 0.86);
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	transform: translateX(-50%);
}

.sc-caption__overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: flex-end;
	padding-top: 68px;
	padding-bottom: 16px;
	background: linear-gradient(to bottom, rgba(16, 17, 20, 0) 0%, #191a1e 100%);
	border-radius: 0 0 8px 8px;
}

.sc-caption__bar {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	width: 100%;
	padding-right: 8px;
	padding-left: 8px;
	border-right: 2px solid #1081df;
	box-sizing: border-box;
}

.sc-caption__text {
	flex: 1 0 0;
	font-family: 'Vazir', sans-serif;
	font-weight: 400;
	font-style: normal;
	font-size: 16px;
	line-height: 1.5;
	color: #ffffff;
	text-align: right;
	direction: rtl;
	white-space: pre-wrap;
	min-height: 1px;
	min-width: 1px;
	margin: 0;
	padding: 0;
}

figure.sc-caption-figure > figcaption {
	display: none !important;
}

@media (max-width: 768px) {
	.sc-caption__overlay {
		padding-top: 48px;
		padding-bottom: 12px;
	}

	.sc-caption__text {
		font-size: 14px;
	}

	.sc-post-lightbox {
		padding: 72px 16px 84px;
	}

	.sc-post-lightbox__image {
		max-height: calc(100vh - 180px);
	}

	.sc-post-lightbox__close {
		top: 16px;
		right: 16px;
		width: 44px;
		height: 44px;
	}

	.sc-post-lightbox__nav {
		bottom: 18px;
		top: auto;
		width: 46px;
		height: 46px;
		font-size: 36px;
		transform: none;
	}

	.sc-post-lightbox__nav:hover,
	.sc-post-lightbox__nav:focus-visible {
		transform: translateY(-1px);
	}

	.sc-post-lightbox__nav--prev {
		left: 24px;
	}

	.sc-post-lightbox__nav--next {
		right: 24px;
	}

	.sc-post-lightbox__caption {
		bottom: 76px;
		font-size: 13px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sc-post-lightbox,
	.sc-post-lightbox__image,
	.sc-post-lightbox__close,
	.sc-post-lightbox__nav,
	.sc-post-lightbox-trigger {
		transition: none;
	}
}

@media (max-width: 480px) {
	.sc-caption__overlay {
		padding-top: 32px;
		padding-bottom: 10px;
	}

	.sc-caption__text {
		font-size: 13px;
	}
}
