/*
 * Beshno Music Homepage — v1.0.4
 * Music-platform homepage, RTL, Light/Dark compatible.
 */

/* =========================================================
   Front page cleanup: remove page/article chrome from Jannah
   ========================================================= */
body.beshno-homepage-active #breadcrumb,
body.beshno-homepage-active .breadcrumb,
body.beshno-homepage-active .entry-header:not(.beshno-section-heading),
body.beshno-homepage-active .page-title,
body.beshno-homepage-active .post-title.entry-title {
	display: none !important;
}

body.beshno-homepage-active .post-content.container-wrapper,
body.beshno-homepage-active .entry-content.container-wrapper,
body.beshno-homepage-active .main-content > .container-wrapper {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	padding: 0 !important;
}

body.beshno-homepage-active .entry-content {
	margin: 0 !important;
}

.beshno-home-root {
	--beshno-home-blue: #0B63F6;
	--beshno-home-hover: #1683FF;
	--beshno-home-bg: #F5F8FC;
	--beshno-home-card: #FFFFFF;
	--beshno-home-text: #101828;
	--beshno-home-muted: #667085;
	--beshno-home-border: #E7ECF3;

	width: 100%;
	direction: rtl;
	color: var(--beshno-home-text);
}

.beshno-home-card {
	background: var(--beshno-home-card);
	border: 1px solid var(--beshno-home-border);
	border-radius: 16px;
	box-shadow: 0 5px 18px rgba(16, 24, 40, .035);
}

/* =========================================================
   Shared headings
   ========================================================= */
.beshno-section-heading {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin-bottom: 18px;
}

.beshno-section-title {
	display: flex;
	align-items: center;
	gap: 9px;
	min-width: 0;
}

.beshno-section-title > .dashicons {
	width: 34px;
	height: 34px;
	line-height: 34px;
	border-radius: 10px;
	background: #EEF5FF;
	color: var(--beshno-home-blue);
	text-align: center;
	font-size: 18px;
	flex: 0 0 auto;
}

.beshno-section-title h2 {
	margin: 0 !important;
	font-size: 18px !important;
	line-height: 1.5 !important;
	font-weight: 700 !important;
	color: var(--beshno-home-text) !important;
}

.beshno-heading-all,
.beshno-box-all {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--beshno-home-blue) !important;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none !important;
}

.beshno-heading-all:hover,
.beshno-box-all:hover {
	color: var(--beshno-home-hover) !important;
}

/* =========================================================
   Featured / Special section
   ========================================================= */
.beshno-special {
	padding: 20px;
	margin-bottom: 22px;
}

.beshno-special-grid {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 16px;
}

.beshno-featured-card {
	min-width: 0;
}

.beshno-card-cover,
.beshno-shelf-cover {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 13px;
	background: #EEF3F9;
	aspect-ratio: 1 / 1;
}

.beshno-card-cover img,
.beshno-shelf-cover img,
.beshno-compact-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .22s ease;
}

.beshno-featured-card:hover .beshno-card-cover img,
.beshno-shelf-card:hover .beshno-shelf-cover img {
	transform: scale(1.035);
}

.beshno-featured-card h3,
.beshno-shelf-card h3 {
	margin: 10px 1px 0 !important;
	font-size: 14px !important;
	line-height: 1.7 !important;
	font-weight: 600 !important;
}

.beshno-featured-card h3 a,
.beshno-shelf-card h3 a {
	color: var(--beshno-home-text) !important;
	text-decoration: none !important;
}

.beshno-featured-card h3 a:hover,
.beshno-shelf-card h3 a:hover {
	color: var(--beshno-home-blue) !important;
}

.beshno-play-badge,
.beshno-small-play {
	position: absolute;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: rgba(11, 99, 246, .94);
	color: #fff;
	box-shadow: 0 5px 16px rgba(11, 99, 246, .3);
	opacity: 0;
	transform: scale(.85);
	transition: opacity .18s ease, transform .18s ease;
}

.beshno-play-badge {
	width: 44px;
	height: 44px;
	inset: 50% auto auto 50%;
	transform: translate(-50%, -50%) scale(.85);
}

.beshno-small-play {
	width: 34px;
	height: 34px;
	left: 10px;
	bottom: 10px;
}

.beshno-featured-card:hover .beshno-play-badge {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

.beshno-shelf-card:hover .beshno-small-play {
	opacity: 1;
	transform: scale(1);
}

/* =========================================================
   Main three-column band
   ========================================================= */
.beshno-home-primary {
	display: grid;
	grid-template-columns: minmax(0, 23fr) minmax(0, 54fr) minmax(0, 23fr);
	grid-template-areas: "left center right";
	gap: 20px;
	align-items: start;
	direction: ltr;
	margin-bottom: 24px;
}

.beshno-home-side,
.beshno-home-center {
	min-width: 0;
	direction: rtl;
}

.beshno-home-side-right { grid-area: right; }
.beshno-home-center { grid-area: center; }
.beshno-home-side-left { grid-area: left; }

.beshno-side-box,
.beshno-new-center {
	padding: 18px;
}

.beshno-side-box + .beshno-side-box {
	margin-top: 20px;
}

.beshno-side-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.beshno-compact-item {
	display: flex;
	align-items: center;
	gap: 11px;
	min-width: 0;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--beshno-home-border);
}

.beshno-compact-item:last-child {
	padding-bottom: 0;
	border-bottom: 0;
}

.beshno-compact-cover {
	width: 68px;
	height: 68px;
	border-radius: 11px;
	overflow: hidden;
	background: #EEF3F9;
	flex: 0 0 68px;
}

.beshno-compact-content {
	min-width: 0;
}

.beshno-compact-content h3 {
	margin: 0 0 5px !important;
	font-size: 13.5px !important;
	line-height: 1.65 !important;
	font-weight: 600 !important;
}

.beshno-compact-content h3 a {
	color: var(--beshno-home-text) !important;
	text-decoration: none !important;
}

.beshno-compact-content h3 a:hover {
	color: var(--beshno-home-blue) !important;
}

.beshno-mini-action {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	font-size: 11px;
	color: var(--beshno-home-muted);
}

.beshno-mini-action .dashicons {
	font-size: 13px;
	width: 13px;
	height: 13px;
	line-height: 13px;
	color: var(--beshno-home-blue);
}

.beshno-box-all {
	margin-top: 15px;
	padding-top: 12px;
	border-top: 1px solid var(--beshno-home-border);
	width: 100%;
	justify-content: center;
}

/* Center latest songs */
.beshno-new-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px 14px;
}

.beshno-new-grid .beshno-compact-item {
	padding: 11px;
	border: 1px solid var(--beshno-home-border);
	border-radius: 13px;
	background: #FBFCFE;
}

.beshno-new-grid .beshno-compact-cover {
	width: 78px;
	height: 78px;
	flex-basis: 78px;
}

.beshno-center-all {
	margin-top: 16px;
}

/* =========================================================
   Category shelves
   ========================================================= */
.beshno-home-shelves {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.beshno-shelf {
	padding: 20px;
}


.beshno-shelf .beshno-section-heading {
	margin-bottom: 16px;
}

.beshno-shelf .beshno-heading-all {
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
}

.beshno-shelf .beshno-heading-all::before {
	content: '';
}


.beshno-shelf-row {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 16px;
	align-items: stretch;
	direction: rtl;
}

.beshno-view-all-tile {
	min-height: 100%;
	border: 1px dashed #BCD4FA;
	border-radius: 13px;
	background: #F3F7FF;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 7px;
	text-align: center;
	color: var(--beshno-home-blue) !important;
	text-decoration: none !important;
	padding: 15px;
	transition: border-color .18s ease, transform .18s ease, background-color .18s ease;
}

.beshno-view-all-tile:hover {
	border-color: var(--beshno-home-blue);
	background: #EAF2FF;
	transform: translateY(-2px);
}

.beshno-view-all-tile > .dashicons:first-child {
	font-size: 28px;
	width: 28px;
	height: 28px;
	line-height: 28px;
}

.beshno-view-all-tile strong {
	font-size: 14px;
}

.beshno-view-all-tile small {
	color: var(--beshno-home-muted);
	font-size: 11px;
}

.beshno-view-arrow {
	margin-top: 4px;
}

/* =========================================================
   Empty and fallback covers
   ========================================================= */
.beshno-cover-placeholder {
	width: 100%;
	height: 100%;
	display: grid;
	place-items: center;
	background: linear-gradient(145deg, #EEF5FF, #E3ECF8);
	color: var(--beshno-home-blue);
}

.beshno-cover-placeholder .dashicons {
	font-size: 32px;
	width: 32px;
	height: 32px;
	line-height: 32px;
}

.beshno-empty-state {
	padding: 15px;
	border: 1px dashed var(--beshno-home-border);
	border-radius: 12px;
	background: #FAFBFD;
	color: var(--beshno-home-muted);
	font-size: 13px;
	line-height: 1.9;
}

.beshno-wide-empty {
	grid-column: 1 / -1;
}

/* =========================================================
   Dark Mode
   ========================================================= */
html.dark-skin .beshno-home-root {
	--beshno-home-card: var(--beshno-dark-surface);
	--beshno-home-text: var(--beshno-dark-text);
	--beshno-home-muted: var(--beshno-dark-muted);
	--beshno-home-border: var(--beshno-dark-border);
	--beshno-home-blue: var(--beshno-dark-primary);
	--beshno-home-hover: #5FAAFF;
}

html.dark-skin .beshno-home-card {
	background: var(--beshno-dark-surface) !important;
	border-color: var(--beshno-dark-border) !important;
	box-shadow: none;
}

html.dark-skin .beshno-section-title > .dashicons {
	background: var(--beshno-dark-surface-2);
	color: var(--beshno-dark-primary);
}

html.dark-skin .beshno-new-grid .beshno-compact-item,
html.dark-skin .beshno-empty-state {
	background: var(--beshno-dark-surface-2);
	border-color: var(--beshno-dark-border);
}

html.dark-skin .beshno-card-cover,
html.dark-skin .beshno-shelf-cover,
html.dark-skin .beshno-compact-cover,
html.dark-skin .beshno-cover-placeholder {
	background: var(--beshno-dark-surface-2);
}

html.dark-skin .beshno-view-all-tile {
	background: var(--beshno-dark-surface-2);
	border-color: var(--beshno-dark-border);
	color: var(--beshno-dark-primary) !important;
}

html.dark-skin .beshno-view-all-tile:hover {
	border-color: var(--beshno-dark-primary);
	background: #112743;
}

html.dark-skin .beshno-featured-card h3 a,
html.dark-skin .beshno-shelf-card h3 a,
html.dark-skin .beshno-compact-content h3 a,
html.dark-skin .beshno-section-title h2 {
	color: var(--beshno-dark-text) !important;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1180px) {
	.beshno-special-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
	.beshno-shelf-row {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}
	.beshno-home-primary {
		grid-template-columns: minmax(0, 24fr) minmax(0, 52fr) minmax(0, 24fr);
		gap: 16px;
	}
}

@media (max-width: 991px) {
	.beshno-home-primary {
		display: block;
	}
	.beshno-home-side {
		display: none !important;
	}
	.beshno-new-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.beshno-special-grid,
	.beshno-shelf-row {
		display: flex;
		overflow-x: auto;
		gap: 13px;
		padding-bottom: 5px;
		scroll-snap-type: x proximity;
	}
	.beshno-featured-card,
	.beshno-shelf-card,
	.beshno-view-all-tile {
		flex: 0 0 180px;
		scroll-snap-align: start;
	}
	.beshno-view-all-tile {
		min-height: 220px;
	}
}

@media (max-width: 620px) {
	.beshno-special,
	.beshno-side-box,
	.beshno-new-center,
	.beshno-shelf {
		padding: 14px;
		border-radius: 13px;
	}
	.beshno-section-title h2 {
		font-size: 16px !important;
	}
	.beshno-new-grid {
		grid-template-columns: 1fr;
	}
	.beshno-featured-card,
	.beshno-shelf-card,
	.beshno-view-all-tile {
		flex-basis: 150px;
	}
	.beshno-view-all-tile {
		min-height: 190px;
	}
}

/* =========================================================
   Wide desktop canvas + mobile-safe gutters (v1.0.1)
   Scoped to the page container that actually contains this
   homepage, so internal pages and the header/footer stay intact.
   ========================================================= */
@supports selector(.container:has(.beshno-home-root)) {
	body.beshno-homepage-active .container:has(.beshno-home-root) {
		width: calc(100% - 40px) !important;
		max-width: 1760px !important;
		margin-left: auto !important;
		margin-right: auto !important;
		box-sizing: border-box;
	}
}

body.beshno-homepage-active .beshno-home-root {
	width: 100%;
	max-width: none;
	box-sizing: border-box;
}

body.beshno-homepage-active .beshno-home-root *,
body.beshno-homepage-active .beshno-home-root *::before,
body.beshno-homepage-active .beshno-home-root *::after {
	box-sizing: border-box;
}

@media (min-width: 992px) {
	body.beshno-homepage-active .beshno-home-primary {
		grid-template-columns: minmax(0, 23fr) minmax(0, 54fr) minmax(0, 23fr);
		gap: clamp(14px, 1.25vw, 24px);
	}
}

@media (max-width: 991px) {
	@supports selector(.container:has(.beshno-home-root)) {
		body.beshno-homepage-active .container:has(.beshno-home-root) {
			width: calc(100% - 20px) !important;
			max-width: none !important;
		}
	}

	body.beshno-homepage-active .beshno-home-root {
		width: 100%;
		max-width: 100%;
		overflow-wrap: anywhere;
	}

	body.beshno-homepage-active .beshno-special,
	body.beshno-homepage-active .beshno-side-box,
	body.beshno-homepage-active .beshno-new-center,
	body.beshno-homepage-active .beshno-shelf {
		padding: 13px;
		border-radius: 13px;
	}

	body.beshno-homepage-active .beshno-home-primary {
		margin-bottom: 16px;
	}

	body.beshno-homepage-active .beshno-home-shelves {
		gap: 14px;
	}

	body.beshno-homepage-active .beshno-section-heading {
		gap: 8px;
		margin-bottom: 13px;
	}

	body.beshno-homepage-active .beshno-section-title h2 {
		font-size: 16px !important;
	}

	body.beshno-homepage-active .beshno-special-grid,
	body.beshno-homepage-active .beshno-shelf-row {
		gap: 11px;
	}

	body.beshno-homepage-active .beshno-featured-card,
	body.beshno-homepage-active .beshno-shelf-card {
		flex: 0 0 clamp(132px, 42vw, 190px);
		width: clamp(132px, 42vw, 190px);
		scroll-snap-align: start;
	}

	body.beshno-homepage-active .beshno-new-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 9px;
	}

	body.beshno-homepage-active .beshno-new-grid .beshno-compact-item {
		padding: 9px;
	}
}

@media (max-width: 480px) {
	body.beshno-homepage-active .beshno-home-root {
		font-size: 14px;
	}

	body.beshno-homepage-active .beshno-section-title > .dashicons {
		width: 30px;
		height: 30px;
		line-height: 30px;
		font-size: 16px;
	}

	body.beshno-homepage-active .beshno-featured-card h3,
	body.beshno-homepage-active .beshno-shelf-card h3 {
		font-size: 13px !important;
	}

	body.beshno-homepage-active .beshno-compact-cover {
		width: 62px;
		height: 62px;
		flex-basis: 62px;
	}
}

/* v1.0.3: pull homepage content up to match the normal section spacing */
body.beshno-homepage-active #main-content,
body.beshno-homepage-active .main-content,
body.beshno-homepage-active .main-content > .container-wrapper,
body.beshno-homepage-active .post-content.container-wrapper,
body.beshno-homepage-active .entry-content.container-wrapper {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

body.beshno-homepage-active .beshno-home-root {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

@media (max-width: 767px) {
	body.beshno-homepage-active #main-content,
	body.beshno-homepage-active .main-content,
	body.beshno-homepage-active .main-content > .container-wrapper,
	body.beshno-homepage-active .post-content.container-wrapper,
	body.beshno-homepage-active .entry-content.container-wrapper {
		margin-top: 0 !important;
		padding-top: 0 !important;
	}
	body.beshno-homepage-active .beshno-home-root > :first-child {
		margin-top: 0 !important;
	}
}


/* The theme keeps this empty top area outside the shortcode wrappers, so
   offset the homepage root itself. Restore the same space below it so the
   sections that follow do not move upward. Scoped to the homepage only. */
body.beshno-homepage-active .beshno-home-root {
    margin-top: -90px !important;
    margin-bottom: 90px !important;
    position: relative;
}

@media (max-width: 767px) {
    body.beshno-homepage-active .beshno-home-root {
        margin-top: -55px !important;
        margin-bottom: 55px !important;
    }
}
