/*
Theme Name: Evren Blok
Description: Evren Çekirdeği eklentisi için blok teması. Üst şeritten kayıt sayfasına kadar her şey Görünüm → Tasarım ekranında sürükle-bırak ile düzenlenebilir; renkler, yazı tipleri ve boşluklar Biçimler'den değiştirilir.
Version: 0.2.0
Author: Evren Arşivi
Text Domain: evren-blok
Requires at least: 6.6
Requires PHP: 7.4
License: GPL-2.0-or-later
*/

/*
 * Bu dosyada yalnızca theme.json ile ifade edilemeyen ayrıntılar var.
 * Renkler ve yazı tipleri her zaman theme.json önayarlarından okunur; böylece
 * Biçimler ekranında yapılan her değişiklik buradaki bileşenlere de yansır.
 */

/* Eklentinin bileşenleri --e-* değişkenlerini kullanır; onları önayarlara bağla. */
:root {
	--e-zemin: var(--wp--preset--color--zemin);
	--e-yuzey: var(--wp--preset--color--yuzey);
	--e-murekkep: var(--wp--preset--color--murekkep);
	--e-soluk: var(--wp--preset--color--soluk);
	--e-cizgi: var(--wp--preset--color--cizgi);
	--e-vurgu: var(--wp--preset--color--vurgu);
	--e-bronz: var(--wp--preset--color--bronz);
	--e-koyu: var(--wp--preset--color--koyu);
	--e-koyu-2: var(--wp--preset--color--koyu-2);
	--e-koyu-metin: var(--wp--preset--color--koyu-metin);
	--e-koyu-soluk: var(--wp--preset--color--koyu-soluk);
	--e-font-baslik: var(--wp--preset--font-family--baslik);
	--e-font-metin: var(--wp--preset--font-family--metin);
}

/* Koyu görünüm: üst şeritteki düğmeyle açılır. Önayarların üzerine yazar. */
html[data-tema="koyu"] {
	--wp--preset--color--zemin: #13100d;
	--wp--preset--color--yuzey: #1c1814;
	--wp--preset--color--murekkep: #e8e0d2;
	--wp--preset--color--soluk: #a3988a;
	--wp--preset--color--cizgi: #362e26;
	--wp--preset--color--vurgu: #c65a40;
	--wp--preset--color--bronz: #c3a06a;
	--wp--preset--color--koyu: #0c0a08;
	--wp--preset--color--koyu-2: #17130f;
	color-scheme: dark;
}

body {
	background-image:
		radial-gradient(ellipse at 15% 0%, color-mix(in srgb, var(--wp--preset--color--bronz) 9%, transparent), transparent 55%),
		radial-gradient(ellipse at 90% 100%, color-mix(in srgb, var(--wp--preset--color--vurgu) 6%, transparent), transparent 50%);
	background-attachment: fixed;
	-webkit-font-smoothing: antialiased;
}

html { scroll-padding-top: 5.5rem; }

:where(.wp-site-blocks) :focus-visible { outline: 2px solid var(--wp--preset--color--bronz); outline-offset: 2px; }

::selection { background: var(--wp--preset--color--vurgu); color: #fff; }

/* Bloklar arası varsayılan boşluğu üst seviyede sıfırla: bölümler kendi boşluğunu taşır. */
.wp-site-blocks > * + * { margin-block-start: 0; }

/* İçerik kısa olsa da alt bilgi her zaman pencerenin en altında dursun. */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
}
.wp-site-blocks > main { flex: 1 0 auto; }
.wp-site-blocks > footer { margin-top: auto; }

/* ==========================================================================
   Üst şerit
   ========================================================================== */
.evren-ust-serit {
	position: sticky;
	top: 0;
	z-index: 100;
	border-bottom: 1px solid transparent;
	border-image: linear-gradient(90deg, transparent, var(--wp--preset--color--bronz) 20%, var(--wp--preset--color--bronz) 80%, transparent) 1;
}
.admin-bar .evren-ust-serit { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) { .admin-bar .evren-ust-serit { top: 0; } }

.evren-ust-serit a:where(:not(.wp-element-button)) { text-decoration: none; }
.evren-ust-serit .wp-block-navigation-item__content:hover,
.evren-ust-serit .wp-block-navigation-item__content[aria-current="page"] { color: #e3b98a; }

.evren-ust-serit .wp-block-navigation .wp-block-navigation__submenu-container {
	min-width: 14rem;
	padding: 0.5rem 0;
	background: var(--wp--preset--color--koyu-2) !important;
	color: var(--wp--preset--color--koyu-soluk) !important;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--bronz) 35%, transparent);
	box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.7);
}
.evren-ust-serit .wp-block-navigation__submenu-container .wp-block-navigation-item__content { padding: 0.5rem 1.1rem; }

/* Menü sağa yaslı olsa da alt menüler, üst öğenin altında sola hizalı açılsın. */
@media (min-width: 600px) {
	.evren-ust-serit .wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container {
		left: 0;
		right: auto;
	}
	/* İkinci seviye alt menüler sağa doğru açılsın. */
	.evren-ust-serit .wp-block-navigation.items-justified-right .wp-block-navigation__container .has-child .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container {
		left: 100%;
		right: auto;
	}
}
.evren-ust-serit .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--koyu-metin); background: color-mix(in srgb, var(--wp--preset--color--bronz) 12%, transparent); }

/* Üst şeritteki arama */
.evren-ust-arama .wp-block-search__inside-wrapper {
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--koyu-metin) 18%, transparent) !important;
	background: rgba(255, 255, 255, 0.05);
	padding: 0;
}
.evren-ust-arama .wp-block-search__input {
	width: 10rem;
	padding: 0.45rem 0.75rem;
	font-size: 0.85rem;
	color: var(--wp--preset--color--koyu-metin);
	background: transparent;
	border: 0;
	transition: width 0.25s ease;
}
.evren-ust-arama .wp-block-search__input:focus { width: 13rem; outline: none; }
.evren-ust-arama .wp-block-search__input::placeholder { color: var(--wp--preset--color--koyu-soluk); }
.evren-ust-arama .wp-block-search__button {
	margin: 0;
	padding: 0 0.6rem;
	color: var(--wp--preset--color--koyu-metin);
	background: transparent;
	border: 0;
}
.evren-ust-serit .evren-tema-dugmesi { border-color: color-mix(in srgb, var(--wp--preset--color--koyu-metin) 20%, transparent); }

@media (max-width: 900px) {
	.evren-ust-arama { display: none; }
}

/* ==========================================================================
   Giriş alanı (Kapak bloğu "Kül" stili)
   ========================================================================== */
.wp-block-cover.is-style-kul {
	isolation: isolate;
	overflow: hidden;
	border-bottom: 1px solid transparent;
	border-image: linear-gradient(90deg, transparent, var(--wp--preset--color--bronz) 30%, var(--wp--preset--color--bronz) 70%, transparent) 1;
}
.wp-block-cover.is-style-kul .wp-block-cover__background {
	background-image:
		radial-gradient(ellipse 60% 50% at 50% 115%, rgba(198, 90, 64, 0.38), transparent 70%),
		radial-gradient(ellipse 80% 60% at 50% -10%, rgba(148, 116, 63, 0.18), transparent 70%) !important;
}
.wp-block-cover.is-style-kul .wp-block-cover__image-background ~ .wp-block-cover__background { opacity: 0.82; }
.wp-block-cover.is-style-kul::before {
	content: "";
	position: absolute;
	inset: -50% 0 0;
	z-index: 1;
	pointer-events: none;
	background-image:
		radial-gradient(1.5px 1.5px at 12% 22%, rgba(236, 200, 160, 0.55), transparent 60%),
		radial-gradient(1px 1px at 28% 68%, rgba(236, 200, 160, 0.45), transparent 60%),
		radial-gradient(2px 2px at 44% 38%, rgba(220, 120, 80, 0.5), transparent 60%),
		radial-gradient(1px 1px at 63% 18%, rgba(236, 200, 160, 0.4), transparent 60%),
		radial-gradient(1.5px 1.5px at 78% 58%, rgba(220, 120, 80, 0.45), transparent 60%),
		radial-gradient(1px 1px at 88% 30%, rgba(236, 200, 160, 0.5), transparent 60%),
		radial-gradient(1.5px 1.5px at 6% 82%, rgba(236, 200, 160, 0.35), transparent 60%),
		radial-gradient(1px 1px at 54% 88%, rgba(220, 120, 80, 0.4), transparent 60%);
	background-size: 520px 520px;
	animation: evren-kul 38s linear infinite;
}
.wp-block-cover.is-style-kul .wp-block-cover__inner-container { z-index: 2; }
@keyframes evren-kul {
	from { transform: translateY(0); }
	to { transform: translateY(-520px); }
}
@media (prefers-reduced-motion: reduce) {
	.wp-block-cover.is-style-kul::before { animation: none; }
}

/* Başlık üstündeki süslü küçük satır */
.is-style-susle {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.9rem;
}
.is-style-susle::before,
.is-style-susle::after { content: ""; width: 2.5rem; height: 1px; background: currentColor; opacity: 0.6; }

.evren-giris-baslik { text-shadow: 0 2px 30px rgba(198, 90, 64, 0.25); }

/* Giriş alanındaki büyük arama */
.evren-giris-arama { max-width: 34rem; margin-inline: auto; }
.evren-giris-arama .wp-block-search__inside-wrapper {
	padding: 0 !important;
	border: 1px solid rgba(201, 168, 119, 0.4) !important;
	background: rgba(12, 10, 8, 0.55);
	backdrop-filter: blur(4px);
}
.evren-giris-arama .wp-block-search__inside-wrapper:focus-within { border-color: #c9a877 !important; }
.evren-giris-arama .wp-block-search__input { padding: 0.9rem 1.1rem; color: #f1e8d8; background: transparent; border: 0; }
.evren-giris-arama .wp-block-search__input::placeholder { color: #8f8474; }
.evren-giris-arama .wp-block-search__input:focus { outline: none; }
.evren-giris-arama .wp-block-search__button { margin: 0; }

.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: inherit;
	border: 1px solid color-mix(in srgb, currentColor 45%, transparent);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover { border-color: var(--wp--preset--color--bronz); background: rgba(148, 116, 63, 0.15); }

/* ==========================================================================
   Sayfa başlıkları ve bölüm başlıkları
   ========================================================================== */
.evren-sayfa-basligi { border-bottom: 1px solid var(--wp--preset--color--cizgi); }
.evren-sayfa-basligi .wp-block-post-title,
.evren-sayfa-basligi .wp-block-query-title { margin-block: 0.2rem 0; }

/* Başlık bloğu "Çizgili bölüm" stili: ana sayfadaki bölüm başlıkları */
.wp-block-heading.is-style-cizgili,
.evren-ana-icerik > h2 {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-top: 2.6em;
	font-size: 1.05rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--wp--preset--color--soluk);
}
.wp-block-heading.is-style-cizgili::after,
.evren-ana-icerik > h2::after { content: ""; flex: 1; height: 1px; background: var(--wp--preset--color--cizgi); }
.evren-ana-icerik > h2:first-child { margin-top: 0.5em; }

/* Sayfalarda düz metin okunaklı genişlikte kalsın; harita, liste gibi bloklar geniş kalır. */
.wp-block-post-content.evren-metin > :is(p, h2, h3, h4, ul, ol, blockquote) { max-width: var(--wp--style--global--content-size, 46rem); }

/* Yazı içi başlıklar: altı çizgili */
.evren-metin > h2 {
	margin: 2.2em 0 0.7em;
	padding-bottom: 0.35em;
	border-bottom: 1px solid var(--wp--preset--color--cizgi);
}
.evren-metin > h3 { margin: 1.8em 0 0.5em; }
.evren-metin > h2:first-child,
.evren-metin > .icindekiler:first-child + h2 { margin-top: 0.4em; }

/* Yazı içeriği "İlk harf süslü" stili */
.wp-block-post-content.is-style-ilk-harfli > p:first-of-type::first-letter {
	float: left;
	margin: 0.08em 0.12em 0 0;
	font-family: var(--e-font-baslik);
	font-size: 3.4em;
	font-weight: 700;
	line-height: 0.82;
	color: var(--wp--preset--color--vurgu);
}

hr.wp-block-separator:not(.is-style-dots) {
	border: 0;
	height: 1px;
	background: linear-gradient(90deg, transparent, var(--wp--preset--color--bronz), transparent);
}

/* ==========================================================================
   Kayıt sayfası düzeni
   ========================================================================== */
.evren-kayit-kolonlar { gap: 3.5rem; }
.evren-kayit-kolonlar > .wp-block-column:first-child { min-width: 0; }
.evren-yapiskan { position: sticky; top: 6rem; }
.admin-bar .evren-yapiskan { top: 8rem; }
@media (max-width: 781px) {
	/* Telefonda bilgi kutusu yazının üstüne gelsin */
	.evren-kayit-kolonlar > .wp-block-column:last-child { order: -1; }
	.evren-yapiskan { position: static; }
}

.icindekiler {
	display: inline-block;
	min-width: 15rem;
	max-width: 100%;
	margin: 0.5em 0 1.6em;
	padding: 0.7rem 1.2rem 0.6rem;
	background: var(--wp--preset--color--yuzey);
	border: 1px solid var(--wp--preset--color--cizgi);
	font-size: 0.92rem;
}
.icindekiler summary {
	cursor: pointer;
	font-family: var(--e-font-baslik);
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--wp--preset--color--soluk);
}
.icindekiler ol { margin: 0.6rem 0 0.2rem; padding-left: 1.3rem; }
.icindekiler li { margin: 0.2rem 0; }
.icindekiler .icindekiler-h3 { margin-left: 1rem; list-style-type: lower-alpha; }
.icindekiler a { text-decoration: none; }
.icindekiler a:hover { text-decoration: underline; }

.evren-kayit-alt { border-top: 1px solid var(--wp--preset--color--cizgi); }

/* ==========================================================================
   Kartlar (Grup bloğu "Evren kartı" stili — sorgu döngüsünde kullanılır)
   ========================================================================== */
.wp-block-group.is-style-evren-kart {
	height: 100%;
	background: var(--wp--preset--color--yuzey);
	border: 1px solid var(--wp--preset--color--cizgi);
	transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.wp-block-group.is-style-evren-kart:hover {
	border-color: var(--wp--preset--color--bronz);
	transform: translateY(-2px);
	box-shadow: 0 10px 24px -14px rgba(20, 12, 6, 0.45);
}
.is-style-evren-kart :is(.wp-block-post-featured-image, .evren-kart-gorsel) { margin: 0; overflow: hidden; background: #2a231d; }
.is-style-evren-kart :is(.wp-block-post-featured-image, .evren-kart-gorsel) img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.85); transition: transform 0.4s ease; }
.is-style-evren-kart:hover :is(.wp-block-post-featured-image, .evren-kart-gorsel) img { transform: scale(1.04); }
.is-style-evren-kart .wp-block-post-title a { color: var(--wp--preset--color--murekkep); }
.is-style-evren-kart .wp-block-post-title a:hover { color: var(--wp--preset--color--vurgu); }
.is-style-evren-kart .wp-block-post-excerpt__excerpt { margin: 0; }
.is-style-evren-kart .wp-block-post-excerpt__more-text { display: none; }

/* Grup bloğu "Parşömen kutu" stili */
.wp-block-group.is-style-parsomen-kutu {
	background: var(--wp--preset--color--yuzey);
	border: 1px solid var(--wp--preset--color--cizgi);
	border-top: 3px solid var(--wp--preset--color--vurgu);
	padding: 1.2rem 1.4rem;
}

/* Sayfalama */
.wp-block-query-pagination { gap: 0.35rem; }
.wp-block-query-pagination .page-numbers,
.wp-block-query-pagination-previous,
.wp-block-query-pagination-next {
	min-width: 2.4rem;
	padding: 0.45rem 0.8rem;
	text-align: center;
	text-decoration: none;
	color: var(--wp--preset--color--murekkep);
	background: var(--wp--preset--color--yuzey);
	border: 1px solid var(--wp--preset--color--cizgi);
}
.wp-block-query-pagination .page-numbers.current { background: var(--wp--preset--color--vurgu); border-color: var(--wp--preset--color--vurgu); color: #fff; }

/* Arama sayfasındaki büyük arama */
.evren-arama-buyuk .wp-block-search__input { padding: 0.7rem 0.9rem; background: var(--wp--preset--color--yuzey); border: 1px solid var(--wp--preset--color--cizgi); color: var(--wp--preset--color--murekkep); }

/* ==========================================================================
   Alt bilgi
   ========================================================================== */
.evren-alt-serit {
	border-top: 1px solid transparent;
	border-image: linear-gradient(90deg, transparent, var(--wp--preset--color--bronz) 20%, var(--wp--preset--color--bronz) 80%, transparent) 1;
}
.evren-alt-serit a { text-decoration: none; }
.evren-alt-serit a:hover { color: #e3b98a; }

/* Koyu görünümde ince ayarlar */
html[data-tema="koyu"] .is-style-evren-kart .wp-block-post-featured-image img { filter: saturate(0.8) brightness(0.92); }
