/*
Theme Name: Rawnaq News
Description: قالب أخبار ومجلة عربي بطابع خليجي: شريط عاجل، أخبار مميزة، أقسام، ووضع ليلي.
Version: 1.0.0
Requires at least: 6.0
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: rawnaq-news
Tags: news, right-sidebar, custom-menu, custom-logo, featured-images, rtl-language-support
*/

:root { --primary: #0b4d3b; --accent: #c9a45c; --bg: #f7f4ec; --surface: #fff; --text: #17231f; --muted: #66736e; --line: #e6e0d2; --link: var(--primary); }
html.dark { --bg: #0e1512; --surface: #17211d; --text: #ecf0ee; --muted: #9eada7; --line: #2a3933; --link: var(--accent); }
* { box-sizing: border-box; }
body { margin: 0; direction: rtl; background: var(--bg); color: var(--text); font: 17px/1.8 Tajawal, Tahoma, Arial, sans-serif; overflow-wrap: break-word; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--link); }
img { max-width: 100%; height: auto; }
button, input, textarea { font: inherit; }
button, input[type=submit] { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.45; margin: 0 0 .5em; }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; top: -100px; }
.skip:focus { top: 8px; right: 8px; background: var(--surface); padding: 8px 16px; z-index: 99; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.topbar { background: #0b1f19; color: #dfe8e4; font-size: .85rem; }
.topbar .wrap, .site-header > .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.topbar .wrap { padding-block: 4px; }
.social { display: flex; gap: 14px; align-items: center; }
.topbar a:hover { color: var(--accent); }
.topbar button { background: none; color: inherit; border: 1px solid #ffffff44; border-radius: 20px; padding: 0 12px; }

.site-header { background: var(--surface); box-shadow: 0 4px 20px #0000000d; margin-bottom: 20px; }
.site-header > .wrap { padding-block: 18px; }
.site-name { font-size: 2rem; font-weight: 800; color: var(--link); }
.brand small { display: block; color: var(--muted); }
.search-form { display: flex; gap: 6px; }
.search-form input[type=search] { background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; width: 100%; }
input[type=submit], .search-submit { background: var(--primary); color: #fff; border: 0; border-radius: 8px; padding: 6px 18px; }
#menu-toggle { display: none; background: var(--primary); color: #fff; border: 0; border-radius: 8px; padding: 6px 14px; }
#main-nav { background: var(--primary); color: #fff; border-bottom: 3px solid var(--accent); }
#main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
#main-nav li { position: relative; }
#main-nav a { display: block; padding: 10px 16px; font-weight: 700; }
#main-nav a:hover, #main-nav .current-menu-item > a, #main-nav .current_page_item > a { background: #00000030; color: #fff; }
#main-nav li ul { display: none; position: absolute; right: 0; top: 100%; min-width: 200px; background: var(--primary); z-index: 20; }
#main-nav li:hover > ul, #main-nav li:focus-within > ul { display: block; }

.ticker { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 20px; }
.ticker strong { background: #b3261e; color: #fff; padding: 8px 18px; }
.ticker-view { flex: 1; min-width: 0; padding-inline: 14px; }
.ticker ul { list-style: none; margin: 0; padding: 0; }
.ticker li { display: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticker:not(.js) li:first-child, .ticker li.on { display: block; animation: fade .4s; }
.ticker button { background: none; border: 0; color: var(--text); font-size: 1.5rem; padding: 0 16px; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }

.card { background: var(--surface); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 18px #0000000f; display: flex; flex-direction: column; min-width: 0; }
.thumb { display: block; aspect-ratio: 3/2; overflow: hidden; background: linear-gradient(135deg, var(--primary), #0b1f19); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.card:hover img { transform: scale(1.05); }
.card-body { padding: 12px 14px 16px; }
.card h3 { font-size: 1.08rem; margin: 6px 0; }
.card p { margin: 0 0 8px; color: var(--muted); font-size: .95rem; }
.card time, .meta, .crumbs { color: var(--muted); font-size: .85rem; }
.badge { display: inline-block; background: var(--accent); color: #17231f; border-radius: 5px; padding: 0 10px; font-size: .78rem; font-weight: 700; }

.hero { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-auto-rows: 220px; gap: 12px; margin-bottom: 32px; }
.overlay { position: relative; }
.overlay:first-child { grid-row: span 2; }
.overlay .thumb { position: absolute; inset: 0; aspect-ratio: auto; }
.overlay .card-body { position: absolute; inset: auto 0 0; background: linear-gradient(transparent, #000000e6 55%); color: #fff; padding-top: 50px; }
.overlay a:hover { color: var(--accent); }
.overlay .badge:hover { color: #17231f; }
.overlay time { color: #ddd; }
.overlay:first-child h3 { font-size: 1.7rem; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.news-section { margin-bottom: 32px; }
.news-section > header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--line); margin-bottom: 16px; }
.section-title { font-size: 1.3rem; border-right: 5px solid var(--accent); padding-right: 12px; }
.news-section .section-title { margin-bottom: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.split { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(3, auto); gap: 14px; }
.split .card:first-child { grid-row: span 3; }
.split .card:not(:first-child) { flex-direction: row; }
.split .card:not(:first-child) .thumb { width: 120px; flex: none; aspect-ratio: 1; }

.box { background: var(--surface); border-radius: 12px; padding: 20px; margin-bottom: 20px; box-shadow: 0 4px 18px #0000000f; }
.ranked { list-style: none; padding: 0; margin: 0; counter-reset: n; }
.ranked li { counter-increment: n; display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 500; }
.ranked li::before { content: counter(n); color: var(--accent); font-size: 1.5rem; font-weight: 800; line-height: 1.2; }
.widget ul { padding-right: 18px; }

.narrow { max-width: 860px; margin-inline: auto; }
.entry h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
.entry > img { width: 100%; border-radius: 10px; }
.entry-content { font-size: 1.12rem; line-height: 2; }
.entry-content a { color: var(--link); text-decoration: underline; }
.entry-content blockquote { margin-inline: 0; padding: 4px 18px; border-right: 4px solid var(--accent); }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content td, .entry-content th { border: 1px solid var(--line); padding: 8px; }
.tags a { display: inline-block; border: 1px solid var(--line); border-radius: 20px; padding: 0 12px; margin: 2px; font-size: .85rem; }
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 14px; }
.share a, .share button { background: var(--primary); color: #fff; border: 0; border-radius: 8px; padding: 4px 16px; }
.comment-list { padding-right: 0; list-style: none; }
.comment-list .children { list-style: none; padding-right: 28px; }
.comment-list .avatar { border-radius: 50%; vertical-align: middle; margin-left: 8px; }
.comment-form input:not([type=submit]):not([type=checkbox]), .comment-form textarea { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.nav-links { display: flex; justify-content: center; gap: 6px; margin-block: 24px; }
.page-numbers { background: var(--surface); border-radius: 6px; padding: 4px 14px; }
.page-numbers.current { background: var(--primary); color: #fff; }
.wp-caption, .alignwide, .alignfull { max-width: 100%; }

.site-footer { background: #0b1f19; color: #dfe8e4; text-align: center; padding-block: 32px; margin-top: 40px; border-top: 4px solid var(--accent); }
.site-footer .site-name { color: var(--accent); margin: 0; }
.site-footer ul { list-style: none; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; }
.site-footer a:hover { color: var(--accent); }
#to-top { position: fixed; left: 18px; bottom: 18px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: #17231f; font-size: 1.3rem; }
#to-top[hidden] { display: none; }
.progress { position: fixed; top: 0; right: 0; height: 4px; width: 0; background: var(--accent); z-index: 100; }
.admin-bar .progress { top: 32px; }

@media (max-width: 960px) {
	.layout { grid-template-columns: minmax(0, 1fr); }
	.hero { grid-template-columns: 1fr 1fr; }
	.overlay:first-child { grid-column: 1 / -1; grid-row: auto; height: 340px; }
	.hero { grid-auto-rows: auto; }
	.overlay { min-height: 220px; }
}
@media (max-width: 680px) {
	#menu-toggle { display: block; }
	#main-nav { display: none; }
	#main-nav.open { display: block; }
	#main-nav ul { display: block; }
	#main-nav li ul { position: static; padding-right: 18px; display: block; }
	.site-header .search-form { order: 3; width: 100%; }
	.hero, .split { grid-template-columns: minmax(0, 1fr); }
	.split { grid-template-rows: none; }
	.split .card:first-child { grid-row: auto; }
	.overlay:first-child h3 { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
