/* =========================================================
   students — page-specific styles  →  assets/css/students.css
   Global styles live in assets/css/main.css
   ========================================================= */

/* ── Page header (shared .page-header styles live in main.css) ── */
/* ── Section layout (sidebar + main) ──────────────────── */
.student-top-nav {
  display: none;
  position: sticky;
  top: 68px;
  z-index: 400;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.student-top-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.5rem 1.25rem;
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.student-top-nav-inner::-webkit-scrollbar { display: none; }

.student-top-nav-link {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
  color: var(--text-2);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.45rem 0.85rem;
  border-radius: 3px;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.student-top-nav-link:hover { color: var(--text); }
.student-top-nav-link.active {
  color: var(--teal-bright);
  background: rgba(43, 138, 138, 0.08);
}

.student-wrap {
  display: flex;
  gap: 0;
  max-width: 1400px;
  margin: 0 auto;
  min-height: 0;
}

.student-sidebar {
  width: 200px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 2rem 0;
}

.student-sidebar .sidebar-sticky {
  position: sticky;
  top: 88px;
}

.student-section-link {
  display: block;
  width: 100%;
  text-align: left;
  text-decoration: none;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  padding: 0.6rem 1.25rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.72rem;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
}

.student-section-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.student-section-link.active {
  color: var(--teal-bright);
  border-left-color: var(--teal);
  background: rgba(43, 138, 138, 0.06);
}

.student-section-link.has-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sub-caret {
  flex-shrink: 0;
  width: 0;
  height: 0;
  border-left: 4px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  opacity: 0.5;
  transition: transform 0.18s ease;
}

.student-section-link[aria-expanded="true"] .sub-caret {
  transform: rotate(90deg);
  opacity: 0.85;
}

/* Collapsible sub-lists under "General guidelines" and "Find your task" */
.student-sublist {
  display: flex;
  flex-direction: column;
  padding: 0.1rem 0 0.35rem;
}

.student-sublist[hidden] { display: none; }

.student-sublink {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  padding: 0.32rem 1.25rem 0.32rem 2rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.66rem;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s;
}

.student-sublink:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.student-sublink.active {
  color: var(--teal-bright);
  border-left-color: var(--teal);
  background: rgba(43, 138, 138, 0.06);
}

.student-main {
  flex: 1;
  min-width: 0;
}

.student-main .student-section {
  padding: 3rem 2.25rem;
  scroll-margin-top: 88px;
}

.student-main .student-section-inner {
  max-width: none;
  margin: 0;
}

/* Section views — one visible at a time, switched via the TOC */
.student-main .student-section { display: none; }
.student-main .student-section.active { display: block; }

/* ── Sections ─────────────────────────────────────────── */
.student-section {
  padding: 3.5rem 2rem;
}

.student-section--alt {
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.student-section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.section-header {
  margin-bottom: 2rem;
}

.section-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--text);
  margin-bottom: 0.4rem;
}

.section-desc {
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.65;
  max-width: 36rem;
}

/* ── Task Cards ───────────────────────────────────────── */
.task-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.5rem;
  position: sticky;
  top: 78px;             /* below .site-nav (renders ~78px tall on desktop) */
  z-index: 300;          /* under .student-top-nav (400) and .site-nav (500) */
  background: var(--bg);
  padding: 0.5rem 0;
}

.task-cards-grid.task-bar--stuck {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 0.4rem;
  border-bottom: 1px solid var(--border);
}

.task-cards-grid.task-bar--stuck::-webkit-scrollbar { display: none; }

.task-bar--stuck .task-card {
  flex: 0 0 auto;
  width: auto;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  flex-direction: row;
  align-items: center;
}

.task-bar--stuck .task-card-sub { display: none; }
.task-bar--stuck .task-card-head { margin-bottom: 0; }
.task-bar--stuck .task-card-title { white-space: nowrap; font-size: 0.72rem; }

/* Desktop: the sidebar sub-links replace the task cards; the grid stays mobile-only */
@media (min-width: 769px) {
  .task-cards-grid,
  .task-cards-grid.task-bar--stuck { display: none; }
}

.task-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.15rem;
  cursor: pointer;
  color: inherit;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  font-family: 'Poppins', sans-serif;
}

.task-card:hover {
  border-color: var(--border-teal);
  transform: translateY(-1px);
}

.task-card.active {
  border-color: var(--teal);
  background: rgba(43, 138, 138, 0.08);
  box-shadow: 0 0 0 1px rgba(43, 138, 138, 0.15);
}

.task-card-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.25rem;
  width: 100%;
}

.task-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

.task-card-sub {
  font-size: 0.68rem;
  color: var(--text-3);
  line-height: 1.45;
}

.task-panels {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-1);
  overflow: hidden;
  scroll-margin-top: 96px;
}

.task-panel {
  display: none;
  padding: 2rem 2.25rem 2.5rem;
}

.task-panel.active {
  display: block;
}

.task-panel-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.75rem;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.task-panel-sub {
  font-size: 0.72rem;
  color: var(--text-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1.75rem;
}

.task-panel-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.risk-box--light {
  margin-top: 1rem;
}

.prompt-note {
  margin: 0 0 0.5rem;
  padding-left: 0.7rem;
  border-left: 2px solid rgba(252, 67, 117, 0.5);
  font-size: 0.74rem;
  line-height: 1.6;
  color: var(--text-2);
  max-width: 44rem;
}

.student-disclaimer {
  background: rgba(252, 67, 117, 0.06);
  border: 1px solid rgba(252, 67, 117, 0.2);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  font-size: 0.76rem;
  color: var(--text-2);
  line-height: 1.65;
  margin-bottom: 1.25rem;
  max-width: 42rem;
}

.prompt-status-chip {
  display: inline-block;
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.18rem 0.5rem;
  border-radius: 3px;
  vertical-align: middle;
}

.prompt-status-chip--independent {
  background: rgba(43, 138, 138, 0.1);
  color: var(--teal-bright);
  border: 1px solid var(--border-teal);
}

.prompt-status-chip--permission {
  background: rgba(201, 162, 39, 0.12);
  color: #c9a227;
  border: 1px solid rgba(201, 162, 39, 0.4);
}

.disclosure-template {
  margin-bottom: 1.75rem;
}

.disclosure-template-desc {
  font-size: 0.75rem;
  color: var(--text-2);
  line-height: 1.6;
  margin: 0.25rem 0 0.65rem;
}

.task-external-tools {
  margin-top: 1rem;
}

.task-external-tools-label {
  display: block;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.5rem;
}

.task-external-tools-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.task-external-tools-list li {
  margin-bottom: 0.65rem;
  padding-left: 0;
}

.task-external-tools-list li:last-child {
  margin-bottom: 0;
}

.task-external-tools-list a {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--teal-bright);
  text-decoration: none;
  transition: color 0.2s;
}

.task-external-tools-list a:hover {
  color: var(--pink);
  text-decoration: underline;
}

.task-external-tools-desc {
  display: block;
  font-size: 0.72rem;
  color: var(--text-2);
  line-height: 1.55;
  margin-top: 0.15rem;
}

/* Do / Don't grid */
.do-dont-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.do-col,
.dont-col {
  border-radius: 8px;
  padding: 1rem 1.15rem;
}

.do-col {
  background: rgba(43, 138, 138, 0.06);
  border: 1px solid rgba(43, 138, 138, 0.2);
}

.dont-col {
  background: rgba(252, 67, 117, 0.04);
  border: 1px solid rgba(252, 67, 117, 0.15);
}

.do-dont-label {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.do-label { color: var(--teal-bright); }
.dont-label { color: var(--pink); }

.do-dont-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.do-dont-list li {
  font-size: 0.76rem;
  color: var(--text-2);
  line-height: 1.55;
  padding-left: 1rem;
  position: relative;
  margin-bottom: 0.4rem;
}

.do-col .do-dont-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--teal);
  font-size: 0.7rem;
}

.dont-col .do-dont-list li::before {
  content: "\00D7";
  position: absolute;
  left: 0;
  color: var(--pink);
  font-size: 0.85rem;
}

.task-prompts-wrap {
  margin-top: 0.5rem;
}

.task-prompt-item {
  margin-top: 1rem;
}

.task-prompt-item .prompt-block {
  font-size: 0.76rem;
  padding: 1.75rem 1.25rem 1rem;
}

/* ── Scenario Carousel ────────────────────────────────── */
.scenario-filter-row {
  margin-bottom: 1.25rem;
}

.scenario-carousel {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.scenario-track-wrap {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-radius: 10px;
}

.scenario-track-wrap::-webkit-scrollbar { display: none; }

.scenario-track {
  display: flex;
}

.scenario-card {
  flex: 0 0 100%;
  scroll-snap-align: start;
  box-sizing: border-box;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--teal);
  border-radius: 0 10px 10px 0;
  padding: 1.35rem 1.5rem;
  transition: border-left-color 0.2s, box-shadow 0.2s;
}

.scenario-card[hidden] {
  display: none !important;
}

.student-section--alt .scenario-card {
  background: var(--bg-2);
}

.scenario-card--active {
  border-left-color: var(--teal-bright);
}

.scenario-nav {
  flex-shrink: 0;
  align-self: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-1);
  color: var(--text-2);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.scenario-nav:hover {
  border-color: var(--teal);
  color: var(--teal-bright);
  background: rgba(43, 138, 138, 0.08);
}

.scenario-counter {
  text-align: center;
  font-size: 0.68rem;
  color: var(--text-3);
  margin-top: 0.85rem;
  letter-spacing: 0.06em;
}

.scenario-persona {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-bright);
  margin-bottom: 0.5rem;
}

.scenario-context {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.scenario-detail {
  margin-bottom: 0.75rem;
}

.scenario-detail-label {
  display: block;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.25rem;
}

.scenario-detail p {
  font-size: 0.76rem;
  color: var(--text-2);
  line-height: 1.6;
  margin: 0;
}

.scenario-detail--good .scenario-detail-label { color: var(--teal); }
.scenario-detail--bad .scenario-detail-label { color: var(--pink); }

/* ── Prompt Library ───────────────────────────────────── */
.prompt-filters {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.filter-group-label {
  display: block;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.5rem;
}

.prompt-filter-row {
  margin-bottom: 0;
}

.prompt-library-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.prompt-library-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.15rem 1.25rem 1.25rem;
}

.prompt-library-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.prompt-meta-chip {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  background: rgba(43, 138, 138, 0.1);
  color: var(--teal-bright);
  border: 1px solid var(--border-teal);
}

.prompt-meta-chip--intent {
  background: rgba(123, 162, 63, 0.1);
  color: var(--beige);
  border-color: var(--beige-border);
}

.prompt-block--compact {
  font-size: 0.72rem;
  padding: 1.65rem 1rem 0.85rem;
  margin-bottom: 0.65rem;
}

.prompt-why {
  font-size: 0.72rem;
  color: var(--text-2);
  line-height: 1.55;
  margin: 0;
}

.prompt-why strong {
  color: var(--text);
  font-weight: 500;
}

[data-theme="light"] .task-card.active {
  background: rgba(43, 138, 138, 0.06);
}

/* Hidden state for filtered prompts / scenarios */
.prompt-library-card[hidden],
.scenario-card[hidden] {
  display: none !important;
}

/* Undergrad page responsive */
@media (max-width: 1024px) {
  .task-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .student-sidebar { width: 170px; }
}

@media (max-width: 768px) {
  .student-top-nav { display: block; }
  .student-sidebar { display: none; }
  .student-wrap { flex-direction: column; max-width: none; }
  .student-main .student-section { padding: 2.5rem 1.25rem; scroll-margin-top: 120px; }
  .task-cards-grid { grid-template-columns: repeat(2, 1fr); top: 116px; }  /* below the sticky section pill bar (bottom ≈116px) */
  .task-panel { padding: 1.5rem 1.25rem 2rem; }
  .task-panel-cols,
  .do-dont-grid { grid-template-columns: 1fr; gap: 1rem; }
  .prompt-library-grid { grid-template-columns: 1fr; }
  .scenario-nav { width: 2rem; height: 2rem; font-size: 1.1rem; }
}

@media (max-width: 480px) {
  .student-main .student-section { padding: 2rem 1rem; }
  .task-cards-grid { grid-template-columns: 1fr; }
  .task-card { padding: 0.85rem 1rem; }
  .task-panel { padding: 1.25rem 1rem 1.75rem; }
  .student-section .section-title { font-size: clamp(1.4rem, 5vw, 1.8rem); }
  .scenario-nav--prev { margin-left: -0.25rem; }
  .scenario-nav--next { margin-right: -0.25rem; }
}


/* ── Right rail — standing reminders + the open task's cautions ──────────
   Deliberately borderless on the left: the reviewer wanted no divider
   between the main column and the rail. */
.student-rail {
  width: 260px;
  flex-shrink: 0;
  /* no vertical padding: .rail-sticky sets its own top and height so the
     content centres against the divider rather than against the padding */
  padding: 0 0 0 2.25rem;
}

/* Sticky box spans the viewport below the site nav. Because it is sticky
   rather than transformed, it can never ride up over the page-header rule —
   at the top of the page it starts at the divider and centres in what is
   visible below it. */
.rail-sticky {
  position: sticky;
  top: 88px;
  height: calc(100vh - 88px);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* auto margins centre the content, and collapse to 0 when it is taller than
   the box — so tall rails start at the top and scroll instead of clipping */
.rail-inner {
  margin-block: auto;
  width: 100%;
}

.rail-reminder,
.rail-risks {
  display: none;
}

.rail-reminder.active,
.rail-risks.active {
  display: block;
  animation: railFade 0.25s ease;
}

@keyframes railFade {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

.rail-label {
  font-family: 'Poppins', sans-serif;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 0.6rem;
}

.rail-reminder {
  border-left: 2px solid #c9a227;
  padding-left: 0.9rem;
  margin-bottom: 2rem;
}

.rail-reminder-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1rem;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 0.45rem;
}

.rail-reminder-body {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.65;
  color: var(--text-2);
}

.rail-label--risks {
  color: #fc4375;
}

.rail-risk-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rail-risk-list li {
  position: relative;
  padding-left: 0.9rem;
  margin-bottom: 0.85rem;
  font-size: 0.76rem;
  line-height: 1.6;
  color: var(--text-2);
}

.rail-risk-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fc4375;
}

/* ── General guidelines ─────────────────────────────────────────────── */
/* No max-width: the guidelines body matches the task panels' full column
   width so the three columns read identically across both views. */
.guidelines-body {
  max-width: none;
}

/* The intro line sits above that body, so it shares its width rather than
   the narrower default measure used by the other sections. */
#general-guidelines .section-desc {
  max-width: none;
}

.guideline-block + .guideline-block {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.guideline-heading {
  font-family: 'DM Serif Display', serif;
  font-size: 1.35rem;
  color: var(--text);
  margin: 0 0 0.9rem;
}

.guideline-block p {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--text-2);
}

.guideline-block p:last-child {
  margin-bottom: 0;
}

.guideline-block a {
  color: var(--teal-bright);
  font-weight: 600;
  text-decoration: none;
}

.guideline-block a:hover {
  text-decoration: underline;
}

/* ── Rail responsive: below ~1024px it joins the flow under the main
   column rather than sitting beside it. ─────────────────────────────── */
@media (max-width: 1180px) {
  .student-rail { width: 220px; padding-left: 1.5rem; }
}

@media (max-width: 1024px) {
  .student-wrap { flex-wrap: wrap; }
  .student-rail {
    width: 100%;
    order: 3;
    /* left inset matches the sidebar so the rail lines up with the main column */
    padding: 0 2.25rem 3rem calc(170px + 2.25rem);
  }
  .rail-sticky {
    position: static;
    height: auto;
    display: block;
    overflow-y: visible;
  }
  .rail-inner { margin-block: 0; }
  .rail-reminder { margin-bottom: 1.5rem; }
}

@media (max-width: 768px) {
  .student-rail { padding: 0 1.25rem 2.5rem; }
}

@media (max-width: 480px) {
  .student-rail { padding: 0 1rem 2rem; }
}


.student-guideline-sublink {
  line-height: 1.45;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.guideline-block {
  scroll-margin-top: 104px;
}
