/* Galerías Rivera Valdés — quiet gallery typography over whatever theme is active. */

.rvg-wrap {
	--rvg-ink: #1a1815;
	--rvg-muted: #6b655d;
	--rvg-rule: rgba(26, 24, 21, .14);
	--rvg-paper: #faf8f5;
	--rvg-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;

	max-width: 1240px;
	margin: 0 auto;
	padding: 3rem 1.5rem 5rem;
	color: var(--rvg-ink);
}

/* ---------- Page heading ---------- */

.rvg-header {
	margin: 0 0 3.25rem;
	text-align: center;
}

.rvg-title {
	margin: 0;
	font-family: var(--rvg-serif);
	font-weight: 400;
	font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
	line-height: 1.1;
	letter-spacing: -0.01em;
}

.rvg-header::after {
	content: "";
	display: block;
	width: 54px;
	height: 1px;
	margin: 1.5rem auto 0;
	background: var(--rvg-ink);
	opacity: .35;
}

.rvg-kicker {
	display: block;
	margin-bottom: .85rem;
	font-size: .72rem;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--rvg-muted);
}

.rvg-intro {
	max-width: 58ch;
	margin: 1.5rem auto 0;
	font-size: 1.02rem;
	line-height: 1.7;
	color: var(--rvg-muted);
}

/* ---------- Grid of artworks (masonry, so tall and wide pieces both sit well) ---------- */

.rvg-grid {
	columns: 3;
	column-gap: 2.25rem;
}

.rvg-cols-1 { columns: 1; }
.rvg-cols-2 { columns: 2; }
.rvg-cols-4 { columns: 4; }

@media (max-width: 900px) { .rvg-grid, .rvg-cols-3, .rvg-cols-4 { columns: 2; column-gap: 1.5rem; } }
@media (max-width: 540px) { .rvg-grid, .rvg-cols-2, .rvg-cols-3, .rvg-cols-4 { columns: 1; } }

.rvg-item {
	break-inside: avoid;
	margin: 0 0 2.5rem;
}

.rvg-item__link {
	display: block;
	color: inherit;
	text-decoration: none;
	box-shadow: none;
}

.rvg-item__media {
	display: block;
	position: relative;
	overflow: hidden;
	background: var(--rvg-paper);
}

.rvg-item__media img {
	display: block;
	width: 100%;
	height: auto;
	transition: transform .7s cubic-bezier(.2, .7, .2, 1), filter .5s ease;
}

.rvg-item__link:hover .rvg-item__media img,
.rvg-item__link:focus-visible .rvg-item__media img {
	transform: scale(1.035);
	filter: brightness(1.04);
}

.rvg-item__media::after {
	content: "";
	position: absolute;
	inset: 0;
	box-shadow: inset 0 0 0 1px rgba(26, 24, 21, .08);
	pointer-events: none;
}

.rvg-item__media--empty { aspect-ratio: 3 / 4; }

.rvg-item__caption {
	display: block;
	margin-top: .9rem;
	font-family: var(--rvg-serif);
	font-size: 1.02rem;
	line-height: 1.35;
}

.rvg-item__link:hover .rvg-item__caption { text-decoration: underline; text-underline-offset: .18em; }

.rvg-item__note {
	display: block;
	margin-top: .3rem;
	font-size: .74rem;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--rvg-muted);
}

/* ---------- Category covers on the index ---------- */

.rvg-sections {
	display: grid;
	gap: 2.25rem;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.rvg-section {
	display: block;
	color: inherit;
	text-decoration: none;
	box-shadow: none;
}

.rvg-section__media {
	display: block;
	position: relative;
	overflow: hidden;
	aspect-ratio: 4 / 5;
	background: var(--rvg-paper);
}

.rvg-section__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
	transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}

.rvg-section:hover .rvg-section__media img { transform: scale(1.05); }

.rvg-section__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(12, 11, 10, .72) 0%, rgba(12, 11, 10, .22) 38%, rgba(12, 11, 10, 0) 65%);
}

.rvg-section__label {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1;
	padding: 1.5rem 1.4rem;
	color: #fff;
	text-shadow: 0 1px 12px rgba(0, 0, 0, .35);
}

.rvg-section__title {
	display: block;
	font-family: var(--rvg-serif);
	font-size: 1.5rem;
	line-height: 1.15;
}

.rvg-section__count {
	display: block;
	margin-top: .35rem;
	font-size: .72rem;
	letter-spacing: .16em;
	text-transform: uppercase;
	opacity: .85;
}

/* ---------- A single artwork ---------- */

.rvg-single { max-width: 1080px; }

.rvg-artwork__media {
	margin: 0 0 2.5rem;
	text-align: center;
}

.rvg-artwork__media img {
	display: inline-block;
	max-width: 100%;
	max-height: 78vh;
	width: auto;
	height: auto;
	box-shadow: 0 24px 60px -28px rgba(26, 24, 21, .55);
}

.rvg-artwork__content {
	max-width: 62ch;
	margin: 0 auto;
	font-size: 1.06rem;
	line-height: 1.75;
}

.rvg-artwork__content p:first-child::first-letter {
	float: left;
	margin: .06em .12em 0 0;
	font-family: var(--rvg-serif);
	font-size: 3.1em;
	line-height: .82;
}

.rvg-artwork__meta {
	max-width: 62ch;
	margin: 2.5rem auto 0;
	padding-top: 1.25rem;
	border-top: 1px solid var(--rvg-rule);
	font-size: .74rem;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--rvg-muted);
}

.rvg-artwork__meta a { color: inherit; }

/* ---------- Previous / next ---------- */

.rvg-adjacent {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.5rem;
	margin-top: 4rem;
	padding-top: 2rem;
	border-top: 1px solid var(--rvg-rule);
}

.rvg-adjacent__link {
	display: flex;
	align-items: center;
	gap: 1rem;
	color: inherit;
	text-decoration: none;
	box-shadow: none;
}

.rvg-adjacent__next { flex-direction: row-reverse; text-align: right; justify-content: flex-start; }
.rvg-adjacent > *:last-child:first-child { grid-column: 1; }

.rvg-adjacent__thumb {
	flex: 0 0 72px;
	width: 72px;
	height: 90px;
	overflow: hidden;
	background: var(--rvg-paper);
}

.rvg-adjacent__thumb img { width: 100%; height: 100%; object-fit: cover; }

.rvg-adjacent__dir {
	display: block;
	font-size: .68rem;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--rvg-muted);
}

.rvg-adjacent__title {
	display: block;
	margin-top: .25rem;
	font-family: var(--rvg-serif);
	font-size: 1rem;
	line-height: 1.3;
}

.rvg-adjacent__link:hover .rvg-adjacent__title { text-decoration: underline; text-underline-offset: .18em; }

@media (max-width: 600px) {
	.rvg-adjacent { grid-template-columns: 1fr; }
	.rvg-adjacent__next { flex-direction: row; text-align: left; }
}

/* ---------- Pagination ---------- */

.rvg-pagination {
	display: flex;
	justify-content: center;
	gap: .4rem;
	margin-top: 3.5rem;
	flex-wrap: wrap;
}

.rvg-pagination .page-numbers {
	min-width: 2.2rem;
	padding: .45rem .6rem;
	text-align: center;
	text-decoration: none;
	box-shadow: none;
	font-size: .9rem;
	color: var(--rvg-muted);
	border-bottom: 1px solid transparent;
}

.rvg-pagination .page-numbers:hover { color: var(--rvg-ink); }
.rvg-pagination .page-numbers.current { color: var(--rvg-ink); border-bottom-color: var(--rvg-ink); }

.rvg-empty {
	text-align: center;
	color: var(--rvg-muted);
	font-style: italic;
}

@media (max-width: 600px) {
	.rvg-wrap { padding: 2rem 1.1rem 3.5rem; }
	.rvg-header { margin-bottom: 2.25rem; }
	.rvg-item { margin-bottom: 2rem; }
	.rvg-sections { gap: 1.5rem; }
}

/* ---------- Blog strip under the gallery index ---------- */

.rvg-blog {
	margin-top: 5rem;
	padding-top: 2.5rem;
	border-top: 1px solid var(--rvg-rule);
}

.rvg-blog__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 2rem;
}

.rvg-blog__heading {
	margin: 0;
	font-family: var(--rvg-serif);
	font-weight: 400;
	font-size: clamp(1.35rem, 1.1rem + .8vw, 1.75rem);
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: none;
	color: var(--rvg-ink);
}

.rvg-blog__all {
	font-size: .85rem;
	color: var(--rvg-muted);
	text-decoration: none;
	box-shadow: none;
	white-space: nowrap;
}

.rvg-blog__all:hover { color: var(--rvg-ink); text-decoration: underline; text-underline-offset: .2em; }

.rvg-blog__list {
	display: grid;
	gap: 2.5rem;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.rvg-post {
	display: block;
	padding-top: 1.25rem;
	border-top: 1px solid var(--rvg-rule);
	color: inherit;
	text-decoration: none;
	box-shadow: none;
}

.rvg-post__media {
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 10;
	margin-bottom: 1rem;
	background: var(--rvg-paper);
}

.rvg-post__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .7s cubic-bezier(.2, .7, .2, 1);
}

.rvg-post:hover .rvg-post__media img { transform: scale(1.04); }

.rvg-post__date {
	display: block;
	font-size: .7rem;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--rvg-muted);
}

.rvg-post__title {
	display: block;
	margin-top: .5rem;
	font-family: var(--rvg-serif);
	font-size: 1.3rem;
	line-height: 1.28;
}

.rvg-post:hover .rvg-post__title { text-decoration: underline; text-underline-offset: .18em; }

.rvg-post__excerpt {
	display: block;
	margin-top: .6rem;
	font-size: .94rem;
	line-height: 1.6;
	color: var(--rvg-muted);
}

@media (max-width: 600px) {
	.rvg-blog { margin-top: 3rem; }
	.rvg-blog__list { gap: 1.75rem; }
	.rvg-post__title { font-size: 1.15rem; }
}
