/**
 * Galleries Section — dark section with horizontal card slider.
 *
 * Figma node: 165-17612
 *
 * @package Hamechadesh
 */

/* ==========================================================================
   Section Container
   Full viewport width minus 10px (5px each side), dark bg, rounded.
   ========================================================================== */

.hm-galleries {
	width: calc(100% - 10px);
	max-width: none;
	margin-inline: auto;
	margin-top: var(--hm-space-section);
	background-color: var(--hm-color-primary);
	border-radius: var(--hm-radius-xl);
	overflow: hidden;
	content-visibility: auto;
	contain-intrinsic-size: auto 500px;
	z-index: 51;
    position: relative;
}

.hm-galleries__inner {
	max-width: var(--hm-container-width);
	margin-inline: auto;
	padding-inline: var(--hm-container-padding);
	padding-top: 60px;
	padding-bottom: 60px;
}

/* ==========================================================================
   Header — dot + title + line + button
   Same pattern as hm-catposts but with white text on dark bg.
   ========================================================================== */

.hm-galleries__header {
	display: flex;
	align-items: flex-end;
	gap: 15px;
	margin-bottom: 25px;
}

.hm-galleries__title-group {
	display: flex;
	align-items: center;
	gap: 5px;
	flex-shrink: 0;
}

.hm-galleries__dot {
	flex-shrink: 0;
}

.hm-galleries__title {
	font-family: var(--hm-font-primary);
	font-size: 32px;
	font-weight: 900;
	line-height: 1;
	color: #ffffff;
	white-space: nowrap;
}

/* Underline — stretches between title and button */
.hm-galleries__line {
	flex: 1;
	min-width: 0;
	border-bottom: 0.6px solid #ffffff;
	opacity: 0.25;
	margin-bottom: 4px;
}

/* CTA button — green pill */
.hm-galleries__link-btn {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	padding: 5px 25px;
	background-color: #55EBB1;
	border-radius: 6px;
	font-family: var(--hm-font-primary);
	font-weight: 300;
	font-size: 16px;
	line-height: 22px;
	color: var(--hm-color-primary);
	text-decoration: none;
	white-space: nowrap;
	transition: opacity var(--hm-transition-fast);
}

.hm-galleries__link-btn:hover {
	opacity: 0.85;
	color: var(--hm-color-primary);
}

/* ==========================================================================
   Cards Slider
   ========================================================================== */

.hm-galleries__slider {
	overflow: hidden;
	margin-bottom: 20px;
}

.hm-galleries__track {
	display: flex;
	gap: 15px;
	transition: transform 400ms ease;
	/* Fixed height so hover scale doesn't push arrows down */
	height: 262px; /* 187px image + 15px gap + ~60px content */
	align-items: flex-start;
}

/* ==========================================================================
   Card — dark card with image, badge, icon, title.
   Hover uses transform: scale() so layout flow is unaffected.
   ========================================================================== */

.hm-galleries__card {
	position: relative;
	flex-shrink: 0;
	width: 320px;
	background-color: #383838;
	border-radius: 14px;
	overflow: hidden;
	transform-origin: center top;
	transition: transform 300ms ease;
}

/* Full-card overlay link */
.hm-galleries__card-link {
	position: absolute;
	inset: 0;
	z-index: 2;
}

/* Hover: only the hovered card scales, others stay unchanged.
   transform: scale doesn't affect layout — row height stays the same. */
.hm-galleries__card:hover {
	transform: scale(1.06);
	z-index: 1;
}

/* --- Card Media --- */

.hm-galleries__card-media {
	position: relative;
	width: 100%;
	height: 187px;
	overflow: hidden;
	border-radius: 14px 14px 0 0;
}

.hm-galleries__card-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.hm-galleries__card-img--placeholder {
	background-color: #4a4a4a;
}

/* Gallery icon — top-right in RTL (= inset-inline-start = physical RIGHT) */
.hm-galleries__card-icon {
	position: absolute;
	top: 7px;
	inset-inline-start: 8px;
	width: 24px;
	height: 24px;
	z-index: 1;
	opacity: 0.9;
}

/* --- Category Badge override for dark card ---
   Reuses hm-card-md__category HTML + CSS from article-card.css.
   Only position override needed: badge sits at inset-inline-end (LEFT in RTL). */

.hm-galleries__card-category {
	/* hm-card-md__category already sets inset-inline-end: 0 (LEFT in RTL) */
}

/* --- Card Content --- */

.hm-galleries__card-content {
	padding: 15px 10px 15px;
	min-height: 70px;
}

.hm-galleries__card-title {
	font-family: var(--hm-font-primary);
	font-size: 20px;
	font-weight: 700;
	line-height: 20px;
	color: #ffffff;
	text-align: start;
}

.hm-galleries__card-title a {
	color: inherit;
	text-decoration: none;
}

.hm-galleries__card-title a:hover {
	color: inherit;
}

/* ==========================================================================
   Navigation Arrows
   ========================================================================== */

.hm-galleries__nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.hm-galleries__nav-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	transition: opacity var(--hm-transition-fast);
}

.hm-galleries__nav-btn:hover {
	opacity: 0.8;
}

.hm-galleries__nav-btn:disabled {
	opacity: 0.3;
	cursor: default;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Mobile base */
@media (max-width: 767px) {
	.hm-galleries__inner {
		padding-top: 40px;
		padding-bottom: 40px;
	}

	.hm-galleries__title {
		font-size: 24px;
	}

	.hm-galleries__card {
		width: 260px;
	}

	.hm-galleries__card-media {
		height: 152px;
	}

	.hm-galleries__track {
		height: 222px;
	}

	.hm-galleries__card-title {
		font-size: 16px;
		line-height: 18px;
	}

	.hm-galleries__link-btn {
		font-size: 14px;
		padding: 4px 16px;
	}
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
	.hm-galleries__inner {
		padding-top: 50px;
		padding-bottom: 50px;
	}

	.hm-galleries__card {
		width: 280px;
	}

	.hm-galleries__card-media {
		height: 163px;
	}

	.hm-galleries__track {
		height: 238px;
	}
}

/* Desktop */
@media (min-width: 1350px) {
	.hm-galleries__inner {
		padding-top: 100px;
		padding-bottom: 120px;
	}
}
