@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    padding: 15px 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.navbar-left .logo { height: 40px; }
.navbar-right { display: flex; gap: 25px; }
.nav-link { text-decoration: none; color: #4a4a4a; font-weight: 500; font-size: 1em; transition: color 0.3s; }
.nav-link:hover { color: #3f51b5; }

/* Footer */
footer { text-align: center; padding: 20px; font-size: 0.85em; color: #777; }

/* Masonry gallery */
.galeria {
    column-count: 5;
    column-gap: 8px;
    padding: 8px;
    max-width: 1500px;
    margin: 0 auto;
}

.imagen-item { 
    margin-bottom: 8px; 
    break-inside: avoid; 
    cursor: pointer; 
    background: #fff;
    position: relative;
    overflow: hidden;
    border-radius: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 200px;
}
.imagen-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.imagen-item img,
.imagen-item video { 
    width: 100%; 
    height: auto; 
    display: block; 
    opacity: 0;
    transition: opacity 0.5s ease;
}
.imagen-item.loaded img,
.imagen-item.loaded video {
    opacity: 1;
}
/* Placeholder shimmer */
.imagen-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    z-index: 1;
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.imagen-item.loaded::before {
    display: none;
}

/* Modal backdrop */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 40px 0;
    box-sizing: border-box;
    z-index: 10000;
}

/* Image & info wrapper */
#imageModal .modal-content-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
    padding: 24px;
    background: #fff;
    border-radius: 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    flex-wrap: nowrap;
    justify-content: flex-start;
    max-height: 90vh;
    overflow-y: auto;
    position: relative; /* necesario para flechas absolutas */
    z-index: 10001;
}

/* Image/video inside modal */
#modalMediaContainer .modal-content {
    width: auto;
    height: auto;
    max-width: 50vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

/* Info card */
.modal-info-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    font-size: 0.95em;
    color: #333;
    flex-shrink: 0;
}
.modal-info-card .info-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}
.modal-info-card .info-icon {
    width: 20px; height: 20px;
    fill: #e94e1b;
    margin-right: 8px;
}
.modal-info-card h4 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #222;
}
.modal-info-card .info-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.modal-info-card .info-prompt {
    margin: 0;
    line-height: 1.5;
    color: #444;
}
.modal-info-card .info-row {
    display: flex;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid #ddd;
}
.modal-info-card .info-row span:first-child {
    font-weight: 500;
    color: #666;
}
.modal-info-card .info-row span:last-child {
    color: #333;
}

/* Hide old arrows wrapper */
.modal-nav-arrows {
    display: none !important;
}

/* New modal navigation arrows */
.nav-arrow {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 2rem !important;
    color: #fff !important;
    padding: 8px !important;
    cursor: pointer !important;
    z-index: 10002 !important;
    transition: color 0.2s ease !important;
}
.nav-arrow:hover {
    color: #ddd !important;
}
.nav-arrow-prev {
    left: -32px !important;
    right: auto !important;
}
.nav-arrow-next {
    right: -32px !important;
    left: auto !important;
}

/* About me modal */
#aboutMeModal .modal-content-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
}
.about-modal-content-wrapper {
    background: #fff;
    padding: 24px;
    max-width: 800px;
    width: 90%;
    display: flex;
    gap: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 0;
}
.about-photo-container {
    flex: 1 1 300px;
    max-width: 350px;
}
.about-photo {
    width: 100%;
    display: block;
    border-radius: 8px;
}
.about-text-content {
    flex: 2 1 500px;
}
.about-text-content h2 {
    margin-top: 0;
    font-size: 2em;
    color: #111;
}
.about-text-content p {
    color: #333;
    line-height: 1.5;
    margin-bottom: 1em;
}

/* Close button */
.close-button {
    position: absolute;
    top: 16px;
    right: 24px;
    font-size: 32px;
    color: #fff;
    cursor: pointer;
    z-index: 10003;
    transition: color 0.3s ease;
}
.close-button:hover {
    color: #ccc;
}

/* Responsive columns */
@media (max-width: 1400px) {
    .galeria { column-count: 4; }
}
@media (max-width: 1024px) {
    .galeria { column-count: 3; }
    #imageModal .modal-content-wrapper {
        flex-direction: column;
        align-items: center;
    }
    #modalMediaContainer .modal-content {
        max-width: 90vw;
    }
    .modal-info-card {
        width: 100%;
        max-width: 400px;
    }
}
@media (max-width: 768px) {
    .galeria { column-count: 2; }
    .nav-arrow {
        font-size: 1.5rem !important;
        padding: 6px !important;
    }
    .nav-arrow-prev { left: -24px !important; }
    .nav-arrow-next { right: -24px !important; }
}
@media (max-width: 480px) {
    .galeria { column-count: 1; }
    .navbar { padding: 15px 20px; }
    .navbar-right { gap: 15px; }
    .about-modal-content-wrapper {
        flex-direction: column;
        text-align: center;
    }
}
