/* ============================================================
   article.css — CalcPocket Blog Article Pages
   Applies on top of blog.css and css/styles.css
   ============================================================ */

/* ---- Box sizing ---- */
.art-page *,
.art-page *::before,
.art-page *::after {
  box-sizing: border-box;
}

/* ============================================================
   PAGE WRAPPER
   ============================================================ */
.art-page {
  position: relative;
  z-index: 1;
}

/* ============================================================
   HERO
   ============================================================ */
.art-hero {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}

.art-hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 28px 40px;
}

.art-hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.art-date {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
  margin-left: auto;
}

.art-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(26px, 4vw, 44px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  color: var(--text);
  margin-bottom: 18px;
  max-width: 860px;
}

.art-excerpt {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0;
}

/* ============================================================
   LAYOUT: article body + sidebar
   ============================================================ */
.art-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 28px 80px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  align-items: start;
}

/* ============================================================
   ARTICLE BODY
   ============================================================ */
.art-body {
  min-width: 0;
}

/* Headings */
.art-body h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text);
  margin: 40px 0 14px;
  padding-top: 8px;
}
.art-body h2:first-child { margin-top: 0; }

.art-body h3 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 28px 0 10px;
}

/* Paragraphs */
.art-body p {
  font-size: 15px;
  line-height: 1.85;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Lists */
.art-body ul,
.art-body ol {
  margin: 0 0 18px 0;
  padding-left: 22px;
}
.art-body li {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.art-body li strong { color: var(--text); font-weight: 600; }

/* ============================================================
   TABLES
   ============================================================ */
.art-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 20px 0 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.art-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 480px;
}

.art-table thead {
  background: var(--bg-3);
}

.art-table th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.art-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  vertical-align: middle;
  line-height: 1.5;
}

.art-table tr:last-child td { border-bottom: none; }
.art-table tbody tr:hover td { background: var(--surface-2, var(--bg-2)); }
.art-table td strong { color: var(--text); font-weight: 600; }

/* ============================================================
   KEY POINT BOX
   ============================================================ */
.art-key-point {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: rgba(91, 156, 246, 0.06);
  border: 1px solid rgba(91, 156, 246, 0.24);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 28px 0;
}
body.light-theme .art-key-point {
  background: rgba(2, 100, 200, 0.05);
  border-color: rgba(2, 100, 200, 0.2);
  border-left-color: var(--accent);
}

.art-key-point > i {
  color: var(--blue);
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}
body.light-theme .art-key-point > i { color: var(--accent); }

.art-key-point p {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-muted);
}

/* ============================================================
   CTA BOX
   ============================================================ */
.art-cta-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--blue);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin: 36px 0 8px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-lg), 0 0 60px var(--accent-dim);
}
body.light-theme .art-cta-box { border-top-color: var(--accent); }

.art-cta-icon {
  width: 42px;
  height: 42px;
  background: rgba(91, 156, 246, 0.10);
  border: 1px solid rgba(91, 156, 246, 0.25);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--blue);
  flex-shrink: 0;
}
body.light-theme .art-cta-icon {
  background: rgba(2, 100, 200, 0.07);
  border-color: rgba(2, 100, 200, 0.2);
  color: var(--accent);
}

.art-cta-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.art-cta-content strong {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.art-cta-content span {
  font-size: 13px;
  color: var(--text-dim);
}

.art-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--blue);
  border-radius: var(--radius);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity var(--transition), transform var(--transition);
}
.art-cta-btn:hover { opacity: 0.88; transform: translateY(-1px); }
body.light-theme .art-cta-btn { background: var(--accent); }

/* ============================================================
   SIDEBAR
   ============================================================ */
.art-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 24px);
}

.art-sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.art-sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}
.art-sidebar-title i { color: var(--blue); font-size: 11px; }
body.light-theme .art-sidebar-title i { color: var(--accent); }

.art-related-list {
  display: flex;
  flex-direction: column;
}

.art-related-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: background var(--transition);
}
.art-related-card:last-child { border-bottom: none; }
.art-related-card:hover { background: var(--bg-2); }

.art-related-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  transition: color var(--transition);
}
.art-related-card:hover .art-related-title { color: var(--blue); }
body.light-theme .art-related-card:hover .art-related-title { color: var(--accent); }

.art-sidebar-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  transition: opacity var(--transition);
}
.art-sidebar-all:hover { opacity: 0.75; }
body.light-theme .art-sidebar-all { color: var(--accent); }
.art-sidebar-all i { font-size: 10px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .art-layout {
    grid-template-columns: 1fr;
    padding: 36px 20px 60px;
    gap: 32px;
  }

  .art-sidebar {
    position: static;
  }

  /* On mobile, sidebar moves below article */
  .art-sidebar-card {
    /* Show as horizontal scrollable related list */
  }
}

@media (max-width: 640px) {
  .art-hero-inner { padding: 28px 16px 32px; }
  .art-layout { padding: 28px 16px 56px; gap: 24px; }

  .art-cta-box {
    flex-direction: column;
    align-items: flex-start;
  }
  .art-cta-btn { width: 100%; justify-content: center; }

  .art-hero-meta { gap: 8px; }
  .art-date { margin-left: 0; }

  .art-body h2 { font-size: 19px; }
  .art-body p, .art-body li { font-size: 14px; }
}
