/**
 * Story Groups and Carousel Styles
 * Includes story details 50:50 layout, image sliders, Swiper carousel, and rich text content
 */

/* 50:50 Container */
.story-details-50-50 {
    display: flex;
    height: calc(100vh - 120px); /* Full height minus header/footer */
    width: 100%;
}

/* LEFT 50%: Map */
.story-details-map-half {
    width: 50%;
    height: 100%;
    position: relative;
    background: #f5f5f5;
}

.story-details-map-full {
    width: 100%;
    height: 100%;
}

/* RIGHT 50%: Content */
.story-details-content-half {
    width: 50%;
    height: 100%;
    overflow-y: auto;
    background: #fff;
}

/* Title */
.story-details-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
    margin: 0;
}

/* Meta Info Line */
.story-meta-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.meta-item i {
    color: #9ca3af;
    font-size: 0.75rem;
}

.meta-separator {
    color: #d1d5db;
    font-weight: 300;
}

/* Story Image Caption in Details View */
.story-details-caption {
    font-size: 0.875rem;
    line-height: 1.5;
    color: #6b7280;
    font-style: italic;
    padding: 0.5rem 0;
    border-left: 3px solid #e5e7eb;
    padding-left: 0.75rem;
}

[dir="rtl"] .story-details-caption {
    border-left: none;
    border-right: 3px solid #e5e7eb;
    padding-left: 0;
    padding-right: 0.75rem;
}

/* Story Content */
.story-details-text {
    margin-top: 1.5rem;
}

.story-content-text {
    font-size: 1rem;
    line-height: 1.7;
    color: #374151;
}

/* Rich text content styling */
.story-content-text p {
    margin-bottom: 1rem;
}

.story-content-text h1,
.story-content-text h2,
.story-content-text h3,
.story-content-text h4,
.story-content-text h5,
.story-content-text h6 {
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #1f2937;
}

.story-content-text h1 { font-size: 1.875rem; }
.story-content-text h2 { font-size: 1.5rem; }
.story-content-text h3 { font-size: 1.25rem; }
.story-content-text h4 { font-size: 1.125rem; }
.story-content-text h5 { font-size: 1rem; }
.story-content-text h6 { font-size: 0.875rem; }

.story-content-text strong,
.story-content-text b {
    font-weight: 700;
}

.story-content-text em,
.story-content-text i {
    font-style: italic;
}

.story-content-text u {
    text-decoration: underline;
}

.story-content-text s,
.story-content-text strike {
    text-decoration: line-through;
}

.story-content-text ul,
.story-content-text ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.story-content-text ul {
    list-style-type: disc;
}

.story-content-text ol {
    list-style-type: decimal;
}

.story-content-text li {
    margin-bottom: 0.5rem;
}

.story-content-text blockquote {
    margin: 1rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid #10b981;
    background-color: #f9fafb;
    font-style: italic;
    color: #4b5563;
}

.story-content-text code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #dc2626;
}

.story-content-text pre {
    background-color: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.story-content-text pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
}

.story-content-text a {
    color: #1967d2;
    text-decoration: underline;
}

.story-content-text a:hover {
    color: #1557b0;
}

.story-content-text img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.story-content-text hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 1.5rem 0;
}

.story-content-text table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.story-content-text table th,
.story-content-text table td {
    border: 1px solid #e5e7eb;
    padding: 0.5rem;
    text-align: left;
}

.story-content-text table th {
    background-color: #f9fafb;
    font-weight: 600;
}

/* Quill-specific classes */
.story-content-text .ql-align-center {
    text-align: center;
}

.story-content-text .ql-align-right {
    text-align: right;
}

.story-content-text .ql-align-justify {
    text-align: justify;
}

.story-content-text .ql-indent-1 { padding-left: 3em; }
.story-content-text .ql-indent-2 { padding-left: 6em; }
.story-content-text .ql-indent-3 { padding-left: 9em; }
.story-content-text .ql-indent-4 { padding-left: 12em; }
.story-content-text .ql-indent-5 { padding-left: 15em; }
.story-content-text .ql-indent-6 { padding-left: 18em; }
.story-content-text .ql-indent-7 { padding-left: 21em; }
.story-content-text .ql-indent-8 { padding-left: 24em; }

/* Additional Info Grid */
.additional-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.additional-info-grid > div {
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 6px;
}

/* Responsive */
@media (max-width: 992px) {
    .story-details-50-50 {
        flex-direction: column;
    }

    .story-details-map-half {
        width: 100%;
        height: 50vh;
    }

    .story-details-content-half {
        width: 100%;
        height: auto;
    }
}

/* Story Image Overlay - Centered on Map */
.story-image-overlay {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 400px !important;
    max-width: 80% !important;
    height: 300px !important;
    max-height: 60% !important;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    z-index: 1000 !important;
    pointer-events: auto;
}

.story-image-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .story-image-overlay {
        width: 90% !important;
        height: 250px !important;
    }
}

/* ============================================ */
/* STORY GROUP IMAGE SLIDER */
/* ============================================ */

/* Slider container */
.story-image-slider {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Slider track holds all images */
.slider-track {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Individual slider items (images) */
.slider-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    pointer-events: none;
}

.slider-item.active {
    opacity: 1;
    pointer-events: auto;
}

.slider-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Navigation buttons */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    opacity: 0;
}

.story-card-image:hover .slider-btn {
    opacity: 1;
}

.slider-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.slider-prev {
    left: 10px;
}

.slider-next {
    right: 10px;
}

.slider-btn i {
    font-size: 16px;
}

/* Slider dots (indicators) */
.slider-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.slider-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.slider-dots .dot:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.slider-dots .dot.active {
    background: white;
    width: 10px;
    height: 10px;
}

/* Ensure story card image has proper positioning for slider */
.story-card-image.has-slider {
    position: relative;
    overflow: hidden;
}

/* Photo Caption Styling */
.story-card-image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 8px 12px;
    font-size: 0.875rem;
    line-height: 1.4;
    text-align: left;
}

[dir="rtl"] .story-card-image-caption {
    text-align: right;
}

/* Swiper Carousel Styles for Story Groups */
.story-carousel {
    width: 100%;
    height: 100%;
}

.swiper {
    width: 100%;
    height: 100%;
}

.swiper-slide {
    display: flex;
    flex-direction: column;
}

.swiper-button-next,
.swiper-button-prev {
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

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

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 14px;
}

.swiper-button-prev {
    left: 10px;
}

.swiper-button-next {
    right: 10px;
}

.swiper-pagination {
    bottom: 10px !important;
}

.swiper-pagination-bullet {
    background: #fff;
    opacity: 0.7;
}

.swiper-pagination-bullet-active {
    background: #007bff;
    opacity: 1;
}

.carousel-slide-image {
    width: 100%;
    height: 200px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.carousel-slide-image i {
    font-size: 3rem;
    color: #9ca3af;
}

.carousel-slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-slide-content {
    padding: 1rem;
    flex: 1;
}

.swipe-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 10;
}

.swipe-indicator i {
    margin-right: 5px;
}
