/**
 * Hamenagen - עמוד הורדת סינגלים [hm_downloads_page]
 * מצב בהיר/כהה: html[data-hm-theme]
 */

.hm-dl-page-wrap {
	width: 100%;
	overflow-x: clip;
	transition: background 0.25s ease;
}

html[data-hm-theme="light"] .hm-dl-page-wrap,
html:not([data-hm-theme]) .hm-dl-page-wrap {
	background: #f4f5f8;
}

html[data-hm-theme="dark"] .hm-dl-page-wrap {
	background: #0b0b24;
}

.hm-dl-page {
	--hm-dl-brand: #cb1e53;
	--hm-dl-navy: #26235a;
	--hm-dl-navy-deep: #20215a;
	--hm-dl-radius: 16px;
	--hm-dl-radius-pill: 999px;
	--hm-dl-transition: 0.25s ease;
	--hm-dl-font: "פולין", "Polin", sans-serif;
	--hm-dl-pad-x: clamp(0.75rem, 3vw, 1.5rem);
	--hm-dl-max-w: 960px;

	direction: rtl;
	font-family: var(--hm-dl-font) !important;
	color: var(--hm-dl-text) !important;
	background: transparent;
	width: 100% !important;
	max-width: var(--hm-dl-max-w) !important;
	margin-inline: auto !important;
	padding: clamp(1.25rem, 3vw, 2.5rem) var(--hm-dl-pad-x) 3rem !important;
	box-sizing: border-box;
	overflow-x: clip;
	transition: background var(--hm-dl-transition), color var(--hm-dl-transition);
}

.hm-dl-page *,
.hm-dl-page *::before,
.hm-dl-page *::after {
	box-sizing: border-box;
}

.hm-dl-page,
.hm-dl-page *,
.hm-dl-page input,
.hm-dl-page a {
	font-family: var(--hm-dl-font) !important;
}

/* === Notice / issue report === */
.hm-dl-page__notice {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.75rem;
	margin: 0 0 1.25rem;
	padding: 0.85rem 1rem;
	border: 1px solid rgba(203, 30, 83, 0.28);
	border-radius: 10px;
	background: linear-gradient(135deg, rgba(203, 30, 83, 0.08), rgba(38, 35, 90, 0.05));
	box-shadow: 0 2px 10px rgba(32, 33, 90, 0.06);
}

html[data-hm-theme="dark"] .hm-dl-page__notice {
	border-color: rgba(203, 30, 83, 0.4);
	background: linear-gradient(135deg, rgba(203, 30, 83, 0.16), rgba(255, 255, 255, 0.04));
	box-shadow: none;
}

.hm-dl-page__notice-text {
	margin: 0;
	color: var(--hm-dl-text) !important;
	font-size: 0.92rem;
	font-weight: 500;
	line-height: 1.55;
}

.hm-dl-page__notice-link {
	color: var(--hm-dl-brand) !important;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.hm-dl-page__notice-link:hover,
.hm-dl-page__notice-link:focus-visible {
	color: #a81845 !important;
}

.hm-dl-page__notice-btn {
	align-self: flex-start;
	appearance: none !important;
	-webkit-appearance: none !important;
	border: none !important;
	border-radius: 8px !important;
	padding: 0.45rem 0.9rem !important;
	background: var(--hm-dl-brand) !important;
	color: #fff !important;
	font-size: 0.9rem !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
	cursor: pointer;
	transition: background var(--hm-dl-transition), transform var(--hm-dl-transition);
}

.hm-dl-page__notice-btn:hover,
.hm-dl-page__notice-btn:focus-visible {
	background: #a81845 !important;
	outline: none;
}

.hm-dl-page__notice-btn[aria-expanded="true"] {
	background: var(--hm-dl-navy) !important;
}

.hm-dl-page__issue-form {
	display: grid;
	gap: 0.55rem;
	margin-top: 0.15rem;
	padding-top: 0.75rem;
	border-top: 1px solid var(--hm-dl-border);
}

.hm-dl-page__issue-form[hidden] {
	display: none !important;
}

.hm-dl-page__issue-label {
	margin: 0.15rem 0 0;
	color: var(--hm-dl-heading) !important;
	font-size: 0.88rem;
	font-weight: 700;
}

.hm-dl-page__issue-select,
.hm-dl-page__issue-textarea {
	width: 100% !important;
	max-width: 100% !important;
	border: 1px solid var(--hm-dl-border) !important;
	border-radius: 8px !important;
	background: var(--hm-dl-search-bg) !important;
	color: var(--hm-dl-text) !important;
	font-size: 0.95rem !important;
	line-height: 1.4 !important;
	padding: 0.65rem 0.8rem !important;
	-webkit-appearance: none !important;
	appearance: none !important;
}

.hm-dl-page__issue-select:focus,
.hm-dl-page__issue-textarea:focus {
	outline: none !important;
	border-color: rgba(203, 30, 83, 0.45) !important;
	box-shadow: 0 0 0 3px rgba(203, 30, 83, 0.12) !important;
}

.hm-dl-page__issue-textarea {
	resize: vertical;
	min-height: 5.5rem;
}

.hm-dl-page__issue-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

.hm-dl-page__issue-submit {
	justify-self: start;
	appearance: none !important;
	-webkit-appearance: none !important;
	border: none !important;
	border-radius: 8px !important;
	padding: 0.5rem 1.15rem !important;
	background: var(--hm-dl-navy) !important;
	color: #fff !important;
	font-size: 0.95rem !important;
	font-weight: 700 !important;
	cursor: pointer;
	transition: background var(--hm-dl-transition), opacity var(--hm-dl-transition);
}

.hm-dl-page__issue-submit:hover,
.hm-dl-page__issue-submit:focus-visible {
	background: #1b1945 !important;
	outline: none;
}

.hm-dl-page__issue-submit:disabled {
	opacity: 0.65;
	cursor: wait;
}

.hm-dl-page__issue-status {
	margin: 0;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.4;
}

.hm-dl-page__issue-status[hidden] {
	display: none !important;
}

.hm-dl-page__issue-status.is-ok {
	color: #1a7f3c !important;
}

.hm-dl-page__issue-status.is-err {
	color: #cb1e53 !important;
}

html[data-hm-theme="dark"] .hm-dl-page__issue-status.is-ok {
	color: #6ddea0 !important;
}

html[data-hm-theme="light"] .hm-dl-page,
html:not([data-hm-theme]) .hm-dl-page {
	--hm-dl-page-bg: #f4f5f8;
	--hm-dl-heading: #20215a;
	--hm-dl-text: #333333;
	--hm-dl-text-muted: #666666;
	--hm-dl-surface: #ffffff;
	--hm-dl-bg-soft: #f7f6ff;
	--hm-dl-border: rgba(32, 33, 90, 0.14);
	--hm-dl-shadow: 0 8px 24px rgba(32, 33, 90, 0.08);
	--hm-dl-card-border: rgba(32, 33, 90, 0.08);
	--hm-dl-search-bg: #ffffff;
	--hm-dl-toolbar-bg: rgba(244, 245, 248, 0.92);
}

html[data-hm-theme="dark"] .hm-dl-page {
	--hm-dl-page-bg: #0b0b24;
	--hm-dl-heading: #ffffff;
	--hm-dl-text: #ffffff;
	--hm-dl-text-muted: #b3b3b3;
	--hm-dl-surface: rgba(255, 255, 255, 0.06);
	--hm-dl-bg-soft: rgba(255, 255, 255, 0.04);
	--hm-dl-border: rgba(255, 255, 255, 0.12);
	--hm-dl-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
	--hm-dl-card-border: rgba(255, 255, 255, 0.08);
	--hm-dl-search-bg: rgba(255, 255, 255, 0.08);
	--hm-dl-toolbar-bg: rgba(11, 11, 36, 0.92);
}

/* === Toolbar (sticky desktop) === */
.hm-dl-page__toolbar {
	margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
	padding-bottom: 0.75rem;
}

@media (min-width: 992px) {
	.hm-dl-page__toolbar {
		position: sticky;
		top: 50px;
		z-index: 20;
		padding-top: 0.5rem;
		padding-bottom: 1rem;
		background: var(--hm-dl-toolbar-bg);
		backdrop-filter: blur(10px);
		-webkit-backdrop-filter: blur(10px);
	}
}

.hm-dl-page__title-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	margin-bottom: 1.25rem;
}

.hm-dl-page__title {
	margin: 0;
	font-size: clamp(1.75rem, 4vw, 2.5rem);
	font-weight: 800;
	line-height: 1.15;
	color: var(--hm-dl-heading) !important;
	letter-spacing: -0.02em;
}

/* === Search === */
.hm-dl-page__search-wrap {
	position: relative;
	max-width: 100%;
	margin-bottom: 1rem;
}

.hm-dl-page__search-label {
	position: absolute;
	inset-inline-end: 1.25rem;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	pointer-events: none;
	color: var(--hm-dl-text-muted);
}

.hm-dl-page__search-icon {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

.hm-dl-page__search {
	display: block !important;
	width: 100% !important;
	padding-block: 1rem !important;
	padding-inline-start: 1.25rem !important;
	padding-inline-end: 3rem !important;
	border: 1px solid var(--hm-dl-border) !important;
	border-radius: var(--hm-dl-radius-pill) !important;
	background: var(--hm-dl-search-bg) !important;
	color: var(--hm-dl-text) !important;
	font-size: 1rem !important;
	line-height: 1.4 !important;
	box-shadow: var(--hm-dl-shadow) !important;
	transition: border-color var(--hm-dl-transition), box-shadow var(--hm-dl-transition) !important;
	-webkit-appearance: none !important;
	appearance: none !important;
}

.hm-dl-page__search::placeholder {
	color: var(--hm-dl-text-muted) !important;
	opacity: 0.85;
}

.hm-dl-page__search:focus {
	outline: none !important;
	border-color: rgba(203, 30, 83, 0.45) !important;
	box-shadow: 0 0 0 3px rgba(203, 30, 83, 0.12) !important;
}

/* === Monthly download limit (free users) === */
.hm-dl-page__limit-status {
	margin: 0;
	flex: 1 1 12rem;
	max-width: 28rem;
	text-align: start;
	color: var(--hm-dl-text-muted) !important;
	font-size: 0.95rem;
	font-weight: 500;
	line-height: 1.45;
}

.hm-dl-page__limit-status strong {
	color: var(--hm-dl-heading) !important;
	font-weight: 700;
}

/* === Meta count === */
.hm-dl-page__meta {
	margin: 0;
	display: inline-flex;
	align-items: baseline;
	gap: 0.35rem;
	color: var(--hm-dl-text-muted) !important;
	font-size: 0.95rem;
	font-weight: 500;
}

.hm-dl-page__count-num {
	font-weight: 700;
	color: var(--hm-dl-text) !important;
}

/* === Results grid - תמיד 2 בעמוד (מובייל: 1) === */
.hm-dl-page__results {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 10px;
	width: 100%;
}

@media (min-width: 540px) {
	.hm-dl-page__results {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}
}

.hm-dl-page__item {
	min-width: 0;
	max-width: 100%;
}

.hm-dl-page.is-loading .hm-dl-page__results {
	opacity: 0.55;
	pointer-events: none;
}

.hm-dl-page__empty {
	margin: 2rem 0 0;
	text-align: center;
	color: var(--hm-dl-text-muted) !important;
	font-size: 1rem;
}

.hm-dl-page__empty[hidden] {
	display: none !important;
}

/* === Pagination === */
.hm-dl-page__pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	flex-wrap: wrap;
	margin-top: 1.75rem;
	padding-top: 0.5rem;
}

.hm-dl-page__pagination[hidden] {
	display: none !important;
}

.hm-dl-page__page-btn {
	-webkit-appearance: none !important;
	appearance: none !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	min-width: 96px !important;
	padding: 0.65rem 1.25rem !important;
	border: 1px solid var(--hm-dl-border) !important;
	border-radius: var(--hm-dl-radius-pill) !important;
	background: var(--hm-dl-surface) !important;
	color: var(--hm-dl-heading) !important;
	font-size: 0.9rem !important;
	font-weight: 600 !important;
	cursor: pointer !important;
	transition: border-color var(--hm-dl-transition), color var(--hm-dl-transition), background var(--hm-dl-transition) !important;
}

.hm-dl-page__page-btn:hover:not(:disabled) {
	border-color: rgba(203, 30, 83, 0.45) !important;
	color: var(--hm-dl-brand) !important;
}

.hm-dl-page__page-btn:disabled {
	opacity: 0.4 !important;
	cursor: not-allowed !important;
}

.hm-dl-page__page-info {
	color: var(--hm-dl-text-muted) !important;
	font-size: 0.9rem;
	font-weight: 500;
	white-space: nowrap;
}

/* === Download item (עיצוב חדש - כמו עמוד הבית) === */
.hm-dl-page .hm-home__download-item {
	--hm-dl-h: clamp(48px, 7vw, 56px);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
	min-width: 0;
	max-width: 100%;
	min-height: var(--hm-dl-h);
	padding: 0.65rem 0.65rem 0.65rem 0.85rem;
	background: var(--hm-dl-bg-soft);
	border: 1px solid var(--hm-dl-card-border);
	border-radius: 50px;
	box-shadow: var(--hm-dl-shadow);
	transition: border-color var(--hm-dl-transition), box-shadow var(--hm-dl-transition);
}

html[data-hm-theme="light"] .hm-dl-page .hm-home__download-item,
html:not([data-hm-theme]) .hm-dl-page .hm-home__download-item {
	border-color: rgba(32, 33, 90, 0.08);
	box-shadow: 0 4px 14px rgba(32, 33, 90, 0.06);
}

.hm-dl-page .hm-home__download-item:hover {
	border-color: rgba(203, 30, 83, 0.25);
}

.hm-dl-page .hm-home__download-info {
	flex: 1;
	min-width: 0;
	line-height: 1.25;
}

.hm-dl-page .hm-home__download-singer {
	display: block;
	min-width: 0;
	max-width: 100%;
	font-size: clamp(0.72rem, 2.8vw, 0.85rem);
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	color: var(--hm-dl-heading);
}

.hm-dl-page .hm-home__download-singer-link {
	flex: 0 0 auto;
	white-space: nowrap;
	color: var(--hm-dl-heading) !important;
	text-decoration: none !important;
	transition: color var(--hm-dl-transition);
}

.hm-dl-page .hm-home__download-singer-link:hover {
	color: var(--hm-dl-brand) !important;
}

.hm-dl-page .hm-home__download-singer-sep {
	flex: 0 0 auto;
	color: var(--hm-dl-heading);
	font-weight: 700;
	white-space: pre;
}

.hm-dl-page .hm-home__download-song {
	display: block;
	margin-top: 0.12em;
	color: var(--hm-dl-text-muted) !important;
	font-size: clamp(0.65rem, 2.4vw, 0.78rem);
	font-weight: 500;
	text-decoration: none !important;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: color var(--hm-dl-transition);
}

.hm-dl-page .hm-home__download-song:hover {
	color: var(--hm-dl-brand) !important;
}

.hm-dl-page .hm-home__download-action {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none !important;
	transition: transform var(--hm-dl-transition);
}

.hm-dl-page .hm-home__download-action:hover {
	transform: scale(1.04);
}

.hm-dl-page .hm-home__download-circle {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: clamp(30px, 5vw, 36px);
	height: clamp(30px, 5vw, 36px);
	background: var(--hm-dl-navy);
	border-radius: 50%;
	transition: background var(--hm-dl-transition);
}

.hm-dl-page .hm-home__download-action:hover .hm-home__download-circle {
	background: var(--hm-dl-brand);
}

.hm-dl-page .hm-home__download-circle img {
	display: block;
	width: 14px;
	height: 14px;
	object-fit: contain;
}

@media (max-width: 539px) {
	.hm-dl-page .hm-home__download-item {
		padding-inline-end: 0.85rem;
	}
}