/* ──────────────────────────────────────────────────────────────────────
   Ficha pública de un curso (Frontend\CourseSingleLayout) — estilo "ficha
   de producto": imagen a la izquierda, título + contenido + inscripción a
   la derecha en escritorio; imagen arriba y todo apilado debajo en tablet/
   móvil. Se apoya en la estructura que ya genera single.php de Divi
   (article.et_pb_post > .et_post_meta_wrapper [h1.entry-title, p.post-meta,
   img] + .entry-content) sin tocar ningún fichero del tema: solo CSS,
   reordenando visualmente con flexbox (móvil) y grid (escritorio).
   ────────────────────────────────────────────────────────────────────── */

body.single-rw_course #main-content .container {
	max-width: 1300px;
}

body.single-rw_course #left-area {
	padding-bottom: 60px;
}

/* Móvil/tablet (por defecto): imagen, luego título, luego datos de autor/
   fecha — el pedido real en el DOM es título/meta/imagen, así que se
   reordena visualmente con flexbox sin tocar el HTML. */
body.single-rw_course article.et_pb_post > .et_post_meta_wrapper {
	display: flex;
	flex-direction: column;
}

body.single-rw_course article.et_pb_post > .et_post_meta_wrapper > img {
	order: 1;
	width: 100%;
	height: auto;
	margin: 0 0 20px;
	border-radius: 12px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
	cursor: zoom-in;
}

body.single-rw_course article.et_pb_post > .et_post_meta_wrapper > .entry-title {
	order: 2;
}

body.single-rw_course article.et_pb_post > .et_post_meta_wrapper > .post-meta {
	order: 3;
}

body.single-rw_course .entry-title {
	font-family: "Poppins", "Open Sans", Arial, sans-serif;
	font-size: 34px;
	font-weight: 700;
	line-height: 1.15;
	color: #1a1a1a;
	margin-top: 0;
}

/* Escritorio: dos columnas reales vía CSS Grid. `display: contents` en el
   wrapper lo "deshace" como caja, así que sus hijos (título, meta, imagen)
   pasan a colocarse como items directos de <article> junto a
   .entry-content, cada uno con su propia posición de rejilla — sin mover
   nada en el HTML. */
@media (min-width: 981px) {
	body.single-rw_course article.et_pb_post {
		display: grid;
		grid-template-columns: minmax(280px, 400px) 1fr;
		column-gap: 60px;
		align-items: start;
	}

	body.single-rw_course article.et_pb_post > .et_post_meta_wrapper {
		display: contents;
	}

	body.single-rw_course article.et_pb_post > .et_post_meta_wrapper > img {
		grid-column: 1;
		grid-row: 1 / span 3;
		margin: 0;
		/* Sticky solo tiene efecto mientras la columna de la derecha (título +
		   contenido + inscripción, más alta que la imagen) sigue haciendo
		   scroll — se detiene sola al llegar al final de esa columna, ya que
		   ambas comparten la misma fila de rejilla (1 / span 3). El offset
		   deja hueco para la cabecera de Divi, que se queda fija al hacer
		   scroll hacia abajo (98px es una estimación prudente de su altura
		   compacta; ajustar aquí si no coincide en producción). */
		position: sticky;
		top: 98px;
	}

	body.single-rw_course article.et_pb_post > .et_post_meta_wrapper > .entry-title {
		grid-column: 2;
		grid-row: 1;
	}

	body.single-rw_course article.et_pb_post > .et_post_meta_wrapper > .post-meta {
		grid-column: 2;
		grid-row: 2;
	}

	body.single-rw_course article.et_pb_post > .entry-content {
		grid-column: 2;
		grid-row: 3;
	}

	body.single-rw_course .entry-title {
		font-size: 44px;
	}
}

/* ── Modal de imagen ampliada (Frontend\CourseSingleLayout, assets/js/rwCourseSingle.js) ── */

.rw-cb-image-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px;
	background: rgba(0, 0, 0, 0.85);
}

.rw-cb-image-modal[hidden] {
	display: none;
}

.rw-cb-image-modal__img {
	max-width: 100%;
	max-height: 100%;
	border-radius: 8px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.rw-cb-image-modal__close {
	position: absolute;
	top: 20px;
	right: 24px;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease;
}

.rw-cb-image-modal__close:hover {
	background: rgba(255, 255, 255, 0.3);
}
