/*
Theme Name: Simurg
Description: Feed-style light theme for simurg.info, based on the ozgur.ca design language.
Version: 0.1.0
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: simurg
*/

:root {
	--page: #F4F4F1;
	--surface: #FFFFFF;
	--ink: #111111;
	--text-strong: #2A2A2A;
	--text: #3D3D3D;
	--nav: #4A4A4A;
	--muted: #5F5F5F;
	--line: rgba(0, 0, 0, 0.08);
	--line-strong: rgba(0, 0, 0, 0.14);
	--chip: #E8E8E4;
	--hover: #EDEDE9;
	--accent: #1F5A3A;
	--accent-tint: #E6EEE8;
	--sans: "Geist", system-ui, -apple-system, sans-serif;
	--mono: "Geist Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html body {
	margin: 0;
	background: var(--page);
	color: var(--text);
	font-family: var(--sans);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: 16px; top: -60px;
	z-index: 100;
	padding: 10px 16px;
	border-radius: 10px;
	background: var(--ink);
	color: #FFFFFF;
	font-weight: 500;
}
.skip-link:focus { top: 16px; }

/* Layout: brand + nav, feed, sidebar. Wraps to one column on narrow screens. */
.shell {
	max-width: 1180px;
	margin: 0 auto;
	padding: 32px 16px 32px;
	display: flex;
	flex-wrap: wrap;
	gap: 32px;
	align-items: flex-start;
}

.site-header {
	flex: 1 1 200px;
	max-width: 240px;
	display: flex;
	flex-direction: column;
	gap: 28px;
}

.brand { display: flex; flex-direction: column; gap: 8px; }
.brand-name {
	display: inline-flex;
	align-items: baseline;
	gap: 2px;
	font-size: 28px;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--ink);
	text-transform: lowercase;
}
.brand-name:hover { text-decoration: none; }
.brand-dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.tagline { margin: 0; font-size: 14px; line-height: 1.45; color: var(--muted); }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.site-nav a {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	padding: 10px 12px;
	border-radius: 10px;
	font-size: 16px;
	font-weight: 500;
	color: var(--nav);
}
.site-nav a:hover { background: var(--chip); text-decoration: none; }
.site-nav .current-menu-item > a,
.site-nav a[aria-current="page"] { background: var(--chip); color: var(--ink); }

.feed {
	flex: 999 1 560px;
	min-width: 0;
	max-width: 620px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 16px;
	overflow: hidden;
}

.site-aside {
	flex: 1 1 260px;
	max-width: 300px;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

@media (min-width: 1000px) {
	.site-header { position: sticky; top: 32px; }
	.admin-bar .site-header { top: 64px; }
}

/* The sidebar sticks only when all three columns fit side by side. It can be taller
   than the window, so it scrolls on its own instead of hiding its lower part. */
@media (min-width: 1120px) {
	.site-aside {
		position: sticky;
		top: 32px;
		max-height: calc(100vh - 64px);
		overflow-y: auto;
		overscroll-behavior: contain;
		scrollbar-width: thin;
		padding-bottom: 2px;
	}
	.admin-bar .site-aside { top: 64px; max-height: calc(100vh - 96px); }
}

@media (max-width: 720px) {
	.shell { padding-top: 20px; gap: 20px; }
	.site-header, .site-aside { max-width: none; }
	.site-header { gap: 12px; }
	.site-nav ul { flex-direction: row; flex-wrap: wrap; }
	.feed { border-radius: 14px; }
}

/* Feed header */
.feed-head {
	padding: 20px 20px 16px;
	border-bottom: 1px solid var(--line);
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.feed-title { margin: 0; font-size: 20px; font-weight: 700; color: var(--ink); }
.feed-desc { margin: 0; font-size: 14px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip {
	display: inline-flex;
	align-items: center;
	height: 36px;
	padding: 0 14px;
	border-radius: 999px;
	border: 1px solid var(--line-strong);
	color: var(--nav);
	font-size: 14px;
	font-weight: 500;
}
.chip:hover { color: var(--ink); border-color: rgba(0, 0, 0, 0.28); text-decoration: none; }
.chip[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }

/* Feed card */
.card {
	display: flex;
	gap: 14px;
	padding: 20px;
	border-bottom: 1px solid var(--line);
}
.card:last-of-type { border-bottom: 0; }
.card:hover { background: #FBFBF9; }

.avatar {
	flex: none;
	width: 44px;
	height: 44px;
	border-radius: 999px;
	background: var(--accent-tint);
	color: var(--accent);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 17px;
}

.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }

.card-meta { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.card-author { color: var(--ink); font-weight: 500; }
.card-sub { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.card-sub a { color: var(--muted); }

.card-title { margin: 0; font-size: 18px; line-height: 1.35; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }

.card-excerpt { margin: 0; font-size: 15px; line-height: 1.6; color: var(--text); }
.card-poem { margin: 0; font-size: 19px; line-height: 1.6; color: var(--text-strong); }

.card-media { display: block; }
.card-media img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 560px;
	object-fit: cover;
	border-radius: 14px;
	border: 1px solid var(--line);
	background: var(--hover);
}

.card-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin: 2px -12px -8px 0;
}
.card-more { font-size: 14px; font-weight: 500; color: var(--accent); }

.share { display: flex; }
.icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 999px;
	background: transparent;
	border: 0;
	color: var(--muted);
	cursor: pointer;
}
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.icon-btn[hidden] { display: none; }

.feed-empty { margin: 0; padding: 32px 20px; color: var(--muted); }

.feed-pages {
	padding: 20px;
	border-top: 1px solid var(--line);
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
}
.btn {
	display: inline-flex;
	align-items: center;
	height: 44px;
	padding: 0 22px;
	border-radius: 999px;
	border: 1px solid var(--line-strong);
	background: var(--page);
	color: var(--ink);
	font-family: inherit;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
}
.btn:hover { background: var(--hover); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #FFFFFF; font-weight: 700; }
.btn-primary:hover { background: #17482E; }

/* Single post and page */
.entry { padding: 24px 20px 20px; }
.entry-head { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.entry-title { margin: 0; font-size: 28px; line-height: 1.25; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.entry-figure { margin: 0 0 24px; }
.entry-figure img { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); }

.entry-content { font-size: 17px; line-height: 1.75; color: var(--text-strong); overflow-wrap: break-word; }
.entry-content > * { margin-top: 0; margin-bottom: 1.1em; }
.entry-content > *:last-child { margin-bottom: 0; }
.entry-content h2, .entry-content h3, .entry-content h4 { color: var(--ink); line-height: 1.3; margin-top: 1.6em; margin-bottom: 0.6em; }
.entry-content h2 { font-size: 22px; }
.entry-content h3 { font-size: 19px; }
.entry-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.entry-content img, .entry-content video { max-width: 100%; height: auto; border-radius: 10px; }
.entry-content iframe { max-width: 100%; }
.entry-content figure { margin-left: 0; margin-right: 0; }
.entry-content figcaption, .entry-content .wp-caption-text { font-size: 13px; color: var(--muted); margin-top: 8px; }
.entry-content .wp-caption { max-width: 100%; }
.entry-content blockquote { margin-left: 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent-tint); color: var(--text); font-style: italic; }
.entry-content hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.entry-content .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.entry-content .alignleft { float: left; margin: 0.3em 1.2em 0.8em 0; }
.entry-content .alignright { float: right; margin: 0.3em 0 0.8em 1.2em; }
.entry-content::after { content: ""; display: table; clear: both; }

.entry-foot {
	margin-top: 28px;
	padding-top: 16px;
	border-top: 1px solid var(--line);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.tags a { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--chip); font-size: 13px; color: var(--text-strong); }

.post-nav { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; padding: 16px 20px; border-top: 1px solid var(--line); font-size: 14px; }
.post-nav a { color: var(--accent); font-weight: 500; }

/* Comments */
.comments { padding: 20px; border-top: 1px solid var(--line); }
.comments-title { margin: 0 0 16px; font-size: 18px; color: var(--ink); }
.comment-list, .comment-list .children { list-style: none; margin: 0; padding: 0; }
.comment-list .children { margin-left: 20px; padding-left: 16px; border-left: 1px solid var(--line); }
.comment-body { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 1.6; }
.comment-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.comment-author { color: var(--ink); font-weight: 500; }
.comment-author .says { display: none; }
.comment-metadata, .comment-metadata a { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.comment-content p { margin: 0 0 0.6em; }
.reply a { font-size: 13px; color: var(--accent); font-weight: 500; }
.comment-respond { margin-top: 20px; }
.comment-reply-title { font-size: 16px; color: var(--ink); }
.comment-form label { display: block; font-size: 13px; color: var(--nav); 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 14px;
	border-radius: 10px;
	border: 1px solid rgba(0, 0, 0, 0.18);
	background: #FFFFFF;
	color: var(--ink);
	font: inherit;
	font-size: 15px;
}
.comment-form .submit { height: 44px; padding: 0 22px; border-radius: 10px; border: 0; background: var(--accent); color: #FFFFFF; font: inherit; font-weight: 700; cursor: pointer; }

/* Sidebar */
.box {
	border: 1px solid var(--line);
	border-radius: 16px;
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.box-filled { background: var(--surface); }
.box h2, .box .widget-title, .box .widgettitle { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); }

.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] {
	flex: 1;
	min-width: 0;
	height: 44px;
	padding: 0 14px;
	border-radius: 10px;
	border: 1px solid rgba(0, 0, 0, 0.18);
	background: #FFFFFF;
	color: var(--ink);
	font: inherit;
	font-size: 15px;
}
.search-form button { height: 44px; padding: 0 14px; border-radius: 10px; border: 0; background: var(--accent); color: #FFFFFF; font: inherit; font-weight: 700; cursor: pointer; }

.ranked { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.ranked li { display: flex; gap: 12px; align-items: baseline; }
.ranked .num { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.ranked a { font-size: 14px; line-height: 1.45; color: var(--text-strong); }

.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cat-chips a { display: inline-block; padding: 6px 12px; border-radius: 999px; background: var(--chip); font-size: 13px; color: var(--text-strong); }

.site-footer { max-width: 1180px; margin: 0 auto; padding: 0 16px 40px; font-family: var(--mono); font-size: 12px; color: var(--muted); }

.toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%);
	padding: 10px 16px;
	border-radius: 999px;
	background: var(--ink);
	color: #FFFFFF;
	font-size: 14px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 150ms ease-out;
}
.toast.is-visible { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
