/* Shared blog list + article pages (blog.html, blog/*.html) */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent: #E2E8F0;
  --amber: #4ade80;
  --amber2: #22c55e;
  --dark: #0F0F0F;
  --card: rgba(255,255,255,.04);
  --border: rgba(255,255,255,.08);
  --text: #F9FAFB;
  --muted: #6B7280;
  --r: 18px;
  --grass: #1a5e1a;
  --grass-light: #2d7a2d;
  --pitch: #0d4d0d;
  --panel: rgba(12, 12, 14, .94);
}

html { scroll-behavior: smooth; }

body {
  font-family: Inter, system-ui, sans-serif;
  background: var(--dark);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.7;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .06;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 39px, var(--grass) 39px, var(--grass) 41px),
    repeating-linear-gradient(90deg, transparent, transparent 79px, var(--grass-light) 79px, var(--grass-light) 81px);
}

/* NAV */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15,15,15,.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: .95rem;
  color: var(--text);
  text-decoration: none;
}

.nav-logo img { width: 34px; height: 34px; border-radius: 8px; }

.nav-right { display: flex; align-items: center; gap: 14px; }

.lang-toggle {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text);
  font-size: .78rem;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s;
  font-family: inherit;
}

.lang-toggle:hover { background: rgba(255,255,255,.13); }

.nav-auth-link {
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 13px;
  border-radius: 8px;
  white-space: nowrap;
  transition: color .2s, background .2s;
}

.nav-auth-link:hover { color: var(--text); background: rgba(255,255,255,.07); }

.nav-auth-link.primary {
  color: var(--dark);
  background: linear-gradient(135deg, var(--amber), var(--amber2));
}

.nav-auth-link.primary:hover { filter: brightness(1.05); }

/* BLOG LIST */
.blog-header {
  padding: 120px 24px 48px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.blog-header h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900;
  letter-spacing: -.04em;
  line-height: 1.1;
  margin-bottom: 16px;
  color: var(--text);
}

.blog-header p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.7;
}

.blog-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 24px 80px;
  position: relative;
  z-index: 1;
}

.blog-layout {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 92px;
}

.blog-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  backdrop-filter: blur(12px);
}

.sidebar-section { margin-bottom: 24px; }
.sidebar-section:last-child { margin-bottom: 0; }

.sidebar-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.filter-group { display: flex; flex-direction: column; gap: 8px; }

.filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: .86rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: inherit;
}

.filter-btn:hover { border-color: var(--amber); background: rgba(74,222,128,.06); }

.filter-btn.active {
  border-color: var(--amber);
  background: rgba(74,222,128,.12);
  color: var(--amber);
}

.filter-count {
  font-size: .72rem;
  color: var(--muted);
  background: rgba(255,255,255,.06);
  padding: 2px 8px;
  border-radius: 99px;
}

.filter-btn.active .filter-count {
  background: rgba(74,222,128,.2);
  color: var(--amber);
}

a.filter-btn {
  text-decoration: none;
}

a.filter-btn:hover { border-color: var(--amber); background: rgba(74,222,128,.06); }

/* Sidebar auth (blog.html + index) */
.blog-aside-auth .hero-auth-card,
.blog-aside-auth .hero-auth-welcome {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  animation: none;
  box-shadow: none;
}

.blog-aside-auth .hero-auth-title { font-size: 1.1rem; margin-bottom: 4px; }
.blog-aside-auth .hero-auth-sub { font-size: .78rem; margin-bottom: 14px; }

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.article-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition: border-color .3s, transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s;
  opacity: 0;
  animation: blogFadeUp .5s forwards;
}

@keyframes blogFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.article-card:hover {
  border-color: rgba(74,222,128,.3);
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,.35);
}

.article-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: rgba(255,255,255,.04);
}

.article-body {
  padding: 20px 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.article-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.article-cat {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--amber);
  background: rgba(74,222,128,.1);
  border: 1px solid rgba(74,222,128,.2);
  padding: 3px 10px;
  border-radius: 99px;
}

.article-cat.market {
  color: #86efac;
  background: rgba(16,185,129,.1);
  border-color: rgba(16,185,129,.2);
}

.article-date { font-size: .72rem; color: var(--muted); }

.article-card h3 {
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -.01em;
  color: var(--text);
}

.article-card p {
  font-size: .84rem;
  color: var(--muted);
  line-height: 1.65;
  flex: 1;
}

.article-read {
  font-size: .78rem;
  font-weight: 600;
  color: var(--amber);
  margin-top: 4px;
}

.no-results { text-align: center; padding: 60px 24px; }
.no-results h3 { font-size: 1.35rem; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.no-results p { color: var(--muted); font-size: .92rem; }

/* ARTICLE PAGE */
.article-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 108px 24px 64px;
  position: relative;
  z-index: 1;
}

.article-page-layout {
  display: grid;
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.article-main {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 32px 36px 40px;
  backdrop-filter: blur(12px);
}

.article-header { margin-bottom: 32px; }

.article-header h1 {
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -.03em;
  margin-bottom: 16px;
  color: var(--text);
}

.article-excerpt {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.6;
}

.article-content p {
  margin-bottom: 22px;
  font-size: 1rem;
  color: var(--text);
  opacity: .92;
}

.article-content h2 {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 40px 0 16px;
  letter-spacing: -.02em;
  color: var(--amber);
}

.article-content strong { color: var(--text); font-weight: 700; }
.article-content em { font-style: italic; color: var(--muted); }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--amber);
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  margin-top: 36px;
  transition: gap .2s;
}

.back-link:hover { gap: 12px; }

.app-promo {
  margin-top: 36px;
  padding: 24px;
  background: rgba(74,222,128,.06);
  border: 1px solid rgba(74,222,128,.15);
  border-radius: var(--r);
}

.app-promo p {
  margin-bottom: 14px;
  font-size: .92rem;
  color: var(--text);
  opacity: .88;
}

.app-promo p:last-of-type { margin-bottom: 18px; }

.app-promo a { display: inline-block; transition: opacity .2s, transform .2s; }
.app-promo a:hover { opacity: .92; transform: translateY(-2px); }
.app-promo img { height: 54px; width: auto; display: block; }

.article-hero-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  margin: 24px 0 32px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
  border: 1px solid var(--border);
}

.article-back-row {
  text-align: center;
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  align-items: center;
}

.article-back-row .sep { color: var(--muted); }

/* Compact auth form (sidebar) */
.hero-auth-card,
.hero-auth-welcome {
  position: relative;
  z-index: 1;
  background: rgba(12, 12, 14, .94);
  border: none;
  border-radius: 18px;
  padding: 28px 26px 24px;
  backdrop-filter: blur(16px);
}

.hero-auth-title {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -.03em;
  margin: 0 0 6px;
  color: var(--text);
}

.hero-auth-sub {
  font-size: .82rem;
  color: var(--muted);
  margin: 0 0 20px;
  line-height: 1.5;
}

.hero-auth-card .auth-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,.04);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 18px;
}

.hero-auth-card .auth-tab {
  flex: 1;
  border: none;
  background: none;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  padding: 9px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s, color .2s;
  font-family: inherit;
}

.hero-auth-card .auth-tab.active {
  background: rgba(74,222,128,.15);
  color: var(--amber);
}

.hero-auth-card .field { margin-bottom: 12px; }

.hero-auth-card .field label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
}

.hero-auth-card .field input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-size: .9rem;
  font-family: inherit;
  transition: border-color .2s;
  box-sizing: border-box;
}

.hero-auth-card .field input:focus {
  outline: none;
  border-color: rgba(74,222,128,.4);
}

.hero-auth-card .forgot-link {
  display: inline-block;
  font-size: .75rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 4px;
}

.hero-auth-card .forgot-link:hover { color: var(--amber); }

.hero-auth-card .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform .15s, filter .15s, opacity .15s;
}

.hero-auth-card .btn:disabled { opacity: .55; cursor: not-allowed; }
.hero-auth-card .btn:not(:disabled):hover { transform: translateY(-1px); filter: brightness(1.04); }

.hero-auth-card .btn-primary {
  background: linear-gradient(135deg, var(--amber), var(--amber2));
  color: var(--dark);
  margin-top: 6px;
}

.hero-auth-card .btn-google {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  color: var(--text);
  margin-top: 10px;
}

.hero-auth-card .btn-google svg { width: 18px; height: 18px; flex-shrink: 0; }

.hero-auth-card .auth-divider {
  text-align: center;
  font-size: .72rem;
  color: var(--muted);
  margin: 14px 0 4px;
  position: relative;
}

.hero-auth-card .auth-divider::before,
.hero-auth-card .auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 38%;
  height: 1px;
  background: var(--border);
}

.hero-auth-card .auth-divider::before { left: 0; }
.hero-auth-card .auth-divider::after { right: 0; }

.hero-auth-card .auth-msg {
  margin-top: 12px;
  font-size: .78rem;
  min-height: 1.2em;
  line-height: 1.45;
}

.hero-auth-card .auth-msg.error { color: #f87171; }
.hero-auth-card .auth-msg.success { color: #4ade80; }

.hero-auth-welcome { text-align: center; padding: 36px 28px; }

.hero-auth-welcome-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(74, 222, 128, .12);
  border: 1px solid rgba(74, 222, 128, .35);
  color: #4ade80;
  font-size: 1.4rem;
  font-weight: 700;
}

.hero-auth-welcome h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 0 0 8px;
  color: var(--text);
}

.hero-auth-welcome p {
  font-size: .88rem;
  color: var(--muted);
  margin: 0 0 22px;
}

.hero-auth-welcome strong { color: var(--text); }

.btn-hero-primary {
  background: linear-gradient(135deg, var(--amber), var(--amber2));
  color: var(--dark);
  font-weight: 700;
  border: none;
  transition: transform .15s, filter .15s, box-shadow .15s;
}

.btn-hero-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 10px 32px rgba(74,222,128,.3);
}

.hero-auth-dash-btn {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  padding: 13px 20px;
  border-radius: 12px;
  text-decoration: none;
}

footer {
  text-align: center;
  padding: 40px 24px;
  font-size: .78rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

@media (max-width: 1024px) {
  .blog-layout,
  .article-page-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .blog-sidebar { position: static; }
}

@media (max-width: 768px) {
  nav { padding: 10px 12px; gap: 8px; }
  .nav-logo span { display: none !important; }
  .nav-logo { gap: 0; flex-shrink: 0; }
  .nav-right { flex-shrink: 0; margin-left: auto; }
}

@media (max-width: 640px) {
  .articles-grid { grid-template-columns: 1fr; }
  .blog-header h1 { font-size: 2rem; }
  .article-main { padding: 24px 20px 28px; }
}
