/* Styles for blog/post_detail.html */
/* Post Header - Add positioning and z-index */
.post-header {
    position: relative;
    z-index: 20;
}

.post-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 3rem;
}

.post-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.post-actions {
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 30;
}

.post-actions .btn {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: var(--transition-ui);
    cursor: pointer;
    border: none;
    position: relative;
    z-index: 30;
}

.post-actions .btn-secondary {
    background: #6c757d;
    color: white;
}

.post-actions .btn-secondary:hover {
    background: #5a6268;
    box-shadow: none;
}

.post-actions .btn-danger {
    background: #dc3545;
    color: white;
}

.post-actions .btn-danger:hover {
    background: #c82333;
    box-shadow: none;
}

.post-actions form {
    display: inline-block;
    margin: 0;
    position: relative;
    z-index: 30;
}

/* Share buttons */
.share-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.share-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 1.05rem;
    transition: var(--transition-ui);
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
}

.share-btn:hover {
    color: #fff;
}

.share-btn.facebook:hover {
    background: #1877f2;
    border-color: #1877f2;
}

.share-btn.twitter:hover {
    background: #1da1f2;
    border-color: #1da1f2;
}

.share-btn.linkedin:hover {
    background: #0a66c2;
    border-color: #0a66c2;
}

.share-btn.whatsapp:hover {
    background: #25d366;
    border-color: #25d366;
}

.share-btn.email:hover {
    background: #ea4335;
    border-color: #ea4335;
}

.share-btn.copy:hover {
    background: #52b788;
    border-color: #52b788;
}

.share-btn.copy.copied {
    background: #52b788;
    border-color: #52b788;
}

.copy-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    margin-bottom: 0.5rem;
}

.copy-tooltip.show {
    opacity: 1;
}

.copy-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

.post-content {
    background: var(--card-bg, #fff);
    padding: 3rem 4rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-top: -30px;
    position: relative;
    z-index: 10;
}

/* A plain bordered note, so yellow is left for callouts inside the article */
.trigger-warning {
    max-width: 42rem;
    margin: 0 auto 2rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-left: 4px solid var(--brand-text, #1e4d8b);
    border-radius: 5px;
    color: var(--text-dark, #2c3e50);
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin: 1.5rem 0;
}

.post-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-dark, #333);
}

.post-content p {
    line-height: 1.8;
    color: var(--text-dark, #444);
    margin-bottom: 1rem;
}

/* Share Section at Bottom of Post */
.post-share-bottom {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color, #f0f0f0);
    text-align: center;
}

.post-share-bottom h4 {
    color: var(--text-dark, #333);
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.post-share-bottom .share-buttons {
    justify-content: center;
}

.post-share-bottom .share-btn {
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
    background: var(--bg-light, #f8f9fa);
    border: 2px solid var(--border-color, #e0e0e0);
    color: var(--text-muted, #666);
}

.post-share-bottom .share-btn:hover {
    color: white;
    border-color: transparent;
}

.post-tags {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color, #eee);
}

.comments-section {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 2px solid var(--border-color, #eee);
}

.comment {
    background: var(--bg-light, #f8f9fa);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    color: var(--text-muted, #666);
    font-size: 0.9rem;
}

.comment-form {
    background: var(--bg-light, #f8f9fa);
    padding: 2rem;
    border-radius: 10px;
    margin-top: 2rem;
}

.related-posts {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 2px solid var(--border-color, #eee);
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.related-post-card {
    background: var(--bg-light, #f8f9fa);
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    text-decoration: none;
    color: var(--text-dark, #333);
    transition: var(--transition-ui);
}

.related-post-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

/* Medium-style content formatting with optimized width */
.post-content-wrapper {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 21px;
    line-height: 1.58;
    letter-spacing: -0.003em;
    color: var(--text-dark, rgba(0, 0, 0, 0.84));
    /* a readable line: about 68 characters of this serif at 21px */
    max-width: 42rem;
    margin-inline: auto;
}

.post-content-wrapper h1 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 40px;
    font-weight: 600;
    line-height: 1.25;
    margin: 2rem 0 1rem;
}

.post-content-wrapper h2 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.25;
    margin: 2rem 0 1rem;
}

.post-content-wrapper h3 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.3;
    margin: 1.5rem 0 0.75rem;
}

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

.post-content-wrapper blockquote {
    border-left: 3px solid #292929;
    padding-left: 20px;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-muted, rgba(0, 0, 0, 0.68));
}

.post-content-wrapper img {
    max-width: 100%;
    height: auto;
    margin: 2rem auto;
    display: block;
    border-radius: 5px;
}

.post-content-wrapper ul,
.post-content-wrapper ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.post-content-wrapper li {
    margin: 0.5rem 0;
    line-height: 1.58;
}

.post-content-wrapper a {
    color: inherit;
    text-decoration: underline;
    text-underline-position: under;
}

.post-content-wrapper a:hover {
    color: var(--brand-text, #1e4d8b);
}

.post-content-wrapper iframe {
    max-width: 100%;
    margin: 2rem auto;
    display: block;
}

.post-content-wrapper .medium-embed,
.post-content-wrapper .twitter-tweet {
    margin: 2rem auto !important;
}

.modal-content {
    border-radius: 10px;
}

.modal-header {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .post-container {
        max-width: 95%;
        padding: 2rem;
    }

    .post-content {
        padding: 2.5rem 3rem;
    }
}

@media (max-width: 768px) {
    .post-container {
        padding: 1rem;
    }

    .post-content {
        padding: 2rem 1.5rem;
        margin-top: -20px;
    }

    .post-content-wrapper {
        font-size: 18px;
    }

    .post-content-wrapper h1 {
        font-size: 32px;
    }

    .post-content-wrapper h2 {
        font-size: 26px;
    }

    .post-content-wrapper h3 {
        font-size: 22px;
    }

    .post-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .post-actions .btn {
        width: 100%;
        max-width: 300px;
    }

    .share-buttons {
        width: 100%;
    }
}
