/* ============================================================
   CERES Hizmet Vitrini — Ön yüz (galeri / vitrin bileşeni)
   Tasarım, wrapper'a inline yazılan CSS değişkenleriyle kontrol
   edilir; böylece admin panelinden renk/boyut/fon ayarlanabilir.
   ============================================================ */

.chv-vitrin {
	/* Varsayılanlar — admin panel bunları inline override eder */
	--chv-accent: #47AB27;
	--chv-card-w: 300px;
	--chv-radius: 16px;
	--chv-gap: 20px;
	--chv-title-size: 18px;
	--chv-desc-size: 14px;
	--chv-ratio: 4 / 3;
	--chv-scrim: 0.55;
	--chv-scrim-rgb: 10, 14, 8;

	/* Tema (açık) */
	--chv-card-bg: #ffffff;
	--chv-text: #15181c;
	--chv-muted: #6b7280;
	--chv-border: #e6e9e4;
	--chv-media-bg: color-mix(in srgb, var(--chv-accent) 10%, #ffffff);
	--chv-fade: #f6f8f4;
	--chv-shadow: 0 1px 2px rgba(16, 24, 16, 0.04);
	--chv-shadow-hover: 0 18px 38px rgba(16, 24, 16, 0.14);

	color: var(--chv-text);
	max-width: 1240px;
	margin: 0 auto;
	position: relative;
	box-sizing: border-box;
	font-family: inherit;
	container-type: inline-size;
	container-name: chv;
}
.chv-vitrin *, .chv-vitrin *::before, .chv-vitrin *::after { box-sizing: border-box; }

/* ---------- Fon modları ---------- */
.chv-vitrin.chv-bg-dark {
	--chv-card-bg: #1b1f17;
	--chv-text: #eef1ea;
	--chv-muted: #9aa392;
	--chv-border: #2c3326;
	--chv-media-bg: color-mix(in srgb, var(--chv-accent) 22%, #10140d);
	--chv-fade: #10140d;
	--chv-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
	--chv-shadow-hover: 0 18px 40px rgba(0, 0, 0, 0.45);
	background: #10140d;
	padding: 26px 22px;
	border-radius: calc(var(--chv-radius) + 6px);
}
.chv-vitrin.chv-bg-light {
	--chv-fade: #f6f8f4;
	background: #f6f8f4;
	padding: 26px 22px;
	border-radius: calc(var(--chv-radius) + 6px);
}
.chv-vitrin.chv-bg-transparent { --chv-fade: transparent; background: transparent; padding: 0; }

/* color-mix desteklemeyen eski tarayıcılar için güvenli fallback */
@supports not (background: color-mix(in srgb, red 10%, white)) {
	.chv-vitrin { --chv-media-bg: #eef6ea; }
	.chv-vitrin.chv-bg-dark { --chv-media-bg: #1f271a; }
}

/* ---------- Başlık ---------- */
.chv-vitrin .chv-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin: 0 0 18px;
}
.chv-vitrin .chv-title {
	font-size: clamp(20px, 2.4vw, 27px);
	font-weight: 700;
	letter-spacing: -0.01em;
	margin: 0;
	color: var(--chv-text);
}
.chv-vitrin .chv-title::after {
	content: "";
	display: block;
	width: 46px;
	height: 3px;
	margin-top: 10px;
	border-radius: 3px;
	background: var(--chv-accent);
}

/* ---------- Carousel (kayar) düzen ---------- */
.chv-vitrin .chv-carousel { position: relative; }
/* Kenarlarda solma: daha fazla kart olduğunu hissettirir, kaydırmaya teşvik eder */
.chv-vitrin.chv-layout-carousel .chv-carousel::before,
.chv-vitrin.chv-layout-carousel .chv-carousel::after {
	content: ""; position: absolute; top: 0; bottom: 14px; width: 54px;
	z-index: 3; pointer-events: none; opacity: 1; transition: opacity 0.25s ease;
}
.chv-vitrin.chv-layout-carousel .chv-carousel::before { left: 0; background: linear-gradient(to right, var(--chv-fade) 12%, transparent); }
.chv-vitrin.chv-layout-carousel .chv-carousel::after { right: 0; background: linear-gradient(to left, var(--chv-fade) 12%, transparent); }
.chv-vitrin.chv-layout-carousel .chv-carousel.chv-at-start::before { opacity: 0; }
.chv-vitrin.chv-layout-carousel .chv-carousel.chv-at-end::after { opacity: 0; }
.chv-vitrin.chv-bg-transparent .chv-carousel::before,
.chv-vitrin.chv-bg-transparent .chv-carousel::after { display: none; }
.chv-vitrin .chv-track {
	display: flex;
	gap: var(--chv-gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	padding: 4px 2px 16px;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: var(--chv-accent) transparent;
}
.chv-vitrin .chv-track:focus { outline: none; }
.chv-vitrin .chv-track::-webkit-scrollbar { height: 7px; }
.chv-vitrin .chv-track::-webkit-scrollbar-track { background: transparent; }
.chv-vitrin .chv-track::-webkit-scrollbar-thumb { background: var(--chv-border); border-radius: 10px; }
.chv-vitrin .chv-track::-webkit-scrollbar-thumb:hover { background: var(--chv-accent); }
.chv-vitrin .chv-track.chv-dragging { cursor: grabbing; scroll-behavior: auto; }
.chv-vitrin .chv-track.chv-dragging .chv-card { pointer-events: none; }
.chv-vitrin .chv-carousel .chv-card { flex: 0 0 var(--chv-card-w); scroll-snap-align: start; }

/* ---------- Grid (ızgara) düzen ---------- */
.chv-vitrin.chv-layout-grid .chv-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(var(--chv-card-w), 1fr));
	gap: var(--chv-gap);
}

/* ---------- Kart ---------- */
.chv-vitrin .chv-card {
	display: flex;
	flex-direction: column;
	background: var(--chv-card-bg);
	border: 1px solid var(--chv-border);
	border-radius: var(--chv-radius);
	overflow: hidden;
	text-decoration: none !important;
	color: inherit !important;
	box-shadow: var(--chv-shadow);
	transition: transform 0.28s cubic-bezier(.2,.7,.3,1), box-shadow 0.28s ease, border-color 0.28s ease;
}
.chv-vitrin .chv-card:hover,
.chv-vitrin .chv-card:focus-visible {
	transform: translateY(-5px);
	box-shadow: var(--chv-shadow-hover);
	border-color: color-mix(in srgb, var(--chv-accent) 55%, var(--chv-border));
}

/* Medya alanı (foto veya ikon) */
.chv-vitrin .chv-media {
	position: relative;
	aspect-ratio: var(--chv-ratio);
	overflow: hidden;
	background: var(--chv-media-bg);
}
.chv-vitrin .chv-media-img {
	width: 100%; height: 100%;
	object-fit: cover; display: block;
	transition: transform 0.55s ease;
}
.chv-vitrin .chv-card:hover .chv-media-img { transform: scale(1.05); }

/* İkon döşemesi */
.chv-vitrin .chv-media-icon {
	width: 100%; height: 100%;
	display: flex; align-items: center; justify-content: center;
	color: var(--chv-accent);
}
.chv-vitrin .chv-media-icon svg {
	width: 42%; height: 42%;
	max-width: 110px; max-height: 110px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: transform 0.4s cubic-bezier(.2,.7,.3,1);
}
.chv-vitrin .chv-card:hover .chv-media-icon svg { transform: scale(1.08) translateY(-2px); }

/* Rozet */
.chv-vitrin .chv-rozet {
	position: absolute; top: 12px; left: 12px;
	background: var(--chv-accent); color: #fff;
	font-size: 11.5px; font-weight: 700; line-height: 1;
	letter-spacing: 0.02em;
	padding: 6px 10px; border-radius: 100px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

/* Gövde */
.chv-vitrin .chv-body {
	padding: 16px 18px 18px;
	display: flex; flex-direction: column; flex: 1 1 auto;
}
.chv-vitrin .chv-card-title {
	font-size: var(--chv-title-size);
	font-weight: 650;
	line-height: 1.3;
	margin: 0 0 6px;
	color: var(--chv-text);
}
.chv-vitrin .chv-card-desc {
	font-size: var(--chv-desc-size);
	line-height: 1.55;
	color: var(--chv-muted);
	margin: 0 0 14px;
	flex: 1 1 auto;
}
.chv-vitrin .chv-cta {
	display: inline-flex; align-items: center; gap: 6px;
	font-size: calc(var(--chv-desc-size) + 0.5px);
	font-weight: 650;
	color: var(--chv-accent);
	margin-top: auto;
}
.chv-vitrin .chv-cta svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.2s ease; }
.chv-vitrin .chv-card:hover .chv-cta svg { transform: translateX(4px); }

/* ---------- Ok butonları (sadece carousel) ---------- */
.chv-vitrin .chv-nav {
	position: absolute; top: 40%; transform: translateY(-50%);
	width: 44px; height: 44px; padding: 0;
	border: 1px solid var(--chv-border);
	border-radius: 50%;
	background: var(--chv-card-bg);
	color: var(--chv-accent);
	cursor: pointer; z-index: 4;
	display: flex; align-items: center; justify-content: center;
	box-shadow: 0 6px 18px rgba(0,0,0,0.12);
	transition: background 0.15s ease, color 0.15s ease, opacity 0.2s ease, transform 0.12s ease;
}
.chv-vitrin .chv-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.chv-vitrin .chv-nav:hover { background: var(--chv-accent); color: #fff; border-color: var(--chv-accent); }
.chv-vitrin .chv-nav:active { transform: translateY(-50%) scale(0.93); }
.chv-vitrin .chv-prev { left: -14px; }
.chv-vitrin .chv-next { right: -14px; }
.chv-vitrin .chv-nav[disabled] { opacity: 0; pointer-events: none; }

/* ---------- Boş durum ---------- */
.chv-vitrin .chv-empty {
	padding: 22px; border-radius: var(--chv-radius);
	background: var(--chv-media-bg);
	border: 1px dashed color-mix(in srgb, var(--chv-accent) 40%, var(--chv-border));
	color: var(--chv-muted);
}

/* ---------- Responsive ---------- */
@container chv (max-width: 880px) {
	.chv-vitrin .chv-nav { display: none !important; }
	.chv-vitrin .chv-carousel .chv-card { flex-basis: min(78%, 320px); }
}
@container chv (max-width: 480px) {
	.chv-vitrin .chv-carousel .chv-card { flex-basis: 86%; }
}
@media (max-width: 480px) {
	.chv-vitrin.chv-bg-dark, .chv-vitrin.chv-bg-light { padding: 18px 14px; }
}

@media (prefers-reduced-motion: reduce) {
	.chv-vitrin .chv-card,
	.chv-vitrin .chv-media-img,
	.chv-vitrin .chv-media-icon svg,
	.chv-vitrin .chv-cta svg,
	.chv-vitrin .chv-track { transition: none; scroll-behavior: auto; }
}

/* ============================================================
   EK DÜZENLER + "GÖRSEL ÜZERİNDE YAZI" STİLİ (v3.1)
   ============================================================ */
.chv-vitrin { --chv-scrim: 0.55; }

/* ---------- Kompakt: ikon öne çıkan, ortalanmış küçük kutucuklar ---------- */
.chv-vitrin.chv-layout-kompakt .chv-kompakt {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
	gap: var(--chv-gap);
}
.chv-vitrin.chv-layout-kompakt .chv-card { align-items: center; text-align: center; padding: 20px 14px 18px; }
.chv-vitrin.chv-layout-kompakt .chv-media {
	width: 66px; height: 66px; aspect-ratio: 1; border-radius: 50%;
	flex: 0 0 auto; margin-bottom: 12px;
}
.chv-vitrin.chv-layout-kompakt .chv-media-icon svg { width: 48%; height: 48%; }
.chv-vitrin.chv-layout-kompakt .chv-media-img { border-radius: 50%; }
.chv-vitrin.chv-layout-kompakt .chv-body { padding: 0; align-items: center; flex: 0 0 auto; }
.chv-vitrin.chv-layout-kompakt .chv-card-title { font-size: calc(var(--chv-title-size) - 2px); margin: 0; }
.chv-vitrin.chv-layout-kompakt .chv-card-desc { display: none; }
.chv-vitrin.chv-layout-kompakt .chv-cta { display: none; }
.chv-vitrin.chv-layout-kompakt .chv-rozet { top: 8px; left: 8px; }

/* ---------- Mozaik (bento): ilk kart büyük, hepsi görsel-dolu ---------- */
.chv-vitrin.chv-layout-mozaik .chv-mozaik {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(var(--chv-card-w), 1fr));
	grid-auto-rows: 200px;
	grid-auto-flow: dense;
	gap: var(--chv-gap);
}
.chv-vitrin.chv-layout-mozaik .chv-mozaik > .chv-card:first-child { grid-column: span 2; grid-row: span 2; }
.chv-vitrin.chv-layout-mozaik .chv-card { height: 100%; position: relative; }
.chv-vitrin.chv-layout-mozaik .chv-media { position: absolute; inset: 0; aspect-ratio: auto; height: 100%; width: 100%; }
.chv-vitrin.chv-layout-mozaik .chv-body {
	position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
	padding: 44px 16px 16px;
	background: linear-gradient(to top, rgba(var(--chv-scrim-rgb), calc(var(--chv-scrim) + 0.2)) 0%, rgba(var(--chv-scrim-rgb), var(--chv-scrim)) 45%, rgba(var(--chv-scrim-rgb), 0) 100%);
}
.chv-vitrin.chv-layout-mozaik .chv-card-title { color: #fff; }
.chv-vitrin.chv-layout-mozaik .chv-card-desc { color: rgba(255,255,255,0.9); }
.chv-vitrin.chv-layout-mozaik .chv-cta { color: #fff; }
.chv-vitrin.chv-layout-mozaik .chv-media-icon { color: #fff; opacity: 0.92; }

/* ---------- Liste (geniş yatay kartlar) ---------- */
.chv-vitrin.chv-layout-liste .chv-liste { display: flex; flex-direction: column; gap: var(--chv-gap); }
.chv-vitrin.chv-layout-liste .chv-card { flex-direction: row; align-items: stretch; }
.chv-vitrin.chv-layout-liste .chv-media { flex: 0 0 240px; width: 240px; aspect-ratio: auto; }
.chv-vitrin.chv-layout-liste .chv-media-img { height: 100%; }
.chv-vitrin.chv-layout-liste .chv-body { justify-content: center; padding: 18px 22px; }
.chv-vitrin.chv-layout-liste .chv-card-desc { margin-bottom: 10px; }
@container chv (max-width: 600px) {
	.chv-vitrin.chv-layout-liste .chv-card { flex-direction: column; }
	.chv-vitrin.chv-layout-liste .chv-media { flex-basis: auto; width: 100%; aspect-ratio: var(--chv-ratio); }
}

/* ---------- "Görsel üzerinde yazı" stili (overlay) — mozaik ve liste hariç ---------- */
.chv-vitrin.chv-style-overlay:not(.chv-layout-liste):not(.chv-layout-mozaik):not(.chv-layout-kompakt) .chv-card { position: relative; aspect-ratio: var(--chv-ratio); display: block; }
.chv-vitrin.chv-style-overlay:not(.chv-layout-liste):not(.chv-layout-mozaik):not(.chv-layout-kompakt) .chv-media { position: absolute; inset: 0; aspect-ratio: auto; height: 100%; width: 100%; }
.chv-vitrin.chv-style-overlay:not(.chv-layout-liste):not(.chv-layout-mozaik):not(.chv-layout-kompakt) .chv-body {
	position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
	padding: 48px 16px 16px;
	background: linear-gradient(to top, rgba(var(--chv-scrim-rgb), calc(var(--chv-scrim) + 0.2)) 0%, rgba(var(--chv-scrim-rgb), var(--chv-scrim)) 45%, rgba(var(--chv-scrim-rgb), 0) 100%);
}
.chv-vitrin.chv-style-overlay:not(.chv-layout-liste):not(.chv-layout-mozaik):not(.chv-layout-kompakt) .chv-card-title { color: #fff; }
.chv-vitrin.chv-style-overlay:not(.chv-layout-liste):not(.chv-layout-mozaik):not(.chv-layout-kompakt) .chv-card-desc { color: rgba(255,255,255,0.9); }
.chv-vitrin.chv-style-overlay:not(.chv-layout-liste):not(.chv-layout-mozaik):not(.chv-layout-kompakt) .chv-cta { color: #fff; }
.chv-vitrin.chv-style-overlay:not(.chv-layout-liste):not(.chv-layout-mozaik):not(.chv-layout-kompakt) .chv-media-icon { color: #fff; opacity: 0.92; }

@container chv (max-width: 600px) {
	.chv-vitrin.chv-layout-mozaik .chv-mozaik { grid-template-columns: 1fr 1fr; grid-auto-rows: 150px; }
	.chv-vitrin.chv-layout-kompakt .chv-kompakt { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

/* ---------- Izgara: sabit sütun sayısı (masaüstü) ---------- */
.chv-vitrin.chv-fixedcols .chv-grid { grid-template-columns: repeat(var(--chv-cols), minmax(0, 1fr)); }
/* Mobil (dar alan) için ayrı sütun sayısı */
@container chv (max-width: 680px) {
	.chv-vitrin.chv-fixedcols-m .chv-grid { grid-template-columns: repeat(var(--chv-cols-m), minmax(0, 1fr)); }
}

/* ============================================================
   TEMA SIZINTISINA KARŞI SAĞLAMLAŞTIRMA
   Site teması kartların görünümünü bozmasın diye kritik
   özellikleri kilitler (büyük harf, link oku, görsel gölgesi…).
   ============================================================ */
.chv-vitrin .chv-title,
.chv-vitrin .chv-card-title,
.chv-vitrin .chv-card-desc,
.chv-vitrin .chv-cta {
	text-transform: none !important;
	letter-spacing: normal !important;
	font-style: normal !important;
	text-shadow: none !important;
}
.chv-vitrin .chv-card-title { line-height: 1.3 !important; }

/* Kart linkleri: alt çizgi / kutu gölgesi / alt çizgi-kenarlık olmasın */
.chv-vitrin a,
.chv-vitrin a:hover,
.chv-vitrin a:focus {
	text-decoration: none !important;
	box-shadow: none !important;
	border-bottom: 0 !important;
	background-image: none !important;
}
/* Temanın linklere/kartlara eklediği ok vb. ::before/::after işaretlerini kaldır
   (carousel kenar solması .chv-carousel üzerindedir, etkilenmez) */
.chv-vitrin a::before,
.chv-vitrin a::after,
.chv-vitrin .chv-card::before,
.chv-vitrin .chv-card::after,
.chv-vitrin .chv-media::before,
.chv-vitrin .chv-media::after {
	content: none !important;
	display: none !important;
}

/* Görsellerde tema gölgesi / çerçevesi / hover filtresi / zoom olmasın */
.chv-vitrin img {
	box-shadow: none !important;
	border: 0 !important;
	filter: none !important;
	background: none !important;
	max-width: 100%;
}
.chv-vitrin .chv-card:hover img,
.chv-vitrin a:hover img { filter: none !important; }

/* Olası tema liste stilleri sızmasın */
.chv-vitrin ul, .chv-vitrin ol, .chv-vitrin li {
	list-style: none !important;
	margin: 0; padding: 0;
}
