/* Post Preview Image and Link Styles */

.post-preview-container {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
}

.post-hero {
    margin: 2rem auto;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 65rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.15);
    background: #0f172a;
}

.post-hero--hidden {
    display: none !important;
}

.post-hero__link,
.post-hero__image {
    width: 100%;
    display: block;
}

.post-hero__image {
    height: auto;
    object-fit: cover;
    border-radius: inherit;
    transition: transform 0.3s ease;
    display: block;
}

.post-hero--external .post-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.6));
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1rem;
    color: white;
    font-size: 1rem;
    font-weight: 600;
}

.post-hero--external:hover .post-hero__image {
    transform: scale(1.02);
}

.post-preview-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

/* Light theme */
body:not(.secondary-theme) .post-preview-image {
    border: 1px solid #e2e8f0;
}

/* Dark theme */
body.secondary-theme .post-preview-image {
    border: 1px solid #333333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Preview Image Link (from fetched article) */
.preview-image-link {
    position: relative;
    display: inline-block;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
    text-decoration: none;
}

.preview-image-link img {
    display: block;
    width: 100%;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 8px;
}

/* Light theme overlay */
body:not(.secondary-theme) .preview-overlay {
    background-color: rgba(0, 0, 0, 0.6);
}

/* Dark theme overlay */
body.secondary-theme .preview-overlay {
    background-color: rgba(0, 0, 0, 0.8);
}

.preview-link-text {
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    padding: 1rem;
}

.preview-image-link:hover img {
    transform: scale(1.05);
    filter: brightness(0.8);
}

.preview-image-link:hover .preview-overlay {
    opacity: 1;
}

/* Link Preview */
.post-preview-container.link-preview {
    margin: 2rem 0;
    justify-content: center;
}

.link-preview-button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid;
}

/* Light theme link button */
body:not(.secondary-theme) .link-preview-button {
    color: #3182ce;
    border-color: #3182ce;
    background-color: #f7fafc;
}

body:not(.secondary-theme) .link-preview-button:hover {
    background-color: #edf2f7;
    transform: translateX(4px);
}

/* Dark theme link button */
body.secondary-theme .link-preview-button {
    color: #ff6600;
    border-color: #ff6600;
    background-color: #1a1a1a;
}

body.secondary-theme .link-preview-button:hover {
    background-color: #2a2a2a;
    transform: translateX(4px);
}

.link-preview-button .link-icon {
    font-size: 1.2em;
}

.link-preview-button .link-text {
    font-size: 1rem;
}

.link-preview-button .link-arrow {
    transition: transform 0.3s ease;
}

.link-preview-button:hover .link-arrow {
    transform: translateX(4px);
}

/* Featured Link Preview (for link posts) */
.post-preview-container.link-preview.featured {
    margin: 2.5rem 0;
    padding: 2rem 0;
}

body:not(.secondary-theme) .post-preview-container.link-preview.featured {
    border-top: 2px solid #e2e8f0;
    border-bottom: 2px solid #e2e8f0;
}

body.secondary-theme .post-preview-container.link-preview.featured {
    border-top: 2px solid #333333;
    border-bottom: 2px solid #333333;
}

.post-preview-container.link-preview.featured .link-preview-button {
    padding: 1.5rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .post-preview-container {
        margin: 1.5rem 0;
    }

    .post-preview-image {
        border-radius: 6px;
    }

    .link-preview-button {
        padding: 0.875rem 1.25rem;
        gap: 0.5rem;
        font-size: 0.95rem;
    }
}
