/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0f0f1a;
  --surface:  #16213e;
  --border:   rgba(255,255,255,.1);
  --tg:       #2AABEE;
  --tg-hover: #1a9bd8;
  --text:     #e8eaf0;
  --muted:    rgba(232,234,240,.5);
  --radius:   14px;
  --max-w:    1100px;
}

html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, sans-serif; line-height: 1.6; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ── Layout ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }

/* ── Header ── */
.site-header {
  background: rgba(26,26,46,.9);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px);
}
.site-header .inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.25rem; max-width: var(--max-w); margin: 0 auto;
}
.site-logo { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.1rem; }
.site-logo svg { color: var(--tg); }
.site-nav { display: flex; gap: 1.5rem; }
.site-nav a { color: var(--muted); font-size: .9rem; transition: color .2s; }
.site-nav a:hover, .site-nav a.active { color: var(--text); }

/* ── Hero ── */
.hero { text-align: center; padding: 5rem 1.25rem 3rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.2;
  background: linear-gradient(135deg, var(--tg), #60a5fa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero p { color: var(--muted); font-size: 1.1rem; max-width: 600px; margin: 1rem auto 0; }

/* ── Channels Grid ── */
.channels-section { padding: 2rem 0 4rem; }
.section-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 1.5rem; }
.channels-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }

.channel-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem;
  transition: transform .2s, box-shadow .2s;
}
.channel-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(42,171,238,.15); }
.channel-card-header { display: flex; align-items: center; gap: 1rem; }
.channel-logo { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.channel-logo-placeholder {
  width: 52px; height: 52px; border-radius: 50%; background: rgba(42,171,238,.15);
  display: flex; align-items: center; justify-content: center;
  color: var(--tg); font-weight: 700; font-size: 1.3rem; flex-shrink: 0;
}
.channel-name { font-weight: 700; font-size: 1rem; }
.channel-members { color: var(--tg); font-size: .82rem; margin-top: .15rem; }
.channel-desc { color: var(--muted); font-size: .88rem; flex: 1; }
.btn-join {
  display: block; text-align: center; background: var(--tg); color: #fff;
  font-weight: 600; padding: .65rem 1rem; border-radius: 10px;
  transition: background .2s; margin-top: auto;
}
.btn-join:hover { background: var(--tg-hover); }

/* ── FAQ ── */
.faq-section { padding: 3rem 0; border-top: 1px solid var(--border); }
.faq-list { max-width: 760px; display: flex; flex-direction: column; gap: .75rem; }
details.faq-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
details.faq-item summary {
  padding: 1rem 1.25rem; font-weight: 600; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
details.faq-item summary::after { content: '+'; font-size: 1.3rem; color: var(--tg); }
details.faq-item[open] summary::after { content: '−'; }
details.faq-item .faq-answer { padding: 0 1.25rem 1rem; color: var(--muted); font-size: .93rem; }

/* ── Blog ── */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.blog-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: transform .2s;
}
.blog-card:hover { transform: translateY(-3px); }
.blog-card-img { width: 100%; height: 180px; object-fit: cover; }
.blog-card-img-placeholder { width: 100%; height: 180px; background: rgba(42,171,238,.08); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.blog-card-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.blog-card-title { font-weight: 700; font-size: 1rem; line-height: 1.4; }
.blog-card-excerpt { color: var(--muted); font-size: .87rem; flex: 1; }
.blog-card-meta { font-size: .78rem; color: var(--muted); }
.blog-card-link { display: inline-block; color: var(--tg); font-size: .87rem; font-weight: 600; margin-top: .5rem; }

/* ── Article Page ── */
.article-layout { display: grid; grid-template-columns: 1fr 300px; gap: 2.5rem; padding: 3rem 0 5rem; align-items: start; }
@media (max-width: 768px) { .article-layout { grid-template-columns: 1fr; } }
.article-cover { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); margin-bottom: 2rem; }
.article-title { font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; line-height: 1.25; margin-bottom: 1rem; }
.article-meta { color: var(--muted); font-size: .85rem; margin-bottom: 2rem; }
.article-content { color: var(--text); line-height: 1.8; font-size: 1rem; }
.article-content h2 { font-size: 1.5rem; font-weight: 700; margin: 2rem 0 .75rem; }
.article-content h3 { font-size: 1.2rem; font-weight: 600; margin: 1.5rem 0 .5rem; }
.article-content p { margin-bottom: 1rem; }
.article-content ul, .article-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.article-content li { margin-bottom: .4rem; }
.article-content a { color: var(--tg); text-decoration: underline; }
.article-content blockquote { border-left: 3px solid var(--tg); padding-left: 1rem; color: var(--muted); margin: 1.5rem 0; }
.article-content pre { background: rgba(255,255,255,.05); padding: 1rem; border-radius: 8px; overflow-x: auto; margin-bottom: 1rem; }
.article-content code { font-family: monospace; font-size: .9em; }

/* Sidebar */
.sidebar { position: sticky; top: 80px; }
.sidebar-widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
.sidebar-widget h3 { font-size: .95rem; font-weight: 700; margin-bottom: 1rem; color: var(--tg); }
.sidebar-channel { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.sidebar-channel:last-child { border-bottom: none; }
.sidebar-channel img, .sidebar-channel .sc-placeholder {
  width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.sidebar-channel .sc-placeholder { background: rgba(42,171,238,.15); display: flex; align-items: center; justify-content: center; color: var(--tg); font-weight: 700; font-size: .9rem; }
.sidebar-channel-name { font-size: .88rem; font-weight: 600; }
.sidebar-channel-link { font-size: .78rem; color: var(--tg); }

/* ── Inline channel CTA (article) ── */
.channel-cta {
  background: linear-gradient(135deg, rgba(42,171,238,.12), rgba(42,171,238,.05));
  border: 1px solid rgba(42,171,238,.3); border-radius: var(--radius);
  padding: 1.25rem 1.5rem; margin: 2rem 0; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.channel-cta p { flex: 1; font-size: .95rem; color: var(--text); }
.channel-cta a { background: var(--tg); color: #fff; padding: .55rem 1.2rem; border-radius: 8px; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.channel-cta a:hover { background: var(--tg-hover); }

/* ── Pagination ── */
.pagination { display: flex; gap: .5rem; justify-content: center; margin-top: 2.5rem; }
.pagination button {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: .5rem .9rem; border-radius: 8px; cursor: pointer; transition: all .2s;
}
.pagination button.active, .pagination button:hover { background: var(--tg); border-color: var(--tg); color: #fff; }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--border); padding: 2.5rem 1.25rem; text-align: center; color: var(--muted); font-size: .85rem; }

/* ── Utility ── */
.hidden { display: none !important; }
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, rgba(255,255,255,.05) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
