/* ---------------------------------------------------------------------------
   S.S. Public School - photo gallery + full-screen viewer.
   Album grid on photo-gallery.cshtml; the viewer opens in place, no library.
   Primary colour matches css/color/color1.css (#084C87).
   --------------------------------------------------------------------------- */

.ssps-gallery-title {
    color: #084C87;
    font-weight: 800;
    margin: 0 0 10px;
}

.ssps-album-count {
    color: #777;
    font-size: 14px;
    margin-bottom: 24px;
}

.ssps-gallery-msg {
    padding: 45px 0;
    text-align: center;
    color: #777;
}

/* ---------------- album / photo grid ---------------- */

.ssps-grid {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    margin: 0 -9px;
}

.ssps-grid-item {
    width: 25%;
    padding: 9px;
}

.ssps-photo {
    display: block;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #eef2f6;
    box-shadow: 0 2px 10px rgba(0,0,0,.12);
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}

.ssps-photo:hover,
.ssps-photo:focus {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,.22);
    text-decoration: none;
}

.ssps-photo img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

.ssps-photo:hover img {
    transform: scale(1.06);
}

.ssps-photo span {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 26px 10px 8px;
    background: linear-gradient(rgba(0,0,0,0), rgba(0,0,0,.82));
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Spinner on the card while its album is being fetched. */
.ssps-photo.is-loading:after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border: 3px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ssps-spin .8s linear infinite;
}

.ssps-btn {
    display: inline-block;
    padding: 11px 26px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none !important;
    background: transparent;
    color: #084C87 !important;
    border: 2px solid #084C87;
    cursor: pointer;
    transition: all .25s ease;
}

.ssps-btn:hover,
.ssps-btn:focus {
    background: #084C87;
    color: #fff !important;
}

.ssps-more-caret {
    margin-left: 6px;
    animation: ssps-caret-nudge 1.6s ease-in-out infinite;
}

#ssps-loadmore:hover .ssps-more-caret {
    animation-play-state: paused;
}

/* ---------------- full-screen viewer ---------------- */

.ssps-lb {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    background-color: rgba(6, 14, 24, .96);
    text-align: center;
    /* visibility (not display) so the opacity transition can actually run */
    visibility: hidden;
    opacity: 0;
    transition: opacity .28s ease, visibility 0s linear .28s;
}

.ssps-lb.is-open {
    visibility: visible;
    opacity: 1;
    transition: opacity .28s ease, visibility 0s linear 0s;
}

.ssps-lb .ssps-lb-stage {
    position: absolute;
    top: 58px;
    left: 70px;
    right: 70px;
    bottom: 62px;
}

.ssps-lb img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0,0,0,.6);
}

.ssps-lb .ssps-lb-stage img {
    opacity: 0;
    transform: scale(.94);
    transition: opacity .3s ease, transform .3s cubic-bezier(.2,.8,.3,1), filter .3s ease;
}

.ssps-lb.is-open .ssps-lb-stage img {
    opacity: 1;
    transform: scale(1);
}

/* Cross-fade while the next photo is swapped in. */
.ssps-lb.is-swapping .ssps-lb-stage img {
    opacity: 0;
    transform: scale(.97);
}

/* Full-size photo still downloading: blurred thumbnail + spinner. */
.ssps-lb.is-loading .ssps-lb-stage img {
    filter: blur(8px);
}

.ssps-lb.is-loading .ssps-lb-stage:after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 38px;
    height: 38px;
    margin: -19px 0 0 -19px;
    border: 3px solid rgba(255,255,255,.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ssps-spin .8s linear infinite;
}

.ssps-lb-btn {
    position: absolute;
    border: 0;
    background: rgba(255,255,255,.13);
    color: #fff;
    border-radius: 50%;
    width: 46px;
    height: 46px;
    font-size: 22px;
    line-height: 46px;
    padding: 0;
    cursor: pointer;
    transition: background .18s ease;
}

.ssps-lb-btn:hover {
    background: #084C87;
}

.ssps-lb-close { top: 16px; right: 20px; }
.ssps-lb-play  { top: 16px; right: 76px; width: auto; border-radius: 23px; padding: 0 16px; font-size: 14px; }
.ssps-lb-prev  { left: 14px; top: 50%; margin-top: -23px; }
.ssps-lb-next  { right: 14px; top: 50%; margin-top: -23px; }

.ssps-lb-count {
    position: absolute;
    top: 18px;
    left: 22px;
    color: #e6edf3;
    font-size: 14px;
}

.ssps-lb-album {
    position: absolute;
    top: 18px;
    left: 90px;
    right: 260px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ssps-lb-cap {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 22px;
    color: #e6edf3;
    font-size: 14px;
    padding: 0 70px;
}

/* Controls drift in just after the photo. */
.ssps-lb .ssps-lb-btn,
.ssps-lb .ssps-lb-cap,
.ssps-lb .ssps-lb-count,
.ssps-lb .ssps-lb-album {
    opacity: 0;
    transition: opacity .25s ease .12s;
}

.ssps-lb.is-open .ssps-lb-btn,
.ssps-lb.is-open .ssps-lb-cap,
.ssps-lb.is-open .ssps-lb-count,
.ssps-lb.is-open .ssps-lb-album {
    opacity: 1;
}

@keyframes ssps-spin {
    to { transform: rotate(360deg); }
}

@keyframes ssps-caret-nudge {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(3px); }
}

@media (max-width: 991px) {
    .ssps-grid-item { width: 33.3333%; }
}

@media (max-width: 767px) {
    .ssps-grid-item { width: 50%; }
    .ssps-photo img { height: 130px; }

    .ssps-lb .ssps-lb-stage {
        left: 12px;
        right: 12px;
        top: 62px;
        bottom: 70px;
    }

    .ssps-lb-cap { padding: 0 14px; }
    .ssps-lb-album { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .ssps-lb,
    .ssps-lb .ssps-lb-stage img,
    .ssps-lb .ssps-lb-btn,
    .ssps-lb .ssps-lb-cap { transition: none; }
    .ssps-more-caret { animation: none; }
}
