@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700&family=Inter:wght@400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #0f172a;
  --orange: #f97316;
  --orange-dark: #ea6c08;
  --gray-bg: #f1f5f9;
  --gray-border: #e2e8f0;
  --gray-text: #64748b;
  --gray-mid: #94a3b8;
  --body-text: #1e293b;
  --white: #ffffff;
  --green: #16a34a;
  --font-head: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;
  --max-width: 1200px;
  --radius: 8px;
}

html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font-body); color: var(--body-text); background: var(--white); line-height: 1.6; }

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

img { max-width: 100%; display: block; }

h1, h2, h3, h4, h5 { font-family: var(--font-head); line-height: 1.25; }

/* Layout */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }
.page-grid { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; }

/* Header */
.site-header {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.site-logo svg { width: 36px; height: 36px; }
.site-logo-text { font-family: var(--font-head); font-size: 1.2rem; font-weight: 700; color: var(--white); }
.site-logo-text span { color: var(--orange); }

.header-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.header-search input {
  width: 100%;
  padding: 9px 40px 9px 14px;
  border-radius: 6px;
  border: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: rgba(255,255,255,0.1);
  color: var(--white);
  outline: none;
}
.header-search input::placeholder { color: rgba(255,255,255,0.5); }
.header-search input:focus { background: rgba(255,255,255,0.15); }
.header-search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.5);
  pointer-events: none;
}

.header-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.header-nav a {
  color: rgba(255,255,255,0.8);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
}
.header-nav a:hover { color: var(--white); background: rgba(255,255,255,0.1); }

.btn-ask {
  background: var(--orange);
  color: var(--white) !important;
  padding: 8px 16px !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
  white-space: nowrap;
}
.btn-ask:hover { background: var(--orange-dark) !important; }

.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 6px; }
.hamburger span { display: block; width: 22px; height: 2px; background: var(--white); margin: 5px 0; border-radius: 2px; transition: 0.2s; }

/* Hero */
.hero {
  background: var(--navy);
  padding: 60px 20px;
  text-align: center;
  color: var(--white);
}
.hero h1 { font-size: 2.4rem; margin-bottom: 12px; }
.hero h1 span { color: var(--orange); }
.hero p { font-size: 1.1rem; color: rgba(255,255,255,0.75); margin-bottom: 28px; }
.hero-search {
  display: flex;
  max-width: 560px;
  margin: 0 auto;
  gap: 0;
}
.hero-search input {
  flex: 1;
  padding: 14px 18px;
  font-size: 1rem;
  font-family: var(--font-body);
  border: none;
  border-radius: 8px 0 0 8px;
  outline: none;
}
.hero-search button {
  padding: 14px 24px;
  background: var(--orange);
  color: var(--white);
  border: none;
  border-radius: 0 8px 8px 0;
  font-size: 1rem;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
}
.hero-search button:hover { background: var(--orange-dark); }

/* Category cards */
.section-title {
  font-size: 1.4rem;
  font-family: var(--font-head);
  margin-bottom: 20px;
  color: var(--navy);
}
.section-title span { color: var(--orange); }

.categories-section { padding: 48px 0; }
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.category-card {
  background: var(--gray-bg);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: block;
}
.category-card:hover {
  border-color: var(--orange);
  box-shadow: 0 2px 12px rgba(249,115,22,0.12);
  text-decoration: none;
}
.category-icon { font-size: 1.8rem; margin-bottom: 10px; }
.category-name { font-family: var(--font-head); font-weight: 600; color: var(--navy); font-size: 0.95rem; margin-bottom: 4px; }
.category-count { font-size: 0.8rem; color: var(--gray-text); }

/* Questions feed */
.questions-section { padding: 0 0 48px; }
.main-content { min-width: 0; }

.question-card {
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 12px;
  background: var(--white);
  transition: border-color 0.15s;
}
.question-card:hover { border-color: var(--orange); }
.question-card-title {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.question-card-title a { color: var(--navy); }
.question-card-title a:hover { color: var(--orange); text-decoration: none; }
.question-card-excerpt { font-size: 0.9rem; color: var(--gray-text); margin-bottom: 12px; }
.question-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--gray-text);
  flex-wrap: wrap;
}
.category-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(249,115,22,0.1);
  color: var(--orange);
}
.meta-item { display: flex; align-items: center; gap: 4px; }

/* Sidebar */
.sidebar { position: sticky; top: 72px; }
.sidebar-widget {
  background: var(--gray-bg);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.widget-title {
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--orange);
}

.contributor-list { list-style: none; }
.contributor-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-border);
}
.contributor-item:last-child { border-bottom: none; }
.contributor-info { flex: 1; min-width: 0; }
.contributor-name { font-size: 0.85rem; font-weight: 600; color: var(--navy); }
.contributor-posts { font-size: 0.75rem; color: var(--gray-text); }

.tags-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-link {
  display: inline-block;
  padding: 4px 10px;
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: 4px;
  font-size: 0.78rem;
  color: var(--gray-text);
  text-decoration: none;
}
.tag-link:hover { border-color: var(--orange); color: var(--orange); text-decoration: none; }

.affiliate-product {
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-border);
}
.affiliate-product:last-child { border-bottom: none; padding-bottom: 0; }
.affiliate-product-name { font-size: 0.875rem; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.affiliate-product-price { font-size: 0.8rem; color: var(--gray-text); margin-bottom: 6px; }
.affiliate-btn {
  display: inline-block;
  padding: 5px 12px;
  background: var(--orange);
  color: var(--white);
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}
.affiliate-btn:hover { background: var(--orange-dark); text-decoration: none; color: var(--white); }

/* Avatar */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--white);
  font-family: var(--font-head);
}
.avatar-sm { width: 28px; height: 28px; font-size: 0.6rem; }
.avatar-lg { width: 44px; height: 44px; font-size: 0.8rem; }

/* Pagination */
.pagination { display: flex; align-items: center; gap: 6px; justify-content: center; margin-top: 28px; }
.page-btn {
  padding: 7px 12px;
  border: 1px solid var(--gray-border);
  border-radius: 4px;
  background: var(--white);
  color: var(--gray-text);
  font-size: 0.875rem;
  cursor: pointer;
  font-family: var(--font-body);
}
.page-btn:hover { border-color: var(--orange); color: var(--orange); }
.page-btn.active { background: var(--orange); color: var(--white); border-color: var(--orange); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Load more */
.load-more-btn {
  display: block;
  margin: 24px auto 0;
  padding: 10px 28px;
  background: var(--white);
  border: 2px solid var(--orange);
  color: var(--orange);
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
}
.load-more-btn:hover { background: var(--orange); color: var(--white); }

/* Footer */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: 48px 0 24px;
  margin-top: 60px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}
.footer-col-title {
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 14px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: rgba(255,255,255,0.65); font-size: 0.875rem; text-decoration: none; }
.footer-col a:hover { color: var(--orange); }
.footer-about { font-size: 0.875rem; line-height: 1.7; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
}
.footer-bottom a { color: rgba(255,255,255,0.55); }

/* Utility */
.hidden { display: none !important; }
.text-orange { color: var(--orange); }
.text-gray { color: var(--gray-text); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }

/* Responsive */
@media (max-width: 1024px) {
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .page-grid { grid-template-columns: 1fr 280px; gap: 24px; }
}

@media (max-width: 768px) {
  .page-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 1.7rem; }
  .header-nav { display: none; }
  .header-nav.open { display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--navy); padding: 12px 20px; z-index: 99; }
  .hamburger { display: block; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .category-grid { grid-template-columns: 1fr 1fr; }
  .hero-search { flex-direction: column; }
  .hero-search input { border-radius: 6px; }
  .hero-search button { border-radius: 6px; }
  .footer-grid { grid-template-columns: 1fr; }
  .question-card-meta { gap: 10px; }
}
