/**
 * PhotoEZ Event Gallery — share panel on the public gallery page.
 *
 * Kept deliberately neutral so it inherits the host theme's look rather than
 * fighting it, matching how the rest of the public gallery is styled.
 */

/* Matches the spacing and centring of its siblings in .peez-event-header
   (.peez-event-header-cart, .peez-event-download-all). */
.peez-event-share {
    margin: 18px 0 0;
    text-align: center;
}

/* Mirrors .peez-download-all in event-gallery.css so the two header buttons
   read as a pair, in the palette's own deep blue instead of that button's
   green. Same specificity and !important, for the same reason: host themes
   style .button aggressively and would otherwise win.

   #3d6f8f is --peez-ejs-cyan-dim from the gallery palette. It carries 5.4:1
   against white — the green it sits beside is 5.0:1, and the lighter
   --peez-ejs-accent would only manage 3.5:1, which fails AA for 13px bold. */
.peez-event-gallery .peez-share-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 240px;
    margin: 0;
    padding: 14px 32px;
    border: 1px solid var(--peez-ejs-cyan-dim, #3d6f8f) !important;
    border-radius: var(--peez-radius, 6px);
    background: var(--peez-ejs-cyan-dim, #3d6f8f) !important;
    color: #fff !important;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: var(--peez-shadow, 0 2px 10px rgba(26, 58, 82, 0.08));
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.peez-event-gallery .peez-share-toggle:hover {
    transform: translateY(-1px);
    background: #2f5872 !important;
    border-color: #2f5872 !important;
    color: #fff !important;
    box-shadow: var(--peez-shadow-hover, 0 4px 16px rgba(26, 58, 82, 0.14));
}

.peez-event-gallery .peez-share-toggle:focus-visible {
    outline: 2px solid var(--peez-ejs-accent, #5a8fad);
    outline-offset: 2px;
}

/* auto side margins, or the capped width would pin the panel to the left edge
   of a header that is otherwise centred. */
.peez-share-panel {
    margin: 12px auto 0;
    padding: 16px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.6);
    max-width: 320px;
}

.peez-share-panel[hidden] {
    display: none;
}

.peez-share-qr {
    display: block;
    width: 200px;
    height: auto;
    max-width: 100%;
    margin: 0 auto 10px;
    /* The PNG is pure black-and-white modules; smoothing on upscale is what
       makes a screen-scanned code fail, so keep the edges hard. */
    image-rendering: pixelated;
}

.peez-share-hint {
    margin: 0 0 10px;
    font-size: 0.9em;
    text-align: center;
}

.peez-share-row {
    display: flex;
    gap: 6px;
    align-items: stretch;
}

.peez-share-url {
    flex: 1 1 auto;
    min-width: 0;
    padding: 6px 8px;
    font-size: 0.85em;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

/* Secondary on purpose — it sits inside the panel and shouldn't compete with
   the toggle. Sized explicitly so a theme's .button padding can't blow it out
   of line with the input beside it. */
.peez-event-gallery .peez-share-copy {
    flex: 0 0 auto;
    padding: 6px 14px;
    border: 1px solid var(--peez-ejs-border, #b8d0e0) !important;
    border-radius: 4px;
    background: #fff !important;
    color: var(--peez-ejs-ink, #1a3a52) !important;
    font-size: 0.85em;
    font-weight: 600;
    line-height: 1.4;
    text-transform: none;
    cursor: pointer;
}

.peez-event-gallery .peez-share-copy:hover {
    background: var(--peez-ejs-surface, #e8f2f8) !important;
}

.peez-share-download {
    margin: 10px 0 0;
    text-align: center;
    font-size: 0.85em;
}

@media (max-width: 480px) {
    .peez-share-panel {
        max-width: none;
    }
}
