/**
 * Türkiye proje haritası bölümü (payitaht/project-map bloğu ve onu saran ana sayfa bölümü).
 * Yalnız blok sayfada çıktı verdiğinde yüklenir (functions.php: payitaht_project_map_style).
 *
 * Masaüstü (≥ 900 px): harita ~%65, kart ~%35. Tablet (600–899 px): harita üstte, kart yatay.
 * Telefon: başlık → harita → şehir seçici → kart → Tüm Projelerimiz.
 */

.payitaht-map-section {
	--payitaht-map-land: #e2e5e9;
	--payitaht-map-project: #8a1c2b;
	--payitaht-map-project-hover: #a51c2f;
	--payitaht-map-selected: var(--wp--preset--color--payitaht-red);
	padding-top: clamp(2.5rem, 1.8rem + 2.4vw, 4rem);
	padding-bottom: clamp(2rem, 1.4rem + 2vw, 3.25rem);
	border-bottom: 1px solid var(--wp--preset--color--border-subtle);
}

.payitaht-map-section__head {
	margin-bottom: clamp(1.25rem, 0.8rem + 1.6vw, 2.25rem);
}

.payitaht-map-section__head > * {
	margin-block: 0;
}

.payitaht-map-section__head .is-style-payitaht-eyebrow {
	margin-bottom: 0.5rem;
}

.payitaht-map-section__lead {
	margin-top: 0.75rem !important;
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--medium);
}

.payitaht-map-section .payitaht-map-section__all {
	display: flex;
	justify-content: flex-end;
	margin-top: clamp(1.25rem, 0.9rem + 1.2vw, 2rem);
	padding-top: clamp(1rem, 0.8rem + 0.6vw, 1.25rem);
	border-top: 1px solid var(--wp--preset--color--border-subtle);
}

/* ------------------------------------------------------------------ */
/* Yerleşim                                                            */
/* ------------------------------------------------------------------ */

.payitaht-map {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas:
		"canvas"
		"picker"
		"card"
		"index";
	gap: 1rem;
	margin-block: 0;
}

.payitaht-map__canvas { grid-area: canvas; }
.payitaht-map__picker { grid-area: picker; }
.payitaht-map__card { grid-area: card; }
.payitaht-map__index { grid-area: index; }

@media (min-width: 900px) {
	.payitaht-map {
		grid-template-columns: minmax(0, 65fr) minmax(0, 35fr);
		grid-template-areas:
			"canvas card"
			"index index";
		column-gap: clamp(1.5rem, 3vw, 3.25rem);
		row-gap: 0.75rem;
		align-items: center;
	}

	.payitaht-map__picker {
		display: none;
	}
}

/* ------------------------------------------------------------------ */
/* Harita                                                              */
/* ------------------------------------------------------------------ */

.payitaht-map__canvas {
	position: relative;
	min-width: 0;
}

.payitaht-map__svg {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
}

.payitaht-map__province {
	fill: var(--payitaht-map-land);
	stroke: #fff;
	stroke-width: 0.8;
	stroke-linejoin: round;
	vector-effect: non-scaling-stroke;
}

.payitaht-map__province.has-projects {
	fill: var(--payitaht-map-project);
	cursor: pointer;
	outline: none;
	transition: fill 220ms ease;
	-webkit-tap-highlight-color: transparent;
}

.payitaht-map__province.has-projects:hover {
	fill: var(--payitaht-map-project-hover);
}

.payitaht-map__province.has-projects.is-selected {
	fill: var(--payitaht-map-selected);
}

/* Görünür odak: SVG yolunda outline yok; koyu kontur. */
.payitaht-map__province.has-projects:focus-visible {
	stroke: var(--wp--preset--color--text-main);
	stroke-width: 2.5;
}

/* Tek seferlik hafif seçilme vurgusu */
.payitaht-map__province.is-picked {
	animation: payitaht-map-pick 420ms ease-out 1;
}

@keyframes payitaht-map-pick {
	from {
		filter: brightness(1.22);
	}

	to {
		filter: brightness(1);
	}
}

/* Bilgi kutusu (üzerine gelince; konum JS'te harita alanı içinde sınırlanır) */
.payitaht-map__tip {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	padding: 0.45rem 0.7rem;
	border-radius: 2px;
	background: var(--wp--preset--color--text-main);
	color: #fff;
	font-size: 0.8125rem;
	line-height: 1.35;
	white-space: nowrap;
	pointer-events: none;
}

.payitaht-map__tip[hidden] {
	display: none;
}

.payitaht-map__tip span {
	color: rgba(255, 255, 255, 0.72);
}

.payitaht-map__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	margin: 1.25rem 0 0;
	padding: 0;
	list-style: none;
	color: var(--wp--preset--color--text-muted);
	font-size: 0.8125rem;
}

.payitaht-map__legend li::before {
	content: "";
	display: inline-block;
	width: 0.75rem;
	height: 0.75rem;
	margin-right: 0.5rem;
	vertical-align: -0.1em;
	background: var(--payitaht-map-project);
}

.payitaht-map__legend li.is-selected::before {
	background: var(--payitaht-map-selected);
}

/* ------------------------------------------------------------------ */
/* Şehir seçici (telefon / tablet)                                     */
/* ------------------------------------------------------------------ */

.payitaht-map__picker label {
	display: block;
	margin-bottom: 0.4rem;
	font-size: 0.8125rem;
	font-weight: 700;
}

.payitaht-map__select {
	width: 100%;
	min-height: 3rem;
	padding: 0.6rem 2.75rem 0.6rem 0.9rem;
	border: 1px solid var(--wp--preset--color--border-subtle);
	border-radius: 0;
	background: #fff right 0.9rem center / 1rem no-repeat;
	color: var(--wp--preset--color--text-main);
	font: inherit;
	font-size: 1rem;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%2319212c' stroke-width='1.6'/%3E%3C/svg%3E");
}

.payitaht-map__select:focus-visible {
	outline: 2px solid var(--wp--preset--color--text-main);
	outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Proje kartı                                                         */
/* ------------------------------------------------------------------ */

.payitaht-map__card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	border: 1px solid var(--wp--preset--color--border-subtle);
	background: var(--wp--preset--color--surface-white);
}

.payitaht-map__media {
	position: relative;
	aspect-ratio: 1.85;
	overflow: hidden;
	background: var(--wp--preset--color--surface-cool);
}

.payitaht-map__media img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 35%;
}

/* Kapak görseli yoksa: boş/siyah alan yerine açık zeminde mimari çizim. */
.payitaht-map__media.is-empty {
	background: var(--wp--preset--color--surface-warm) url("../img/architectural-sketch.svg") center bottom / auto 85% no-repeat;
}

.payitaht-map__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: clamp(1rem, 0.8rem + 0.6vw, 1.35rem) clamp(1rem, 0.8rem + 0.7vw, 1.5rem) 0;
}

/* Sabit içerik yüksekliği: kısa/uzun proje arasında geçişte kart boyu değişmez. */
.payitaht-map__content {
	min-height: 10.25rem;
}

.payitaht-map__content > * {
	margin: 0;
}

.payitaht-map__city {
	color: var(--wp--preset--color--payitaht-red);
	font-size: var(--wp--preset--font-size--label);
	font-weight: 700;
	letter-spacing: var(--wp--custom--letter-spacing--label);
	line-height: 1.4;
	text-transform: uppercase;
}

.payitaht-map__title {
	display: -webkit-box;
	margin-top: 0.35rem !important;
	overflow: hidden;
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.01em;
	overflow-wrap: anywhere;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.payitaht-map__title a {
	color: inherit;
	text-decoration: none;
}

.payitaht-map__title a:hover,
.payitaht-map__title a:focus-visible {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

.payitaht-map__location,
.payitaht-map__status {
	display: inline-block;
	margin-top: 0.55rem !important;
	margin-right: 1.1rem !important;
	color: var(--wp--preset--color--text-muted);
	font-size: 0.8125rem;
	line-height: 1.4;
}

.payitaht-map__location[hidden],
.payitaht-map__status[hidden] {
	display: none;
}

.payitaht-map__location::before,
.payitaht-map__status::before {
	content: "";
	display: inline-block;
	width: 1em;
	height: 1em;
	margin-right: 0.45em;
	vertical-align: -0.15em;
	background: var(--wp--preset--color--payitaht-red);
	-webkit-mask: var(--payitaht-icon-pin) center / contain no-repeat;
	mask: var(--payitaht-icon-pin) center / contain no-repeat;
}

.payitaht-map__status::before {
	background: var(--wp--preset--color--text-muted);
	-webkit-mask-image: var(--payitaht-icon-building);
	mask-image: var(--payitaht-icon-building);
}

.payitaht-map__text {
	display: -webkit-box;
	margin-top: 0.6rem !important;
	overflow: hidden;
	color: var(--wp--preset--color--text-muted);
	font-size: 0.9375rem;
	line-height: 1.5;
	overflow-wrap: anywhere;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.payitaht-map__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	min-height: 3.5rem;
	margin-top: auto;
	border-top: 1px solid var(--wp--preset--color--border-subtle);
}

.payitaht-map__more {
	display: inline-flex;
	align-items: center;
	min-height: 2.75rem;
	color: var(--wp--preset--color--text-main);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.35em;
}

.payitaht-map__more:hover,
.payitaht-map__more:focus-visible {
	color: var(--wp--preset--color--payitaht-red);
}

.payitaht-map__pager {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.payitaht-map__pager[hidden] {
	display: none;
}

.payitaht-map__counter {
	min-width: 3.25em;
	color: var(--wp--preset--color--text-muted);
	font-size: 0.8125rem;
	font-variant-numeric: tabular-nums;
	text-align: center;
}

.payitaht-map__nav {
	display: inline-grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: 1px solid var(--wp--preset--color--border-subtle);
	border-radius: 0;
	background: #fff;
	color: var(--wp--preset--color--text-main);
	cursor: pointer;
}

.payitaht-map__nav::before {
	content: "";
	width: 0.95rem;
	height: 0.95rem;
	background: currentColor;
	-webkit-mask: var(--payitaht-icon-arrow-e) center / contain no-repeat;
	mask: var(--payitaht-icon-arrow-e) center / contain no-repeat;
}

.payitaht-map__nav.is-prev::before {
	transform: scaleX(-1);
}

.payitaht-map__nav:hover {
	border-color: var(--wp--preset--color--payitaht-red);
	color: var(--wp--preset--color--payitaht-red);
}

.payitaht-map__nav:focus-visible {
	outline: 2px solid var(--wp--preset--color--text-main);
	outline-offset: 2px;
}

/* JS yoksa: seçici ve oklar çalışmaz, gizlenir; şehirlere göre proje listesi görünür. */
.payitaht-map__index {
	padding-top: 1rem;
	border-top: 1px solid var(--wp--preset--color--border-subtle);
	font-size: 0.875rem;
}

.payitaht-map__index ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.payitaht-map__index > ul {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
	gap: 0.75rem 1.5rem;
}

.payitaht-map__index-city {
	font-weight: 700;
}

.js .payitaht-map__index {
	display: none;
}

html:not(.js) .payitaht-map__picker,
html:not(.js) .payitaht-map__pager,
html:not(.js) .payitaht-map__legend .is-selected {
	display: none;
}

/* ------------------------------------------------------------------ */
/* Tablet: kart yatay (görsel solda)                                   */
/* ------------------------------------------------------------------ */

@media (min-width: 600px) and (max-width: 899px) {
	.payitaht-map__card {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}

	.payitaht-map__media {
		aspect-ratio: auto;
		min-height: 100%;
	}

	.payitaht-map__body {
		padding-top: 1.25rem;
	}
}

/* ------------------------------------------------------------------ */
/* Telefon                                                             */
/* ------------------------------------------------------------------ */

@media (max-width: 899px) {
	.payitaht-map__legend {
		display: none;
	}
}

@media (max-width: 599px) {
	.payitaht-map {
		gap: 0.875rem;
	}

	.payitaht-map__canvas {
		margin-inline: -0.25rem;
	}

	.payitaht-map__title {
		font-size: 1.25rem;
	}

	.payitaht-map__content {
		min-height: 9.5rem;
	}

	.payitaht-map-section .payitaht-map-section__all {
		justify-content: flex-start;
	}
}

@media (prefers-reduced-motion: reduce) {
	.payitaht-map__province.has-projects {
		transition: none;
	}

	.payitaht-map__province.is-picked {
		animation: none;
	}
}
