/* =========================================================================
   Academia APAN — Single course page redesign
   Scoped to .single-course to avoid bleeding into other templates.
   ========================================================================= */

/* --- Page-title banner -------------------------------------------------
   Rebuilds the parent theme's .gdlr-page-title-wrapper into the curved
   teal banner from the mockup + the dark-navy decorative arc on the right.
   The title text inside <h1 class="gdlr-page-title"> is swapped to
   "Cursos da Academia APAN" by the PHP filter.
   --------------------------------------------------------------------- */

/* The banner IS the PNG — full width, natural aspect ratio, every screen.
   No solid-color fallback, no rectangles, no cropping. The teal color
   and navy curve come straight from the image file, so they always match
   the design 1:1.

   Trick: ::before uses the padding-bottom percentage hack to create a
   box whose height is width * (354/2560), guaranteeing the wrapper
   matches the image's aspect ratio in every browser. The title text
   sits on top via absolute positioning. */

body.single-course .gdlr-page-title-wrapper {
	background: transparent !important;
	background-image: none !important;
	position: relative !important;
	padding: 0 !important;
	margin: 0 !important;
	min-height: 0 !important;
	height: auto !important;
	width: 100% !important;
	overflow: hidden !important;
	line-height: 0;
}

body.single-course .gdlr-page-title-wrapper::before {
	content: "";
	display: block;
	width: 100%;
	/* 354 / 2560 = 13.828125% — preserves the PNG's native aspect ratio */
	padding-bottom: 13.828125%;
	background-image: url("https://staging.apan.pt/academia/wp-content/uploads/2026/04/g3594.png");
	background-repeat: no-repeat;
	background-position: center center;
	background-size: 100% 100%;
}

body.single-course .gdlr-page-title-overlay {
	display: none !important;
}

body.single-course .gdlr-page-title-container {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: auto !important;
	max-width: none !important;
	height: auto !important;
	padding: 0 20px !important;
	margin: 0 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	line-height: normal;
}

body.single-course .gdlr-page-title {
	color: #ffffff !important;
	font-family: "Poppins", sans-serif !important;
	/* Scales smoothly from ~12px on phones up to 34px on desktop, so the
	   text stays readable inside the short-aspect banner at any width. */
	font-size: clamp(12px, 2.6vw, 34px) !important;
	font-weight: 700 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	text-align: center !important;
	margin: 0 !important;
	padding: 0 !important;
	line-height: 1.2 !important;
	white-space: nowrap;
}

/* --- Course page wrapper ---------------------------------------------- */

.single-course .apan-course-page {
	font-family: "Poppins", sans-serif;
	color: #19335d;
	max-width: 960px;
	margin: 0 auto;
	padding: 0px 20px 60px;
}

/* --- Top section: two cards side-by-side ------------------------------- */

.single-course .apan-course-top {
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: 20px;
	align-items: stretch;
	margin-bottom: 40px;
}

.single-course .apan-course-card {
	background: #fff;
	border-radius: 14px;
	overflow: hidden;
}

.single-course .apan-course-card--main {
	border: 1.5px solid #cfd6e0;
	padding: 28px 32px;
	display: flex;
	flex-direction: column;
}

.single-course .apan-course-card--side {
	display: flex;
	flex-direction: column;
	border-radius: 14px;
	overflow: hidden;
}

/* Pill badge (ONLINE / PRESENCIAL / HÍBRIDO) */
.single-course .apan-pill {
	display: inline-block;
	background: #008a98;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.5px;
	padding: 6px 14px;
	border-radius: 6px;
	margin-bottom: 18px;
	align-self: flex-start;
}

/* Course title */
.single-course .apan-course-title {
	font-family: "Poppins", sans-serif;
	font-size: 28px;
	font-weight: 700;
	line-height: 1.2;
	color: #19335d;
	margin: 0 0 22px;
	text-transform: none;
	letter-spacing: 0;
}

/* Meta block (Data, Horário, Duração, Área) */
.single-course .apan-course-meta {
	margin-bottom: 24px;
}
.single-course .apan-course-meta p {
	margin: 0 0 6px;
	font-size: 15px;
	line-height: 1.6;
	color: #19335d;
}
.single-course .apan-meta-label {
	font-weight: 700;
	margin-right: 4px;
}

/* Action buttons */
.single-course .apan-course-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: auto;
}
.single-course .apan-btn {
	display: inline-block;
	padding: 12px 26px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	text-decoration: none;
	border: none;
	cursor: pointer;
	transition: background-color 0.2s ease;
	font-family: "Poppins", sans-serif;
	line-height: 1.2;
}
.single-course .apan-btn--primary {
	background: #008a98;
	color: #fff;
}
.single-course .apan-btn--primary:hover {
	background: #006d78;
	color: #fff;
}
.single-course .apan-btn--secondary {
	background: #19335d;
	color: #fff;
}
.single-course .apan-btn--secondary:hover {
	background: #0f2040;
	color: #fff;
}

/* --- Right card: instructor + prices ----------------------------------- */

.single-course .apan-course-formador {
	position: relative;
	flex: 1;
	min-height: 200px;
	overflow: hidden;
}
.single-course .apan-course-formador img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	min-height: 200px;
}
.single-course .apan-formador-info {
	position: absolute;
	left: 16px;
	bottom: 12px;
	background: rgba(255, 255, 255, 0.95);
	border-radius: 6px;
	padding: 6px 12px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}
.single-course .apan-formador-label {
	display: block;
	font-size: 11px;
	color: #19335d;
	font-weight: 400;
	line-height: 1.2;
}
.single-course .apan-formador-name {
	display: block;
	font-size: 13px;
	color: #19335d;
	font-weight: 700;
	line-height: 1.2;
}

/* Prices block */
.single-course .apan-course-prices {
	background: #19335d;
	color: #fff;
	padding: 20px 24px;
}
.single-course .apan-price-row {
	margin-bottom: 10px;
}
.single-course .apan-price-row:last-child {
	margin-bottom: 0;
}
.single-course .apan-price-label {
	display: block;
	font-size: 13px;
	font-weight: 400;
	color: #fff;
	margin-bottom: 2px;
	letter-spacing: 0.3px;
}
.single-course .apan-price-value {
	display: block;
	font-size: 22px;
	font-weight: 700;
	color: #fff;
	letter-spacing: 0.3px;
}
.single-course .apan-price-row--highlight .apan-price-label {
	color: #7ec9d1;
}

/* --- Description ------------------------------------------------------- */

.single-course .apan-course-description {
	margin-bottom: 40px;
	color: #19335d;
	font-size: 15px;
	line-height: 1.75;
}
.single-course .apan-course-description p {
	margin: 0 0 18px;
}
.single-course .apan-course-description .apan-destinatarios {
	margin-top: 8px;
}

/* --- PROGRAMA --------------------------------------------------------- */

.single-course .apan-course-programa {
	margin-bottom: 40px;
}
.single-course .apan-programa-title {
	font-size: 18px;
	font-weight: 700;
	color: #19335d;
	margin: 0 0 16px;
	letter-spacing: 0.3px;
	text-transform: uppercase;
}
.single-course .apan-programa-list {
	border: 1px solid #d6dbe4;
	border-radius: 8px;
	overflow: hidden;
}
.single-course .apan-programa-section {
	background: #19335d;
	color: #fff;
	padding: 10px 18px;
	font-weight: 700;
	font-size: 14px;
}
.single-course .apan-programa-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
	padding: 14px 18px;
	border-bottom: 1px solid #d6dbe4;
}
.single-course .apan-programa-row:last-child {
	border-bottom: none;
}
.single-course .apan-programa-row-title {
	color: #19335d;
	font-size: 15px;
	font-weight: 400;
}
.single-course .apan-programa-preview {
	color: #19335d;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}
.single-course .apan-programa-preview:hover {
	color: #008a98;
}

/* --- Política de cancelamento ---------------------------------------- */

.single-course .apan-course-politica {
	color: #19335d;
	font-size: 14px;
	line-height: 1.6;
}
.single-course .apan-course-politica p {
	margin: 0 0 6px;
}
.single-course .apan-politica-heading {
	font-weight: 700;
}

/* --- Hide the parent-theme page title text in the banner --------------- */
/* (We still want the teal banner, but not the course title inside it.
    The text itself is now replaced via the_title filter.) */

/* --- Responsive -------------------------------------------------------- */

@media (max-width: 900px) {
	.single-course .apan-course-top {
		grid-template-columns: 1fr;
	}
	.single-course .apan-course-card--side {
		flex-direction: column;
	}
	.single-course .apan-course-formador {
		min-height: 220px;
	}
}

@media (max-width: 600px) {
	.single-course .apan-course-page {
		padding: 24px 12px 40px;
	}
	.single-course .apan-course-card--main {
		padding: 22px 20px;
	}
	.single-course .apan-course-title {
		font-size: 24px;
	}
	.single-course .apan-course-actions {
		flex-direction: column;
	}
	.single-course .apan-btn {
		width: 100%;
		text-align: center;
	}
	.single-course .apan-programa-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}
}
