/* === NexusFi Academy — Colors matched to site palette === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* --- Article Page --- */
.academy-main { max-width: 900px; margin: 0 auto; padding: 32px 24px; overflow-x: hidden; box-sizing: border-box; width: 100%; }
/* Prevent academy content from expanding vBulletin table-layout parent chain on mobile */
td.page, .paddingmobile { max-width: 100vw; overflow-x: hidden; box-sizing: border-box; }
.academy-article h1 { font-size: 2.2rem; margin-bottom: 8px; color: #0d2744; line-height: 1.2; }
.article-meta { font-size: 14px; color: #718096; margin-bottom: 32px; border-bottom: 1px solid #e2e8f0; padding-bottom: 16px; }
.academy-toc { background: #f0f4f8; border: 1px solid #e2e8f0; border-radius: 8px; padding: 20px 24px; margin-bottom: 40px; }
.academy-toc h3 { font-size: 16px; color: #0d2744; margin-bottom: 10px; }
.academy-toc ol { padding-left: 20px; columns: 2; column-gap: 24px; }
.academy-toc li { font-size: 15px; margin-bottom: 4px; break-inside: avoid; }
.academy-toc a { color: #1a5b9e; text-decoration: none; }
.academy-toc a:hover { text-decoration: underline; }
.academy-section { margin-bottom: 48px; }
.academy-section h2 { font-size: 1.6rem; color: #0d2744; margin-bottom: 20px; padding-bottom: 6px;
  border-bottom: 2px solid #1a5b9e; }
.academy-section h2 + p { margin-top: 18px; }
.academy-section h3 { font-size: 1.25rem; color: #1b3a5c; margin: 24px 0 12px; }
.academy-section h4 { font-size: 1.1rem; color: #4a5568; margin: 20px 0 8px; }
.academy-section p { margin-bottom: 16px; color: #1a1a1a; }
.academy-section ul, .academy-section ol { margin: 0 0 16px 24px; }
.academy-section li { margin-bottom: 6px; }
.academy-section blockquote { border-left: 4px solid #1a5b9e; padding: 12px 20px; margin: 16px 0;
  background: #f5f0e6; border-radius: 0 4px 4px 0; color: #4a5568; font-style: italic; }
.academy-section code { background: #edf2f7; padding: 2px 6px; border-radius: 3px; font-size: 0.9em; font-family: 'SFMono-Regular', Consolas, monospace; }
pre.academy-code { background: #1e293b; color: #e2e8f0; padding: 16px 20px; border-radius: 6px;
  overflow-x: auto; margin: 16px 0; font-size: 0.9em; line-height: 1.6; border: 1px solid #334155; }
pre.academy-code code { background: none; padding: 0; color: inherit; font-size: inherit; }
.academy-table-wrap { overflow-x: auto; margin: 16px 0; -webkit-overflow-scrolling: touch; }
.academy-table-wrap table { min-width: 500px; }
.academy-table { width: 100%; border-collapse: collapse; font-size: 0.95em; }
.academy-table th { background: #1a5b9e; color: #fff; padding: 10px 14px; text-align: left; font-weight: 600; }
.academy-table td { padding: 10px 14px; border-bottom: 1px solid #e2e8f0; }
.academy-table tbody tr:nth-child(even) { background: #f8fafc; }
.academy-table tbody tr:hover { background: #edf2f7; }
.academy-section a { color: #1a5b9e; text-decoration: none; }
.academy-section a:hover { text-decoration: underline; }
.academy-section strong { color: inherit; background: #f5f0e6; padding: 1px 5px;
  border-radius: 3px; text-decoration: underline dotted #d4a843;
  text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
/* Safety net: ALL images inside articles get max-width constraint regardless of class */
.academy-article img { max-width: 100%; height: auto; }
/* Inline content images (from markdown conversion or embedded in content) */
.academy-image, .academy-inline-img { max-width: 100%; height: auto; display: block; margin: 16px auto;
  border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.12); border: 1px solid #e2e8f0;
  cursor: zoom-in; transition: box-shadow 0.2s, transform 0.2s; }
.academy-image:hover, .academy-inline-img:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.18); transform: scale(1.01); }
.academy-visual { margin: 24px 0; text-align: center; }
.academy-visual img { max-width: 100%; height: auto; border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12); border: 1px solid #e2e8f0;
  cursor: zoom-in; transition: box-shadow 0.2s, transform 0.2s; }
.academy-visual img:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.18); transform: scale(1.01); }
.academy-visual figcaption { font-size: 14px; color: #718096; margin-top: 8px; font-style: italic; }
/* Lightbox */
.academy-lightbox { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center; }
.academy-lightbox-backdrop { position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(13,39,68,0.92); }
.academy-lightbox-content { position: relative; max-width: 95vw; max-height: 95vh; z-index: 1; }
.academy-lightbox-content img { max-width: 95vw; max-height: 88vh; object-fit: contain;
  border-radius: 4px; box-shadow: 0 8px 40px rgba(0,0,0,0.5); }
.academy-lightbox-caption { text-align: center; color: #e2e8f0; font-size: 15px;
  margin-top: 12px; max-width: 700px; margin-left: auto; margin-right: auto; line-height: 1.5; }
.academy-lightbox-close { position: absolute; top: -40px; right: 0; background: none; border: none;
  color: #fff; font-size: 36px; cursor: pointer; line-height: 1; padding: 4px 8px;
  opacity: 0.7; transition: opacity 0.2s; }
.academy-lightbox-close:hover { opacity: 1; }
/* --- @Mention Links --- */
.academy-mention { color: #1a5b9e; font-weight: 600; text-decoration: none;
  background: linear-gradient(to bottom, transparent 60%, rgba(26,91,158,0.12) 60%); }
.academy-mention:hover { text-decoration: underline; }

/* --- Knowledge Map (Relationship Visualization) --- */
.academy-relationships { margin-top: 48px; padding-top: 32px; border-top: 2px solid #e2e8f0; }
.academy-relationships > h2 { font-size: 1.5rem; color: #0d2744; margin-bottom: 24px;
  padding-bottom: 8px; border-bottom: 2px solid #1a5b9e; }
.academy-rel-grid { display: flex; flex-direction: column; gap: 24px; }
.academy-rel-group { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 20px 24px; transition: border-color 0.2s; }
.academy-rel-group:hover { border-color: #cbd5e0; }
.academy-rel-group-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.academy-rel-group-header h3 { margin: 0; font-size: 1.1rem; color: #0d2744; line-height: 1.2; }
.academy-rel-group-icon { font-size: 24px; line-height: 1; flex-shrink: 0; }
.academy-rel-subtitle { display: block; font-size: 13px; color: #718096; margin-top: 2px; }
.academy-rel-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.academy-rel-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; text-decoration: none;
  transition: all 0.2s; }
.academy-rel-card:hover { border-color: #1a5b9e; box-shadow: 0 2px 8px rgba(26,91,158,0.12);
  transform: translateY(-1px); }
.academy-rel-card-icon { font-size: 20px; flex-shrink: 0; }
.academy-rel-card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.academy-rel-card-title { font-size: 14px; font-weight: 600; color: #0d2744; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; }
.academy-rel-card-cat { font-size: 11px; color: #718096; text-transform: uppercase;
  letter-spacing: 0.4px; font-weight: 500; }
/* Prereq group accent */
.academy-rel-prereqs { border-left: 4px solid #0d2744; }
/* Explore group accent */
.academy-rel-explores { border-left: 4px solid #1a5b9e; }
/* Related group accent */
.academy-rel-related { border-left: 4px solid #29b6f6; }
/* Incoming group accent */
.academy-rel-incoming { border-left: 4px solid #d4a843; }

@media (max-width: 768px) {
  .academy-rel-cards { grid-template-columns: 1fr; }
  .academy-rel-group { padding: 16px; }
}

.academy-citations { margin-top: 48px; padding-top: 24px; border-top: 2px solid #e2e8f0; }
.academy-citations h2 { font-size: 1.4rem; color: #0d2744; margin-bottom: 16px; }
.citation-list { padding-left: 20px; }
.citation-list li { margin-bottom: 12px; font-size: 15px; line-height: 1.5; }
.cite-author { font-weight: 600; color: #1a5b9e; }
.cite-source { font-weight: 600; color: #1b3a5c; }
.cite-thread { color: #1a5b9e; }
.cite-excerpt { margin-top: 6px; font-size: 14px; padding: 6px 12px; color: #4a5568;
  font-style: italic; border-left: 3px solid #1a5b9e; background: #f5f0e6; border-radius: 0 3px 3px 0;
  line-height: 1.4; }
.academy-citation-thanks { font-size: 12px; color: #718096; margin-left: 4px; }
/* Inline citation superscripts — link to footnote anchors in citations section */
sup.academy-cite a { color: #1a5b9e; text-decoration: none; background: #e8f0fb; padding: 0 2px; border-radius: 2px; font-weight: 600; }
sup.academy-cite a:hover { background: #c8d8f5; text-decoration: underline; }
/* Bare URL citation source references */
p.academy-source-ref { margin-top: -8px; margin-bottom: 16px; font-size: 13px; }
p.academy-source-ref a, a.academy-source-ref { color: #1a5b9e; text-decoration: none; font-size: 13px; font-style: italic; }
p.academy-source-ref a:hover, a.academy-source-ref:hover { text-decoration: underline; }
.academy-cta { background: linear-gradient(135deg, #0d2744 0%, #1a5b9e 100%); color: white; padding: 24px;
  border-radius: 8px; margin-top: 48px; text-align: center; }
.academy-cta h3 { margin-bottom: 8px; }
.academy-cta a { color: #29b6f6; font-weight: 600; }
.academy-footer-row { display: flex; justify-content: space-between; align-items: flex-start; margin-top: 24px; gap: 16px; }
.version-history { font-size: 14px; color: #718096; }
.version-history summary { cursor: pointer; color: #1b3a5c; }
.academy-view-count { font-size: 13px; color: #a0aec0; white-space: nowrap; padding-top: 2px; }
.academy-view-count svg { vertical-align: -2px; margin-right: 3px; }

/* --- Callout Boxes --- */
.academy-callout { margin: 20px 0; padding: 16px 20px; border-radius: 6px; border-left: 4px solid; }
.academy-callout-label { font-weight: 700; font-size: 13px; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 8px; }
.academy-callout-body p { margin-bottom: 8px; }
.academy-callout-body p:last-child { margin-bottom: 0; }
.academy-callout { background: #f0f4f8; border-left-color: #1a5b9e; }
.academy-callout .academy-callout-label { color: #0d2744; }
.academy-callout-takeaway { border-left: none; border-top: 3px solid #1a5b9e;
  margin-top: 28px; padding: 14px 20px; border-radius: 4px; }
.academy-callout-takeaway .academy-callout-body { font-style: italic; }

/* --- Pull Quote Cards (matches vBulletin [quote] style) --- */
.academy-pullquote { margin: 24px 0; border: 1px solid #A1A1A1; background: #fafafb;
  border-radius: 4px; overflow: hidden; }
.academy-pullquote-header { padding: 0 12px; display: flex; align-items: center;
  gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.academy-pullquote-user { background: #3765c7; color: #fff; padding: 3px 8px 4px;
  font-weight: 600; font-size: 13px; border-radius: 2px; white-space: nowrap; }
.academy-pullquote-user a.academy-user-link { color: #fff; text-decoration: none; }
.academy-pullquote-user a.academy-user-link:hover { text-decoration: underline; }
.cite-author a.academy-user-link { color: #1a5b9e; text-decoration: none; }
.cite-author a.academy-user-link:hover { text-decoration: underline; }
.academy-pullquote-thread { font-size: 13px; color: #718096; text-decoration: none; }
.academy-pullquote-thread:hover { color: #1a5b9e; text-decoration: underline; }
.academy-pullquote-text { padding: 8px 16px 12px; color: #1a1a1a; font-size: 15px;
  line-height: 1.35; font-style: italic; word-break: break-word; overflow-wrap: break-word; }

/* --- Reading Progress Bar --- */
.academy-progress { position: fixed; top: 0; left: 0; width: 100%; height: 4px;
  z-index: 100000; background: #e2e8f0; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.academy-progress.visible { opacity: 1; }
.academy-progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, #1a5b9e, #29b6f6);
  transition: width 0.15s linear; }

/* --- Anchor Bookmarks --- */
.academy-anchor { opacity: 0; margin-left: 6px; color: #1a5b9e; text-decoration: none;
  font-weight: 400; font-size: 0.8em; transition: opacity 0.15s; }
h2:hover .academy-anchor, h3:hover .academy-anchor, h4:hover .academy-anchor { opacity: 0.5; }
.academy-anchor:hover { opacity: 1 !important; }

/* --- Landing Page (Category Directory) --- */
.academy-landing { max-width: 1000px; margin: 0 auto; padding: 32px 24px; }
.academy-landing-hero { background: linear-gradient(135deg, #0d2744 0%, #1a5b9e 100%);
  color: #fff; padding: 32px 36px; border-radius: 8px; margin-bottom: 28px; }
.academy-landing-hero h1 { font-size: 2rem; font-weight: 700; margin: 0 0 10px; }
.academy-landing-hero p { color: rgba(255,255,255,0.85); font-size: 15px; line-height: 1.6; margin: 0 0 20px; max-width: 680px; }
.academy-landing-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.academy-stat { text-align: center; }
.academy-stat-num { display: block; font-size: 1.8rem; font-weight: 700; color: #fff; line-height: 1.2; }
.academy-stat-label { font-size: 12px; color: rgba(255,255,255,0.7); text-transform: uppercase; letter-spacing: 0.5px; }
.academy-cat-grid { display: flex; flex-wrap: wrap; gap: 12px; padding: 4px 0; }
.academy-cat-card { flex: 1 1 calc(50% - 12px); min-width: 300px; max-width: calc(50% - 6px);
  background: #e8f4fc; border: 1px solid #c5ddf0; border-radius: 6px;
  padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start;
  transition: border-color 0.2s, box-shadow 0.2s; color: inherit; }
.academy-cat-card:hover { border-color: #8bb8dc; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.academy-cat-card-icon { font-size: 28px; line-height: 1; flex-shrink: 0; padding-top: 2px; }
.academy-cat-card-body { flex: 1; min-width: 0; }
.academy-cat-card-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.academy-cat-card h3 { margin: 0; font-size: 15px; font-weight: bold; }
.academy-cat-card h3 span { color: #1a5b9e; }
.academy-cat-count { color: #666; font-size: 13px; white-space: nowrap; }
.academy-cat-desc { margin: 0; font-size: 13px; color: #333; line-height: 1.45; }

/* --- Category Index Page --- */
.academy-listing { max-width: 960px; margin: 0 auto; padding: 32px 24px; }
.academy-listing-hero { background: linear-gradient(135deg, #0d2744 0%, #1a5b9e 100%);
  color: #fff; padding: 28px 32px; border-radius: 8px; margin-bottom: 28px; }
.academy-listing-hero h1 { font-size: 1.8rem; font-weight: 700; margin: 0 0 8px; }
.academy-listing-hero p { color: rgba(255,255,255,0.85); font-size: 15px; line-height: 1.5; margin: 0; }
.academy-cat-meta-bar { margin-top: 12px; font-size: 13px; color: rgba(255,255,255,0.6); letter-spacing: 0.3px; }
.academy-rdl-callout { background: linear-gradient(135deg, #e8f0fe 0%, #d4e4f7 100%); border: 1px solid #b8cfe0; border-left: 5px solid #1a5b9e; border-radius: 8px; padding: 18px 22px; margin-bottom: 28px; font-size: 15px; line-height: 1.6; color: #1a365d; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.academy-rdl-callout-text { flex: 1; min-width: 200px; }
.academy-rdl-callout-btn { display: inline-block; background: #1a5b9e; color: #fff !important; padding: 9px 20px; border-radius: 5px; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background 0.2s; }
.academy-rdl-callout-btn:hover { background: #0d2744; text-decoration: none; }
.academy-cat-footer { margin-top: 32px; padding-top: 20px; border-top: 1px solid #e2e8f0; text-align: center; }
.academy-cat-footer a { color: #1a5b9e; text-decoration: none; font-size: 15px; font-weight: 500; }
.academy-cat-footer a:hover { text-decoration: underline; }

/* --- Sort Bar --- */
.academy-sort-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.academy-sort-label { font-size: 13px; color: #718096; font-weight: 500; }
.academy-sort-btn { background: #f0f4f8; border: 1px solid #e2e8f0; border-radius: 5px;
  padding: 5px 14px; font-size: 13px; color: #4a5568; cursor: pointer; font-weight: 500;
  transition: all 0.15s; font-family: inherit; }
.academy-sort-btn:hover { border-color: #1a5b9e; color: #1a5b9e; }
.academy-sort-btn.active { background: #1a5b9e; color: #fff; border-color: #1a5b9e; }

/* --- Article Cards (within category pages) --- */
.academy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.academy-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 0; overflow: hidden; transition: box-shadow 0.2s, transform 0.15s; text-decoration: none; display: block; }
.academy-card:hover { box-shadow: 0 6px 20px rgba(13,39,68,0.12); transform: translateY(-2px); }
.academy-card-img { width: 100%; height: 160px; object-fit: cover; background: #0d2744; display: block; }
.academy-card-body { padding: 16px 20px; }
.academy-card-cat { display: inline-block; background: #f0f4f8; color: #1a5b9e; font-size: 11px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; padding: 3px 10px;
  border-radius: 12px; margin-bottom: 8px; }
.academy-card-title { font-size: 17px; font-weight: 600; color: #0d2744; margin: 0 0 6px; line-height: 1.3; }
.academy-card-desc { font-size: 14px; color: #718096; line-height: 1.5; margin: 0; }
.academy-card-meta { display: flex; align-items: center; gap: 12px; margin-top: 12px;
  padding-top: 12px; border-top: 1px solid #f0f4f8; font-size: 12px; color: #a0aec0; }
.academy-card-meta span { display: flex; align-items: center; gap: 4px; }

/* --- Help Improve This Article (RDL-style) --- */
.rdl-meta-section { background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
  border: 1px dashed #cbd5e0; border-radius: 8px; padding: 24px; margin-top: 48px; }
.rdl-meta-section h2 { font-size: 1.3rem; color: #0d2744; margin-bottom: 8px; border-bottom: none !important;
  padding-bottom: 0 !important; }
.meta-desc { color: #4a5568; font-size: 14px; margin: 0 0 16px; }
.meta-actions { margin-bottom: 8px; }
.meta-login-prompt { color: #4a5568; font-size: 14px; margin: 0; }
.meta-login-prompt a { color: #1a5b9e; font-weight: 600; text-decoration: none; }
.meta-login-prompt a:hover { text-decoration: underline; }
.academy-improve-form textarea { width: 100%; min-height: 80px; max-height: 200px; padding: 10px 12px;
  border: 1px solid #ddd; border-radius: 6px; font-size: 14px; font-family: inherit;
  resize: vertical; box-sizing: border-box; }
.academy-improve-form textarea:focus { outline: none; border-color: #1a5b9e;
  box-shadow: 0 0 0 3px rgba(26,91,158,0.1); }
.academy-improve-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.btn-proceed { background: linear-gradient(135deg, #0a2d57 0%, #1a5b9e 100%); color: #fff; border: none;
  border-radius: 6px; padding: 10px 24px; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: all 0.15s; }
.btn-proceed:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(10,45,87,0.3); }
.btn-proceed:disabled { background: #ccc; cursor: not-allowed; transform: none; box-shadow: none; }
.academy-feedback-status { font-size: 13px; color: #4a5568; }
.modal-limit { margin: 10px 0 0; font-size: 12px; color: #888; }

/* --- Breadcrumb (reused on article + category pages) --- */
.academy-breadcrumb { font-size: 14px; margin-bottom: 16px; color: #718096; }
.academy-breadcrumb a { color: #1a5b9e; text-decoration: none; }
.academy-breadcrumb a:hover { text-decoration: underline; }
.academy-breadcrumb-sep { margin: 0 6px; color: #a0aec0; }

@media (max-width: 768px) {
  .academy-article h1 { font-size: 1.6rem; }
  .academy-toc ol { columns: 1; }
  .academy-main { padding: 16px; }
  .academy-landing { padding: 16px; }
  .academy-landing-hero { padding: 20px 24px; }
  .academy-landing-hero h1 { font-size: 1.5rem; }
  .academy-landing-stats { gap: 20px; }
  .academy-cat-grid { flex-direction: column; }
  .academy-cat-card { min-width: 100%; max-width: 100%; }
  .academy-listing { padding: 16px; }
  .academy-grid { grid-template-columns: 1fr; }
  .academy-listing-hero { padding: 20px; }
  .academy-listing-hero h1 { font-size: 1.4rem; }
}