/* ============================================================
   News Detail — typography for Tiptap-rendered HTML + lightbox
   ============================================================ */

/* Wrapper around `details` HTML */
.news-detail-content { font-size: 1rem; line-height: 1.7; color: #1f2937; word-wrap: break-word; }
.dark .news-detail-content { color: #e5e7eb; }

/* Headings */
.news-detail-content h1,
.news-detail-content h2,
.news-detail-content h3,
.news-detail-content h4,
.news-detail-content h5,
.news-detail-content h6 {
    font-weight: 700;
    line-height: 1.3;
    margin: 1.5em 0 0.6em;
    color: #111827;
}
.dark .news-detail-content h1,
.dark .news-detail-content h2,
.dark .news-detail-content h3,
.dark .news-detail-content h4 { color: #f9fafb; }
.news-detail-content h1 { font-size: 1.875rem; }
.news-detail-content h2 { font-size: 1.5rem; }
.news-detail-content h3 { font-size: 1.25rem; }
.news-detail-content h4 { font-size: 1.125rem; }

/* Paragraph + spacing */
.news-detail-content p { margin: 0.75em 0; }
.news-detail-content p:first-child { margin-top: 0; }

/* Lists */
.news-detail-content ul,
.news-detail-content ol { margin: 0.75em 0; padding-left: 1.75rem; }
.news-detail-content ul { list-style: disc; }
.news-detail-content ol { list-style: decimal; }
.news-detail-content li { margin: 0.25em 0; }

/* Links */
.news-detail-content a { color: #4f46e5; text-decoration: underline; text-underline-offset: 2px; }
.news-detail-content a:hover { color: #4338ca; }
.dark .news-detail-content a { color: #818cf8; }

/* Inline emphasis */
.news-detail-content strong, .news-detail-content b { font-weight: 700; }
.news-detail-content em, .news-detail-content i { font-style: italic; }
.news-detail-content u { text-decoration: underline; }
.news-detail-content s, .news-detail-content strike { text-decoration: line-through; }
.news-detail-content mark { background: #fef08a; padding: 0 0.2em; border-radius: 2px; }

/* Images inside details */
.news-detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 1em 0;
    display: block;
}

/* Blockquote */
.news-detail-content blockquote {
    border-left: 4px solid #6366f1;
    background: #eef2ff;
    padding: 0.75em 1.25em;
    margin: 1em 0;
    border-radius: 0 0.5rem 0.5rem 0;
    color: #3730a3;
    font-style: italic;
}
.dark .news-detail-content blockquote { background: rgba(99,102,241,.12); color: #c7d2fe; }

/* Code */
.news-detail-content code {
    background: #f3f4f6;
    color: #be185d;
    padding: 0.15em 0.4em;
    border-radius: 0.25rem;
    font-family: 'JetBrains Mono', Menlo, Monaco, monospace;
    font-size: 0.9em;
}
.dark .news-detail-content code { background: #1f2937; color: #f472b6; }
.news-detail-content pre {
    background: #1f2937;
    color: #e5e7eb;
    padding: 1em 1.25em;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1em 0;
    font-size: 0.875rem;
    line-height: 1.5;
}
.news-detail-content pre code { background: transparent; color: inherit; padding: 0; }

/* Table */
.news-detail-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
    overflow-x: auto;
    display: block;
}
.news-detail-content table thead { background: #f9fafb; }
.dark .news-detail-content table thead { background: #1f2937; }
.news-detail-content th,
.news-detail-content td {
    border: 1px solid #e5e7eb;
    padding: 0.5em 0.75em;
    text-align: left;
    vertical-align: top;
}
.dark .news-detail-content th,
.dark .news-detail-content td { border-color: #374151; }
.news-detail-content th { font-weight: 600; }

/* HR */
.news-detail-content hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 2em 0;
}
.dark .news-detail-content hr { border-color: #374151; }

/* Figure */
.news-detail-content figure { margin: 1em 0; }
.news-detail-content figcaption {
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 0.5em;
}

/* ============================================================
   Lightbox — full-screen image viewer
   ============================================================ */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    padding: 2rem;
}
.lightbox.open { display: flex; }
.lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
}
.lightbox-close:hover { background: rgba(255, 255, 255, 0.3); }

/* Thumbnail strip */
.news-gallery-thumb {
    cursor: pointer;
    transition: transform 0.15s, ring 0.15s;
}
.news-gallery-thumb.active {
    outline: 3px solid #6366f1;
    outline-offset: 2px;
}
