/*
 * Crush Theme — shared styles for the NEW templates only
 * (scroll-reveal, blog listing, single post). Existing sections are untouched.
 * Design tokens mirror the site's article/about sections.
 */

:root {
	--crush-orange: #EA8F09;
	--crush-orange-dark: #c97c08;
	--crush-orange-soft: #fff7e6;
	--crush-heading: #0f172a;
	--crush-text: #475569;
	--crush-muted: #94a3b8;
	--crush-body-bg: #f8fafc;
	--crush-card: #ffffff;
	--crush-border: #eef2f6;
	--crush-border-2: #e2e8f0;
	--crush-radius: 18px;
	--crush-ease: cubic-bezier(.22, 1, .36, 1);
	--crush-font: 'IranBakh', 'IRANSansX', 'IRANSans', 'Vazirmatn', 'Shabnam', Tahoma, sans-serif;
}

/* ---------- Scroll reveal ---------- */
.crush-reveal {
	opacity: 0;
	transform: translateY(28px);
	transition: opacity .6s var(--crush-ease), transform .6s var(--crush-ease);
	transition-delay: var(--crush-reveal-delay, 0ms);
	will-change: opacity, transform;
}
.crush-reveal--scale { transform: scale(.94); }
.crush-reveal--right { transform: translateX(40px); }
.crush-reveal--left { transform: translateX(-40px); }
.crush-reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	.crush-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ============================================================
 *  BLOG LISTING  [blog_listing]  — prefix .cbl
 * ============================================================ */
.cbl {
	direction: rtl;
	font-family: var(--crush-font);
	background: var(--crush-body-bg);
	padding: clamp(40px, 6vw, 84px) 0;
	color: var(--crush-text);
}
.cbl__container { width: min(1200px, 92%); margin-inline: auto; }
.cbl__head { text-align: center; max-width: 640px; margin: 0 auto clamp(28px, 4vw, 52px); }
.cbl__badge {
	display: inline-block; font-size: .8rem; font-weight: 700;
	color: var(--crush-orange-dark); background: var(--crush-orange-soft);
	padding: 7px 16px; border-radius: 999px; margin-bottom: 16px;
}
.cbl__title {
	margin: 0 0 12px; font-size: clamp(1.5rem, 3.4vw, 2.3rem); font-weight: 800;
	color: var(--crush-heading); line-height: 1.35;
}
.cbl__sub { margin: 0; font-size: clamp(.95rem, 1.6vw, 1.05rem); color: var(--crush-muted); line-height: 2; }

.cbl__grid {
	display: grid; gap: clamp(16px, 2.2vw, 26px);
	grid-template-columns: repeat(var(--cbl-cols, 3), minmax(0, 1fr));
}
@media (max-width: 900px) { .cbl__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cbl__grid { grid-template-columns: 1fr; } }

.cbl-card {
	display: flex; flex-direction: column; background: var(--crush-card);
	border: 1px solid var(--crush-border); border-radius: var(--crush-radius);
	overflow: hidden; transition: transform .45s var(--crush-ease), box-shadow .45s var(--crush-ease), border-color .45s var(--crush-ease);
}
.cbl-card:hover { transform: translateY(-6px); box-shadow: 0 22px 48px rgba(15, 23, 42, .12); border-color: #f0c24b; }
.cbl-card__media {
	position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #eef2f6;
}
.cbl-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--crush-ease); }
.cbl-card:hover .cbl-card__media img { transform: scale(1.06); }
.cbl-card__noimg { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: #cbd5e1; }
.cbl-card__noimg svg { width: 46px; height: 46px; }
.cbl-card__cat {
	position: absolute; inset-inline-start: 12px; inset-block-start: 12px;
	font-size: .72rem; font-weight: 700; color: #fff; background: var(--crush-orange);
	padding: 5px 12px; border-radius: 999px;
}
.cbl-card__body { display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 20px; flex: 1; }
.cbl-card__meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: .78rem; color: var(--crush-muted); }
.cbl-card__meta span { display: inline-flex; align-items: center; gap: 5px; }
.cbl-card__meta svg { width: 14px; height: 14px; opacity: .8; }
.cbl-card__title { margin: 0; font-size: 1.08rem; font-weight: 800; line-height: 1.7; }
.cbl-card__title a {
	color: var(--crush-heading); text-decoration: none;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cbl-card__title a:hover { color: var(--crush-orange-dark); }
.cbl-card__excerpt {
	margin: 0; font-size: .9rem; color: var(--crush-text); line-height: 2;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cbl-card__more {
	margin-top: auto; display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
	font-size: .85rem; font-weight: 700; color: var(--crush-orange-dark); text-decoration: none;
}
.cbl-card__more svg { width: 16px; height: 16px; transition: transform .3s var(--crush-ease); }
.cbl-card:hover .cbl-card__more svg { transform: translateX(-4px); }
.cbl__empty { text-align: center; color: var(--crush-muted); padding: 40px 0; }

/* pagination */
.cbl__pagination { margin-top: clamp(28px, 4vw, 46px); display: flex; justify-content: center; }
.cbl__pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px;
	margin: 0 4px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--crush-border-2);
	background: #fff; color: var(--crush-heading); text-decoration: none; font-weight: 700; transition: all .25s var(--crush-ease);
}
.cbl__pagination .page-numbers:hover { border-color: var(--crush-orange); color: var(--crush-orange-dark); }
.cbl__pagination .page-numbers.current { background: var(--crush-orange); border-color: var(--crush-orange); color: #fff; }
.cbl__pagination .page-numbers.dots { border: none; background: transparent; }

/* ============================================================
 *  SINGLE POST  single.php  — prefix .csp
 * ============================================================ */
.csp { direction: rtl; font-family: var(--crush-font); background: var(--crush-body-bg); color: var(--crush-text); }
.csp__hero {
	position: relative; padding: clamp(40px, 7vw, 96px) 0 clamp(28px, 4vw, 48px);
	background: linear-gradient(180deg, #0f1a2e 0%, #141b2e 100%);
	color: #fff; overflow: hidden;
}
.csp__hero::after {
	content: ""; position: absolute; inset: 0;
	background: radial-gradient(circle at 82% 18%, rgba(234, 143, 9, .18), transparent 42%);
	pointer-events: none;
}
.csp__hero-inner { position: relative; width: min(860px, 92%); margin-inline: auto; text-align: center; z-index: 1; }
.csp__cat {
	display: inline-block; font-size: .78rem; font-weight: 700; color: #fff;
	background: var(--crush-orange); padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}
.csp__title { margin: 0 0 18px; font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: 800; line-height: 1.5; }
.csp__meta { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; font-size: .85rem; color: #b7c0d0; }
.csp__meta span { display: inline-flex; align-items: center; gap: 6px; }
.csp__meta svg { width: 15px; height: 15px; opacity: .85; }

.csp__wrap { width: min(820px, 92%); margin: 0 auto; padding: clamp(28px, 4vw, 52px) 0 clamp(48px, 7vw, 90px); }
.csp__featured {
	margin: clamp(-60px, -6vw, -40px) auto clamp(28px, 4vw, 44px); position: relative; z-index: 2;
	border-radius: 20px; overflow: hidden; box-shadow: 0 24px 60px rgba(15, 23, 42, .22);
}
.csp__featured img { display: block; width: 100%; height: auto; }

.csp__content { font-size: 1.05rem; line-height: 2.1; color: #334155; }
.csp__content > * { margin: 0 0 1.15em; }
.csp__content h2 { font-size: 1.6rem; font-weight: 800; color: var(--crush-heading); margin: 1.6em 0 .6em; line-height: 1.6; }
.csp__content h3 { font-size: 1.3rem; font-weight: 800; color: var(--crush-heading); margin: 1.4em 0 .5em; }
.csp__content h4 { font-size: 1.1rem; font-weight: 700; color: var(--crush-heading); margin: 1.2em 0 .4em; }
.csp__content a { color: var(--crush-orange-dark); text-decoration: underline; text-underline-offset: 3px; }
.csp__content ul, .csp__content ol { padding-inline-start: 1.5em; }
.csp__content li { margin-bottom: .5em; }
.csp__content img { max-width: 100%; height: auto; border-radius: 14px; }
.csp__content blockquote {
	margin: 1.6em 0; padding: 18px 22px; border-inline-start: 4px solid var(--crush-orange);
	background: var(--crush-orange-soft); border-radius: 0 14px 14px 0; color: #7a5a12; font-weight: 600;
}
.csp__content pre {
	background: #0f172a; color: #e2e8f0; padding: 18px; border-radius: 14px; overflow-x: auto;
	direction: ltr; text-align: left; font-size: .9rem;
}
.csp__content code { background: #f1f5f9; padding: 2px 6px; border-radius: 6px; font-size: .92em; }
.csp__content pre code { background: none; padding: 0; }
.csp__content table {
	width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: .95rem;
	border: 1px solid var(--crush-border-2); border-radius: 12px; overflow: hidden;
}
.csp__content th, .csp__content td { padding: 12px 14px; border-bottom: 1px solid var(--crush-border-2); text-align: right; }
.csp__content th { background: #f8fafc; font-weight: 800; color: var(--crush-heading); }
.csp__content tr:last-child td { border-bottom: none; }

.csp__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.csp__tags a {
	font-size: .8rem; font-weight: 600; color: var(--crush-text); background: #fff;
	border: 1px solid var(--crush-border-2); padding: 6px 14px; border-radius: 999px; text-decoration: none;
	transition: all .25s var(--crush-ease);
}
.csp__tags a:hover { border-color: var(--crush-orange); color: var(--crush-orange-dark); }

.csp__nav {
	display: flex; justify-content: space-between; gap: 16px; margin-top: 40px;
	border-top: 1px solid var(--crush-border-2); padding-top: 24px; flex-wrap: wrap;
}
.csp__nav a { color: var(--crush-heading); text-decoration: none; font-weight: 700; max-width: 46%; }
.csp__nav a:hover { color: var(--crush-orange-dark); }
.csp__nav small { display: block; color: var(--crush-muted); font-weight: 600; margin-bottom: 4px; }

/* comments (kept simple, on-brand) */
.csp__comments { width: min(820px, 92%); margin: 0 auto clamp(48px, 7vw, 90px); }
.csp__comments .comment-list { list-style: none; margin: 0; padding: 0; }
.csp__comments h2, .csp__comments h3 { color: var(--crush-heading); }
.csp__comments input[type=text], .csp__comments input[type=email], .csp__comments input[type=url], .csp__comments textarea {
	width: 100%; padding: 12px 14px; border: 1px solid var(--crush-border-2); border-radius: 12px; font-family: inherit;
}
.csp__comments .submit {
	background: var(--crush-orange); color: #fff; border: none; padding: 12px 26px; border-radius: 12px;
	font-family: inherit; font-weight: 700; cursor: pointer;
}
