/*
Theme Name: VMNinja
Theme URI: https://vmninja.io
Author: vmninja.io
Description: Linux, storage ve VMware yazıları için terminal esintili, hızlı ve okunaklı bir teknik blog teması. Karanlık/aydınlık mod, kod kopyalama, okuma süresi ve eski yazılar için "güncellik" uyarısı içerir.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: vmninja
Tags: blog, dark-mode, one-column, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready
*/

/* ---------- Tokens ---------- */
:root {
	--bg: #0d1117;
	--bg-2: #131a23;
	--surface: #161e29;
	--border: #26313f;
	--text: #d7dee8;
	--text-dim: #8b98a9;
	--heading: #f2f5f9;
	--accent: #3ddc84;
	--accent-ink: #0b1a12;
	--linux: #f5b041;
	--storage: #4cc9f0;
	--vmware: #3ddc84;
	--code-bg: #0a0e14;
	--shadow: 0 1px 0 rgba(255,255,255,.03), 0 10px 30px rgba(0,0,0,.25);
	--radius: 10px;
	--mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	--sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--wrap: 1120px;
	--read: 740px;
}
:root[data-theme="light"] {
	--bg: #f7f8fa;
	--bg-2: #eef1f5;
	--surface: #ffffff;
	--border: #dfe4ea;
	--text: #2b3340;
	--text-dim: #657285;
	--heading: #0f1620;
	--accent: #13a05a;
	--accent-ink: #ffffff;
	--linux: #c47f00;
	--storage: #0a8fb8;
	--vmware: #13a05a;
	--code-bg: #0f141b;
	--shadow: 0 1px 2px rgba(15,22,32,.05), 0 8px 24px rgba(15,22,32,.06);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 17px/1.7 var(--sans);
	-webkit-font-smoothing: antialiased;
	transition: background-color .2s, color .2s;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, h5, h6 { color: var(--heading); line-height: 1.25; margin: 1.8em 0 .6em; font-weight: 700; letter-spacing: -.01em; }
::selection { background: var(--accent); color: var(--accent-ink); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 999; width: auto; height: auto; clip: auto; padding: 8px 14px; background: var(--accent); color: var(--accent-ink); border-radius: 6px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.mono { font-family: var(--mono); }

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: color-mix(in srgb, var(--bg) 85%, transparent);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--heading); font: 700 18px var(--mono); }
.brand:hover { text-decoration: none; }
.brand .prompt { color: var(--accent); }
.brand .cursor { display: inline-block; width: 9px; height: 18px; background: var(--accent); margin-left: 2px; vertical-align: -3px; animation: blink 1.1s steps(1) infinite; }
.brand img { max-height: 36px; width: auto; }
@keyframes blink { 50% { opacity: 0; } }
.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.main-nav a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--text-dim); font: 500 14px var(--mono); }
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current-menu-parent > a { color: var(--heading); background: var(--bg-2); text-decoration: none; }
.main-nav .sub-menu { display: none; }
.header-actions { display: flex; gap: 6px; }
.icon-btn {
	width: 38px; height: 38px; display: inline-grid; place-items: center;
	background: transparent; border: 1px solid var(--border); border-radius: 8px;
	color: var(--text-dim); cursor: pointer;
}
.icon-btn:hover { color: var(--heading); border-color: var(--text-dim); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-toggle { display: none; }
.theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: block; }
:root[data-theme="light"] .theme-toggle .moon { display: none; }

.search-panel { display: none; border-top: 1px solid var(--border); padding: 14px 0; }
.search-panel.open { display: block; }

@media (max-width: 820px) {
	.menu-toggle { display: inline-grid; }
	.main-nav { position: absolute; top: 64px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); display: none; }
	.main-nav.open { display: block; }
	.main-nav ul { flex-direction: column; padding: 10px 20px 16px; }
	.header-actions { margin-left: auto; }
}

/* ---------- Search form ---------- */
.search-form { display: flex; align-items: center; gap: 8px; background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; padding: 4px 4px 4px 14px; font-family: var(--mono); }
.search-form::before { content: "$ grep -ri"; color: var(--accent); font-size: 14px; white-space: nowrap; }
.search-form input[type="search"] { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: #e6edf3; font: 15px var(--mono); padding: 8px 4px; }
.search-form button { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 6px; padding: 8px 14px; font: 600 14px var(--mono); cursor: pointer; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 40px; border-bottom: 1px solid var(--border); background:
	radial-gradient(800px 300px at 85% -10%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%); }
.terminal {
	max-width: 720px; background: var(--code-bg); border: 1px solid var(--border);
	border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; border-bottom: 1px solid #1d2632; }
.terminal-bar i { width: 11px; height: 11px; border-radius: 50%; background: #2c3644; }
.terminal-bar i:nth-child(1) { background: #ff5f57; } .terminal-bar i:nth-child(2) { background: #febc2e; } .terminal-bar i:nth-child(3) { background: #28c840; }
.terminal-bar span { margin-left: 8px; color: #6e7b8c; font: 12px var(--mono); }
.terminal-body { padding: 20px 22px 24px; font: 15px/1.8 var(--mono); color: #c9d4e0; }
.terminal-body .ps { color: #3ddc84; }
.terminal-body h1 { font: 700 clamp(26px, 4vw, 38px)/1.2 var(--sans); color: #f2f5f9; margin: 10px 0 8px; letter-spacing: -.02em; }
.terminal-body p { margin: 0; color: #8b98a9; }
.topic-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.topic-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: 500 14px var(--mono); }
.topic-chip:hover { text-decoration: none; border-color: var(--c, var(--accent)); color: var(--heading); }
.topic-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); }
.topic-chip small { color: var(--text-dim); }

/* ---------- Category colors ---------- */
.cat-linux   { --c: var(--linux); }
.cat-storage { --c: var(--storage); }
.cat-vmware  { --c: var(--vmware); }

/* ---------- Post list ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 48px 0 20px; }
.section-head h2 { margin: 0; font: 600 14px var(--mono); color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; }
.archive-head { padding: 48px 0 8px; }
.archive-head h1 { margin: 0 0 6px; font-size: clamp(28px, 4vw, 40px); }
.archive-head .path { font: 14px var(--mono); color: var(--text-dim); }
.archive-head .path b { color: var(--c, var(--accent)); font-weight: 600; }
.archive-head .desc { color: var(--text-dim); max-width: 640px; }

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.card {
	position: relative; display: flex; flex-direction: column;
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
	overflow: hidden; transition: border-color .15s, transform .15s;
}
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--c, var(--accent)); opacity: .9; }
.card:hover { border-color: var(--c, var(--accent)); transform: translateY(-2px); }
.card-thumb { aspect-ratio: 16/9; overflow: hidden; background: var(--bg-2); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.card-title { margin: 8px 0 10px; font-size: 20px; line-height: 1.35; }
.card-title a { color: var(--heading); }
.card-title a::after { content: ""; position: absolute; inset: 0; }
.card-excerpt { color: var(--text-dim); font-size: 15px; margin: 0 0 16px; }
.card-excerpt p { margin: 0; }
.card .meta { margin-top: auto; }

.post-list-compact .card { flex-direction: row; }
.post-grid.featured { grid-template-columns: 1fr; }
.post-grid.featured .card { display: grid; grid-template-columns: 1.2fr 1fr; }
.post-grid.featured .card-thumb { aspect-ratio: auto; min-height: 260px; }
.post-grid.featured .card:not(:has(.card-thumb)) { grid-template-columns: 1fr; }
.post-grid.featured .card-title { font-size: clamp(22px, 3vw, 30px); }
@media (max-width: 760px) { .post-grid.featured .card { grid-template-columns: 1fr; } .post-grid { grid-template-columns: 1fr; } }

.cat-label { display: inline-flex; align-items: center; gap: 6px; font: 600 12px var(--mono); color: var(--c, var(--accent)); text-transform: lowercase; position: relative; z-index: 2; }
.cat-label::before { content: "#"; opacity: .6; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font: 13px var(--mono); color: var(--text-dim); }
.meta .updated { color: var(--accent); }

/* ---------- Pagination ---------- */
.pagination { margin: 48px 0; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; font-family: var(--mono); }
.pagination .page-numbers { min-width: 40px; padding: 8px 12px; text-align: center; border: 1px solid var(--border); border-radius: 8px; color: var(--text); }
.pagination .page-numbers.current, .pagination a.page-numbers:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); text-decoration: none; }

/* ---------- Single ---------- */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); z-index: 60; }
.entry-header { max-width: var(--read); margin: 0 auto; padding: 56px 0 24px; }
.entry-header h1 { margin: 12px 0 16px; font-size: clamp(30px, 5vw, 44px); letter-spacing: -.02em; }
.entry-thumb { max-width: 980px; margin: 8px auto 32px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.entry-content { max-width: var(--read); margin: 0 auto; }
.entry-content > * { margin-top: 0; margin-bottom: 1.3em; }
.entry-content h2 { font-size: 28px; padding-top: .3em; }
.entry-content h2::before { content: "## "; color: var(--accent); font-family: var(--mono); font-size: .75em; opacity: .7; }
.entry-content h3 { font-size: 22px; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li { margin: .3em 0; }
.entry-content blockquote { margin-left: 0; padding: 4px 20px; border-left: 3px solid var(--accent); color: var(--text-dim); font-style: italic; }
.entry-content hr { border: 0; border-top: 1px dashed var(--border); margin: 2.5em 0; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { padding: 10px 12px; border: 1px solid var(--border); text-align: left; }
.entry-content th { background: var(--bg-2); color: var(--heading); font-family: var(--mono); font-size: 13px; }
.entry-content figure { margin-left: 0; margin-right: 0; }
.entry-content figcaption, .wp-element-caption { color: var(--text-dim); font-size: 14px; text-align: center; margin-top: 8px; }
.alignwide { max-width: 980px; margin-left: auto; margin-right: auto; }
.alignfull { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); }
.aligncenter { margin-left: auto; margin-right: auto; }

/* inline + block code */
:not(pre) > code { font: .88em var(--mono); background: var(--bg-2); border: 1px solid var(--border); padding: .12em .4em; border-radius: 5px; color: var(--heading); }
pre, .wp-block-code {
	position: relative; font: 14px/1.65 var(--mono);
	background: var(--code-bg); color: #d7dee8;
	border: 1px solid #1d2632; border-radius: var(--radius);
	padding: 18px 20px; overflow-x: auto; tab-size: 4;
}
pre code { background: none; border: 0; padding: 0; color: inherit; font: inherit; }
.code-wrap { position: relative; }
.copy-btn {
	position: absolute; top: 8px; right: 8px; z-index: 2;
	padding: 4px 10px; font: 12px var(--mono); color: #8b98a9;
	background: #161e29; border: 1px solid #26313f; border-radius: 6px; cursor: pointer;
	opacity: 0; transition: opacity .15s;
}
.code-wrap:hover .copy-btn, .copy-btn:focus { opacity: 1; }
.copy-btn.done { color: #3ddc84; border-color: #3ddc84; }
@media (hover: none) { .copy-btn { opacity: 1; } }

/* notices */
.stale-notice {
	display: flex; gap: 12px; align-items: flex-start;
	padding: 14px 18px; margin-bottom: 2em; border-radius: var(--radius);
	background: color-mix(in srgb, var(--linux) 10%, var(--surface));
	border: 1px solid color-mix(in srgb, var(--linux) 40%, var(--border));
	font-size: 15px; color: var(--text);
}
.stale-notice strong { color: var(--linux); font-family: var(--mono); font-weight: 600; }

/* toc */
.toc { margin-bottom: 2em; padding: 16px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: 15px; }
.toc summary { cursor: pointer; font: 600 13px var(--mono); color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; }
.toc ol { margin: 12px 0 0; padding-left: 1.2em; }
.toc li { margin: .25em 0; }
.toc .lvl-3 { margin-left: 1em; list-style: circle; }

/* tags / footer of post */
.entry-footer { max-width: var(--read); margin: 40px auto 0; padding-top: 24px; border-top: 1px solid var(--border); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { font: 13px var(--mono); padding: 4px 10px; border-radius: 6px; background: var(--bg-2); color: var(--text-dim); }
.tags a:hover { color: var(--heading); text-decoration: none; }
.author-box { display: flex; gap: 16px; align-items: center; margin-top: 28px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.author-box img { border-radius: 50%; }
.author-box h4 { margin: 0 0 4px; font-size: 16px; }
.author-box p { margin: 0; color: var(--text-dim); font-size: 15px; }
.post-nav { max-width: var(--read); margin: 32px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.post-nav a { display: block; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--heading); font-weight: 600; font-size: 15px; }
.post-nav a:hover { border-color: var(--accent); text-decoration: none; }
.post-nav small { display: block; font: 12px var(--mono); color: var(--text-dim); margin-bottom: 4px; }
.post-nav .next { text-align: right; }
.related { max-width: var(--wrap); margin: 64px auto 0; }

/* ---------- Comments ---------- */
.comments-area { max-width: var(--read); margin: 56px auto 0; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 24px; border-left: 1px dashed var(--border); }
.comment-body { padding: 16px 0; border-bottom: 1px solid var(--border); }
.comment-author { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--heading); }
.comment-author img { border-radius: 50%; }
.comment-metadata { font: 12px var(--mono); }
.comment-metadata a { color: var(--text-dim); }
.comment-form label { display: block; font: 13px var(--mono); color: var(--text-dim); margin-bottom: 4px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 10px 12px; background: var(--surface); color: var(--text);
	border: 1px solid var(--border); border-radius: 8px; font: 15px var(--sans);
}
.comment-form input:focus, .comment-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.comment-form .submit, .btn {
	display: inline-block; background: var(--accent); color: var(--accent-ink); border: 0;
	padding: 10px 18px; border-radius: 8px; font: 600 14px var(--mono); cursor: pointer;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }

/* ---------- 404 / empty ---------- */
.not-found { max-width: var(--read); margin: 64px auto; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 80px; border-top: 1px solid var(--border); padding: 32px 0; font: 13px var(--mono); color: var(--text-dim); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 16px; }
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--heading); }
.footer-widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; width: 100%; padding-bottom: 24px; margin-bottom: 8px; border-bottom: 1px solid var(--border); font-family: var(--sans); font-size: 15px; }
.footer-widgets .widget-title { font: 600 13px var(--mono); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 12px; color: var(--heading); }
.footer-widgets ul { display: block; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
