/* Route-scoped studio backdrop. The original imagery is kept still; only the
   opacity blend follows the reader's natural document scroll. */
html:has(.student-backdrop) {
  min-height: 100%;
  background: #1e252b;
  scroll-behavior: auto;
}

body:has(.student-backdrop) {
  position: relative;
  isolation: isolate;
  background: transparent;
}

/* The shared design system paints the full student layout and each section
   with opaque charcoal. Let the fixed studio layer show through those shells
   while keeping their reading surfaces dark enough for sustained study. */
.student-backdrop ~ .student-layout {
  background: transparent !important;
}

.student-layout > .student-main {
  background: transparent;
}

body .student-layout .student-main > .dashboard-section {
  background: rgba(30, 37, 43, .58);
  border-color: transparent;
}

/* Keep the Sala de Estudo shell clear so its colored tool cards can reveal
   the studio backdrop beneath their own translucent surfaces. */
body .student-layout .student-main > #sala-de-estudo {
  background: transparent;
}

/* Keep the overview counters translucent and color only the inner content
   cards. This is scoped away from the Study Room tools. */
.student-layout .student-main > .overview-grid > .overview-card {
  background: rgba(30, 37, 43, .62);
}

/* Actual inner card selectors from area-do-aluno.ejs and its timeline partial.
   This sheet loads after area-do-aluno.css; specificity beats the later,
   generic design-system.css card backgrounds. */
body .student-layout .student-main .program-card.student-module-disclosure,
body .student-layout .student-main .timeline-item,
body .student-layout .student-main .student-library-video-card,
body .student-layout .student-main .student-library-support-grid > .student-material-card,
body .student-layout .student-main .locked-card.student-mentorship-card {
  background: #1E252B;
}

/* Encounter pages share the student area's layout geometry and studio wash. */
body .lesson-layout.student-layout {
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 248px;
  align-items: start;
  gap: clamp(28px, 4vw, 56px);
  padding: 60px 10%;
  background: transparent !important;
}

body .lesson-layout.student-layout > .lesson-main {
  min-width: 0;
  background: transparent;
}

body .lesson-layout.student-layout > .lesson-sidebar {
  top: 24px;
  width: 100%;
  padding: 24px 18px;
  border: 1px solid rgba(245, 242, 236, .12);
  border-radius: 18px;
  background: rgba(38, 45, 51, .78);
  box-shadow: none;
  backdrop-filter: blur(12px);
}

body .lesson-layout.student-layout > .lesson-sidebar .sidebar-logo {
  padding-bottom: 20px;
  margin-bottom: 20px;
}

body .lesson-layout.student-layout > .lesson-sidebar .sidebar-nav { gap: 6px; }
body .lesson-layout.student-layout > .lesson-sidebar .sidebar-nav a,
body .lesson-layout.student-layout > .lesson-sidebar .sidebar-nav button {
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 8px;
}

/* Matching translucent section shells and the graphite inner-card finish. */
body .lesson-layout.student-layout .lesson-highlight,
body .lesson-layout.student-layout .lesson-section,
body .lesson-layout.student-layout .mentor-notes,
body .lesson-layout.student-layout .next-steps,
body .lesson-layout.student-layout .lesson-completion {
  border-color: transparent;
  background: rgba(30, 37, 43, .58);
  box-shadow: none;
  backdrop-filter: blur(8px);
}

body .lesson-layout.student-layout .student-video-main,
body .lesson-layout.student-layout .student-video-card,
body .lesson-layout.student-layout .student-material-card,
body .lesson-layout.student-layout .mentor-notes,
body .lesson-layout.student-layout .next-steps {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 18px;
  background: #1E252B;
  box-shadow: none;
}

body .lesson-layout.student-layout .lesson-header h1 { font-size: clamp(2.5rem, 4vw, 4rem); }
body .lesson-layout.student-layout .section-header h2 { font-size: clamp(2rem, 3vw, 2.75rem); }

body .lesson-layout.student-layout .study-button:not(.completed),
body .lesson-layout.student-layout .student-material-card > a[href],
body .lesson-layout.student-layout .student-material-card > button {
  background-color: #173F63;
}

body .lesson-layout.student-layout .study-button:not(.completed):hover,
body .lesson-layout.student-layout .study-button:not(.completed):focus-visible,
body .lesson-layout.student-layout .study-button:not(.completed):active,
body .lesson-layout.student-layout .student-material-card > a[href]:hover,
body .lesson-layout.student-layout .student-material-card > a[href]:focus-visible,
body .lesson-layout.student-layout .student-material-card > a[href]:active,
body .lesson-layout.student-layout .student-material-card > button:hover,
body .lesson-layout.student-layout .student-material-card > button:focus-visible,
body .lesson-layout.student-layout .student-material-card > button:active {
  background-color: #173F63;
}

body .lesson-layout.student-layout .study-button:focus-visible,
body .lesson-layout.student-layout .student-material-card > a[href]:focus-visible,
body .lesson-layout.student-layout .student-material-card > button:focus-visible {
  outline: 2px solid #A9C7D8;
  outline-offset: 2px;
}

body .lesson-layout.student-layout > .lesson-sidebar .sidebar-nav a:hover,
body .lesson-layout.student-layout > .lesson-sidebar .sidebar-nav button:hover,
body .lesson-layout.student-layout > .lesson-sidebar .sidebar-nav a.active {
  background-color: #173F63;
}

@media (max-width: 900px) {
  body .lesson-layout.student-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding-top: 24px;
    padding-bottom: 24px;
  }
  body .lesson-layout.student-layout > .lesson-sidebar {
    position: relative;
    top: auto;
    order: -1;
    height: auto;
    padding: 16px;
  }
  body .lesson-layout.student-layout > .lesson-sidebar .sidebar-logo { display: none; }
  body .lesson-layout.student-layout > .lesson-sidebar .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (max-width: 768px) {
  body .lesson-layout.student-layout { padding-right: 5%; padding-left: 5%; }
  body .lesson-layout.student-layout .lesson-highlight,
  body .lesson-layout.student-layout .lesson-section,
  body .lesson-layout.student-layout .mentor-notes,
  body .lesson-layout.student-layout .next-steps { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  body .lesson-layout.student-layout .sidebar-nav a,
  body .lesson-layout.student-layout .sidebar-nav button { transition: none; }
}

.student-layout > .student-sidebar {
  background: rgba(38, 45, 51, .78) !important;
  backdrop-filter: blur(12px);
}

.student-backdrop {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  background: #1e252b;
  pointer-events: none;
}

.student-backdrop__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 54%;
  opacity: 0;
}

.student-backdrop__image[data-student-room="control"] { opacity: 1; }

.student-backdrop__grade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(16, 23, 28, .88) 0%, rgba(18, 25, 30, .72) 44%, rgba(18, 25, 30, .55) 100%),
    linear-gradient(0deg, rgba(15, 21, 26, .58), rgba(20, 29, 35, .18) 58%, rgba(15, 21, 26, .48));
}

.student-backdrop__edge {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 150px rgba(8, 13, 17, .38);
}

.student-backdrop ~ * {
  position: relative;
  z-index: 1;
}

@media (max-width: 760px) {
  .student-backdrop__image { object-position: 58% center; }
  .student-backdrop__grade {
    background:
      linear-gradient(90deg, rgba(16, 23, 28, .78), rgba(18, 25, 30, .48)),
      linear-gradient(0deg, rgba(15, 21, 26, .68), rgba(15, 21, 26, .27) 55%, rgba(15, 21, 26, .45));
  }
}

@media (prefers-reduced-motion: reduce) {
  html:has(.student-backdrop) { scroll-behavior: auto; }
}

/* Student navigation uses a short, legible state change rather than a broad
   transition on every property. */
.student-sidebar .sidebar-nav a,
.student-sidebar .sidebar-nav button {
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.student-sidebar .sidebar-nav a:focus-visible,
.student-sidebar .sidebar-nav button:focus-visible {
  outline: 2px solid #a9c7d8;
  outline-offset: 2px;
}

body .student-layout > .student-sidebar .sidebar-nav a:hover,
body .student-layout > .student-sidebar .sidebar-nav button:hover,
body .student-layout > .student-sidebar .sidebar-nav a.active {
  background-color: #173F63;
}

@media (hover: hover) and (pointer: fine) {
  .student-sidebar .sidebar-nav a:hover,
  .student-sidebar .sidebar-nav button:hover {
    transform: translateX(2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .student-sidebar .sidebar-nav a,
  .student-sidebar .sidebar-nav button {
    transition: none;
  }
  .student-sidebar .sidebar-nav a:hover,
  .student-sidebar .sidebar-nav button:hover {
    transform: none;
  }
}

/* Presidential Blue is limited to the six requested action types. These
   controls live in the dynamic module, meeting, library, and locked-module
   cards; Study Room controls are intentionally outside these selectors. */
body .student-layout .student-main .program-card.student-module-disclosure > .student-module-summary .student-card-toggle,
body .student-layout .student-main .timeline-item .timeline-content .timeline-action--presidential:not(.disabled),
body .student-layout .student-main .student-library-material-card .student-library-material-details > summary .student-card-toggle,
body .student-layout .student-main .student-library-material-card .library-action--presidential[href],
body .student-layout .student-main .locked-card.student-mentorship-card .locked-card-summary .student-card-toggle,
body .student-layout .student-main .locked-card.student-mentorship-card > .locked-card-action {
  background-color: #173F63;
}

body .student-layout .student-main .program-card.student-module-disclosure > .student-module-summary:hover .student-card-toggle,
body .student-layout .student-main .program-card.student-module-disclosure > .student-module-summary:active .student-card-toggle,
body .student-layout .student-main .timeline-item .timeline-content .timeline-action--presidential:not(.disabled):hover,
body .student-layout .student-main .timeline-item .timeline-content .timeline-action--presidential:not(.disabled):active,
body .student-layout .student-main .student-library-material-card .student-library-material-details > summary:hover .student-card-toggle,
body .student-layout .student-main .student-library-material-card .student-library-material-details > summary:active .student-card-toggle,
body .student-layout .student-main .student-library-material-card .library-action--presidential[href]:hover,
body .student-layout .student-main .student-library-material-card .library-action--presidential[href]:active,
body .student-layout .student-main .locked-card.student-mentorship-card .locked-card-summary:hover .student-card-toggle,
body .student-layout .student-main .locked-card.student-mentorship-card .locked-card-summary:active .student-card-toggle,
body .student-layout .student-main .locked-card.student-mentorship-card > .locked-card-action:hover,
body .student-layout .student-main .locked-card.student-mentorship-card > .locked-card-action:active {
  background-color: #173F63;
}
