/* ================================
   Article detail page
================================ */

.article-detail-page {
    position: relative;
    min-height: calc(100vh - 78px);
    padding: 58px 24px 100px;
    overflow: hidden;
    background:
        radial-gradient(circle at 14% 4%, rgba(184, 138, 46, 0.14), transparent 28%),
        radial-gradient(circle at 86% 12%, rgba(184, 138, 46, 0.08), transparent 26%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(248, 246, 240, 0.96)),
        var(--surface-soft);
}

.article-detail-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.46;
    background-image:
        linear-gradient(rgba(20, 20, 20, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 20, 20, 0.035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, black, transparent 72%);
}

.article-detail-shell {
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
}


/* ================================
   Back link
================================ */

.article-detail-back {
    margin-bottom: 34px;
}

.article-detail-back a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.94rem;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-detail-back a:hover {
    color: var(--gold);
}


/* ================================
   Hero
================================ */

.article-detail-hero {
    max-width: 860px;
    margin: 0 auto 36px;
    text-align: center;
}

.article-detail-category {
    display: inline-flex;
    align-items: center;
    margin-bottom: 18px;
    padding: 8px 14px;
    border: 1px solid rgba(184, 138, 46, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    box-shadow: 0 12px 30px rgba(15, 15, 15, 0.04);
}

.article-detail-hero h1 {
    margin: 0;
    color: var(--text-main);
    font-size: clamp(2.4rem, 6vw, 5.2rem);
    line-height: 0.98;
    letter-spacing: -0.07em;
}

.article-detail-excerpt {
    max-width: 760px;
    margin: 22px auto 0;
    color: var(--text-muted);
    font-size: 1.12rem;
    line-height: 1.75;
}

.article-detail-meta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.article-detail-meta span {
    display: inline-flex;
    align-items: center;
}

.article-detail-meta span + span::before {
    content: "";
    width: 5px;
    height: 5px;
    margin-right: 12px;
    border-radius: 999px;
    background: rgba(184, 138, 46, 0.6);
}


/* ================================
   Featured image
================================ */

.article-detail-image-wrap,
.article-detail-image-fallback {
    width: 100%;
    min-height: 390px;
    margin: 0 0 42px;
    border: 1px solid rgba(20, 20, 20, 0.08);
    border-radius: 34px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(184, 138, 46, 0.18), rgba(255, 255, 255, 0.72)),
        #f5f1e8;
    box-shadow: 0 30px 90px rgba(15, 15, 15, 0.09);
}

.article-detail-image {
    display: block;
    width: 100%;
    height: 430px;
    object-fit: cover;
}

.article-detail-image-fallback {
    display: grid;
    place-items: center;
    text-align: center;
}

.article-detail-image-fallback div {
    display: grid;
    place-items: center;
    gap: 14px;
}

.article-detail-image-fallback span {
    width: 96px;
    height: 96px;
    display: grid;
    place-items: center;
    border-radius: 30px;
    background: rgba(184, 138, 46, 0.16);
    color: var(--gold);
    font-size: 2.8rem;
    font-weight: 900;
    box-shadow: inset 0 0 0 1px rgba(184, 138, 46, 0.16);
}

.article-detail-image-fallback p {
    margin: 0;
    color: var(--text-muted);
    font-weight: 800;
}


/* ================================
   Layout
================================ */

.article-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 34px;
    align-items: start;
}


/* ================================
   Markdown article content
================================ */

.article-detail-content {
    min-width: 0;
    padding: 54px 58px;
    border: 1px solid rgba(20, 20, 20, 0.07);
    border-radius: 34px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 22px 70px rgba(15, 15, 15, 0.055);
    overflow: hidden;
    overflow-wrap: break-word;
    word-break: normal;
}

.article-detail-content > * {
    max-width: 760px;
}

.article-detail-content > *:first-child {
    margin-top: 0;
}

.article-detail-content > *:last-child {
    margin-bottom: 0;
}

.article-detail-content h1,
.article-detail-content h2,
.article-detail-content h3,
.article-detail-content h4 {
    color: var(--text-main);
    font-weight: 850;
    letter-spacing: -0.045em;
}

.article-detail-content h1 {
    margin: 0 0 26px;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.08;
}

.article-detail-content h2 {
    margin: 54px 0 18px;
    font-size: clamp(1.55rem, 3vw, 2.05rem);
    line-height: 1.16;
}

.article-detail-content h3 {
    margin: 38px 0 14px;
    font-size: 1.32rem;
    line-height: 1.25;
}

.article-detail-content h4 {
    margin: 30px 0 12px;
    font-size: 1.08rem;
    line-height: 1.3;
}

.article-detail-content p {
    margin: 0 0 24px;
    color: #3f3f3f;
    font-size: 1.055rem;
    line-height: 1.88;
}

.article-detail-content p + h2,
.article-detail-content ul + h2,
.article-detail-content ol + h2,
.article-detail-content blockquote + h2,
.article-detail-content pre + h2 {
    margin-top: 58px;
}

.article-detail-content ul,
.article-detail-content ol {
    margin: 0 0 28px;
    padding-left: 1.35rem;
    color: #3f3f3f;
}

.article-detail-content li {
    margin-bottom: 10px;
    padding-left: 4px;
    font-size: 1.04rem;
    line-height: 1.78;
}

.article-detail-content li::marker {
    color: var(--gold);
    font-weight: 900;
}

.article-detail-content strong {
    color: var(--text-main);
    font-weight: 850;
}

.article-detail-content em {
    color: #4b4b4b;
}

.article-detail-content a {
    color: var(--gold);
    font-weight: 800;
    text-decoration: none;
    border-bottom: 1px solid rgba(184, 138, 46, 0.35);
}

.article-detail-content a:hover {
    border-bottom-color: var(--gold);
}

.article-detail-content blockquote {
    margin: 38px 0;
    padding: 24px 28px;
    border-left: 4px solid var(--gold);
    border-radius: 22px;
    background: rgba(184, 138, 46, 0.075);
}

.article-detail-content blockquote p {
    margin: 0;
    color: var(--text-main);
    font-size: 1.08rem;
    line-height: 1.78;
    font-weight: 700;
}

.article-detail-content p code,
.article-detail-content li code {
    padding: 3px 7px;
    border-radius: 7px;
    background: rgba(184, 138, 46, 0.11);
    color: #171717;
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 0.92em;
}

.article-detail-content pre {
    max-width: 100%;
    overflow-x: auto;
    margin: 34px 0;
    padding: 22px 24px;
    border-radius: 22px;
    background: #111827;
    color: #f9fafb;
    font-size: 0.92rem;
    line-height: 1.7;
}

.article-detail-content pre code {
    padding: 0;
    background: transparent;
    color: inherit;
    font-family: Consolas, Monaco, "Courier New", monospace;
}

.article-detail-content table {
    width: 100%;
    max-width: 100%;
    margin: 34px 0;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 18px;
    font-size: 0.95rem;
}

.article-detail-content th,
.article-detail-content td {
    padding: 14px 16px;
    border: 1px solid rgba(20, 20, 20, 0.08);
    text-align: left;
}

.article-detail-content th {
    background: rgba(184, 138, 46, 0.10);
    color: var(--text-main);
    font-weight: 850;
}

.article-detail-content td {
    background: rgba(255, 255, 255, 0.72);
    color: #444;
}

.article-detail-content hr {
    max-width: 760px;
    margin: 44px 0;
    border: 0;
    border-top: 1px solid rgba(20, 20, 20, 0.09);
}


/* ================================
   Sidebar
================================ */

.article-detail-sidebar {
    position: sticky;
    top: 96px;
    display: grid;
    gap: 20px;
}

.article-side-card {
    padding: 24px;
    border: 1px solid rgba(20, 20, 20, 0.08);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 20px 60px rgba(15, 15, 15, 0.06);
}

.article-side-label {
    display: inline-flex;
    margin-bottom: 12px;
    color: var(--gold);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.article-side-card h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.35rem;
    line-height: 1.18;
    letter-spacing: -0.04em;
}

.article-side-card p {
    margin: 14px 0 20px;
    color: var(--text-muted);
    font-size: 0.94rem;
    line-height: 1.7;
}

.article-side-button {
    width: 100%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 13px 16px;
    border-radius: 16px;
    background: var(--gold);
    color: #fff;
    font-size: 0.94rem;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 14px 30px rgba(184, 138, 46, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-side-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgba(184, 138, 46, 0.32);
}

.article-related-list {
    display: grid;
    gap: 12px;
}

.article-related-item {
    display: block;
    padding: 14px;
    border: 1px solid rgba(20, 20, 20, 0.07);
    border-radius: 18px;
    color: inherit;
    text-decoration: none;
    background: rgba(248, 246, 240, 0.7);
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.article-related-item:hover {
    transform: translateY(-2px);
    border-color: rgba(184, 138, 46, 0.28);
    background: rgba(184, 138, 46, 0.07);
}

.article-related-item strong {
    display: block;
    color: var(--text-main);
    font-size: 0.94rem;
    line-height: 1.35;
}

.article-related-item span {
    display: block;
    margin-top: 7px;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.55;
}


/* ================================
   Responsive
================================ */

@media (max-width: 980px) {
    .article-detail-layout {
        grid-template-columns: 1fr;
    }

    .article-detail-sidebar {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .article-detail-page {
        padding: 44px 18px 80px;
    }

    .article-detail-hero {
        margin-bottom: 28px;
        text-align: left;
    }

    .article-detail-meta {
        justify-content: flex-start;
    }

    .article-detail-image-wrap,
    .article-detail-image-fallback {
        min-height: 260px;
        margin-bottom: 28px;
        border-radius: 26px;
    }

    .article-detail-image {
        height: 280px;
    }

    .article-detail-content {
        padding: 30px 24px;
        border-radius: 26px;
    }

    .article-detail-content > * {
        max-width: 100%;
    }

    .article-detail-content h1 {
        font-size: 2rem;
    }

    .article-detail-content h2 {
        margin-top: 42px;
        font-size: 1.55rem;
    }

    .article-detail-content h3 {
        font-size: 1.22rem;
    }

    .article-detail-content p,
    .article-detail-content li {
        font-size: 1rem;
        line-height: 1.78;
    }

    .article-detail-sidebar {
        grid-template-columns: 1fr;
    }
}