/* SavvyGreat Snapic photo gallery.
   Local-only CSS; no external font, stylesheet, image, or API dependency. */

.sgsnapic-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.sgsnapic-token { display: none !important; }

.sgsnapic-photo-page {
    width: min(1440px, calc(100% - 16px));
    margin: 0 auto;
    padding: 8px 0 40px;
}

.sgsnapic-photo-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 3px;
}

.sgsnapic-photo {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    aspect-ratio: 1 / 1;
    padding: 0;
    border: 0;
    border-radius: 4px;
    overflow: hidden;
    background: var(--sgcv-surface-container-high, #ece6f0);
    cursor: pointer;
}

.sgsnapic-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: rgba(255, 255, 255, 0);
    transition: background-color 120ms ease;
}

.sgsnapic-photo:hover::after { background: rgba(255, 255, 255, .09); }
.sgsnapic-photo:focus-visible {
    z-index: 2;
    outline: 3px solid var(--sgcv-primary, #6750a4);
    outline-offset: 2px;
}

.sgsnapic-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.001);
}

.sgsnapic-photo-sentinel {
    min-height: 42px;
    display: grid;
    place-items: center;
    padding: 8px 0;
    color: var(--sgcv-on-surface-variant, #49454f);
    font-size: 13px;
}

.sgsnapic-photo-viewer {
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    overflow: hidden;
    background: #050505;
    color: #fff;
}

.sgsnapic-photo-viewer[open] { display: block; }
.sgsnapic-photo-viewer::backdrop { background: #050505; }

.sgsnapic-photo-viewer-shell {
    position: relative;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #050505;
}

.sgsnapic-photo-viewer-topbar {
    min-height: 58px;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 46px;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    background: #0b0b0b;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.sgsnapic-photo-viewer-heading {
    min-width: 0;
    display: grid;
    justify-items: center;
    gap: 1px;
    text-align: center;
}

.sgsnapic-photo-viewer-heading strong {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
    font-weight: 700;
}

.sgsnapic-photo-viewer-heading time {
    color: rgba(255, 255, 255, .68);
    font-size: 12px;
}

.sgsnapic-photo-viewer-spacer { width: 42px; height: 42px; }

.sgsnapic-photo-icon-button,
.sgsnapic-photo-nav {
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
}

.sgsnapic-photo-icon-button {
    width: 42px;
    height: 42px;
    background: transparent;
}

.sgsnapic-photo-icon-button:hover { background: rgba(255, 255, 255, .10); }

.sgsnapic-photo-icon-button svg,
.sgsnapic-photo-nav svg,
.sgsnapic-photo-comments-title svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.sgsnapic-photo-icon-button:focus-visible,
.sgsnapic-photo-nav:focus-visible,
.sgsnapic-photo-reaction:focus-visible,
.sgsnapic-photo-comment-form textarea:focus-visible {
    outline: 3px solid var(--sgcv-primary, #d0bcff);
    outline-offset: 2px;
}

.sgsnapic-photo-viewer-content {
    min-height: 0;
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
    overflow: hidden;
}

.sgsnapic-photo-stage {
    position: relative;
    min-width: 0;
    min-height: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #000;
}

.sgsnapic-photo-stage > img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.sgsnapic-photo-nav {
    position: absolute;
    top: 50%;
    z-index: 12;
    width: 48px;
    height: 48px;
    margin-top: -24px;
    background: rgba(20, 20, 20, .72);
    box-shadow: 0 5px 18px rgba(0, 0, 0, .28);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.sgsnapic-photo-nav svg { width: 30px; height: 30px; stroke-width: 2.6; }
.sgsnapic-photo-nav:hover { background: rgba(35, 35, 35, .92); }
.sgsnapic-photo-nav-prev { left: 14px; }
.sgsnapic-photo-nav-next { right: 14px; }

.sgsnapic-photo-info {
    min-height: 0;
    overflow-y: auto;
    padding: 22px;
    background: #111;
    border-left: 1px solid rgba(255, 255, 255, .08);
    color: #fff;
    scrollbar-width: thin;
}

.sgsnapic-photo-details h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.25;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.sgsnapic-photo-details time {
    display: block;
    margin-top: 6px;
    color: rgba(255, 255, 255, .62);
    font-size: 13px;
}

.sgsnapic-photo-details p {
    margin: 15px 0 0;
    color: rgba(255, 255, 255, .82);
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.sgsnapic-photo-reactions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin: 0 0 22px;
}

.sgsnapic-photo-reaction {
    min-height: 48px;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 8px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 24px;
    background: #202020;
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.sgsnapic-photo-reaction:hover { background: #292929; }
.sgsnapic-photo-reaction:disabled { opacity: .55; cursor: progress; }
.sgsnapic-photo-reaction svg { width: 22px; height: 22px; flex: 0 0 auto; fill: currentColor; }
.sgsnapic-photo-reaction span { min-width: 0; font-size: 12px; font-weight: 700; }
.sgsnapic-photo-reaction b {
    min-width: 14px;
    color: rgba(255, 255, 255, .72);
    font-size: 12px;
    text-align: center;
}

.sgsnapic-photo-message {
    min-height: 20px;
    margin: 10px 0 0;
    color: rgba(255, 255, 255, .68);
    font-size: 13px;
}

.sgsnapic-photo-message.is-error { color: #ffb4ab; }

.sgsnapic-photo-comments {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, .10);
}

.sgsnapic-photo-comments-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sgsnapic-photo-comments-title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sgsnapic-photo-comments-title svg { width: 20px; height: 20px; }
.sgsnapic-photo-comments-head h3 { margin: 0; font-size: 17px; font-weight: 700; }
.sgsnapic-photo-comments-head > span {
    min-width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    padding: 0 8px;
    border-radius: 14px;
    background: #292929;
    color: rgba(255, 255, 255, .75);
    font-size: 12px;
    font-weight: 700;
}

.sgsnapic-photo-comment-list { display: grid; gap: 16px; margin-top: 18px; }
.sgsnapic-photo-comment {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 11px;
    align-items: start;
}

.sgsnapic-photo-comment-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--sgcv-primary, #6750a4);
    color: var(--sgcv-on-primary, #fff);
    font-weight: 800;
}

.sgsnapic-photo-comment-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.sgsnapic-photo-comment-meta strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.sgsnapic-photo-comment-meta time { flex: 0 0 auto; color: rgba(255, 255, 255, .50); font-size: 11px; }
.sgsnapic-photo-comment p,
.sgsnapic-photo-comment-empty {
    margin: 5px 0 0;
    color: rgba(255, 255, 255, .78);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.sgsnapic-photo-comment-empty { margin-top: 0; }

.sgsnapic-photo-comment-form { display: grid; gap: 9px; margin-top: 22px; }
.sgsnapic-photo-comment-form label { color: rgba(255, 255, 255, .72); font-size: 13px; font-weight: 700; }
.sgsnapic-photo-comment-form textarea {
    width: 100%;
    min-height: 82px;
    box-sizing: border-box;
    resize: vertical;
    padding: 12px 13px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 16px;
    background: #1d1d1d;
    color: #fff;
    font: inherit;
}

.sgsnapic-photo-comment-form textarea::placeholder { color: rgba(255, 255, 255, .42); }

.sgsnapic-photo-signin {
    margin-top: 20px;
    padding: 13px 14px;
    border-radius: 16px;
    background: #202020;
}

.sgsnapic-photo-signin a { color: #fff; font-weight: 700; text-decoration: none; }

@media (max-width: 1180px) {
    .sgsnapic-photo-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .sgsnapic-photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .sgsnapic-photo-viewer-content { grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); }
    .sgsnapic-photo-info { padding: 18px; }
}

/* Mobile viewer: the photo owns the full viewport. Controls and information
   sit on the photo in an L-shaped composition: horizontal actions at the
   lower-left, then title/date/comments vertically toward the bottom. */
@media (max-width: 760px) {
    .sgsnapic-photo-page {
        width: calc(100% - 8px);
        padding-top: 4px;
    }

    .sgsnapic-photo-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 2px;
    }

    .sgsnapic-photo { border-radius: 2px; }

    .sgsnapic-photo-viewer,
    .sgsnapic-photo-viewer[open] {
        width: 100vw;
        height: 100dvh;
        overflow: hidden;
        background: #000;
    }

    .sgsnapic-photo-viewer-shell {
        position: relative;
        width: 100vw;
        height: 100dvh;
        min-height: 100dvh;
        overflow: hidden;
        display: block;
        background: #000;
    }

    .sgsnapic-photo-viewer-topbar {
        position: absolute;
        z-index: 40;
        top: 0;
        left: 0;
        right: 0;
        min-height: 64px;
        padding: calc(6px + env(safe-area-inset-top)) 10px 12px;
        border: 0;
        background: linear-gradient(to bottom, rgba(0, 0, 0, .72), rgba(0, 0, 0, 0));
        pointer-events: none;
    }

    .sgsnapic-photo-viewer-topbar .sgsnapic-photo-icon-button {
        width: 44px;
        height: 44px;
        background: rgba(0, 0, 0, .42);
        box-shadow: 0 3px 14px rgba(0, 0, 0, .26);
        backdrop-filter: blur(7px);
        -webkit-backdrop-filter: blur(7px);
        pointer-events: auto;
    }

    .sgsnapic-photo-viewer-heading,
    .sgsnapic-photo-viewer-spacer { visibility: hidden; }

    .sgsnapic-photo-viewer-content {
        position: relative;
        width: 100vw;
        height: 100dvh;
        min-height: 0;
        display: block;
        overflow: hidden;
    }

    .sgsnapic-photo-stage {
        position: absolute;
        z-index: 1;
        inset: 0;
        width: 100%;
        height: 100%;
        min-height: 0;
        background: #000;
    }

    .sgsnapic-photo-stage > img {
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        object-fit: contain;
    }

    .sgsnapic-photo-nav {
        z-index: 35;
        width: 46px;
        height: 46px;
        margin-top: -23px;
        background: rgba(0, 0, 0, .48);
        box-shadow: 0 4px 16px rgba(0, 0, 0, .32);
    }

    .sgsnapic-photo-nav svg { width: 28px; height: 28px; stroke-width: 2.8; }
    .sgsnapic-photo-nav-prev { left: 8px; }
    .sgsnapic-photo-nav-next { right: 8px; }

    .sgsnapic-photo-info {
        position: absolute;
        z-index: 30;
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        max-height: 50dvh;
        min-height: 0;
        box-sizing: border-box;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 96px 14px calc(16px + env(safe-area-inset-bottom));
        border: 0;
        color: #fff;
        background: linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0) 0%,
            rgba(0, 0, 0, .36) 22%,
            rgba(0, 0, 0, .82) 54%,
            rgba(0, 0, 0, .96) 100%
        );
        scrollbar-width: thin;
    }

    .sgsnapic-photo-reactions {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: nowrap;
        gap: 8px;
        width: max-content;
        max-width: 100%;
        margin: 0 0 12px;
    }

    .sgsnapic-photo-reaction {
        flex: 0 0 auto;
        width: auto;
        min-width: 48px;
        min-height: 44px;
        padding: 0 11px;
        border-color: rgba(255, 255, 255, .22);
        background: rgba(12, 12, 12, .56);
        box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    .sgsnapic-photo-details {
        max-width: min(90vw, 560px);
        padding-left: 2px;
    }

    .sgsnapic-photo-details h2 {
        font-size: 19px;
        line-height: 1.24;
        text-shadow: 0 2px 8px rgba(0, 0, 0, .55);
    }

    .sgsnapic-photo-details time {
        margin-top: 4px;
        color: rgba(255, 255, 255, .78);
        font-size: 12px;
    }

    .sgsnapic-photo-details p {
        display: -webkit-box;
        margin-top: 7px;
        overflow: hidden;
        color: rgba(255, 255, 255, .88);
        font-size: 13px;
        line-height: 1.38;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
    }

    .sgsnapic-photo-message {
        min-height: 0;
        margin: 7px 0 0 2px;
        text-shadow: 0 2px 8px rgba(0, 0, 0, .48);
    }

    .sgsnapic-photo-comments {
        max-width: min(94vw, 620px);
        margin-top: 10px;
        padding: 9px 2px 0;
        border-top-color: rgba(255, 255, 255, .18);
    }

    .sgsnapic-photo-comments-title svg { width: 19px; height: 19px; }
    .sgsnapic-photo-comments-head h3 { font-size: 14px; }
    .sgsnapic-photo-comments-head > span {
        min-width: 24px;
        height: 24px;
        padding: 0 7px;
        background: rgba(255, 255, 255, .14);
    }

    .sgsnapic-photo-comment-list {
        max-height: 18dvh;
        overflow-y: auto;
        gap: 11px;
        margin-top: 11px;
        padding-right: 4px;
    }

    .sgsnapic-photo-comment { grid-template-columns: 32px minmax(0, 1fr); gap: 9px; }
    .sgsnapic-photo-comment-avatar { width: 32px; height: 32px; font-size: 12px; }
    .sgsnapic-photo-comment p,
    .sgsnapic-photo-comment-empty { font-size: 12px; }
    .sgsnapic-photo-comment-form { margin-top: 13px; }
    .sgsnapic-photo-comment-form textarea {
        min-height: 64px;
        resize: none;
        background: rgba(20, 20, 20, .72);
    }

    .sgsnapic-photo-signin {
        margin-top: 12px;
        padding: 10px 12px;
        background: rgba(25, 25, 25, .72);
    }
}

@media (max-width: 420px) {
    .sgsnapic-photo-reaction { min-width: 46px; padding: 0 10px; }
    .sgsnapic-photo-reaction span { display: none; }
    .sgsnapic-photo-reaction b { min-width: 12px; }
    .sgsnapic-photo-info { max-height: 48dvh; padding-inline: 11px; }
}

@media (max-width: 380px) {
    .sgsnapic-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    .sgsnapic-photo::after { transition: none; }
}
