/* ========== CSS VARIABLES ========== */
:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --ink: #1c1e21;
  --muted: #6b7280;
  --brand: #1055c9;
  --brand-2: #0a3d8f;
  --ring: #e3e9ff;
}

/* ========== RESET & BASE ========== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ========== LAYOUT ========== */
.container {
  max-width: 1120px;
  margin: auto;
  padding: 16px;
}

/* ========== HEADER ========== */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  border-bottom: 1px solid #eee;
}

.topbar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
}

.brand .logo {
  width: 40px;
  height: 40px;
  display: block;
  object-fit: contain;
}

.tagline {
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
  margin-left: 56px;
  margin-top: -4px;
}

/* ========== NAVIGATION ========== */
nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 14px;
}

.pill[aria-current="page"] {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* ========== SEARCH ========== */
.search {
  position: relative;
  max-width: 360px;
  flex: 1;
}

.search input {
  width: 100%;
  padding: 10px 36px 10px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  outline: none;
}

.search button {
  position: absolute;
  right: 4px;
  top: 4px;
  bottom: 4px;
  border: none;
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  padding: 0 10px;
  cursor: pointer;
}

/* ========== HERO SECTION ========== */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  margin: 16px 0;
}

/* ========== CARD ========== */
.card {
  background: var(--card);
  border: 1px solid #eee;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.card.pad {
  padding: 18px;
}

.card.rel {
  position: relative;
}

/* ========== GRID & LAYOUT ========== */
.grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

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

.articles > * {
  min-width: 0;
  width: 100%;
}

/* ========== ARTICLE CARD ========== */
.article {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
  display: flex;
  background: #e9efff;
  border-radius: 12px;
  width: 100%;
  height: auto;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 24px;
  color: #0a2a78;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.title {
  font-weight: 750;
  margin: 10px 0 6px;
  font-size: 18px;
  line-height: 1.25;
}

.meta {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ========== BADGES & TAGS ========== */
.badge {
  font-size: 11px;
  background: #e3ebff;
  border: 1px solid #cad8ff;
  color: #103f91;
  padding: 4px 8px;
  border-radius: 999px;
}

.tag {
  font-size: 12px;
  background: #f3f4f6;
  border-radius: 999px;
  padding: 2px 8px;
  margin-right: 0;
  white-space: nowrap;
  display: inline-block;
}

.new {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--brand);
  color: #fff;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
}

.label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--brand);
}

/* ========== SIDEBAR ========== */
.sidebar .section {
  margin-bottom: 16px;
}

.section h3 {
  margin: 0 0 10px;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Popular Ranking */
.rank li {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 10px 0;
}

.rank .idx {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
}

/* Category List */
.catlist li {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.catlist li:hover {
  background: #f0f6ff;
}

/* ========== FOOTER ========== */
.footer {
  margin-top: 24px;
  padding: 20px;
  background: #fff;
  border-top: 1px solid #eee;
  color: #6b7280;
  font-size: 14px;
  border-radius: 14px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 960px) {
  .brand-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .tagline {
    margin-left: 0;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .articles {
    grid-template-columns: 1fr;
  }

  nav {
    display: none;
  }
}
