/* =========================================================
   Liscotech News & Events (Static JSON-powered layout)
   ========================================================= */

.news-layout {
    width: 82%;
    max-width: 1000px;
    margin: 0 auto 80px auto;
    padding: 10px 0 40px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 56px;
    align-items: start;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", sans-serif;
    color: #333;
}

.news-layout h1,
.news-layout h2,
.news-layout h3,
.news-layout h4 {
    text-align: left;
    padding: 0;
}

/* Filter banner */
.news-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 32px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    color: #666;
}

.news-layout .news-filter-bar a:link,
.news-layout .news-filter-bar a:visited {
    color: #1f2160;
    text-decoration: none;
    font-weight: 600;
}

.news-layout .news-filter-bar a:hover {
    text-decoration: underline;
}

/* Article card */
.news-post {
    padding-bottom: 48px;
    margin-bottom: 48px;
    border-bottom: 1px solid #e5e7eb;
}

.news-post:last-of-type {
    border-bottom: none;
    margin-bottom: 24px;
}

.news-post-cats {
    margin-bottom: 10px;
}

.news-layout .news-cat-badge,
.news-layout .news-cat-badge:link,
.news-layout .news-cat-badge:visited {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #3b82a6;
    text-decoration: none;
    margin-right: 10px;
}

.news-layout .news-cat-badge:hover {
    color: #1f2160;
    text-decoration: underline;
}

.news-post-title {
    margin: 0 0 14px 0;
    font-size: 24px;
    line-height: 1.38;
    font-weight: 700;
    color: #1f2160;
    letter-spacing: 0.01em;
}

.news-layout .news-post-title a,
.news-layout .news-post-title a:link,
.news-layout .news-post-title a:visited {
    color: #1f2160;
    text-decoration: none;
}

.news-layout .news-post-title a:hover {
    color: #3b82a6;
}

.news-post-divider {
    width: 48px;
    height: 2px;
    background: #d1d5db;
    margin: 14px 0 12px 0;
}

.news-post-date {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #888;
    margin: 0 0 22px 0;
}

.news-featured-img {
    margin: 0 0 22px 0;
}

.news-featured-img img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 3px;
}

/* Post Body Content */
.news-post-content {
    font-size: 15.5px;
    line-height: 1.8;
    color: #444;
    word-wrap: break-word;
}

.news-post-content p {
    margin: 0 0 16px 0;
    text-align: left;
}

.news-post-content h2 {
    font-size: 20px;
    color: #1f2160;
    margin: 26px 0 12px 0;
}

.news-post-content h3 {
    font-size: 18px;
    color: #1f2160;
    margin: 22px 0 10px 0;
}

.news-post-content h4 {
    font-size: 16px;
    color: #1f2160;
    margin: 18px 0 8px 0;
}

.news-post-content ul,
.news-post-content ol {
    margin: 0 0 18px 22px;
    padding: 0;
}

.news-post-content li {
    margin-bottom: 6px;
}

.news-layout .news-post-content a,
.news-layout .news-post-content a:link,
.news-layout .news-post-content a:visited {
    color: #1f2160;
    text-decoration: underline;
}

.news-layout .news-post-content a:hover {
    color: #3b82a6;
}

.news-post-content figure {
    margin: 20px 0;
}

.news-post-content figcaption {
    font-size: 13px;
    color: #777;
    margin-top: 8px;
    text-align: center;
}

.news-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 3px;
    cursor: zoom-in;
    transition: opacity 0.15s ease;
}

.news-post-content img:hover {
    opacity: 0.92;
}

.news-post-content .wp-block-image.aligncenter {
    text-align: center;
}

.news-post-content .wp-block-image img {
    display: inline-block;
}

.news-post-content .wp-block-embed {
    margin: 16px 0;
    padding: 12px 16px;
    background: #f8f9fb;
    border-left: 3px solid #1f2160;
    border-radius: 2px;
}

/* WordPress Block Galleries */
.news-post-content .wp-block-gallery {
    margin: 24px 0;
}

.news-post-content .blocks-gallery-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.news-post-content .wp-block-gallery.columns-2 .blocks-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.news-post-content .wp-block-gallery.columns-1 .blocks-gallery-grid {
    grid-template-columns: 1fr;
}

.news-post-content .blocks-gallery-item {
    margin: 0;
    padding: 0;
}

.news-post-content .blocks-gallery-item figure {
    margin: 0;
    height: 100%;
    overflow: hidden;
    border-radius: 3px;
    background: #f3f4f6;
}

.news-post-content .wp-block-gallery.is-cropped .blocks-gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.news-post-content .wp-block-gallery.columns-2.is-cropped .blocks-gallery-item img {
    height: 260px;
}

.news-post-content .wp-block-gallery.columns-1.is-cropped .blocks-gallery-item img {
    height: auto;
    max-height: 520px;
    object-fit: contain;
}

/* Pagination */
.news-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

.news-layout .news-pagination a,
.news-layout .news-pagination a:link,
.news-layout .news-pagination a:visited,
.news-layout .news-pagination span {
    display: inline-block;
    min-width: 36px;
    padding: 7px 12px;
    font-size: 14px;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    color: #444;
    text-decoration: none;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.news-layout .news-pagination a:hover {
    border-color: #1f2160;
    color: #1f2160;
    background: #f5f7fb;
}

.news-layout .news-pagination .current {
    background: #1f2160;
    border-color: #1f2160;
    color: #fff;
    font-weight: 600;
}

.news-layout .news-pagination .ellipsis {
    border-color: transparent;
    color: #888;
    min-width: auto;
    padding: 7px 4px;
}

/* Sidebar */
.news-sidebar {
    position: sticky;
    top: 100px;
}

.news-widget {
    margin-bottom: 36px;
}

.news-widget-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #222;
    margin: 0 0 14px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #222;
}

.news-cat-list,
.news-recent-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.news-cat-list li {
    border-bottom: 1px solid #eee;
}

.news-layout .news-cat-list a,
.news-layout .news-cat-list a:link,
.news-layout .news-cat-list a:visited {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 4px;
    font-size: 15px;
    color: #444;
    text-decoration: none;
    transition: color 0.15s ease;
}

.news-layout .news-cat-list a:hover,
.news-layout .news-cat-list a.is-active,
.news-layout .news-cat-list a.is-active:link,
.news-layout .news-cat-list a.is-active:visited {
    color: #1f2160;
    font-weight: 600;
}

.news-cat-count {
    font-size: 12px;
    color: #666;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 10px;
}

.news-layout .news-cat-list a.is-active .news-cat-count {
    background: #1f2160;
    color: #fff;
}

.news-recent-list li {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.news-layout .news-recent-list a,
.news-layout .news-recent-list a:link,
.news-layout .news-recent-list a:visited {
    display: block;
    font-size: 14px;
    line-height: 1.45;
    color: #444;
    text-decoration: none;
}

.news-layout .news-recent-list a:hover {
    color: #1f2160;
    text-decoration: underline;
}

.news-recent-date {
    display: block;
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* Single post back link */
.news-layout .news-back-link,
.news-layout .news-back-link:link,
.news-layout .news-back-link:visited {
    display: inline-block;
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 600;
    color: #1f2160;
    text-decoration: none;
}

.news-layout .news-back-link:hover {
    text-decoration: underline;
}

/* Lightbox modal */
.news-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.86);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    cursor: zoom-out;
}

.news-lightbox.open {
    display: flex;
}

.news-lightbox img {
    max-width: 92vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.news-lightbox-close {
    position: fixed;
    top: 18px;
    right: 26px;
    color: #fff;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}

/* Responsive */
@media screen and (max-width: 900px) {
    .news-layout {
        width: 90%;
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .news-sidebar {
        position: static;
        border-top: 1px solid #e5e7eb;
        padding-top: 28px;
    }

    .news-post-content .blocks-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 560px) {
    .news-layout {
        width: 92%;
        padding: 10px 0 32px 0;
    }

    .news-post-title {
        font-size: 20px;
    }

    .news-post-content .blocks-gallery-grid,
    .news-post-content .wp-block-gallery.columns-2 .blocks-gallery-grid {
        grid-template-columns: 1fr;
    }

    .news-post-content .wp-block-gallery.is-cropped .blocks-gallery-item img {
        height: auto;
        max-height: 360px;
    }
}

/* Strict CSP helpers for migrated WordPress post content */
.news-emoji-22 { width: 22px; }
.news-emoji-24 { width: 24px; }
.news-underline { text-decoration: underline; }
