/**
 * Post Detail Prose Styling
 * External CSS for prose content to avoid CSP violations
 */

.prose {
    color: #374151;
    max-width: none;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
    color: #111827;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.prose h1 {
    font-size: 2.25rem;
    line-height: 2.5rem;
}

.prose h2 {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

.prose h3 {
    font-size: 1.5rem;
    line-height: 2rem;
}

.prose h4 {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.prose p {
    margin-bottom: 1.5rem;
    line-height: 1.75;
}

.prose ul,
.prose ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.prose pre {
    background-color: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.prose pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.prose a {
    color: #2563eb;
    text-decoration: underline;
    transition: color 0.2s;
}

.prose a:hover {
    color: #1d4ed8;
}

.prose img {
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

.prose blockquote {
    border-left: 4px solid #e5e7eb;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #6b7280;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.prose th,
.prose td {
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    text-align: left;
}

.prose th {
    background-color: #f9fafb;
    font-weight: 600;
}

.prose strong {
    font-weight: 600;
    color: #111827;
}

.prose em {
    font-style: italic;
}

/* Responsive typography */
@media (max-width: 639px) {
    .prose h1 {
        font-size: 1.875rem;
        line-height: 2.25rem;
    }

    .prose h2 {
        font-size: 1.5rem;
        line-height: 2rem;
    }

    .prose h3 {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }
}

/* Fix YouTube video embed - ensure video displays correctly */
.prose .responsive-object {
    position: relative;
    overflow: hidden;
    max-width: 100%;
    margin: 1.5rem 0;
    padding-bottom: 56.25% !important;
    /* 16:9 aspect ratio */
    height: 0 !important;
}

.prose .responsive-object iframe,
.prose .responsive-object object,
.prose .responsive-object embed,
.prose .responsive-object video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: 0;
}

/* Fade-in effect for intro description */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.intro-description.fade-in {
    animation: fadeIn 0.8s ease-out;
}

/* ============================================
   Not-prose: Reset prose styles for child blocks
   (ad blocks, banners, etc.)
   Targeted reset - không dùng revert vì override Tailwind utilities
   ============================================ */
.prose .not-prose a {
    color: inherit;
    text-decoration: none;
    font-weight: inherit;
}

.prose .not-prose a:hover {
    color: inherit;
}

.prose .not-prose img {
    margin: 0;
    border-radius: inherit;
}

.prose .not-prose p {
    margin-bottom: 0;
    line-height: inherit;
}

.prose .not-prose h1,
.prose .not-prose h2,
.prose .not-prose h3,
.prose .not-prose h4,
.prose .not-prose h5,
.prose .not-prose h6 {
    margin-top: 0;
    margin-bottom: 0;
    color: inherit;
}
