/* Public article / album pages (external_newsblog.php, external_photos.php) - 2026-09-27.
   Uses the theme tokens from km-theme.css (--km-primary, --km-surface, ...). ASCII only. */

.ke-body .content-wrapper { background: var(--km-bg); }
.ke-page { max-width: 1180px; margin: 0 auto; padding: 20px 16px 40px; }

/* top bar */
.ke-top .ke-top-in { display: flex; align-items: center; gap: 12px; min-height: 54px; }
.ke-top .ke-owner-nav { margin: 0; float: none; min-width: 0; }
.ke-top .ke-owner-nav > li { float: none; }
.ke-top .ke-owner-nav > li > a.ke-owner { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; padding: 5px 14px 5px 5px; margin: 8px 0; border-radius: 999px; background: rgba(255,255,255,.14); max-width: 70vw; line-height: 1.3; }
.ke-top .ke-owner-nav > li > a.ke-owner:hover, .ke-top .ke-owner-nav > li > a.ke-owner:focus { text-decoration: none; background: rgba(255,255,255,.26); }
.ke-owner img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: #fff; }
.ke-owner span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ke-top .navbar-custom-menu { margin-left: auto; }

/* reading progress */
.ke-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 2000; background: var(--km-primary); transition: width .08s linear; pointer-events: none; }

/* layout */
.ke-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.ke-main { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.ke-side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 16px; }
.ke-album + .ke-layout { margin-top: 20px; }
@media (max-width: 991px) {
  .ke-layout { grid-template-columns: minmax(0, 1fr); }
  .ke-side { position: static; }
}

/* cards */
.ke-card { background: var(--km-surface); border: 1px solid var(--km-border); border-radius: 18px; box-shadow: var(--km-shadow-sm); }
.ke-card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 0; }
.ke-card-head h2, .ke-sec-head h2 { margin: 0; font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.ke-card-head h2 .fa, .ke-sec-head h2 .fa { color: var(--km-primary); }
.ke-count { display: inline-block; min-width: 24px; padding: 1px 8px; border-radius: 999px; background: var(--km-primary-soft); color: var(--km-primary); font-size: 12.5px; font-weight: 600; text-align: center; }
.ke-muted { color: var(--km-muted); font-size: 13px; }

/* chips */
.ke-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ke-chips:empty { display: none; }
.ke-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: var(--km-surface-2); border: 1px solid var(--km-border); color: var(--km-muted); font-size: 12.5px; line-height: 1.5; }
.ke-chip.is-primary { background: var(--km-primary-soft); border-color: transparent; color: var(--km-primary); font-weight: 500; }
.ke-chip.is-ok { background: rgba(18,183,106,.1); border-color: transparent; color: #067647; }
.ke-chip.is-warn { background: rgba(247,144,9,.12); border-color: transparent; color: #b54708; }
.ke-chip-sm { padding: 0 7px; font-size: 11px; vertical-align: 1px; }

/* article head */
.ke-head { padding: 28px 32px 20px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--km-border); }
.ke-title { margin: 0; font-size: clamp(22px, 3.2vw, 32px); line-height: 1.3; font-weight: 600; color: var(--km-text); word-wrap: break-word; overflow-wrap: anywhere; }
.ke-head-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ke-edit { margin-left: auto; border-radius: 999px; }
.ke-byline { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ke-byline > div { min-width: 0; }
.ke-ava { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--km-surface-2); flex: none; }
.ke-byline-name { font-weight: 600; color: var(--km-text); }
.ke-byline-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--km-muted); }
.ke-byline-meta .fa { margin-right: 3px; }

/* article body */
.ke-content { padding: 26px 32px; font-size: 16.5px; line-height: 1.85; color: var(--km-text); overflow-wrap: anywhere; }
.ke-content:empty { display: none; }
.ke-content img { max-width: 100% !important; height: auto !important; border-radius: 12px; cursor: zoom-in; }
.ke-content iframe, .ke-content video { max-width: 100%; border-radius: 12px; }
.ke-content table { max-width: 100%; display: block; overflow-x: auto; }
.ke-content blockquote { border-left: 4px solid var(--km-primary); background: var(--km-surface-2); margin: 16px 0; padding: 12px 18px; border-radius: 0 12px 12px 0; }
.ke-content a { text-decoration: underline; text-underline-offset: 3px; }
.ke-content h1, .ke-content h2, .ke-content h3 { line-height: 1.4; margin-top: 1.4em; }
.ke-content p { margin: 0 0 1em; }

/* photos */
.ke-photos { padding: 0 32px 26px; }
.ke-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; }
.ke-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ke-gallery.is-album { padding: 0 20px 20px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.ke-ph { position: relative; display: block; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 12px; background: var(--km-surface-2); outline-offset: 2px; }
.ke-ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s var(--km-ease), filter .35s; }
.ke-ph::after { content: "\f00e"; font-family: FontAwesome; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 22px; background: rgba(0,0,0,.28); opacity: 0; transition: opacity .25s; }
.ke-ph:hover img, .ke-ph:focus img { transform: scale(1.05); }
.ke-ph:hover::after, .ke-ph:focus::after { opacity: 1; }
/* masonry view: natural proportions */
.ke-gallery.is-masonry { display: block; column-width: 220px; column-gap: 8px; }
.ke-gallery.is-masonry .ke-ph { aspect-ratio: auto; margin-bottom: 8px; break-inside: avoid; }
.ke-gallery.is-masonry .ke-ph img { height: auto; }

.ke-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 16px 20px 12px; }
.ke-seg { display: inline-flex; border: 1px solid var(--km-border); border-radius: 10px; overflow: hidden; }
.ke-seg button { border: 0; background: var(--km-surface); color: var(--km-muted); padding: 5px 11px; }
.ke-seg button + button { border-left: 1px solid var(--km-border); }
.ke-seg button.is-on { background: var(--km-primary-soft); color: var(--km-primary); }

/* actions */
.ke-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--km-border); }
.ke-btn { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--km-border); background: var(--km-surface); color: var(--km-text); font-size: 14px; line-height: 1.4; cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .15s; }
.ke-btn:hover, .ke-btn:focus { text-decoration: none; background: var(--km-surface-2); color: var(--km-text); }
.ke-btn:active { transform: scale(.96); }
.ke-btn.is-on { background: var(--km-primary); border-color: var(--km-primary); color: #fff; }
.ke-btn.is-static { cursor: default; }
.ke-btn.is-busy { opacity: .6; pointer-events: none; }
.ke-btn.is-pop .fa { animation: ke-pop .4s var(--km-ease); }
@keyframes ke-pop { 40% { transform: scale(1.45) rotate(-12deg); } }
.ke-share { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.ke-share-label { font-size: 13px; color: var(--km-muted); margin-right: 2px; }
.ke-share-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--km-border); background: var(--km-surface); color: var(--km-muted); display: inline-flex; align-items: center; justify-content: center; font-size: 15px; transition: all .15s; }
.ke-share-btn:hover, .ke-share-btn:focus { text-decoration: none; color: #fff; background: var(--km-primary); border-color: var(--km-primary); }
.ke-share-btn.is-fb:hover { background: #1877f2; border-color: #1877f2; }
.ke-share-btn.is-line { font-size: 9.5px; letter-spacing: -.2px; }
.ke-share-btn.is-line:hover { background: #06c755; border-color: #06c755; }
.ke-share-btn.is-x:hover { background: #111; border-color: #111; }
.ke-share-btn[hidden] { display: none; }
@media (max-width: 600px) {
  .ke-share { margin-left: 0; width: 100%; }
  .ke-hide-sm { display: none; }
}

/* previous / next */
.ke-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ke-pn-item { display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; background: var(--km-surface); border: 1px solid var(--km-border); border-radius: 16px; color: var(--km-text); transition: border-color .15s, box-shadow .15s, transform .15s; min-width: 0; }
.ke-pn-item:hover, .ke-pn-item:focus { text-decoration: none; color: var(--km-text); border-color: var(--km-primary); box-shadow: var(--km-shadow); transform: translateY(-2px); }
.ke-pn-item small { color: var(--km-primary); font-weight: 500; }
.ke-pn-item b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ke-pn-item.is-next { text-align: right; }
@media (max-width: 480px) { .ke-pn { grid-template-columns: 1fr; } .ke-pn > span { display: none; } }

/* comments */
.ke-comments { padding-bottom: 12px; }
.ke-cm-form { display: flex; gap: 12px; padding: 16px 20px 6px; align-items: flex-start; }
.ke-cm-input { flex: 1; min-width: 0; border: 1px solid var(--km-border); border-radius: 16px; background: var(--km-surface-2); transition: border-color .15s, box-shadow .15s; }
.ke-cm-input:focus-within { border-color: var(--km-primary); box-shadow: 0 0 0 4px var(--km-primary-ring); background: var(--km-surface); }
.ke-cm-input textarea { display: block; width: 100%; border: 0; background: transparent; resize: none; padding: 11px 14px 4px; min-height: 44px; max-height: 260px; font-size: 15px; line-height: 1.55; outline: 0; color: var(--km-text); }
.ke-cm-tools { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 4px 8px 8px 14px; }
.ke-cm-tools .btn { border-radius: 999px; }
.ke-hint { font-size: 12px; color: var(--km-muted); }
.ke-note { margin: 16px 20px 4px; padding: 12px 16px; border-radius: 12px; background: var(--km-surface-2); color: var(--km-muted); font-size: 14px; }
.ke-cm-list { list-style: none; margin: 0; padding: 8px 20px 0; }
.ke-cm { display: flex; gap: 10px; padding: 8px 0; }
.ke-cm.is-new { animation: ke-in .45s var(--km-ease); }
.ke-cm.is-leaving { opacity: 0; transform: translateX(12px); transition: all .25s; }
@keyframes ke-in { from { opacity: 0; transform: translateY(-8px); } }
.ke-cm .ke-ava { width: 36px; height: 36px; }
.ke-cm-body { min-width: 0; flex: 1; }
.ke-cm-bubble { display: inline-block; max-width: 100%; background: var(--km-surface-2); border: 1px solid var(--km-border); border-radius: 4px 16px 16px 16px; padding: 8px 14px; }
.ke-cm-name { font-weight: 600; font-size: 13.5px; color: var(--km-text); }
.ke-cm-text { font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; }
.ke-cm-meta { display: flex; gap: 12px; align-items: center; font-size: 12px; color: var(--km-muted); padding: 3px 0 0 12px; }
.ke-link-btn { border: 0; background: none; padding: 0; color: var(--km-muted); font-size: 12px; }
.ke-link-btn:hover { color: var(--km-danger); }
.ke-empty { text-align: center; color: var(--km-muted); padding: 24px 16px; margin: 0; }
.ke-more { text-align: center; padding: 6px 0 4px; }
.ke-more .btn { border-radius: 999px; }

/* author */
.ke-author { padding: 24px 20px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ke-author-pic { position: relative; display: inline-block; margin-bottom: 4px; }
.ke-author-pic img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 4px solid var(--km-surface); box-shadow: 0 0 0 2px var(--km-primary-soft), var(--km-shadow); }
.ke-online { position: absolute; right: 6px; bottom: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--km-success); border: 3px solid var(--km-surface); }
.ke-author-name { font-size: 17px; font-weight: 600; color: var(--km-text); }
.ke-author-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 4px 0; }
.ke-author-stats { display: grid; grid-template-columns: 1fr 1fr; width: 100%; margin: 8px 0 10px; border: 1px solid var(--km-border); border-radius: 12px; overflow: hidden; }
.ke-author-stats > div { padding: 8px 4px; display: flex; flex-direction: column; }
.ke-author-stats > div + div { border-left: 1px solid var(--km-border); }
.ke-author-stats b { font-size: 18px; color: var(--km-primary); }
.ke-author-stats span { font-size: 12px; color: var(--km-muted); }
.ke-author-org { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font-size: 13px; padding: 8px 10px; margin-bottom: 10px; border-radius: 12px; background: var(--km-surface-2); }
.ke-author-org img { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; background: #fff; }
.ke-author .btn-block { border-radius: 999px; }

/* more from author */
.ke-more-list { list-style: none; margin: 0; padding: 10px 12px 12px; }
.ke-more-list a { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; color: var(--km-text); }
.ke-more-list a:hover, .ke-more-list a:focus { text-decoration: none; background: var(--km-surface-2); color: var(--km-text); }
.ke-more-list img, .ke-thumb-ph { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: none; background: var(--km-surface-2); }
.ke-thumb-ph { display: flex; align-items: center; justify-content: center; color: var(--km-muted); font-size: 22px; }
.ke-more-txt { display: flex; flex-direction: column; min-width: 0; }
.ke-more-txt b { font-weight: 500; font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ke-more-txt small { color: var(--km-muted); }

/* admin review bar */
.ke-approve { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 12px 18px; margin-bottom: 20px; border-left: 5px solid var(--km-warning); }
.ke-approve.is-on { border-left-color: var(--km-success); }
.ke-approve-txt .fa { color: var(--km-muted); margin-right: 4px; }
.ke-approve [data-ke-approve-state] { margin-left: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; background: rgba(247,144,9,.12); color: #b54708; }
.ke-approve.is-on [data-ke-approve-state] { background: rgba(18,183,106,.1); color: #067647; }
.ke-approve .btn { border-radius: 999px; }

/* blocked / missing */
.ke-blocked { max-width: 520px; margin: 40px auto; padding: 44px 28px; text-align: center; }
.ke-blocked > .fa { font-size: 44px; color: var(--km-primary); background: var(--km-primary-soft); width: 88px; height: 88px; line-height: 88px; border-radius: 50%; margin-bottom: 14px; }
.ke-blocked h1 { font-size: 22px; margin: 0 0 6px; }
.ke-blocked p { color: var(--km-muted); margin-bottom: 18px; }

/* small screens */
@media (max-width: 600px) {
  .ke-page { padding: 12px 10px 28px; }
  .ke-head { padding: 20px 18px 16px; }
  .ke-content { padding: 20px 18px; font-size: 16px; }
  .ke-photos { padding: 0 18px 20px; }
  .ke-gallery { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .ke-gallery.is-album { padding: 0 10px 12px; grid-template-columns: repeat(2, 1fr); }
  .ke-ph { border-radius: 8px; }
  .ke-actions { padding: 12px 16px; }
  .ke-cm-form, .ke-cm-list { padding-left: 12px; padding-right: 12px; }
  .ke-cm-form > .ke-ava { display: none; }
  .ke-edit { margin-left: 0; }
}

/* inside the lightwindow popup */
html.km-embed .ke-page { padding-top: 12px; }
html.km-embed .ke-progress { display: none; }

/* print: the article only */
@media print {
  .ke-top, .ke-side, .ke-actions, .ke-comments, .ke-pn, .ke-progress, .ke-approve, .main-footer, .ke-sec-head .btn { display: none !important; }
  .ke-layout { display: block; }
  .ke-card { border: 0; box-shadow: none; }
  .ke-body .content-wrapper { background: #fff; }
  .ke-gallery { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .ke-ph img, .ke-btn, .ke-pn-item, .ke-cm.is-new { transition: none; animation: none; }
}

/* ---- public link page (external_links.php) - 2026-09-27 ---- */
.kl-body .ke-top .ke-top-in { flex-wrap: wrap; }
.kl-body .ke-top .kl-menu { flex: 1 1 auto; min-width: 0; padding: 0; border: 0; box-shadow: none; }
.kl-body .ke-top .kl-menu > .navbar-nav { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.kl-body .ke-top .kl-menu > .navbar-nav > li { float: none; }
.kl-body .ke-top .kl-menu > .navbar-nav > li > a { border-radius: 10px; padding: 8px 12px; margin: 7px 0; font-size: 14.5px; }
.kl-body .ke-top .kl-menu > .navbar-nav > li > a:hover,
.kl-body .ke-top .kl-menu > .navbar-nav > li.open > a { background: rgba(255,255,255,.16); }
.kl-body .ke-top .kl-menu .dropdown-menu { border-radius: 14px; padding: 6px; border: 1px solid var(--km-border); box-shadow: var(--km-shadow); min-width: 220px; }
.kl-body .ke-top .kl-menu .dropdown-menu > li > a { border-radius: 9px; padding: 8px 12px; white-space: normal; }
.kl-body .ke-top .kl-menu .dropdown-menu > li > a:hover { background: var(--km-primary-soft); color: var(--km-primary); }
.kl-body .ke-top .kl-menu-toggle { display: none; order: 2; margin-left: auto; float: none; color: #fff; background: rgba(255,255,255,.14); border: 0; }
.kl-body .ke-top .kl-menu-toggle .fa { font-size: 18px; }
.kl-body .ke-top .navbar-custom-menu { order: 3; }
@media (max-width: 767px) {
  .kl-body .ke-top .kl-menu-toggle { display: flex; }
  .kl-body .ke-top .navbar-custom-menu { margin-left: 0; }
  .kl-body .ke-top .kl-menu { order: 4; flex-basis: 100%; }
  .kl-body .ke-top .kl-menu.collapse:not(.in) { display: none !important; }
  .kl-body .ke-top .kl-menu > .navbar-nav { flex-direction: column; align-items: stretch; padding-bottom: 8px; }
  .kl-body .ke-top .kl-menu > .navbar-nav > li > a { margin: 0; }
  .kl-body .ke-top .kl-menu .open .dropdown-menu { position: static; float: none; box-shadow: none; background: rgba(255,255,255,.08); border: 0; }
  .kl-body .ke-top .kl-menu .open .dropdown-menu > li > a { color: #fff; }
}

.kl-single { grid-template-columns: minmax(0, 1fr); max-width: 900px; margin: 0 auto; }
.kl-head { background: linear-gradient(135deg, var(--km-primary-soft), transparent 70%); border-radius: 18px 18px 0 0; }
.kl-crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13.5px; color: var(--km-muted); }
.kl-crumb a { color: var(--km-primary); display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 50%; background: var(--km-surface); box-shadow: var(--km-shadow-sm); }
.kl-crumb a:hover { text-decoration: none; background: var(--km-primary); color: #fff; }
.kl-crumb span { font-weight: 500; }
.kl-article .ke-empty { border-top: 0; }

.kl-nav { padding-bottom: 10px; }
.kl-nav-list { list-style: none; margin: 10px 0 0; padding: 0 10px; display: flex; flex-direction: column; gap: 2px; }
.kl-nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; color: var(--km-text); transition: background .15s, color .15s; }
.kl-nav-item .fa { width: 16px; text-align: center; color: var(--km-muted); flex: none; }
.kl-nav-item b { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
a.kl-nav-item:hover, a.kl-nav-item:focus { text-decoration: none; background: var(--km-surface-2); color: var(--km-text); }
.kl-nav-item.is-on { background: var(--km-primary-soft); color: var(--km-primary); }
.kl-nav-item.is-on b { font-weight: 600; }
.kl-nav-item.is-on .fa { color: var(--km-primary); }
.kl-nav-item.is-locked { color: var(--km-muted); cursor: not-allowed; }
@media print { .kl-head { background: none; } .kl-crumb { display: none; } }
