/**
 * Arama: başlıktaki açılır arama, sonuç sayfası başlığı ve "sonuç yok" kartı.
 * Tüm arama kutuları (.gridlove-search-form) aynı görünümü paylaşır.
 * Etiket ve metinler inc/theme-tweaks.php içindeki Gridlove çeviri ayarlarından gelir.
 */

/* Arama kutusu: alan ve düğme tek bir çerçevede (tema açılır menüde forma 25 px dolgu verir; o da aşılır) */
.gridlove-search-form,
.sub-menu form.gridlove-search-form {
	display: flex;
	align-items: stretch;
	gap: var(--ufb-space-1);
	width: 100%;
	padding: var(--ufb-space-1);
	border: 1px solid var(--ufb-line-strong);
	border-radius: 12px;
	background: var(--ufb-card);
	transition: border-color var(--ufb-ease), box-shadow var(--ufb-ease);
}

.gridlove-search-form:focus-within {
	border-color: var(--ufb-navy);
	box-shadow: 0 0 0 3px rgba(245, 197, 24, .55);
}

.gridlove-search-form input[name="s"],
body.search .gridlove-search-form input[name="s"],
.gridlove-not-found .gridlove-search-form input[name="s"] {
	flex: 1 1 auto;
	width: auto;
	min-width: 0;
	max-width: none;
	height: 44px;
	margin: 0;
	padding: 0 12px 0 40px;
	border: 0;
	border-radius: 9px;
	background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6478' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px 50% / 18px 18px;
	box-shadow: none;
	color: var(--ufb-text);
	font: 500 16px / 1.2 var(--ufb-font); /* 16 px: iOS odaklanınca sayfayı yakınlaştırmaz */
}

.gridlove-search-form input[name="s"]::placeholder {
	color: var(--ufb-muted);
	opacity: 1;
}

.gridlove-search-form input[name="s"]:focus {
	box-shadow: none;
	outline: 0;
}

.gridlove-search-form .gridlove-button-search,
body.search .gridlove-search-form .gridlove-button-search,
.sub-menu .gridlove-search-form .gridlove-button-search,
:is(.gridlove-header-middle, .gridlove-header-sticky, .gridlove-header-responsive) .gridlove-search-form .gridlove-button-search {
	flex: none;
	width: auto;
	height: 44px;
	min-height: 44px;
	margin: 0;
	padding: 0 20px;
	border-radius: 9px;
	background: var(--ufb-yellow);
	box-shadow: none;
	color: var(--ufb-navy);
	font: 700 15px / 1 var(--ufb-font-ui);
	letter-spacing: .3px;
	text-transform: none;
}

.gridlove-search-form .gridlove-button-search:hover,
:is(.gridlove-header-middle, .gridlove-header-sticky, .gridlove-header-responsive) .gridlove-search-form .gridlove-button-search:hover {
	background: var(--ufb-yellow-dark);
	box-shadow: none;
}

.gridlove-search-form .gridlove-button-search:focus-visible {
	outline: 2px solid var(--ufb-navy);
	outline-offset: 2px;
}

/* Başlıktaki açılır arama: menü panelleriyle aynı beyaz kart */
:is(.gridlove-header-middle, .gridlove-header-sticky) .gridlove-action-search .sub-menu {
	width: 400px;
	padding: var(--ufb-space-3);
	border: 1px solid var(--ufb-line);
	border-radius: 12px;
	background: var(--ufb-card);
	box-shadow: inset 0 3px 0 var(--ufb-yellow), 0 18px 40px rgba(0, 2, 45, .18), 0 2px 6px rgba(0, 2, 45, .08);
}

.gridlove-action-search .sub-menu li,
.gridlove-action-search .sub-menu form.gridlove-search-form {
	width: 100%;
	padding-right: 0;
	padding-left: 0;
}

.gridlove-action-search .sub-menu form.gridlove-search-form {
	padding: var(--ufb-space-1);
}

/* Kart içinde ikinci bir çerçeve gerekmez; çerçeve odakta belirginleşir */
:is(.gridlove-header-middle, .gridlove-header-sticky) .gridlove-action-search .gridlove-search-form {
	border-color: var(--ufb-line);
	background: var(--ufb-surface);
}

/* Mobil başlık: arama, başlığın altında tam genişlikte açılır */
.gridlove-header-responsive .gridlove-action-search .sub-menu {
	padding: var(--ufb-space-3) var(--ufb-space-4) var(--ufb-space-4);
	border-top: 0;
	border-bottom: 4px solid var(--ufb-yellow);
	background: var(--ufb-navy);
	box-shadow: 0 12px 24px rgba(0, 2, 45, .25);
}

.gridlove-header-responsive .gridlove-search-form {
	border-color: transparent;
}

/* Sonuç sayfası başlığı: küçük etiket, altında aranan kelime; arama kutusu altta tam genişlikte */
body.search .module-header .module-title {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: var(--ufb-space-4);
}

body.search .module-header .module-title > h1 {
	margin: 0;
	overflow-wrap: anywhere;
}

.ufb-arama-etiket {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 10px;
	margin-bottom: var(--ufb-space-2);
	color: var(--ufb-muted);
	font: 700 13px / 1.3 var(--ufb-font-ui);
	letter-spacing: 2px;
	text-transform: uppercase;
}

body.search .module-header .module-actions {
	position: static;
	float: none;
	width: 100%;
	max-width: 640px;
	margin: 0;
	transform: none;
}

/* Sonuç yok kartı */
.gridlove-not-found .gridlove-box {
	text-align: center;
}

.gridlove-not-found .module-header .module-title {
	align-items: center;
}

.gridlove-not-found .module-header .module-title > h1::after {
	margin-right: auto;
	margin-left: auto;
}

/* Sıra: simge → metin → arama kutusu → kısayollar (kısayollar çeviri metniyle birlikte gelir) */
.gridlove-not-found .entry-content {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.gridlove-not-found .entry-content > .gridlove-search-form {
	order: 2;
}

.gridlove-not-found .entry-content > .ufb-arama-kisayol {
	order: 3;
}

.gridlove-not-found .entry-content > p:empty,
.gridlove-not-found .entry-content > p[hidden] {
	display: none;
}

.gridlove-not-found .entry-content::before {
	content: "";
	display: block;
	width: 64px;
	height: 64px;
	margin: 0 auto var(--ufb-space-4);
	border-radius: 50%;
	background: var(--ufb-yellow-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300022d' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5M8.5 11h5'/%3E%3C/svg%3E") no-repeat 50% 50% / 28px 28px;
}

.gridlove-not-found .entry-content > p {
	max-width: 46ch;
	margin: 0 auto var(--ufb-space-5);
	color: var(--ufb-text);
	font-size: var(--ufb-fs-md);
	line-height: 1.6;
}

.gridlove-not-found .entry-content .gridlove-search-form {
	max-width: 520px;
	margin: 0 auto;
}

.ufb-arama-kisayol {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--ufb-space-2);
	margin-top: var(--ufb-space-5);
}

.ufb-arama-kisayol a {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 6px 14px;
	border: 1px solid var(--ufb-line-strong);
	border-radius: var(--ufb-radius-pill);
	color: var(--ufb-navy);
	font: 700 14px / 1 var(--ufb-font-ui);
	text-decoration: none;
	transition: background-color var(--ufb-ease), border-color var(--ufb-ease);
}

.ufb-arama-kisayol a:hover,
.ufb-arama-kisayol a:focus-visible {
	border-color: var(--ufb-yellow);
	background: var(--ufb-yellow-soft);
}

@media (max-width: 480px) {
	.gridlove-search-form .gridlove-button-search,
	body.search .gridlove-search-form .gridlove-button-search {
		padding: 0 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gridlove-search-form,
	.ufb-arama-kisayol a {
		transition: none;
	}
}
