/* Blog article layout — About-page editorial system, 2026-09-17
   2026-09-21 統一為全部文章共用模板(15 篇＋admin/article-gen.js):
   首屏 2.45:1、左 1/3 深綠資訊區＋右 2/3 主圖＋書脊；移除內容區大型章節數字 */
:root {
    --ar-bg: #faf8f4;
    --ar-paper: #f7f6f3;
    --ar-panel: #eff1eb;
    --ar-ink: #242729;
    --ar-text: #50534f;
    --ar-soft: #6c6d66;
    --ar-line: #deddd6;
    --ar-red: #b94316;
    --ar-red-dark: #96340f;
    --ar-sage: #cfd4c4;
    --ar-green: #355c50;
}

body { overflow-x: hidden; background: var(--ar-bg); color: var(--ar-text); }

/* ARTICLE HERO */
.article-hero {
    position: relative;
    min-height: 0;
    padding: 132px 0 64px;
    overflow: hidden;
    border: 0;
    background: var(--ar-bg);
    color: var(--ar-ink);
}
.article-hero::before,
.article-hero::after { display: none; }
.article-hero .container {
    position: relative;
    z-index: 2;
    max-width: 1160px;
}
.breadcrumb {
    max-width: none;
    margin: 0 0 24px;
    color: var(--ar-soft);
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 11px;
    letter-spacing: .08em;
    line-height: 1.7;
}
.breadcrumb a { color: var(--ar-red); }
.article-hero-panel {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 2fr;
    width: 100%;
    aspect-ratio: 2.45 / 1;   /* 內容若超過會自然撐高，不裁字 */
    background: var(--ar-green);
}
.article-hero-panel--no-image { grid-template-columns: 1fr; aspect-ratio: auto; }
.article-hero-copy {
    position: relative;
    z-index: 2;
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    padding: 38px 42px;
    background: linear-gradient(135deg, #29483f 0%, var(--ar-green) 100%);
    color: #fff;
}
.article-hero-copy::after {
    content: '';
    position: absolute;
    z-index: 3;
    top: 0;
    right: -16px;
    bottom: 0;
    width: 24px;
    background: rgba(36, 68, 59, .9);
    box-shadow: 10px 0 0 rgba(250, 248, 244, .12);
}
.article-hero-image {
    position: relative;
    z-index: 1;
    min-width: 0;
    height: 100%;
    margin: 0;
    overflow: hidden;
}
.article-hero-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(53, 92, 80, .18), transparent 35%);
    pointer-events: none;
}
.article-hero-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: saturate(.8) contrast(1.02);
}
.article-hero .accent-line { display: none; }
.article-kicker {
    position: relative;
    z-index: 5;
    margin: 0 0 22px;
    color: #efaa8c;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .22em;
    line-height: 1.5;
}
.article-hero h1 {
    position: relative;
    z-index: 5;
    max-width: none;
    margin: 0;
    color: #fff;
    font-family: 'Noto Serif TC', serif !important;
    font-size: clamp(29px, 2.45vw, 35px);
    font-weight: 500;
    letter-spacing: .075em;
    line-height: 1.55;
    text-wrap: balance;
    overflow-wrap: anywhere;
}
.article-meta {
    position: relative;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-top: 24px;
    color: rgba(255, 255, 255, .78);
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 11px;
    letter-spacing: .04em;
}
.article-meta span { padding: 0 9px; border-left: 1px solid rgba(255, 255, 255, .24); }
.article-meta span:first-child { padding-left: 0; border-left: 0; }
.article-tags { position: relative; z-index: 5; gap: 6px; max-width: none; margin-top: 18px; }
.article-tags span {
    padding: 3px 7px;
    border: 1px solid rgba(255, 255, 255, .25);
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, .76);
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 10px;
}

/* ARTICLE STAGE */
.article-body { padding: 0 0 96px; background: var(--ar-bg); }
.article-body.has-sidebar > .container { display: block; max-width: 1160px; }
.article-content {
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.blog-sidebar { display: none; }

/* Reading guide */
.article-intro-panel {
    position: relative;
    display: grid;
    grid-template-columns: .88fr 1.12fr;
    gap: 58px;
    margin: 0 0 28px;
    padding: 58px 50px 56px;
    background: var(--ar-panel);
}
.article-intro-panel::before {
    display: none;
}
.article-intro-panel::after {
    display: none;
}
.article-cover { display: none; }
.article-intro-panel:not(:has(.article-toc)) { grid-template-columns: 1fr; }
.article-intro-panel:not(:has(.article-toc)) .article-lead { padding-right: 0; }
.article-lead {
    align-self: start;
    margin: 0;
    padding: 0 40px 0 0;
    border: 0;
    color: var(--ar-ink);
    font-family: 'Noto Serif TC', serif !important;
    font-size: 23px;
    font-weight: 500;
    letter-spacing: .04em;
    line-height: 1.9;
}
.article-toc { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.article-toc .toc-title {
    margin: 0 0 16px;
    color: var(--ar-red);
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .2em;
}
.article-toc .toc-title::after { content: 'CONTENTS'; margin-left: 10px; color: #989990; font-size: 8px; }
.article-toc ol {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 26px;
    margin: 0;
    padding: 0;
    columns: auto;
    list-style: none;
    counter-reset: toc;
}
.article-toc li {
    position: relative;
    margin: 0;
    padding: 10px 0 10px 30px;
    border-top: 1px solid var(--ar-line);
    color: var(--ar-text);
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 12px;
    line-height: 1.65;
    counter-increment: toc;
}
.article-toc li::before {
    content: counter(toc, decimal-leading-zero);
    position: absolute;
    top: 11px;
    left: 0;
    color: var(--ar-red);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .08em;
}
.article-content .article-toc a { color: inherit; text-decoration: none; }
.article-content .article-toc a:hover { color: var(--ar-red); }

/* Content modules(大型章節數字已移除，標題直接貼齊區塊頂端) */
.article-section {
    display: grid;
    grid-template-columns: minmax(250px, .72fr) minmax(0, 1.28fr);
    gap: clamp(50px, 7vw, 92px);
    align-items: start;
    padding: 88px 28px;
    border-bottom: 1px solid var(--ar-line);
}
.article-section-head { position: sticky; top: 112px; }
.article-eyebrow {
    margin: 0 !important;
    color: var(--ar-red) !important;
    font-family: 'Noto Sans TC', sans-serif !important;
    font-size: 10px !important;
    font-weight: 700;
    letter-spacing: .2em;
    line-height: 1.5 !important;
}
.article-content .article-section h2 {
    margin: 26px 0 0;
    padding: 0;
    border: 0;
    color: var(--ar-ink);
    font-family: 'Noto Serif TC', serif !important;
    font-size: 30px;
    font-weight: 500;
    letter-spacing: .055em;
    line-height: 1.65;
}
.article-content .article-section h2::before { display: none; }
.article-content .article-section-head > h2:first-child { margin-top: 0; }
.article-section-copy { min-width: 0; padding-top: 5px; }
.article-content .article-section-copy p,
.article-content .article-section-copy li {
    color: var(--ar-text);
    font-family: 'Noto Sans TC', sans-serif !important;
    font-size: 15px;
    line-height: 2.05;
}
.article-content .article-section-copy p { margin: 0 0 21px; }
.article-content strong { color: var(--ar-ink); font-weight: 700; }
.article-content a {
    color: var(--ar-red-dark);
    text-decoration-color: rgba(185, 67, 22, .38);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
.article-content h3 {
    margin: 36px 0 14px;
    padding-top: 18px;
    border-top: 1px solid var(--ar-line);
    color: var(--ar-ink);
    font-family: 'Noto Serif TC', serif !important;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: .04em;
    line-height: 1.7;
}
.article-content > .article-section:first-of-type { border-top: 0; }
/* 標題前的導言段落(舊文首段圖/說明)：對齊內文欄 */
.article-section--opening { padding-top: 12px; padding-bottom: 56px; }
.article-section--opening .article-section-copy { grid-column: 2; }
/* 首屏已顯示封面，舊文內文裡同一張封面(＋圖說)不再重複；模組只剩封面時整個收起(09-21 使用者指定)
   :has 不能巢狀，所以「只剩封面」用 p:only-child 判斷 */
.article-section-copy > p:has(> img[src*="/cover."]) { display: none; }
.article-section--opening:has(> .article-section-copy > p:only-child > img[src*="/cover."]) { display: none; }
.article-section--story { margin-top: 36px; padding: 66px 58px; background: var(--ar-panel); border: 0; }

/* Images and captions */
.article-section-copy > p:has(> img) { position: relative; margin: 36px 0 30px; padding: 0 0 30px 28px; }
.article-section-copy > p:has(> img)::before {
    content: '';
    position: absolute;
    z-index: 0;
    bottom: 0;
    left: 0;
    width: 43%;
    height: 72%;
    background: var(--ar-sage);
}
.article-content .article-section-copy > p > img {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: none;
    height: auto;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
}
.article-section-copy > p > img + em {
    position: relative;
    z-index: 1;
    display: block;
    margin-top: 10px;
    color: var(--ar-soft);
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 11px;
    font-style: normal;
    line-height: 1.7;
}

/* Alternate compositions */
.article-section--visual { min-height: 560px; }
.article-section--reverse { grid-template-columns: minmax(0, 1.28fr) minmax(250px, .72fr); }
.article-section--reverse .article-section-head { grid-column: 2; grid-row: 1; }
.article-section--reverse .article-section-copy { grid-column: 1; grid-row: 1; }

/* Specification panel */
.article-section--spec { margin: 30px 0; padding: 70px 58px; background: var(--ar-panel); border: 0; }
.article-content table {
    width: 100%;
    margin: 30px 0 34px;
    border: 0;
    border-top: 1px solid var(--ar-ink);
    border-collapse: collapse;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 13px;
}
.article-content table th,
.article-content table td {
    padding: 12px 13px;
    border: 0;
    border-bottom: 1px solid var(--ar-line);
    background: transparent;
    color: var(--ar-text);
    line-height: 1.7;
    text-align: left;
}
.article-content table th { background: var(--ar-ink); color: #fff; font-size: 11px; font-weight: 500; letter-spacing: .04em; }
.article-content table tr:nth-child(even) td { background: rgba(255, 255, 255, .45); }

/* Common mistakes */
.article-section--mistakes { margin: 30px 0; padding: 64px 58px; background: var(--ar-sage); border: 0; }
.article-section--mistakes ul { margin: 18px 0 0; padding: 0; list-style: none; }
.article-section--mistakes li {
    position: relative;
    margin: 0;
    padding: 15px 0 15px 32px;
    border-top: 1px solid rgba(36, 39, 41, .16);
}
.article-section--mistakes li::before {
    content: '×';
    position: absolute;
    top: 13px;
    left: 2px;
    color: var(--ar-red);
    font-family: 'Noto Serif TC', serif;
    font-size: 20px;
}
.article-section--summary { padding-bottom: 76px; }

/* FAQ */
.article-section--faq { display: block; margin-top: 8px; padding: 70px 58px; border: 0; background: var(--ar-paper); }
.article-section--faq .article-section-head {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    column-gap: 28px;
    align-items: end;
    margin-bottom: 38px;
}
.article-section--faq .article-eyebrow,
.article-section--faq h2 { grid-column: 1; }
.article-content .article-section--faq h2 { margin-top: 10px; }
/* 沒有手寫英文小標的文章(模板產生)FAQ 區自動補「FAQ」小標，跟基準文一致 */
.article-section--faq .article-section-head:not(:has(.article-eyebrow))::before {
    content: 'FAQ';
    display: block;
    color: var(--ar-red);
    font-family: 'Noto Sans TC', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .2em;
    line-height: 1.5;
}
.article-content .article-section--faq .article-section-head > h2 { margin-top: 10px; }
.article-section--faq .article-section-copy { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.faq-item {
    margin: 0;
    padding: 22px 24px;
    border: 1px solid var(--ar-line);
    border-left: 3px solid var(--ar-red);
    border-radius: 0;
    background: var(--ar-bg);
}
.faq-q {
    margin: 0 0 9px !important;
    color: var(--ar-ink) !important;
    font-family: 'Noto Serif TC', serif !important;
    font-size: 15px !important;
    font-weight: 600;
    line-height: 1.7 !important;
}
.faq-a p { margin: 0 !important; color: var(--ar-soft) !important; font-size: 13px !important; line-height: 1.9 !important; }
.article-closing {
    grid-column: 1 / -1;
    margin: 20px 0 0;
    padding: 38px 42px;
    border: 0;
    border-top: 3px solid var(--ar-red);
    background: var(--ar-panel);
    text-align: left;
}
.article-closing p { color: var(--ar-text) !important; font-size: 13px !important; line-height: 1.95 !important; }
.article-closing p:last-child { margin-top: 22px !important; }
.article-closing p:last-child a {
    display: inline-block;
    padding: 11px 24px;
    background: var(--ar-red);
    color: #fff;
    text-decoration: none;
}

/* Bottom navigation */
.article-footer-nav { padding: 18px 0 72px; background: var(--ar-bg); }
.article-footer-nav .afn-wrap { max-width: 1112px; }
.article-footer-nav .afn-prev,
.article-footer-nav .afn-next,
.article-footer-nav > a { border-radius: 0; box-shadow: none; }

@media (max-width: 1180px) {
    .article-content .article-section h2 { font-size: 26px; }
}

@media (max-width: 900px) {
    .article-hero { padding: 120px 0 56px; }
    .article-hero-panel { grid-template-columns: 2fr 3fr; aspect-ratio: auto; min-height: 360px; }
    .article-hero-copy { padding: 30px 28px; }
    .article-hero h1 { font-size: 27px; }
    .article-meta { font-size: 10px; }
    .article-tags { display: none; }
    .article-intro-panel { grid-template-columns: 1fr; padding-left: 50px; }
    .article-lead { padding-right: 0; }
    .article-section,
    .article-section--reverse { grid-template-columns: 1fr; gap: 34px; padding: 68px 34px; }
    .article-section-head,
    .article-section--reverse .article-section-head { position: static; grid-column: 1; grid-row: auto; }
    .article-section-copy,
    .article-section--reverse .article-section-copy { grid-column: 1; grid-row: auto; }
    .article-section--story,
    .article-section--spec,
    .article-section--mistakes,
    .article-section--faq { padding-right: 38px; padding-left: 38px; }
}

@media (max-width: 620px) {
    .article-hero { padding-top: 104px; padding-bottom: 48px; }
    .article-hero .container { padding-right: 20px; padding-left: 20px; }
    .breadcrumb { display: none; }
    .article-hero-panel { display: flex; height: auto; flex-direction: column; }
    .article-hero-panel { aspect-ratio: auto; min-height: 0; }
    .article-hero-copy { min-height: 0; padding: 24px 24px 28px; }
    .article-hero-copy::after { top: auto; right: 0; bottom: 0; left: 0; width: auto; height: 6px; box-shadow: none; }
    .article-kicker { margin-bottom: 14px; }
    .article-meta { margin-top: 16px; }
    .article-hero-image { height: auto; }
    .article-hero-image img { height: auto; object-fit: contain; }
    .article-hero h1 {
        max-width: 100%;
        font-size: 27px;
        letter-spacing: .035em;
        white-space: normal !important;
        word-break: break-word;
        text-wrap: wrap;
    }
    .article-meta span { display: block; width: 100%; padding: 2px 0; border: 0; }
    .article-body.has-sidebar > .container { padding-right: 20px; padding-left: 20px; }
    .article-intro-panel { grid-template-columns: 1fr; gap: 34px; padding: 38px 24px; }
    .article-lead { font-size: 19px; line-height: 1.85; }
    .article-toc ol { grid-template-columns: 1fr; }
    .article-section,
    .article-section--story,
    .article-section--spec,
    .article-section--mistakes,
    .article-section--faq { margin-right: 0; margin-left: 0; padding: 58px 22px; }
    .article-section:not(.article-section--story):not(.article-section--spec):not(.article-section--mistakes):not(.article-section--faq) { padding-right: 4px; padding-left: 4px; }
    .article-content .article-section h2 { font-size: 24px; }
    .article-content .article-section-copy p,
    .article-content .article-section-copy li { font-size: 14.5px; line-height: 2; }
    .article-section-copy > p:has(> img) { padding: 0 0 22px 14px; }
    .article-content table { display: block; width: 100%; max-width: 100%; overflow-x: auto; }
    .article-section--faq .article-section-head { display: block; }
    .article-section--faq .article-section-copy { grid-template-columns: 1fr; }
    .article-closing { padding: 28px 24px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
