/* =========================================================
   ESTILOS BASE Y LAYOUT (CONSOLIDADO DE estilof.css)
   ========================================================= */

body { 
    /* Estilos base: priorizando los de la sección de galería */
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
    color: #444340; /* Heredado del primer bloque de estilof.css */
}

h1 { 
    /* Título general (Estilo de la galería) */
    color: #333;
    text-align: center;
    margin-bottom: 30px;
}

img { 
    border: none; 
}

a { 
    color: #444340; 
}

#Header { 
    /* Estilo del Header (del primer bloque de estilof.css) */
    background: #EEBF02; 
    height: 61px; 
    padding: 0; 
    border-bottom: 1px solid #3c3c3c;  
}

#Header img { 
    display: block; 
    margin: 0 auto 0; 
}

#MainContent { 
    /* Estilo del MainContent (Estilo de la galería) */
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.page-content h1 {
    /* Estilo de título dentro del contenido */
    color: #333;
    text-align: center;
    margin-bottom: 30px;
}

#Footer { 
    /* Estilo del Footer (Estilo de la galería) */
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #666;
    border-top: 1px solid #ddd;
} 

#SocialLinks { 
    padding: 10px 0 0 0; 
}

#SocialLinks:after { 
    clear: both; 
    content: "."; 
    display: block; 
    height: 0; 
    visibility: hidden; 
}

#SocialLinks a { 
    display: block; 
    float: left; 
    padding-right: 15px; 
}

/* =========================================================
   ESTILOS DE LA GALERÍA
   ========================================================= */

.gallery-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

div.gallery-row:after { 
    /* Manteniendo el clearfix antiguo si se necesita, aunque flexbox lo hace obsoleto */
    clear: both; 
    content: "."; 
    display: block; 
    height: 0; 
    visibility: hidden; 
}

.gallery-item {
    float: left; /* Mantenido para compatibilidad, aunque flex: 0 0... es el dominante */
    flex: 0 0 calc(33.333% - 15px);
    max-width: 300px;
}

.gallery-item a {
    display: block;
    text-decoration: none;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    border: 1px solid #3c3c3c; /* Heredado del primer bloque de estilof.css */
}

.gallery-item a:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* =========================================================
   ESTILOS PHOTOSWIPE (Consolidado de photo.css)
   ========================================================= */

body.ps-active 
{
	-webkit-text-size-adjust: none;
	overflow: hidden;
}
body.ps-active * { 
	-webkit-tap-highlight-color:  rgba(255, 255, 255, 0); 
}
body.ps-active *:focus 
{ 
	outline: 0; 
}

/* Document overlay */
div.ps-document-overlay 
{
	background: #000;
	position: fixed;
	width: 100%;
	height: 100%;
	left: 0;
	top: 0;
	z-index: 15000;
}

/* Viewport - Z-INDEX ALTO para capturar el clic (toggle UI) */
div.ps-viewport 
{
	background: #000;
	cursor: pointer;
	position: fixed;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	z-index: 17000; /* Alto para capturar el clic de toggle */
	overflow: hidden;
}

/* Zoom/pan/rotate layer - FONDO TRANSPARENTE */
div.ps-zoom-pan-rotate{
	background: transparent;
	position: fixed;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	z-index: 15002;
}

/* Slider */
div.ps-slider-item-loading 
{ 
	position: relative;
}
div.ps-slider-item-loading:after {
	content: "🔄";
	font-size: 32px;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	color: white;
}

/* Caption - CORRECCIÓN DE ALTURA Y EVENTOS */
div.ps-caption
{ 
	background: rgba(0, 0, 0, 0.8);
	color: #ffffff;
	font-size: 13px;
	font-family: "Lucida Grande", Helvetica, Arial, Verdana, sans-serif;
	text-align: center;
	position: fixed;
	left: 0;
	width: 100%;
    top: 0; 
    bottom: auto; 
	z-index: 16000; 
    pointer-events: none;
    height: auto; 
    min-height: 44px; 
}

div.ps-caption-bottom
{ 
    top: auto;
	bottom: 44px; 
    min-height: 0; 
}

div.ps-caption-content
{
	padding: 13px;
}

/* Toolbar - EVENTOS Y POSICIÓN */
div.ps-toolbar
{ 
	background: rgba(0, 0, 0, 0.8);
	color: #ffffff;
	font-size: 13px;
	font-family: "Lucida Grande", Helvetica, Arial, Verdana, sans-serif;
	text-align: center;
	height: 44px;
	display: table;
	table-layout: fixed;
	position: fixed;
	left: 0;
	width: 100%;
	bottom: 0; 
	z-index: 16001; 
    pointer-events: none;
}

div.ps-toolbar-top 
{
	top: 0;
	bottom: auto;
}

/* Iconos y Botones - REACTIVAR POINTER-EVENTS */
div.ps-toolbar-close, div.ps-toolbar-previous, div.ps-toolbar-next, div.ps-toolbar-play
{
	cursor: pointer;
	display: table-cell;
	position: relative;
	width: 25%;
    pointer-events: auto; /* Reactiva el clic solo en los botones del menú */
}

div.ps-toolbar div div.ps-toolbar-content
{
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	font-weight: bold;
	margin: 0 auto;
}

/* Iconos de texto */
div.ps-toolbar-close div.ps-toolbar-content:before { 
	content: "✕"; 
}

div.ps-toolbar-previous div.ps-toolbar-content:before { 
	content: "‹"; 
}

div.ps-toolbar-next div.ps-toolbar-content:before { 
	content: "›"; 
}

div.ps-toolbar-play div.ps-toolbar-content:before { 
	content: "▶";
}

/* Estados hover */
div.ps-toolbar-close div.ps-toolbar-content:hover, 
div.ps-toolbar-previous div.ps-toolbar-content:hover, 
div.ps-toolbar-next div.ps-toolbar-content:hover, 
div.ps-toolbar-play div.ps-toolbar-content:hover {
	background-color: rgba(255, 255, 255, 0.2);
	border-radius: 4px;
}

/* Estados deshabilitados */
div.ps-toolbar-previous-disabled, 
div.ps-toolbar-next-disabled {
	opacity: 0.3;
	cursor: default;
    pointer-events: none;
}

div.ps-toolbar-previous-disabled div.ps-toolbar-content:hover,
div.ps-toolbar-next-disabled div.ps-toolbar-content:hover {
	background-color: transparent;
}

/* =========================================================
   MEDIA QUERIES (CONSOLIDADO)
   ========================================================= */

@media (max-width: 768px) {
    .gallery-item {
        flex: 0 0 calc(50% - 15px);
    }
}

@media (max-width: 480px) {
    .gallery-item {
        flex: 0 0 100%;
    }
}