/* Global Styling for Single Post Content */
.post-content {
    color: #444;
    line-height: 1.7;
    font-size: 1rem;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    font-weight: bold;
    line-height: 1.3;
    color: #333;
    margin: 1.5rem 0 1rem;
}

.post-content h1 {
    font-size: 2rem;
    color: #1E3A8A; /* Primary Color */
}

.post-content h2 {
    font-size: 1.75rem;
    color: #1E40AF;
}

.post-content h3 {
    font-size: 1.5rem;
}

.post-content h4 {
    font-size: 1.25rem;
}

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

.post-content a {
    color: #2563EB; /* Accent color for links */
    text-decoration: underline;
    transition: color 0.2s ease-in-out;
}

.post-content a:hover {
    color: #1E3A8A;
}

/* Images */
.post-content img {
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
    margin: 1.5rem auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.post-content img.post-image-lightbox-trigger {
    cursor: zoom-in;
}

/* Lists */
.post-content ul, .post-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

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

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

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

/* Blockquote */
.post-content blockquote {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #F3F4F6;
    border-left: 4px solid #1E3A8A;
    font-style: italic;
    color: #555;
}

.post-content blockquote p {
    margin: 0;
}

/* Tables */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.post-content table th,
.post-content table td {
    border: 1px solid #DDD;
    padding: 0.75rem;
    text-align: left;
}

.post-content table th {
    background-color: #F3F4F6;
    font-weight: bold;
    color: #333;
}

.post-content table tr:nth-child(even) {
    background-color: #FAFAFA;
}

/* Code Blocks */
.post-content pre,
.post-content code {
    padding: 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
}

.post-content pre {
    overflow-x: auto;
    padding: 1rem;
    margin: 1.5rem 0;
}

.post-content code {
    padding: 0.2rem 0.4rem;
}

/* Horizontal Rule */
.post-content hr {
    margin: 2rem 0;
    border: none;
    border-top: 1px solid #DDD;
}

/* Video Embeds */
.post-content iframe {
    max-width: 100%;
    margin: 1.5rem auto;
    display: block;
    border-radius: 8px;
}

/* Lightbox overlay */
#post-image-lightbox {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.2s ease-in-out;
    opacity: 0;
    pointer-events: none;
}

#post-image-lightbox:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.post-image-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
}

.post-image-lightbox__content {
    position: relative;
    max-width: min(94vw, 1200px);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0;
}

.post-image-lightbox__image {
    max-width: min(94vw, 1200px);
    max-height: 85vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: none;
    object-fit: contain;
}

.post-image-lightbox__caption {
    color: #f8fafc;
    font-size: 0.95rem;
    text-align: center;
}

.post-image-lightbox__open-original {
    color: #f8fafc;
    font-size: 0.9rem;
    text-decoration: underline;
}

.post-image-lightbox__open-original:hover,
.post-image-lightbox__open-original:focus {
    color: #e0f2fe;
}

.post-image-lightbox__close {
    position: fixed;
    top: clamp(0.75rem, 4vw, 2rem);
    right: clamp(0.75rem, 4vw, 2rem);
    background: rgba(15, 23, 42, 0.65);
    border: none;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    font-size: 1.6rem;
    line-height: 1;
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease-in-out, transform 0.2s ease-in-out;
    z-index: 10000;
}

.post-image-lightbox__close:hover,
.post-image-lightbox__close:focus {
    background: rgba(15, 23, 42, 0.85);
    transform: scale(1.05);
    color: #ffffff;
}

#post-image-lightbox:not(.hidden) .post-image-lightbox__image {
    cursor: zoom-out;
}

@media (max-width: 640px) {
    .post-image-lightbox__image {
        max-height: 90vh;
    }

    .post-image-lightbox__caption,
    .post-image-lightbox__open-original {
        font-size: 0.85rem;
    }
}
