/* Post View Page Specific Styles */

/* Embedded gallery styles */
.embedded-gallery {
    margin: 2rem 0;
}

.embedded-thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1rem 0;
    padding: 0.5rem;
    width: 95vw;
    margin-left: 50%;
    transform: translateX(-50%);
}

.embedded-thumbnail-item {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 8px;
    overflow: hidden;
    margin: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    position: relative;
    width: 100%;
    aspect-ratio: 1;
}

.embedded-thumbnail-item:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

.embedded-thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    margin: 0;
    padding: 0;
    border: none;
    vertical-align: top;
}

.gallery-caption {
    font-style: italic;
    font-size: 1rem;
    color: #666;
    width: 80vw !important;
    margin: 1rem auto;
    text-align: center;
}

/* Post-specific styles */
.post-header {
    background: rgba(0, 0, 0, 0.5);
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.post-header h1 {
    color: white;
    font-weight: 300;
    letter-spacing: -1px;
    margin: 0;
}

.post-meta {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.post-content {
    max-width: 60%;
    margin: 0 auto;
    line-height: 1.5;
    font-size: 1.5rem;
    color: #102030;
}

.post-content h1,
.post-content h2,
.post-content h3 {
    color: #102030;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content strong {
    font-weight: 600;
}

.post-content em {
    font-style: italic;
}

.post-content ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

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

.post-content a {
    color: #3498db;
    text-decoration: none;
}

.post-content a:hover {
    text-decoration: underline;
}


/* Override embedded gallery styles to fix formatting issues */
.post-content .embedded-gallery {
    margin: 1rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 98vw;
    margin-left: 50%;
    transform: translateX(-50%);
}

.post-content .embedded-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.post-content .embedded-gallery-item {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 150px;
}

.post-content .embedded-gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.post-content .embedded-gallery-item:hover .embedded-gallery-thumbnail {
    transform: scale(1.05);
}

.post-content .embedded-gallery-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    border: none;
    margin: 0;
    padding: 0;
    transition: transform 0.3s ease;
}

.post-content .embedded-gallery-header {
    margin-bottom: 1rem;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

.post-content .embedded-gallery-header h4 {
    margin: 0;
    color: #102030;
    font-weight: 600;
}

.post-content .embedded-gallery-caption {
    margin: 1rem auto;
    color: #34495e;
    line-height: 1.6;
    width: 80vw !important;
    max-width: 80vw !important;
    text-align: center;
}

/* Override the global embedded gallery w-100 caption max-width */
.embedded-gallery.w-100 .gallery-caption {
    max-width: 80vw !important;
    width: 80vw !important;
    margin-left: 50% !important;
    margin-right: 0 !important;
    margin-top: 1rem !important;
    margin-bottom: 0 !important;
    transform: translateX(-50%) !important;
    text-align: center !important;
    position: relative !important;
}

/* Configurable image modal sizing */
.modal-xl.image-modal-size {
    max-width: 95vw;
    width: 95vw;
}

.image-modal-size .image-modal-content {
    height: 95vh;
}

.image-modal-size .image-modal-body {
    min-height: 95vh;
}

.image-modal-size .image-modal-img {
    max-height: 95vh;
    max-width: 95vw;
}

/* Configurable modal transition duration */
.modal.fade .modal-dialog {
    transition: transform 250ms ease-out;
}

/* Image navigation click areas */
.image-nav-area {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    z-index: 2100;
    cursor: pointer;
}

.image-nav-left {
    left: 0;
}

.image-nav-right {
    right: 0;
}

/* Image loading progress styles */
.image-loading-overlay {
    position: absolute;
    bottom: 5%;
    left: 0;
    width: 100%;
    height: 6rem;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-content {
    text-align: center;
    color: white;
    max-width: 300px;
    width: 80%;
}

.progress-container {
    margin: 0 auto;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    opacity: 0.9;
}

@media (max-width: 1024px) {
    .post-header {
        padding: 1.5rem 0;
    }

    .post-content {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .post-content .embedded-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }

    .post-content .embedded-gallery-item {
        height: 120px;
        /* Disable expensive hover effects on mobile for better scrolling performance */
        transition: none;
    }

    .post-content .embedded-gallery-item:hover {
        transform: none;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    }

    .post-content .embedded-gallery-item:hover .embedded-gallery-thumbnail {
        transform: none;
    }

    .post-content .embedded-gallery-thumbnail {
        transition: none;
    }

    /* Disable transform animations on mobile gallery items */
    .embedded-thumbnail-item {
        transition: none;
    }

    .embedded-thumbnail-item:hover {
        transform: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    }
}
