/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: #f8fafc;
  color: #1e293b;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
::selection { background: #e9d5ff; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin: 0; }
button { font: inherit; }
.hidden { display: none !important; }
.icon { width: 16px; height: 16px; flex-shrink: 0; }

.container { max-width: 1152px; margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.header-inner {
  padding-top: 16px;
  padding-bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
@media (min-width: 768px) {
  .header-inner { flex-direction: row; }
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  outline: none;
}
.brand:focus-visible { outline: 2px solid #7c3aed; outline-offset: 4px; border-radius: 8px; }
.brand:hover .logo-box { transform: scale(1.05); }
.logo-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #9333ea);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
  transition: transform 0.3s ease;
}
.logo-box span { color: #fff; font-weight: 800; font-size: 24px; letter-spacing: -0.05em; }
.brand-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #2563eb, #9333ea);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.2;
}
.brand-sub {
  display: none;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
  font-weight: 700;
  margin-top: -4px;
}
@media (min-width: 768px) {
  .brand-title { font-size: 30px; }
  .brand-sub { display: block; }
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}
@media (min-width: 768px) {
  .nav { justify-content: flex-end; width: auto; }
}
.nav-btn {
  white-space: nowrap;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(226, 232, 240, 0.6);
  background: rgba(255, 255, 255, 0.8);
  color: #475569;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}
.nav-btn:hover { background: #f1f5f9; color: #0f172a; }
.nav-btn.active {
  background: linear-gradient(to right, #2563eb, #9333ea);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
  transform: scale(1.05);
}
.nav-btn:focus-visible { outline: 2px solid #7c3aed; outline-offset: 2px; }
@media (min-width: 768px) {
  .nav-btn { font-size: 14px; }
}

/* ---------- Main grid ---------- */
.main { padding-top: 40px; padding-bottom: 40px; }
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 768px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Loaders ---------- */
.loader-wrap { display: flex; justify-content: center; padding: 80px 0; width: 100%; }
.loader-wrap.more { padding: 48px 0; }
.loader-pill {
  display: flex;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.dot { width: 12px; height: 12px; border-radius: 50%; animation: bounce 1s infinite; }
.dot-blue { background: #3b82f6; }
.dot-purple { background: #a855f7; }
@keyframes bounce {
  0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
  50% { transform: none; animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
}

/* ---------- End message ---------- */
.end { text-align: center; padding: 64px 0; width: 100%; }
.end-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid #fff;
  border-radius: 9999px;
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.icon-check { width: 20px; height: 20px; color: #10b981; }

/* ---------- Article card ---------- */
.card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.5s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1); }
@media (min-width: 768px) { .card.featured { grid-column: span 2; } }

.card-media {
  display: block;
  position: relative;
  overflow: hidden;
  height: 224px;
}
.card.featured .card-media { height: 288px; }
@media (min-width: 768px) { .card.featured .card-media { height: 384px; } }

.card-media .overlay {
  position: absolute;
  inset: 0;
  background: rgba(30, 58, 138, 0.1);
  z-index: 10;
  transition: background-color 0.5s ease;
  pointer-events: none;
}
.card-media:hover .overlay { background: transparent; }

.card-media img,
.card-media .img-wrap,
.card-media .img-wrap img,
.card-media .banner {
  width: 100%;
  height: 100%;
}
.card-media img {
  display: block;
  object-fit: cover;
  transition: transform 0.7s ease-out;
}
.card-media:hover img { transform: scale(1.05); }
.card-media .img-wrap { width: 100%; height: 100%; }

.banner {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, #1e3a8a 0%, #312e81 50%, #581c87 100%);
}
.banner .blob {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  filter: blur(24px);
}
.banner .blob-1 { right: -40px; bottom: -40px; background: rgba(168, 85, 247, 0.2); }
.banner .blob-2 { left: -40px; top: -40px; background: rgba(59, 130, 246, 0.2); }
.banner-icon {
  position: relative;
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}
.banner-icon svg { width: 24px; height: 24px; color: rgba(255, 255, 255, 0.9); }
.banner-title {
  position: relative;
  font-weight: 800;
  letter-spacing: -0.025em;
  font-size: 18px;
  background: linear-gradient(to right, #bfdbfe, #e9d5ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.banner-sub {
  position: relative;
  font-size: 12px;
  color: rgba(191, 219, 254, 0.6);
  margin-top: 4px;
  font-weight: 500;
}

.featured-badge {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
}
.featured-badge span {
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 9999px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.source-pill {
  padding: 4px 12px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 9999px;
  transition: background-color 0.2s ease;
}
.source-pill:hover { background: #dbeafe; }
.time { font-size: 12px; color: #94a3b8; font-weight: 500; }
.time-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}
.time-row svg { width: 16px; height: 16px; color: #94a3b8; }

.card-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #1e293b;
  line-height: 1.25;
  transition: color 0.3s ease;
}
.card.featured .card-title { font-size: 24px; }
@media (min-width: 768px) { .card.featured .card-title { font-size: 30px; } }
.card:hover .card-title { color: #7e22ce; }
.card-title a { color: inherit; }

.excerpt {
  color: #475569;
  font-size: 14px;
  line-height: 1.625;
  margin-bottom: 32px;
  flex-grow: 1;
}
@media (min-width: 768px) { .excerpt { font-size: 16px; } }

.card-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(241, 245, 249, 0.8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.go-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #2563eb;
  transition: color 0.3s ease;
}
.go-link:hover { color: #7e22ce; }
.go-link svg { width: 16px; height: 16px; transition: transform 0.3s ease; }
.go-link:hover svg { transform: translateX(4px); }
.cat-tag {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(241, 245, 249, 0.8);
  padding: 4px 10px;
  border-radius: 6px;
}

a:focus-visible, .card-media:focus-visible { outline: 2px solid #7c3aed; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
