/* ============================================================
   SF Content Card  --  Gallery carousel & Video thumbnail cards
   ============================================================ */

/* ---- Card base ---- */
.sf-card {
    background: #181B21;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
}
.sf-card__media {
    position: relative;
    width: 100%;
    overflow: hidden;
}
.sf-card__media:hover {
    filter: brightness(1.06);
}
/* ---- Clickable card media overlay ---- */
.sf-card {
    cursor: pointer;
}
.sf-card__media {
    position: relative;
}
.sf-card__media-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    text-decoration: none;
}
/* Keep carousel controls above the overlay link */
.sf-carousel__prev,
.sf-carousel__next {
    z-index: 3;
}
.sf-carousel__counter {
    z-index: 3;
}


/* ---- Info bar ---- */
.sf-card__info {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.sf-card__title {
    color: #c8cdd5;
    font-family: "DM Sans", sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sf-card__title:hover {
    color: #fff;
}
.sf-card__meta {
    color: #6b7280;
    font-family: "DM Sans", sans-serif;
    font-size: 12px;
    font-weight: 400;
}

/* ============================================================
   Gallery Carousel
   ============================================================ */
.sf-card__carousel {
    position: relative;
    width: 100%;
}
.sf-carousel__track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;            /* Firefox */
    -ms-overflow-style: none;         /* IE / Edge */
}
.sf-carousel__track::-webkit-scrollbar {
    display: none;                    /* Chrome / Safari */
}
.sf-carousel__slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #111318;
}
.sf-carousel__slide img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    display: block;
}

/* Prev / Next buttons */
.sf-carousel__prev,
.sf-carousel__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    padding: 0;
}
.sf-card__carousel:hover .sf-carousel__prev,
.sf-card__carousel:hover .sf-carousel__next {
    opacity: 1;
}
.sf-carousel__prev:hover,
.sf-carousel__next:hover {
    background: rgba(0, 0, 0, 0.8);
}
.sf-carousel__prev {
    left: 8px;
}
.sf-carousel__next {
    right: 8px;
}

/* Counter pill */
.sf-carousel__counter {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 2;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-family: "DM Sans", sans-serif;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 12px;
    pointer-events: none;
    line-height: 1;
}

/* ============================================================
   Video Thumbnail Card
   ============================================================ */
.sf-card--video .sf-card__play-trigger {
    display: block;
    position: relative;
    text-decoration: none;
    line-height: 0;
}
.sf-card--video .sf-card__thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}
.sf-card__play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background 0.2s, transform 0.2s;
    pointer-events: none;
}
.sf-card__play-icon svg {
    margin-left: 3px;  /* optical centering of play triangle */
}
.sf-card--video .sf-card__play-trigger:hover .sf-card__play-icon {
    background: rgba(220, 50, 70, 0.85);
    transform: translate(-50%, -50%) scale(1.08);
}

/* ============================================================
   Fallback post card
   ============================================================ */
.sf-card--post .sf-card__media a {
    display: block;
    line-height: 0;
}
.sf-card--post .sf-card__thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

/* ============================================================
   Video Modal
   ============================================================ */
.sf-video-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}
.sf-video-modal.is-active {
    opacity: 1;
    visibility: visible;
}
.sf-video-modal__content {
    position: relative;
    width: 94vw;
    max-width: 900px;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sf-video-modal__content video {
    width: 100%;
    max-height: 80vh;
    border-radius: 6px;
    background: #000;
    outline: none;
}
.sf-video-modal__close {
    position: absolute;
    top: -40px;
    right: 0;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.sf-video-modal__close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Mobile adjustments */
@media (max-width: 600px) {
    .sf-video-modal__content {
        width: 100vw;
        max-width: 100vw;
    }
    .sf-video-modal__close {
        top: 8px;
        right: 8px;
        background: rgba(0, 0, 0, 0.7);
    }
    .sf-carousel__prev,
    .sf-carousel__next {
        opacity: 0.7;
        width: 30px;
        height: 30px;
        font-size: 18px;
    }
}

/* ============================================================
   Per-Page Selector
   ============================================================ */
.sf-per-page {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    margin-bottom: 15px;
}
.sf-per-page__label {
    color: #8a8f98;
    font-size: 13px;
}
.sf-per-page__option {
    color: #8a8f98;
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s;
}
.sf-per-page__option:hover {
    color: #fff;
    background: rgba(59, 154, 232, 0.15);
}
.sf-per-page__option.sf-per-page--active {
    color: #fff;
    background: #3B9AE8;
}


/* ============================================================
   Publish Date & Meta Row
   ============================================================ */
.sf-card__meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.sf-card__date {
    color: #6b7280;
    font-family: "DM Sans", sans-serif;
    font-size: 12px;
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1;
    white-space: nowrap;
}
.sf-card__date-icon {
    opacity: 0.6;
    flex-shrink: 0;
}
