/* Assignment page styling — matches tulasimohan.github.io */
:root {
  --bits-blue-dark: #2b2b88;
  --bits-blue-light: #5ccae8;
  --bits-gold: #fecc0b;
  --bits-red: #d71920;
  --body-color: #333;
}

body {
  font-family: "Heliotrope", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--body-color);
  line-height: 1.6;
  background:
    radial-gradient(circle at 10% 20%, rgba(253, 185, 19, 0.04) 0%, transparent 25%),
    radial-gradient(circle at 90% 80%, rgba(207, 32, 39, 0.04) 0%, transparent 25%),
    radial-gradient(circle at 50% 50%, rgba(92, 202, 232, 0.04) 0%, transparent 40%);
  background-attachment: fixed;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  margin: 0 auto;
  padding: 2rem;
}

body:not(.index-page) {
  max-width: 1000px;
}

.index-page {
  max-width: 1200px;
  padding: 1rem 2rem;
}

/* ─── Allow code selection ─── */
pre, code, .sourceCode {
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
}

/* ─── Typography ─── */
h1, h2, h3, h4 {
  font-family: "Heliotrope", "Inter", sans-serif;
  color: var(--bits-blue-dark);
  font-weight: 700;
}

h1 { font-size: 1.6rem; margin: 0; }
h2 {
  font-size: 1.15rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  border-bottom: 2px solid #eee;
  padding-bottom: 0.4rem;
  font-weight: 700;
  color: var(--bits-blue-dark);
}

a {
  color: var(--bits-blue-dark);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover { color: var(--bits-red); }

/* ─── Hero ─── */
.assignment-hero {
  margin-bottom: 1.5rem;
}
.hero-title {
  font-family: "Heliotrope", "Inter", sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--bits-blue-dark);
  margin: 0;
  line-height: 1.2;
}
.hero-subtitle {
  font-size: 0.9rem;
  color: #666;
  margin: 0.2rem 0 0 0;
}
.hero-term {
  display: inline-block;
  background: var(--bits-blue-dark);
  color: #fff;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  margin-left: 0.5rem;
  vertical-align: middle;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ─── Info strip ─── */
.info-strip {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.info-item {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 0.4rem 0.7rem;
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  flex: 1;
  min-width: 100px;
}
.info-item strong {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #999;
  margin-bottom: 0.1rem;
}
.info-item span {
  color: var(--body-color);
  font-weight: 600;
}

/* ─── Steps grid ─── */
.steps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin: 0.5rem 0;
}
.step-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: transform 0.2s, box-shadow 0.2s;
}
.step-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}
.step-num {
  background: var(--bits-blue-dark);
  color: #fff;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.step-text {
  font-size: 0.85rem;
  line-height: 1.4;
  color: #444;
}
.step-text code {
  font-size: 0.8em;
  background: #f0f0f0;
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
}

/* ─── Note box ─── */
.note-box {
  background: rgba(254, 204, 11, 0.08);
  border-left: 3px solid var(--bits-gold);
  padding: 0.5rem 0.8rem;
  font-size: 0.82rem;
  color: #666;
  border-radius: 0 4px 4px 0;
  margin: 1rem 0;
}

/* ─── Problem cards ─── */
.problem-cards {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.problem-card {
  display: flex;
  align-items: stretch;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  text-decoration: none;
  color: inherit;
}
.problem-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 12px rgba(0,0,0,0.08);
  border-color: var(--bits-blue-light);
  color: inherit;
}
.card-label {
  background: var(--bits-blue-dark);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  flex-shrink: 0;
}
.card-body {
  padding: 0.6rem 0.8rem;
  flex: 1;
}
.card-title {
  font-family: "Heliotrope", "Inter", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--bits-blue-dark);
  margin-bottom: 0.05rem;
}
.card-meta {
  font-size: 0.72rem;
  color: var(--bits-red);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 0.15rem;
}
.card-desc {
  font-size: 0.82rem;
  color: #666;
  line-height: 1.4;
}

/* ─── Problem statement pages ─── */
.callout {
  margin: 0.5rem 0 !important;
  padding: 0.35rem 0.6rem 0.35rem 0.8rem !important;
  border-radius: 0 4px 4px 0 !important;
  border-left-width: 3px !important;
  font-size: 0.9rem !important;
}
.callout .callout-header {
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  padding: 0 !important;
  margin: 0 0 0.1rem 0 !important;
  background: transparent !important;
  border: none !important;
}
.callout .callout-body { padding: 0 !important; margin: 0 !important; }
.callout .callout-body p { margin: 0.1rem 0 !important; line-height: 1.5 !important; }
.callout .callout-icon { display: none !important; }

.callout-note {
  border-left-color: var(--bits-blue-dark) !important;
  background: rgba(43, 43, 136, 0.04) !important;
}
.callout-note .callout-header { color: var(--bits-blue-dark) !important; }
.callout-tip {
  border-left-color: var(--bits-blue-light) !important;
  background: rgba(92, 202, 232, 0.06) !important;
}
.callout-tip .callout-header { color: #2a8fa8 !important; }
.callout-important {
  border-left-color: var(--bits-red) !important;
  background: rgba(215, 25, 32, 0.04) !important;
}
.callout-important .callout-header { color: var(--bits-red) !important; }

/* ─── Tables ─── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0;
  font-size: 0.9rem;
}
th, td {
  padding: 0.4rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
}
th { background: #f5f5f5; font-weight: 600; }

/* ─── Code blocks ─── */
pre {
  background: #f8f9fa;
  border: 1px solid #e5e5e5;
  border-radius: 5px;
  padding: 0.6rem 0.8rem;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.4;
  margin: 0.25rem 0;
}
code {
  background: #f0f0f0;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.88em;
}
pre code { background: none; padding: 0; }

img {
  pointer-events: none;
  -webkit-touch-callout: none;
  max-width: 100%;
}

/* ─── Tooltip ─── */
.tooltip-item {
  position: relative;
  cursor: help;
}
.tooltip-item .tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: 50%;
  left: calc(100% + 10px);
  transform: translateY(-50%);
  background: var(--bits-blue-light);
  color: #fff;
  font-size: 0.72rem;
  line-height: 1.4;
  padding: 0.5rem 0.6rem;
  border-radius: 5px;
  white-space: normal;
  width: 220px;
  text-align: center;
  font-weight: 400;
  z-index: 10;
  transition: opacity 0.2s, visibility 0.2s;
  pointer-events: none;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}
.tooltip-item .tooltip-text::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 100%;
  margin-top: -5px;
  border: 5px solid transparent;
  border-right-color: var(--bits-blue-light);
}
.tooltip-item:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* ─── Utility ─── */
#quarto-content h2 { border-bottom: 2px solid #eee !important; }
.back-link { font-size: 0.85rem; margin-bottom: 0.5rem; display: block; }

/* ─── Hide Quarto default title block on index pages ─── */
.index-page header.quarto-title-block.default {
  display: none;
}
