/**
 * TGF Booking Manager – public output.
 * Every rule is scoped to .tgfbm so Divi and the theme stay untouched.
 * Values mirror the original Divi modules of https://tgfhockey.de/ballschule/.
 */

.tgfbm {
	--tgfbm-green-dark: #153e34;
	--tgfbm-green: #1a6d5e;
	--tgfbm-red: #921828;
	--tgfbm-black: #000;
	--tgfbm-white: #fff;
	box-sizing: border-box;
}

.tgfbm *,
.tgfbm *::before,
.tgfbm *::after {
	box-sizing: inherit;
}

/* ---------- Ballschule ---------- */

.tgfbm-ballschule {
	width: 100%;
	color: var(--tgfbm-black);
	container-type: inline-size;
}

.tgfbm-ballschule .tgfbm-group + .tgfbm-group {
	margin-top: 4%;
}

.tgfbm-ballschule .tgfbm-group__header {
	background-color: var(--tgfbm-green);
	padding: 2.5% 0;
}

.tgfbm-ballschule .tgfbm-group__title,
.tgfbm-ballschule .tgfbm-group__subtitle {
	margin: 0 0 0 2%;
	padding: 0 0 10px;
	font-family: "Roboto", sans-serif;
	font-size: 26px;
	font-weight: 500;
	font-style: normal;
	line-height: 1em;
	color: var(--tgfbm-white);
	text-transform: none;
	letter-spacing: normal;
}

.tgfbm-ballschule .tgfbm-group__title {
	text-transform: uppercase;
}

/* Margin instead of padding: Divi resets the padding of the last paragraph (p:last-of-type). */
.tgfbm-ballschule .tgfbm-group__subtitle {
	margin-bottom: 10px;
	padding-bottom: 0;
}

.tgfbm-ballschule .tgfbm-courses {
	list-style: none;
	margin: 0;
	padding: 0;
}

.tgfbm-ballschule .tgfbm-course {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 5.5%;
	margin: 0;
	padding: 2.5% 0;
	border-top: 1px solid var(--tgfbm-black);
	list-style: none;
}

.tgfbm-ballschule .tgfbm-course:last-child {
	border-bottom: 1px solid var(--tgfbm-black);
}

/* Hexagon pattern on hover, same as the Divi row background pattern of the original page. */
.tgfbm-ballschule .tgfbm-course::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	background-position: 0 0;
	background-repeat: repeat;
	background-size: 56px auto;
	pointer-events: none;
}

.tgfbm-ballschule .tgfbm-course:hover::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2280%22 height=%22160%22 viewBox=%220 0 80 160%22 preserveAspectRatio=%22none%22 fill=%22rgba(0,0,0,0.12)%22%3E%3Cpath d=%22M41.12,40,53,16.28,60.62,1H80V0H58.88L40,37.76,21.12,0H0V1H19.38L27,16.28,38.88,40,19.38,79H0v2H19.38l19.5,39-19.5,39H0v1H21.12L40,122.24,58.88,160H80v-1H60.62l-19.5-39,19.5-39H80V79H60.62ZM40,117.76,21.12,80,40,42.24,58.88,80Z%22/%3E%3C/svg%3E");
}

.tgfbm-ballschule .tgfbm-course__name,
.tgfbm-ballschule .tgfbm-course__details {
	position: relative;
	z-index: 1;
	flex: 0 0 47.25%;
	min-width: 0;
}

.tgfbm-ballschule .tgfbm-course__title {
	margin: 0;
	padding: 0 0 10px;
	font-family: "Roboto", sans-serif;
	font-size: 40px;
	font-weight: 700;
	font-style: normal;
	line-height: 1.2em;
	text-transform: uppercase;
	color: var(--tgfbm-black);
	overflow-wrap: break-word;
	hyphens: manual;
}

/* Margin instead of padding: Divi resets the padding of the last paragraph (p:last-of-type). */
.tgfbm-ballschule .tgfbm-course__time {
	margin: 0 0 28px;
	margin-bottom: 2.75cqi; /* Divi module spacing: 2.75 % of the row width */
	padding: 0;
	font-family: "Roboto Condensed", sans-serif;
	font-size: 16px;
	line-height: 1.8em;
	color: var(--tgfbm-black);
}

.tgfbm-ballschule .tgfbm-course__action {
	margin: 0;
}

/* ---------- Button (Ballschule + Camps) ---------- */

.tgfbm .tgfbm-btn {
	position: relative;
	display: inline-block;
	max-width: 100%;
	margin: 0;
	padding: 0.3em 1em;
	border: 2px solid var(--tgfbm-green-dark);
	border-radius: 18px;
	background-color: var(--tgfbm-green-dark);
	color: var(--tgfbm-white);
	font-family: "Roboto Condensed", sans-serif;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.7em;
	letter-spacing: 2px;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	white-space: normal;
	overflow-wrap: anywhere;
	cursor: pointer;
	transition: color 300ms ease, background-color 300ms ease, border 300ms ease, padding 300ms ease;
}

.tgfbm a.tgfbm-btn::after {
	content: "&";
	position: absolute;
	margin-left: -1em;
	opacity: 0;
	font-family: ETmodules, sans-serif;
	font-weight: 400;
	letter-spacing: normal;
	line-height: inherit;
	transition: all 300ms ease;
}

.tgfbm a.tgfbm-btn:hover,
.tgfbm a.tgfbm-btn:focus-visible {
	padding: 0.3em 2em 0.3em 0.7em;
	border-color: var(--tgfbm-black);
	background-color: var(--tgfbm-black);
	color: var(--tgfbm-white);
	text-decoration: none;
}

.tgfbm a.tgfbm-btn:hover::after,
.tgfbm a.tgfbm-btn:focus-visible::after {
	margin-left: 0.3em;
	opacity: 1;
}

.tgfbm a.tgfbm-btn:focus-visible {
	outline: 3px solid var(--tgfbm-green);
	outline-offset: 2px;
}

.tgfbm .tgfbm-btn--closed {
	border-color: #8a8a8a;
	background-color: #8a8a8a;
	cursor: not-allowed;
}

.tgfbm .tgfbm-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Camp button ----------
   Mirrors the red Divi blurb "Anmeldung abgeschlossen" it replaces on the camp pages:
   full-width pill, centered content, 32px ETmodules icon, Roboto 18px like the theme h4.
   Scoped to .tgfbm-camp-button so the Ballschule buttons keep the Divi button look. */

.tgfbm-camp-button {
	margin: 0;
	text-align: center;
}

.tgfbm-camp-button .tgfbm-btn,
.tgfbm-camp-button a.tgfbm-btn:hover,
.tgfbm-camp-button a.tgfbm-btn:focus-visible {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 15px;
	width: 100%;
	padding: 8px 1.5em; /* + 2px border = 10px like the blurb */
	border-radius: 98px;
	font-family: "Roboto", sans-serif;
	font-size: 18px;
	font-weight: 500;
	line-height: 1.8em;
	letter-spacing: normal;
	text-transform: none;
}

.tgfbm-camp-button .tgfbm-btn--closed {
	border-color: var(--tgfbm-red);
	background-color: var(--tgfbm-red);
	color: var(--tgfbm-white);
	cursor: default;
}

.tgfbm-camp-button .tgfbm-btn--closed::before {
	content: "r";
	flex: 0 0 auto;
	font-family: ETmodules, sans-serif;
	font-size: 32px;
	font-weight: 400;
	line-height: 1;
}

/* No sliding arrow: it would shift the centered label. */
.tgfbm-camp-button a.tgfbm-btn::after {
	content: none;
}

/* ---------- Tablet (Divi breakpoint 980px): columns stack like Divi columns ---------- */

@media only screen and (max-width: 980px) {

	.tgfbm-ballschule .tgfbm-group__header,
	.tgfbm-ballschule .tgfbm-course {
		padding: 30px 0;
	}

	.tgfbm-ballschule .tgfbm-course {
		display: block;
	}

	.tgfbm-ballschule .tgfbm-course__name,
	.tgfbm-ballschule .tgfbm-course__time {
		margin-bottom: 30px;
	}

	.tgfbm-ballschule .tgfbm-course__title {
		font-size: 32px;
	}

	.tgfbm-ballschule .tgfbm-course__time {
		font-size: 15px;
	}
}

/* ---------- Phone (Divi breakpoint 767px) ---------- */

@media only screen and (max-width: 767px) {

	.tgfbm-ballschule .tgfbm-group__title,
	.tgfbm-ballschule .tgfbm-group__subtitle {
		font-size: 23px;
	}

	.tgfbm-ballschule .tgfbm-course__title {
		font-size: 20px;
	}

	.tgfbm-ballschule .tgfbm-course__time {
		font-size: 14px;
	}

	.tgfbm .tgfbm-btn {
		font-size: 12px;
	}

	.tgfbm-camp-button .tgfbm-btn,
	.tgfbm-camp-button a.tgfbm-btn:hover,
	.tgfbm-camp-button a.tgfbm-btn:focus-visible {
		font-size: 18px;
	}
}

/* Narrow containers on desktop (e.g. a Divi column narrower than the full row):
   keep long course names like "DIENSTAGSKURS 1" on whole words. Tablet and phone
   stack the columns and use the Divi sizes above instead. */
@media only screen and (min-width: 981px) {

	@container (max-width: 720px) {

		.tgfbm-ballschule .tgfbm-course__title {
			font-size: 28px;
		}
	}

	@container (max-width: 480px) {

		.tgfbm-ballschule .tgfbm-course__title {
			font-size: 20px;
		}
	}
}

@media (prefers-reduced-motion: reduce) {

	.tgfbm .tgfbm-btn,
	.tgfbm a.tgfbm-btn::after {
		transition: none;
	}
}
