/*
Theme Name: Anas Al-Sulami
Theme URI: https://anasasulami.com
Author: Anas A. Al-Sulami
Description: قالب شخصي عربي (RTL) لموقع أنس عبدالرحيم السلمي — أقسام: عني، مقالات، وسائط متعددة.
Version: 1.3
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: anas-sulami
*/

/* خط ثمانية — Thmanyah typeface */
@font-face { font-family: "Thmanyah Sans"; src: url("assets/fonts/thmanyahsans-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("assets/fonts/thmanyahsans-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Thmanyah Sans"; src: url("assets/fonts/thmanyahsans-Bold.woff2") format("woff2"); font-weight: 600 900; font-display: swap; }
@font-face { font-family: "Thmanyah Serif Display"; src: url("assets/fonts/thmanyahserifdisplay-Bold.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }

:root {
	--ink: #262626;
	--muted: #8a8a8a;
	--accent: #3aa6d0;
	--paper: #fafafa;
	--header: #1b22c9;
	--wrap: 960px;
	--serif: "Thmanyah Serif Display", "Thmanyah Sans", serif;
	--sans: "Thmanyah Sans", "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html { direction: rtl; }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 17px;
	line-height: 1.9;
	-webkit-text-size-adjust: 100%;
	direction: rtl;
	text-align: right;
}

a { color: inherit; }
/* Form controls don't inherit the page font by default */
button, input, textarea, select { font-family: inherit; }
img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.site-header {
	color: #fff;
	background-color: var(--header);
	background-image:
		linear-gradient(to left, rgba(4, 12, 48, .72), rgba(4, 12, 48, .38)),
		url("assets/header-bg.jpg");
	background-size: cover;
	background-position: center 40%;
}
.site-header .site-title,
.site-header .site-subtitle,
.main-nav a { text-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.site-header .top {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 24px;
	padding-top: 40px;
	padding-bottom: 26px;
}
.site-title {
	margin: 0;
	font-family: var(--sans);
	font-weight: 700;
	font-size: 34px;
	line-height: 1.3;
	text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.site-title a { text-decoration: none; }
.site-subtitle {
	margin: 10px 0 0;
	direction: ltr;
	text-align: right;
	font-family: var(--sans);
	font-size: 17px;
	letter-spacing: .22em;
	text-transform: uppercase;
	text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.search-form { display: flex; }
.search-form input[type="search"] {
	width: 170px;
	padding: 7px 10px;
	border: 0;
	font: inherit;
	font-size: 14px;
	background: #fff;
	color: var(--ink);
}

.main-nav { border-top: 1px solid rgba(255, 255, 255, .85); border-bottom: 1px solid rgba(255, 255, 255, .85); }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.main-nav a {
	display: block;
	padding: 8px 18px;
	font-size: 16px;
	font-weight: 500;
	text-decoration: none;
}
.main-nav li:first-child a { padding-right: 0; }
.main-nav a:hover,
.main-nav .is-active > a { text-decoration: underline; text-underline-offset: 8px; }
.main-nav .has-icon a { display: flex; align-items: center; height: 100%; padding-left: 14px; padding-right: 14px; }
.main-nav .has-icon a:hover { opacity: .8; }
.main-nav .has-icon .label {
	position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.icon { display: block; flex: 0 0 auto; }
.site-header .nav-space { height: 22px; }

/* Drawer parts: only used on tablet/phone */
.menu-toggle, .drawer-head, .drawer-search, .drawer-overlay { display: none; }

/* ---------- Content ---------- */
.site-main { padding: 44px 0 70px; min-height: 50vh; }

.section-title {
	font-family: var(--serif);
	font-size: 30px;
	margin: 0 0 30px;
}

/* About */
.about { display: flex; gap: 36px; align-items: flex-start; }
.about-photo { flex: 0 0 240px; }
.about-photo img { width: 240px; height: 240px; object-fit: cover; border-radius: 4px; }
.about-name { font-family: var(--serif); font-size: 38px; font-weight: 700; margin: 0 0 14px; line-height: 1.4; }
.about-name-en { direction: ltr; text-align: right; color: var(--muted); letter-spacing: .08em; margin: -10px 0 16px; font-size: 15px; }
.about-bio p { margin: 0 0 12px; text-align: justify; }
.contact-btn {
	display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
	margin-top: 10px; padding: 8px 18px;
	border: 1.5px solid var(--header); border-radius: 999px;
	color: var(--header); font-weight: 600; text-decoration: none;
}
.contact-btn:hover { background: var(--header); color: #fff; }
.contact-email { direction: ltr; font-weight: 400; opacity: .85; }

/* Post cards (archive) */
.card { display: flex; gap: 26px; margin-bottom: 40px; }
.card-thumb { flex: 0 0 200px; }
.card-thumb a, .card-thumb .ph { display: block; width: 200px; height: 190px; border-radius: 4px; overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb .ph {
	background: linear-gradient(135deg, #1b22c9, #3aa6d0);
	display: flex; align-items: center; justify-content: center;
	color: #fff; font-size: 44px;
}
.card-body { flex: 1; min-width: 0; }
.card-cat { color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: none; }
.card-title { font-family: var(--serif); font-size: 25px; line-height: 1.5; margin: 2px 0 6px; }
.card-title a { text-decoration: none; }
.card-title a:hover { text-decoration: underline; }
.card-date { color: var(--muted); font-size: 14px; }
.card-excerpt { margin: 8px 0 10px; color: #444;
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-excerpt p { margin: 0; }
.read-more { font-weight: 700; font-size: 14px; text-decoration: none; letter-spacing: .02em; }
.read-more:hover { color: var(--accent); }

.pagination .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers { padding: 4px 12px; border: 1px solid #ddd; text-decoration: none; }
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Single post / page */
.entry-header { margin-bottom: 24px; }
.entry-title { font-family: var(--serif); font-size: 34px; line-height: 1.5; margin: 4px 0 6px; }
.entry-thumb { margin: 0 0 26px; }
.entry-thumb img { width: 100%; border-radius: 4px; }
.entry-content { font-size: 18px; }
.entry-content img, .entry-content iframe, .entry-content video { max-width: 100%; }
.entry-content blockquote { margin: 20px 0; padding: 4px 18px; border-right: 4px solid var(--accent); color: #555; }
.empty { color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid #e6e6e6; padding: 22px 0 40px; font-size: 14px; color: #666; }

/* ---------- iPad & iPhone: side drawer ---------- */
@media (max-width: 1024px) {
	.wrap { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
	.site-header .top { align-items: center; justify-content: flex-start; gap: 16px; padding-top: 22px; padding-bottom: 22px; }
	.header-search, .site-header .nav-space { display: none; }

	.menu-toggle {
		display: flex; flex-direction: column; justify-content: center; gap: 5px;
		flex: 0 0 auto; width: 44px; height: 44px; padding: 10px;
		background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .5); border-radius: 6px;
		cursor: pointer;
	}
	.menu-toggle span { display: block; height: 2px; background: #fff; border-radius: 2px; }

	.main-nav {
		position: fixed; top: 0; right: 0; bottom: 0; z-index: 1000;
		width: min(300px, 85vw);
		padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
		background: #0a1a3f;
		border: 0;
		overflow-y: auto;
		transform: translateX(100%);
		transition: transform .25s ease;
		box-shadow: -6px 0 24px rgba(0, 0, 0, .3);
	}
	body.drawer-open { overflow: hidden; }
	body.drawer-open .main-nav { transform: none; }
	.drawer-overlay { display: block; position: fixed; inset: 0; z-index: 999; background: rgba(0, 0, 0, .45); }
	.drawer-overlay[hidden] { display: none; }

	.drawer-head {
		display: flex; justify-content: space-between; align-items: center;
		padding: 16px 20px; font-weight: 700; border-bottom: 1px solid rgba(255, 255, 255, .2);
	}
	.menu-close { background: none; border: 0; color: #fff; font-size: 22px; line-height: 1; padding: 6px; cursor: pointer; }
	.drawer-search { display: block; padding: 14px 20px; }
	.drawer-search .search-form input[type="search"] { width: 100%; }
	.drawer-search .search-form { width: 100%; }

	.main-nav ul { flex-direction: column; }
	.main-nav a,
	.main-nav li:first-child a,
	.main-nav .has-icon a {
		display: flex; align-items: center; gap: 12px;
		padding: 14px 20px; font-size: 17px;
		border-bottom: 1px solid rgba(255, 255, 255, .12);
	}
	.main-nav .is-active > a { background: rgba(255, 255, 255, .12); text-decoration: none; }
	.main-nav .has-icon .label { position: static; width: auto; height: auto; clip: auto; }
}

/* ---------- Phone layout ---------- */
@media (max-width: 720px) {
	.site-title { font-size: 23px; }
	.site-subtitle { font-size: 13px; letter-spacing: .1em; margin-top: 4px; }
	.site-main { padding-top: 30px; }
	.about { flex-direction: column; align-items: center; }
	.about-name, .about-name-en { text-align: center; }
	.about-name { font-size: 30px; }
	.contact-btn { justify-content: center; width: 100%; }
	.card { flex-direction: column; gap: 14px; }
	.card-thumb a, .card-thumb .ph { width: 100%; height: 210px; }
	.card-thumb { flex-basis: auto; }
}
