/* Hero2 tiles scroller (κάθε πλακίδιο ~ 3/12 = 25% πλάτος) */

.hero2-tiles {
	--hero2-gap: 16px;
	--hero2-card-height: 16.5rem;
	--hero2-caption-height: 3.1rem;
	margin-top: 3rem;
	padding-top: 0.65rem;
	margin-bottom: 2rem;
	position: relative;
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	column-gap: 0.75rem;
}

/* Static mode: show tiles without carousel/controls.
   Used when we have 4 (or fewer) photos. */
.hero2-tiles--static {
	display: block;
}

.hero2-tiles-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0;
	/* Overlay πάνω από τα tiles ώστε να μην δημιουργεί δεύτερη γραμμή */
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	transform: translateY(-50%);
	padding: 0 0.5rem;
	z-index: 5;
	pointer-events: none; /* επιτρέπουμε μόνο στα κουμπιά να "πατάνε" */
}

.hero2-tiles-controls {
	display: flex;
	gap: 0.5rem;
	pointer-events: auto;
	justify-content: center;
	align-self: center;
}

/* Static mode: χωράνε όλα → χωρίς βελάκια. Αν όχι, JS προσθέτει .hero2-tiles--overflow */
.hero2-tiles--static .hero2-tiles-controls {
	display: none;
}

.hero2-tiles--static.hero2-tiles--overflow {
	position: relative;
}

.hero2-tiles--static.hero2-tiles--overflow .hero2-tiles-scroll {
	overflow-x: auto;
	padding-bottom: 6px;
}

.hero2-tiles--static.hero2-tiles--overflow .hero2-tiles-controls {
	display: flex;
	position: absolute;
	top: 45%;
	transform: translateY(-50%);
	z-index: 6;
}

.hero2-tiles--static.hero2-tiles--overflow .hero2-tiles-controls-prev {
	left: 0.35rem;
}

.hero2-tiles--static.hero2-tiles--overflow .hero2-tiles-controls-next {
	right: 0.35rem;
}

.hero2-tiles-btn {
	width: 40px;
	height: 40px;
	border-radius: 999px;
	border: 1px solid #e9ecef;
	background: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #003366;
	flex: 0 0 auto;
}

.hover-enabled .hero2-tiles-btn {
	transition: all 0.2s ease;
}

.hover-enabled .hero2-tiles-btn:hover {
	border-color: #dee2e6;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
	transform: translateY(-1px);
}

.hero2-tiles-scroll {
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
	padding-bottom: 6px;
	scrollbar-width: none; /* Firefox */
	min-width: 0; /* Avoid Grid shrinking the scroll area */
}

.hero2-tiles--static .hero2-tiles-scroll {
	overflow-x: hidden;
	padding-bottom: 0;
}

.hero2-tiles-scroll::-webkit-scrollbar {
	height: 0;
}

.hero2-tiles-row {
	display: flex;
	gap: var(--hero2-gap);
}

.hero2-tiles--static .hero2-tiles-row {
	flex-wrap: nowrap;
}

/* 3 cols out of 12 => 25% width each */
.hero2-tile-col {
	flex: 0 0 calc(25% - (var(--hero2-gap) * 0.75));
	max-width: calc(25% - (var(--hero2-gap) * 0.75));
}

.hero2-tile-link {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	border: 1px solid #e9ecef;
	border-radius: 12px;
	background: #ffffff;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	/* Κλειδώνουμε συνολικό ύψος ώστε όλες οι κάρτες να είναι ίδιες */
	height: var(--hero2-card-height);
	box-sizing: border-box;
}

.hover-enabled .hero2-tile-link {
	transition: all 0.2s ease;
}

.hover-enabled .hero2-tile-link:hover {
	transform: translateY(-2px);
	border-color: #dee2e6;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.hero2-tile-img-wrap {
	width: 100%;
	background: #f1f3f5;
	display: flex;
	align-items: center;
	justify-content: center;
	/* Ντετερμινιστικό: img-wrap = card - caption */
	height: calc(var(--hero2-card-height) - var(--hero2-caption-height));
	flex: 0 0 auto;
}

.hero2-tile-img-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ΕΘΑΑΕ / Πρόγραμμα Υποτροφίας: ίδιο frame — contain, λευκό φόντο */
.hero2-tile-image--ethaae,
.hero2-tile-image--scholarship {
	width: auto !important;
	height: auto !important;
	max-width: 70% !important;
	max-height: 100% !important;
	object-fit: contain !important;
}

.hero2-tile-img-wrap--ethaae,
.hero2-tile-img-wrap--scholarship {
	background: #ffffff;
}

.hero2-tile-caption {
	padding: 0.6rem 0.75rem;
	text-align: center;
	font-weight: 600;
	color: #003366;
	font-size: 0.95rem;
	line-height: 1.2;
	/* Ίδιες διαστάσεις κάρτας μεταξύ όλων των tiles */
	height: var(--hero2-caption-height);
	overflow: hidden;

	/* Κρατάμε σταθερό ύψος και περιορίζουμε σε έως 2 γραμμές */
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.hero2-tiles-scroll:focus {
	outline: 2px solid #0057b7;
	outline-offset: 3px;
}

.hero2-tiles-hint {
	display: none;
}

@media (min-width: 481px) {
	.hero2-tiles-hint {
		display: none !important;
	}
}

/* Mobile friendly sizing:
   - On small screens show 2 tiles instead of 4 (less shrinking).
   - On extra small screens show 1 tile.
*/
@media (max-width: 768px) {
	.hero2-tile-col {
		/* 6 cols out of 12 => ~50% width each */
		flex: 0 0 calc(50% - (var(--hero2-gap) * 0.5));
		max-width: calc(50% - (var(--hero2-gap) * 0.5));
	}

	.hero2-tile-caption {
		font-size: 0.9rem;
	}

	/* If we are in carousel mode (more than 4 tiles), overlay controls
	   so they don't steal width from the tiles. */
	.hero2-tiles:not(.hero2-tiles--static) {
		grid-template-columns: 1fr;
	}

	.hero2-tiles:not(.hero2-tiles--static) .hero2-tiles-controls {
		position: absolute;
		top: 50%;
		transform: translateY(-50%);
	}

	.hero2-tiles:not(.hero2-tiles--static) .hero2-tiles-controls-prev {
		left: 0;
	}

	.hero2-tiles:not(.hero2-tiles--static) .hero2-tiles-controls-next {
		right: 0;
	}
}

@media (max-width: 480px) {
	.hero2-tiles {
		--hero2-gap: 12px;
		--hero2-card-height: 18.25rem;
		--hero2-caption-height: 2.9rem;
		margin-top: 2rem;
		padding-top: 0.45rem;
		/* Μην κρατάς πλευρικά tracks όταν τα controls είναι absolute overlay */
		grid-template-columns: 1fr;
		column-gap: 0;
	}

	.hero2-tiles-scroll {
		position: relative;
		padding-right: 1.25rem;
	}

	.hero2-tiles-scroll::after {
		content: '';
		position: absolute;
		top: 0;
		right: 0;
		bottom: 6px;
		width: 1.25rem;
		pointer-events: none;
		background: linear-gradient(to left, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0));
	}

	/* Πάντα 1-by-1 οριζόντιο scrolling */
	.hero2-tiles-scroll {
		scroll-snap-type: x mandatory;
	}

	.hero2-tiles-row {
		flex-wrap: nowrap;
	}

	.hero2-tile-col {
		/* One tile per viewport width */
		flex: 0 0 100%;
		max-width: 100%;
		scroll-snap-align: start;
	}

	.hero2-tile-caption {
		/* λίγο πιο μικρό σε κινητό */
		font-size: 0.9rem;
	}

	/* Βελάκια overlay (πάνω στην εικόνα) */
	.hero2-tiles-controls {
		position: absolute;
		top: 45%;
		transform: translateY(-50%);
		z-index: 6;
		display: flex;
	}

	/* Override: στο static mode τα rules desktop το κρύβουν.
	   Στο mobile το θέλουμε ορατό. */
	.hero2-tiles--static .hero2-tiles-controls {
		display: flex;
	}

	.hero2-tiles-controls-prev {
		left: 0.35rem;
	}

	.hero2-tiles-controls-next {
		right: 0.35rem;
	}

	/* Static mode still should scroll on mobile */
	.hero2-tiles--static .hero2-tiles-scroll {
		overflow-x: auto;
		padding-bottom: 6px;
	}

	.hero2-tiles-hint {
		display: inline-flex;
		align-items: center;
		gap: 0.35rem;
		font-size: 0.78rem;
		color: #6c757d;
		margin: 0.2rem 0.2rem 0;
	}
}

