/* =========================================================
   IG Reels Albüm — ön yüz
   ========================================================= */

.igra-wrap {
	margin: 0 0 1.5em;
}

/* ---------- Instagram profil ızgarası ---------- */

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

.igra-tile {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: var(--igra-ratio, 9 / 16);
	background: #efefef;
	color: #fff;
	text-decoration: none !important;
	box-shadow: none !important;
	-webkit-tap-highlight-color: transparent;
}

@supports not (aspect-ratio: 9 / 16) {
	.igra-tile {
		height: 0;
		padding-top: 177.78%;
	}
}

.igra-tile__img,
.igra-tile__ph {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	margin: 0;
	border: 0;
	border-radius: 0;
	transition: transform .35s ease;
}

.igra-tile__ph {
	background: linear-gradient(45deg, #f09433, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888);
}

/* Kapak görseli indirilemediğinde: Instagram'ın kendi oynatıcısı kapak olarak
   kullanılır, üst/alt şeritleri kırpılır. Ölçek katsayısını public.js hesaplar. */
.igra-tile__frame {
	position: absolute;
	inset: 0;
	overflow: hidden;
	background: #000;
}

.igra-tile__frame iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 326px;   /* Instagram gömme oynatıcısının en küçük genişliği */
	height: 780px;
	border: 0;
	display: block;
	background: #000;
	pointer-events: none;
	transform-origin: top left;
	transform: scale(var(--igra-fs, 1)) translateY(calc(-1 * var(--igra-crop, 54px)));
}

.igra-tile:hover .igra-tile__img {
	transform: scale(1.04);
}

/* Alt karartma: yazılar her zeminde okunsun */
.igra-tile__shade {
	position: absolute;
	inset: auto 0 0 0;
	height: 45%;
	background: linear-gradient(to top, rgba(0, 0, 0, .45), rgba(0, 0, 0, 0));
	pointer-events: none;
}

/* Sağ üstteki reels ikonu */
.igra-tile__reel {
	position: absolute;
	top: 8px;
	right: 8px;
	line-height: 0;
	color: #fff;
	filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .5));
	pointer-events: none;
}

/* Sol alttaki izlenme sayısı */
.igra-tile__views {
	position: absolute;
	left: 9px;
	bottom: 8px;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: .2px;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
	pointer-events: none;
}

/* Üzerine gelince beğeni / yorum */
.igra-tile__stats {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 26px;
	background: rgba(0, 0, 0, .35);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	opacity: 0;
	transition: opacity .2s ease;
	pointer-events: none;
}

.igra-tile__stats span {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.igra-tile:hover .igra-tile__stats,
.igra-tile:focus-visible .igra-tile__stats {
	opacity: 1;
}

@media (hover: none) {
	.igra-tile__stats {
		display: none;
	}
}

@media (max-width: 480px) {
	.igra-tile__views {
		font-size: 12px;
		left: 7px;
		bottom: 6px;
	}
}

/* ---------- Lightbox ---------- */

.igra-lb {
	--igra-lb-w: min(92vw, calc((86vh - 96px) * 0.5625), 420px);
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .92);
	opacity: 0;
	transition: opacity .18s ease;
}

.igra-lb.is-open {
	opacity: 1;
}

.igra-lb__box {
	position: relative;
	z-index: 1;
	width: var(--igra-lb-w);
}

.igra-lb__frame {
	position: relative;
	width: 100%;
	height: calc(var(--igra-lb-w) * 1.7778 + 96px);
	max-height: 90vh;
	background: #000;
	border-radius: 14px;
	overflow: hidden;
}

.igra-lb__frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
	background: #fff;
}

.igra-lb__spin {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 34px;
	height: 34px;
	margin: -17px 0 0 -17px;
	border: 3px solid rgba(255, 255, 255, .25);
	border-top-color: #fff;
	border-radius: 50%;
	animation: igra-spin .8s linear infinite;
}

@keyframes igra-spin {
	to { transform: rotate(360deg); }
}

.igra-lb__btn {
	position: absolute;
	z-index: 3; /* Her zaman videonun üstünde kalsın */
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, .55);
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	backdrop-filter: blur(2px);
	transition: background .15s ease;
}

.igra-lb__btn:hover {
	background: rgba(0, 0, 0, .8);
}

.igra-lb__close {
	top: 16px;
	right: 16px;
	position: fixed;
	width: 44px;
	height: 44px;
	background: #ed4956; /* Instagram kırmızısı */
	color: #fff;
	font-size: 26px;
	font-weight: 600;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}

.igra-lb__close:hover {
	background: #c62b38;
}

.igra-lb__prev,
.igra-lb__next {
	top: 50%;
	transform: translateY(-50%);
	position: fixed;
}

.igra-lb__prev { left: 16px; }
.igra-lb__next { right: 16px; }

.igra-lb__btn[hidden] { display: none; }

.igra-lb__link {
	display: block;
	margin-top: 12px;
	color: rgba(255, 255, 255, .85);
	font-size: 13px;
	text-align: center;
	text-decoration: none;
}

.igra-lb__link:hover {
	color: #fff;
	text-decoration: underline;
}

@media (max-width: 782px) {
	.igra-lb__btn {
		width: 32px;
		height: 32px;
		font-size: 18px;
	}

	.igra-lb__close {
		width: 32px;
		height: 32px;
		top: 10px;
		right: 10px;
		font-size: 20px;
	}

	.igra-lb__prev { left: 4px; }
	.igra-lb__next { right: 4px; }
}

body.igra-lb-open {
	overflow: hidden;
}

/* ---------- Klasik gömme görünümü (layout="embed") ---------- */

.igra-grid {
	display: flex;
	flex-wrap: wrap;
	gap: var(--igra-gap, 18px);
	margin: 0 0 1.5em;
	padding: 0;
	list-style: none;
}

.igra-item {
	flex: 0 1 calc((100% - (var(--igra-cols, 3) - 1) * var(--igra-gap, 18px)) / var(--igra-cols, 3));
	min-width: 280px;
	max-width: 540px;
	position: relative;
	background: #fafafa;
	border-radius: 12px;
	overflow: hidden;
}

.igra-item--auto {
	height: 0;
	padding-top: calc(177.78% + 96px);
}

.igra-item--fixed {
	height: var(--igra-height, 620px);
}

.igra-item iframe {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	min-width: 0 !important;
	max-width: none !important;
	border: 0;
	margin: 0;
	display: block;
}

@media (max-width: 600px) {
	.igra-item {
		flex: 1 1 100%;
		min-width: 0;
		max-width: none;
	}
}
