/*
Theme Name: الجوزاء نيوز
Author: faraj hamed
Description: قالب إخباري عربي متجاوب مع أقسام تحريرية ولوحة إعدادات خاصة.
Version: 1.5.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; }
.sidebar-search .search-form { width: 100%; }
.sidebar-search .search-form label { flex: 1; }
.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; }
.ticker.rotation-ready ul { display: block; overflow: hidden; }
.ticker.rotation-ready li { max-width: 100%; }
.ticker .rotation-controls { flex-wrap: nowrap; }
.rotation-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px; }
.rotation-controls button { border: 1px solid var(--rule); background: var(--surface); color: var(--ink); padding: 3px 8px; font-size: .85rem; }
.rotation-controls button[aria-pressed="true"] { background: var(--paper); border-color: var(--brand); }
.carousel-slides { display: grid; gap: 12px; overflow: hidden; }
.news-carousel .story-image img { max-height: 390px; object-fit: cover; }
@media (prefers-reduced-motion: no-preference) {
    .motion-fade.rotation-ready [data-slide]:not([hidden]) { animation: baran-fade .35s ease-out; }
    .motion-slide.rotation-ready [data-slide]:not([hidden]) { animation: baran-slide .35s ease-out; }
    .ticker.rotation-ready [data-slide]:not([hidden]) { animation: baran-fade .25s ease-out; }
}
@keyframes baran-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes baran-slide { from { transform: translateX(var(--carousel-offset, 5%)); } to { transform: translateX(0); } }
[dir="rtl"] .news-carousel { --carousel-offset: -5%; }
.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; }
.news-section:not(.news-carousel) .story-card { border-radius: 5px; }
.news-section:not(.news-carousel) .story-body { border-block-start: 2px solid var(--rule); }
.news-carousel .story-featured { border-block-end: 3px solid var(--accent); }
.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 .story-image img { aspect-ratio: 16 / 9; }
.story-featured .story-title { font-size: clamp(1.35rem, 2.6vw, 2rem); }

.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); }
.author-profile {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    padding: clamp(16px, 3vw, 28px);
    margin-block-end: 22px;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-inline-start: 4px solid var(--accent);
}
.author-profile > div { flex: 1 1 230px; min-width: 0; }
.author-avatar { width: clamp(72px, 10vw, 112px); aspect-ratio: 1; height: auto; object-fit: cover; border-radius: 50%; }
.author-profile h1 { color: var(--brand); font-size: clamp(1.65rem, 4vw, 2.65rem); margin: 0; }
.author-count { color: var(--muted); font-weight: 700; margin: 3px 0 0; }
.author-bio { margin-block-start: 8px; max-width: 68ch; }
.author-bio p:last-child { margin-block-end: 0; }
.category-header {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-block-start: 4px solid var(--accent);
    padding: clamp(16px, 3vw, 30px);
    margin-block-end: 20px;
}
.category-header h1 { color: var(--brand); font-size: clamp(1.75rem, 4vw, 2.8rem); margin: 0; }
.category-description { color: var(--muted); margin-block-start: 8px; }
.category-description p:last-child { margin-block-end: 0; }
.category-chips, .category-sidebar ul { list-style: none; margin: 0; padding: 0; }
.category-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 14px; }
.category-chips a { display: block; border: 1px solid var(--rule); padding: 4px 12px; color: var(--brand); text-decoration: none; }
.category-sidebar li { border-block-end: 1px solid var(--rule); }
.category-sidebar li:last-child { border-block-end: 0; }
.category-sidebar .children { padding-inline-start: 12px; }
.category-sidebar a { display: block; padding: 7px 8px; text-decoration: none; }
.category-chips a:hover, .category-sidebar a:hover, .category-sidebar .current-cat > a {
    background: var(--paper);
    color: var(--brand);
    text-decoration: underline;
}
.story-grid.story-list { grid-template-columns: minmax(0, 1fr); }
.story-list .story-title { font-size: 1.18rem; }
.related-news { margin-block-start: 24px; }
.article-tags { font-size: .9rem; color: var(--muted); margin-block-start: 20px; }
@media (min-width: 580px) {
    .story-list .story-card { display: flex; align-items: flex-start; }
    .story-list .story-image { flex: 0 0 31%; }
    .story-list .story-body { min-width: 0; }
}
@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)); }
}
@media (max-width: 460px) {
    .story-grid { grid-template-columns: minmax(0, 1fr); }
    .masthead-tools { width: 100%; }
}
