/* DBOPH - news archive.
   Uses the site palette from assets/css/site.css; only adds what the archive
   needs. The one deliberate break is .ar-paper, which is light on purpose. */

/* ------------------------------------------------------------------ filters */

.ar-filters {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin: 0 0 22px;
}
.ar-filters input[type=search] {
  flex: 1 1 260px; max-width: 420px;
  padding: 11px 14px;
  background: #0c1219; color: var(--text);
  border: 1px solid var(--edge); border-radius: 6px;
  font: 15px "Segoe UI", sans-serif;
}
.ar-filters input[type=search]:focus { outline: 0; border-color: var(--gold); background: #0f1620; }
.ar-filters .btn { padding: 11px 22px; }

.ar-facets { display: flex; flex-direction: column; gap: 10px; margin: 0 0 22px; }
.ar-facet { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ar-facet-label {
  width: 62px; flex: none;
  font-size: 11.5px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--faint);
}

.ar-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--edge); background: rgba(13,20,30,.7);
  color: var(--dim); font-size: 13.5px; font-weight: 600;
}
.ar-chip:hover { color: var(--text); border-color: var(--gold); text-decoration: none; }
.ar-chip.on { color: #1a1202; background: var(--gold); border-color: var(--gold); }
.ar-chip .n { font-size: 11.5px; font-weight: 700; opacity: .62; }

.ar-count { margin: 0 0 18px; color: var(--faint); font-size: 13.5px; }

/* --------------------------------------------------------------------- grid */

.ar-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(3, 1fr);
}

.ar-item {
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--edge); border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
  transition: border-color .15s ease, transform .08s ease;
}
.ar-item:hover { border-color: var(--gold); text-decoration: none; transform: translateY(-2px); }

.ar-thumb {
  height: 132px; background: #0a1018;
  border-bottom: 1px solid var(--edge);
  overflow: hidden;
}
.ar-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ar-thumb.none {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #0d1421, #0a0f18);
  color: var(--faint); font-size: 12px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
}

.ar-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.ar-item h3 {
  margin: 0 0 6px; font-size: 15.5px; line-height: 1.42; color: var(--text);
  font-weight: 600;
}
.ar-ex { margin: 0; color: var(--faint); font-size: 13px; line-height: 1.5; }

/* --------------------------------------------------------------------- meta */

.ar-meta {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin: 0 0 8px; font-size: 11.5px;
}
.ar-region, .ar-kind {
  padding: 2px 8px; border-radius: 999px;
  font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
}
.ar-region        { background: rgba(151,162,176,.16); color: var(--dim); }
.ar-region.r-kr   { background: rgba(224,82,79,.16);   color: #ff9a98; }
.ar-region.r-tw   { background: rgba(5,41,154,.34);    color: #9dbaff; }
.ar-region.r-hk   { background: rgba(62,207,76,.14);   color: #8fe098; }
.ar-region.r-jp   { background: rgba(241,165,0,.16);   color: var(--gold-bright); }
.ar-kind          { background: rgba(241,165,0,.14);   color: var(--gold-bright); }
.ar-date          { color: var(--faint); letter-spacing: .04em; }

/* -------------------------------------------------------------------- pager */

.ar-pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin: 34px 0 0; flex-wrap: wrap;
}
.ar-pager-mid { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }
.ar-page {
  min-width: 34px; padding: 6px 9px; text-align: center;
  border: 1px solid var(--edge); border-radius: 6px;
  color: var(--dim); font-size: 13.5px; font-weight: 600;
}
.ar-page:hover { color: var(--text); border-color: var(--gold); text-decoration: none; }
.ar-page.on { background: var(--gold); border-color: var(--gold); color: #1a1202; }
.ar-pager-mid .gap { color: var(--faint); padding: 0 2px; }

/* --------------------------------------------------------------- post header */

.ar-post-head { margin: 0 0 22px; }
.ar-post-head h1 { margin: 0 0 8px; font-size: 27px; line-height: 1.28; }
.ar-src { margin: 0; color: var(--faint); font-size: 13px; }
.ar-src code {
  background: rgba(13,20,30,.9); border: 1px solid var(--edge);
  border-radius: 4px; padding: 1px 6px; font-size: 12px; color: var(--dim);
  word-break: break-all;
}

/* --------------------------------------------------------------------- paper
   The archived article itself. Light on purpose: these posts hard-code text
   colours for a white page, and on the site's dark background a good number of
   them would render as near-invisible navy on near-black. */

.ar-paper {
  display: block;
  background: #fff; color: #1a1a1a;
  border: 1px solid var(--edge); border-radius: var(--radius);
  padding: 30px 34px;
  overflow-x: auto;
  font: 15px/1.68 "Malgun Gothic", "Microsoft JhengHei", "Segoe UI", system-ui, sans-serif;
}
.ar-paper img { max-width: 100%; height: auto; display: inline-block; }
.ar-paper table { max-width: 100%; border-collapse: collapse; }
.ar-paper td, .ar-paper th { padding: 2px 4px; vertical-align: top; }
.ar-paper a { color: #0b57a4; }
.ar-paper p { margin: 0 0 10px; }
.ar-paper hr { border: 0; border-top: 1px solid #ddd; margin: 18px 0; }
/* The originals are full of empty spacer rows; stop them opening big gaps. */
.ar-paper br + br + br { display: none; }

/* ------------------------------------------------------------ prev/next nav */

.ar-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin: 30px 0 0;
}
.ar-nav-link {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px;
  background: var(--panel); border: 1px solid var(--edge); border-radius: var(--radius);
  color: var(--dim);
}
.ar-nav-link:hover { border-color: var(--gold); text-decoration: none; }
.ar-nav-link span { font-size: 11.5px; font-weight: 700; letter-spacing: .1em;
                    text-transform: uppercase; color: var(--gold); }
.ar-nav-link strong { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.4; }
.ar-nav-link.right { text-align: right; align-items: flex-end; }

/* -------------------------------------------------------------------- small */

@media (max-width: 900px) {
  .ar-grid { grid-template-columns: repeat(2, 1fr); }
  .ar-facet-label { width: 100%; }
}
@media (max-width: 560px) {
  .ar-grid { grid-template-columns: 1fr; }
  .ar-nav  { grid-template-columns: 1fr; }
  .ar-nav-link.right { text-align: left; align-items: flex-start; }
  .ar-paper { padding: 20px 18px; }
}
