/* ============================================================
   Untersbergblick Galerie — Stil passend zum Theme
   ============================================================ */

.ubg {
    font-family: inherit;
    color: inherit;
    margin: 2rem 0;
}

/* --- Tabs --- */
.ubg-tabs {
    display: flex;
    justify-content: center;
    gap: 0;
    margin: 0 0 2rem;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.ubg-tab {
    background: transparent;
    border: none;
    padding: 12px 28px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #8a8578;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}
.ubg-tab:hover { color: #2a2a2a; }
.ubg-tab.is-active { color: #b8693d; }
.ubg-tab.is-active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -1px;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: #b8693d;
}

/* --- Panels --- */
.ubg-panel { display: none; }
.ubg-panel.is-active { display: block; }

/* --- Filter --- */
.ubg-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0 0 2rem;
}
.ubg-chip {
    padding: 7px 18px;
    font-family: inherit;
    font-size: 13px;
    letter-spacing: 0.05em;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    color: #6a6557;
    transition: all 0.15s;
}
.ubg-chip:hover {
    border-color: rgba(0,0,0,0.3);
    color: #2a2a2a;
}
.ubg-chip.is-active {
    background: #b8693d;
    color: #fff;
    border-color: #b8693d;
}

/* --- Grid --- */
.ubg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}
.ubg-grid--fotos {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* --- Card --- */
.ubg-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s, box-shadow 0.25s;
    text-decoration: none;
    color: inherit;
    display: block;
}
.ubg-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.10);
}
.ubg-card:focus-visible {
    outline: 2px solid #b8693d;
    outline-offset: 3px;
}

/* --- Thumb mit Play-Button --- */
.ubg-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #f4f1ea;
    overflow: hidden;
}
.ubg-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s;
}
.ubg-card:hover .ubg-thumb img {
    transform: scale(1.04);
}
.ubg-play {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(184, 105, 61, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}
.ubg-card:hover .ubg-play {
    background: #b8693d;
    transform: translate(-50%, -50%) scale(1.08);
}
.ubg-play::before {
    content: "";
    display: block;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 11px 0 11px 18px;
    border-color: transparent transparent transparent #fff;
    margin-left: 5px;
}

/* --- Meta --- */
.ubg-meta {
    padding: 16px 18px 20px;
}
.ubg-title {
    font-size: 18px;
    font-weight: 500;
    color: #2a2a2a;
    margin: 0 0 6px;
    line-height: 1.3;
    font-family: inherit;
}
.ubg-desc {
    font-size: 14px;
    line-height: 1.55;
    color: #6a6557;
    margin: 0 0 8px;
}
.ubg-cat {
    font-size: 11px;
    color: #b8693d;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 500;
}

/* --- Foto-Karte (kompakter) --- */
.ubg-card--foto .ubg-meta { padding: 12px 14px 16px; }
.ubg-card--foto .ubg-title { font-size: 15px; }
.ubg-card--foto .ubg-thumb { aspect-ratio: 4 / 3; }

/* --- Lightbox --- */
.ubg-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(20, 18, 14, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
}
.ubg-lightbox.is-open { display: flex; }
.ubg-lightbox-inner {
    position: relative;
    width: 100%;
    max-width: 1180px;
}
.ubg-lightbox-inner.is-video { aspect-ratio: 16 / 9; }
.ubg-lightbox iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
    border-radius: 6px;
}
.ubg-lightbox img {
    display: block;
    max-width: 100%;
    max-height: 85vh;
    width: auto;
    margin: 0 auto;
    border-radius: 6px;
}
.ubg-lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 15px;
    letter-spacing: 0.1em;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ubg-lightbox-close::before {
    content: "×";
    font-size: 28px;
    line-height: 1;
}
.ubg-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.ubg-lightbox-nav:hover { background: rgba(255,255,255,0.25); }
.ubg-lightbox-nav.is-prev { left: -64px; }
.ubg-lightbox-nav.is-next { right: -64px; }
.ubg-lightbox-nav::before {
    content: "";
    width: 12px;
    height: 12px;
    border-top: 2px solid #fff;
    border-right: 2px solid #fff;
    transform: rotate(45deg);
}
.ubg-lightbox-nav.is-prev::before { transform: rotate(-135deg); margin-left: 4px; }
.ubg-lightbox-nav.is-next::before { margin-right: 4px; }
.ubg-lightbox-caption {
    color: #f4f1ea;
    text-align: center;
    margin: 16px 0 0;
    font-size: 14px;
}

/* --- Mobile --- */
@media (max-width: 768px) {
    .ubg-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
    .ubg-title { font-size: 15px; }
    .ubg-desc { font-size: 13px; }
    .ubg-tab { padding: 10px 16px; font-size: 12px; }
    .ubg-meta { padding: 12px 14px 16px; }
    .ubg-play { width: 48px; height: 48px; }
    .ubg-play::before { border-width: 8px 0 8px 13px; }
    .ubg-lightbox-nav.is-prev { left: 8px; }
    .ubg-lightbox-nav.is-next { right: 8px; }
    .ubg-lightbox-close { top: -38px; }
}
