/* سکان‌بازار — Home page (Phase 7) v1.0.2
   Page root container: "ie sb-home". Everything is scoped under .sb-home or the new Loop Items.
   Grid: 1200 container, 12 × 78 + 11 × 24. Main 792 / side 384 (8+4). */

/* ---------- Page chrome ---------- */
.sb-home { --sb-home-gap: 48px; }
/* Astra wraps Elementor Full Width content in .ast-container (20px side padding ≤ 921px): the home controls its own gutters */
.sb-front #content > .ast-container { padding-inline: 0; max-inline-size: none; }
.sb-home .elementor-widget { margin: 0; }
.sb-home .ie-sr, .sb-home .sb-sr .elementor-heading-title { position: absolute !important; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; margin: 0; }
.sb-home .ie-section-head .ie-section-head__title { margin: 0; }
.sb-home .elementor-widget-shortcode:has(> .elementor-shortcode:empty),
.sb-home .elementor-widget-shortcode:not(:has(*)) { display: none; }

/* A section whose Loop Grid returned nothing disappears with its heading (sample data is thin). */
.sb-home .sb-home-sec:not(:has(.e-loop-item)) { display: none !important; }
.sb-home .sb-home-row:not(:has(.e-loop-item)) { display: none !important; }

/* ---------- Columns (desktop / tablet) ---------- */
.sb-home .sb-col-8 { flex: 0 0 calc(66.6667% - 8px); max-inline-size: calc(66.6667% - 8px); min-inline-size: 0; }
.sb-home .sb-col-4 { flex: 0 0 calc(33.3333% - 16px); max-inline-size: calc(33.3333% - 16px); min-inline-size: 0; }
/* design ratios inside the 792 column: 444/324 · 396/372 · 468/300 */
.sb-home .sb-r444 { flex: 444 1 0; min-inline-size: 0; }
.sb-home .sb-r324 { flex: 324 1 0; min-inline-size: 0; }
.sb-home .sb-r396 { flex: 396 1 0; min-inline-size: 0; }
.sb-home .sb-r372 { flex: 372 1 0; min-inline-size: 0; }
.sb-home .sb-r468 { flex: 468 1 0; min-inline-size: 0; }
.sb-home .sb-r300 { flex: 300 1 0; min-inline-size: 0; }

/* ---------- Lead ---------- */
.sb-home .sb-home-hero .sb-card--hero .sb-card__title .elementor-heading-title { font-size: 40px; line-height: 48px; font-weight: 800; }

/* card-top («مهم‌ترین‌ها»): thumb 112 3:2, category, title 16/28, date */
.sb-card--top { border-bottom: 1px solid var(--border); }
.e-loop-item:last-child > .sb-card--top { border-bottom: 0; }
.sb-card--top .sb-card__media { flex: 0 0 112px; inline-size: 112px; }
.sb-card--top .sb-card__media img { border-radius: 0; }
.sb-card--top .sb-card__body { flex: 1 1 0; min-inline-size: 0; }
.sb-card--top .sb-card__title .elementor-heading-title { font-size: 16px; line-height: 28px; font-weight: 700; color: var(--primary); }
.ie a.hp-cat, .ie .hp-cat { font-size: 12px; line-height: 18px; font-weight: 500; color: var(--accent); text-decoration: none; }
.ie a.hp-cat:hover { color: var(--accent-hover); text-decoration: underline; }
.sb-home .sb-home-top .e-loop-item:first-child > .sb-card--top { padding-block-start: 0; }
.sb-home .sb-home-top .e-loop-item:last-child > .sb-card--top { padding-block-end: 0; }
.sb-home .sb-home-topcol { justify-content: flex-start; }

/* Medium row: 3 × 384 */
@media (max-width: 1024px) and (min-width: 768px) {
	.sb-home .sb-home-mediums .sb-card--medium .sb-card__media { flex-basis: 120px; inline-size: 120px; }
}

/* ---------- «فوری و زنده» ---------- */
.sb-home .hp-livesec { display: flex; flex-direction: column; gap: 16px; }
.sb-home .hp-live-card { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg); }
.sb-home .hp-live-main { grid-column: span 4; display: flex; flex-direction: column; align-items: flex-start; gap: 0; min-inline-size: 0; }
.sb-home .hp-live-main .ie-card__kicker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ie .ie-chip.hp-live { background: var(--negative); border-color: var(--negative); color: #fff; font-weight: 700; }
.sb-home .hp-live-title { margin: 12px 0 0; align-self: stretch; font-size: 24px; line-height: 32px; font-weight: 700; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.sb-home .hp-live-title a { color: var(--primary); text-decoration: none; }
.sb-home .hp-live-title a:hover { color: var(--accent); }
.sb-home .hp-live-main .ie-meta { margin-block-start: 8px; }
.sb-home .hp-live-btn { margin-block-start: 16px; display: inline-flex; align-items: center; gap: 8px; min-block-size: 40px; }
.sb-home .hp-live-upd, .sb-home .hp-live-lead { grid-column: span 8; }
.sb-home .hp-live-upd { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 24px; align-items: start; }
.sb-home .hp-live-lead { margin: 0; font-size: 16px; line-height: 28px; color: var(--text); }
.sb-home .hp-upd { display: flex; flex-direction: column; gap: 8px; padding-block-start: 12px; border-block-start: 2px solid var(--border); min-inline-size: 0; }
.sb-home .hp-upd.is-new { border-block-start-color: var(--negative); }
.sb-home .hp-upd time { font-size: 14px; line-height: 22px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.sb-home .hp-upd.is-new time { color: var(--negative); }
.sb-home .hp-upd p { margin: 0; font-size: 16px; line-height: 28px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.sb-home .hp-upd a { color: var(--text); text-decoration: none; }
.sb-home .hp-upd a:hover { color: var(--accent); text-decoration: underline; }

/* ---------- Markets ---------- */
.sb-home .hp-mt { border: 1px solid var(--border); }
.sb-home .hp-mt table { inline-size: 100%; border-collapse: collapse; margin: 0; border: 0; }
.sb-home .hp-mt th { block-size: 40px; padding: 0 16px; background: var(--surface); border: 0; border-bottom: 1px solid var(--border); font-size: 12px; line-height: 18px; font-weight: 500; color: var(--muted); text-align: start; }
.sb-home .hp-mt td { block-size: 48px; padding: 0 16px; border: 0; border-bottom: 1px solid var(--border); font-size: 14px; line-height: 22px; color: var(--text); }
.sb-home .hp-mt tbody tr:last-child td { border-bottom: 0; }
.sb-home .hp-mt .num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sb-home .hp-mt .v { font-size: 16px; line-height: 24px; font-weight: 700; }
.sb-home .hp-mt .up { color: var(--positive-text); font-weight: 700; }
.sb-home .hp-mt .down { color: var(--negative); font-weight: 700; }
.sb-home .hp-mt a { color: var(--text); font-weight: 500; text-decoration: none; }
.sb-home .hp-mt a:hover { color: var(--accent); text-decoration: underline; }
.sb-home .hp-cap { margin: 8px 0 0; font-size: 12px; line-height: 18px; font-weight: 500; color: var(--muted); }
.sb-home .hp-mkt .ie-market { display: none; }
/* scroll containers must be positioned, or the absolutely positioned .ie-sr labels escape them and widen the page */
.sb-home .hp-mkt .ie-market, .sb-home .hp-mt, .sb-home .ie-quote, .sb-home .sb-home-top .elementor-loop-container { position: relative; }

/* ---------- «تحلیل و یادداشت» band ---------- */
.sb-home .hp-opband { border: 1px solid var(--border); border-radius: var(--radius-md); }

/* ---------- Dossiers (Loop Carousel of card-dossier) ---------- */
.sb-home .sb-home-doss { position: relative; }
.sb-home .sb-home-doss .ie-section-head { padding-inline-end: 80px; }
.sb-home .sb-home-dossloop { position: static; }
.sb-home .sb-home-dossloop .elementor-swiper-button { position: absolute; inset-block-start: 4px !important; transform: none !important; display: grid; place-items: center; inline-size: 32px; block-size: 32px; border: 1px solid var(--border-input); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font-size: 16px; z-index: 2; }
.sb-home .sb-home-dossloop .elementor-swiper-button:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.sb-home .sb-home-dossloop .elementor-swiper-button svg { inline-size: 16px; block-size: 16px; fill: currentColor; }
.sb-home .sb-home-dossloop .elementor-swiper-button-prev { inset-inline-end: 40px !important; inset-inline-start: auto !important; }
.sb-home .sb-home-dossloop .elementor-swiper-button-next { inset-inline-end: 0 !important; inset-inline-start: auto !important; }
.sb-home .sb-home-dossloop .elementor-swiper-button.swiper-button-disabled { opacity: .4; cursor: default; }
.hp-dcard { display: flex; flex-direction: column; gap: 12px; min-inline-size: 0; }
.hp-dcard__media { display: block; border-radius: var(--radius-md); overflow: hidden; background: var(--border); aspect-ratio: 3 / 2; }
.hp-dcard__media img, .hp-dcard__ph { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; }
.hp-dcard__body { display: flex; flex-direction: column; gap: 4px; }
.ie .hp-dcard__title { margin: 0; font-size: 18px; line-height: 28px; font-weight: 700; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.ie .hp-dcard__title a { color: var(--primary); text-decoration: none; }
.ie .hp-dcard__title a:hover { color: var(--accent); }
.hp-dcard__count { color: var(--text); font-weight: 700; }

/* ---------- Multimedia ---------- */
.sb-card--video .sb-vmedia { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-md); overflow: hidden; background: var(--border); }
.sb-card--video .sb-vmedia img, .sb-card--video .sb-vmedia__ph { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; }
.ie a.hp-play { position: absolute; inset: 0; margin: auto; display: grid; place-items: center; inline-size: 64px; block-size: 64px; border-radius: var(--radius-full); background: var(--primary); color: #fff; border: 2px solid #fff; text-decoration: none; }
.ie a.hp-play:hover, .ie a.hp-play:focus-visible { background: var(--accent); }
.hp-play svg { inline-size: 24px; block-size: 24px; fill: currentColor; transform: translateX(2px); }
.hp-dur { position: absolute; inset-block-end: 8px; inset-inline-end: 8px; display: inline-flex; align-items: center; block-size: 22px; padding-inline: 6px; border-radius: var(--radius-sm); background: var(--primary); color: #fff; font-size: 12px; line-height: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sb-card--video .ie-card__kicker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sb-card--ig { border-bottom: 1px solid var(--border); }
.e-loop-item:last-child > .sb-card--ig { border-bottom: 0; }
.sb-card--ig .sb-card__media { flex: 0 0 84px; inline-size: 84px; }
.sb-card--ig .sb-card__media img { aspect-ratio: 3 / 4; }
.sb-card--ig .sb-card__body { flex: 1 1 0; min-inline-size: 0; align-items: flex-start; }
.sb-card--ig .sb-card__title { align-self: stretch; }
.sb-card--ig .sb-card__title .elementor-heading-title { font-size: 16px; line-height: 28px; font-weight: 700; color: var(--primary); }
.sb-home .sb-home-ig .e-loop-item:first-child > .sb-card--ig { padding-block-start: 0; }

/* ---------- Sidebar ---------- */
.sb-home .sb-home-side { gap: 32px; }
.sb-home .hp-hint .elementor-heading-title { margin: 0; font-size: 12px; line-height: 18px; font-weight: 500; color: var(--muted); }
.sb-home .sb-sticky { flex: 1 1 auto; }
.sb-home .sb-sticky .ad-300x600 { position: sticky; inset-block-start: 72px; }
.admin-bar .sb-home .sb-sticky .ad-300x600 { inset-block-start: calc(72px + var(--wp-admin--admin-bar--height, 32px)); }
.sb-home .sb-home-ad2 { display: none; }
.sb-home .sb-nlbox .elementor-heading-title { margin: 0; }
.sb-home .sb-nlbox .elementor-field-group { margin-bottom: 0; padding: 0 !important; }
.sb-home .sb-nlbox .elementor-form-fields-wrapper { margin: 0 !important; row-gap: 12px; }
.sb-home .sb-nlbox .elementor-field-textual { min-height: 44px; direction: ltr; text-align: left; }
.sb-home .sb-nlbox .elementor-button { inline-size: 100%; min-height: 44px; }

/* ---------- «آخرین مطالب» + Load more ---------- */
.sb-home .sb-home-latest .e-load-more-anchor + .elementor-button-wrapper,
.sb-home .sb-home-latest .elementor-button-wrapper { display: flex; justify-content: center; margin-block-start: 24px; }
.sb-home .sb-home-latest .elementor-button-wrapper .elementor-button { min-inline-size: 240px; min-block-size: 48px; padding: 0 24px; background: transparent; color: var(--primary); border: 1px solid var(--primary); border-radius: var(--radius-sm); font-size: 16px; line-height: 24px; font-weight: 700; }
.sb-home .sb-home-latest .elementor-button-wrapper .elementor-button:hover { background: var(--surface); color: var(--primary); }
.sb-home .sb-home-latest.e-load-more-pagination-end .elementor-button-wrapper { display: none; } /* last page reached */

/* ---------- Tablet (768–1024) ---------- */
@media (max-width: 1024px) {
	.sb-home .sb-home-wrap { padding-inline: 16px !important; }
	.sb-home .sb-home-hero .sb-card--hero .sb-card__title .elementor-heading-title { font-size: 32px; line-height: 40px; }
	.sb-home .hp-live-main { grid-column: span 5; }
	.sb-home .hp-live-upd, .sb-home .hp-live-lead { grid-column: span 7; }
	.sb-home .hp-live-upd { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px; }
	.sb-home .hp-live-upd li:nth-child(3) { display: none; }
}

/* ---------- Phone (≤767): one column, sidebar widgets interleaved (design MobileTop/Bottom) ---------- */
@media (max-width: 767px) {
	.sb-home { --sb-home-gap: 48px; }
	.sb-home .sb-col-8, .sb-home .sb-col-4,
	.sb-home .sb-r444, .sb-home .sb-r324, .sb-home .sb-r396, .sb-home .sb-r372, .sb-home .sb-r468, .sb-home .sb-r300 { flex: 1 1 auto; max-inline-size: 100%; inline-size: 100%; }
	.sb-home .sb-home-hero .sb-card--hero .sb-card__title .elementor-heading-title { font-size: 28px; line-height: 36px; }

	/* «مهم‌ترین‌ها» becomes a horizontal strip of bordered cards (88px thumbs, no date) */
	.sb-home .sb-home-top .elementor-loop-container { display: flex !important; gap: 16px !important; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; }
	.sb-home .sb-home-top .elementor-loop-container::-webkit-scrollbar { display: none; }
	.sb-home .sb-home-top .e-loop-item { flex: 0 0 296px; scroll-snap-align: start; }
	.sb-home .sb-home-top .sb-card--top { block-size: 100%; padding: 12px !important; border: 1px solid var(--border) !important; border-radius: var(--radius-md); align-items: flex-start; }
	.sb-home .sb-home-top .sb-card--top .sb-card__media { flex-basis: 88px; inline-size: 88px; }
	.sb-home .sb-home-top .sb-card--top .sb-card__date { display: none; }

	/* body: main + aside flatten into one ordered column */
	.sb-home .sb-home-body { flex-direction: column !important; gap: var(--sb-home-gap) !important; }
	.sb-home .sb-home-main, .sb-home .sb-home-side { display: contents !important; }
	.sb-home .sb-o-econ { order: 1; } .sb-home .sb-o-pol { order: 2; }
	.sb-home .sb-o-pop { order: 3; } .sb-home .sb-o-ad1 { order: 4; }
	.sb-home .sb-o-mkt { order: 5; } .sb-home .sb-o-biz { order: 6; }
	.sb-home .sb-o-latest { order: 7; } .sb-home .sb-o-ad2 { order: 8; }
	.sb-home .sb-o-nl { order: 9; } .sb-home .sb-o-op { order: 10; }
	.sb-home .sb-o-doss { order: 11; } .sb-home .sb-o-mm { order: 12; }
	.sb-home .sb-home-infeed, .sb-home .sb-sticky { display: none !important; }
	.sb-home .sb-home-side .ad-300x250 { display: grid !important; }

	/* live band */
	.sb-home .hp-live-card { display: flex; flex-direction: column; padding: 16px; }
	.sb-home .hp-live-title { margin-block-start: 8px; font-size: 20px; line-height: 28px; }
	.sb-home .hp-live-main .ie-meta { margin-block-start: 4px; }
	.sb-home .hp-live-upd { display: flex; flex-direction: column; gap: 12px; margin-block-start: 16px; }
	.sb-home .hp-live-upd li:nth-child(3) { display: flex; }
	.sb-home .hp-upd { gap: 4px; }
	.sb-home .hp-upd p { -webkit-line-clamp: 2; line-clamp: 2; }
	.sb-home .hp-live-btn { align-self: stretch; justify-content: center; min-block-size: 44px; order: 3; }
	.sb-home .hp-live-lead { margin-block-start: 12px; }

	/* markets: table → quote strip */
	.sb-home .hp-mkt .hp-mt, .sb-home .hp-mkt .hp-cap { display: none; }
	.sb-home .hp-mkt .ie-market { display: flex; margin-inline: -16px; padding: 8px 16px; }
	.sb-home .hp-mkt .ie-quote { block-size: 44px; }

	/* opinion band bleeds to the edges */
	.sb-home .hp-opband { margin-inline: -16px; border-radius: 0; border-inline: 0; padding: 32px 16px !important; }

	/* section «more» links: 44px touch target */
	.sb-home .ie a.ie-section-head__more, .sb-home a.ie-section-head__more { min-block-size: 44px; margin-block: -6px; }

	/* dossiers: swipe only */
	.sb-home .sb-home-dossloop .elementor-swiper-button { display: none !important; }
	.sb-home .sb-home-doss .ie-section-head { padding-inline-end: 0; }

	/* infographic list */
	.sb-card--ig .sb-card__media { flex-basis: 72px; inline-size: 72px; }
	.sb-card--ig .sb-card__title { --sb-clamp: 2; }

	.sb-home .sb-home-ad2 { display: grid !important; }
	.sb-home .sb-home-latest .elementor-button-wrapper .elementor-button { inline-size: 100%; }
}
