/* course page styles (course.php) */

/* The side picture and the info-box style are shared with the teaching page,
   so they stay in teaching-styles.css, loaded here. */
@import url("./teaching-styles.css");

/* =====================================================================
   CALENDAR AND EVENT COLOURS: change them here
   ---------------------------------------------------------------------
   Homework dates are yellow, tests (quiz, midterm, final) are red,
   anything else is grey. "ink" is the colour of the text written on top.
   ===================================================================== */
:root {
  --cal-homework: hsl(48, 96%, 53%); /* yellow */
  --cal-homework-ink: hsl(0, 0%, 12%);
  --cal-test: hsl(0, 72%, 47%); /* red */
  --cal-test-ink: hsl(0, 0%, 100%);
  --cal-other: hsl(217, 8%, 40%); /* grey: holidays and any other type */
  --cal-other-ink: hsl(0, 0%, 100%);
  --cal-quiz: hsl(173, 73%, 42%);
  --cal-quiz-ink: hsl(0, 0%, 12%);
  --cal-ink: hsl(0, 0%, 12%);

  --cal-today: hsl(224, 76%, 48%); /* ring around today */
  --cal-line: rgba(128, 128, 128, 0.3); /* grid lines */
  --cal-day-background1: hsla(0, 0%, 0%, 0.8);
  --cal-day-background2: hsla(0, 0%, 100%, 0.8);
  --cal-day-background-other: hsla(0, 0%, 100%, 0.8);
  --text-shadow-colour1: hsla(0, 13%, 71%, 0.5);
  --text-shadow-colour2: hsla(0, 5%, 41%, 0.5);
  --text-shadow-colour-other: hsla(0, 3%, 36%, 0.5);

  --colour-border-next: hsl(0, 84%, 43%);

  --colour-link-hover: hsl(228, 100%, 33%);

  /* google classroom link colours */
  --colour-gclass: hsl(0, 0%, 100%);
  --colour-border-gclass: hsl(28, 71%, 58%);
  --colour-background-gclass: hsla(120, 58%, 40%, 0.8);
  --colour-border-gclass-hover: hsl(0, 0%, 37%);
  --colour-gclass-hover: hsla(0, 0%, 0%, 0.8);
  --colour-background-gclass-hover: hsla(120, 58%, 59%, 0.8);

  /* back button */
  --colour-boder-back-button: hsl(0, 0%, 0%);
  --colour-background-back-button: hsla(38, 40%, 92%, 0.8);

  /* calendar */
}

:root.dark {
  --cal-today: hsl(215, 90%, 68%);
  --cal-ink: hsl(0, 0%, 84%);
  --colour-link-hover: hsl(229, 56%, 67%);

  /* back button */
  --colour-boder-back-button: hsl(0, 0%, 99%);
  --colour-background-back-button: rgba(23, 37, 58, 0.8);
}

[id] {
  scroll-margin-top: 3.5rem; /* Replace 80px with the exact height of your sticky menu */
}

a:hover {
  color: var(--colour-link-hover);
}

.section-global {
  /* gap: 0.1rem; */
}

/* back button */
.course-back {
  font-weight: 600;
  font-size: 0.8rem;
  margin: 0.6rem;
}

.course-back-link {
  border-radius: var(--radius-md);
  color: var(--colour-link-menu);
  border: 0.1rem solid var(--colour-border-menu);
  background: var(--colour-background-back-button);
  padding: 0.2rem;
  box-shadow:
    -1px -1px 1px 0px var(--colour-shadow1),
    -1px -1px 1px 0px var(--colour-shadow2);
  transition: color var(--transition-fast);
}

.course-back-link:hover {
  opacity: 0.8;
  box-shadow:
    2px 2px 2px 0px var(--colour-shadow1),
    2px 2px 2px 0px var(--colour-shadow2);
}

.course-back-link:active {
  opacity: 1;
  box-shadow:
    1px 1px 0px 0px var(--colour-shadow1),
    1px 1px 0px 0px var(--colour-shadow2);
}

/* which colour each event type uses (a type that is not listed uses grey) */
.event--homework,
.event--project {
  --event-colour: var(--cal-homework);
  --event-ink: var(--cal-homework-ink);
  --event-shadow: var(--text-shadow-colour1);
  --event-day-background: var(--cal-day-background1);
}
.event--midterm,
.event--final-exam {
  --event-colour: var(--cal-test);
  --event-ink: var(--cal-test-ink);
  --event-shadow: var(--text-shadow-colour2);
  --event-day-background: var(--cal-day-background2);
}

.event--quiz {
  --event-colour: var(--cal-quiz);
  --event-ink: var(--cal-quiz-ink);
}

.event--quiz-close {
  --event-colour: var(--cal-quiz);
  --event-ink: var(--cal-quiz-ink);
}

/* a new type needs one rule, for example:
   .event--lab { --event-colour: hsl(190, 70%, 35%); --event-ink: white; } */

/* =====================================================================
   COURSE PAGE: sections
   ===================================================================== */
/* styles for course pages - common */
.course-page-title {
  font-size: 1rem;
  margin-top: 0.4rem;
}
.course-section {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 0.8rem;
}

/* announcements */
.announcement-list,
.homework-list,
.notes-list {
  list-style-position: outside;
  padding-left: 1.2rem;
}
.announcement-date {
  font-weight: 600;
  margin-right: 0.4rem;
}

/* shown under the heading when there is nothing to announce */
.announcement-empty {
  padding-left: 1.2rem; /* lines up with the text of the announcements */
  font-size: 0.85rem;
  opacity: 0.6;
}

/* homework */
.homework-link {
  text-decoration: underline;
}
.homework-link:hover {
  color: var(--colour-link-hover);
  text-decoration: underline;
}
.homework-item.past {
  opacity: 0.6;
  font-size: 0.8rem;
}
.homework {
  font-size: 0.8rem;
}

/* midterm and final content */
/* .test-head {
} */
.test-list {
  list-style-type: none;
  list-style-position: inside;
  padding-left: 0.8rem;
}
.test-item {
  font-size: 1rem;
}

.topics-list {
  list-style-type: circle;
  list-style-position: inside;
  padding-left: 0.8rem;
}

/* .topics-item {
} */

/* every section heading */
/* .course-section {
  
} */
/* section heading after due date (for midterm and final exam mainly) */
.course-section.past {
  /* background: black; */
  opacity: 0.6;
  font-size: 0.8rem;
}

/* .past .test-list {
} */

.test-item.past {
  opacity: 0.6;
  font-size: 0.6rem;
}
/* .past .topics-list {  
}
.past .topics-item {
} */

/* solution links */
.solution-link {
  margin-left: 0.4rem;
  font-size: 0.8rem;
  text-decoration: underline;
}
.solution-link:hover {
  color: var(--colour-link-hover);
}

.solution-locked {
  margin-left: 0.4rem;
  /* margin-right: 0.4rem; */
  font-size: 0.8rem;
  opacity: 0.7;
  font-style: italic;
}

/* =====================================================================
   IMPORTANT DATES: the label of each event (list and calendar text)
   ===================================================================== */
.schedule-type {
  display: inline-block;
  margin-right: 0.4rem;
  padding: 0 0.5rem;
  border-radius: var(--radius-full);
  background-color: var(--event-colour, var(--cal-other));
  color: var(--event-ink, var(--cal-other-ink));
  font-size: 0.8rem;
  font-weight: 600;
}
.schedule-meta {
  margin-left: 0.4rem;
  font-size: 0.85rem;
  opacity: 0.85;
}

/* =====================================================================
   IMPORTANT DATES: chronological list
   ===================================================================== */
.schedule-list {
  list-style-position: outside;
  padding-left: 1.2rem;
}
.schedule-item {
  margin-bottom: 0.3rem;
  padding-left: 0.2rem;
}
.schedule-item.past {
  opacity: 0.6;
  padding-left: 0.2rem;
  font-size: 0.6rem;
}
.schedule-item.next {
  background-color: var(--colour-background-menu);
  border-radius: var(--radius-xxl);
  box-shadow: 0 0 0 0.25rem var(--colour-background-menu); /* highlight without moving the text */
  border: 0.2rem dotted var(--colour-border-next);
  padding: 0.2rem;
  width: fit-content;
}
.schedule-date {
  margin-right: 0.4rem;
  font-weight: 600;
}

/* an event that has not happened yet is a link to its section */
.schedule-title a:hover {
  color: var(--colour-link-hover);
  /* text-decoration: underline; */
}

.schedule-item.event--quiz-open {
  display: none;
}

/* =====================================================================
   IMPORTANT DATES: calendar (one month at a time)
   ---------------------------------------------------------------------
   .cal-widget   the whole calendar, centred        .cal-head   buttons + month name
   .cal          the table of days                  .cal-nav    previous / next button
   .cal-num      the day number (the circle)        .cal-month-events  text list under the month
   ===================================================================== */
.cal-widget {
  width: 100%;
  max-width: 32rem; /* size of the calendar */
  margin: 0.5rem auto 1rem;
}
.cal-month[hidden] {
  display: none;
}
.cal-month + .cal-month {
  margin-top: 1.5rem; /* only matters without JavaScript, when the months are stacked */
}
/* previous button, month name, next button */
.cal-head {
  display: grid;
  grid-template-columns: 2.6rem 1fr 2.6rem;
  align-items: center;
  margin-bottom: 0.5rem;
  text-align: center;
}
.cal-title {
  font-size: 1.2rem;
  font-weight: 600;
}
.cal-nav {
  width: 2.4rem;
  height: 2.4rem;
  padding: 0 0 0.15rem;
  border: 0.1rem solid var(--colour-border-menu);
  border-radius: 50%;
  background: transparent;
  /* background: black; */
  color: inherit;
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.cal-nav:hover:not(:disabled) {
  /* background-color: var(--colour-background-menu); */
  background-color: var(--colour-background-back-button);
}
.cal-nav:focus-visible {
  outline: 0.15rem solid var(--cal-today);
  outline-offset: 0.1rem;
}
.cal-nav:disabled {
  opacity: 0.3;
  cursor: default;
}
/* without JavaScript the buttons cannot work, so they are not shown */
.cal-widget:not(.is-js) .cal-nav {
  visibility: hidden;
}
/* the table of days */
.cal {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}
.cal th {
  padding: 0.3rem 0;
  font-size: 0.85rem;
  font-weight: 500;
  opacity: 0.7;
}
.cal td {
  height: 3.4rem;
  padding: 0.15rem;
  border: 1px solid var(--cal-line);
  text-align: center;
  vertical-align: middle;
}
.cal td.cal-blank {
  border: none;
}

/* the day number; on an important date it sits inside a coloured circle */
.cal-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  font-size: 1.05rem;
}
.cal-day.has-event .cal-num {
  background-color: var(--event-colour, var(--cal-other));
  color: var(--event-ink, var(--cal-other-ink));
  font-weight: 700;
}

.cal-day.has-event.event--quiz-open span {
  background: none;
  color: var(--cal-ink);
  border: dotted 0.2rem var(--cal-quiz);
  /* box-shadow: inset 0 0 0 0.3rem var(--cal-quiz); */
}
.cal-event-day.event--quiz-open {
  background: none;
  box-sizing: content-box;
  border: dotted 0.2rem var(--cal-quiz);
  color: var(--cal-ink);
  /* box-shadow: inset 0 0 0 0.2rem var(--cal-quiz); */
}
/* today gets a ring, so it can be told apart from an important date */
.cal-day.today .cal-num {
  box-shadow: 0 0 0 0.15rem var(--cal-today);
}

/* Option: a ring instead of a filled circle. Replace the .has-event rule above with this one.
.cal-day.has-event .cal-num {
  background: none;
  color: inherit;
  box-shadow: inset 0 0 0 0.2rem var(--event-colour, var(--cal-other));
}
*/

/* the text version under the month: what each circle means */
.cal-month-events {
  margin-top: 0.8rem;
  list-style: none;
  font-size: 0.95rem;
}
.cal-month-events li {
  margin-bottom: 0.2rem;
  padding-left: 1.8rem; /* hanging indent: wrapped text lines up under itself */
  text-indent: -1.8rem;
}
.cal-month-events li > span {
  text-indent: 0; /* the indent is for the line only, not for the pieces inside it */
}
.cal-event-day {
  display: inline-block;
  width: 1.3rem;
  height: 1.3rem;
  margin-right: 0.3rem;
  border-radius: 50%;
  /* text-shadow: 0px 0px 5px var(--event-shadow, var(--text-shadow-colour-other)); */
  /* background-color: var(
    --event-day-background,
    var(--cal-day-background-other)
  ); */
  color: var(--event-ink, var(--cal-other-ink));
  background-color: var(--event-colour, var(--cal-other));
  font-size: 0.8rem;
  /* color: var(--event-colour, var(--cal-other)); */
  font-weight: 700;
  line-height: 1.3rem;
  text-align: center;
  vertical-align: middle;
  text-indent: 0;
  box-sizing: content-box;
  border: solid 0.2rem transparent;
}

/* .cal-event-day.event--quiz {
  background: none;
  box-shadow: inset 0 0 0 0.2rem var(--cal-quiz);
} */

/* temporary contact form button */
.contact-form-button {
  /* display: none; */
  background: hsla(0, 0%, 61%, 0.4);
  /* border: none; */
  margin: 0.1rem;
  padding: 0.2rem;
  margin-left: 8px;
  font: inherit;
  color: inherit;
  font-weight: 600;
  /* text-decoration: underline; */
  cursor: pointer;
  border: 2px solid hsl(0, 0%, 73%);
  box-shadow: 2px 2px 2px 0 var(--colour-mid2);
  text-decoration: none;
}

.contact-form-button:hover {
  /* opacity: 0.8; */
  background: hsla(0, 0%, 61%, 0.3);
  border: 2px solid rgb(from var(--colour-link-hover) r g b / 40%);
  box-shadow: 1px 1px 2px 0 var(--colour-mid2);
}

.contact-form-button:active {
  margin-top: 1px;
  margin-left: 9px;
  box-shadow: 0px 0px 1px 0 var(--colour-mid2);
}
.info-box-item.contact-me {
  display: none;
}
.info-box-item-content.contact-me {
  margin-right: 0.5rem;
  margin-bottom: 0.2rem;
  margin-top: 0.1rem;
}
.info-box-row.contact-me {
  text-align: right;
}
.info-list a {
  text-decoration: none;
}

/* =====================================================================
   CONTACT FORM
   ===================================================================== */
.contact-section {
  margin-top: 1.5rem;
}
.contact-form {
  display: grid;
  gap: 0.7rem;
  max-width: 36rem;
  margin-top: 0.6rem;
}
.contact-field {
  display: grid;
  gap: 0.2rem;
}
.contact-label {
  font-size: 0.9rem;
  font-weight: 600;
}
.contact-field input,
.contact-field textarea {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 0.1rem solid var(--colour-border-menu);
  border-radius: var(--radius-md);
  background: transparent;
  color: inherit;
  font: inherit;
}
.contact-field textarea {
  min-height: 8rem;
  resize: vertical;
}
.contact-field input:focus-visible,
.contact-field textarea:focus-visible,
.contact-button:focus-visible {
  outline: 0.15rem solid var(--cal-today);
  outline-offset: 0.1rem;
}
.contact-button {
  justify-self: start;
  padding: 0.4rem 1.2rem;
  border: 0.1rem solid var(--colour-border-menu);
  border-radius: var(--radius-md);
  background-color: var(--colour-background-menu);
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.contact-button:hover {
  border-color: var(--cal-today);
}

/* result of sending: success and error messages */
.contact-message {
  max-width: 36rem;
  margin: 0.6rem 0;
  padding: 0.5rem 0.8rem;
  border: 0.15rem solid;
  border-radius: var(--radius-md);
}
.contact-message--ok {
  border-color: hsl(140, 55%, 38%);
}
.contact-message--error {
  border-color: hsl(0, 72%, 47%);
  list-style-position: inside;
}

/* the trap for robots: out of sight, but still there for them to fill in */
.contact-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* info-box */
.info-title {
  display: content;
}
/* .info-box-row {
} */
.info-box-item {
  font-size: 1rem;
}
.info-box-item-content.google-classroom-code {
  font-size: 1rem;
  margin-left: 1rem;
  width: fit-content;
  font-weight: 600;
  /* color: var(colour-gclass); */
}
.info-box-item-content.google-classroom-code a {
  border: 0.2rem solid var(--colour-border-gclass);
  color: var(--colour-gclass);
  border-radius: var(--radius-md);
  text-decoration: none;
  padding: 0.1rem;
  background-color: var(--colour-background-gclass);
}
.info-box-item-content.google-classroom-code a:hover {
  color: var(--colour-gclass-hover);
  border-color: var(--colour-border-gclass-hover);
  background-color: var(--colour-background-gclass-hover);
}
/* the link in the info box to the contact page (and back to the course) */
.info-box-link a {
  display: inline-block;
  padding: 0.25rem 0.9rem;
  border: 0.1rem solid var(--colour-border-menu);
  border-radius: var(--radius-md);
  background-color: var(--colour-background-menu);
  font-weight: 600;
  text-decoration: none;
}
.info-box-link a:hover {
  border-color: var(--cal-today);
}

/* "Send another message" after sending */
.contact-again a {
  /* text-decoration: underline; */
}
/* .info-box-item-label {
  display: none;
} 
*/
/* .info-box--aside {
} */

/* side picture */
.picture-back img {
  object-fit: contain;
  /* background: white; */
  /* transform: scale(0.9); */
}

.picture-front img {
  /* object-fit: contain; */
  /* background: white; */
  /* transform: scale(2) translateX(2rem); */
}

@media (max-width: 620px) {
  .contact-form {
    max-width: 600px;
    padding-left: 2%;
    padding-right: 2%;
    width: 100%;
  }

  .contact-field input,
  .contact-field textarea {
    width: 100%;
  }

  .picture-front {
    height: 100%;
    width: 100%;
  }

  .picture-back {
    height: auto;
    top: -150px;
  }

  .picture-front.c115-2-DS__10040 {
    width: 100%;
    height: auto;
  }

  .picture-back.c115-2-DS__10040 {
    top: -50px;
    height: auto;
  }
}
