/*
Theme Name: Blocksy Child
Template: blocksy
*/

/* ===== Ficha de proyecto ===== */

/* Ocultar el encabezado de Blocksy (título, autor, fecha) en los proyectos */
.single-proyecto .hero-section { display: none; }

/* Quitar el ancho máximo que WordPress impone al contenido */
.single-proyecto .entry-content > .bb-proyecto { max-width: none; }

/* Título y contador */
.bb-proyecto__titulo   { margin: 0; font-size: 1.6rem; }
.bb-proyecto__contador { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Columna de texto: descripción y detalles */
.bb-proyecto__texto { overflow-wrap: anywhere; }
.bb-proyecto__texto p:last-child { margin-bottom: 0; }
.bb-proyecto__detalles { margin-top: 2rem; }
.bb-proyecto__detalles p { margin: 0; }
.bb-proyecto__detalles a { color: inherit; text-decoration: underline; text-underline-offset: 0.2em; overflow-wrap: anywhere; }
.bb-proyecto__detalles a:hover { text-decoration: none; }

/* Tipología: sin etiqueta, en negrita y separada del resto */
.bb-proyecto__dato--tipologia { font-weight: 700; margin-bottom: 1em !important; }

.bb-proyecto__slide { margin: 0; }

/* Escritorio: imágenes a la izquierda (2/3), texto a la derecha (1/3), título abajo a la izquierda */
@media (min-width: 1000px) {
	.bb-proyecto {
		height: var(--bb-alto, calc(100svh - 200px)); /* el valor real lo calcula el JS */
		display: grid;
		grid-template-columns: 2fr 1fr;
		grid-template-rows: minmax(0, 1fr) auto;
		grid-template-areas:
			"imagenes info"
			"pie      info";
		column-gap: 3rem;
	}

	/* Tira horizontal: una imagen por pantalla, encaja en cada una */
	.bb-proyecto__imagenes {
		grid-area: imagenes;
		display: flex;
		overflow-x: auto;
		overflow-y: hidden;
		scroll-snap-type: x mandatory;
		overscroll-behavior-x: contain; /* evita el gesto de "atrás" del trackpad */
		scrollbar-width: none;
	}
	.bb-proyecto__imagenes::-webkit-scrollbar { display: none; }
	.bb-proyecto__slide {
		flex: 0 0 100%;
		height: 100%;
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 2rem 0;
		box-sizing: border-box;
		scroll-snap-align: center;
	}
	.bb-proyecto__slide img {
		max-height: 100%;
		max-width: 100%;
		width: auto;
		height: auto;
		object-fit: contain;
	}

	/* Título abajo a la izquierda, contador a la derecha de esa misma línea */
	.bb-proyecto__pie {
		grid-area: pie;
		display: flex;
		justify-content: space-between;
		align-items: baseline;
		gap: 2rem;
		padding: 1.5rem 0 2rem;
	}

	/* Columna de texto con scroll vertical propio si no cabe */
	.bb-proyecto__info {
		grid-area: info;
		min-height: 0;
		overflow-y: auto;
		overscroll-behavior: contain;
		scrollbar-width: thin;
		padding: 2rem 0.5rem 2rem 0;
	}
}

/* ===== Listado de proyectos [brubru_proyectos] ===== */

.entry-content > .bb-listado { max-width: none; }

.bb-listado {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 3rem 1.5rem; /* vertical / horizontal */
}
.bb-listado__item {
	display: block;
	color: inherit;
	text-decoration: none;
}
.bb-listado__img {
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #f2f2f2;
}
.bb-listado__img img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: opacity .2s;
}
.bb-listado__item:hover img { opacity: .85; }
.bb-listado__pie {
	display: block;
	margin-top: 1rem;
	font-size: 1.25rem;
}

@media (max-width: 999.98px) {
	.bb-listado { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 689.98px) {
	.bb-listado { grid-template-columns: 1fr; gap: 2rem; }
}

/* Móvil y tableta: título, texto e imágenes una debajo de otra */
@media (max-width: 999.98px) {
	.bb-proyecto { display: flex; flex-direction: column; }
	.bb-proyecto__pie  { order: -2; margin-bottom: 1.5rem; }
	.bb-proyecto__info { order: -1; margin-bottom: 2rem; }
	.bb-proyecto__contador { display: none; }
	.bb-proyecto__slide { margin-bottom: 1.5rem; }
	.bb-proyecto__slide img { width: 100%; height: auto; }
}