/* ============================================================
   GALERÍA LA BROCHERIANA — Frontend CSS
   ============================================================ */

:root {
    --gal-arena:       #C0B599;
    --gal-tierra:      #3F352E;
    --gal-tierra-osc:  #2a231e;
    --gal-arena-claro: #f0ece6;
    --gal-radio:       8px;
    --gal-sombra:      0 4px 20px rgba(63,53,46,0.12);
}

.broch-galeria-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ── Filtro de años ─────────────────────────────────────── */
.broch-gal-filter {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 2.5rem;
}

.broch-gal-filter-btn {
    background: var(--gal-arena-claro);
    border: 1.5px solid var(--gal-arena);
    color: var(--gal-tierra);
    padding: .45rem 1.1rem;
    border-radius: 100px;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 600;
    transition: all .2s;
    font-family: inherit;
}
.broch-gal-filter-btn:hover,
.broch-gal-filter-btn.active {
    background: var(--gal-tierra);
    border-color: var(--gal-tierra);
    color: #fff;
}

/* ── Grid álbumes ───────────────────────────────────────── */
.broch-albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.broch-album-card {
    text-decoration: none;
    color: inherit;
    border-radius: var(--gal-radio);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--gal-sombra);
    transition: transform .25s, box-shadow .25s;
    display: flex;
    flex-direction: column;
}
.broch-album-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 32px rgba(63,53,46,0.18);
}
.broch-album-card[style*="display: none"] { display: none !important; }

.broch-album-thumb {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--gal-arena-claro);
}
.broch-album-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s;
}
.broch-album-card:hover .broch-album-thumb img {
    transform: scale(1.05);
}
.broch-album-no-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 3rem;
    color: #bbb;
}
.broch-album-overlay {
    position: absolute;
    bottom: .75rem;
    right: .75rem;
    background: rgba(63,53,46,0.82);
    color: #fff;
    padding: .25rem .75rem;
    border-radius: 100px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .03em;
}

.broch-album-info {
    padding: 1rem 1.25rem 1.25rem;
}
.broch-album-year {
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gal-arena);
    margin-bottom: .3rem;
}
.broch-album-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--gal-tierra);
    margin: 0 0 .4rem;
    line-height: 1.3;
}
.broch-album-desc {
    font-size: .85rem;
    color: #7a6f69;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Cabecera álbum individual ──────────────────────────── */
.broch-album-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.broch-back-link {
    display: inline-block;
    font-size: .85rem;
    color: var(--gal-tierra);
    text-decoration: none;
    margin-bottom: 1.5rem;
    opacity: .7;
    transition: opacity .2s;
}
.broch-back-link:hover { opacity: 1; }
.broch-album-year-badge {
    display: inline-block;
    background: var(--gal-arena);
    color: var(--gal-tierra);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: .25rem .9rem;
    border-radius: 100px;
    margin-bottom: .75rem;
}
.broch-album-page-title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--gal-tierra);
    margin: 0 0 .5rem;
}
.broch-album-page-desc {
    color: #7a6f69;
    margin: 0 auto .75rem;
    max-width: 600px;
}
.broch-album-meta {
    font-size: .8rem;
    color: #aaa;
}

/* ── Grid fotos ─────────────────────────────────────────── */
.broch-photos-grid-frontend {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: .75rem;
}

.broch-photo-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--gal-radio);
    cursor: pointer;
    background: var(--gal-arena-claro);
}
.broch-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s;
    display: block;
}
.broch-photo-item:hover img { transform: scale(1.06); }

.broch-photo-item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(63,53,46,0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .25s;
}
.broch-photo-item:hover .broch-photo-item-overlay {
    background: rgba(63,53,46,0.4);
}
.broch-photo-zoom {
    font-size: 1.8rem;
    opacity: 0;
    transform: scale(.8);
    transition: all .25s;
}
.broch-photo-item:hover .broch-photo-zoom {
    opacity: 1;
    transform: scale(1);
}

/* ── Lightbox ───────────────────────────────────────────── */
.broch-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}
.broch-lightbox.active { display: flex; }

.broch-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20,15,12,0.95);
}
.broch-lightbox-content {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}
#broch-lightbox-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 6px;
    display: block;
}
.broch-lightbox-caption {
    margin-top: .75rem;
    text-align: center;
    color: rgba(255,255,255,.8);
    font-size: .88rem;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}
#broch-lightbox-autor { opacity: .6; font-size: .8rem; }
.broch-lightbox-counter {
    margin-top: .4rem;
    font-size: .75rem;
    color: rgba(255,255,255,.4);
}
.broch-lightbox-close,
.broch-lightbox-prev,
.broch-lightbox-next {
    position: absolute;
    background: rgba(255,255,255,.1);
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    transition: background .2s;
    font-size: 1.4rem;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}
.broch-lightbox-close:hover,
.broch-lightbox-prev:hover,
.broch-lightbox-next:hover { background: rgba(255,255,255,.2); }

.broch-lightbox-close { top: 1rem; right: 1rem; width: 44px; height: 44px; }
.broch-lightbox-prev  { left: 1rem;  top: 50%; transform: translateY(-50%); width: 48px; height: 48px; }
.broch-lightbox-next  { right: 1rem; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; }

/* ── Formulario de envío ────────────────────────────────── */
.broch-submit-form-wrap {
    max-width: 680px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--gal-sombra);
    padding: 2.5rem;
}
.broch-submit-header {
    text-align: center;
    margin-bottom: 2rem;
}
.broch-submit-header h3 {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--gal-tierra);
    margin: .5rem 0;
}
.broch-submit-header p { color: #7a6f69; margin: 0; }

.broch-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.broch-field { margin-bottom: 1.25rem; }
.broch-field label {
    display: block;
    font-size: .85rem;
    font-weight: 700;
    color: var(--gal-tierra);
    margin-bottom: .4rem;
}
.broch-field label span { color: #c00; }
.broch-field input[type="text"],
.broch-field input[type="email"],
.broch-field select,
.broch-field textarea {
    width: 100%;
    padding: .7rem 1rem;
    border: 1.5px solid #e0d8cc;
    border-radius: 6px;
    font-size: .95rem;
    font-family: inherit;
    background: #faf9f7;
    color: var(--gal-tierra);
    box-sizing: border-box;
    transition: border-color .2s;
}
.broch-field input:focus,
.broch-field select:focus,
.broch-field textarea:focus {
    outline: none;
    border-color: var(--gal-arena);
    background: #fff;
}

/* File drop zone */
.broch-file-drop {
    position: relative;
    border: 2px dashed var(--gal-arena);
    border-radius: 8px;
    background: var(--gal-arena-claro);
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s, border-color .2s;
    overflow: hidden;
}
.broch-file-drop:hover { background: #e8e3db; border-color: var(--gal-tierra); }
.broch-file-drop input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.broch-file-drop-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    color: #7a6f69;
    font-size: .9rem;
    text-align: center;
    pointer-events: none;
}
#broch-file-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: .75rem;
    pointer-events: none;
}
#broch-preview-img {
    max-height: 140px;
    max-width: 100%;
    border-radius: 6px;
    object-fit: contain;
}
#broch-preview-name { font-size: .78rem; color: #7a6f69; }

.broch-submit-btn {
    width: 100%;
    padding: .9rem;
    background: var(--gal-tierra);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
    font-family: inherit;
    margin-top: .5rem;
}
.broch-submit-btn:hover { background: var(--gal-tierra-osc); }
.broch-submit-btn:disabled { opacity: .6; cursor: not-allowed; }

.broch-notice {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: .95rem;
}
.broch-notice--success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.broch-notice--error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ── Vacío ──────────────────────────────────────────────── */
.broch-gal-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #aaa;
}

@media (max-width: 600px) {
    .broch-form-row { grid-template-columns: 1fr; }
    .broch-submit-form-wrap { padding: 1.5rem; }
    .broch-lightbox-prev { left: .25rem; }
    .broch-lightbox-next { right: .25rem; }
    .broch-photos-grid-frontend { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
