.foto-header {
    text-align: center;
    padding: 60px 20px 20px;
    position: relative;
    z-index: 2;
}

.foto-header h1 {
    font-size: 3.2rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 15px;
    letter-spacing: -1px;
}

.foto-header p {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

.foto-header i.header-icon {
    font-size: 3.5rem;
    color: #FF9500;
    margin-bottom: 20px;
    display: inline-block;
    filter: drop-shadow(0 10px 15px rgba(255, 149, 0, 0.3));
}

/* --- CONTROLES DE VISTA --- */
.view-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    position: relative;
    z-index: 2;
}

.btn-view {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 10px 25px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--glass-shine);
}

.btn-view:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-view.active {
    background: #FF9500;
    color: white;
    border-color: #FF9500;
    box-shadow: 0 5px 15px rgba(255, 149, 0, 0.4);
}

/* --- VISTA GALERÍA (MASONRY) --- */
.galeria-masonry {
    column-count: 4;
    column-gap: 25px;
    max-width: 100%;
    margin: 0 auto 80px;
    padding: 0 30px;
    display: block; /* Activa por defecto */
}

/* --- VISTA LÍNEA DEL TIEMPO --- */
.galeria-timeline {
    max-width: 1000px;
    margin: 0 auto 80px;
    padding: 0 20px;
    display: none; /* Oculta por defecto */
    position: relative;
}

.galeria-timeline::before {
    content: '';
    position: absolute;
    left: 50px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: rgba(255, 149, 0, 0.3);
    border-radius: 2px;
}

.timeline-year-group {
    margin-bottom: 50px;
    position: relative;
}

.timeline-year-marker {
    display: inline-flex;
    align-items: center;
    background: #FF9500;
    color: white;
    padding: 8px 25px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1.4rem;
    margin-bottom: 30px;
    position: relative;
    z-index: 2;
    box-shadow: 0 5px 15px rgba(255, 149, 0, 0.4);
    left: 20px; /* Alineado con la línea */
}

.timeline-year-marker::before {
    content: '';
    position: absolute;
    left: -32px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: white;
    border: 4px solid #FF9500;
    border-radius: 50%;
    z-index: 3;
}

.timeline-lugar-group {
    margin-left: 80px;
    margin-bottom: 40px;
}

.timeline-lugar-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.timeline-lugar-title i {
    color: #FF9500;
}

.timeline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* --- ESTILOS COMPARTIDOS DE TARJETAS --- */
.foto-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 15px;
    box-shadow: var(--glass-shine), 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    animation: fadeIn 0.6s ease;
}

/* Ajustes específicos para Masonry */
.galeria-masonry .foto-card {
    margin-bottom: 25px;
    break-inside: avoid;
    min-height: 200px;
}

/* Ajustes específicos para Timeline */
.timeline-grid .foto-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.timeline-grid .foto-card img {
    height: 200px;
    object-fit: cover;
}

[data-theme="dark"] .foto-card {
    box-shadow: var(--glass-shine), 0 10px 30px rgba(0, 0, 0, 0.8);
    border-bottom: 2px solid #FF9500;
}

.foto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(255, 149, 0, 0.2);
    border-color: #FF9500;
}

.image-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 4px solid var(--glass-border);
    border-top-color: #FF9500;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    z-index: 0;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.foto-card img {
    width: 100%;
    border-radius: 12px;
    display: block;
    margin-bottom: 15px;
    cursor: zoom-in;
    opacity: 0;
    transition: opacity 0.4s ease;
    position: relative;
    z-index: 1;
}

.foto-card img.loaded {
    opacity: 1;
}

.foto-card img.loaded:hover {
    opacity: 0.9;
}

.foto-info-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.foto-desc {
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.5;
    font-weight: 500;
    padding: 0 5px;
    text-align: center;
}

.foto-meta {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: auto;
    padding-top: 5px;
}

.foto-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(128, 128, 128, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
}

[data-theme="dark"] .foto-meta-item {
    background: rgba(255, 255, 255, 0.05);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Lightbox */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.lightbox-content {
    position: relative;
    max-width: 900px;
    width: 100%;
}

.lightbox-img {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 15px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    transition: color 0.3s;
}

.lightbox-close:hover {
    color: #FF9500;
}

/* Breakpoints */
@media (min-width: 1600px) {
    .galeria-masonry { column-count: 5; }
}

@media (max-width: 1200px) {
    .galeria-masonry { column-count: 3; }
}

@media (max-width: 900px) {
    .galeria-masonry { column-count: 2; }
}

@media (max-width: 768px) {
    .galeria-timeline::before { left: 30px; }
    .timeline-year-marker { left: 5px; font-size: 1.2rem; padding: 6px 20px; }
    .timeline-lugar-group { margin-left: 50px; }
}

@media (max-width: 600px) {
    .foto-header { padding: 40px 20px 20px; }
    .foto-header h1 { font-size: 2.5rem; }
    .galeria-masonry { column-count: 1; column-gap: 0; padding: 0 15px; }
    .timeline-grid { grid-template-columns: 1fr; }
}