/* ============================================================
   Galería virreinal - estilos (versión modernizada)
   Para cambiar el aspecto general, edita las variables de :root
   ============================================================ */

:root {
	--fondo: #161a20;
	--superficie: #1f252d;
	--borde: rgba(255, 255, 255, .12);
	--texto: #f3efe8;
	--texto-suave: rgba(243, 239, 232, .6);
	--acento: #d4a94f;          /* dorado */
	--acento-oscuro: #1a1408;   /* texto sobre fondo dorado */
	--radio: 14px;
	--sombra: 0 10px 30px rgba(0, 0, 0, .35);
	--fuente-titulos: 'Slabo 27px', Georgia, serif;
	--fuente-texto: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* {
	margin: 0;
	padding: 0;
	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	font-size: 16px;
	line-height: 1.5;
	font-family: var(--fuente-texto);
	background: radial-gradient(ellipse at top, #222a34 0%, var(--fondo) 55%) fixed;
	background-color: var(--fondo);
	color: var(--texto);
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--fuente-titulos);
	font-weight: normal;
}

a {
	text-decoration: none;
	color: var(--texto);
	-webkit-transition: color .2s ease, border-color .2s ease, background-color .2s ease;
	transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}

a:hover {
	text-decoration: none;
	color: var(--acento);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
	outline: 2px solid var(--acento);
	outline-offset: 3px;
}

.contenedor {
	max-width: 1300px;
	width: 95%;
	margin: auto;
}

.izquierda {
	float: left;
}

.derecha {
	float: right;
}

/* --- Header --- */

header {
	margin: 56px 0 44px;
	text-align: center;
}

header h1,
header .titulo {
	font-size: clamp(1.7rem, 4.2vw, 2.8rem);
	line-height: 1.2;
	letter-spacing: .01em;
	text-wrap: balance;
}

/* Pequeño adorno dorado bajo el título */
header h1::after,
header .titulo::after {
	content: "";
	display: block;
	width: 64px;
	height: 3px;
	margin: 18px auto 0;
	border-radius: 3px;
	background: var(--acento);
}

/* --- FOTOS (galería) --- */

.fotos .contenedor {
	display: block;
}

.fotos .row {
	margin-left: 0;
	margin-right: 0;
}

.fotos .card-columns {
	width: 100%;
	min-width: 0;
}

/* Grid adaptable: tantas columnas como quepan, de al menos 280px cada una */
.card-columns {
	-webkit-column-count: auto;
	-moz-column-count: auto;
	column-count: auto;
	-webkit-column-width: 280px;
	-moz-column-width: 280px;
	column-width: 280px;
	-webkit-column-gap: 24px;
	-moz-column-gap: 24px;
	column-gap: 24px;
}

.card-columns .card.thumb {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	min-width: 0;
	margin-bottom: 24px;
	border: 0;
	border-radius: var(--radio);
	background: var(--superficie);
	-webkit-box-shadow: var(--sombra);
	box-shadow: var(--sombra);
	-webkit-transition: transform .35s ease, box-shadow .35s ease;
	transition: transform .35s ease, box-shadow .35s ease;
}

.thumb:hover {
	-webkit-transform: translateY(-4px);
	transform: translateY(-4px);
	-webkit-box-shadow: 0 18px 40px rgba(0, 0, 0, .5);
	box-shadow: 0 18px 40px rgba(0, 0, 0, .5);
}

.thumb a {
	display: block;
	overflow: hidden;
}

.thumb img {
	display: block;
	vertical-align: top;
	width: 100%;
	height: auto;
	background: var(--superficie);
	-webkit-transition: transform .6s ease;
	transition: transform .6s ease;
}

.thumb:hover img {
	-webkit-transform: scale(1.05);
	transform: scale(1.05);
}

/* El título se superpone sobre la parte inferior de la foto */
.card-body {
	min-width: 0;
	background: transparent;
}

.thumb .card-body {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 48px 18px 16px;
	background: linear-gradient(to top, rgba(10, 12, 16, .92) 0%, rgba(10, 12, 16, .6) 55%, rgba(10, 12, 16, 0) 100%);
	pointer-events: none;   /* el clic llega a la foto */
}

.card-title {
	margin: 0;
	text-align: left;
	font-family: var(--fuente-texto);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.35;
	color: var(--texto);
	text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
	overflow-wrap: anywhere;
	word-break: break-word;
}

/* --- Foto individual --- */

.fa-times-circle {
	position: fixed;
	top: 18px;
	right: 22px;
	margin: 0;
	z-index: 10;
	opacity: .85;
	-webkit-filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .6));
	filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .6));
	-webkit-transition: opacity .2s ease, transform .2s ease;
	transition: opacity .2s ease, transform .2s ease;
}

.fa-times-circle:hover {
	opacity: 1;
	-webkit-transform: scale(1.08);
	transform: scale(1.08);
}

.foto {
	width: 100%;
	margin: auto;
	max-width: 900px;
	min-width: 0;
	text-align: center;
}

.foto img {
	display: block;
	width: 100%;
	height: auto;
	vertical-align: top;
	margin-bottom: 32px;
	border-radius: var(--radio);
	-webkit-box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
	box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
}

.foto .texto {
	max-width: 70ch;
	margin: 0 auto 36px;
	font-size: 1.1rem;
	line-height: 1.75;
	color: var(--texto-suave);
	text-align: left;
}

.regresar {
	display: inline-block;
	padding: 10px 22px;
	margin-bottom: 36px;
	border-radius: 50px;
	font-size: 16px;
	border: 1px solid var(--borde);
}

.regresar:hover {
	border-color: var(--acento);
	color: var(--acento);
}

.regresar .fa {
	margin-right: 12px;
}

/* --- Footer --- */

footer {
	margin-top: 20px;
	border-top: 1px solid var(--borde);
}

footer .copyright {
	text-align: center;
	color: var(--texto-suave);
	font-size: 14px;
	padding: 24px 0;
}

/* --- Paginación --- */

.paginacion {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	width: 100%;
	margin: 10px 0 40px;
}

.paginacion .derecha {
	margin-left: auto;
}

.paginacion a {
	display: inline-block;
	padding: 12px 24px;
	border-radius: 50px;
	border: 1px solid var(--borde);
}

.paginacion a:hover {
	background: var(--acento);
	border-color: var(--acento);
	color: var(--acento-oscuro);
}

.paginacion .izquierda .fa {
	margin-right: 10px;
}

.paginacion .derecha .fa {
	margin-left: 10px;
}

/* --- Formularios (subir foto) --- */

.formulario {
	max-width: 520px;
	width: 90%;
	margin: auto;
	margin-bottom: 40px;
	padding: 28px;
	border: 1px solid var(--borde);
	border-radius: var(--radio);
	background: rgba(255, 255, 255, .03);
}

.formulario label {
	display: block;
	margin-bottom: 8px;
	color: var(--texto-suave);
	font-size: 14px;
	letter-spacing: .03em;
}

.formulario .error {
	border: 1px solid #e06a6a;
	border-radius: 10px;
	color: #f2aaaa;
	padding: 16px 20px;
	margin-bottom: 24px;
}

.formulario input[type="text"],
.formulario input[type="file"],
.formulario textarea {
	width: 100%;
	margin-bottom: 24px;
	color: var(--texto);
	font-family: var(--fuente-texto);
	font-size: 16px;
}

.formulario input[type="text"],
.formulario textarea {
	padding: 12px 14px;
	background: rgba(255, 255, 255, .04);
	border: 1px solid var(--borde);
	border-radius: 10px;
}

.formulario textarea {
	min-height: 96px;
	max-height: 220px;
	max-width: 100%;
	min-width: 100%;
}

.formulario input[type="text"]:focus,
.formulario textarea:focus {
	border-color: var(--acento);
	outline: none;
	-webkit-box-shadow: 0 0 0 3px rgba(212, 169, 79, .2);
	box-shadow: 0 0 0 3px rgba(212, 169, 79, .2);
}

.formulario .submit {
	display: inline-block;
	text-align: center;
	color: var(--acento-oscuro);
	font-family: var(--fuente-texto);
	font-size: 16px;
	font-weight: 600;
	padding: 12px 28px;
	border-radius: 50px;
	border: 1px solid var(--acento);
	background: var(--acento);
	cursor: pointer;
	-webkit-transition: filter .2s ease, transform .2s ease;
	transition: filter .2s ease, transform .2s ease;
}

.formulario .submit:hover {
	-webkit-filter: brightness(1.1);
	filter: brightness(1.1);
	-webkit-transform: translateY(-1px);
	transform: translateY(-1px);
}

/* --- Accesibilidad: sin animaciones si el usuario lo prefiere --- */

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		-webkit-transition: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}
	.thumb:hover,
	.thumb:hover img {
		-webkit-transform: none;
		transform: none;
	}
}
