/* ================================================================
   category.css — Category Listing Page
   Editorial magazine style — clean, structured, professional
   ================================================================ */

body { background: var(--bg2); }
.cat-page { padding-bottom: 60px; }

/* ── BREADCRUMB ─────────────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: 7px;
  padding: 14px 0 0; font-size: .72rem;
  color: var(--muted); font-family: var(--font-en);
}
.breadcrumb a { color: var(--muted); transition: color .18s; }
.breadcrumb a:hover { color: var(--cat-color, var(--primary)); }
.breadcrumb .sep { color: var(--border2); }

/* ── CATEGORY HERO ──────────────────────────────────────────── */
.cat-hero {
  position: relative;
  margin: 16px 0 32px;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--cat-color, var(--primary));
  padding: 36px 40px;
  display: flex; align-items: center; gap: 24px;
  min-height: 140px;
}
/* Decorative shapes — kept inside overflow:hidden */
.cat-hero::before {
  content: '';
  position: absolute; top: -50px; right: -50px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,.08);
  pointer-events: none;
}
.cat-hero::after {
  content: '';
  position: absolute; bottom: -50px; right: 80px;
  width: 140px; height: 140px; border-radius: 50%;
  background: rgba(0,0,0,.06);
  pointer-events: none;
}
.cat-hero-icon {
  flex-shrink: 0; width: 64px; height: 64px; border-radius: 16px;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; color: rgba(255,255,255,.9);
  backdrop-filter: blur(4px); position: relative; z-index: 1;
}
.cat-hero-info { flex: 1; min-width: 0; position: relative; z-index: 1; }
.cat-hero-info h1 {
  font-family: var(--font-hi); font-size: 2rem; font-weight: 900;
  color: #fff; line-height: 1.2; margin-bottom: 6px;
}
.cat-hero-info p {
  font-size: .82rem; color: rgba(255,255,255,.7);
  font-family: var(--font-hi); line-height: 1.5;
}
.art-count {
  flex-shrink: 0; text-align: center;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--r-lg); padding: 14px 22px;
  backdrop-filter: blur(4px); position: relative; z-index: 1;
}
.art-count .num {
  font-family: var(--font-display); font-size: 2.4rem; color: #fff;
  font-style: italic; line-height: 1;
}
.art-count .lbl {
  font-size: .62rem; color: rgba(255,255,255,.6);
  text-transform: uppercase; letter-spacing: 1.5px; margin-top: 2px;
}
@media(max-width: 600px) {
  .cat-hero { padding: 24px 20px; gap: 16px; min-height: 110px; }
  .cat-hero-icon { width: 48px; height: 48px; font-size: 1.2rem; }
  .cat-hero-info h1 { font-size: 1.4rem; }
  .art-count { padding: 10px 16px; }
  .art-count .num { font-size: 1.8rem; }
}

/* ── LAYOUT GRID ────────────────────────────────────────────── */
.cat-page-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  align-items: start;
}
@media(max-width: 1023px) { .cat-page-grid { grid-template-columns: 1fr; } }

/* ── SORT/FILTER BAR ────────────────────────────────────────── */
.filter-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 14px;
  border-bottom: 2px solid var(--border);
  gap: 12px; flex-wrap: wrap;
}
.filter-bar-title {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.filter-bar-title span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--cat-color, var(--primary)); color: #fff;
  font-size: .62rem; font-weight: 800;
}

/* ── ARTICLES GRID ──────────────────────────────────────────── */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media(max-width: 860px) { .articles-grid { grid-template-columns: repeat(2, 1fr); } }
@media(max-width: 500px) { .articles-grid { grid-template-columns: 1fr; } }

/* ── NEWS CARD ──────────────────────────────────────────────── */
.news-card {
  background: var(--bg);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--sh-xs);
  display: flex; flex-direction: column;
  transition: transform .22s, box-shadow .22s;
}
.news-card:hover { transform: translateY(-4px); box-shadow: var(--sh-md); }

/* First card: featured / wider */
.articles-grid .news-card:first-child {
  grid-column: span 2;
  flex-direction: row;
}
@media(max-width: 860px) { .articles-grid .news-card:first-child { grid-column: span 2; flex-direction: column; } }
@media(max-width: 500px)  { .articles-grid .news-card:first-child { grid-column: span 1; } }

.news-card .thumb {
  position: relative;
  padding-top: 58%;
  overflow: hidden;
  flex-shrink: 0;
}
/* Featured card thumb */
.articles-grid .news-card:first-child .thumb {
  padding-top: 0;
  width: 42%;
  min-height: 220px;
}
@media(max-width: 860px) {
  .articles-grid .news-card:first-child .thumb { width: 100%; padding-top: 52%; min-height: 0; }
}

.news-card .thumb img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transition: transform .4s;
}
.news-card:hover .thumb img { transform: scale(1.05); }

.no-img {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--bg2), var(--bg3));
  display: flex; align-items: center; justify-content: center;
  color: var(--border2); font-size: 2rem;
}

/* Category badge on thumb */
.cat-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  padding: 3px 9px; border-radius: 4px;
  font-size: .58rem; font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase; color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

/* Breaking badge */
.breaking-dot {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 8px; height: 8px; border-radius: 50%; background: #ff2222;
  box-shadow: 0 0 0 3px rgba(255,34,34,.3);
  animation: bkpulse 1.2s infinite;
}
@keyframes bkpulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.6;transform:scale(1.3)} }

.card-body {
  padding: 14px 16px 16px;
  flex: 1; display: flex; flex-direction: column; gap: 8px;
}
.card-body h3 {
  font-family: var(--font-hi); font-size: .9rem; line-height: 1.55;
  color: var(--ink); font-weight: 700; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
/* Featured card has bigger title */
.articles-grid .news-card:first-child .card-body h3 {
  font-size: 1.05rem; -webkit-line-clamp: 4;
}
.card-body h3 a { color: inherit; }
.card-body h3 a:hover { color: var(--cat-color, var(--primary)); }

.card-excerpt {
  font-size: .76rem; color: var(--muted); font-family: var(--font-hi);
  line-height: 1.55; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: .65rem; color: var(--muted); margin-top: auto;
  padding-top: 8px; border-top: 1px solid var(--border);
}
.card-meta i { color: var(--cat-color, var(--primary)); font-size: .6rem; }
.card-author {
  display: flex; align-items: center; gap: 5px;
  font-size: .65rem; color: var(--muted); margin-left: auto;
}
.card-author i { font-size: .58rem; }

/* ── EMPTY STATE ────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 80px 20px;
  background: var(--bg); border-radius: var(--r-xl);
  border: 2px dashed var(--border);
}
.empty-state i { font-size: 3rem; color: var(--border2); display: block; margin-bottom: 16px; }
.empty-state p { font-family: var(--font-hi); color: var(--muted); font-size: .88rem; }

/* ── PAGINATION ─────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; margin-top: 32px; flex-wrap: wrap;
}
.pg-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 10px;
  border-radius: var(--r-sm); font-size: .8rem; font-weight: 600;
  background: var(--bg); border: 1.5px solid var(--border);
  color: var(--ink3); transition: all .18s; cursor: pointer;
  text-decoration: none;
}
.pg-btn:hover:not(.disabled):not(.active) {
  border-color: var(--cat-color, var(--primary));
  color: var(--cat-color, var(--primary));
}
.pg-btn.active {
  background: var(--cat-color, var(--primary));
  border-color: var(--cat-color, var(--primary));
  color: #fff; box-shadow: 0 3px 10px rgba(0,0,0,.15);
}
.pg-btn.disabled { opacity: .35; cursor: default; pointer-events: none; }

/* ── SIDEBAR ────────────────────────────────────────────────── */
.sidebar {
  display: flex; flex-direction: column; gap: 20px;
  min-width: 0;
}
@media(min-width: 1024px) {
  .sidebar {
    position: sticky;
    top: calc(var(--header-h, 60px) + var(--topbar-h, 32px) + 14px);
    align-self: start;
  }
}

/* ── POPULAR ITEMS ──────────────────────────────────────────── */
.pop-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.pop-item:last-child { border-bottom: none; }
.pop-item:hover { background: var(--bg2); }
.pop-num {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg3); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 800; margin-top: 1px;
  transition: background .18s, color .18s;
}
.pop-item:first-child .pop-num {
  background: var(--cat-color, var(--primary)); color: #fff;
}
.pop-item:hover .pop-num { background: var(--cat-color, var(--primary)); color: #fff; }
.pop-item h4 {
  font-family: var(--font-hi); font-size: .8rem; line-height: 1.45;
  color: var(--ink); margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pop-item h4 a:hover { color: var(--cat-color, var(--primary)); }
.pop-views { font-size: .63rem; color: var(--muted); }
.pop-views i { color: var(--cat-color, var(--primary)); font-size: .58rem; margin-right: 3px; }

/* ── OTHER CATEGORIES ───────────────────────────────────────── */
.other-cats { display: flex; flex-direction: column; }
.oc-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  color: var(--ink); font-size: .82rem; font-family: var(--font-hi);
  font-weight: 600; transition: background .15s, padding-left .18s;
}
.oc-btn:last-child { border-bottom: none; }
.oc-btn:hover { background: var(--bg2); padding-left: 18px; }
.oc-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* ── Newsletter Widget ───────────────────────────────────────── */
.sw-nl { background: linear-gradient(135deg, var(--bg) 60%, var(--primary-dim)) !important; }
.sw-nl-inner { padding: 20px 16px; text-align: center; }
.sw-nl-icon { font-size: 1.8rem; color: var(--primary); margin-bottom: 10px; }
.sw-nl-inner h4 { font-size: .88rem; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.sw-nl-inner p  { font-size: .75rem; color: var(--muted); margin-bottom: 14px; font-family: var(--font-hi); line-height: 1.6; }
.sw-nl-form { display: flex; flex-direction: column; gap: 8px; }
.sw-nl-form input {
  width: 100%; padding: 9px 14px; border: 1px solid var(--border);
  border-radius: var(--r-sm); font-size: .82rem; outline: none;
  background: var(--bg2); color: var(--ink); box-sizing: border-box;
  transition: border-color .2s, box-shadow .2s; font-family: var(--font-en);
}
.sw-nl-form input:focus {
  border-color: var(--primary); background: var(--bg); box-shadow: 0 0 0 3px var(--primary-dim);
}
.sw-nl-form button {
  width: 100%; padding: 10px; background: var(--primary); color: #fff;
  border-radius: var(--r-sm); font-weight: 700; font-size: .82rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .18s, transform .1s;
}
.sw-nl-form button:hover { background: var(--accent); transform: translateY(-1px); }