/* =========================================================================
   Weekly Challenge — podium, submissions gallery, and lightbox styling.
   ========================================================================= */

/* ---------- Winner podium ---------- */
.challenge-podium {
    position: relative;
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: contain;
    min-height: 410px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* "Winner of Week of ..." caption pinned to the bottom of the podium image */
.challenge-podium-caption {
    position: absolute;
    bottom: 0.5rem;
    left: 0;
    right: 0;
    text-align: center;
    font-weight: 700;
    color: var(--suss-red, #DA291C);
}

.challenge-podium-photo {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    display: block;
    margin: 0 auto;
    margin-top: 50px;
}
#section_weekly_challenge_group .challenge-podium-photo {
    margin-top: 90px;
}

@media screen and (max-width: 991px) {
    .challenge-podium {
        min-height: 420px;
    }
    .challenge-podium-photo {
        width: 150px;
        height: 150px;
        margin-top: 50px;
    }
}
@media screen and (max-width: 767px) {
    .challenge-podium {
        min-height: 350px;
    }
    .challenge-podium-photo {
        width: 120px;
        height: 120px;
        margin-top: 50px;
    }
}
@media screen and (max-width: 575px) {
    .challenge-podium {
        min-height: 310px;
    }
    .challenge-podium-photo {
        width: 100px;
        height: 100px;
        margin-top: 50px;
    }
}

.challenge-podium-link {
    text-decoration: none;
}

.challenge-podium-name {
    display: inline-block;
    margin-top: 0.6rem;
    padding: 0.25rem 0.9rem;
    background-color: var(--suss-blue, #001E60);
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    border-radius: 20px;
    cursor: pointer;
}

.challenge-podium-group {
    display: inline-block;
    margin-top: 0.4rem;
    padding: 0.2rem 0.85rem;
    background-color: var(--suss-red, #DA291C);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 20px;
    cursor: pointer;
}

/* ---------- Submissions gallery ---------- */
.challenge-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.challenge-thumb {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border: 1px solid darkgray;
    border-radius: 0.35rem;
    aspect-ratio: 1 / 1;
    background: #f0f0f0;
}

.challenge-thumb img,
.challenge-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
    display: block;
}

.challenge-thumb:hover img {
    transform: scale(1.06);
}

/* Play glyph overlaid on video thumbnails */
.challenge-thumb-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border-radius: 50%;
    font-size: 1.2rem;
    padding-left: 3px; /* optically centre the triangle */
    pointer-events: none;
}

/* "Vote" button pinned to the bottom of each gallery entry */
.challenge-vote-btn {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    background: var(--suss-red, #DA291C);
    color: #fff;
    border: 0;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 4px 14px;
    border-radius: 14px;
    cursor: pointer;
    opacity: 0.95;
}

.challenge-vote-btn:hover {
    opacity: 1;
}

/* Count badge on multi-photo entries (e.g. Individual week 2's 4-photo set) */
.challenge-thumb-count {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    z-index: 2;
}

/* Multi-photo entry shown as a grid inside the lightbox */
.challenge-lb-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 4px;
}

.challenge-lb-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0.35rem;
}

.challenge-thumb-winner-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: #ffc107;
    color: #212529;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

/* ---------- Lightbox ---------- */
#challengeLightbox .modal-content {
    background: transparent;
    border: 0;
}

#challengeLightboxImg,
#challengeLightboxVideo {
    max-height: 80vh;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
    border-radius: 0.35rem;
}

.challenge-lb-close {
    /* Paint the X white via Bootstrap's own icon variable (5.3),
       instead of .btn-close-white (its filter:invert() would also flip our dark pill light). */
    --bs-btn-close-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e");

    position: absolute;
    top: 0;
    right: 0;
    z-index: 5;
    padding: 0.6rem;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 0.35rem;
    opacity: 1; /* Bootstrap's btn-close starts semi-transparent; keep it solid on the dark pill */
}

.challenge-lb-close:hover,
.challenge-lb-close:focus {
    background-color: rgba(0, 0, 0, 0.7);
    opacity: 1;
}

.challenge-lb-prev,
.challenge-lb-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    border: 0;
    font-size: 2rem;
    line-height: 1;
    padding: 0.25rem 0.75rem;
    border-radius: 0.35rem;
    cursor: pointer;
}

.challenge-lb-prev:hover,
.challenge-lb-next:hover {
    background: rgba(0, 0, 0, 0.7);
}

.challenge-lb-prev {
    left: 0;
}

.challenge-lb-next {
    right: 0;
}



.past-week-voting-section {
    padding: 20px 0 35px;
    border-radius: 20px;
    background-color: var(--suss-blue, #001E60);
}



/* 
Week tabs — styled to keep the old ".challenge-weekbox" look: light-blue rounded pills with bold blue text and a calendar icon (see .challenge-weekbox in main.css).
The SELECTED week is exactly that light-blue pill, so the common single-week case looks identical to before; other open weeks are shown as muted outlined pills you can click. Overrides Bootstrap's default .nav-tabs underline/notch styling. 
*/
.challenge-week-tabs {
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    border-bottom: 0;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 14px;
    background-color: #d8ebf8;
}
.challenge-week-tabs .nav-link {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 0;
    padding: 10px 22px;

    font-family: 'montserrat-bold', sans-serif;
    color: #7a93b8; /* muted for unselected weeks */

    border: 1px solid #d6e6f5;
    border-radius: 14px;
    background-color: transparent;
}
.challenge-week-tabs .nav-link i {
    font-size: 1.4rem;
}
.challenge-week-tabs .nav-link:hover,
.challenge-week-tabs .nav-link:focus {
    color: var(--suss-blue, #001E60);
    border-color: transparent;
    background-color: #d8ebf8;
}
/* Selected week — the original .challenge-weekbox appearance. */
.challenge-week-tabs .nav-link.active {
    color: var(--suss-blue, #001E60);
    border-color: transparent;
    background-color: #eaf4fb;
}

/* Cross-week "Vote for Week N" nav button (blue, near the top of a week page). */
.challenge-week-nav-btn {
    font-weight: 700;
    color: var(--suss-blue, #001E60);
    background-color: #eaf4fb;
}
.challenge-week-nav-btn i {
    margin-right: 6px;
}

/* Locked (not-yet-open) week placeholder. */
.challenge-locked {
    padding: 40px 20px;
    border: 1px dashed #c9d6e5;
    border-radius: 14px;
    background-color: #f4f9fd;
}
.challenge-locked__icon {
    font-size: 2.5rem;
    color: var(--suss-blue, #001E60);
}
