/* =============================================================================
   Sonidekor Munkáink — munkak.css
   ============================================================================= */

/* ── Screen-reader only utility ──────────────────────────────────────────── */
.smunka-sr-status {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ── Wrapper ─────────────────────────────────────────────────────────────── */
.smunka-wrapper {
	width: 100%;
}

/* ── Filter bar ──────────────────────────────────────────────────────────── */
.smunka-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 32px;
}

.smunka-filter-btn {
	display: inline-block;
	position: relative;
	background-color: transparent;
	border: none;
	outline: none;
	box-shadow: none;
	cursor: pointer;
	padding: 8px 20px;
	border-radius: 5px;
	font-size: inherit;
	font-family: inherit;
	line-height: 1.4;
	color: #333;
	transition: background-color 0.2s ease, color 0.2s ease;
}

/* Border via ::before so it never affects layout — theme button:hover rules can't touch it */
.smunka-filter-btn::before {
	content: '';
	position: absolute;
	inset: 0;
	border: 1px solid currentColor;
	border-radius: inherit;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.smunka-filter-btn:focus-visible {
	outline: 2px solid #111;
	outline-offset: 2px;
}

.smunka-card__link:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -3px;
}

.smunka-load-more-btn:focus-visible {
	outline: 2px solid #111;
	outline-offset: 2px;
}

.smunka-detail-gallery__link:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -3px;
}

.smunka-filter-btn--active {
	background-color: #111;
	color: #fff;
}

.smunka-filter-btn--active::before {
	opacity: 0;
}

/* ── Grid (Shuffle.js layout) ────────────────────────────────────────────── */
.smunka-grid {
	position: relative;
	--smunka-gap: 24px;
	width: 100%;
	min-width: 0;
}

/* Column widths — Shuffle.js positions items absolutely; widths set via CSS */
.smunka-grid--cols-2 .smunka-card { width: calc(50% - var(--smunka-gap) / 2); }
.smunka-grid--cols-3 .smunka-card { width: calc(33.333% - var(--smunka-gap) * 2 / 3); }
.smunka-grid--cols-4 .smunka-card { width: calc(25% - var(--smunka-gap) * 3 / 4); }

/* ── Card base (Shuffle.js item) ─────────────────────────────────────────── */
.smunka-card {
	box-sizing: border-box;
	padding-bottom: var(--smunka-gap); /* vertical row spacing counted by Shuffle.js */
}

/* ── Card inner (visual card) ────────────────────────────────────────────── */
.smunka-card__inner {
	position: relative;
	aspect-ratio: 4 / 3; /* fallback; overridden by Elementor */
	border-radius: 8px; /* fallback; overridden by Elementor */
	overflow: hidden;
}

.smunka-card__link {
	position: absolute;
	inset: 0;
	display: block;
	text-decoration: none;
	color: inherit;
}

.smunka-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.smunka-card__img--placeholder {
	width: 100%;
	height: 100%;
	background-color: #e0e0e0;
}

.smunka-card__inner:hover .smunka-card__img,
.smunka-card__inner:focus-within .smunka-card__img {
	transform: scale(1.04);
}

/* ── Hover overlay ───────────────────────────────────────────────────────── */
.smunka-card__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.35); /* fallback; overridden by Elementor */
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
	z-index: 1;
}

.smunka-card__inner:hover .smunka-card__overlay,
.smunka-card__inner:focus-within .smunka-card__overlay {
	opacity: 1;
}

/* ── Arrow icon — appears centred on hover ───────────────────────────────── */
.smunka-card__icon {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0.7);
	width: 44px;
	height: 44px;
	background-color: rgba(255, 255, 255, 0.92);
	border-radius: 50%;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23222' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='7' y1='17' x2='17' y2='7'/%3E%3Cpolyline points='7 7 17 7 17 17'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 18px 18px;
	opacity: 0;
	transition: opacity 0.3s ease, transform 0.3s ease;
	z-index: 2;
	pointer-events: none;
	display: block;
}

.smunka-card__inner:hover .smunka-card__icon,
.smunka-card__inner:focus-within .smunka-card__icon {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

/* ── Title bar — always visible at the bottom ────────────────────────────── */
.smunka-card__bar {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: rgba(40, 40, 40, 0.82); /* fallback; overridden by Elementor */
	padding: 10px 14px;
	z-index: 3;
	box-sizing: border-box;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.smunka-card__title {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 500;
	line-height: 1.3;
	color: #fff; /* fallback; overridden by Elementor */
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ── Loading state ───────────────────────────────────────────────────────── */
.smunka-grid-wrap {
	position: relative;
	min-height: 80px;
}

.smunka-grid-wrap.is-loading::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.65);
	z-index: 5;
	border-radius: 4px;
}

.smunka-spinner {
	display: none;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 40px;
	height: 40px;
	border: 3px solid rgba(0, 0, 0, 0.1);
	border-top-color: #111;
	border-radius: 50%;
	animation: smunka-spin 0.75s linear infinite;
	z-index: 6;
}

.smunka-grid-wrap.is-loading .smunka-spinner {
	display: block;
}

@keyframes smunka-spin {
	to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.smunka-empty {
	text-align: center;
	padding: 40px 20px;
	color: #888;
	font-size: 0.95rem;
}

/* ── Load More gomb ──────────────────────────────────────────────────────── */
.smunka-load-more-wrap {
	text-align: center;
	margin-top: 40px;
}

.smunka-load-more-btn {
	display: inline-block;
	border: none;
	cursor: pointer;
	background-color: #111;
	color: #fff;
	padding: 12px 40px;
	border-radius: 4px;
	font-size: inherit;
	font-family: inherit;
	font-weight: 500;
	line-height: 1.4;
	transition: opacity 0.2s ease;
}

.smunka-load-more-btn:hover {
	opacity: 0.85;
}

.smunka-load-more-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* ── Pagination ──────────────────────────────────────────────────────────── */
.smunka-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	margin-top: 40px;
}

.smunka-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
	text-decoration: none;
	color: #333;
	font-size: 0.9rem;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.smunka-pagination .page-numbers.current,
.smunka-pagination .page-numbers:hover {
	background-color: #111;
	color: #fff;
	border-color: #111;
}

/* ── Detail widget (smunka-detail) ───────────────────────────────────────── */
.smunka-detail {
	width: 100%;
	min-width: 0; /* prevents flex/grid overflow */
}

.smunka-detail__header {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 16px;
	width: 100% !important;
	min-width: 0;
	margin-bottom: 12px;
}

.smunka-detail__alcim {
	font-size: 31px;
	margin: 0;
}

.smunka-detail__leiras {
	font-size: 1rem;
	line-height: 1.7;
	color: #444;
	margin: 0 0 28px;
}

.smunka-detail__back-link {
	display: inline-block;
	flex-shrink: 0;
	align-self: center;
	margin-left: auto;
	line-height: 1;
	color: inherit;
	text-decoration: underline;
	font-size: 0.9rem;
	opacity: 0.65;
	white-space: nowrap;
	transition: opacity 0.2s ease;
}

.smunka-detail__back-link:hover {
	opacity: 1;
}

/* ── Detail gallery grid ─────────────────────────────────────────────────── */
.smunka-detail-gallery {
	display: grid;
	gap: 16px;
	margin-bottom: 40px;
	width: 100%;
	min-width: 0;
}

.smunka-detail-gallery--cols-1 { grid-template-columns: 1fr; }
.smunka-detail-gallery--cols-2 { grid-template-columns: repeat(2, 1fr); }
.smunka-detail-gallery--cols-3 { grid-template-columns: repeat(3, 1fr); }
.smunka-detail-gallery--cols-4 { grid-template-columns: repeat(4, 1fr); }

.smunka-detail-gallery__item {
	overflow: hidden;
	border-radius: 8px; /* fallback; Elementor slider targets this */
}

.smunka-detail-gallery__link {
	display: block;
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3; /* fallback; Elementor slider targets __link */
	overflow: hidden;
	text-decoration: none;
	cursor: zoom-in;
}

.smunka-detail-gallery__img {
	display: block;
	width: 100%;
	aspect-ratio: inherit; /* matches the link's ratio — fills exactly */
	object-fit: cover;
	object-position: center;
	transition: transform 0.4s ease;
}

.smunka-detail-gallery__item:hover .smunka-detail-gallery__img {
	transform: scale(1.04);
}

.smunka-detail-gallery__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.35);
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
	z-index: 1;
}

.smunka-detail-gallery__item:hover .smunka-detail-gallery__overlay,
.smunka-detail-gallery__item:focus-within .smunka-detail-gallery__overlay {
	opacity: 1;
}

/* Zoom icon on hover */
.smunka-detail-gallery__link::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0.7);
	width: 44px;
	height: 44px;
	background-color: rgba(255, 255, 255, 0.92);
	border-radius: 50%;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23222' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 20px 20px;
	opacity: 0;
	transition: opacity 0.3s ease, transform 0.3s ease;
	z-index: 2;
	pointer-events: none;
}

.smunka-detail-gallery__item:hover .smunka-detail-gallery__link::after,
.smunka-detail-gallery__item:focus-within .smunka-detail-gallery__link::after {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

/* Tablet landscape / kis desktop (≤ 1024px — Elementor tablet breakpoint) */
@media (max-width: 1024px) {
	.smunka-grid--cols-4 .smunka-card { width: calc(33.333% - var(--smunka-gap) * 2 / 3); }
	.smunka-detail-gallery--cols-4 { grid-template-columns: repeat(3, 1fr); }
}

/* Tablet portrait (≤ 768px — iPad, Android tablet álló) */
@media (max-width: 768px) {
	.smunka-grid--cols-3 .smunka-card,
	.smunka-grid--cols-4 .smunka-card { width: calc(50% - var(--smunka-gap) / 2); }

	.smunka-detail-gallery--cols-3,
	.smunka-detail-gallery--cols-4 { grid-template-columns: repeat(2, 1fr); }

	/* Cím + vissza link egymás alá mobilon */
	.smunka-detail__header {
		flex-direction: column !important;
		align-items: flex-start !important;
	}
	.smunka-detail__back-link {
		margin-left: 0;
	}
}

/* Mobil (≤ 480px — telefon álló nézet) */
@media (max-width: 480px) {
	.smunka-grid--cols-2 .smunka-card,
	.smunka-grid--cols-3 .smunka-card,
	.smunka-grid--cols-4 .smunka-card { width: 100%; }

	.smunka-detail-gallery--cols-2,
	.smunka-detail-gallery--cols-3,
	.smunka-detail-gallery--cols-4 { grid-template-columns: 1fr; }

	.smunka-filters { gap: 8px; }
	.smunka-card__title { font-size: 1rem; }
}

/* ── Elementor lightbox: hide fullscreen, share and zoom toolbar buttons ──── */
/* Targets both icon-font (<i>) and SVG-experiment versions */
.elementor-slideshow__header .eicon-share-arrow,
.elementor-slideshow__header .elementor-icon-share,
.elementor-slideshow__header .eicon-zoom-in-bold,
.elementor-slideshow__header .e-eicon-zoom-in-bold,
.elementor-slideshow__header .e-eicon-zoom-out-bold,
.elementor-slideshow__header .eicon-frame-expand,
.elementor-slideshow__header .e-eicon-frame-expand,
.elementor-slideshow__header .e-eicon-frame-minimize,
.elementor-slideshow__share-menu {
	display: none !important;
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	.smunka-card__img,
	.smunka-card__overlay,
	.smunka-card__icon,
	.smunka-detail-gallery__img,
	.smunka-detail-gallery__overlay,
	.smunka-detail-gallery__link::after,
	.smunka-load-more-btn,
	.smunka-filter-btn,
	.smunka-filter-btn::before,
	.smunka-detail__back-link,
	.smunka-pagination .page-numbers {
		transition: none;
	}

	.smunka-card__inner:hover .smunka-card__img,
	.smunka-detail-gallery__item:hover .smunka-detail-gallery__img {
		transform: none;
	}

	.smunka-card__inner:hover .smunka-card__icon,
	.smunka-card__inner:focus-within .smunka-card__icon {
		transform: translate(-50%, -50%) scale(1);
	}

	.smunka-detail-gallery__item:hover .smunka-detail-gallery__link::after,
	.smunka-detail-gallery__item:focus-within .smunka-detail-gallery__link::after {
		transform: translate(-50%, -50%) scale(1);
	}

	.smunka-spinner {
		animation: none;
	}
}
