/* Athar24 News 2.3 — newsroom additions (header row, slider, briefs, editorial,
   طوب وفلوب, poll, most read, civic initiatives, simplified footer). */

/* ---------- Header: logo and banner in one row ---------- */
.masthead-inner.has-banner { justify-content: space-between; align-items: center; gap: 28px; padding: 12px 0; }
.masthead-inner.has-banner .brand-wrap { flex: none; }
.masthead-inner.has-banner .brand-logo { width: 190px; }
.ad-slot--header-banner { margin: 0; flex: 0 1 728px; min-width: 0; max-width: 728px; min-height: 0; }
.ad-slot--header-banner img,
.ad-slot--header-banner iframe { max-width: 100%; height: auto; }
.ad-slot--header-banner .ad-widget { width: 100%; }

/* ---------- Slider: image + title only, title low with a light gradient ---------- */
.home-slide .hero-main.hero-main--slide::after { inset: auto 0 0; height: 60%; background: linear-gradient(180deg, rgba(5, 10, 20, 0) 0%, rgba(5, 10, 20, .42) 48%, rgba(5, 10, 20, .8) 100%); }
.home-slide .hero-main.hero-main--slide .hero-copy { inset-inline: 0; bottom: 0; padding: 0 30px 44px; }
.home-slide .hero-main.hero-main--slide .hero-title { font-size: clamp(21px, 2.25vw, 31px); line-height: 1.45; max-width: 900px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 10px rgba(0, 0, 0, .35); overflow-wrap: anywhere; }
.home-slider--empty { position: relative; display: flex; align-items: center; justify-content: center; padding: 20px; background: #fbf6e8; border: 1px dashed #e0b84a; }

/* ---------- «مستجدات الساعة»: static list ---------- */
.flash-rail-list li { grid-template-columns: auto minmax(0, 1fr); }
.flash-rail-list time { white-space: nowrap; min-width: 40px; }
.flash-rail-all { display: block; text-align: center; padding: 9px 12px; border-top: 1px solid var(--line); font-weight: 700; font-size: 13px; color: var(--red); background: #fff; }
.flash-rail-all:hover { background: var(--soft); }
.flash-rail-empty { margin: 14px; }
.home-slider-row--rail-only { grid-template-columns: 1fr; }
.home-slider-row--rail-only .flash-rail { min-height: 0; max-height: none; }

/* Editors-only hints (visitors never see them). */
.empty-state--editor { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; background: #fff8e6; border: 1px dashed #e0b84a; border-radius: 10px; padding: 12px 16px; font-size: 13.5px; color: #5b4a12; text-align: start; }
.empty-state--editor .btn { margin-inline-start: auto; padding: 6px 14px; border-radius: 6px; font-size: 13px; }

/* ---------- Rows: half (2) and third (3) ---------- */
.half-row > :only-child { grid-column: 1 / -1; }
.third-row { display: flex; gap: 24px; margin-bottom: 38px; align-items: stretch; }
.third-row > .news-section { flex: 1 1 0; min-width: 0; margin-bottom: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; }
.third-row .section-head { margin-bottom: 14px; }
.news-section--third .section-head h2 { font-size: 16px; background: var(--navy); }
.news-section--civic .section-head h2 { background: #1f7a5a; }
.news-section--poll .section-head h2 { background: var(--red); }
.third-list { display: grid; gap: 12px; }
.third-list .list-item { grid-template-columns: 92px minmax(0, 1fr); }

/* ---------- «افتتاحية» ---------- */
.news-section--editorial .section-head h2 { background: var(--navy); }
.editorial-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-height: 220px; }
.editorial-thumb { position: relative; display: block; min-height: 200px; background: var(--navy); }
.editorial-thumb img,
.editorial-thumb .no-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.editorial-body { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 16px 18px; }
.editorial-kicker { align-self: flex-start; font-size: 12px; font-weight: 800; color: var(--red); border-bottom: 2px solid var(--red); line-height: 1.6; }
.editorial-title { margin: 0; font-size: 20px; line-height: 1.5; font-weight: 800; }
.editorial-writer { font-weight: 700; color: var(--navy); font-size: 14px; }
.news-section--editorial .list-item { margin-top: 12px; }

/* ---------- «طوب وفلوب» ---------- */
.news-section--topflop .section-head h2 { background: var(--navy); }
.topflop-note { margin: -6px 0 12px; font-size: 12px; color: var(--muted); }
.topflop-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.topflop-item { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-inline-start: 4px solid #c9d0da; border-radius: 10px; padding: 8px; }
.topflop-item--top { border-inline-start-color: #1f9d55; }
.topflop-item--flop { border-inline-start-color: #d71920; }
.topflop-thumb { position: relative; display: block; aspect-ratio: 3 / 2; border-radius: 6px; overflow: hidden; background: var(--soft); }
.topflop-thumb img,
.topflop-thumb .no-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; font-size: 10px; }
.tf-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 800; padding: 1px 9px; border-radius: 999px; margin-bottom: 4px; line-height: 1.8; }
.tf-badge--top { background: #e7f6ee; color: #16794a; }
.tf-badge--flop { background: #fdecec; color: #b5121a; }
.topflop-title { margin: 0; font-size: 15px; line-height: 1.55; font-weight: 700; }

/* ---------- «الأكثر مشاهدة» ---------- */
.mostread-period { margin: -6px 0 6px; font-size: 12px; color: var(--muted); }
.mostread-list { list-style: none; counter-reset: mr; margin: 0; padding: 0; }
.mostread-list li { counter-increment: mr; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: start; padding: 9px 0; border-bottom: 1px dashed var(--line); font-weight: 600; font-size: 14.5px; line-height: 1.55; }
.mostread-list li:last-child { border-bottom: 0; }
.mostread-list li::before { content: counter(mr); font: 800 20px/1.15 var(--font); color: var(--red); text-align: center; }
.sidebar-box .mostread-list li { padding: 8px 0; }

/* ---------- «استطلاع أثر24» ---------- */
.poll-q { margin: 0 0 10px; font-size: 16px; line-height: 1.55; }
.poll-form { display: grid; gap: 6px; }
.poll-form[hidden] { display: none; }
.poll-opt { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 14.5px; background: #fff; }
.poll-opt:hover { border-color: var(--red); }
.poll-opt input { accent-color: var(--red); margin: 0; }
.poll-actions { display: flex; gap: 12px; align-items: center; margin-top: 6px; }
.poll-vote { border: 0; padding: 7px 20px; cursor: pointer; font-size: 14px; }
.poll-vote[disabled] { opacity: .6; cursor: default; }
.poll-show { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 13px; }
.poll-row { margin: 8px 0; }
.poll-row-head { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.poll-bar { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.poll-bar span { display: block; height: 100%; background: var(--red); border-radius: 99px; }
.poll-total { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.poll-msg { font-size: 13px; font-weight: 700; color: var(--navy); margin: 8px 0 0; }
.poll-note { font-size: 11.5px; color: var(--muted); margin: 10px 0 0; line-height: 1.6; }

/* ---------- Simplified footer ---------- */
.footer-simple { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 34px; align-items: start; }
.footer-simple .footer-about p { max-width: 520px; margin-bottom: 0; }
.footer-pages-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; }
.footer-pages-list li { font-size: 14.5px; }
.footer-pages-list a { color: #cfd5dc; }
.footer-pages-list a:hover { color: #fff; }
.site-footer--simple .social-links--footer { margin-top: 18px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.masthead-inner.has-banner { flex-direction: column; gap: 10px; padding: 12px 0 8px; }
	.masthead-inner.has-banner .brand-logo { width: 150px; }
	.ad-slot--header-banner { flex: none; width: 100%; max-width: 100%; }
	.third-row { flex-direction: column; gap: 0; margin-bottom: 0; }
	.third-row > .news-section { margin-bottom: 24px; }
	.flash-rail { max-height: none; }
}
@media (max-width: 680px) {
	.home-slide .hero-main.hero-main--slide .hero-copy { padding: 0 14px 34px; }
	.home-slide .hero-main.hero-main--slide .hero-title { font-size: clamp(16px, 4.7vw, 20px); line-height: 1.5; -webkit-line-clamp: 3; }
	.editorial-card { grid-template-columns: 1fr; }
	.editorial-thumb { min-height: 190px; }
	.editorial-body { padding: 12px 14px 14px; }
	.editorial-title { font-size: 18px; }
	.topflop-item { grid-template-columns: 80px minmax(0, 1fr); }
	.footer-simple { grid-template-columns: 1fr; gap: 20px; }
}

/* «افتتاحية» بجانب «خبر خاص»: نفس الحجم */
.half-row > .news-section--editorial { display: flex; flex-direction: column; }
.half-row .editorial-card { flex: 1 1 auto; grid-template-columns: 1fr; grid-template-rows: auto 1fr; min-height: 0; }
.half-row .editorial-thumb { min-height: 0; aspect-ratio: 16 / 9; }
.half-row .editorial-body { justify-content: flex-start; padding: 16px 20px 18px; }
.half-row .editorial-title { font-size: 22px; }

/* ---------- Top row: «مستجدات الساعة» | slider | «افتتاحية» ---------- */
.home-slider-row.has-editorial { grid-template-columns: 292px minmax(0, 1fr) 292px; grid-template-areas: "rail slider edit"; align-items: stretch; }
.home-slider-row.has-editorial > .home-slider { grid-area: slider; }
.home-slider-row.has-editorial > .flash-rail { grid-area: rail; }
.home-slider-row.has-editorial > .home-editorial { grid-area: edit; }
.home-editorial { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; height: 440px; }
.home-ed-head { border-bottom: 3px solid var(--red); }
.home-ed-thumb { position: relative; display: block; flex: none; aspect-ratio: 16 / 10; background: var(--navy); overflow: hidden; }
.home-ed-thumb img,
.home-ed-thumb .no-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.home-ed-thumb:hover img { transform: scale(1.04); }
.home-ed-body { display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 0; padding: 12px 14px 12px; overflow: hidden; }
.home-ed-writer { align-self: flex-start; font-size: 12.5px; font-weight: 800; color: var(--red); line-height: 1.6; }
.home-ed-title { margin: 0; font-size: 17px; line-height: 1.55; font-weight: 800; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.home-ed-title a { color: var(--ink); }
.home-ed-title a:hover { color: var(--red); }
.home-ed-excerpt { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.home-ed-date { margin-top: auto; font-size: 12px; color: var(--muted); }
.home-editorial .flash-rail-empty { margin: 14px; }

/* «الأكثر مشاهدة» next to «خبر خاص» */
.half-row > .news-section--mostread .section-head h2 { background: var(--navy); font-size: 18px; }
.half-row > .news-section--mostread .mostread-list { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 18px; }
.half-row > .news-section--mostread .mostread-list li { padding: 13px 0; font-size: 15.5px; }

@media (max-width: 1100px) {
	.home-slider-row.has-editorial { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "slider slider" "rail edit"; }
	.home-slider-row.has-editorial > .flash-rail,
	.home-editorial { height: 400px; min-height: 0; max-height: 400px; }
}
@media (max-width: 900px) {
	.home-slider-row.has-editorial { grid-template-columns: minmax(0, 1fr); grid-template-areas: "slider" "rail" "edit"; }
	.home-slider-row.has-editorial > .flash-rail { height: auto; max-height: 320px; }
	.home-editorial { height: auto; max-height: none; }
}
.half-row > .news-section--mostread { display: flex; flex-direction: column; }
.half-row > .news-section--mostread .mostread-list { flex: 1 1 auto; }

/* ---------- «طوب وفلوب» على شكل طالع / نازل ---------- */
.news-section--topflop .section-head h2 { background: var(--navy); }
.updown { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.updown > :only-child { grid-column: 1 / -1; max-width: 640px; }
.updown-card { position: relative; display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 18px; align-items: center; background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--ud); border-radius: 12px; padding: 18px 18px 16px; box-shadow: 0 2px 10px rgba(10, 20, 35, .04); transition: box-shadow .2s ease, transform .2s ease; }
.updown-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.updown-card--up { --ud: #1f9d55; --ud-soft: #e7f6ee; --ud-ink: #16794a; }
.updown-card--down { --ud: #d71920; --ud-soft: #fdecec; --ud-ink: #b5121a; }
.updown-photo { position: relative; display: block; width: 132px; aspect-ratio: 1; border-radius: 50%; padding: 4px; background: var(--ud); }
.updown-photo img, .updown-photo .no-thumb { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid #fff; background: var(--soft); }
.updown-arrow { position: absolute; bottom: 2px; inset-inline-end: 2px; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--ud); color: #fff; border: 3px solid #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .18); }
.updown-arrow svg { width: 18px; height: 18px; }
.updown-flag { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 6px; padding: 2px 12px; border-radius: 999px; background: var(--ud-soft); color: var(--ud-ink); font: 800 14px/1.8 var(--font); }
.updown-flag svg { width: 12px; height: 12px; }
.updown-name { margin: 0 0 6px; font-size: 19px; line-height: 1.45; font-weight: 800; }
.updown-name a { color: var(--ink); }
.updown-name a:hover { color: var(--ud); }
.updown-text { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.updown-slot { display: grid; place-items: center; min-height: 170px; border: 2px dashed var(--line); border-top: 5px solid var(--ud); border-radius: 12px; padding: 16px; text-align: center; color: var(--muted); font-size: 13.5px; background: #fff; }
.updown-slot-text { display: block; margin: 4px 0 10px; }
.updown-slot .btn { font-size: 13px; }
@media (max-width: 900px) {
	.updown-card { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 10px; padding: 16px 12px 14px; }
	.updown-photo { width: 112px; }
}
@media (max-width: 520px) {
	.updown { gap: 10px; }
	.updown-photo { width: 88px; }
	.updown-arrow { width: 30px; height: 30px; }
	.updown-arrow svg { width: 14px; height: 14px; }
	.updown-name { font-size: 15.5px; }
	.updown-text { display: none; }
	.updown-flag { font-size: 12.5px; padding: 1px 10px; }
}

/* ---------- صف «جاليتنا» + «الأكثر مشاهدة» ---------- */
.pair-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; margin-bottom: 38px; align-items: stretch; }
.pair-row--even { grid-template-columns: 1fr 1fr; }
.pair-row > .news-section { margin-bottom: 0; min-width: 0; }
.pair-row > :only-child { grid-column: 1 / -1; }
.pair-row > .news-section--mostread { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; }
.pair-row > .news-section--mostread .section-head h2 { font-size: 16px; background: var(--navy); }
.pair-row > .news-section--mostread:only-child .mostread-list { columns: 2; column-gap: 36px; }
.pair-row > .news-section--mostread:only-child .mostread-list li { break-inside: avoid; }
.pair-row .news-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pair-row .news-grid:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pair-row > :only-child .news-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) {
	.pair-row, .pair-row--even { grid-template-columns: 1fr; gap: 0; margin-bottom: 0; }
	.pair-row > .news-section { margin-bottom: 38px; }
}
@media (max-width: 680px) {
	.pair-row > .news-section--mostread:only-child .mostread-list { columns: 1; }
	.pair-row .news-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
	.pair-row .news-grid > :first-child:nth-last-child(3) { grid-column: 1 / -1; }
}

/* ---------- أركان «قريباً» (تظهر للزوار قبل أول مادة) ---------- */
.news-section--soon { display: flex; flex-direction: column; }
.soon-card { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 240px; padding: 28px 22px; text-align: center; background: linear-gradient(180deg, #fff 0%, var(--soft) 100%); border: 1px solid var(--line); border-radius: 12px; }
.soon-icon { display: grid; place-items: center; width: 68px; height: 68px; margin-bottom: 6px; border-radius: 50%; background: var(--navy); color: #fff; box-shadow: 0 6px 18px rgba(17, 40, 74, .18); }
.soon-icon svg { width: 32px; height: 32px; }
.soon-title { font: 800 22px/1.4 var(--font); color: var(--ink); }
.soon-text { margin: 0; max-width: 380px; color: var(--muted); font-size: 14.5px; line-height: 1.7; }
.soon-card .btn { margin-top: 10px; }
.updown-avatar { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; border: 3px solid #fff; background: var(--ud-soft); color: var(--ud); }
.updown-avatar svg { width: 56%; height: 56%; opacity: .55; }
.updown-card--soon:hover { transform: none; box-shadow: 0 2px 10px rgba(10, 20, 35, .04); }
.updown-card--soon .updown-name { color: var(--muted); }
.updown-card--soon .btn { margin-top: 8px; font-size: 13px; }
@media (max-width: 520px) {
	.updown-card--soon .updown-text { display: none; }
}

/* ---------- صف «عدالة» + «كتاب أثر 24» ---------- */
.pair-row > .news-section--writers { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; }
.pair-row > .news-section--writers.news-section--soon { background: none; border: 0; padding: 0; }
.pair-row > .news-section--writers .section-head h2 { font-size: 16px; background: var(--navy); }
.pair-row .writers-grid { grid-template-columns: 1fr; gap: 0; }
.pair-row .writer-card { flex-direction: row; align-items: center; gap: 12px; padding: 9px 0; text-align: start; border-radius: 0; box-shadow: none; border-bottom: 1px dashed var(--line); }
.pair-row .writer-card:last-child { border-bottom: 0; }
.pair-row .writer-card:hover { transform: none; box-shadow: none; }
.pair-row .writer-avatar { flex: 0 0 auto; }
.pair-row .writer-avatar img { width: 50px; height: 50px; }
.pair-row .writer-body { min-width: 0; }
.pair-row .writer-title { font-size: 14.5px; line-height: 1.5; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pair-row .writer-name { font-size: 13px; }
.pair-row .writer-card .post-meta { display: none; }