/* =====================================================================
   listing.css — archive / listing template
   ===================================================================== */

/* ---------- Page header ---------- */
.lst-head{padding:56px 0 36px;position:relative;overflow:hidden;border-bottom:1px solid var(--line)}
.lst-head::before{content:"";position:absolute;inset:0;background:radial-gradient(ellipse at 85% 0%,rgba(22,139,255,.16),transparent 55%);pointer-events:none}
.lst-head .wrap{position:relative}
.lst-head .crumbs{margin-bottom:24px}
.lst-heading{font-family:var(--display);font-weight:700;font-size:clamp(44px,6vw,84px);line-height:.95;margin:12px 0 16px}
.lst-intro{max-width:52ch;margin:0;font-size:clamp(18px,1.6vw,21px);line-height:1.55;color:var(--text-2)}

/* ---------- Toolbar ---------- */
.lst{padding:28px 0 var(--section)}
.lst-toolbar{display:flex;justify-content:space-between;align-items:center;gap:16px 24px;flex-wrap:wrap;padding-bottom:22px;margin-bottom:8px;border-bottom:1px solid var(--line)}
.lst-filters{border:0;margin:0;padding:0;min-width:0}
.lst-tools{display:flex;align-items:center;gap:18px;margin-left:auto}
.lst-count{margin:0;font-family:var(--display);font-size:15px;color:var(--muted);white-space:nowrap}

/* View toggle (segmented control) */
.view-toggle{display:inline-flex;border:1px solid var(--line);border-radius:var(--radius);padding:3px;margin:0;background:var(--chip-bg);gap:2px}
.view-toggle label{position:relative}
.view-toggle input{position:absolute;opacity:0;pointer-events:none}
.view-toggle span{display:inline-flex;align-items:center;gap:8px;padding:7px 14px;border-radius:4px;font-family:var(--display);font-weight:500;font-size:15px;color:var(--muted);cursor:pointer;transition:background var(--dur),color var(--dur)}
.view-toggle span:hover{color:var(--text)}
.view-toggle input:checked+span{background:var(--blue);color:#fff}
.view-toggle input:focus-visible+span{outline:2px solid var(--cyan);outline-offset:2px}

/* ---------- Topic filters (CSS only) ---------- */
.lst:has(input[name="lst-cat"][value="air"]:checked) .lst-item:not([data-cat="air"]),
.lst:has(input[name="lst-cat"][value="naval"]:checked) .lst-item:not([data-cat="naval"]),
.lst:has(input[name="lst-cat"][value="space"]:checked) .lst-item:not([data-cat="space"]),
.lst:has(input[name="lst-cat"][value="strike"]:checked) .lst-item:not([data-cat="strike"]),
.lst:has(input[name="lst-cat"][value="industry"]:checked) .lst-item:not([data-cat="industry"]){display:none}

/* ---------- Item (shared by both views) ---------- */
.lst-items{list-style:none;margin:0;padding:0;display:grid}
.lst-card{position:relative;height:100%}
.lst-thumb{position:relative;border-radius:var(--radius);border:1px solid var(--line);overflow:hidden}
.lst-thumb::after{opacity:.55}
.lst-thumb .scene{position:absolute;inset:0;width:100%;height:100%;transition:transform .5s var(--ease)}
.lst-card:hover .lst-thumb .scene{transform:scale(1.04)}
.lst-kind{position:absolute;left:12px;top:12px;z-index:1;font-family:var(--display);font-weight:600;font-size:13px;letter-spacing:.04em;padding:1px 9px;border-radius:3px;color:#F5F8FC;background:rgba(6,17,31,.72);border:1px solid rgba(155,175,197,.35)}
.lst-body{display:flex;flex-direction:column;gap:6px;min-width:0}
.lst-title{font-family:var(--display);font-weight:600;line-height:1.15;margin:0;color:var(--text)}
.lst-title a::after{content:"";position:absolute;inset:0;z-index:2}
.lst-card:hover .lst-title{color:var(--text-strong)}
.lst-card:hover .lst-title a{text-decoration:underline;text-decoration-color:var(--accent-border);text-underline-offset:4px}
.lst-title a:focus-visible{outline:none}
.lst-card:has(.lst-title a:focus-visible){outline:2px solid var(--cyan);outline-offset:4px;border-radius:var(--radius)}
.lst-sum{margin:0;color:var(--text-2);line-height:1.55}
.lst-body .meta{margin-top:4px}
.lst-body .meta .via{color:var(--cyan)}

/* ---------- List view ---------- */
.lst:has(#viewList:checked) .lst-item{border-bottom:1px solid var(--line);animation:lst-in-list .45s var(--ease) both}
.lst:has(#viewList:checked) .lst-card{display:grid;grid-template-columns:minmax(0,300px) minmax(0,1fr);gap:28px;align-items:center;padding:24px 0}
.lst:has(#viewList:checked) .lst-thumb{aspect-ratio:16/10}
.lst:has(#viewList:checked) .lst-title{font-size:clamp(22px,2vw,27px)}
.lst:has(#viewList:checked) .lst-sum{font-size:16.5px;max-width:68ch}

/* ---------- Card view ---------- */
.lst:has(#viewCard:checked) .lst-items{grid-template-columns:repeat(auto-fill,minmax(min(100%,300px),1fr));gap:22px;padding-top:20px}
.lst:has(#viewCard:checked) .lst-item{animation:lst-in-card .45s var(--ease) both}
.lst:has(#viewCard:checked) .lst-card{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:var(--radius);background:var(--bg2);overflow:hidden;transition:border-color var(--dur),transform var(--dur) var(--ease),box-shadow var(--dur)}
.lst:has(#viewCard:checked) .lst-card:hover{border-color:var(--line-strong);transform:translateY(-3px);box-shadow:0 14px 30px var(--shadow)}
.lst:has(#viewCard:checked) .lst-thumb{aspect-ratio:16/9;border:0;border-bottom:1px solid var(--line);border-radius:0}
.lst:has(#viewCard:checked) .lst-body{padding:18px 20px 20px;flex:1}
.lst:has(#viewCard:checked) .lst-title{font-size:21px}
.lst:has(#viewCard:checked) .lst-sum{font-size:15.5px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.lst:has(#viewCard:checked) .lst-body .meta{margin-top:auto;padding-top:10px}

/* ---------- View switch animation ---------- */
@keyframes lst-in-list{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes lst-in-card{from{opacity:0;transform:translateY(10px) scale(.98)}to{opacity:1;transform:none}}
.lst-item:nth-child(2){animation-delay:.03s}.lst-item:nth-child(3){animation-delay:.06s}.lst-item:nth-child(4){animation-delay:.09s}.lst-item:nth-child(5){animation-delay:.12s}
.lst-item:nth-child(6){animation-delay:.15s}.lst-item:nth-child(7){animation-delay:.18s}.lst-item:nth-child(8){animation-delay:.21s}.lst-item:nth-child(n+9){animation-delay:.24s}

/* ---------- Responsive ---------- */
@media (max-width:900px){
  .lst:has(#viewList:checked) .lst-card{grid-template-columns:minmax(0,220px) minmax(0,1fr);gap:20px}
}
@media (max-width:720px){
  .lst-toolbar{flex-direction:column;flex-wrap:nowrap;align-items:stretch}
  .lst-filters{flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px;scrollbar-width:none}
  .lst-filters::-webkit-scrollbar{display:none}
  .lst-filters .chip span{white-space:nowrap}
  .lst-tools{margin-left:0;justify-content:space-between}
}
@media (max-width:600px){
  .lst-head{padding:36px 0 28px}
  .lst:has(#viewList:checked) .lst-card{grid-template-columns:112px minmax(0,1fr);gap:14px;align-items:start;padding:18px 0}
  .lst:has(#viewList:checked) .lst-thumb{aspect-ratio:1}
  .lst:has(#viewList:checked) .lst-kind{display:none}
  .lst:has(#viewList:checked) .lst-title{font-size:18px}
  .lst:has(#viewList:checked) .lst-sum{display:none}
  .view-toggle span{padding:7px 11px}
}
@media (max-width:380px){
  .view-toggle span{font-size:0;gap:0}
  .view-toggle span svg{width:18px;height:18px}
}

.lst-head-top{
  margin-top: 80px;
}