/**
 * Nostalji Köşesi — frontend stilleri
 *
 * Değişkenler :root'a değil widget köküne (.nostalji-kosesi) yazılıyor.
 * Global :root kullanmak, aynı sitedeki diğer eklentilerle isim çakışması
 * yaratıyor ve son yüklenen CSS diğerini eziyor.
 */

.nostalji-kosesi {
	--tn-accent: #e31e24;
	--tn-ink: #1f2933;
	--tn-muted: #6b7280;
	--tn-paper: #fdfaf4;
	--tn-line: #d9d2c6;
	--tn-radius: 12px;
	--tn-gap: 18px;
	--tn-cols: 4;
	--tn-ratio: 1;
	--tn-ease: cubic-bezier(.25, .46, .45, .94);

	box-sizing: border-box;
	width: 100%;
}

.nostalji-kosesi *,
.nostalji-kosesi *::before,
.nostalji-kosesi *::after {
	box-sizing: inherit;
}

/* Filtre kartları hidden ile gizleniyor; tema display kuralları ezmesin. */
.nostalji-kosesi [hidden] {
	display: none !important;
}

/* ==================================================================
   Düzenleyici uyarısı (ziyaretçi görmez)
   ================================================================== */

.nostalji-kosesi.tn-notice {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 24px;
	border: 2px dashed var(--tn-line);
	border-radius: 12px;
	background: #faf8f4;
	color: var(--tn-muted);
	font-size: 15px;
}

.tn-notice__icon {
	font-size: 22px;
	line-height: 1;
}

/* ==================================================================
   Izgara
   ================================================================== */

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

/* ==================================================================
   Kart
   ================================================================== */

.tn-card {
	position: relative;
	margin: 0;
	border-radius: var(--tn-radius);
	overflow: hidden;
	background: #11161b;
	box-shadow: 0 4px 18px rgba(17, 22, 27, .14);
	transition: transform .4s var(--tn-ease), box-shadow .4s var(--tn-ease);
}

.tn-card--clickable {
	cursor: pointer;
}

.tn-card--clickable:focus-visible {
	outline: 3px solid var(--tn-accent);
	outline-offset: 3px;
}

.tn-card__media {
	position: relative;
	aspect-ratio: var(--tn-ratio);
	overflow: hidden;
}

.tn-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .6s var(--tn-ease);
}

.tn-card--clickable:hover {
	transform: translateY(-6px);
	box-shadow: 0 18px 38px rgba(17, 22, 27, .26);
}

.tn-card--clickable:hover .tn-card__img {
	transform: scale(1.07);
}

/* Yıl rozeti */
.tn-card__badge {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 2;
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba(17, 22, 27, .72);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .04em;
	line-height: 1.5;
}

/* Alt yazı overlay'i */
.tn-card__caption {
	position: absolute;
	inset: auto 0 0 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 32px 16px 14px;
	background: linear-gradient(to top, rgba(10, 14, 18, .92) 0%, rgba(10, 14, 18, .55) 55%, rgba(10, 14, 18, 0) 100%);
	color: #fff;
	transform: translateY(12px);
	opacity: 0;
	transition: opacity .35s var(--tn-ease), transform .35s var(--tn-ease);
	pointer-events: none;
}

.tn-card:hover .tn-card__caption,
.tn-card:focus-visible .tn-card__caption,
.tn-card:focus-within .tn-card__caption {
	opacity: 1;
	transform: translateY(0);
}

/**
 * Dokunmatik cihazda hover yok — başlık/açıklama hiç görünmezdi.
 * Bu cihazlarda alt yazı kalıcı olarak açık duruyor.
 */
@media (hover: none) {

	.tn-card__caption {
		opacity: 1;
		transform: none;
	}
}

.tn-card__title {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}

.tn-card__desc {
	font-size: 13px;
	line-height: 1.5;
	color: rgba(255, 255, 255, .85);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Büyüteç rozeti */
.tn-zoom {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .94);
	color: var(--tn-accent);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .28);
	transform: translate(-50%, -50%) scale(.6);
	opacity: 0;
	transition: transform .35s var(--tn-ease), opacity .35s var(--tn-ease);
	pointer-events: none;
}

.tn-zoom svg {
	width: 22px;
	height: 22px;
}

.tn-card--clickable:hover .tn-zoom,
.tn-card--clickable:focus-visible .tn-zoom,
.tn-polaroid--clickable:hover .tn-zoom {
	transform: translate(-50%, -50%) scale(1);
	opacity: 1;
}

/* ==================================================================
   Zaman tüneli
   ================================================================== */

.tn-timeline {
	position: relative;
}

.tn-era {
	position: relative;
	padding: 0 0 44px 96px;
}

/* Dikey çizgi */
.tn-era::before {
	content: '';
	position: absolute;
	top: 8px;
	bottom: 0;
	left: 35px;
	width: 2px;
	background: var(--tn-line);
}

.tn-era:last-child {
	padding-bottom: 0;
}

.tn-era:last-child::before {
	bottom: auto;
	height: 40px;
	background: linear-gradient(to bottom, var(--tn-line), transparent);
}

.tn-era__marker {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 2;
	width: 96px;
	padding-right: 20px;
	text-align: left;
}

.tn-era__dot {
	position: absolute;
	top: 6px;
	left: 28px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--tn-accent);
	box-shadow: 0 0 0 4px #fff, 0 0 0 6px var(--tn-line);
}

.tn-era__year {
	display: block;
	font-size: 26px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: -.02em;
	color: var(--tn-ink);
}

.tn-era__count {
	display: block;
	margin-top: 6px;
	font-size: 12px;
	font-weight: 500;
	color: var(--tn-muted);
}

@media (max-width: 767px) {
	.tn-era {
		padding-left: 0;
		padding-bottom: 34px;
	}

	.tn-era::before {
		display: none;
	}

	.tn-era__marker {
		position: static;
		width: auto;
		margin-bottom: 14px;
		padding: 0 0 10px;
		border-bottom: 2px solid var(--tn-line);
	}

	.tn-era__dot {
		display: none;
	}

	.tn-era__year {
		font-size: 22px;
	}
}

/* ==================================================================
   Filtre çubuğu
   ================================================================== */

.tn-filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-bottom: 24px;
}

.tn-filter {
	padding: 9px 18px;
	border: 1px solid var(--tn-line);
	border-radius: 999px;
	background: transparent;
	color: var(--tn-ink);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	transition: background .25s var(--tn-ease), color .25s var(--tn-ease), border-color .25s var(--tn-ease);
}

.tn-filter:hover {
	border-color: var(--tn-accent);
	color: var(--tn-accent);
}

.tn-filter.is-active {
	background: var(--tn-accent);
	border-color: var(--tn-accent);
	color: #fff;
}

.tn-filter:focus-visible {
	outline: 3px solid var(--tn-accent);
	outline-offset: 2px;
}

.tn-no-result {
	margin: 28px 0 0;
	text-align: center;
	color: var(--tn-muted);
	font-size: 15px;
}

/* ==================================================================
   Polaroid kartlar
   ================================================================== */

.tn-polaroid {
	position: relative;
	margin: 0;
	padding: 12px 12px 0;
	border-radius: 3px;
	background: var(--tn-paper);
	box-shadow: 0 6px 20px rgba(31, 41, 51, .18);
	transition: transform .45s var(--tn-ease), box-shadow .45s var(--tn-ease);
}

.tn-polaroid--clickable {
	cursor: pointer;
}

.tn-polaroid--clickable:focus-visible {
	outline: 3px solid var(--tn-accent);
	outline-offset: 4px;
}

.tn-polaroids--tilt .tn-polaroid:nth-child(4n+1) { transform: rotate(-2.1deg); }
.tn-polaroids--tilt .tn-polaroid:nth-child(4n+2) { transform: rotate(1.5deg); }
.tn-polaroids--tilt .tn-polaroid:nth-child(4n+3) { transform: rotate(-1deg); }
.tn-polaroids--tilt .tn-polaroid:nth-child(4n+4) { transform: rotate(2.4deg); }

.tn-polaroid--clickable:hover,
.tn-polaroids--tilt .tn-polaroid--clickable:hover {
	transform: rotate(0deg) translateY(-10px) scale(1.03);
	box-shadow: 0 22px 44px rgba(31, 41, 51, .3);
	z-index: 2;
}

.tn-polaroid__frame {
	position: relative;
	aspect-ratio: var(--tn-ratio);
	overflow: hidden;
	background: #ddd6c8;
}

.tn-polaroid__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: sepia(var(--tn-sepia, 70%)) contrast(1.04) brightness(.98) saturate(.9);
	transition: filter .5s var(--tn-ease), transform .6s var(--tn-ease);
}

.tn-polaroids--colorize .tn-polaroid:hover .tn-polaroid__img {
	filter: sepia(0) contrast(1) brightness(1) saturate(1);
}

/* Dokunmatikte eğiklik kalsın ama sepya biraz hafiflesin. */
@media (hover: none) {

	.tn-polaroids--colorize .tn-polaroid__img {
		filter: sepia(calc(var(--tn-sepia, 70%) * .6)) contrast(1.02) brightness(1) saturate(.95);
	}
}

/* Eski baskı dokusu */
.tn-polaroid__frame::after {
	content: '';
	position: absolute;
	inset: 0;
	background:
		radial-gradient(ellipse at center, rgba(255, 240, 210, 0) 45%, rgba(92, 64, 30, .22) 100%);
	pointer-events: none;
	transition: opacity .5s var(--tn-ease);
}

.tn-polaroids--colorize .tn-polaroid:hover .tn-polaroid__frame::after {
	opacity: 0;
}

/* Bant süsü */
.tn-polaroids--tape .tn-polaroid::before {
	content: '';
	position: absolute;
	top: -10px;
	left: 50%;
	z-index: 3;
	width: 74px;
	height: 22px;
	transform: translateX(-50%) rotate(-3deg);
	background: rgba(226, 214, 178, .72);
	box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
	pointer-events: none;
}

.tn-polaroid__caption {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 12px 4px 16px;
	text-align: center;
	color: var(--tn-ink);
}

.tn-polaroid__title {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
}

.tn-polaroid__desc {
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--tn-muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.tn-polaroid__year {
	margin-top: 4px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .12em;
	color: var(--tn-accent);
}

/* ==================================================================
   Lightbox — body'ye eklenir, widget'ın içine değil
   ================================================================== */

.tn-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	opacity: 0;
	visibility: hidden;
	transition: opacity .3s ease, visibility .3s ease;

	--tn-accent: #e31e24;
	box-sizing: border-box;
}

.tn-lightbox *,
.tn-lightbox *::before,
.tn-lightbox *::after {
	box-sizing: border-box;
}

.tn-lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

.tn-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(8, 10, 13, .94);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
}

html.tn-lightbox-open {
	overflow: hidden;
}

.tn-lightbox__figure {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	max-width: min(1200px, 92vw);
	margin: 0;
	transform: scale(.94);
	transition: transform .35s cubic-bezier(.25, .46, .45, .94);
}

.tn-lightbox.is-open .tn-lightbox__figure {
	transform: scale(1);
}

.tn-lightbox__stage {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 120px;
	min-height: 120px;
}

.tn-lightbox__img {
	display: block;
	max-width: 92vw;
	max-height: 72vh;
	object-fit: contain;
	border-radius: 8px;
	box-shadow: 0 26px 70px rgba(0, 0, 0, .55);
	opacity: 0;
	transition: opacity .3s ease;
}

.tn-lightbox__img.is-loaded {
	opacity: 1;
}

.tn-lightbox__spinner {
	position: absolute;
	width: 42px;
	height: 42px;
	border: 3px solid rgba(255, 255, 255, .22);
	border-top-color: #fff;
	border-radius: 50%;
	animation: tn-spin .9s linear infinite;
}

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

.tn-lightbox__info {
	max-width: 680px;
	text-align: center;
	color: #fff;
}

.tn-lightbox__year {
	display: inline-block;
	margin-bottom: 6px;
	padding: 3px 12px;
	border-radius: 999px;
	background: var(--tn-accent);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .08em;
}

.tn-lightbox__title {
	margin: 0 0 6px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	color: #fff;
}

.tn-lightbox__desc {
	margin: 0;
	font-size: 14.5px;
	line-height: 1.6;
	color: rgba(255, 255, 255, .74);
}

.tn-lightbox__btn {
	position: absolute;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	cursor: pointer;
	transition: background .25s ease, transform .25s ease;
}

.tn-lightbox__btn:hover {
	background: var(--tn-accent);
}

.tn-lightbox__btn:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

.tn-lightbox__btn svg {
	width: 26px;
	height: 26px;
}

.tn-lightbox__close {
	top: 20px;
	right: 20px;
	width: 46px;
	height: 46px;
}

.tn-lightbox__close:hover {
	transform: rotate(90deg);
}

.tn-lightbox__nav {
	top: 50%;
	width: 54px;
	height: 54px;
	margin-top: -27px;
}

.tn-lightbox__prev {
	left: 20px;
}

.tn-lightbox__next {
	right: 20px;
}

.tn-lightbox__counter {
	position: absolute;
	bottom: 20px;
	left: 50%;
	z-index: 3;
	transform: translateX(-50%);
	padding: 5px 14px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .12);
	color: rgba(255, 255, 255, .82);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .04em;
}

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

	.tn-lightbox__img {
		max-height: 62vh;
	}

	.tn-lightbox__close {
		top: 12px;
		right: 12px;
		width: 40px;
		height: 40px;
	}

	.tn-lightbox__nav {
		width: 44px;
		height: 44px;
		margin-top: -22px;
	}

	.tn-lightbox__prev {
		left: 8px;
	}

	.tn-lightbox__next {
		right: 8px;
	}

	.tn-lightbox__btn svg {
		width: 22px;
		height: 22px;
	}

	.tn-lightbox__title {
		font-size: 17px;
	}

	.tn-lightbox__desc {
		font-size: 13.5px;
	}
}

/* ==================================================================
   Hareket azaltma tercihi
   ================================================================== */

@media (prefers-reduced-motion: reduce) {

	.nostalji-kosesi *,
	.tn-lightbox * {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}

	.tn-polaroids--tilt .tn-polaroid {
		transform: none !important;
	}
}

/* ==================================================================
   Albüm rozeti — çok fotoğraflı kayıtlarda kapak kartında
   ================================================================== */

.tn-card__album {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 9px;
	border-radius: 999px;
	background: rgba(17, 22, 27, .74);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.4;
	pointer-events: none;
}

.tn-card__album svg {
	width: 13px;
	height: 13px;
}

/* Albüm kartı: arkada istiflenmiş fotoğraf hissi */
.tn-card--album::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	border-radius: inherit;
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, .18) inset,
		6px -6px 0 -2px rgba(17, 22, 27, .18);
	pointer-events: none;
}

/* Polaroid'de rozet beyaz kenarın içine değil fotoğrafın üstüne otursun */
.tn-polaroid__album {
	top: 20px;
	right: 20px;
}

/**
 * Kart görselleri çerçeveyi TAM doldursun.
 *
 * Temaların ve Elementor'un `img { height: auto }` kuralları
 * (`.elementor img` gibi bizden daha özgül seçicilerle) yüksekliği
 * eziyor; görsel kendi oranında kalıp kartın altında koyu boşluk
 * bırakıyordu. Çerçeveyi biz tanımladığımız için burada ısrar ediyoruz.
 */
.nostalji-kosesi .tn-card__media > img,
.nostalji-kosesi .tn-polaroid__frame > img {
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	min-height: 0;
	object-fit: cover;
	display: block;
}
