/* Preview Interface Styles */

.preview-body {
    background: linear-gradient(135deg, #f4f4f4 0%, #e0e0e0 100%);
    min-height: 100vh;
    font-family: Georgia, Times, serif;
    position: relative;
}

.preview-body::before,
.preview-body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/F-for-Faemalia.svg');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
    pointer-events: none;
	opacity: 0.2;
}

.preview-body::before {
    filter: blur(40px);
    z-index: -999;
}

.preview-body::after {
    filter: blur(6px);
    z-index: -1;
}

.preview-header-overlay {
    background: rgba(0, 0, 0, 0.5);
    padding: 1.5rem 0 2.5rem 0;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 2rem;
}

.preview-header-overlay h1 {
    color: white;
    font-weight: 300;
    letter-spacing: -1px;
}

.preview-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.preview-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 2rem;
}

.preview-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.preview-image-container {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.3s ease;
}

.preview-card:hover .preview-image {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, 
        rgba(0,0,0,0) 0%, 
        rgba(0,0,0,0) 60%, 
        rgba(0,0,0,0.7) 100%);
    display: flex;
    align-items: flex-end;
    padding: 1rem;
}

.image-count {
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    background: rgba(0,0,0,0.5);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.preview-content {
    padding: 1.5rem;
}

.preview-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0;
    line-height: 1.3;
}

.preview-date {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.preview-caption {
    color: #34495e;
    line-height: 1.6;
    font-size: 0.95rem;
    margin: 0;
}

.preview-caption br:first-child,
.preview-caption br:last-child {
    display: none;
}

.empty-state {
    padding: 4rem 2rem;
}

.empty-state h3 {
    font-weight: 300;
}

/* Preview Group Detail Styles */
.preview-group-header h1 {
    color: #2c3e50;
    font-weight: 300;
    line-height: 1.2;
}

.group-caption {
    color: black;
    line-height: 1.7;
    font-size: 1.1rem;
    width: 100%;
    margin: 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    text-align: left;
}

.group-caption br:first-child,
.group-caption br:last-child {
    display: none;
}

.preview-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.preview-image-item {
    cursor: pointer;
    border-radius: 12px;
    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;
}

.preview-image-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.preview-image-wrapper {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.preview-grid-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.3s ease;
}

.preview-image-item:hover .preview-grid-image {
    transform: scale(1.05);
}


.preview-modal .modal-content {
    background: #1a1a1a;
    border: none;
}

.preview-modal .modal-header {
    border-bottom: 1px solid #333;
    background: #2c2c2c;
}

.preview-modal .modal-footer {
    border-top: 1px solid #333;
    background: #2c2c2c;
}

.preview-modal .modal-title {
    color: white;
}

.modal-image {
    max-height: 80vh;
    width: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .preview-header h1 {
        font-size: 2rem;
    }
    
    .preview-image-container {
        height: 200px;
    }
    
    .preview-content {
        padding: 1rem;
    }
    
    .preview-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .preview-group-header .d-flex {
        flex-direction: column;
        align-items: start !important;
    }
    
    .preview-group-header .btn {
        margin-top: 1rem;
        align-self: end;
    }
}

/* Image Modal Styles */
.image-modal-content {
    background: #000;
    border: none;
    border-radius: 0;
}


.image-modal-body {
    padding: 0 !important;
    background: #000;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-img {
    max-height: 90vh;
    width: auto !important;
    object-fit: contain;
}

.image-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-modal-body:hover .image-modal-overlay {
    opacity: 1;
}

.image-modal-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: auto;
}

.image-modal-header .modal-title {
    margin: 0;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.image-modal-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: auto;
}

.image-info {
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}


.image-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: auto;
}

.image-nav-left {
    left: 1rem;
}

.image-nav-right {
    right: 1rem;
}

.image-nav-arrow button {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.image-nav-arrow button:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

/* Make modal fullscreen on mobile */
@media (max-width: 768px) {
    .modal-xl {
        max-width: 100vw;
        margin: 0;
    }
    
    .image-modal-content {
        height: 100vh;
        border-radius: 0;
    }
    
    .image-modal-body {
        min-height: 100vh;
    }
    
    .image-modal-img {
        max-height: 100vh;
    }
    
    .image-nav-arrow {
        display: none; /* Hide side arrows on mobile */
    }
}

/* Embedded Gallery Styles for Posts */
.embedded-gallery {
    margin: 2rem 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);
}

/* Full width embedded galleries (for single image group posts) */
.embedded-gallery.w-100 {
    width: 100%;
    margin: 0;
    padding: 0;
    background: none;
    box-shadow: none;
    border-radius: 0;
	opacity: 0.95;
}

/* Center caption for full-width galleries */
.embedded-gallery.w-100 .gallery-caption {
    text-align: center;
    max-width: 800px;
    margin: 2rem auto 0 auto;
    padding: 0 1rem;
	opacity: 0.95;
}

/* Embedded thumbnail grid */
.embedded-thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    justify-items: start;
}

.embedded-thumbnail-item {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    width: 100%;
    aspect-ratio: 1;
}

.embedded-thumbnail-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

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

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

.embedded-gallery-header h4 {
    margin: 0;
    color: #2c3e50;
    font-weight: 600;
}

.embedded-gallery-caption {
    margin: 1rem 0;
    color: #34495e;
    line-height: 1.6;
}

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

.embedded-gallery-item {
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.embedded-gallery-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.embedded-gallery-thumbnail {
    width: 100%;
    height: 150px;
    object-fit: cover;
    object-position: top;
}

/* Post Preview Styles */
.post-previews {
    max-width: 100%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 0 1rem;
}

.post-preview-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
	opacity: 0.95;
    margin-bottom: 0rem;
    min-height: 19rem;
}

.post-preview-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.post-preview-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.post-preview-content {
    display: flex;
    align-items: flex-start;
    padding: 1.5rem;
    gap: 1.5rem;
}

.post-preview-image {
    flex-shrink: 0;
    width: 12rem;
    height: 15rem;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.post-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: transform 0.3s ease;
}

.post-preview-card:hover .post-thumbnail {
    transform: scale(1.05);
}

.post-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 2rem;
}

.post-preview-text {
    flex: 1;
    min-width: 0;
}

.post-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.post-preview-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

.post-preview-date {
    color: #7f8c8d;
    font-size: 0.9rem;
    font-style: italic;
    white-space: nowrap;
    flex-shrink: 0;
}

.post-preview-date-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0.75rem;
}

.post-preview-date-text {
    color: white;
    font-size: 0.9rem;
    font-style: italic;
    font-weight: 500;
}

.post-preview-excerpt {
    color: #34495e;
    line-height: 1.6;
    font-size: 1rem;
}

/* Post Content Styles */
.post-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
    font-size: 1.4rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 4rem 2rem;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.post-content-fullwidth {
    width: 100%;
    margin: 0;
    line-height: 1.7;
    font-size: 1.3rem;
}

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

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

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

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

@media (max-width: 1024px) {
    .post-previews {
        max-width: 95%;
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .post-preview-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .post-preview-image {
        width: 100%;
        height: 200px;
        order: -1;
    }
    
    .post-preview-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .post-preview-date-text {
        font-size: 0.85rem;
    }
    
    .post-preview-title {
        font-size: 1.25rem;
    }
    
    .embedded-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }
    
    .embedded-gallery-thumbnail {
        height: 120px;
    }
}

/* Global Footer */
.global-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1.8rem;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-content {
    color: white;
    font-size: 0.80rem;
    text-align: center;
    line-height: 1;
}

/* Add bottom padding to preview body to account for footer */
.preview-body {
    padding-bottom: 1.5rem;
}

/* Blockquote Styles */
.blockquote {
    margin: 1.5rem 3rem;
    padding: 0.2rem 1rem;
    border-left: 4px solid #6c757d;
    font-style: normal;
    position: relative;
}

.blockquote p {
    margin: 0;
    font-size: inherit;
    line-height: inherit;
}

/* Markdown Image Styles */
.inline-image {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
    margin: 0 0.25rem;
}

.embedded-single-image {
    text-align: center;
    margin: 2rem 0;
}

.embedded-single-image .embedded-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.embedded-single-image .embedded-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Embedded Video Styles */
.embedded-single-video {
    text-align: center;
    margin: 2rem 0;
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.video-container::before {
    content: '';
    display: block;
    padding-top: 56.25%; /* 16:9 aspect ratio */
}

.embedded-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

/* Additional specificity for static generation compatibility */
.post-content .video-container,
.post-content-fullwidth .video-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.post-content .embedded-video,
.post-content-fullwidth .embedded-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.video-link:hover {
    text-decoration: underline;
}

.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    pointer-events: none;
}

.embedded-thumbnail-item {
    position: relative;
}

.embedded-thumbnail-item .video-play-overlay {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.embedded-thumbnail-item:hover .video-play-overlay {
    opacity: 1;
}
