/**
 * Estilos para la galería de imágenes con medidas de seguridad
 * Versión: 2.0
 * Fecha: 2025-06-30
 */

/* Reseteo seguro */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Variables CSS para fácil mantenimiento */
:root {
    --color-background: #333333;
    --color-text: #ffffff;
    --color-primary: #4a90e2;
    --color-secondary: #50b7f5;
    --color-accent: #f48024;
    --color-error: #e74c3c;
    --color-success: #2ecc71;
    --font-main: 'Arial', sans-serif;
    --shadow-normal: 0 2px 5px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.3);
    --transition-speed: 0.3s;
}

/* Estilos generales */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-background);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* Prevenir desbordamiento horizontal */
    padding-top: 10px; /* Espacio para el menú fijo */
}

/* Menú fijo y colofón */
.fixed-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: auto;
    background-color: transparent;
    z-index: 1000;
}

.menu-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    position: relative;
    text-align: right;
}

.colophon-toggle {
    background: none;
    border: none;
    color: #fff;
    font-size: 0.7rem;
    padding: 10px 15px 0 0;
    margin-right: 0;
    cursor: pointer;
    text-transform: lowercase;
    letter-spacing: 1px;
    font-weight: 300;
    transition: color 0.3s ease;
    text-align: right;
}

.colophon-toggle:hover {
    color: var(--color-accent);
}

.colophon-content {
    overflow: hidden;
    max-height: 0;
    background-color: transparent;
    padding: 0;
    position: absolute;
    top: 100%;
    right: 0;
    width: auto;
    min-width: 180px;
    text-align: right;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
}

.colophon-content.active {
    max-height: 200px;
    padding: 0;
    opacity: 1;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-15px); }
    to { opacity: 1; transform: translateY(0); }
}

.colophon-content p {
    margin: 0;
    padding: 0 1rem;
    font-size: 0.7rem;
    color: #fff;
    text-align: right;
}

.colophon-photos {
    font-style: italic;
    padding-bottom: 0.8rem;
}

/* Enlace flotante de administrador */
.admin-link-floating {
    position: fixed;
    bottom: 20px;
    right: 20px;
    color: #666;
    text-decoration: none;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid #444;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    opacity: 0.5;
    transition: opacity var(--transition-speed) ease;
    z-index: 100;
}

.admin-link-floating:hover {
    opacity: 1;
    color: var(--color-text);
    background-color: rgba(0, 0, 0, 0.8);
}

/* Contenedor principal */
.gallery-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    flex-grow: 1;
}

/* Estilos de la galería */
.gallery {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
    width: 100%;
}

/* Mensajes de estado */
.loading-message {
    text-align: center;
    padding: 2rem;
    font-size: 1.2rem;
    color: var(--color-secondary);
}

.error-message {
    text-align: center;
    padding: 1.5rem;
    margin: 1rem 0;
    background-color: rgba(231, 76, 60, 0.2);
    border-left: 4px solid var(--color-error);
    color: var(--color-error);
    border-radius: 4px;
}

.no-images-message {
    text-align: center;
    padding: 2rem;
    color: var(--color-text);
    font-style: italic;
}

/* Elemento de la galería */
.gallery-item {
    width: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-normal);
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.2);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 10s ease;
    max-width: 100vw;
    object-fit: contain;
}

.gallery-item:hover img {
    transform: scale(1.01);
}



/* Estilos responsive */
@media (max-width: 768px) {
    .admin-link-floating {
        padding: 4px 8px;
        font-size: 11px;
        bottom: 10px;
        right: 10px;
    }
}

/* Estilos para el modal de imagen */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}
