/*
Theme Name: بران
Description: قالب إخباري عربي متجاوب مع أقسام تحريرية ولوحة إعدادات خاصة.
Version: 1.0.1
Requires at least: 6.2
Requires PHP: 7.4
Text Domain: baran
Tags: news, blog, custom-colors, custom-logo, custom-menu, featured-images, rtl-language-support, threaded-comments
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/
:root {
    --brand: #704642;
    --accent: #e5a414;
    --urgent: #b32906;
    --paper: #f5f6f4;
    --ink: #221c1b;
    --muted: #615653;
    --rule: #e2dcd8;
    --surface: #fff;
    --frame: 1260px;
}
*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: "Tajawal", Tahoma, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}
[hidden] { display: none !important; }
img { display: block; height: auto; max-width: 100%; }
a { color: inherit; text-underline-offset: .2em; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid #1c73b8;
    outline-offset: 3px;
}
button, input, textarea, select { font: inherit; }
button, input[type="submit"] { cursor: pointer; }
h1, h2, h3, p { margin-block-start: 0; }
.baran-wrap { width: min(var(--frame), calc(100% - 48px)); margin-inline: auto; }
.screen-reader-text {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip-link:focus {
    width: auto; height: auto; margin: 0; clip-path: none; inset: 12px auto auto 12px;
    padding: 8px 16px; background: #fff; z-index: 100000;
}
.masthead { background: var(--surface); border-block-start: 4px solid var(--accent); }
.masthead-inner, .masthead-tools, .footer-line {
    display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap;
}
.masthead-inner { min-height: 116px; padding-block: 16px; }
.identity p { font-size: .86rem; color: var(--muted); margin: 0; }
.wordmark { font-size: clamp(2rem, 4vw, 3.1rem); font-weight: 700; line-height: 1.2; text-decoration: none; color: var(--brand); }
.custom-logo { max-width: min(200px, 65vw); max-height: 78px; object-fit: contain; }
.masthead-tools time { font-size: .86rem; color: var(--muted); }
.search-form { display: flex; gap: 0; width: max-content; max-width: 100%; }
.search-form label { min-width: 0; }
.search-form input { border: 1px solid var(--rule); padding: 7px 10px; width: 100%; min-width: 0; background: #fff; }
.search-form button, .comment-form .submit { background: #272222; color: #fff; border: 0; padding: 7px 13px; }
.nav-band { background: var(--brand); color: #fff; border-block-end: 3px solid var(--accent); }
.menu, .sub-menu, .ticker ul, .latest-list { list-style: none; margin: 0; padding: 0; }
.primary-nav .menu { display: flex; flex-wrap: wrap; }
.primary-nav li { position: relative; }
.primary-nav a { display: block; padding: 10px 15px; text-decoration: none; font-weight: 700; }
.primary-nav a:hover, .primary-nav .current-menu-item > a { background: #0004; }
.primary-nav .sub-menu { background: #302422; min-width: 13rem; position: absolute; inset-inline-start: 0; z-index: 10; display: none; }
.primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { display: block; }
.menu-toggle { background: transparent; color: inherit; border: 1px solid currentColor; padding: 4px 12px; margin-block: 8px; }
.ticker { display: flex; margin-block-start: 18px; align-items: stretch; border: 1px solid var(--rule); background: var(--surface); }
.ticker strong { background: var(--urgent); color: #fff; padding: 8px 14px; display: grid; place-items: center; white-space: nowrap; }
.ticker ul { display: flex; flex: 1; gap: 20px; padding: 8px 14px; min-width: 0; overflow-x: auto; }
.ticker li { flex: 0 0 auto; max-width: min(32rem, 68vw); }
.ticker a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .88rem; text-decoration: none; }
.ticker a:hover { text-decoration: underline; }
.main-wrap { padding-block: 24px 54px; min-height: 50vh; }
.news-layout { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
.news-column, .news-sidebar { min-width: 0; }
.news-section { margin-block-end: 30px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-block-end: 1px solid var(--rule); margin-block-end: 14px; }
.section-heading > a { color: var(--brand); font-size: .87rem; }
.section-title { color: var(--brand); font-size: 1.3rem; line-height: 1.4; margin: 0; border-inline-start: 4px solid var(--accent); padding: 5px 10px; }
.archive-heading, .archive-description { margin-block-end: 18px; }
.story-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.story-card, .baran-widget, .article-shell, .empty-state { background: var(--surface); border: 1px solid var(--rule); }
.story-card { overflow: hidden; min-width: 0; }
.story-image img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.story-body { padding: 13px 15px 15px; }
.story-body p { margin: 8px 0 0; }
.story-title { margin: 6px 0 0; font-size: 1.04rem; line-height: 1.55; }
.story-title a { text-decoration: none; }
.story-title a:hover { text-decoration: underline; }
.story-meta { display: flex; gap: 6px 12px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.story-category { font-weight: 700; color: var(--brand); text-decoration: none; }
.story-featured { grid-column: span 2; grid-row: span 3; }
.story-featured .story-title { font-size: clamp(1.35rem, 2.6vw, 2rem); }
.story-featured:only-child { grid-column: 1 / -1; grid-row: auto; }
.lead-grid .story-card:not(.story-featured) .story-image img { aspect-ratio: 2.35; }
.section-podcast, .section-video { background: #282221; color: #fff; padding: 16px; }
:is(.section-podcast, .section-video) :is(.section-title, .section-heading > a) { color: #fff; }
:is(.section-podcast, .section-video) .story-card { color: var(--ink); }
.baran-widget { padding: 15px; margin-block-end: 14px; }
.baran-widget .section-title { margin-block-end: 12px; }
.latest-list li { padding-block: 10px; border-block-end: 1px solid var(--rule); }
.latest-list li:last-child { border: 0; }
.latest-list time { display: block; color: var(--muted); font-size: .76rem; }
.latest-list a { text-decoration: none; font-weight: 700; line-height: 1.5; display: block; }
.latest-list a:hover { text-decoration: underline; }
.article-shell, .empty-state { padding: clamp(16px, 4vw, 42px); }
.article-shell .article-header h1, .empty-state h1 { font-size: clamp(1.7rem, 4.8vw, 3rem); line-height: 1.35; margin-block: 10px 16px; }
.article-categories, .article-content a, .empty-state a { color: var(--brand); }
.article-image { margin: 24px 0; }
.article-image img { width: 100%; max-height: 680px; object-fit: contain; background: var(--paper); }
.article-image figcaption { color: var(--muted); font-size: .85rem; padding-block-start: 6px; }
.article-content { font-size: 1.12rem; line-height: 1.95; margin-block-start: 20px; }
.article-content img { display: inline-block; }
.article-content iframe, .article-content video { max-width: 100%; }
.article-content .aligncenter { display: block; margin-inline: auto; }
.article-content pre { overflow: auto; }
.comments-area { margin-block-start: 20px; }
.comment-form textarea { width: 100%; }
.pagination, .comments-pagination { margin-block: 20px; }
.page-numbers { display: inline-block; padding: 4px 10px; }
.page-numbers.current { background: var(--brand); color: #fff; }
.site-footer { border-block-start: 4px solid var(--accent); background: #282221; color: #fff; padding-block: 24px; }
.site-footer .menu { display: flex; gap: 10px 20px; flex-wrap: wrap; }
.footer-line p { margin: 0; }
.footer-widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 16px; margin-block-end: 16px; color: var(--ink); }
@media (min-width: 1000px) {
    .news-layout.with-sidebar { grid-template-columns: minmax(0, 1fr) minmax(235px, 26%); }
    .news-layout.sidebar-start { grid-template-columns: minmax(235px, 26%) minmax(0, 1fr); }
    .news-layout.sidebar-start .news-sidebar { grid-column: 1; grid-row: 1; }
    .news-layout.sidebar-start .news-column { grid-column: 2; grid-row: 1; }
}
@media (max-width: 760px) {
    .baran-wrap { width: calc(100% - 28px); }
    .masthead-inner, .masthead-tools { gap: 10px; }
    .masthead-inner { min-height: auto; }
    .primary-nav .menu, .primary-nav .sub-menu { display: block; }
    .primary-nav .sub-menu { position: static; padding-inline-start: 15px; }
    .primary-nav a { padding-block: 6px; }
    .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .story-featured { grid-column: 1 / -1; grid-row: auto; }
}
@media (max-width: 460px) {
    .story-grid { grid-template-columns: minmax(0, 1fr); }
    .masthead-tools { width: 100%; }
}
