:root {
  color-scheme: light;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  background-color: #f9fafb;
  color: #111827;
}

* {
  box-sizing: border-box;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

body {
  margin: 0;
  background-color: #ffffff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 16px;
  background: #2563eb;
  color: #fff;
  padding: 8px 12px;
  z-index: 1000;
  border-radius: 4px;
}

.skip-link:focus {
  top: 16px;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 999;
  transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.site-header.scrolled {
  background: #ffffff;
  border-color: rgba(229, 231, 235, 0.75);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  gap: 16px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  color: inherit;
}

.site-logo img {
  display: block;
}

.site-nav ul {
  display: flex;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-weight: 500;
  color: #374151;
  border-radius: 999px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.site-nav a::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  height: 3px;
  background: linear-gradient(120deg, #2563eb, #7c3aed);
  border-radius: 999px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: #111827;
  background-color: rgba(37, 99, 235, 0.08);
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  transform: scaleX(1);
}

.site-main {
  padding: 24px 0 64px;
}

.hero,
.category-hero {
  background: linear-gradient(120deg, #eff6ff, #eef2ff);
  padding: 48px 0;
  text-align: left;
}

.hero h1,
.category-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.75rem);
  color: #111827;
}

.hero p,
.category-hero p {
  max-width: 640px;
  color: #4b5563;
}

.hero-home .hero-body {
  display: grid;
  gap: 20px;
  max-width: 760px;
}

.hero-search {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 999px;
  padding: 8px 8px 8px 18px;
  backdrop-filter: blur(6px);
}

.hero-search input {
  flex: 1 1 220px;
  border: none;
  background: transparent;
  font-size: 1rem;
  padding: 10px 4px;
  min-width: 0;
}

.hero-search input:focus-visible {
  outline: none;
}

.hero-search button {
  border: none;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #ffffff;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-search button:hover,
.hero-search button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(37, 99, 235, 0.25);
}

.category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: #1f2937;
  font-size: 0.9rem;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.chip:hover,
.chip:focus-visible {
  background: rgba(37, 99, 235, 0.18);
  color: #111827;
}

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

.trending {
  padding: 48px 0 24px;
}

.trending-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.trending-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.trending-header p {
  margin: 0;
  color: #4b5563;
  font-size: 0.95rem;
}

.trending-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.trending-card {
  display: flex;
  gap: 16px;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  color: inherit;
  text-decoration: none;
}

.trending-card:hover,
.trending-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.16);
}

.trending-card:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.4);
  outline-offset: 2px;
}

.trending-rank {
  font-weight: 700;
  font-size: 1.25rem;
  color: #2563eb;
  min-width: 2rem;
}

.trending-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trending-copy h3 {
  margin: 0;
  color: #111827;
  font-size: 1.05rem;
}

.trending-copy p {
  margin: 0;
  color: #4b5563;
}

.trending-meta {
  font-size: 0.85rem;
  color: #6b7280;
}

.card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.05);
}

.card.card--link {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card.card--link:hover,
.card.card--link:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 20px 32px rgba(15, 23, 42, 0.15);
}

.card__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
}

.card__inner:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.45);
  outline-offset: -3px;
}

.card__media {
  display: block;
  position: relative;
  overflow: hidden;
  background: #e5e7eb;
}

.card__media img {
  display: block;
  width: 100%;
  height: auto;
}

.card__content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 24px 24px;
  flex: 1;
}

.card__content h2 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.45;
  color: #111827;
}

.card__content p {
  margin: 0;
  color: #4b5563;
}

.card-meta {
  font-size: 0.85rem;
  color: #6b7280;
}

.post {
  background: #ffffff;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 12px 24px rgb(15 23 42 / 0.08);
}

.post-header {
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 24px;
  padding-bottom: 24px;
}

.post-header h1 {
  margin: 12px 0 0;
  font-size: clamp(2rem, 5vw, 2.75rem);
}

.post-cover {
  display: block;
  max-width: 800px;
  margin: 0 auto 24px;
  border-radius: 16px;
  overflow: hidden;
  background: #e5e7eb;
}

.post-cover img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
}

.post-meta {
  margin: 0;
  font-size: 0.9rem;
  color: #6b7280;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.post-content h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.post-share ul {
  list-style: none;
  display: flex;
  gap: 12px;
  padding: 0;
}

.post-share a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid #d1d5db;
  color: #1f2937;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
}

.post-nav a {
  flex: 1;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: inherit;
  display: block;
}

.related-posts {
  margin-top: 48px;
}

.related-posts h2 {
  margin-bottom: 16px;
}

.pagination {
  margin-top: 32px;
  display: flex;
  justify-content: center;
}

.search-page {
  padding-bottom: 64px;
}

.search-header {
  padding: 32px 0 16px;
  display: grid;
  gap: 16px;
  max-width: 760px;
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.search-form input[type="search"] {
  flex: 1 1 260px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  font-size: 1rem;
  min-width: 0;
}

.search-form input[type="search"]:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.6);
  outline-offset: 2px;
}

.search-form button {
  border: none;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-form button:hover,
.search-form button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px rgba(37, 99, 235, 0.25);
}

.search-hint {
  margin: 0;
  font-size: 0.85rem;
  color: #6b7280;
}

.search-results-wrapper {
  margin-top: 24px;
}

.search-status {
  margin: 0;
  color: #6b7280;
  font-size: 0.95rem;
}

.search-results-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 24px;
}

.search-result-card {
  display: block;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.07);
  color: inherit;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.search-result-card:hover,
.search-result-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 18px 28px rgba(15, 23, 42, 0.18);
}

.search-result-card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  color: #111827;
}

.search-result-card .search-result-meta {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 8px;
}

.search-result-card p {
  margin: 0;
  color: #4b5563;
}

.pagination ul {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
}

.pagination a,
.pagination span {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  color: #374151;
  min-width: 36px;
  text-align: center;
}

.pagination .active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.site-footer {
  border-top: 1px solid #e5e7eb;
  background: #f3f4f6;
  padding: 24px 0;
  text-align: center;
  color: #4b5563;
}

.nav-toggle {
  display: none;
  position: relative;
  width: 46px;
  height: 46px;
  border: 1px solid #d1d5db;
  border-radius: 50%;
  background: #ffffff;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nav-toggle:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.nav-toggle:hover {
  border-color: #2563eb;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.12);
}

.nav-toggle__bar {
  position: absolute;
  width: 20px;
  height: 2px;
  background: #1f2937;
  border-radius: 999px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle__bar:nth-child(1) {
  transform: translateY(-6px);
}

.nav-toggle__bar:nth-child(2) {
  transform: translateY(6px);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  transform: rotate(-45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  opacity: 0;
}

.nav-toggle__bar:nth-child(3) {
  transform: scaleX(0.6);
}

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #2563eb;
  color: #fff;
  font-size: 1.5rem;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 24px rgb(37 99 235 / 0.35);
  cursor: pointer;
}

.back-to-top.visible {
  display: flex;
}

.ad-slot {
  min-height: 120px;
  background: #f9fafb;
  border: 1px dashed #cbd5f5;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .post {
    padding: 20px;
  }

  .post-nav {
    flex-direction: column;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    width: 100%;
  }

  .site-nav ul {
    width: 100%;
    flex-direction: column;
    gap: 4px;
    padding: 12px 0 4px;
    display: none;
  }

  .site-nav.is-open ul {
    display: flex;
  }

  .site-nav a {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 16px;
  }

  .hero-search {
    flex-direction: column;
    align-items: stretch;
    border-radius: 20px;
  }

  .hero-search button {
    width: 100%;
  }

  .trending-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-form {
    flex-direction: column;
    align-items: stretch;
  }

  .search-form button {
    width: 100%;
  }
}

@media (min-width: 769px) {
  .site-header.scrolled {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(229, 231, 235, 0.42);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(12px);
  }
}
