.stories-controls {
    max-width: 600px;
    margin: 32px auto 0 auto;
    display: flex;
    gap: 12px;
}

.stories-search {
    flex: 1;
    padding: 10px 16px;
    font-size: 1.1rem;
    border-radius: 10px;
    border: 1px solid #ccc;
}

.stories-container {
    margin: 32px auto 0 auto;
    padding: 0 16px 48px 16px;
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    height: auto;
    gap: 2%; /* Total with ".story-card" max-width */
}

.story-card {
    background: rgba(60, 60, 60, 0.18);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    width: 32%; /* Total with ".story-container" gap */
    height: 400px;
    position: relative;
    transition: box-shadow 0.2s, transform 0.2s;
    backdrop-filter: blur(2px);
    margin: 16px 0;
}

.story-card:hover {
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.28);
    transform: translateY(-4px) scale(1.02);
}

.story-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.story-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 24px 20px 20px 20px;
    background: linear-gradient(0deg, rgba(40, 40, 40, 0.82) 90%, rgba(255, 255, 255, 0.01) 100%);
    color: #fff;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    z-index: 2;
}

.story-title {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 8px;
    font-style: italic;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.story-excerpt {
    color: #f3f3f3;
    font-size: 16px;
    line-height: 1.5;
    max-height: 3.2em;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

@media (max-width: 900px) {
    .stories-container {
        gap: 2%;
    }

    .story-card {
        width: 48%;
    }
}

@media (max-width: 600px) {
    .stories-container {
        gap: 0;
    }

    .story-card {
        width: 100%;
    }
}

/* Modal */
#story-modal-content {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    background: none;
    border-radius: 32px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    max-width: 100%;
    width: 90vw;
    min-height: 340px;
    height: 90vh;
    overflow: hidden;
}

/* Modal Resizer */
#story-modal-resizer {
    width: 24px; /* Increased from 12px */
    cursor: ew-resize;
    background: rgba(0,0,0,0.08);
    position: relative;
    z-index: 10;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}
#story-modal-resizer:hover {
    background: rgba(0,0,0,0.18);
}
#story-modal-resizer:after {
    content: '';
    display: block;
    width: 10px;   /* Increased from 4px */
    height: 48px;  /* Increased from 40px */
    margin: auto;
    border-radius: 5px;
    background: #bbb;
    box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(0,0,0,0.10);
}
@media (max-width: 700px) {
    #story-modal-resizer {
        width: 100%;
        height: 24px; /* Increased from 12px */
        min-height: 24px;
        cursor: ns-resize;
    }
    #story-modal-resizer:after {
        width: 48px;  /* Increased from 40px */
        height: 10px; /* Increased from 4px */
    }
}
/* END - Modal Resizer */

.story-modal-card {
    flex-basis: 30%;
    min-width: 40px;
    background: rgba(255,255,255,0.92);
    border-radius: 0 32px 32px 0;
    box-shadow: none;
    padding: 32px 28px 28px 28px;
    text-align: center;
    overflow-y: auto; /* Make card scrollable */
    position: relative;
    transition: flex-basis 0.2s, padding 1s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.story-modal-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 18px;
    color: #222;
}
.story-modal-body {
    color: #222;
    font-size: 17px;
    line-height: 1.6;
    text-align: left;
    transition: opacity 0.3s;
    white-space: pre-line;
}

/* Responsive: stack on mobile, vertical resizer */
@media (max-width: 700px) {
    #story-modal-content {
        flex-direction: column;
        max-width: 98vw;
        width: 98vw;
        height: 98vh;
        border-radius: 18px;
    }
    #story-modal-image {
        width: 100% !important;
        min-width: 0;
        height: auto;
        border-radius: 18px 18px 0 0;
        flex-basis: 70%;
        transition: height 0.2s, flex-basis 0.2s;
    }
    #story-modal-resizer {
        width: 100%;
        height: 12px;
        cursor: ns-resize;
        background: rgba(0,0,0,0.08);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    #story-modal-resizer:after {
        width: 40px;
        height: 4px;
    }
    .story-modal-card {
        border-radius: 0 0 18px 18px;
        padding: 16px 6px 16px 6px;
        flex-basis: 30%;
    }
}

.story-modal-reset {
    position: absolute;
    left: 50%;
    top: 12px;
    transform: translateX(-50%);
    z-index: 20;
    background: #fff;
    color: #444;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.3rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
}
.story-modal-reset:hover {
    background: #ffd700;
    color: #222;
    opacity: 1;
}
@media (max-width: 700px) {
    .story-modal-reset {
        left: auto;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
    }
}
/* END - Responsive: stack on mobile, vertical resizer */

/* Modal slider */
#story-modal-image-slider {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-basis: 70%;
    min-width: 40px;
    max-width: 100%;
    background: black;
    border-top-left-radius: 32px;
    border-bottom-left-radius: 32px;
    overflow: hidden;
    transition: flex-basis 0.2s;
}
.story-modal-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}
.story-modal-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.7);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.5rem;
    color: #444;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s;
    opacity: 0.8;
}
#story-modal-prev { left: 8px; }
#story-modal-next { right: 8px; }
.story-modal-slider-btn:hover { background: #ffd700; color: #222; }

@media (max-width: 700px) {
    #story-modal-image-slider {
        flex-basis: 70%;
        width: 100% !important;
        min-width: 0;
        height: 180px;
        border-radius: 18px 18px 0 0;
        transition: height 0.2s, flex-basis 0.2s;
    }
    .story-modal-image {
        max-height: 60vh;
    }
}
/* END - Modal Slider */