/* ===========================================
   Intara AI - Article Typography
   Matches Public View & Admin Editor
   =========================================== */

/* Shared Typography for Article Content & Editor */
/* Shared Typography for Article Content & Editor */
.article-content,
.ql-editor {
    font-family: 'Georgia', 'Times New Roman', serif;
    /* NYT Style Serif */
    font-size: 1.25rem;
    /* 20px base size */
    line-height: 1.8;
    color: #e2e8f0;
    /* Light Gray for Dark Mode */
}

/* Light Mode Support */
body.light .article-content,
body.light .ql-editor {
    color: #121212;
}

/* Headings within content */
.article-content h1,
.ql-editor h1,
.article-content h2,
.ql-editor h2,
.article-content h3,
.ql-editor h3,
.article-content h4,
.ql-editor h4 {
    color: #ffffff;
    /* White for Dark Mode */
    font-family: 'Georgia', 'Times New Roman', serif;
    font-weight: 700;
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

body.light .article-content h1,
body.light .ql-editor h1,
body.light .article-content h2,
body.light .ql-editor h2,
body.light .article-content h3,
body.light .ql-editor h3,
body.light .article-content h4,
body.light .ql-editor h4 {
    color: #000000;
}

.article-content h1,
.ql-editor h1 {
    font-size: 2.5rem;
    letter-spacing: -0.02em;
}

.article-content h2,
.ql-editor h2 {
    font-size: 2rem;
    letter-spacing: -0.01em;
}

.article-content h3,
.ql-editor h3 {
    font-size: 1.75rem;
}

.article-content h4,
.ql-editor h4 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Paragraphs */
.article-content p,
.ql-editor p {
    margin-bottom: 2rem;
}

/* Lists */
.article-content ul,
.ql-editor ul,
.article-content ol,
.ql-editor ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.article-content ul,
.ql-editor ul {
    list-style-type: disc;
}

.article-content ol,
.ql-editor ol {
    list-style-type: decimal;
}

.article-content li,
.ql-editor li {
    margin-bottom: 0.5rem;
}

/* Links */
.article-content a,
.ql-editor a {
    color: var(--ai-cyan);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.article-content a:hover,
.ql-editor a:hover {
    color: var(--ai-purple);
}

/* Blockquotes */
.article-content blockquote,
.ql-editor blockquote {
    border-left: 4px solid var(--ai-purple);
    padding-left: 1.5rem;
    font-style: italic;
    color: var(--text-muted);
    margin: 2rem 0;
    background: rgba(99, 102, 241, 0.1);
    padding: 1rem 1.5rem;
    border-radius: 0 8px 8px 0;
}

body.light .article-content blockquote,
body.light .ql-editor blockquote {
    color: var(--text-dark-muted);
    background: rgba(99, 102, 241, 0.05);
}

/* Images */
/* Images */
.article-content img,
.ql-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2rem auto;
    /* Default: Centered */
    display: block;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

/* Valid Alignment overrides */
.article-content .ql-align-left img,
.ql-editor .ql-align-left img {
    margin-left: 0;
    margin-right: auto;
}

.article-content .ql-align-right img,
.ql-editor .ql-align-right img {
    margin-left: auto;
    margin-right: 0;
}

/* Code Blocks */
.article-content pre,
.ql-editor pre {
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.light .article-content pre,
body.light .ql-editor pre {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #e5e5e5;
}

/* Horizontal Rule */
.article-content hr,
.ql-editor hr {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--text-muted), transparent);
    opacity: 0.3;
    margin: 3rem 0;
}

/* Bold & Italic */
.article-content strong,
.ql-editor strong {
    font-weight: 700;
    color: var(--ai-cyan);
    /* Highlight bold text slightly */
}

body.light .article-content strong,
body.light .ql-editor strong {
    color: var(--ai-blue);
}

/* Quill Editor Specific Overrides for Admin Panel */
/* Ensure the editor background matches the theme or is at least readable */
.ql-container.ql-snow {
    border: 1px solid #374151 !important;
    border-radius: 0 0 8px 8px;
    background-color: rgba(255, 255, 255, 0.02);
}

.ql-toolbar.ql-snow {
    border: 1px solid #374151 !important;
    border-bottom: none !important;
    border-radius: 8px 8px 0 0;
    background-color: #1f2937;
}

/* Light mode overrides for admin form if applicable */
/* Assuming admin uses same layout/theme */

.ql-editor.ql-blank::before {
    color: rgba(255, 255, 255, 0.3) !important;
    font-style: italic;
}

/* Admin Panel Editor Correction:
   Since the admin panel has a white background, we must ensure the editor text is dark.
   The shared .ql-editor styles above set it to light gray for the dark mode article view.
   This override fixes it for the admin form.
*/
#editor-container .ql-editor {
    color: #121212 !important;
    /* Force dark text for Admin Pnael */
    background-color: #ffffff;
    min-height: 300px;
    /* Better editing experience */
}

#editor-container .ql-editor p,
#editor-container .ql-editor h1,
#editor-container .ql-editor h2,
#editor-container .ql-editor h3,
#editor-container .ql-editor h4 {
    color: #121212 !important;
}

/* Gallery grid on public article */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.gallery-card {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.35);
}

.gallery-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform .4s ease, opacity .4s ease;
}

.gallery-card:hover img {
    transform: scale(1.03);
    opacity: 0.95;
}

/* Quill content helpers for public rendering */
.article-content .ql-align-center {
    text-align: center;
}

.article-content .ql-align-right {
    text-align: right;
}

.article-content .ql-align-justify {
    text-align: justify;
}

.article-content .ql-size-small {
    font-size: 0.9em;
}

.article-content .ql-size-large {
    font-size: 1.25em;
}

.article-content .ql-size-huge {
    font-size: 1.5em;
}

.article-content .ql-indent-1 {
    padding-left: 3em;
}

.article-content .ql-indent-2 {
    padding-left: 6em;
}

.article-content .ql-indent-3 {
    padding-left: 9em;
}

.article-content .ql-indent-4 {
    padding-left: 12em;
}

.article-content .ql-indent-5 {
    padding-left: 15em;
}

.article-content .ql-indent-6 {
    padding-left: 18em;
}

.article-content .ql-indent-7 {
    padding-left: 21em;
}

.article-content .ql-indent-8 {
    padding-left: 24em;
}

.article-content .ql-video {
    width: 100%;
    aspect-ratio: 16/9;
    display: block;
    margin: 2rem 0;
    border-radius: 12px;
    overflow: hidden;
    border: none;
}

/* YouTube/Vimeo iframe embeds from Quill */
.article-content iframe.ql-video,
.ql-editor iframe.ql-video {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

/* NYT Style Layout Overrides (No-Build Safe) */
.nyt-body {
    background-color: #0f172a;
    /* Dark Slate aka 'Intara Dark' */
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #e2e8f0;
    /* Light Gray text */
    min-height: 100vh;
}

.nyt-container {
    max-width: 840px;
    /* Standard editorial width */
    margin: 0 auto;
    padding: 60px 20px;
}

.nyt-header {
    text-align: left;
    /* Classic NYT is often left-aligned or centered, let's go cleaner left */
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid #334155;
    /* Darker border */
}

.nyt-meta {
    font-family: 'Arial', sans-serif;
    font-size: 0.85rem;
    color: #94a3b8;
    /* Muted minimalist color */
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    font-weight: 700;
}

.nyt-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 3.5rem;
    /* Large and bold */
    line-height: 1.1;
    font-weight: 800;
    color: #ffffff;
    /* Pure white for title */
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.nyt-summary {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.5rem;
    line-height: 1.4;
    color: #cbd5e1;
    /* Lighter summary text */
    font-style: italic;
    margin-bottom: 0;
}

.nyt-image-container {
    margin: 40px 0;
}

.nyt-image {
    width: 100%;
    height: auto;
    max-height: 450px;
    /* Force smaller height */
    object-fit: cover;
    display: block;
    margin-bottom: 10px;
}

.nyt-caption {
    font-family: 'Arial', sans-serif;
    font-size: 0.85rem;
    color: #888;
    text-align: right;
}

/* Ensure the article content itself is constrained */
.article-content {
    max-width: 100% !important;
    /* Let container handle width */
    font-size: 1.25rem;
}

.nyt-back-link {
    font-family: 'Arial', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 12px 24px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-block;
}

.nyt-back-link:hover {
    background-color: #ffffff;
    color: #0f172a;
    border-color: #ffffff;
}