/* ============================================
   DON INACIO — GALERÍA
   Design system unificado
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Montserrat:wght@300;400;500;600&display=swap');

:root {
    --gold:        #c8962a;
    --gold-light:  #e8b84b;
    --gold-pale:   #f5e6c0;
    --cream:       #faf6ee;
    --dark:        #1a1208;
    --dark-mid:    #2c1e0a;
    --text:        #3a2e1a;
    --text-muted:  #7a6a50;
    --white:       #ffffff;
    --header-h:    64px;
    --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { overflow-x: hidden; scroll-behavior: smooth; }
body { font-family: 'Montserrat', sans-serif; background: var(--cream); color: var(--text); overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--dark); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }

/* ============================================
   HEADER SIMPLE
   ============================================ */
.gallery-header-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 36px;
    z-index: 900;
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease;
}
.gallery-header-bar.scrolled {
    background: rgba(20, 12, 3, 0.97);
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 24px rgba(0,0,0,0.45);
}

.header-back {
    display: flex;
    align-items: center;
    gap: 7px;
    color: rgba(255,255,255,0.85);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 8px 16px 8px 10px;
    border-radius: 40px;
    border: 1px solid rgba(255,255,255,0.22);
    transition: all 0.25s ease;
}
.header-back .material-symbols-outlined { font-size: 1.1rem; }
.header-back:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.45);
    color: #fff;
}

.header-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.header-logo img {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(200,150,42,0.35));
    transition: transform 0.3s var(--ease-spring);
}
.header-logo:hover img { transform: scale(1.06); }

.header-reservar {
    display: flex;
    align-items: center;
    gap: 7px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--dark);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 9px 18px;
    border-radius: 40px;
    transition: transform 0.3s var(--ease-spring), box-shadow 0.3s;
}
.header-reservar .material-symbols-outlined { font-size: 1rem; }
.header-reservar:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(200,150,42,0.45);
}

/* ============================================
   HERO
   ============================================ */
.gallery-hero {
    position: relative;
    height: 60vh;
    min-height: 420px;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.gallery-hero-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to right, rgba(15,8,2,0.93) 0%, rgba(15,8,2,0.55) 55%, rgba(15,8,2,0.2) 100%),
        url('../extern-arch/imagenes galeria/1.jpg') center / cover no-repeat;
    animation: heroZoom 18s ease-in-out infinite alternate;
}
@keyframes heroZoom {
    from { transform: scale(1.0); }
    to   { transform: scale(1.06); }
}
.gallery-hero-content {
    position: relative;
    z-index: 2;
    padding: 0 8%;
    padding-top: var(--header-h);
    max-width: 600px;
}
.gallery-hero-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 16px;
}
.gallery-hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(3.2rem, 7vw, 5.8rem);
    font-weight: 900;
    color: #fff;
    line-height: 1.05;
    margin-bottom: 20px;
}
.gallery-hero-title em { font-style: italic; color: var(--gold-light); }
.gallery-hero-desc {
    color: rgba(255,255,255,0.62);
    font-size: 0.93rem;
    line-height: 1.85;
}
.gallery-hero-scroll {
    position: absolute;
    bottom: 26px; left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.45);
    animation: bounce 2.2s ease-in-out infinite;
    z-index: 2;
}
.gallery-hero-scroll .material-symbols-outlined { font-size: 2rem; }
@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%       { transform: translateX(-50%) translateY(9px); }
}

/* ============================================
   FILTROS
   ============================================ */
.gallery-filters-section {
    position: sticky;
    top: var(--header-h);
    z-index: 100;
    background: rgba(250,246,238,0.97);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(200,150,42,0.14);
}
.gallery-filters-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 14px 6%;
    max-width: 1200px;
    margin: 0 auto;
}
.gallery-filters-wrap::-webkit-scrollbar { display: none; }

.filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 9px 18px;
    border-radius: 40px;
    border: 1.5px solid transparent;
    transition: all 0.22s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.filter-btn .material-symbols-outlined { font-size: 1rem; }
.filter-btn:hover {
    color: var(--gold);
    background: rgba(200,150,42,0.08);
    border-color: rgba(200,150,42,0.2);
}
.filter-btn.active {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--dark);
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(200,150,42,0.3);
}

/* ============================================
   GALERÍA MAIN
   ============================================ */
.gallery-main {
    background: var(--dark);
    min-height: 60vh;
    padding: 56px 0 72px;
}

.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 4%;
}

/* Contador */
.gallery-count {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
    text-align: right;
    margin-bottom: 28px;
    padding-right: 4px;
}

/* Grid masonry-like */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* ── ITEM ── */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
    background: rgba(255,255,255,0.04);
    aspect-ratio: 4 / 3;
    opacity: 0;
    transform: translateY(18px);
    animation: itemReveal 0.5s var(--ease-out) forwards;
    border: 1px solid rgba(255,255,255,0.05);
}

/* Ítems especiales más grandes */
.gallery-item:nth-child(7n+1) {
    grid-column: span 2;
    grid-row: span 2;
    aspect-ratio: unset;
}

@keyframes itemReveal {
    to { opacity: 1; transform: translateY(0); }
}
.gallery-item:nth-child(1)  { animation-delay: 0.04s; }
.gallery-item:nth-child(2)  { animation-delay: 0.08s; }
.gallery-item:nth-child(3)  { animation-delay: 0.12s; }
.gallery-item:nth-child(4)  { animation-delay: 0.16s; }
.gallery-item:nth-child(5)  { animation-delay: 0.20s; }
.gallery-item:nth-child(6)  { animation-delay: 0.24s; }
.gallery-item:nth-child(7)  { animation-delay: 0.28s; }
.gallery-item:nth-child(8)  { animation-delay: 0.32s; }
.gallery-item:nth-child(n+9) { animation-delay: 0.36s; }

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.55s var(--ease-out);
    display: block;
}
.gallery-item:hover img { transform: scale(1.07); }

/* Overlay con icono en hover */
.gallery-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(20,12,3,0.6) 0%, transparent 55%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}
.gallery-item::after {
    content: 'zoom_in';
    font-family: 'Material Symbols Outlined';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    color: #fff;
    font-size: 2.4rem;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s var(--ease-spring);
    z-index: 2;
}
.gallery-item:hover::before { opacity: 1; }
.gallery-item:hover::after  { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ── Borde dorado al enfocar (accesibilidad) ── */
.gallery-item:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8, 4, 1, 0.96);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}
.lightbox.active { display: flex; }

.lightbox-content {
    position: relative;
    max-width: 88vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.lightbox-content img {
    max-width: 100%;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.7);
    animation: lbZoom 0.28s var(--ease-out);
}
@keyframes lbZoom {
    from { transform: scale(0.88); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

/* Botón cerrar */
.lightbox-close {
    position: fixed;
    top: 20px; right: 20px;
    width: 46px; height: 46px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(200,150,42,0.15);
    border: 1px solid rgba(200,150,42,0.4);
    border-radius: 50%;
    color: var(--gold-light);
    transition: all 0.25s ease;
    z-index: 2001;
}
.lightbox-close .material-symbols-outlined { font-size: 1.3rem; }
.lightbox-close:hover {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--dark);
    transform: rotate(90deg);
}

/* Botones prev / next */
.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(200,150,42,0.12);
    border: 1px solid rgba(200,150,42,0.3);
    border-radius: 50%;
    color: rgba(255,255,255,0.8);
    transition: all 0.25s ease;
    z-index: 2001;
}
.lightbox-nav .material-symbols-outlined { font-size: 1.6rem; }
.lightbox-nav:hover {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--dark);
    transform: translateY(-50%) scale(1.08);
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* Contador */
.lightbox-counter {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-style: italic;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.1em;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer { background: var(--dark); padding: 60px 6% 0; }
.footer-inner {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 48px;
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 48px;
}
.footer-brand img { height: 48px; margin-bottom: 16px; filter: drop-shadow(0 2px 8px rgba(200,150,42,0.25)); }
.footer-brand p { font-size: 0.85rem; color: rgba(255,255,255,0.38); line-height: 1.7; }
.footer-nav h4, .footer-contact h4 {
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em;
    text-transform: uppercase; color: var(--gold-light); margin-bottom: 16px;
}
.footer-nav ul li, .footer-contact ul li {
    display: flex; align-items: center; gap: 8px;
    color: rgba(255,255,255,0.42); font-size: 0.86rem; margin-bottom: 10px;
}
.footer-nav ul li a { transition: color 0.2s; }
.footer-nav ul li a:hover { color: var(--gold-light); }
.footer-contact ul li .material-symbols-outlined { font-size: 1rem; color: var(--gold); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 20px 0; text-align: center;
    max-width: 1100px; margin: 0 auto;
}
.footer-bottom p { font-size: 0.78rem; color: rgba(255,255,255,0.22); }

/* ============================================
   SCROLL TOP
   ============================================ */
.scroll-top {
    position: fixed;
    bottom: 30px; right: 26px;
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(200,150,42,0.92);
    color: var(--dark);
    border-radius: 50%;
    z-index: 800;
    box-shadow: 0 4px 16px rgba(200,150,42,0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s var(--ease-spring);
}
.scroll-top.visible { opacity: 1; pointer-events: all; }
.scroll-top:hover { transform: translateY(-3px) scale(1.08); }
.scroll-top .material-symbols-outlined { font-size: 1.2rem; }

/* ============================================
   RESPONSIVE — TABLET
   ============================================ */
@media (max-width: 1024px) {
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}

/* ============================================
   RESPONSIVE — MOBILE
   ============================================ */
@media (max-width: 768px) {
    :root { --header-h: 56px; }

    .gallery-header-bar { padding: 0 20px; }
    .header-back span:last-child { display: none; }
    .header-back { padding: 8px 10px; gap: 0; }
    .header-reservar span:last-child { display: none; }
    .header-reservar { padding: 9px 12px; gap: 0; border-radius: 50%; }

    .gallery-hero { height: 70vh; }
    .gallery-hero-bg {
        background:
            linear-gradient(to bottom, rgba(15,8,2,0.75) 0%, rgba(15,8,2,0.9) 100%),
            url('../extern-arch/imagenes galeria/1.jpg') center / cover no-repeat;
    }
    .gallery-hero-content { padding: 0 6%; padding-top: calc(var(--header-h) + 16px); }

    .gallery-filters-section { padding: 0; }
    .gallery-filters-wrap { padding: 12px 4%; gap: 4px; }
    .filter-btn { padding: 8px 12px; font-size: 0.72rem; }
    .filter-btn .material-symbols-outlined { display: none; }

    .gallery-main { padding: 36px 0 56px; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .gallery-item:nth-child(7n+1) { grid-column: span 2; grid-row: span 1; }

    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    .lightbox-nav { width: 42px; height: 42px; }
    .lightbox-content img { max-height: 74vh; }

    .footer-inner { grid-template-columns: 1fr; gap: 28px; }
    .footer-brand { grid-column: auto; }
}

@media (max-width: 480px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .gallery-item:nth-child(7n+1) { grid-column: span 1; }
    .gallery-count { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}