/*
Theme Name: Shahab News
Theme URI: https://theshahab.com/
Author: The Shahab
Description: A fast, lightweight entertainment news theme for The Shahab. Magazine homepage, clean article pages, no page builder needed.
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: shahab
*/

:root {
	--accent: #e11d48;
	--accent-dark: #be123c;
	--ink: #0f172a;
	--text: #1e293b;
	--muted: #64748b;
	--line: #e2e8f0;
	--bg: #ffffff;
	--soft: #f8fafc;
	--dark: #0b1020;
	--radius: 10px;
	--wrap: 1200px;
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--serif: Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; font-size: 16px; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 1000; width: auto; height: auto; clip: auto; background: #fff; color: var(--ink); padding: 10px 16px; border-radius: 6px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.topbar { background: var(--dark); color: #cbd5e1; font-size: 13px; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; min-height: 36px; gap: 12px; }
.topbar a { color: #e2e8f0; }
.topbar ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; }

.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-main { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 74px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .custom-logo { max-height: 52px; width: auto; }
.wordmark { font-weight: 900; font-size: 28px; letter-spacing: -0.5px; color: var(--ink); line-height: 1; text-transform: uppercase; }
.wordmark span { color: var(--accent); }
.tagline { display: block; font-size: 12px; color: var(--muted); letter-spacing: .3px; margin-top: 4px; font-weight: 500; text-transform: none; }

.primary-nav { display: flex; align-items: center; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; }
.primary-nav > ul { display: flex; gap: 4px; }
.primary-nav li { position: relative; }
.primary-nav a { display: block; padding: 10px 12px; font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .3px; color: var(--ink); border-radius: 6px; }
.primary-nav a:hover, .primary-nav .current-menu-item > a, .primary-nav .current-category-ancestor > a { color: var(--accent); }
.primary-nav .menu-item-has-children > a::after { content: ""; display: inline-block; margin-left: 6px; border: 4px solid transparent; border-top-color: currentColor; transform: translateY(2px); }
.primary-nav .sub-menu { position: absolute; top: 100%; left: 0; min-width: 210px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 30px rgba(15,23,42,.12); padding: 8px; opacity: 0; visibility: hidden; transform: translateY(6px); transition: .15s; z-index: 60; }
.primary-nav li:hover > .sub-menu, .primary-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.primary-nav .sub-menu a { text-transform: none; font-weight: 600; font-size: 14px; padding: 8px 12px; }
.primary-nav .sub-menu a:hover { background: var(--soft); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { background: none; border: 0; width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); }
.icon-btn:hover { background: var(--soft); color: var(--accent); }
.icon-btn svg { width: 22px; height: 22px; }
.menu-toggle { display: none; }

.search-panel { display: none; border-top: 1px solid var(--line); background: var(--soft); padding: 16px 0; }
.search-panel.open { display: block; }
.search-form { display: flex; gap: 8px; }
.search-form input[type=search] { flex: 1; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 16px; font-family: inherit; }
.btn, .search-form button { background: var(--accent); color: #fff; border: 0; padding: 12px 20px; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 15px; font-family: inherit; }
.btn:hover, .search-form button:hover { background: var(--accent-dark); color: #fff; }

/* ---------- Common bits ---------- */
.badge { display: inline-block; background: var(--accent); color: #fff !important; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; padding: 4px 9px; border-radius: 4px; line-height: 1.3; }
.badge:hover { background: var(--accent-dark); }
.meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.meta a { color: var(--muted); font-weight: 600; }
.thumb { position: relative; display: block; overflow: hidden; border-radius: var(--radius); background: #e2e8f0; aspect-ratio: 16 / 9; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
a.thumb:hover img { transform: scale(1.04); }
.thumb-fallback { width: 100%; height: 100%; display: flex; align-items: flex-end; padding: 16px; color: #fff; font-weight: 900; font-size: 20px; text-transform: uppercase; letter-spacing: .5px; background: linear-gradient(135deg, var(--dark), var(--accent)); }

.section { margin: 44px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--ink); margin-bottom: 22px; }
.section-title { margin: 0; font-size: 20px; font-weight: 900; text-transform: uppercase; letter-spacing: .4px; background: var(--ink); color: #fff; padding: 8px 14px 6px; border-radius: 6px 6px 0 0; }
.section-head a.more { font-size: 13px; font-weight: 700; color: var(--accent); text-transform: uppercase; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 28px 24px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card .thumb { margin-bottom: 12px; }
.card .badge { margin-bottom: 8px; }
.card-title { margin: 0 0 8px; font-size: 18px; line-height: 1.3; font-weight: 800; color: var(--ink); }
.card-title a:hover { color: var(--accent); }
.card-excerpt { margin: 0 0 8px; color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.list-item { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .thumb { border-radius: 8px; aspect-ratio: 4 / 3; }
.list-item .card-title { font-size: 15px; margin-bottom: 4px; }
.list-item .thumb-fallback { font-size: 11px; padding: 8px; }

/* ---------- Hero ---------- */
.hero { margin-top: 28px; display: grid; grid-template-columns: 1.65fr 1fr; gap: 24px; }
.hero-main { position: relative; border-radius: 14px; overflow: hidden; min-height: 460px; display: flex; align-items: flex-end; background: var(--dark); }
.hero-main .thumb { position: absolute; inset: 0; border-radius: 0; aspect-ratio: auto; }
.hero-main::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(2,6,23,.92) 0%, rgba(2,6,23,.45) 45%, rgba(2,6,23,0) 75%); pointer-events: none; }
.hero-body { position: relative; z-index: 2; padding: 32px; color: #fff; }
.hero-body .card-title { color: #fff; font-size: 34px; line-height: 1.15; margin: 10px 0 12px; }
.hero-body .card-title a:hover { color: #fecdd3; }
.hero-body .meta, .hero-body .meta a { color: #cbd5e1; }
.hero-side { display: grid; grid-template-rows: repeat(2, 1fr); gap: 24px; }
.hero-side .tile { position: relative; border-radius: 14px; overflow: hidden; display: flex; align-items: flex-end; min-height: 218px; background: var(--dark); }
.hero-side .tile .thumb { position: absolute; inset: 0; border-radius: 0; aspect-ratio: auto; }
.hero-side .tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(2,6,23,.9), rgba(2,6,23,0) 70%); pointer-events: none; }
.hero-side .hero-body { padding: 20px; }
.hero-side .card-title { font-size: 20px; margin: 8px 0 0; }

/* ---------- Trending strip ---------- */
.trending { margin-top: 28px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.trend { display: grid; grid-template-columns: 42px 1fr; gap: 10px; padding: 18px; border-right: 1px solid var(--line); align-items: start; }
.trend:last-child { border-right: 0; }
.trend-num { font-size: 34px; font-weight: 900; color: var(--accent); line-height: 1; font-family: var(--serif); }
.trend .card-title { font-size: 15px; margin: 0; }

/* ---------- Layout with sidebar ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 44px; margin: 36px 0 60px; }
.sidebar .widget { margin-bottom: 36px; }
.widget-title { margin: 0 0 14px; font-size: 16px; font-weight: 900; text-transform: uppercase; letter-spacing: .4px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li { padding: 8px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.sidebar .widget li:last-child { border-bottom: 0; }
.cat-list li { display: flex; justify-content: space-between; }
.cat-list .count { background: var(--soft); color: var(--muted); font-size: 12px; padding: 1px 8px; border-radius: 20px; }
.popular { counter-reset: pop; }
.popular .list-item { grid-template-columns: 34px 1fr; }
.popular .list-item::before { counter-increment: pop; content: counter(pop); font-size: 26px; font-weight: 900; color: #cbd5e1; font-family: var(--serif); }
.sticky-side { position: sticky; top: 96px; }

/* ---------- Archive ---------- */
.archive-head { background: var(--soft); border-bottom: 1px solid var(--line); padding: 38px 0; }
.archive-head h1 { margin: 6px 0 0; font-size: 36px; font-weight: 900; color: var(--ink); line-height: 1.15; }
.archive-head .kicker { font-size: 13px; text-transform: uppercase; font-weight: 800; color: var(--accent); letter-spacing: .6px; }
.archive-head p { color: var(--muted); max-width: 720px; margin: 10px 0 0; }
.feed .card { display: grid; grid-template-columns: 300px 1fr; gap: 22px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.feed .card .thumb { margin-bottom: 0; }
.feed .card-title { font-size: 22px; }
.feed { display: grid; gap: 28px; }

.pagination { margin-top: 36px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pagination .page-numbers { min-width: 42px; height: 42px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; font-weight: 700; }
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Single ---------- */
.article-head { max-width: 860px; margin: 40px auto 26px; text-align: center; padding: 0 20px; }
.breadcrumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.breadcrumbs a { font-weight: 600; }
.article-head h1 { font-size: 42px; line-height: 1.15; font-weight: 900; color: var(--ink); margin: 14px 0 16px; letter-spacing: -.5px; }
.article-head .meta { justify-content: center; }
.article-head .avatar { border-radius: 50%; width: 32px; height: 32px; }
.article-figure { max-width: 1000px; margin: 0 auto 10px; padding: 0 20px; }
.article-figure .thumb { border-radius: 14px; }
.layout-single { grid-template-columns: minmax(0, 1fr) 300px; max-width: 1100px; margin-left: auto; margin-right: auto; padding: 0 20px; }
.entry-content { font-size: 18px; line-height: 1.8; color: #1f2937; overflow-wrap: break-word; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content p { margin: 0 0 1.3em; }
.entry-content [style*="justify"] { text-align: left !important; }
.entry-content h2 { font-size: 28px; line-height: 1.25; margin: 1.6em 0 .6em; color: var(--ink); font-weight: 850; }
.entry-content h3 { font-size: 22px; line-height: 1.3; margin: 1.5em 0 .5em; color: var(--ink); }
.entry-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.entry-content img { border-radius: 10px; margin: 1.4em auto; }
.entry-content figure, .entry-content .wp-caption { margin: 1.6em 0; max-width: 100%; }
.entry-content figcaption, .entry-content .wp-caption-text { font-size: 14px; color: var(--muted); text-align: center; margin-top: -0.8em; }
.entry-content blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--accent); font-family: var(--serif); font-size: 21px; color: var(--ink); }
.entry-content ul, .entry-content ol { padding-left: 1.4em; margin: 0 0 1.3em; }
.entry-content li { margin-bottom: .4em; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 16px; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.entry-content th { background: var(--soft); }
.entry-content iframe { max-width: 100%; }
.alignleft { float: left; margin: .3em 1.4em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.4em; }
.aligncenter { margin-left: auto; margin-right: auto; }

.post-tags { margin: 30px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.post-tags a { background: var(--soft); border: 1px solid var(--line); padding: 5px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 30px 0; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.share strong { margin-right: 6px; font-size: 14px; text-transform: uppercase; }
.share a { padding: 8px 14px; border-radius: 6px; color: #fff; font-size: 14px; font-weight: 700; }
.share a:hover { color: #fff; opacity: .88; }
.share .fb { background: #1877f2; } .share .x { background: #0f172a; } .share .wa { background: #16a34a; } .share .pin { background: #e60023; }
.author-box { display: grid; grid-template-columns: 72px 1fr; gap: 18px; background: var(--soft); border-radius: 14px; padding: 22px; margin: 30px 0; }
.author-box img { border-radius: 50%; }
.author-box h3 { margin: 0 0 4px; font-size: 18px; }
.author-box p { margin: 0; color: var(--muted); font-size: 15px; }
.related { margin: 44px 0 10px; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 30px 0; }
.post-nav a { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; font-weight: 700; color: var(--ink); }
.post-nav span { display: block; font-size: 12px; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.post-nav .next { text-align: right; }

/* ---------- Comments ---------- */
.comments-area { margin-top: 40px; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 28px; }
.comment-body { padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment-author img { border-radius: 50%; float: left; margin-right: 10px; }
.comment-form input[type=text], .comment-form input[type=email], .comment-form input[type=url], .comment-form textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.comment-form .submit { background: var(--accent); color: #fff; border: 0; padding: 12px 22px; border-radius: 8px; font-weight: 700; cursor: pointer; }

/* ---------- Page / 404 ---------- */
.page-wrap { max-width: 820px; margin: 44px auto 70px; padding: 0 20px; }
.page-wrap h1 { font-size: 38px; font-weight: 900; color: var(--ink); line-height: 1.15; margin: 0 0 24px; }
.notfound { text-align: center; padding: 70px 20px; }
.notfound .big { font-size: 120px; font-weight: 900; color: var(--accent); line-height: 1; }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: #94a3b8; margin-top: 40px; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding: 54px 0 36px; }
.site-footer .wordmark { color: #fff; }
.site-footer p { margin: 14px 0 0; font-size: 15px; max-width: 380px; }
.site-footer h4 { color: #fff; margin: 0 0 14px; text-transform: uppercase; font-size: 14px; letter-spacing: .6px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 20px; }
.site-footer li { padding: 4px 0; break-inside: avoid; }
.site-footer a { color: #cbd5e1; font-size: 14px; }
.site-footer a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #1e293b; padding: 18px 0; font-size: 13px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.to-top { position: fixed; right: 18px; bottom: 18px; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; display: none; align-items: center; justify-content: center; box-shadow: 0 6px 18px rgba(0,0,0,.2); z-index: 40; border: 0; cursor: pointer; }
.to-top.show { display: inline-flex; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
	.grid-4 { grid-template-columns: repeat(2, 1fr); }
	.trending { grid-template-columns: repeat(2, 1fr); }
	.trend:nth-child(2) { border-right: 0; }
	.trend:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
	.layout, .layout-single { grid-template-columns: 1fr; }
	.sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
	.sticky-side { position: static; }
}
@media (max-width: 900px) {
	.menu-toggle { display: inline-flex; }
	.primary-nav { position: fixed; inset: 0 0 0 auto; width: min(340px, 86vw); background: #fff; flex-direction: column; align-items: stretch; padding: 70px 18px 24px; transform: translateX(100%); visibility: hidden; transition: transform .25s ease, visibility .25s; overflow-y: auto; z-index: 70; }
	.primary-nav.open { transform: none; visibility: visible; box-shadow: -10px 0 30px rgba(0,0,0,.15); }
	.primary-nav > ul { flex-direction: column; gap: 0; }
	.primary-nav a { padding: 12px 8px; border-bottom: 1px solid var(--line); border-radius: 0; }
	.primary-nav .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 0 14px; display: block; }
	.nav-close { position: absolute; top: 14px; right: 14px; }
	.nav-backdrop { position: fixed; inset: 0; background: rgba(2,6,23,.5); z-index: 65; display: none; }
	.nav-backdrop.open { display: block; }
	.hero { grid-template-columns: 1fr; }
	.hero-main { min-height: 380px; }
	.hero-side { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
	.grid-3 { grid-template-columns: repeat(2, 1fr); }
	.footer-top { grid-template-columns: 1fr; gap: 28px; }
	.feed .card { grid-template-columns: 220px 1fr; }
}
@media (min-width: 901px) { .nav-close, .nav-backdrop { display: none !important; } }
@media (max-width: 640px) {
	body { font-size: 15px; }
	.topbar { display: none; }
	.header-main { min-height: 62px; }
	.wordmark { font-size: 22px; }
	.tagline { display: none; }
	.hero { margin-top: 16px; gap: 16px; }
	.hero-main { min-height: 330px; border-radius: 12px; }
	.hero-body { padding: 20px; }
	.hero-body .card-title { font-size: 24px; }
	.hero-side { grid-template-columns: 1fr; gap: 16px; }
	.hero-side .tile { min-height: 190px; }
	.trending { grid-template-columns: 1fr; }
	.trend { border-right: 0; border-bottom: 1px solid var(--line); }
	.trend:last-child { border-bottom: 0; }
	.grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
	.sidebar { grid-template-columns: 1fr; }
	.feed .card { grid-template-columns: 1fr; gap: 12px; }
	.article-head { margin-top: 24px; }
	.article-head h1 { font-size: 28px; }
	.entry-content { font-size: 17px; }
	.entry-content h2 { font-size: 23px; }
	.archive-head h1 { font-size: 28px; }
	.post-nav { grid-template-columns: 1fr; }
	.alignleft, .alignright { float: none; margin: 1em auto; }
}
