/*
Theme Name: Khabaria
Theme URI: https://khabaria.ir
Author: Khabaria
Description: قالب سبک خبریا؛ راست‌به‌چپ، با HTML معنایی و سازگار با سئو. قالب فقط نمایش را انجام می‌دهد؛ عنوان و متا و اسکیما را Yoast و افزونه Khabaria Core تولید می‌کنند.
Version: 1.0.0
Requires at least: 5.8
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: khabaria
*/

/* ===== شروع: فونت (self-host) ===== */
@font-face {
	font-family: "IRANYekan";
	font-weight: 300;
	font-style: normal;
	font-display: swap;
	src: url("fonts/yekan-light.woff2") format("woff2");
}
@font-face {
	font-family: "IRANYekan";
	font-weight: 400;
	font-style: normal;
	font-display: swap;
	src: url("fonts/yekan-regular.woff2") format("woff2");
}
@font-face {
	font-family: "IRANYekan";
	font-weight: 700;
	font-style: normal;
	font-display: swap;
	src: url("fonts/yekan-bold.woff2") format("woff2");
}
/* ===== پایان: فونت ===== */

/* ===== شروع: رنگ‌ها و اندازه‌ها ===== */
:root {
	--bg: #eff1f5;
	--surface: #ffffff;
	--line: #dfe3ec;
	--text: #1f2937;
	--muted: #5b6676;
	--navy: #002d56;
	--header: #2c4a6e;
	--bar: #243d5a;
	--link: #1a4fa3;
	--accent: #c40000;
	--font: "IRANYekan", Tahoma, sans-serif;
	--width: 1170px;
}
/* ===== پایان: رنگ‌ها و اندازه‌ها ===== */

/* ===== شروع: پایه ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 400 14px/1.9 var(--font);
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0 0 .5em; color: var(--navy); font-weight: 700; line-height: 1.7; }
ul, ol { margin: 0; padding: 0; }
input, textarea, button { font: inherit; }
.wrap { max-width: var(--width); margin: 0 auto; padding: 0 15px; }

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}
.screen-reader-text:focus {
	background: #fff;
	clip: auto;
	clip-path: none;
	color: var(--text);
	display: block;
	height: auto;
	padding: 10px 15px;
	right: 5px;
	top: 5px;
	width: auto;
	z-index: 100000;
}
/* ===== پایان: پایه ===== */

/* ===== شروع: نوار بالا ===== */
.topbar { background: var(--bar); color: #cfd8e6; font-size: 12px; }
.topbar__inner { display: flex; justify-content: space-between; align-items: center; min-height: 34px; }
.topbar__menu { display: flex; gap: 16px; list-style: none; }
.topbar a { color: #cfd8e6; }
/* ===== پایان: نوار بالا ===== */

/* ===== شروع: هدر و لوگو ===== */
.site-header { background: var(--header); color: #fff; }
.site-header__inner { padding-top: 14px; padding-bottom: 14px; min-height: 90px; display: flex; align-items: center; }
.site-heading { margin: 0; font-size: inherit; }
.site-title { color: #fff; font-size: 26px; font-weight: 700; }
.custom-logo { display: block; max-height: 64px; width: auto; }
/* ===== پایان: هدر و لوگو ===== */

/* ===== شروع: منوی اصلی ===== */
.navbar { background: var(--bar); }
.primary-nav ul { list-style: none; display: flex; flex-wrap: wrap; }
.primary-nav li { position: relative; }
.primary-nav a { display: block; padding: 10px 14px; color: #fff; }
.primary-nav a:hover { background: rgba(255, 255, 255, .12); text-decoration: none; }
.primary-nav .sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	right: 0;
	z-index: 50;
	min-width: 200px;
	flex-direction: column;
	background: var(--bar);
}
.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu { display: flex; }
.nav-toggle {
	display: none;
	padding: 10px 0;
	border: 0;
	background: none;
	color: #fff;
	cursor: pointer;
}
/* ===== پایان: منوی اصلی ===== */

/* ===== شروع: چیدمان صفحه (محتوا و سایدبار) ===== */
.layout { display: flex; gap: 24px; align-items: flex-start; margin: 20px 0; }
.layout__main { flex: 1 1 0; min-width: 0; }
.layout__side { flex: 0 0 300px; order: -1; }
.breadcrumbs { margin: 14px 0 0; font-size: 12px; color: var(--muted); }
/* ===== پایان: چیدمان صفحه ===== */

/* ===== شروع: کارت نوشته ===== */
.card-list { display: grid; gap: 16px; }
.card {
	display: flex;
	gap: 16px;
	padding: 14px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 6px;
}
.card__media { flex: 0 0 220px; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 4px; background: var(--line); }
.card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card__body { flex: 1; min-width: 0; }
.card__title { margin: 0 0 6px; font-size: 17px; }
.card__title a { color: var(--navy); }
.card__excerpt { margin: 0 0 8px; }
.card__meta { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.card__meta a { color: var(--accent); }
.card--lead { flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
.card--lead .card__media { flex: none; aspect-ratio: 16 / 9; border-radius: 0; }
.card--lead .card__body { padding: 16px; }
.card--lead .card__title { font-size: 22px; }
.home-ads { min-height: 1px; }
/* ===== پایان: کارت نوشته ===== */

/* ===== شروع: سرتیتر آرشیو ===== */
.page-header {
	margin-bottom: 16px;
	padding: 14px 18px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 6px;
}
.page-title { margin: 0; font-size: 20px; }
.page-description { margin-top: 6px; color: var(--muted); }
/* ===== پایان: سرتیتر آرشیو ===== */

/* ===== شروع: صفحه نوشته ===== */
.entry { padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.entry__cats { display: flex; gap: 12px; margin-bottom: 4px; font-size: 12px; }
.entry__cats a { color: var(--accent); }
.entry__title { font-size: 24px; }
.entry__meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 16px; font-size: 12px; color: var(--muted); }
.entry__image { margin: 0 0 18px; }
.entry__image img { display: block; width: 100%; border-radius: 4px; }
.entry__image figcaption { margin-top: 4px; font-size: 12px; color: var(--muted); }
.entry__content { font-size: 15px; line-height: 2; overflow-wrap: break-word; }
.entry__content p { margin: 0 0 1.1em; }
.entry__content h2 { margin-top: 1.6em; font-size: 20px; }
.entry__content h3 { margin-top: 1.4em; font-size: 17px; }
.entry__content ul, .entry__content ol { margin: 0 0 1.1em; padding-right: 1.5em; }
.entry__content blockquote { margin: 1em 0; padding: 6px 16px; border-right: 3px solid var(--line); color: var(--muted); }
.entry__content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; }
.entry__content th, .entry__content td { padding: 6px 10px; border: 1px solid var(--line); }
.entry__content iframe, .entry__content video { max-width: 100%; }
.alignleft { float: left; margin: 0 1em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1em; }
.aligncenter { display: block; margin: 0 auto 1em; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 12px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; list-style: none; }
.tags a { display: block; padding: 0 10px; border: 1px solid var(--line); border-radius: 14px; font-size: 12px; color: var(--muted); }
.related { margin-top: 16px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.related__title { font-size: 16px; }
.related__list { padding-right: 1.2em; }
.post-navigation { margin-top: 16px; }
.post-navigation .nav-links { display: flex; justify-content: space-between; gap: 16px; }
/* ===== پایان: صفحه نوشته ===== */

/* ===== شروع: صفحه‌بندی ===== */
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 20px; }
.page-numbers { padding: 2px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; color: var(--text); }
.page-numbers.current { background: var(--header); border-color: var(--header); color: #fff; }
/* ===== پایان: صفحه‌بندی ===== */

/* ===== شروع: سایدبار و ویجت‌ها ===== */
.widget { margin-bottom: 16px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.widget-title { padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 15px; }
.widget ul { list-style: none; }
.widget li { padding: 3px 0; }
/* ===== پایان: سایدبار و ویجت‌ها ===== */

/* ===== شروع: جستجو و دیدگاه‌ها ===== */
.search-form { display: flex; gap: 8px; }
.search-field { flex: 1; padding: 6px 10px; border: 1px solid var(--line); border-radius: 4px; }
.search-submit, .comment-form .submit {
	padding: 6px 16px;
	border: 0;
	border-radius: 4px;
	background: var(--header);
	color: #fff;
	cursor: pointer;
}
.comments { margin-top: 16px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.comments__title { font-size: 16px; }
.comment-list { list-style: none; }
.comment-list .children { list-style: none; padding-right: 20px; }
.comment-body { padding: 10px 0; border-bottom: 1px solid var(--line); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%;
	padding: 6px 10px;
	border: 1px solid var(--line);
	border-radius: 4px;
}
/* ===== پایان: جستجو و دیدگاه‌ها ===== */

/* ===== شروع: فوتر ===== */
.site-footer { margin-top: 24px; padding: 20px 0; background: var(--bar); color: #cfd8e6; font-size: 13px; }
.site-footer a { color: #fff; }
.footer-menu { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; list-style: none; }
/* ===== پایان: فوتر ===== */

/* ===== شروع: موبایل ===== */
@media (max-width: 900px) {
	.layout { flex-direction: column; }
	.layout__side { flex-basis: auto; width: 100%; order: 0; }
}
@media (max-width: 768px) {
	.nav-toggle { display: block; }
	.primary-nav ul { display: none; flex-direction: column; }
	.primary-nav.is-open ul { display: flex; }
	.primary-nav .sub-menu { position: static; display: flex; padding-right: 14px; }
}
@media (max-width: 600px) {
	.card { flex-direction: column; }
	.card__media { flex-basis: auto; width: 100%; }
	.entry { padding: 14px; }
	.entry__title { font-size: 21px; }
}
/* ===== پایان: موبایل ===== */

/* ===== شروع: چاپ ===== */
@media print {
	.topbar, .navbar, .layout__side, .site-footer, .comments, .related, .pagination, .post-navigation { display: none; }
	body { background: #fff; }
	.entry { border: 0; padding: 0; }
}
/* ===== پایان: چاپ ===== */
