/* ========================================================================
 * Version 0.34.0 – compact photo actions and sticky quick navigation
 * ======================================================================== */

/* The large stacked action buttons used valuable room in the object summary.
   Keep the actions compact so custom object facts can use the full card. */
body.dsa-photo-template .dsa-photo-actions {
    display: none !important;
}

.dsa-photo-quick-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: .42rem;
}

.dsa-photo-quick-actions--summary {
    margin-top: 1.15rem;
}

.dsa-photo-quick-action,
.dsa-photo-wikipedia-action {
    box-sizing: border-box;
    border: 1px solid var(--dsa-border);
    background: rgba(255,255,255,.035);
    color: var(--dsa-text) !important;
    text-decoration: none !important;
    transition: border-color .16s ease, background-color .16s ease, color .16s ease, transform .16s ease;
}

.dsa-photo-quick-action {
    display: inline-flex;
    min-height: 2.55rem;
    align-items: center;
    justify-content: center;
    gap: .42rem;
    padding: .52rem .68rem;
    border-radius: .52rem;
    font-size: .82rem;
    font-weight: 720;
    line-height: 1.15;
    white-space: nowrap;
}

.dsa-photo-quick-action svg {
    width: 1.02rem;
    height: 1.02rem;
    flex: 0 0 auto;
}

.dsa-photo-quick-action-tech {
    border-color: rgba(139,205,255,.32);
    background: rgba(20,91,142,.52);
    color: #fff !important;
}

.dsa-photo-wikipedia-action {
    display: inline-flex;
    width: 2.55rem;
    height: 2.55rem;
    flex: 0 0 2.55rem;
    align-items: center;
    justify-content: center;
    padding: .55rem;
    border-radius: 50%;
}

.dsa-photo-wikipedia-action svg {
    display: block;
    width: 100%;
    height: 100%;
}

.dsa-photo-quick-action:hover,
.dsa-photo-quick-action:focus-visible,
.dsa-photo-wikipedia-action:hover,
.dsa-photo-wikipedia-action:focus-visible {
    border-color: var(--dsa-accent);
    background: rgba(114,191,255,.11);
    color: var(--dsa-accent-strong) !important;
    outline: none;
}

.dsa-photo-quick-action-tech:hover,
.dsa-photo-quick-action-tech:focus-visible {
    background: #1972ad;
    color: #fff !important;
}

.dsa-label-short { display: none; }

/* This duplicate action row lives in the normal document flow. It becomes
   visible only after the photo overview has scrolled away and then remains
   directly below the sticky site header. The long object text itself always
   remains fully visible and scrollable. */
.dsa-photo-sticky-nav {
    position: sticky;
    z-index: 45;
    top: 5.55rem;
    width: fit-content;
    max-width: 100%;
    margin: -1rem 0 1rem auto;
    padding: .38rem;
    border: 1px solid var(--dsa-border);
    border-radius: .68rem;
    background: rgba(7,16,25,.9);
    box-shadow: 0 .65rem 1.8rem rgba(0,0,0,.24);
    backdrop-filter: blur(14px);
}

.admin-bar .dsa-photo-sticky-nav {
    top: calc(5.55rem + 32px);
}

.dsa-photo-sticky-nav:empty {
    display: none;
}

/* Anchor jumps stop below the fixed/sticky navigation instead of hiding the
   section heading underneath it. */
#objektdetails,
#aufnahme-technik {
    scroll-margin-top: 8.8rem;
}

/* Slightly tighten the summary now that the buttons no longer need a full
   vertical stack. More of the right-hand card is available for object facts. */
body.dsa-photo-template .dsa-photo-summary {
    padding-bottom: clamp(1rem, 1.7vw, 1.35rem);
}

@media (max-width: 1000px) {
    .dsa-photo-sticky-nav {
        margin-top: -.75rem;
    }
}

@media (max-width: 782px) {
    .admin-bar .dsa-photo-sticky-nav {
        top: calc(5.55rem + 46px);
    }
}

@media (max-width: 620px) {
    .dsa-photo-quick-actions {
        gap: .35rem;
    }

    .dsa-photo-quick-action {
        min-height: 2.35rem;
        padding: .45rem .58rem;
        font-size: .78rem;
    }

    .dsa-photo-wikipedia-action {
        width: 2.35rem;
        height: 2.35rem;
        flex-basis: 2.35rem;
        padding: .5rem;
    }

    .dsa-photo-quick-actions--summary {
        margin-top: 1rem;
    }

    .dsa-label-full { display: none; }
    .dsa-label-short { display: inline; }

    .dsa-photo-sticky-nav {
        top: 4.72rem;
        width: 100%;
        margin: -.6rem 0 .9rem;
        padding: .32rem;
        border-radius: .58rem;
    }

    .dsa-photo-sticky-nav .dsa-photo-quick-actions {
        justify-content: center;
    }

    .admin-bar .dsa-photo-sticky-nav {
        top: calc(4.72rem + 46px);
    }

    #objektdetails,
    #aufnahme-technik {
        scroll-margin-top: 8rem;
    }
}

@media (prefers-reduced-motion: no-preference) {
    html:has(body.dsa-photo-template) {
        scroll-behavior: smooth;
    }
}
