/**
 * AIM Obsazenost — front-end styles.
 *
 * Values are taken from the original hand-built table on aimsport.cz so the
 * shortcode output is visually identical: Poppins 18px, #192c4b text, the
 * green gradient button and the #08c7ff calendar icon.
 *
 * Everything is scoped under .scamp-terminy so nothing leaks into Divi.
 * Colours and spacing live in custom properties on the root element:
 * override them in Divi → Theme Options → Custom CSS to match a rebrand.
 */

.scamp-terminy {
	--scamp-font: "Poppins", Helvetica, Arial, Lucida, sans-serif;
	--scamp-size: 18px;

	--scamp-text: #192c4b;
	--scamp-line: #f2f2f2;
	--scamp-icon: #08c7ff;

	--scamp-free: #18c129;
	--scamp-limited: #e09900;
	--scamp-full: #e02b20;

	--scamp-cta-from: #00da16;
	--scamp-cta-to: #18c129;
	--scamp-cta-text: #ffffff;
	--scamp-cta-size: 12px;
	--scamp-cta-padding: 15px 25px;
	--scamp-cta-radius: 3px;

	--scamp-gap: 1.25rem;
	--scamp-row-padding: 12px;
	--scamp-row-padding-mobile: 20px;

	color: var(--scamp-text);
	font-family: var(--scamp-font);
	font-size: var(--scamp-size);
}

.scamp-terminy *,
.scamp-terminy *::before,
.scamp-terminy *::after {
	box-sizing: border-box;
}

.scamp-terminy__title {
	margin: 0 0 1.5rem;
}

.scamp-terminy__empty {
	margin: 0;
	color: var(--scamp-text);
}

.scamp-terminy__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.scamp-terminy__item {
	display: grid;
	align-items: center;
	gap: 0.5rem var(--scamp-gap);
	/* No divider on phones — it only adds noise in the stacked card layout,
	   the extra spacing separates the terms instead. */
	padding: var(--scamp-row-padding-mobile) 0;
	grid-template-columns: 1fr;
	grid-template-areas:
		"date"
		"label"
		"occ"
		"cta";
}

.scamp-terminy__date {
	grid-area: date;
	display: inline-flex;
	align-items: center;
	white-space: nowrap;
	line-height: 1.7;
}

.scamp-terminy__icon {
	flex: 0 0 auto;
	width: 18px;
	height: auto;
	color: var(--scamp-icon);
}

/* 10px gap, matching the original inline style on the date span. */
.scamp-terminy__date-text {
	margin-left: 10px;
}

.scamp-terminy__label {
	grid-area: label;
	font-weight: 700;
	line-height: 1.7;
}

.scamp-terminy__occupancy {
	grid-area: occ;
	font-weight: 500;
	line-height: 1.7;
}

.scamp-terminy__occupancy--free {
	color: var(--scamp-free);
}

.scamp-terminy__occupancy--limited {
	color: var(--scamp-limited);
}

.scamp-terminy__occupancy--full {
	color: var(--scamp-full);
}

.scamp-terminy__cta {
	grid-area: cta;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: var(--scamp-cta-padding);
	border: 0;
	border-radius: var(--scamp-cta-radius);
	background-image: linear-gradient(180deg, var(--scamp-cta-from) 0%, var(--scamp-cta-to) 99%);
	font-family: var(--scamp-font);
	font-size: var(--scamp-cta-size);
	font-style: italic;
	font-weight: 600;
	line-height: 1.7;
	text-align: center;
	text-transform: uppercase;
	transition: filter 0.3s ease;

	/* Divi's theme options set a global link colour and underline. */
	color: var(--scamp-cta-text) !important;
	text-decoration: none !important;
}

.scamp-terminy__cta:hover,
.scamp-terminy__cta:focus {
	filter: brightness(0.94);
	color: var(--scamp-cta-text) !important;
}

.scamp-terminy__cta:focus-visible {
	outline: 3px solid var(--scamp-text);
	outline-offset: 2px;
}

/* Screen-reader only context, so a page full of identical links stays usable. */
.scamp-terminy__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.scamp-terminy--inline {
	display: inline;
	font-size: inherit;
}

/* Tablet — two columns. */
@media (min-width: 768px) {
	.scamp-terminy__item {
		padding: var(--scamp-row-padding) 0;
		border-bottom: 1px solid var(--scamp-line);
		grid-template-columns: 1fr auto;
		grid-template-areas:
			"date  occ"
			"label cta";
	}

	.scamp-terminy__item:last-child {
		border-bottom: 0;
	}

	.scamp-terminy__cta {
		justify-self: end;
	}
}

/* Desktop — the four column row from the original table. */
@media (min-width: 981px) {
	.scamp-terminy__item {
		grid-template-columns: minmax(10rem, 0.9fr) minmax(8rem, 1fr) minmax(9rem, 0.9fr) auto;
		grid-template-areas: "date label occ cta";
	}
}

@media (prefers-reduced-motion: reduce) {
	.scamp-terminy__cta {
		transition: none;
	}
}
