/* ============================================================
   EAVicar — Galería Nuestras Instalaciones
   Escuela Agraria Vícar | Diseñado por masqweb
   ============================================================ */

/* ---- HERO ---- */
.gal-hero {
    position: relative;
    min-height: 78vh;
    background-size: cover;
    background-position: center 42%;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.gal-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(26,46,62,0.91) 0%, rgba(46,163,242,0.50) 100%);
}
.gal-hero-inner {
    position: relative;
    z-index: 2;
    max-width: 1080px;
    margin: 0 auto;
    padding: 120px 40px 80px;
    width: 100%;
}
.gal-eyebrow {
    display: inline-block;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.88);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 5px 16px;
    border-radius: 20px;
    margin-bottom: 20px;
}
.gal-hero-inner h1 {
    color: #fff;
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 18px;
}
.gal-hero-inner p {
    color: rgba(255,255,255,0.84);
    font-size: 1.1rem;
    max-width: 620px;
    margin: 0 0 48px;
    line-height: 1.75;
}
.gal-hero-inner p sup {
    font-size: 0.6em;
    vertical-align: super;
    line-height: 0;
}
/* Stats chips */
.gal-hero-stats {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}
.gal-hero-stats div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-left: 3px solid rgba(46,163,242,0.7);
    padding-left: 14px;
}
.gal-hero-stats strong {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}
.gal-hero-stats span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,0.55);
}

/* ---- FILTROS ---- */
.gal-filters {
    background: #fff;
    padding: 28px 24px;
    border-bottom: 1px solid #d6eaf8;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.gal-filters-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}
.gal-filter-btn {
    padding: 8px 20px;
    border-radius: 24px;
    border: 2px solid #b8d9f0;
    background: transparent;
    color: #444;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .22s;
    font-family: inherit;
}
.gal-filter-btn:hover {
    border-color: #2ea3f2;
    color: #2ea3f2;
}
.gal-filter-btn.active {
    background: #2ea3f2;
    border-color: #2ea3f2;
    color: #fff;
}

/* ---- GRID ---- */
.gal-section {
    padding: 48px 24px 72px;
    background: #f0f6fc;
    min-height: 60vh;
}
.gal-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}
.gal-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #ddd;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,.10);
    transition: transform .28s cubic-bezier(.25,.8,.25,1), box-shadow .28s;
    aspect-ratio: 4/3;
}
.gal-item:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 12px 32px rgba(46,163,242,.22);
}
.gal-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.gal-item:hover img {
    transform: scale(1.05);
}
.gal-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(26,46,62,0.75) 0%, transparent 55%);
    opacity: 0;
    transition: opacity .28s;
    display: flex;
    align-items: flex-end;
    padding: 18px;
}
.gal-item:hover .gal-item-overlay {
    opacity: 1;
}
.gal-item-caption {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}
.gal-item-zoom {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .28s;
}
.gal-item:hover .gal-item-zoom {
    opacity: 1;
}
.gal-item-zoom svg {
    width: 16px;
    height: 16px;
    stroke: #2ea3f2;
}

/* Items ocultos por filtro */
.gal-item.hidden {
    display: none;
}

/* Badge categoría */
.gal-item-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(46,163,242,0.92);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 10px;
    backdrop-filter: blur(4px);
}

/* ---- LIGHTBOX ---- */
.gal-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    background: rgba(10,16,26,0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
    padding: 20px;
}
.gal-lightbox.open {
    opacity: 1;
    pointer-events: all;
}
.gal-lb-inner {
    position: relative;
    max-width: 1100px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.gal-lb-img-wrap {
    position: relative;
    max-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.gal-lb-img-wrap img {
    max-width: 100%;
    max-height: calc(100vh - 140px);
    border-radius: 10px;
    display: block;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
    transform: scale(0.92);
    transition: transform .3s cubic-bezier(.25,.8,.25,1);
}
.gal-lightbox.open .gal-lb-img-wrap img {
    transform: scale(1);
}
.gal-lb-caption {
    color: rgba(255,255,255,0.85);
    font-size: 15px;
    font-weight: 500;
    text-align: center;
}
.gal-lb-counter {
    color: rgba(255,255,255,0.45);
    font-size: 13px;
}
.gal-lb-close {
    position: absolute;
    top: 18px;
    right: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    z-index: 10000;
}
.gal-lb-close:hover { background: rgba(255,255,255,0.22); }
.gal-lb-close svg { width: 22px; height: 22px; stroke: #fff; }

.gal-lb-prev,
.gal-lb-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    z-index: 10000;
}
.gal-lb-prev { left: 16px; }
.gal-lb-next { right: 16px; }
.gal-lb-prev:hover,
.gal-lb-next:hover { background: rgba(255,255,255,0.24); }
.gal-lb-prev svg,
.gal-lb-next svg { width: 26px; height: 26px; stroke: #fff; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .gal-hero { min-height: 60vh; background-attachment: scroll; }
    .gal-hero-inner { padding: 100px 24px 60px; }
    .gal-hero-stats { gap: 20px; }
    .gal-hero-stats strong { font-size: 18px; }
    .gal-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
    .gal-lb-prev { left: 6px; }
    .gal-lb-next { right: 6px; }
}
@media (max-width: 480px) {
    .gal-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .gal-filters-inner { gap: 7px; }
    .gal-filter-btn { padding: 7px 14px; font-size: 13px; }
}
