/*
Theme Name: Bnaweet Magazine
Theme URI: https://bnaweet.com
Author: Bnaweet
Author URI: https://bnaweet.com
Description: قالب مجلة بناويت - قالب عربي RTL لمجلة نسائية في الصحة والجمال والأزياء، مستوحى من تصميم الموقع السابق.
Version: 1.0.1
Requires at least: 5.9
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bnaweet
Tags: rtl-language-support, custom-logo, custom-menu, featured-images, right-sidebar, blog, news
*/

:root {
	--bn-primary: #fc3f95;
	--bn-primary-dark: #ca0d63;
	--bn-dark: #222222;
	--bn-text: #2c2c2c;
	--bn-muted: #777777;
	--bn-border: #e8e8e8;
	--bn-bg: #f5f6f7;
	--bn-white: #ffffff;
	--bn-radius: 8px;
	--bn-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	direction: rtl;
	text-align: right;
	font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.8;
	color: var(--bn-text);
	background: var(--bn-bg);
}

img { max-width: 100%; height: auto; }

a { color: var(--bn-text); text-decoration: none; transition: color .2s; }
a:hover { color: var(--bn-primary); }

h1, h2, h3, h4, h5, h6 { line-height: 1.5; margin: 0 0 .6em; color: var(--bn-dark); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	clip: rect(1px, 1px, 1px, 1px);
	overflow: hidden;
}

/* ===== Header ===== */
.top-bar {
	background: var(--bn-dark);
	color: #ccc;
	font-size: 13px;
}
.top-bar .container { display: flex; justify-content: space-between; align-items: center; min-height: 36px; }
.top-bar a { color: #ccc; margin-inline-start: 12px; }
.top-bar a:hover { color: var(--bn-primary); }

.site-header { background: var(--bn-white); box-shadow: var(--bn-shadow); position: relative; z-index: 50; }
.header-main .container { display: flex; align-items: center; justify-content: space-between; min-height: 80px; }
.site-logo img { max-height: 40px; width: auto; display: block; }
.site-logo .site-title { font-size: 30px; font-weight: 700; color: var(--bn-primary); margin: 0; }
.site-logo .site-title a { color: var(--bn-primary); }

.main-nav-wrap { background: var(--bn-white); border-top: 1px solid var(--bn-border); }
.main-nav { display: flex; align-items: center; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.main-nav > ul > li > a {
	display: block;
	padding: 14px 16px;
	font-weight: 700;
	font-size: 15px;
	color: var(--bn-dark);
	border-bottom: 3px solid transparent;
}
.main-nav > ul > li > a:hover,
.main-nav > ul > li.current-menu-item > a {
	color: var(--bn-primary);
	border-bottom-color: var(--bn-primary);
}
.main-nav ul ul {
	display: none;
	position: absolute;
	background: var(--bn-white);
	box-shadow: 0 4px 12px rgba(0,0,0,.12);
	min-width: 190px;
	z-index: 99;
}
.main-nav ul li { position: relative; }
.main-nav ul li:hover > ul { display: block; }
.main-nav ul ul li a { display: block; padding: 10px 16px; font-size: 14px; border-bottom: 1px solid var(--bn-border); }

.header-search { position: relative; }
.header-search form { display: flex; }
.header-search input[type="search"] {
	border: 1px solid var(--bn-border);
	border-radius: 20px 0 0 20px;
	padding: 8px 16px;
	font-family: inherit;
	font-size: 14px;
	width: 200px;
	outline: none;
}
.header-search input[type="search"]:focus { border-color: var(--bn-primary); }
.header-search button {
	background: var(--bn-primary);
	color: #fff;
	border: none;
	border-radius: 0 20px 20px 0;
	padding: 8px 16px;
	cursor: pointer;
	font-family: inherit;
}
.header-search button:hover { background: var(--bn-primary-dark); }

.menu-toggle {
	display: none;
	background: none;
	border: none;
	font-size: 26px;
	color: var(--bn-dark);
	cursor: pointer;
	padding: 6px 10px;
}

/* ===== Breadcrumb ===== */
.breadcrumb { font-size: 13px; color: var(--bn-muted); margin: 18px 0 0; }
.breadcrumb a { color: var(--bn-muted); }
.breadcrumb a:hover { color: var(--bn-primary); }
.breadcrumb .sep { margin: 0 6px; }

/* ===== Layout ===== */
.site-content { padding: 25px 0 40px; }
.content-sidebar { display: grid; grid-template-columns: 1fr 320px; gap: 30px; align-items: start; }
.content-sidebar > * { min-width: 0; }
.no-sidebar .content-sidebar { grid-template-columns: 1fr; }

/* ===== Post cards ===== */
.post-card {
	background: var(--bn-white);
	border-radius: var(--bn-radius);
	box-shadow: var(--bn-shadow);
	overflow: hidden;
	position: relative;
	display: flex;
	flex-direction: column;
}
.post-card .thumb { position: relative; display: block; overflow: hidden; aspect-ratio: 16/10; background: #eee; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; display: block; }
.post-card:hover .thumb img { transform: scale(1.05); }
.post-card .card-body { padding: 14px 16px 16px; flex: 1; }
.post-card .post-title { font-size: 16px; margin: 0 0 8px; font-weight: 700; }
.post-card .post-title a { color: var(--bn-dark); }
.post-card .post-title a:hover { color: var(--bn-primary); }
.post-card .post-meta { font-size: 12px; color: var(--bn-muted); }
.post-card .excerpt { font-size: 13px; color: #555; margin-top: 6px; }

.cat-badge {
	position: absolute;
	top: 10px;
	right: 10px;
	background: var(--bn-primary);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	padding: 3px 10px;
	border-radius: 3px;
	z-index: 2;
}
.cat-badge:hover { background: var(--bn-primary-dark); color: #fff; }

.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.posts-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

/* ===== Featured section ===== */
.featured-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 15px; margin-bottom: 30px; }
.featured-grid .feat-item { position: relative; border-radius: var(--bn-radius); overflow: hidden; min-height: 180px; display: block; background: #ddd; }
.featured-grid .feat-item:first-child { grid-row: span 2; min-height: 380px; }
.feat-item img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; transition: transform .35s; }
.feat-item:hover img { transform: scale(1.04); }
.feat-item .feat-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0,0,0,.75) 0%, rgba(0,0,0,.05) 60%);
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 16px;
	z-index: 1;
}
.feat-item .feat-title { color: #fff; font-size: 16px; font-weight: 700; margin: 6px 0 0; line-height: 1.5; }
.feat-item:first-child .feat-title { font-size: 22px; }
.feat-item .cat-badge { position: static; align-self: flex-start; }

/* ===== Magazine block ===== */
.mag-block { background: var(--bn-white); border-radius: var(--bn-radius); box-shadow: var(--bn-shadow); padding: 20px; margin-bottom: 30px; }
.mag-block-head { display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--bn-border); margin-bottom: 20px; }
.mag-block-head h2 { font-size: 20px; margin: 0; padding-bottom: 10px; border-bottom: 2px solid var(--bn-primary); margin-bottom: -2px; }
.mag-block-head h2 a { color: var(--bn-dark); }
.mag-block-head .more-link { font-size: 13px; color: var(--bn-muted); }
.mag-block-head .more-link:hover { color: var(--bn-primary); }
.mag-block-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; }
.mag-block .big-post .thumb { aspect-ratio: 16/10; border-radius: var(--bn-radius); overflow: hidden; display: block; position: relative; background: #eee; }
.mag-block .big-post .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.mag-block .big-post:hover .thumb img { transform: scale(1.04); }
.mag-block .big-post .post-title { font-size: 19px; margin: 12px 0 6px; }
.mag-block .small-posts { display: flex; flex-direction: column; gap: 14px; }
.list-item { display: flex; gap: 12px; align-items: flex-start; }
.list-item .thumb { flex: 0 0 100px; aspect-ratio: 4/3; border-radius: 6px; overflow: hidden; display: block; background: #eee; }
.list-item .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.list-item .post-title { font-size: 14px; margin: 0 0 4px; font-weight: 700; }
.list-item .post-meta { font-size: 12px; color: var(--bn-muted); }

/* ===== Archive header ===== */
.archive-head { margin-bottom: 25px; }
.archive-head h1 {
	font-size: 24px;
	display: inline-block;
	background: var(--bn-white);
	padding: 10px 20px;
	border-radius: var(--bn-radius);
	border-right: 4px solid var(--bn-primary);
	box-shadow: var(--bn-shadow);
	margin: 0;
}
.archive-head .archive-desc { color: var(--bn-muted); margin-top: 10px; font-size: 14px; }

/* ===== Single post ===== */
.single-post-wrap, .page-wrap {
	background: var(--bn-white);
	border-radius: var(--bn-radius);
	box-shadow: var(--bn-shadow);
	padding: 30px;
}
.entry-header .entry-title { font-size: 28px; margin-bottom: 12px; }
.entry-meta { font-size: 13px; color: var(--bn-muted); margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 15px; align-items: center; }
.entry-meta .meta-cat a { background: var(--bn-primary); color: #fff; padding: 2px 10px; border-radius: 3px; font-size: 12px; font-weight: 700; }
.entry-meta .meta-cat a:hover { background: var(--bn-primary-dark); }
.post-featured-img { margin: 0 0 25px; border-radius: var(--bn-radius); overflow: hidden; }
.post-featured-img img { display: block; width: 100%; max-height: 480px; object-fit: cover; }

.entry-content { font-size: 17px; line-height: 2; }
.entry-content h2, .entry-content h3 {
	position: relative;
	padding-right: 14px;
}
.entry-content h2::before, .entry-content h3::before {
	content: "";
	position: absolute;
	right: 0;
	top: 8px;
	bottom: 8px;
	width: 4px;
	background: var(--bn-primary);
	border-radius: 2px;
}
.entry-content img { border-radius: var(--bn-radius); margin: 10px auto; display: block; max-width: 100%; height: auto; }
/* old-site figures carry inline width:2000px — force them down */
.entry-content figure,
.entry-content .wp-caption { max-width: 100% !important; width: auto !important; margin-inline: auto; }
.entry-content .wp-caption-text {
	text-align: center;
	font-size: 13px;
	color: var(--bn-muted);
	margin: 6px 0 0;
}

/* ===== Jannah related-posts widget scraped inside old content ===== */
.entry-content .mag-box-container { margin: 20px 0; }
.entry-content .mag-box .widget-title { display: none; }
.entry-content ul.posts-items {
	list-style: none;
	margin: 0;
	padding: 15px;
	background: var(--bn-bg);
	border: 1px solid var(--bn-border);
	border-radius: var(--bn-radius);
	display: grid;
	gap: 12px;
}
.entry-content ul.posts-items::before {
	content: "اقرئي أيضاً";
	font-weight: 800;
	color: var(--bn-dark);
	font-size: 16px;
	border-bottom: 2px solid var(--bn-primary);
	padding-bottom: 6px;
	margin-bottom: 4px;
	display: inline-block;
	width: fit-content;
}
.entry-content ul.posts-items li {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
}
.entry-content ul.posts-items li img {
	width: 90px;
	height: 62px;
	object-fit: cover;
	border-radius: 6px;
	margin: 0;
	flex-shrink: 0;
}
.entry-content ul.posts-items .post-widget-body { flex: 1; min-width: 0; }
.entry-content ul.posts-items a.post-title {
	font-size: 14px;
	font-weight: 700;
	color: var(--bn-text);
	display: block;
	line-height: 1.6;
}
.entry-content ul.posts-items a.post-title:hover { color: var(--bn-primary); text-decoration: none; }
.entry-content ul.posts-items .date { font-size: 12px; color: var(--bn-muted); }
.entry-content a { color: var(--bn-primary); }
.entry-content a:hover { color: var(--bn-primary-dark); text-decoration: underline; }
.entry-content blockquote {
	border-right: 4px solid var(--bn-primary);
	background: var(--bn-bg);
	margin: 20px 0;
	padding: 15px 20px;
	border-radius: var(--bn-radius);
}
.entry-content table { border-collapse: collapse; width: 100%; margin: 20px 0; }
.entry-content table td, .entry-content table th { border: 1px solid var(--bn-border); padding: 8px 12px; }

/* ===== جدول المحتويات (LuckyWP TOC leftovers from the old site) ===== */
.lwptoc {
	background: #fef5f9;
	border: 1px solid #fadbe9;
	border-radius: var(--bn-radius);
	padding: 18px 22px;
	margin: 20px 0 25px;
	font-size: 15px;
	line-height: 1.9;
}
.lwptoc br { display: none; }
.lwptoc_header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-bottom: 10px;
	margin-bottom: 10px;
	border-bottom: 1px solid #fadbe9;
}
.lwptoc_title { font-size: 17px; font-weight: 800; color: var(--bn-dark); }
.lwptoc_toggle_label {
	font-size: 12px;
	color: var(--bn-primary);
	background: #fff;
	border: 1px solid #fadbe9;
	border-radius: 12px;
	padding: 1px 12px;
	cursor: pointer;
}
.lwptoc_items.lwptoc-collapsed { display: none; }
.lwptoc_item { margin: 2px 0; }
.lwptoc_item a { color: var(--bn-text); display: inline-block; padding: 2px 0; }
.lwptoc_item a:hover { color: var(--bn-primary); }
.lwptoc_item_number { color: var(--bn-primary); font-weight: 700; margin-inline-end: 6px; }
.lwptoc_itemWrap .lwptoc_itemWrap { margin-right: 18px; }
.lwptoc_itemWrap .lwptoc_itemWrap .lwptoc_item a { font-size: 14px; color: #555; }
.lwptoc p { margin: 0; }

.entry-tags { margin-top: 25px; }
.entry-tags a {
	display: inline-block;
	background: var(--bn-bg);
	border: 1px solid var(--bn-border);
	border-radius: 20px;
	padding: 4px 14px;
	font-size: 13px;
	margin: 0 0 8px 8px;
	color: var(--bn-muted);
}
.entry-tags a:hover { background: var(--bn-primary); border-color: var(--bn-primary); color: #fff; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 25px; }
.post-nav a {
	display: block;
	background: var(--bn-white);
	border: 1px solid var(--bn-border);
	border-radius: var(--bn-radius);
	padding: 14px 16px;
	font-size: 14px;
	font-weight: 700;
}
.post-nav a:hover { border-color: var(--bn-primary); }
.post-nav .nav-label { display: block; font-size: 12px; color: var(--bn-muted); font-weight: 400; margin-bottom: 4px; }
.post-nav .next { text-align: left; }

.related-posts { margin-top: 35px; }
.related-posts h3 { font-size: 20px; border-bottom: 2px solid var(--bn-primary); display: inline-block; padding-bottom: 8px; margin-bottom: 20px; }

/* ===== Sidebar ===== */
.sidebar .widget {
	background: var(--bn-white);
	border-radius: var(--bn-radius);
	box-shadow: var(--bn-shadow);
	padding: 20px;
	margin-bottom: 25px;
}
.sidebar .widget-title {
	font-size: 17px;
	border-bottom: 2px solid var(--bn-border);
	padding-bottom: 10px;
	margin-bottom: 15px;
	position: relative;
}
.sidebar .widget-title::after {
	content: "";
	position: absolute;
	bottom: -2px;
	right: 0;
	width: 50px;
	height: 2px;
	background: var(--bn-primary);
}
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget ul li { padding: 8px 0; border-bottom: 1px solid var(--bn-bg); font-size: 14px; }
.sidebar .widget ul li:last-child { border-bottom: none; }
.sidebar .widget_categories li { display: flex; justify-content: space-between; }

/* ===== Pagination ===== */
.pagination { margin-top: 30px; text-align: center; }
.pagination .nav-links { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pagination .page-numbers {
	display: inline-block;
	background: var(--bn-white);
	border: 1px solid var(--bn-border);
	border-radius: 6px;
	padding: 8px 14px;
	font-size: 14px;
	font-weight: 700;
	color: var(--bn-dark);
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover { background: var(--bn-primary); border-color: var(--bn-primary); color: #fff; }

/* ===== Footer ===== */
.site-footer { background: var(--bn-dark); color: #bbb; margin-top: 20px; }
.footer-widgets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; padding: 40px 0; }
.site-footer .widget-title { color: #fff; font-size: 17px; border-bottom: 2px solid var(--bn-primary); display: inline-block; padding-bottom: 8px; margin-bottom: 15px; }
.site-footer a { color: #bbb; }
.site-footer a:hover { color: var(--bn-primary); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer ul li { padding: 6px 0; font-size: 14px; }
.footer-bottom { border-top: 1px solid #333; padding: 18px 0; font-size: 13px; }
.footer-bottom .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ===== Misc ===== */
.error-404 { text-align: center; padding: 60px 20px; background: var(--bn-white); border-radius: var(--bn-radius); box-shadow: var(--bn-shadow); }
.error-404 h1 { font-size: 80px; color: var(--bn-primary); margin: 0; }

.back-to-top {
	position: fixed;
	bottom: 25px;
	left: 25px;
	width: 42px; height: 42px;
	background: var(--bn-primary);
	color: #fff;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	font-size: 18px;
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 200;
	box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.back-to-top.show { display: flex; }
.back-to-top:hover { background: var(--bn-primary-dark); }

/* ===== Responsive ===== */
@media (max-width: 991px) {
	.content-sidebar { grid-template-columns: 1fr; }
	.posts-grid { grid-template-columns: repeat(2, 1fr); }
	.featured-grid { grid-template-columns: 1fr 1fr; }
	.featured-grid .feat-item:first-child { grid-column: span 2; grid-row: auto; min-height: 260px; }
	.footer-widgets { grid-template-columns: 1fr; }
	.mag-block-inner { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
	.menu-toggle { display: block; }
	.main-nav { display: none; width: 100%; }
	.main-nav.open { display: block; }
	.main-nav ul { flex-direction: column; }
	.main-nav ul ul { display: block; position: static; box-shadow: none; padding-right: 15px; }
	.header-search input[type="search"] { width: 130px; }
	.posts-grid { grid-template-columns: 1fr; }
	.featured-grid { grid-template-columns: 1fr; }
	.featured-grid .feat-item:first-child { grid-column: auto; }
	.entry-header .entry-title { font-size: 22px; }
	.single-post-wrap, .page-wrap { padding: 18px; }
	.post-nav { grid-template-columns: 1fr; }
}
