/* Noticias: listado (home.php) y detalle (single.php). */

/* Cards in the blog use squarer photos than the home page */
.blog .news-card__media,
.espacio--noticias .news-card__media { aspect-ratio: 33 / 34; }

.blog .news-card__title,
.espacio--noticias .news-card__title {
	font-weight: 400;
	/* 22px a 1440, medido en BLOG.png */
	font-size: clamp(18px, 1.53vw, 26px);
	letter-spacing: -0.02em;
	line-height: 1.15;
	margin-bottom: 14px;
}

.blog .news-card__excerpt,
.espacio--noticias .news-card__excerpt {
	font-size: clamp(15px, 1.042vw, 20px);
	line-height: 1.2;
	margin-bottom: 20px;
}

.noticia__date {
	display: flex;
	align-items: center;
	gap: 6px;
	font-family: var(--font-mono);
	font-size: clamp(13px, 0.903vw, 17.3px);
	color: var(--c-dark);
}

/* --- Listado ------------------------------------------------------------- */

.blog__title {
	padding: clamp(24px, 2.6vw, 40px) var(--edge) clamp(28px, 3vw, 44px);
}

/* Four columns divided by hairlines; rows just breathe */
.blog__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	row-gap: clamp(32px, 3vw, 44px);
	/* the items carry the gutter themselves; the grid only adds what centres it */
	padding: 0 calc(var(--edge) - var(--gutter));
}

.blog__item {
	padding: 0 var(--gutter);
	border-left: 1px solid rgba(27, 27, 26, 0.15);
}

.blog__item:nth-child(4n + 1) { border-left: 0; }

.blog__more { padding-top: clamp(36px, 4vw, 56px); }

.blog__empty {
	padding: 64px var(--edge);
	font-weight: 300;
}

/* --- Detalle ------------------------------------------------------------- */

/* Dos columnas: a la izquierda la noticia entera, a la derecha la foto de
   portada, que se queda fija mientras la columna de texto pasa. */
.noticia__hero {
	display: grid;
	grid-template-columns: 1fr 1fr;
	/* sin esto la foto se estira al alto de la columna y no tiene dónde fijarse */
	align-items: start;
	gap: 10px;
	padding-right: 0;
}

.noticia__hero-text {
	display: flex;
	flex-direction: column;
}

.noticia__intro {
	flex: 1 1 auto;
	padding: clamp(24px, 2.6vw, 36px) var(--gutter) clamp(24px, 2.6vw, 36px) var(--edge);
}

.noticia__title {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: clamp(28px, 2.8vw, 40px);
	letter-spacing: -0.03em;
	line-height: 1.05;
	margin-bottom: 28px;
}

.noticia__lead {
	max-width: 520px;
	font-size: clamp(16px, 1.111vw, 21.3px);
	line-height: 1.3;
	margin-bottom: 28px;
}

.noticia__lead p + p { margin-top: 1em; }

/* Featured photo on the right runs the full block height; the optional
   second photo fills what the intro leaves free on the left */
.noticia__hero-media,
.noticia__hero-secondary {
	margin: 0;
	background: var(--c-cream-light);
}

.noticia__hero-media {
	position: sticky;
	top: 0;
	height: 100vh;
	height: 100dvh;
}

.noticia__hero-secondary { aspect-ratio: 715 / 480; }

.noticia__hero-media img,
.noticia__hero-secondary img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.noticia__body {
	padding: 0 0 clamp(32px, 4vw, 56px);
}

.noticia__content {
	padding: clamp(24px, 2.6vw, 36px) var(--gutter) 0 var(--edge);
	font-size: clamp(15px, 1.042vw, 20px);
	line-height: 1.35;
}

.noticia__content > * { max-width: 520px; }

.noticia__content h2,
.noticia__content h3 {
	font-family: var(--font-display);
	font-weight: 700;
	font-size: clamp(22px, 2.2vw, 30px);
	letter-spacing: -0.03em;
	line-height: 1.05;
	margin: 0 0 20px;
}

.noticia__content p { margin: 0 0 1em; }

.noticia__content a { text-decoration: underline; }

.noticia__content strong a { font-weight: 700; }

/* Photos in the body run edge to edge of the column */
.noticia__content figure,
.noticia__content img,
.noticia__content .wp-block-image {
	max-width: none;
	margin: 28px -22px 40px;
}

.noticia__content figure img,
.noticia__content .wp-block-image img {
	width: 100%;
	margin: 0;
}

.noticia__share {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 18px;
	padding: clamp(32px, 4vw, 56px) var(--edge) 28px;
	font-family: var(--font-mono);
	font-size: clamp(13px, 0.903vw, 17.3px);
}

.noticia__share span { margin-right: 6px; }

.noticia__share svg {
	width: 18px;
	height: 18px;
	display: block;
}

.noticia__nav {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	margin: 0 22px;
	padding: 16px 0;
	border-top: 1px solid rgba(27, 27, 26, 0.15);
	border-bottom: 1px solid rgba(27, 27, 26, 0.15);
	font-weight: 700;
	font-size: clamp(15px, 1.042vw, 20px);
	letter-spacing: -0.02em;
}

/* Recent posts: same track as "Productos en espacio", four cards per view */
.espacio--noticias .espacio__item {
	flex-basis: calc(25% - 7.5px);
	background: none;
}

.espacio--noticias .espacio__item + .espacio__item {
	border-left: 1px solid rgba(27, 27, 26, 0.15);
	padding-left: 10px;
}

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

@media (max-width: 1100px) {
	.blog__grid { grid-template-columns: repeat(2, 1fr); }
	.blog__item:nth-child(4n + 1) { border-left: 1px solid rgba(27, 27, 26, 0.15); }
	.blog__item:nth-child(2n + 1) { border-left: 0; }
	.espacio--noticias .espacio__item { flex-basis: calc(50% - 5px); }
}

@media (max-width: 900px) {
	.noticia__hero { grid-template-columns: 1fr; }
	.noticia__hero-media {
		position: static;
		order: -1;
		height: auto;
		aspect-ratio: 4 / 3;
	}
}

@media (max-width: 600px) {
	.blog__grid { grid-template-columns: 1fr; }
	.blog__item { border-left: 0; }
	.espacio--noticias .espacio__item { flex-basis: 80%; }
}
