/* atropi-scope: .ac-, .atropi-ctx- */
/* =====================================================================================================
   ATROPI — newsroom (posts page, single post, category / tag / author / date archives, search).
   Loaded on blog views after _components.css (post cards, covers, prose, TOC and search form live there).
   ===================================================================================================== */

/* ---------------------------------------------------------------- live wire (newsroom hero visual) */
.ac-wire { position: relative; width: min(100%, 440px); margin-inline: auto; border-radius: 22px; background: var(--surface-glass); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-hi), var(--shadow-xl); overflow: hidden; }
.ac-wire::before { content: ""; position: absolute; inset: -40% -30% auto auto; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, var(--field-a), transparent); pointer-events: none; }
.ac-wire-head { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.ac-wire-live { display: inline-flex; align-items: center; gap: 7px; height: 22px; padding: 0 8px; border-radius: var(--r-xs); background: var(--bear-bg); color: var(--bear); font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .12em; }
.ac-wire-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--bear-vivid); animation: ac-blink 1.6s steps(2, start) infinite; }
@keyframes ac-blink { to { visibility: hidden; } }
.ac-wire-src { font-size: 10.5px; letter-spacing: .14em; color: var(--muted); }
.ac-wire-dots { margin-inline-start: auto; display: inline-flex; gap: 5px; }
.ac-wire-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.ac-wire-list { list-style: none; padding: 6px 0; margin: 0; position: relative; }
.ac-wire-item { display: grid; grid-template-columns: 52px minmax(0, 1fr) 18px; gap: 12px; align-items: start; padding: 12px 18px; color: var(--ink); transition: background-color .25s; }
.ac-wire-item:hover { background: var(--brand-50); }
.ac-wire-time { font-size: 11px; letter-spacing: .04em; color: var(--brand-ink); padding-top: 2px; white-space: nowrap; }
.ac-wire-body { display: grid; gap: 4px; min-width: 0; }
.ac-wire-t { font-size: 14px; font-weight: 600; line-height: 1.35; letter-spacing: -0.005em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ac-wire-cat { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.ac-wire-go { width: 16px; height: 16px; color: var(--faint); margin-top: 2px; transition: color .25s, transform .4s var(--ease-out); }
.ac-wire-item:hover .ac-wire-go { color: var(--brand); transform: translate(2px, -2px); }
.ac-wire-list li + li .ac-wire-item { border-top: 1px dashed var(--line); }
html.js .ac-wire-list li { opacity: 0; transform: translateY(8px); transition: opacity .6s var(--ease-out), transform .7s var(--ease-out); transition-delay: calc(.5s + var(--i, 0) * .14s); }
html.js .ac-hero-visual.is-in .ac-wire-list li { opacity: 1; transform: none; }
.ac-wire-foot { display: flex; align-items: center; gap: 12px; padding: 12px 18px 14px; border-top: 1px solid var(--line); }
.ac-wire-cursor { font-size: 11px; color: var(--brand); animation: ac-blink 1.1s steps(2, start) infinite; }
.ac-wire-bar { position: relative; flex: 1; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.ac-wire-bar i { position: absolute; inset: 0; width: 34%; background: var(--grad-brand); animation: ac-wire-scan 3.2s var(--ease-io) infinite; }
@keyframes ac-wire-scan { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.ac-paused .ac-wire-live i, .ac-paused .ac-wire-cursor, .ac-paused .ac-wire-bar i { animation-play-state: paused; }

/* hero search (also used on archives and search) */
.ac-hero-meta .ac-results { margin-top: 12px; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* ---------------------------------------------------------------- newsroom */
.ac-news { padding-top: clamp(36px, 4vw, 64px); }
.ac-news-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: clamp(24px, 3vw, 36px); }
.ac-chips { max-width: 100%; }
.ac-chips-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ac-chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; white-space: nowrap; transition: border-color .25s, color .25s, background-color .25s, box-shadow .3s; }
.ac-chip .ico { color: var(--muted); transition: color .25s; }
.ac-chip:hover { border-color: var(--brand-400); color: var(--ink); box-shadow: var(--shadow-sm); }
.ac-chip:hover .ico { color: var(--brand); }
.ac-chip-n { font-size: 10.5px; font-weight: 500; color: var(--faint); }
.ac-chip.is-current { background: var(--ink); border-color: var(--ink); color: var(--bg); box-shadow: var(--shadow-md); }
.ac-chip.is-current .ico, .ac-chip.is-current .ac-chip-n { color: inherit; opacity: .7; }
.ac-news-featured { margin-bottom: clamp(16px, 1.6vw, 22px); }
.ac-news-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(16px, 1.6vw, 22px); }
.ac-news-grid > li { grid-column: span 2; min-width: 0; }
.ac-news-grid.is-first > li:nth-child(-n+2) { grid-column: span 3; }
.ac-news-grid.is-first > li:nth-child(-n+2) .ac-cover { aspect-ratio: 16 / 8.4; }
.ac-news-grid.is-first > li:nth-child(-n+2) .ac-post-t { font-size: clamp(20px, 1.6vw, 24px); }
/* featured + latest are two rail chapters but one visual flow (home.php) */
.ac-news.ac-news--featured { padding-bottom: 0; }
.ac-news.ac-news--rest { padding-top: 0; }
/* no orphan in the last row (home.php sets the classes from the post count) */
@media (min-width: 1024px) {
  .ac-news-grid > li.is-half, .ac-news-grid.is-first > li.is-half { grid-column: span 3; }
  .ac-news-grid > li.is-half .ac-cover { aspect-ratio: 16 / 8.4; }
  .ac-news-grid > li.is-full, .ac-news-grid.is-first > li.is-full { grid-column: 1 / -1; }
  .ac-news-grid > li.is-full .ac-post { flex-direction: row; align-items: stretch; }
  .ac-news-grid > li.is-full .ac-post-media { width: 42%; flex: none; border-radius: var(--r-lg) 0 0 var(--r-lg); }
  .ac-news-grid > li.is-full .ac-cover { height: 100%; aspect-ratio: auto; min-height: 220px; }
  .ac-news-grid > li.is-full .ac-post-body { justify-content: center; padding: clamp(22px, 2.4vw, 36px); }
  .ac-news-grid > li.is-full .ac-post-t { font-size: clamp(20px, 1.6vw, 24px); }
}
@media (max-width: 1023px) {
  .ac-news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ac-news-grid > li, .ac-news-grid.is-first > li:nth-child(-n+2) { grid-column: span 1; }
  .ac-news-grid.is-first > li:first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .ac-news-grid { grid-template-columns: minmax(0, 1fr); }
  .ac-chips-list { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); padding-bottom: 4px; }
  .ac-chips-list::-webkit-scrollbar { display: none; }
}

/* pagination */
.ac-pager { margin-top: clamp(36px, 4vw, 56px); display: flex; justify-content: center; }
.ac-pager-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.ac-pager .page-numbers { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; height: 44px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid transparent; font-family: var(--font-mono); font-size: 14px; font-weight: 500; color: var(--text); transition: border-color .25s, background-color .25s, color .25s; }
.ac-pager a.page-numbers:hover { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.ac-pager .page-numbers.current { background: var(--ink); color: var(--bg); }
.ac-pager .page-numbers.dots { color: var(--faint); }
.ac-pager .prev, .ac-pager .next { font-family: var(--font-sans); font-weight: 600; border-color: var(--line-strong); padding: 0 18px; }
.ac-pager .ico { width: 18px; height: 18px; }
.ac-pg-prev, .ac-flip { transform: rotate(180deg); }

/* empty state handled in _components.css (.ac-empty) */

/* ---------------------------------------------------------------- single article */
.ac-article { padding-top: clamp(24px, 3vw, 44px); }
.ac-article-cover { margin: 0 0 clamp(32px, 4vw, 56px); border-radius: var(--r-xl); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.ac-article-cover .ac-cover { aspect-ratio: 21 / 8; border-radius: 0; }
.ac-article-cover .ac-cover-mark { width: 52px; height: 52px; inset-inline-start: 24px; top: 24px; border-radius: 15px; }
.ac-article-cover .ac-cover-mark .ico { width: 24px; height: 24px; }
.ac-article-grid.has-toc { grid-template-columns: minmax(0, 260px) minmax(0, 1fr); }
.ac-article-aside { display: grid; gap: 28px; align-content: start; }
.ac-article-prog .ac-toc-t { display: block; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.ac-share { display: grid; gap: 12px; }
.ac-share-k { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.ac-share-k .ico { color: var(--brand); }
.ac-share-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ac-share-btn { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); transition: border-color .25s, background-color .25s, color .25s, transform .4s var(--ease-out); }
.ac-share-btn svg { width: 18px; height: 18px; fill: currentColor; }
.ac-share-btn .ico { fill: none; }
.ac-share-btn:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }
.ac-share-ok { position: absolute; opacity: 0; transform: scale(.5); transition: opacity .25s, transform .4s var(--ease-spring); color: var(--bull); }
.ac-share-btn.is-copied > .ico:first-child { opacity: 0; }
.ac-share-btn.is-copied .ac-share-ok { opacity: 1; transform: none; }
.ac-share-btn.is-copied { border-color: var(--bull); background: var(--bull-bg); }
.ac-share-msg { min-height: 1em; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--bull); }
.ac-share--row { display: flex; align-items: center; gap: 12px; }
.ac-share--row .ac-share-msg { min-height: 0; }
.ac-article-tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.ac-article-tags .chip { height: 30px; padding: 0 12px; font-size: 12px; }
.ac-article-end { align-items: center; }
.ac-article-by { display: flex; align-items: center; gap: 14px; }
.ac-article-ava { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.ac-article-ava .logo { width: 34px; height: auto; }
.ac-article-by-n { display: block; font-weight: 650; color: var(--ink); line-height: 1.3; }
.ac-article-by .ac-lf-end-meta { display: block; margin-top: 3px; }
.ac-article-risk { margin-top: 28px; }
.ac-postnav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 28px; }
.ac-postnav-a { display: grid; gap: 8px; padding: 18px 20px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .3s, box-shadow .4s var(--ease-out), transform .5s var(--ease-out); }
.ac-postnav-a:hover { border-color: color-mix(in srgb, var(--brand) 36%, var(--line)); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.ac-postnav-a.is-next { text-align: end; grid-column: 2; }
.ac-postnav-k { display: inline-flex; align-items: center; gap: 8px; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ac-postnav-a.is-next .ac-postnav-k { justify-content: flex-end; }
.ac-postnav-t { font-size: 15.5px; font-weight: 650; line-height: 1.35; color: var(--ink); }
.ac-readnext .chapter-head { margin-bottom: clamp(36px, 4vw, 56px); }
@media (max-width: 1099px) {
  .ac-article-aside { display: block; }
  .ac-article-aside .ac-share { display: none; }
  .ac-article-prog { display: none; }
}
@media (max-width: 640px) {
  .ac-article-cover { border-radius: var(--r-lg); }
  .ac-article-cover .ac-cover { aspect-ratio: 16 / 9; }
  .ac-postnav { grid-template-columns: minmax(0, 1fr); }
  .ac-postnav-a.is-next { grid-column: auto; }
  .ac-article-end { flex-direction: column; align-items: flex-start; }
}

/*rtl:raw:
[dir="rtl"] .ac-share-k, [dir="rtl"] .ac-postnav-k, [dir="rtl"] .ac-wire-cat, [dir="rtl"] .ac-hero-meta .ac-results { font-family: var(--font-sans); letter-spacing: 0; text-transform: none; font-size: 12.5px; }
*/

@media (prefers-reduced-motion: reduce) {
  .ac-wire-live i, .ac-wire-cursor, .ac-wire-bar i { animation: none; }
  html.js .ac-wire-list li { opacity: 1; transform: none; transition: none; }
}

/* newsroom note: English posts fill the list in fa/ar/ru (see atropi_news_lang_args) */
.ac-news-note { margin: 0 0 18px; font-size: 13.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.ac-news-note::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); flex: none; }
