:root {
  --primary: #f11d64;
  --primary-dark: #c9134f;
  --primary-soft: rgba(255, 255, 255, 0.22);
  --badge-blue: #476da5;
  --badge-blue-dark: #3a5c8a;
  --bg: #f4f5f7;
  --card-bg: #ffffff;
  --text: #1c293b;
  --text-muted: #66738a;
  --border: #e5e9ee;
  --radius: 8px;
  --shadow: 0 2px 4px rgba(16, 24, 40, 0.04);
  --shadow-hover: 0 6px 16px rgba(16, 24, 40, 0.1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 20px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}
.brand:hover { text-decoration: none; }

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

.brand-name {
  font-weight: 800;
  font-size: 18px;
  color: #fff;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 3px;
}

.lang-btn {
  border: none;
  background: transparent;
  padding: 6px 11px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}

.lang-btn.active {
  background: #fff;
  color: var(--primary);
}

.site-link {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.22);
  color: #fff !important;
  padding: 9px 16px;
  border-radius: 8px;
}
.site-link:hover { background: rgba(255, 255, 255, 0.32); text-decoration: none; }

/* Pink hero band (part of the sticky pink header) */
.hero-band {
  background: var(--primary);
  padding: 6px 20px 34px;
}
.hero-band-inner {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.hero-title {
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  margin: 14px 0 22px;
}

.hero-band.compact { padding: 0 20px 16px; }
.hero-band.compact .hero-title { display: none; }
.hero-band.compact .search-box input {
  background: var(--primary-soft);
  color: #fff;
  box-shadow: none;
}
.hero-band.compact .search-box input::placeholder { color: rgba(255, 255, 255, 0.85); }
.hero-band.compact .search-box::before,
.hero-band.compact .search-box::after { border-color: #fff; background: #fff; }

.search-box {
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 14px 18px 14px 44px;
  font-size: 15px;
  border-radius: 8px;
  border: none;
  background: #fff;
  box-shadow: var(--shadow);
  outline: none;
  font-family: inherit;
}

.search-box input:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.4);
}

.search-box::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  pointer-events: none;
}

.search-box::after {
  content: "";
  position: absolute;
  left: 29px;
  top: 63%;
  width: 7px;
  height: 2px;
  background: var(--text-muted);
  transform: rotate(45deg);
  pointer-events: none;
}

.search-results {
  max-width: 620px;
  margin: 10px auto 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow-hover);
  overflow: hidden;
  text-align: left;
}

.search-results a {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
}
.search-results a:last-child { border-bottom: none; }
.search-results a:hover { background: var(--bg); text-decoration: none; }
.search-results .cat-tag {
  display: inline-block;
  font-size: 11px;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.app {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 20px 80px;
  min-height: 60vh;
}

section h2 {
  font-size: 19px;
  font-weight: 800;
  margin: 0 0 16px;
  color: var(--text);
}

.section-block { margin-bottom: 44px; }

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.article-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.article-card:hover {
  box-shadow: var(--shadow-hover);
  text-decoration: none;
}
.article-card .a-main { flex: 1; min-width: 0; }
.article-card .a-title {
  font-weight: 700;
  font-size: 14.5px;
  margin-bottom: 4px;
}
.article-card .a-desc {
  font-size: 13px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card .a-chevron {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 18px;
  font-weight: 700;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.category-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 14px;
  align-items: flex-start;
  color: var(--text);
}
.category-card:hover {
  box-shadow: var(--shadow-hover);
  text-decoration: none;
}
.cat-icon {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  color: var(--primary);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cat-icon svg { width: 22px; height: 22px; }
.category-card .c-title {
  display: inline-block;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  background: var(--badge-blue);
  padding: 7px 14px;
  border-radius: 6px;
  margin-bottom: 8px;
}
.category-card .c-desc {
  font-size: 13px;
  color: var(--text-muted);
}
.category-card .c-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Category page */
.page-header {
  margin-bottom: 30px;
}
.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.breadcrumb a { color: var(--primary); font-weight: 600; }
.page-header h1 {
  font-size: 25px;
  margin: 0 0 6px;
  color: var(--text);
}
.page-header p {
  color: var(--text-muted);
  margin: 0;
}

/* Article page */
.article-view {
  background: #fff;
  border-radius: var(--radius);
  padding: 34px 38px;
  box-shadow: var(--shadow);
}
.article-view h1 {
  font-size: 24px;
  margin: 0 0 6px;
  color: var(--text);
  font-weight: 800;
}
.article-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.article-body {
  font-size: 15px;
}
.article-body p { margin: 0 0 14px; }
.article-body ul { margin: 0 0 14px; padding-left: 22px; }
.article-body li { margin-bottom: 4px; }
.article-body img { max-width: 100%; border-radius: 8px; margin: 12px 0; }
.article-body table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 14px; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 8px 10px; text-align: center; }
.article-body th { background: var(--bg); }
.article-body .yt-embed { position: relative; padding-bottom: 56.25%; height: 0; margin: 16px 0; border-radius: 8px; overflow: hidden; }
.article-body .yt-embed iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

.not-found-block {
  margin-top: 50px;
  text-align: center;
  padding: 30px;
  border-top: 1px solid var(--border);
}
.not-found-block h3 { margin-bottom: 12px; font-size: 16px; }
.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
}

.footer {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
}

@media (max-width: 560px) {
  .article-view { padding: 24px 20px; }
  .topbar-inner { flex-wrap: wrap; gap: 10px; }
  .site-link { display: none; }
}
