/* Visual Blog Styles */

.blog-container {
    padding: 2rem 2rem 4rem;
}

.blog-header {
    text-align: center;
    margin-bottom: 3rem;
}

.blog-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.blog-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Masonry Grid Layout */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    grid-auto-rows: 10px;
    grid-auto-flow: row;
    gap: 1.5rem;
    align-items: start;
}

.blog-post {
    break-inside: avoid;
    margin: 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.blog-post:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.post-content {
    padding: 1.5rem;
}

.post-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
}

.post-date {
    display: block;
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 0.75rem;
    font-weight: 400;
}

.post-text {
    font-size: 0.92rem;
    line-height: 1.3;
    color: var(--text-muted);
    margin: 0;
}

.post-text br {
    display: block;
    margin-top: 0.3rem;
    line-height: 0.3rem;
}

.post-text p {
    margin: 0 0 1rem 0;
    line-height: 1.3;
}

.post-text p:last-child {
    margin-bottom: 0;
}

.post-text br {
    display: block;
    height: 1rem;
    margin: 0;
    content: "";
}

.post-image-wrapper {
    width: calc(100% - 3rem);
    margin: 0 1.5rem 1.5rem 1.5rem;
    position: relative;
    overflow: hidden;
    background: transparent;
    min-height: 0;
}

.image-caption {
    font-style: italic;
    color: #555;
    font-size: 0.85rem;
    margin: -1rem 1.5rem 0.5rem 1.5rem;
    padding: 0;
    text-align: center;
    background: transparent;
}

.post-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    margin: 0;
    transition: filter 0.5s ease, opacity 0.5s ease, transform 0.5s ease;
    cursor: pointer;
}

.post-image.lazy-image {
    filter: blur(15px);
    opacity: 0.6;
    transform: scale(1.05);
}

.post-image.lazy-image.loaded {
    filter: blur(0);
    opacity: 1;
    transform: scale(1);
}

/* Video Post Styles */
.post-video-wrapper {
    width: calc(100% - 3rem);
    margin: -1rem 1.5rem 1.5rem 1.5rem;
    position: relative;
    overflow: hidden;
    background: #000;
    cursor: pointer;
}

.post-video {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    margin: 0;
}

.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.post-video-wrapper.playing .video-play-button {
    opacity: 0;
    pointer-events: none;
}

.post-video-wrapper:hover .video-play-button {
    transform: translate(-50%, -50%) scale(1.1);
}

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.post-video-wrapper:hover .video-controls,
.post-video-wrapper.playing .video-controls {
    opacity: 1;
    pointer-events: all;
}

.video-progress-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

.video-progress-bar {
    width: 100%;
    height: 100%;
    position: relative;
}

.video-progress-filled {
    height: 100%;
    background: #fff;
    border-radius: 4px;
    width: 0%;
    transition: width 0.05s linear;
    position: relative;
}

.video-progress-filled::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.video-progress-container:hover .video-progress-filled::after,
.video-progress-container.dragging .video-progress-filled::after {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .blog-container {
        padding: 2rem 1.5rem 3rem;
    }
    
    .blog-header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .masonry-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 8px;
        gap: 1rem;
    }

    .blog-container {
        padding: 1.5rem 1rem 2rem;
    }
    
    .blog-header {
        margin-bottom: 2rem;
    }
    
    .blog-header h1 {
        font-size: 1.75rem;
    }
    
    .blog-subtitle {
        font-size: 1rem;
    }
    
    .post-content {
        padding: 1.25rem;
    }
    
    .post-image-wrapper {
        width: calc(100% - 2.5rem);
        margin: 0 1.25rem 1.25rem 1.25rem;
    }
    
    .post-image {
        width: 100%;
        margin: 0;
    }
    
    .post-video-wrapper {
        width: calc(100% - 2.5rem);
        margin: 0 1.25rem 1.25rem 1.25rem;
    }
    
    .post-title {
        font-size: 1.2rem;
    }
    
    .post-date {
        font-size: 0.85rem;
    }
    
    .post-text {
        font-size: 0.95rem;
    }
    
    .blog-post {
        margin: 0;
    }
}

/* Animation for loading posts */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog-post {
    animation: fadeInUp 0.5s ease-out;
}

/* Stagger animation for posts */
.blog-post:nth-child(1) { animation-delay: 0.05s; }
.blog-post:nth-child(2) { animation-delay: 0.1s; }
.blog-post:nth-child(3) { animation-delay: 0.15s; }
.blog-post:nth-child(4) { animation-delay: 0.2s; }
.blog-post:nth-child(5) { animation-delay: 0.25s; }
.blog-post:nth-child(6) { animation-delay: 0.3s; }
.blog-post:nth-child(7) { animation-delay: 0.35s; }
.blog-post:nth-child(8) { animation-delay: 0.4s; }

/* Lightbox Modal Styles */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    cursor: default;
    animation: lightboxFadeIn 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: opacity 0.2s ease;
    line-height: 1;
}

.lightbox-close:hover {
    opacity: 0.7;
}

@keyframes lightboxFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Prevent body scroll when lightbox is open */
body.lightbox-open {
    overflow: hidden;
}

