/* ==========================================================================
   ApexBulletin Core Stylesheet
   Modern, Clean, High-Yield Strategy & Intelligence Theme
   ========================================================================== */

:root {
  --primary: #1e3a8a;
  --primary-light: #2563eb;
  --primary-dark: #0f172a;
  --accent: #0284c7;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border-light: #e2e8f0;
  --border-subtle: #f1f5f9;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.03);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Charter", "Bitstream Charter", "Sitka Text", Cambria, serif;
  --max-width: 1200px;
  --article-width: 780px;
}

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

html {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

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

.wrap {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(8px);
  background-color: rgba(255, 255, 255, 0.95);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary-dark);
}

.logo img {
  width: 34px;
  height: 34px;
}

.logo span {
  color: var(--primary-light);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--primary-light);
  background-color: #f1f5f9;
}

.nav-link.active {
  color: var(--primary-light);
  background-color: #eff6ff;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-main);
}

/* ==========================================================================
   Hero Banner
   ========================================================================== */
.hero-banner {
  padding: 48px 0 32px 0;
  text-align: center;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 36px;
  background: linear-gradient(180deg, #ffffff 0%, var(--bg-main) 100%);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.hero-banner h1 {
  font-size: 2.5rem;
  font-weight: 850;
  letter-spacing: -0.03em;
  color: var(--primary-dark);
  margin-bottom: 12px;
  line-height: 1.2;
}

.hero-banner p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
}

/* ==========================================================================
   Category Pill Bar (Secondary Nav)
   ========================================================================== */
.category-filter-bar {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 28px;
}

.cat-pill {
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
}

.cat-pill:hover, .cat-pill.active {
  background: var(--primary-dark);
  color: #ffffff;
  border-color: var(--primary-dark);
}

/* ==========================================================================
   Articles Grid Layout
   ========================================================================== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 28px;
  margin-bottom: 48px;
}

.article-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card-thumb-link {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e2e8f0;
}

.card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.article-card:hover .card-thumb {
  transform: scale(1.04);
}

.card-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-light);
  margin-bottom: 8px;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 750;
  line-height: 1.35;
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.card-title a:hover {
  color: var(--primary-light);
}

.card-summary {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 16px;
  flex-grow: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
  font-size: 0.82rem;
  color: var(--text-subtle);
  font-weight: 500;
}

/* ==========================================================================
   Article Detail Page Layout
   ========================================================================== */
.article-detail-wrap {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  margin-top: 32px;
  margin-bottom: 60px;
}

.article-main {
  max-width: var(--article-width);
  background: #ffffff;
  padding: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.article-header {
  margin-bottom: 28px;
}

.article-header .badge {
  display: inline-block;
  padding: 4px 10px;
  background: #eff6ff;
  color: var(--primary-light);
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 4px;
  margin-bottom: 14px;
}

.article-header h1 {
  font-size: 2.25rem;
  font-weight: 850;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--primary-dark);
  margin-bottom: 16px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 20px;
}

.article-featured-image {
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 32px;
}

.article-content {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  line-height: 1.8;
  color: #2d3748;
}

.article-content p {
  margin-bottom: 24px;
}

.article-content h2 {
  font-family: var(--font-sans);
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin: 40px 0 16px 0;
  line-height: 1.3;
}

.article-content h3 {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 750;
  color: var(--primary-dark);
  margin: 30px 0 12px 0;
}

.article-content ul, .article-content ol {
  margin: 0 0 24px 24px;
}

.article-content li {
  margin-bottom: 8px;
}

.article-content blockquote {
  border-left: 4px solid var(--primary-light);
  padding-left: 20px;
  margin: 28px 0;
  font-style: italic;
  color: #4b5563;
  background: #f8fafc;
  padding: 16px 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.sidebar-card {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.sidebar-title {
  font-size: 1.05rem;
  font-weight: 750;
  color: var(--primary-dark);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #eff6ff;
}

/* ==========================================================================
   Static Pages (About / Privacy / Terms / Contact)
   ========================================================================== */
.static-page-box {
  background: #ffffff;
  max-width: 860px;
  margin: 36px auto 60px auto;
  padding: 48px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.static-page-box h1 {
  font-size: 2.2rem;
  font-weight: 850;
  color: var(--primary-dark);
  margin-bottom: 14px;
}

.static-page-box .last-updated {
  font-size: 0.9rem;
  color: var(--text-subtle);
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 16px;
}

.static-page-box h2 {
  font-size: 1.35rem;
  font-weight: 750;
  margin: 28px 0 12px 0;
  color: var(--primary-dark);
}

.static-page-box p {
  margin-bottom: 16px;
  color: #334155;
  font-size: 1.02rem;
  line-height: 1.7;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  background: #ffffff;
  border-top: 1px solid var(--border-light);
  margin-top: auto;
  padding: 48px 0 28px 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 12px;
  max-width: 380px;
}

.footer-col h4 {
  font-size: 0.95rem;
  font-weight: 750;
  color: var(--primary-dark);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--primary-light);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-subtle);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 960px) {
  .article-detail-wrap {
    grid-template-columns: 1fr;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: #ffffff;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-md);
  }
  .nav-toggle {
    display: block;
  }
  .hero-banner h1 {
    font-size: 1.85rem;
  }
  .articles-grid {
    grid-template-columns: 1fr;
  }
  .article-main {
    padding: 24px;
  }
}
