[hidden] { display: none !important; }

.gal-header {
    text-align: center;
    padding: 2rem 1rem 0.8rem;
    background: var(--accent-crema);
}
.gal-logo { max-width: 140px; height: auto; margin-bottom: 1rem; }
.gal-header h1 { font-size: 1.6rem; color: var(--accent-verde); margin-bottom: 0.4rem; }
.gal-sub { font-family: "Century Gothic", sans-serif; color: #555; font-size: 0.95rem; }

.gal-main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1rem 1rem;
    font-family: "Century Gothic", sans-serif;
}

/* Franja de upload: pill compacto centrado, sin fondo propio */
.gal-upload {
    text-align: center;
    margin: 1.25rem 0 1.5rem;
}
.gal-upload-row {
    display: inline-flex;        /* el conjunto toma su propio ancho natural */
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.4rem 0.3rem 0.3rem;
    background: #fff;
    border: 1px solid rgba(3, 113, 114, 0.12);
    border-radius: 999px;        /* pill: le quita gravedad de formulario */
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.gal-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    background: var(--accent-verde);
    color: #fff;
    border-radius: 999px;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
    transition: filter 0.15s, transform 0.05s;
}
.gal-upload-btn:hover { filter: brightness(1.08); }
.gal-upload-btn:active { transform: scale(0.98); }

input.gal-upload-name {
    width: 220px;
    padding: 0.35rem 0.6rem;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    font-family: inherit;
    color: #333;
    min-width: 0;
}
input.gal-upload-name::placeholder { color: #999; }
input.gal-upload-name:focus { outline: none; }

@media (max-width: 520px) {
    .gal-upload-row { max-width: calc(100% - 1rem); }
    input.gal-upload-name { width: auto; flex: 1; }
}

.gal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.9rem 1rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: transform 0.05s, filter 0.15s;
}
.gal-btn:active { transform: scale(0.98); }
.gal-btn-primary { background: var(--accent-verde); color: var(--white); }
.gal-btn-primary:hover:not(:disabled) { filter: brightness(1.1); }
.gal-btn-secondary { background: var(--accent-terracota); color: var(--white); }
.gal-btn-secondary:hover:not(:disabled) { filter: brightness(1.1); }
.gal-btn-ghost { background: transparent; color: #555; border: 1px solid #ccc; }
.gal-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.gal-uploads { margin: 0.6rem auto 0; max-width: 720px; }
.gal-upload-item {
    display: grid;
    grid-template-columns: 40px 1fr auto;
    gap: 0.6rem;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
}
.gal-upload-item:last-child { border-bottom: 0; }
.gal-upload-icon { font-size: 1.4rem; text-align: center; }
.gal-upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #333; }
.gal-upload-status { font-size: 0.8rem; }
.gal-upload-status.ok { color: var(--accent-verde); }
.gal-upload-status.err { color: #c00; }
.gal-upload-progress {
    grid-column: 1 / -1;
    height: 4px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.3rem;
}
.gal-upload-progress-bar {
    height: 100%;
    background: var(--accent-verde);
    width: 0%;
    transition: width 0.2s;
}

/* Modal */
.gal-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
}
.gal-modal-inner {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 400px;
    width: 100%;
    font-family: "Century Gothic", sans-serif;
}
.gal-modal-inner h3 { margin-bottom: 1rem; color: var(--accent-verde); text-align: center; }

/* Galería pública — cuadrícula */
.gal-public-header { position: relative; display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; }
.gal-public-header h2 { color: var(--accent-verde); margin: 0; text-align: center; }
.gal-public-header #backToAlbumsBtn {
    position: absolute; left: 0; padding: 0.4rem 0.7rem; font-size: 0.9rem;
    background: transparent; color: var(--accent-verde);
}
.gal-public #galleryDescription { text-align: center; margin: -0.5rem 0 1rem; color: #666; }

/* Grid de álbumes */
.gal-albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.9rem;
    margin-bottom: 1rem;
}
.gal-album-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: #ddd;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.15s;
}
.gal-album-card:hover { transform: translateY(-2px); }
.gal-album-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal-album-card .gal-album-placeholder {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem; color: #999; background: linear-gradient(135deg, #eee, #ddd);
}
.gal-album-card .gal-album-overlay {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 0.6rem 0.8rem 0.7rem;
    background: linear-gradient(to top, rgba(0,0,0,0.75), rgba(0,0,0,0));
    color: #fff;
}
.gal-album-card .gal-album-title { font-size: 1rem; font-weight: 600; line-height: 1.2; }
.gal-album-card .gal-album-count { font-size: 0.8rem; opacity: 0.85; margin-top: 0.1rem; }

.gal-public h2 { color: var(--accent-verde); margin-bottom: 1rem; text-align: center; }
.gal-download-bar {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}
.gal-download-bar .gal-btn { padding: 0.5rem 0.9rem; font-size: 0.9rem; }
.gal-feed-item.selected {
    outline: 3px solid var(--accent-verde);
    outline-offset: -3px;
}
.gal-feed-item .gal-select-mark {
    position: absolute;
    top: 0.3rem; right: 0.3rem;
    width: 1.5rem; height: 1.5rem;
    border-radius: 50%;
    background: rgba(255,255,255,0.85);
    color: var(--accent-verde);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; font-weight: bold;
    opacity: 0;
    transition: opacity 0.15s;
}
.gal-public.selecting .gal-feed-item .gal-select-mark { opacity: 0.8; }
.gal-feed-item.selected .gal-select-mark {
    opacity: 1;
    background: var(--accent-verde);
    color: #fff;
}
.gal-public.selecting .gal-feed-item { cursor: pointer; }
.gal-public.selecting .gal-feed-item:hover img { transform: none; }
.gal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.35rem;
}
.gal-feed-item {
    margin: 0;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 4px;
    cursor: zoom-in;
    background: #eee;
    position: relative;
}
.gal-feed-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.2s;
}
.gal-feed-item:hover img { transform: scale(1.04); }
.gal-video-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2b2b2b, #4a4a4a);
    color: #fff;
}
.gal-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.4rem;
    color: #fff;
    opacity: 0.92;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
    pointer-events: none;
    transition: transform 0.2s;
}
.gal-feed-item.is-video:hover .gal-video-play { transform: translate(-50%, -50%) scale(1.1); }
#lightboxBody video {
    max-width: 100%;
    max-height: 100%;
    display: block;
    background: #000;
}
.gal-feed-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 0.3rem 0.5rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    font-size: 0.72rem;
    line-height: 1.2;
    pointer-events: none;
}

/* Lightbox */
.gal-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    touch-action: none;
    overscroll-behavior: contain;
    user-select: none;
    -webkit-user-select: none;
}
.gal-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    color: white;
    border: none;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    z-index: 2;
}
.gal-lightbox-download {
    position: absolute;
    top: 1.1rem;
    right: 3.5rem;
    color: white;
    background: rgba(255,255,255,0.15);
    width: 2.2rem; height: 2.2rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    font-size: 1.3rem;
    text-decoration: none;
    z-index: 2;
    transition: background 0.15s;
}
.gal-lightbox-download:hover { background: rgba(255,255,255,0.3); }
.gal-lightbox-share {
    position: absolute;
    top: 1.1rem;
    right: 6rem;
    color: white;
    background: rgba(255,255,255,0.15);
    width: 2.2rem; height: 2.2rem;
    display: flex; align-items: center; justify-content: center;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 2;
    transition: background 0.15s;
}
.gal-lightbox-share:hover { background: rgba(255,255,255,0.3); }
.gal-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    z-index: 10;
    pointer-events: none;
}
.gal-lightbox-body {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gal-lightbox-body img,
.gal-lightbox-body video { max-width: 100%; max-height: 90vh; object-fit: contain; }
.gal-lightbox-body img.slide-next { animation: galSlideNext 0.25s ease; }
.gal-lightbox-body img.slide-prev { animation: galSlidePrev 0.25s ease; }
@keyframes galSlideNext { from { transform: translateX(60%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes galSlidePrev { from { transform: translateX(-60%); opacity: 0; } to { transform: none; opacity: 1; } }
.gal-lightbox-body audio { width: 90vw; max-width: 500px; }

.gal-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: none;
    font-size: 2.2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    transition: background 0.15s;
}
.gal-lightbox-nav:hover { background: rgba(255,255,255,0.3); }
.gal-lightbox-nav:disabled { opacity: 0.25; cursor: default; }
.gal-lightbox-prev { left: 0.5rem; }
.gal-lightbox-next { right: 0.5rem; }
.gal-lightbox-counter {
    position: absolute;
    top: 1rem;
    left: 1rem;
    color: rgba(255,255,255,0.75);
    font-size: 0.85rem;
    font-family: monospace;
}
@media (max-width: 480px) {
    .gal-lightbox-nav { width: 2.4rem; height: 2.4rem; font-size: 1.7rem; }
}
