/**
 * Ardem Wiki - Markdown Content Styling
 * Optimized for dark theme
 */

.article-content {
    @apply text-gray-300 leading-relaxed;
}

/* Headings */
.article-content h1 {
    @apply text-4xl font-bold text-white mt-12 mb-6 pb-3 border-b border-gray-800;
}

.article-content h2 {
    @apply text-3xl font-bold text-white mt-10 mb-5;
}

.article-content h3 {
    @apply text-2xl font-bold text-white mt-8 mb-4;
}

.article-content h4 {
    @apply text-xl font-semibold text-white mt-6 mb-3;
}

.article-content h5 {
    @apply text-lg font-semibold text-gray-200 mt-4 mb-2;
}

.article-content h6 {
    @apply text-base font-semibold text-gray-300 mt-4 mb-2;
}

/* Paragraphs */
.article-content p {
    @apply text-gray-300 my-4 leading-relaxed;
}

/* Links */
.article-content a {
    @apply text-emerald-400 hover:text-emerald-300 underline transition-colors duration-200;
}

.article-content a:hover {
    @apply text-emerald-300;
}

/* Strong & Emphasis */
.article-content strong {
    @apply font-bold text-white;
}

.article-content em {
    @apply italic;
}

.article-content del {
    @apply line-through text-gray-500;
}

/* Code */
.article-content code {
    @apply bg-gray-800 text-emerald-400 px-2 py-1 rounded text-sm font-mono;
}

.article-content pre {
    @apply bg-gray-900 rounded-lg p-4 overflow-x-auto my-6 border border-gray-800;
}

.article-content pre code {
    @apply bg-transparent text-gray-300 p-0;
}

/* Lists */
.article-content ul {
    @apply list-disc list-outside ml-6 space-y-2 my-4;
}

.article-content ol {
    @apply list-decimal list-outside ml-6 space-y-2 my-4;
}

.article-content li {
    @apply text-gray-300 leading-relaxed;
}

.article-content li > ul,
.article-content li > ol {
    @apply mt-2 mb-0;
}

/* Blockquotes */
.article-content blockquote {
    @apply border-l-4 border-emerald-500 pl-6 pr-4 py-3 my-6 italic text-gray-400 bg-gray-900/50 rounded-r-lg;
}

.article-content blockquote p {
    @apply my-2;
}

/* Images */
.article-content img {
    @apply rounded-lg shadow-2xl max-w-full h-auto my-8 mx-auto;
}

/* Tables */
.article-content table {
    @apply w-full my-6 border-collapse rounded-lg overflow-hidden;
}

.article-content thead {
    @apply bg-gray-800;
}

.article-content th {
    @apply px-4 py-3 text-left font-semibold text-white border border-gray-700;
}

.article-content td {
    @apply px-4 py-3 border border-gray-800 text-gray-300;
}

.article-content tbody tr:hover {
    @apply bg-gray-900/50;
}

/* Horizontal Rule */
.article-content hr {
    @apply border-gray-800 my-8;
}

/* YouTube Embeds - Responsive with proper sizing */
.youtube-embed {
    position: relative;
    width: 100%;
    max-width: 900px; /* Maximum width for large screens */
    margin: 2rem auto; /* Center it */
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    background-color: #000;
    overflow: hidden;
}

/* Aspect ratio wrapper */
.youtube-embed::before {
    content: "";
    display: block;
    padding-top: 56.25%; /* 16:9 aspect ratio */
}

.youtube-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.article-content .youtube-embed {
    margin: 2rem auto;
}

/* WebM Video Embeds - Responsive with proper sizing */
.webm-embed {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 2rem auto;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.webm-embed video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 1rem;
    background-color: #000;
}

.article-content .webm-embed {
    margin: 2rem auto;
}

/* Responsive breakpoints */
@media (max-width: 768px) {
    .youtube-embed {
        max-width: 100%;
        margin: 1.5rem 0;
        border-radius: 0.75rem;
    }

    .article-content .youtube-embed {
        margin: 1.5rem 0;
    }

    .webm-embed {
        max-width: 100%;
        margin: 1.5rem 0;
        border-radius: 0.75rem;
    }

    .article-content .webm-embed {
        margin: 1.5rem 0;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .youtube-embed {
        max-width: 720px;
    }

    .webm-embed {
        max-width: 720px;
    }
}

@media (min-width: 1025px) {
    .youtube-embed {
        max-width: 900px;
    }

    .webm-embed {
        max-width: 900px;
    }
}

/* Table of Contents */
.toc {
    @apply bg-gray-900 rounded-xl p-6 mb-8 border border-gray-800;
}

.toc h3 {
    @apply text-white font-bold mb-4 mt-0;
}

.toc ul {
    @apply space-y-2 list-none ml-0;
}

.toc a {
    @apply text-gray-400 hover:text-emerald-400 transition-colors no-underline;
}

/* Responsive */
@media (max-width: 768px) {
    .article-content h1 {
        @apply text-3xl;
    }

    .article-content h2 {
        @apply text-2xl;
    }

    .article-content h3 {
        @apply text-xl;
    }

    .article-content pre {
        @apply text-sm;
    }

    .article-content table {
        @apply text-sm;
    }
}

/* Print Styles */
@media print {
    .article-content {
        @apply text-black;
    }

    .article-content a {
        @apply text-blue-600;
    }

    .article-content pre {
        @apply bg-gray-100 text-black border border-gray-300;
    }
}
