/* Sticky footer styles
-------------------------------------------------- */
html {
  position: relative;
  min-height: 100%;
  overflow-x: hidden;
}
body {
  /* Margin bottom by footer height */
  margin-bottom: 60px;
  /* Safety net: the schedule page's per-week calendar grid scrolls
     horizontally inside its own .grid-wrap container on narrow screens;
     this guarantees the page itself never does. */
  overflow-x: hidden;
}
.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  /* Set the fixed height of the footer here */
  height: 60px;
  line-height: 60px; /* Vertically center the text there */
  background-color: #004455;
}


/* Custom page CSS
-------------------------------------------------- */
/* Not required for template or sticky footer method. */

body > .container {
  padding: 30px 15px 0;
}

.footer > .container {
  padding-right: 15px;
  padding-left: 15px;
}

code {
  font-size: 80%;
}

/*----------------------------------------------*/

.week {
    font-size: 16pt;
    text-align: center;
    color: white;
    background-color: #004455;
    border: 0px;
    border-left: 6px solid #2AAEEF!important;
    border-right: 6px solid #2AAEEF!important;
    /* Unit banners (e.g. #unit-2) are direct-linkable; keep them clear of the
       fixed navbar + sticky schedule control bar when jumped to via anchor. */
    scroll-margin-top: calc(var(--nav-height, 56px) + 70px);
}

.compact-ul {
    margin-bottom: 0pt;
}

.staff-photo {
    width: 100%;
    max-width: 220px;
    height: 260px;
    object-fit: cover;
}

.non-lecture {
    background-color: #edf4f6;
}

.clicker_alert {
    top: 40%;
    left: 10%;
    width: 80%;
    position:fixed;
}

.center_fixed_text {
    top: 40%;
    left: 10%;
    width: 80%;
    position:fixed;
    text-align: center;
}

.prettyprint {
    background-color: white;
}

.popover{
    max-width:800px;
}

pre.example {
    background-color: white;
    padding: 8pt;
    border-left: 4px #004455;
}

.bg-custom {
    background-color: #004455;
}

.bg-dark {
    background-color: #004455!important;
}

/* Bootstrap's default .navbar-dark .nav-link color (rgba(255,255,255,.5))
   contrasts at ~3.9:1 against our #004455 background, below the 4.5:1 AA
   minimum for normal text. Use full-opacity white and an underline (instead
   of an opacity shift) to distinguish hover/focus state. */
.navbar-dark .navbar-nav .nav-link,
.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
    color: #ffffff;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
    text-decoration: underline;
}

/* The navbar is fixed-top (z-index 1030 in Bootstrap), so the skip link
   needs its own fixed position + higher z-index to be visible above it
   when focused, rather than being covered. */
.sr-only-focusable:focus {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    padding: 0.75rem 1rem;
    background-color: #004455;
    color: #ffffff;
}

/* Schedule page: Mon–Fri calendar, section toggle, cookie-remembered section
-------------------------------------------------- */

.schedule-controlbar {
    position: sticky;
    top: var(--nav-height, 56px);
    z-index: 20;
    background: #ffffff;
    border-bottom: 1px solid #d8e2e5;
    box-shadow: 0 1px 2px rgba(10, 30, 36, 0.06), 0 4px 10px rgba(10, 30, 36, 0.05);
    padding: 0.65rem 0.85rem;
    margin: 0 -15px 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.section-toggle {
    display: inline-flex;
    border: 1px solid #b9c8cc;
    border-radius: 999px;
    padding: 3px;
    background: #eef1f2;
    gap: 2px;
}

.section-toggle-btn {
    font-weight: 600;
    font-size: 0.9rem;
    border: 0;
    background: transparent;
    color: #4c6069;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.section-toggle-btn[aria-pressed="true"] {
    background: #004455;
    color: #ffffff;
}

.section-toggle-btn:focus-visible {
    outline: 2px solid #2AAEEF;
    outline-offset: 2px;
}

.section-toggle-btn:not([aria-pressed="true"]):hover {
    color: #16262b;
}

.schedule-legend {
    display: flex;
    gap: 1rem;
    margin-left: auto;
    font-size: 0.78rem;
    color: #4c6069;
    flex-wrap: wrap;
}

.schedule-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    border: 1px solid #b9c8cc;
    display: inline-block;
}

.legend-swatch.lecture { background: #ffffff; }
.legend-swatch.non-lecture { background: #e3f2f7; }
.legend-swatch.empty { background: #e2e0db; border-style: dashed; }

.day-header-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(180px, 1fr));
    gap: 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #4c6069;
    padding: 0 0 0.3rem;
}

.grid-wrap {
    overflow-x: auto;
    padding-bottom: 2px;
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(180px, 1fr));
    gap: 0.6rem;
    align-items: stretch;
}

.day-cell {
    border: 1px solid #d8e2e5;
    border-radius: 6px;
    background: #ffffff;
    padding: 0.65rem 0.75rem 0.8rem;
    min-height: 3.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.day-cell.non-lecture { background: #e3f2f7; }

.day-cell.empty {
    background: #e2e0db;
    border-style: dashed;
    color: #4c6069;
    align-items: center;
    justify-content: center;
    min-height: 3.2rem;
}

.day-cell.empty .empty-label {
    font-size: 0.74rem;
    letter-spacing: 0.03em;
}

.day-cell.today {
    border-color: #2AAEEF;
    box-shadow: 0 0 0 1px #2AAEEF;
}

/* A day carrying both a fixed calendar fact (release/due/exam) and that
   week's lecture for the active section: the lecture gets an inset card so
   it still reads as the day's main event, the fixed fact sits below it as a
   dashed-off addendum, so the overlap stays visible instead of hidden. */
.day-cell.mixed { background: #e3f2f7; }

.day-cell.mixed .block-lecture {
    background: #ffffff;
    border: 1px solid #b9c8cc;
    border-radius: 5px;
    padding: 0.5rem 0.6rem;
}

.day-cell.mixed .block-fixed {
    border-top: 1px dashed #b9c8cc;
    padding-top: 0.45rem;
}

.block-eyebrow {
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #4c6069;
    margin-bottom: 0.15rem;
}

.cell-date {
    font-variant-numeric: tabular-nums;
    font-size: 0.72rem;
    color: #4c6069;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.cell-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #16262b;
    margin: 0;
    line-height: 1.3;
}

.cell-body {
    font-size: 0.82rem;
    color: #333f43;
}

.cell-body ul.compact-ul {
    margin: 0.3rem 0;
    padding-left: 1.1rem;
}

.cell-body li {
    margin-bottom: 0.15rem;
}

@media (max-width: 560px) {
    .schedule-controlbar {
        padding: 0.6rem 0.75rem;
    }
    .schedule-legend {
        display: none;
    }
}
