/* ==========================================================================
   OCP Java 17 Prep — Views (Dashboard, Notes, TOC, Code, Tables)
   ========================================================================== */

.container {
  width: min(var(--container-max), calc(100% - 36px));
  margin: 0 auto;
}

main {
  padding: 22px 0 48px;
  min-height: calc(100vh - 130px);
}

/* Headings */
h1, h2, h3, h4 {
  color: var(--text);
  margin-top: 0;
}

h1 {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

h2 {
  font-size: var(--text-xl);
  font-weight: 650;
  letter-spacing: -0.015em;
  margin-bottom: 6px;
}

h3 {
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.view-head {
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 4px;
}

.lead {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
  margin: 0 0 16px;
  max-width: 52rem;
}

/* Dashboard Hero */
.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.hero h2 {
  font-size: 1.45rem;
  margin-bottom: 6px;
}

.hero p:not(.eyebrow) {
  color: var(--muted);
  margin: 0;
  font-size: 0.92rem;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 20px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

.stat strong {
  display: block;
  font-size: 1.65rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  margin-bottom: 2px;
}

.stat span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Section Heading */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 14px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.25rem;
}

/* Cards Grid */
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.cards > .card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ch-index {
  position: absolute;
  top: -6px;
  right: 8px;
  font-size: 3.5rem;
  font-weight: 800;
  color: rgba(79, 109, 245, 0.08);
  pointer-events: none;
  user-select: none;
  line-height: 1;
}

.cards h2 {
  font-size: 1.05rem;
  margin-bottom: 4px;
  max-width: 16ch;
}

.cards .card .small {
  margin-bottom: 6px;
}

.small {
  font-size: 0.82rem;
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.link-list,
.history {
  list-style: none;
  padding: 0;
  margin: 0;
}

.link-list li,
.history {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 0;
  font-size: 0.88rem;
}

.link-list li:last-child {
  border-bottom: 0;
}

.history span {
  color: var(--muted);
  font-size: 0.82rem;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: 16px 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs a {
  padding: 8px 14px;
  text-decoration: none;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.tabs a:hover {
  color: var(--text);
  text-decoration: none;
}

.tabs a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* Chapter Notes Layout */
.notes-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 24px;
}

.notes-layout > *,
.cards > *,
.stats > *,
.split > *,
.trap-list > *,
.checklist > *,
.cheatsheet > * {
  min-width: 0;
}

.toc {
  align-self: start;
  position: sticky;
  top: 76px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
}

.toc h3 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 8px;
}

.toc a {
  display: block;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
  transition: all 0.15s ease;
}

.toc a:hover {
  color: var(--text);
  background: var(--surface-hover);
  text-decoration: none;
}

.toc a.read {
  color: var(--success);
}

.note {
  margin-bottom: 18px;
}

.note-content {
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.note-content p {
  margin: 0 0 12px;
}

.note-content h3 {
  margin: 16px 0 8px;
  font-size: 1.05rem;
  color: var(--text);
}

/* Highlighter in study content */
.note strong,
.gotcha strong,
.trap strong,
.cheatsheet strong,
.flashcard strong,
.lead strong {
  background: var(--hl);
  border-radius: 3px;
  padding: 1px 4px;
  font-weight: 600;
  color: var(--text);
}
/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding: 18px 0;
  margin-top: 36px;
  color: var(--muted);
  font-size: 0.82rem;
}

/* Responsive */
@media (max-width: 860px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .notes-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .toc {
    position: static;
  }
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 580px) {
  .cards,
  .stats,
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
  .footer {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}
