/* News Detail Page */

body.page-news-detail {
    padding-top: var(--header-height);
    overflow-x: hidden;
}

body.page-news-detail .site-header {
    background-color: #fff;
    border-bottom-color: var(--color-border);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* Top bar — aligned with site-breadcrumb-bar on list pages */
.nd-topbar {
    background: #fff;
    border-bottom: 1px solid var(--color-border);
}

.nd-topbar.site-breadcrumb-bar {
    position: relative;
    z-index: 5;
    padding: var(--breadcrumb-bar-padding-y) 0;
}

.nd-topbar.site-breadcrumb-bar .nd-topbar__inner {
    padding: 0;
}

.nd-topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--topbar-gap);
}

.nd-topbar.site-breadcrumb-bar .page-container {
    padding-left: var(--page-padding-x);
    padding-right: var(--page-padding-x);
}

.nd-topbar .site-breadcrumb {
    flex: 1 1 auto;
    min-width: 0;
    margin-bottom: 0;
}

.nd-topbar__back {
    flex-shrink: 0;
    font-size: var(--fs-xs);
    font-weight: 600;
    text-decoration: none;
    color: var(--color-primary);
    transition: color 0.2s ease;
}

.nd-topbar__back:hover {
    color: var(--color-accent);
}

/* Main */
.nd-main {
    padding: calc(var(--section-py) + 8px) 0 calc(var(--section-py) + 16px);
    background: #fff;
}

.nd-article {
    width: 100%;
}

/* Header */
.nd-article__head {
    text-align: center;
    margin-bottom: 32px;
}

.nd-article__title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(24px, 3.2vw, var(--fs-xl));
    line-height: 1.35;
    letter-spacing: 0.01em;
    color: #111827;
    margin: 0;
    max-width: none;
}

.nd-article__rule {
    width: 100%;
    height: 1px;
    margin: 22px auto;
    background: #e5e7eb;
}

.nd-article__rule--accent {
    height: 4px;
    margin-top: 18px;
    margin-bottom: 0;
    background: #eef2fa;
    border-radius: 2px;
}

.nd-article__release {
    margin: 0;
    font-size: var(--fs-sm);
    line-height: 1.5;
    color: #9ca3af;
}

.nd-article__release time {
    color: #6b7280;
    font-weight: 500;
}

/* Cover */
.nd-article__cover {
    margin: 28px auto 36px;
    max-width: var(--article-max-width);
    text-align: center;
    background: #f9fafb;
    border-radius: 4px;
    overflow: hidden;
}

.nd-article__cover img {
    display: block;
    width: 100%;
    max-width: var(--article-max-width);
    height: auto;
    max-height: var(--article-cover-max-h);
    object-fit: contain;
    object-position: center center;
    margin: 0 auto;
}

/* Body */
.nd-article__body {
    font-family: Georgia, 'Times New Roman', Times, serif;
    font-size: clamp(16px, 1.15vw, 18px);
    line-height: 1.95;
    color: #374151;
    text-align: left;
}

.nd-article__body p {
    margin: 0 0 1.35em;
}

.nd-article__body p:last-child {
    margin-bottom: 0;
}

.nd-article__body h2,
.nd-article__body h3,
.nd-article__body h4 {
    font-family: var(--font-display);
    font-weight: 700;
    color: #111827;
    margin: 1.8em 0 0.75em;
    line-height: 1.35;
}

.nd-article__body h2 { font-size: clamp(20px, 2vw, 26px); }
.nd-article__body h3 { font-size: clamp(18px, 1.8vw, 22px); }
.nd-article__body h4 { font-size: clamp(16px, 1.5vw, 18px); }

.nd-article__body ul,
.nd-article__body ol {
    margin: 0 0 1.35em;
    padding-left: 1.5em;
}

.nd-article__body li {
    margin-bottom: 0.5em;
}

.nd-article__body img {
    display: block;
    max-width: min(var(--article-max-width), 100%);
    width: auto;
    height: auto;
    margin: 1.6em auto;
    object-fit: contain;
}

.nd-article__body figure {
    margin: 1.6em 0;
    text-align: center;
}

.nd-article__body figure img {
    margin: 0 auto;
}

.nd-article__body figcaption {
    margin-top: 10px;
    font-size: 0.9em;
    color: #6b7280;
    font-style: italic;
}

.nd-article__body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    font-family: var(--font-sans, Roboto, system-ui, sans-serif);
    font-size: var(--fs-sm);
}

.nd-article__body th,
.nd-article__body td {
    border: 1px solid var(--color-border);
    padding: 10px 14px;
    text-align: left;
}

.nd-article__body th {
    background: #f9fafb;
    font-weight: 600;
}

.nd-article__body a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.nd-article__body a:hover {
    color: var(--color-accent);
}

.nd-article__body blockquote {
    margin: 1.4em 0;
    padding: 0.2em 0 0.2em 1.2em;
    border-left: 3px solid var(--color-accent);
    color: #4b5563;
    font-style: italic;
}

/* Prev / Next */
.nd-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--grid-gap-lg);
    width: 100%;
    margin: calc(var(--section-header-mb) + 20px) auto 0;
    padding-top: calc(var(--section-header-mb) + 8px);
    border-top: 1px solid var(--color-border);
}

.nd-pager__item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 18px 0;
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

.nd-pager__item:hover .nd-pager__title {
    color: var(--color-accent);
}

.nd-pager__item--next {
    text-align: right;
    align-items: flex-end;
}

.nd-pager__label {
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #9ca3af;
}

.nd-pager__title {
    font-family: var(--font-display);
    font-size: var(--fs-sm);
    font-weight: 600;
    line-height: 1.45;
    color: var(--color-primary);
    transition: color 0.2s ease;
}

.nd-pager__item[href="javascript:;"] {
    opacity: 0.45;
    pointer-events: none;
}

/* More */
.nd-more {
    width: 100%;
    margin: 28px auto 0;
    text-align: center;
}

.nd-more__btn {
    display: inline-block;
    padding: var(--btn-padding-y) var(--btn-padding-x);
    background-color: var(--color-primary);
    color: #fff;
    font-family: var(--btn-font-family);
    font-size: var(--btn-font-size);
    font-weight: var(--btn-font-weight);
    letter-spacing: var(--btn-letter-spacing);
    text-transform: uppercase;
    text-decoration: none;
    border-radius: var(--btn-radius);
    transition: background-color 0.25s ease, transform 0.25s ease;
}

.nd-more__btn:hover {
    background-color: var(--btn-hover-bg-active);
    transform: translateY(-1px);
    box-shadow: var(--btn-hover-shadow);
}

/* Responsive */
@media (max-width: 767px) {
    .nd-topbar__inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .nd-topbar .site-breadcrumb {
        width: 100%;
        font-size: var(--fs-xs);
        line-height: 1.45;
        gap: 4px;
    }

    .nd-topbar__back {
        font-size: 11px;
        line-height: 1.4;
        max-width: 100%;
    }

    .nd-main {
        padding: 20px 0 calc(var(--section-py) + 8px);
    }

    .nd-article__head {
        margin-bottom: 24px;
    }

    .nd-article__title {
        max-width: none;
        font-size: clamp(18px, 5.2vw, 26px);
        line-height: 1.3;
    }

    .nd-article__rule {
        margin: 18px auto;
    }

    .nd-article__cover {
        margin: 20px 0 24px;
    }

    .nd-article__body {
        font-size: var(--fs-sm);
        line-height: 1.75;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nd-article__body img {
        margin: 1em auto;
    }

    .nd-article__body table {
        width: 100% !important;
        max-width: 100%;
        min-width: 0;
        font-size: 11px;
        line-height: 1.45;
        table-layout: fixed;
    }

    .nd-article__body th,
    .nd-article__body td {
        padding: 6px 8px !important;
        word-break: break-word;
        hyphens: auto;
    }

    .nd-pager {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
        margin-top: 28px;
    }

    .nd-pager__item {
        padding: 14px 16px;
    }

    .nd-pager__item--next {
        text-align: left;
        align-items: flex-start;
    }

    .nd-more {
        margin-top: 28px;
    }
}
