/* =============================================
   360 Elementor Widget – Grid Styles v1.0.2
   ============================================= */

/* -- Widget container ------------------------ */
.elementor-widget-ew360_cpt_grid,
.elementor-widget-ew360_cpt_grid .elementor-widget-container {
	width: 100%;
}

/* -- Siatka ---------------------------------- */
.ew360-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	width: 100%;
	box-sizing: border-box;
}

/* -- Kafelek --------------------------------- */
.ew360-item {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border-radius: 8px;
	background: #f0f0f0;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ew360-item:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* -- Link ------------------------------------ */
.ew360-item__link {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	width: 100%;
	flex: 1;
}

/* -- Miniaturka ------------------------------ */
.ew360-item__thumb {
	display: block;
	position: relative;
	width: 100%;
	padding-top: 100%; /* fallback dla aspect-ratio */
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	background-color: #e0e0e0;
	overflow: hidden;
	box-sizing: border-box;
	flex-shrink: 0;
}

@supports (aspect-ratio: 1) {
	.ew360-item__thumb {
		padding-top: 0 !important;
		aspect-ratio: 1 / 1;
	}
}

/* -- Nakladka hover -------------------------- */
.ew360-item__overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.5);
	opacity: 0;
	transition: opacity 0.3s ease;
	z-index: 2;
}

.ew360-item:hover .ew360-item__overlay,
.ew360-item.ew360-touched .ew360-item__overlay,
.ew360-item__link:focus .ew360-item__overlay {
	opacity: 1;
}

/* -- Ikona w nakladce ------------------------ */
.ew360-item__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	transform: scale(0.8);
	transition: transform 0.3s ease;
}

.ew360-item__icon svg {
	fill: #fff;
	display: block;
	width: 32px;
	height: 32px;
}

.ew360-item:hover .ew360-item__icon,
.ew360-item.ew360-touched .ew360-item__icon {
	transform: scale(1);
}

/* -- Pasek tytulu ---------------------------- */
.ew360-item__title {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	box-sizing: border-box;
	background-color: #000000;
	color: #ffffff;
	font-size: 14px;
	padding: 10px;
	text-align: left;
	line-height: 1.4;
	word-break: break-word;
	z-index: 3;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.ew360-item:hover .ew360-item__title,
.ew360-item.ew360-touched .ew360-item__title {
	opacity: 1;
	transform: translateY(0);
}

/* -- Brak postow ----------------------------- */
.ew360-no-posts {
	padding: 20px;
	background: #fff3cd;
	border: 1px solid #ffc107;
	border-radius: 6px;
	color: #856404;
	font-size: 14px;
}

/* -- Placeholder edytora --------------------- */
.ew360-item__thumb--placeholder {
	background-color: #e8e8e8;
	background-image: none !important;
}

.ew360-placeholder-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 32px;
	opacity: 0.4;
	z-index: 1;
}

/* -- Responsywnosc fallback ------------------ */
@media (max-width: 1024px) {
	.ew360-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 767px) {
	.ew360-grid {
		grid-template-columns: repeat(1, 1fr);
	}
}

/* -- Focus accessibility --------------------- */
.ew360-item__link:focus {
	outline: 3px solid #0073aa;
	outline-offset: 2px;
}

.ew360-item__link:focus:not(:focus-visible) {
	outline: none;
}
