/* Instagram-style Stories */

.comma-stories {
    overflow: hidden;
    padding: 8px 0 12px;
}

.comma-stories-track .swiper-slide {
    width: auto;
}

.comma-story-thumb-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 78px;
}

.comma-story-ring {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    transition: background 0.25s ease;
}

.comma-story-ring.is-seen {
    background: #c7c7c7;
}

.comma-story-ring img {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    display: block;
}

.comma-story-name {
    font-size: 12px;
    font-weight: 400;
    color: #262626;
    max-width: 74px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    line-height: 1.2;
}

/* Viewer overlay */
.comma-story-viewer {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}

.comma-story-viewer.is-open {
    display: flex;
}

.comma-story-viewer-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
}

.comma-story-viewer-frame {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    height: 100%;
    max-height: 100vh;
    background: #000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@media (min-width: 769px) {
    .comma-story-viewer-frame {
        height: min(90vh, 820px);
        border-radius: 12px;
        box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    }
}

/* Progress bars */
.comma-story-progress {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    z-index: 20;
    display: flex;
    gap: 4px;
    height: 2px;
}

.comma-story-progress-segment {
    flex: 1;
    height: 100%;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 2px;
    overflow: hidden;
}

.comma-story-progress-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: #fff;
    border-radius: 2px;
}

.comma-story-progress-segment.is-done .comma-story-progress-fill {
    width: 100%;
}

/* Header */
.comma-story-header {
    position: absolute;
    top: 18px;
    left: 12px;
    right: 12px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 10px;
}

.comma-story-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.comma-story-header-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.comma-story-header-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comma-story-header-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.2;
}

.comma-story-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    flex-shrink: 0;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.comma-story-close:hover {
    opacity: 1;
}

/* Media */
.comma-story-media {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    min-height: 0;
}

.comma-story-slide-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

/* Tap zones (Instagram: left = prev, right = next) */
.comma-story-tap {
    position: absolute;
    top: 60px;
    bottom: 80px;
    z-index: 15;
    cursor: pointer;
}

.comma-story-tap-prev {
    left: 0;
    width: 35%;
}

.comma-story-tap-next {
    right: 0;
    width: 65%;
}

/* CTA button */
.comma-story-cta {
    position: absolute;
    bottom: 24px;
    left: 16px;
    right: 16px;
    z-index: 20;
    display: flex;
    justify-content: center;
}

.comma-story-cta-link {
    display: inline-block;
    background: #fff;
    color: #262626;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
}

.comma-story-cta-link:hover {
    background: #f5f5f5;
    color: #262626;
    transform: scale(1.02);
}

/* Pause indicator */
.comma-story-viewer.is-paused .comma-story-progress-fill {
    transition: none !important;
}

/* Admin gallery metabox */
.remove-image {
    color: darkred;
}

#gallery-metabox-list li {
    float: left;
    width: 150px;
    text-align: center;
    margin: 10px 10px 10px 0;
    cursor: move;
}

.gallery-image {
    height: 150px;
    width: 100%;
    margin-bottom: 10px;
}

img.image-preview {
    height: 100%;
    width: 100%;
    object-fit: contain;
}
