/* @file    nap-article.css
   @created 2026-06-14 by Claude
   @updated 2026-06-14 by Claude
   @desc    Scoped styles for the News/Event article-detail page redesign
            ("ຂ່າວ ແລະ ກິດຈະກຳ - ລາຍລະອຽດ" Claude Design handoff). All rules are
            namespaced under .article-page so they never clash with global classes.
            Design tokens (--green-*, --ink-*, --line, --paper, --bg, --shadow*)
            come from nap-header-footer.css :root (loaded globally by base.html). */

.article-page{font-family:'Noto Sans Lao',system-ui,sans-serif;color:var(--ink);line-height:1.6}
.article-page *{box-sizing:border-box}
.article-page a{text-decoration:none;color:inherit}
.article-page svg{display:block}

/* ============ BREADCRUMB ============ */
.article-page .crumb{background:var(--paper);border-bottom:1px solid var(--line)}
.article-page .crumb-inner{max-width:var(--maxw);margin:0 auto;padding:13px 32px;display:flex;align-items:center;gap:9px;font-size:12.5px;font-weight:600;color:var(--ink-faint);flex-wrap:wrap}
.article-page .crumb-inner a{color:var(--ink-soft);transition:color .15s}
.article-page .crumb-inner a:hover{color:var(--green-700)}
.article-page .crumb-inner svg{width:13px;height:13px;color:var(--ink-faint);opacity:.7}
.article-page .crumb-inner .cur{color:var(--green-800);font-weight:800;max-width:38ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ============ ARTICLE ============ */
.article-page .article-shell{max-width:1080px;margin:0 auto;padding:34px 32px 10px}
.article-page .a-head{position:relative}
.article-page .a-badges{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:18px}
.article-page .a-cat{display:inline-flex;align-items:center;gap:8px;background:var(--green-700);color:#fff;font-size:12px;font-weight:800;letter-spacing:.3px;padding:7px 15px;border-radius:999px}
.article-page .a-cat svg{width:14px;height:14px}
.article-page .a-title{margin:0;font-size:38px;line-height:1.22;font-weight:900;color:var(--green-950);letter-spacing:-.6px;text-wrap:balance}
.article-page .a-line{display:block;width:60px;height:4px;border-radius:3px;background:var(--green-400);margin:22px 0 0}

/* meta row */
.article-page .a-meta{display:flex;align-items:center;gap:22px;flex-wrap:wrap;margin:24px 0 0;padding:18px 0 0;border-top:1px solid var(--line)}
.article-page .a-author{display:flex;align-items:center;gap:12px}
.article-page .a-author .av{width:42px;height:42px;border-radius:50%;background:linear-gradient(150deg,var(--green-600),var(--green-800));color:#fff;display:grid;place-items:center;font-weight:800;font-size:16px;flex:0 0 auto}
.article-page .a-author b{display:block;font-size:14px;font-weight:800;color:var(--green-900);line-height:1.2}
.article-page .a-author span{display:block;font-size:12px;font-weight:600;color:var(--ink-faint);margin-top:2px}
.article-page .a-metaitem{display:inline-flex;align-items:center;gap:8px;font-size:13px;font-weight:600;color:var(--ink-soft)}
.article-page .a-metaitem svg{width:16px;height:16px;color:var(--green-600);flex:0 0 auto}

/* featured image */
.article-page .a-figure{max-width:1080px;margin:30px auto 0;padding:0 32px}
.article-page .a-figure .fimg{display:block;width:100%;aspect-ratio:16/9;object-fit:cover;border-radius:22px;box-shadow:var(--shadow-lg);overflow:hidden;background:var(--green-50)}
.article-page .a-figure figcaption{display:flex;align-items:center;gap:9px;margin:14px 4px 0;font-size:12.5px;color:var(--ink-faint);font-weight:600}
.article-page .a-figure figcaption svg{width:14px;height:14px;flex:0 0 auto;color:var(--green-600)}

/* body layout: prose only */
.article-page .a-body-wrap{max-width:1080px;margin:0 auto;padding:18px 32px 0}

.article-page .prose{max-width:none;font-size:17px;line-height:1.95;color:#27332d}
.article-page .prose>p{margin:0 0 22px;text-wrap:pretty}
.article-page .prose strong{color:var(--green-800);font-weight:800}
.article-page .prose h3{font-size:22px;font-weight:900;color:var(--green-900);letter-spacing:-.3px;margin:38px 0 14px}
.article-page .prose a{color:var(--green-700);font-weight:700;text-decoration:underline;text-decoration-color:var(--green-100);text-underline-offset:3px;word-break:break-word}
.article-page .prose a:hover{text-decoration-color:var(--green-500)}
.article-page .prose ul{margin:0 0 22px;padding:0;list-style:none;display:flex;flex-direction:column;gap:12px}
.article-page .prose ul li{position:relative;padding-left:30px;font-size:16.5px;line-height:1.7}
.article-page .prose ul li::before{content:"";position:absolute;left:4px;top:11px;width:9px;height:9px;border-radius:50%;background:var(--green-500);box-shadow:0 0 0 4px var(--green-50)}

/* attachment download card — DB: has_attachment() / get_attachment_download_url() */
.article-page .attach{display:flex;align-items:center;gap:16px;margin:36px 0 0;padding:16px 18px;background:var(--green-50);border:1px solid var(--green-100);border-radius:16px;transition:border-color .15s,transform .15s,box-shadow .15s}
.article-page .attach:hover{border-color:var(--green-400);transform:translateY(-2px);box-shadow:var(--shadow)}
.article-page .attach-ic{position:relative;width:46px;height:46px;flex:0 0 auto;border-radius:12px;background:var(--green-700);color:#fff;display:grid;place-items:center}
.article-page .attach-ic svg{width:22px;height:22px}
.article-page .attach-ic .attach-ext{position:absolute;bottom:-6px;right:-6px;background:#fff;color:var(--green-800);font-size:9px;font-weight:900;letter-spacing:.3px;padding:2px 5px;border-radius:6px;box-shadow:0 0 0 2px var(--green-50)}
.article-page .attach-meta{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:3px}
.article-page .attach-meta b{font-size:15px;font-weight:800;color:var(--green-900);line-height:1.3;word-break:break-word}
.article-page .attach-meta span{font-size:12.5px;font-weight:600;color:var(--ink-soft)}
.article-page .attach-dl{flex:0 0 auto;width:42px;height:42px;border-radius:11px;background:var(--green-700);color:#fff;display:grid;place-items:center;transition:background .15s}
.article-page .attach:hover .attach-dl{background:var(--green-800)}
.article-page .attach-dl svg{width:19px;height:19px}

/* back link */
.article-page .a-back{max-width:1080px;margin:0 auto;padding:26px 32px 0}
.article-page .back-btn{display:inline-flex;align-items:center;gap:9px;color:var(--green-700);font-size:14px;font-weight:800;padding:11px 20px;border:1px solid var(--green-100);background:var(--green-50);border-radius:999px;transition:all .15s}
.article-page .back-btn:hover{background:var(--green-700);color:#fff;border-color:var(--green-700);gap:13px}
.article-page .back-btn svg{width:17px;height:17px}

/* ============ RELATED ============ */
.article-page .related{margin-top:46px;background:var(--paper);border-top:1px solid var(--line);padding:54px 0 64px}
.article-page .rel-head{max-width:var(--maxw);margin:0 auto 28px;padding:0 32px;display:flex;align-items:flex-end;justify-content:space-between;gap:20px}
.article-page .rel-kick{display:inline-flex;align-items:center;gap:9px;font-size:11.5px;font-weight:800;letter-spacing:1px;text-transform:uppercase;color:var(--green-600);margin-bottom:9px}
.article-page .rel-kick .k-ic{width:28px;height:28px;border-radius:8px;background:var(--green-50);display:grid;place-items:center}
.article-page .rel-kick .k-ic svg{width:15px;height:15px;color:var(--green-700)}
.article-page .rel-head h2{margin:0;font-size:27px;font-weight:900;color:var(--green-900);letter-spacing:-.4px}
.article-page .rel-all{display:inline-flex;align-items:center;gap:7px;color:var(--green-700);font-size:13.5px;font-weight:800;white-space:nowrap;padding:10px 18px;border:1px solid var(--green-100);border-radius:999px;transition:all .15s}
.article-page .rel-all:hover{background:var(--green-50);gap:10px}
.article-page .rel-all svg{width:15px;height:15px}
.article-page .rel-grid{max-width:var(--maxw);margin:0 auto;padding:0 32px;display:grid;grid-template-columns:repeat(3,1fr);gap:24px}
.article-page .ncard{display:flex;flex-direction:column;background:var(--paper);border:1px solid var(--line);border-radius:18px;overflow:hidden;box-shadow:var(--shadow);transition:transform .2s,box-shadow .2s,border-color .2s}
.article-page .ncard:hover{transform:translateY(-5px);box-shadow:var(--shadow-lg);border-color:var(--green-100)}
.article-page .ncard .nc-media{position:relative;aspect-ratio:16/10;overflow:hidden}
.article-page .ncard .nc-media .nc-img{width:100%;height:100%;object-fit:cover;background:var(--green-50)}
.article-page .ncard .nc-cat{position:absolute;top:12px;left:12px;background:rgba(7,37,24,.82);backdrop-filter:blur(4px);color:#fff;font-size:11px;font-weight:800;padding:5px 12px;border-radius:999px}
.article-page .ncard .nc-body{padding:18px 19px 20px;display:flex;flex-direction:column;flex:1 1 auto}
.article-page .ncard .nc-date{display:inline-flex;align-items:center;gap:7px;font-size:12px;font-weight:700;color:var(--ink-faint);margin-bottom:10px}
.article-page .ncard .nc-date svg{width:13px;height:13px;color:var(--green-600)}
.article-page .ncard h3{margin:0;font-size:16.5px;font-weight:800;color:var(--green-900);line-height:1.45;letter-spacing:-.2px;text-wrap:pretty;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.article-page .ncard .nc-more{margin-top:auto;padding-top:16px;display:inline-flex;align-items:center;gap:8px;color:var(--green-700);font-size:13.5px;font-weight:800;transition:gap .15s}
.article-page .ncard:hover .nc-more{gap:11px}
.article-page .ncard .nc-more svg{width:15px;height:15px}

/* ============ RESPONSIVE ============ */
@media (max-width:900px){
  .article-page .a-title{font-size:30px}
  .article-page .rel-grid{grid-template-columns:1fr 1fr}
}
@media (max-width:680px){
  .article-page .crumb-inner{padding-left:18px;padding-right:18px}
  .article-page .article-shell,.article-page .a-figure,.article-page .a-body-wrap,.article-page .a-back{padding-left:18px;padding-right:18px}
  .article-page .a-title{font-size:25px}
  .article-page .a-meta{gap:14px}
  .article-page .rel-grid{grid-template-columns:1fr}
}
