/* EEIE30069 */

:root {
  --page-bg: #ffffff;
  --content-bg: #ffffff;

  /* Header and navigation backgrounds */
  --brand-bg: #fcfcfc;
  --nav-bg: #f5f5f5;

  --subtle-bg: #f6f8fa;
  --hover-bg: #f3f4f6;

  --text-main: #1f2328;
  --text-muted: #59636e;

  --border: #d0d7de;
  --border-muted: #d8dee4;

  --link: #0969da;
  --link-hover: #0550ae;

  --active: #fd8c73;
  --danger: #ff2e3c;

  /* Maximum width shared by header, navigation and content */
  --content-width: 1200px;

  /* Header logo */
  --logo-size: 120px;
  --logo-gap: 22px;
}

/* =========================================================
   Base
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;

  overflow-y: scroll;
  overflow-x: hidden;

  background: var(--page-bg);
}

body {
  width: 100%;
  min-height: 100vh;

  margin: 0;
  padding: 0;

  background: var(--content-bg);
  color: var(--text-main);

  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Noto Sans TC",
    "Microsoft JhengHei",
    Arial,
    sans-serif;

  font-size: 16px;
  line-height: 1.6;
  text-align: left;
}

p {
  margin: 0.55em 0;
}

/* =========================================================
   Common course header
   ========================================================= */

/* Full-width header background */
.site-header {
  width: 100%;
  background: var(--brand-bg);
}

/* Course title area: logo on the left, text on the right */
.site-brand {
  display: flex;
  align-items: center;
  gap: var(--logo-gap);

  width: 100%;
  max-width: var(--content-width);

  margin: 0 auto;
  padding: 14px 48px;

  background: var(--brand-bg);
}

/* Header logo */
.site-logo {
  display: block;
  width: var(--logo-size);
  height: var(--logo-size);

  object-fit: contain;
  flex: 0 0 var(--logo-size);

  /*
    The source image has a white background.
    Multiply helps it blend into the light-gray header.
  */
  mix-blend-mode: multiply;
}

/* Text block next to the logo */
.site-brand-text {
  min-width: 0;
}

.site-course-id {
  margin-bottom: 5px;

  color: var(--text-muted);

  font-size: 20px;
  font-weight: 400;
}

.site-course-title {
  color: var(--text-main);

  font-size: 32px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

/* =========================================================
   Navigation
   ========================================================= */

/* Full-width navigation background */
.site-nav-bar {
  width: 100%;

  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
}

/* Navigation content aligned with header and page content */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 28px;

  width: 100%;
  max-width: var(--content-width);

  margin: 0 auto;
  padding: 0 48px;

  overflow-x: auto;

  background: transparent;
}

/* Navigation links */
.site-nav a.nav-link {
  display: inline-block;

  padding: 13px 2px 11px;

  color: var(--text-muted);

  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;

  border-bottom: 2px solid transparent;
}

.site-nav a.nav-link:visited {
  color: var(--text-muted);
  text-decoration: none;
}

.site-nav a.nav-link:hover,
.site-nav a.nav-link:focus {
  color: var(--text-main);
  text-decoration: none;

  border-bottom-color: var(--border);
}

.site-nav a.nav-link.active,
.site-nav a.nav-link.active:visited {
  color: var(--text-main);

  font-weight: 600;
  text-decoration: none;

  border-bottom-color: var(--active);
}

/* =========================================================
   Main page content
   ========================================================= */

.page-content {
  width: 100%;
  max-width: var(--content-width);

  margin: 0 auto;
  padding: 30px 48px 48px;
}

.page-title-block {
  width: 100%;
  margin-bottom: 24px;
}

.page-title {
  margin: 0 0 12px;

  color: var(--text-main);

  font-size: 28px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.page-divider {
  width: 100%;
  height: 1px;

  background: var(--border-muted);
}

.course-semester {
  margin: -8px 0 26px;

  color: var(--text-main);

  font-size: 15px;
}

/* =========================================================
   Section headings
   ========================================================= */

.section-title {
  margin: 28px 0 12px;
  padding-bottom: 8px;

  color: var(--text-main);

  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;

  border-bottom: 1px solid var(--border-muted);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-main);
  font-family: inherit;
}

h2,
h3,
h4 {
  font-weight: 600;
}

/* =========================================================
   General links
   ========================================================= */

a[href] {
  color: var(--link);
  text-decoration: none;
}

a[href]:visited {
  color: var(--link);
}

a[href]:hover,
a[href]:focus {
  color: var(--link-hover);

  text-decoration: underline;
  text-underline-offset: 2px;
}

a[href]:focus-visible {
  outline: 2px solid #54aeff;
  outline-offset: 2px;

  border-radius: 3px;
}

/*
  Keep navigation styling independent from the general
  link rules above.
*/

.site-nav a.nav-link,
.site-nav a.nav-link:visited {
  color: var(--text-muted);
  text-decoration: none;
}

.site-nav a.nav-link:hover,
.site-nav a.nav-link:focus {
  color: var(--text-main);
  text-decoration: none;

  border-bottom-color: var(--border);
}

.site-nav a.nav-link.active,
.site-nav a.nav-link.active:visited {
  color: var(--text-main);

  font-weight: 600;
  text-decoration: none;

  border-bottom-color: var(--active);
}

/* =========================================================
   Lists
   ========================================================= */

ul,
ol {
  padding-left: 1.5em;
}

li {
  margin: 0.3em 0;
}

/* =========================================================
   Staff information
   ========================================================= */

.staff-block {
  margin-bottom: 18px;
}

.staff-name {
  font-weight: 600;
}

/* =========================================================
   Dividers
   ========================================================= */

hr {
  height: 1px;

  margin: 24px 0;

  background: var(--border-muted);
  border: 0;
}

/* =========================================================
   General tables
   ========================================================= */

table {
  border-collapse: collapse;

  background: var(--content-bg);
  border: 1px solid var(--border);
}

table td,
table th {
  padding: 9px 12px;

  border: 1px solid var(--border);
}

/* =========================================================
   Grading table
   ========================================================= */

.grading-table {
  width: 420px;
  max-width: 100%;
  margin: 16px auto 26px;
  text-align: center;
}

.grading-table tr:first-child td,
.grading-table tr:first-child th {
  background: var(--subtle-bg);

  font-weight: 600;
}

/* =========================================================
   Schedule table
   ========================================================= */

.tabletext {
  width: 100%;

  overflow-x: auto;

  font-size: 15px;
  line-height: 1.5;
}

.tabletext table {
  width: 100% !important;
  max-width: 100%;

  margin: 0 auto;

  table-layout: fixed;

  background: var(--content-bg);
  border: 1px solid var(--border);
}

.tabletext td,
.tabletext th {
  padding: 12px 14px !important;

  vertical-align: middle;

  border-color: var(--border) !important;
}

.tabletext tr:first-child td,
.tabletext tr:first-child th {
  background: var(--subtle-bg);
  color: var(--text-main);

  font-weight: 600;
}

.tabletext tr:not(:first-child):hover td {
  background: var(--hover-bg);
}

.tabletext td:first-child,
.tabletext td:nth-child(2) {
  color: var(--text-main);

  font-weight: 600;
}

.tabletext p {
  margin: 0.22em 0;
}

/* Important notices such as exams and holidays */

p[style*="crimson"] {
  color: var(--danger) !important;
}

/* =========================================================
   Footer
   ========================================================= */

.site-footer {
  margin-top: 36px;
  padding-top: 20px;

  color: var(--text-muted);

  text-align: center;

  border-top: 1px solid var(--border-muted);
}

/* =========================================================
   Existing class compatibility
   ========================================================= */

.titlestyle {
  color: var(--text-main);

  font-family: inherit;
}

.textstyle {
  color: var(--text-main);

  font-family: inherit;
  line-height: 1.6;
}

.linestyle {
  color: var(--text-muted);

  text-align: center;
}

.liststyle {
  color: var(--text-main);

  font-size: 16px;
  font-weight: 600;
}

/* =========================================================
   Inline code
   ========================================================= */

code {
  padding: 0.15em 0.35em;

  background: rgba(175, 184, 193, 0.2);

  border-radius: 4px;

  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    "Liberation Mono",
    monospace;

  font-size: 0.9em;
}

/* =========================================================
   Mobile and smaller screens
   ========================================================= */

@media (max-width: 760px) {
  .site-brand {
    gap: 14px;
    padding: 14px 16px;
  }

  .site-logo {
    width: 76px;
    height: 76px;
    flex-basis: 76px;
  }

  .site-course-id {
    font-size: 13px;
  }

  .site-course-title {
    font-size: 23px;
  }

  .site-nav {
    justify-content: flex-start;

    gap: 20px;
    padding: 0 16px;
  }

  .site-nav a.nav-link {
    padding-top: 12px;
    padding-bottom: 10px;

    font-size: 14px;
  }

  .page-content {
    padding: 24px 16px 36px;
  }

  .page-title {
    font-size: 25px;
  }

  .section-title {
    font-size: 19px;
  }

  .tabletext {
    font-size: 14px;
  }

  .tabletext table {
    min-width: 720px;
  }

  .grading-table {
    width: 100%;
  }
}

/* =========================================================
   Print
   ========================================================= */

@media print {
  html,
  body {
    width: 100%;

    background: #ffffff;
  }

  body {
    margin: 0;
    padding: 0;
  }

  /* Hide the complete navigation row */
  .site-nav-bar {
    display: none;
  }

  .page-content {
    padding: 20px 0;
  }

  a[href] {
    color: #000000;
    text-decoration: none;
  }

  .tabletext table {
    min-width: 0;
  }
}

/* =========================================================
   Shared header loader
   ========================================================= */

/*
  Reserve space while common_header.html is loading so the
  page content does not jump upward and then move down.
*/
#common-header {
	min-height: 198px;
	background: var(--brand-bg);
}

#common-header.is-loaded {
	min-height: 0;
}

.header-load-error {
	width: 100%;
	max-width: var(--content-width);

	margin: 0 auto;
	padding: 20px 48px;

	color: var(--danger);
	background: var(--brand-bg);

	font-size: 15px;
}

@media (max-width: 760px) {
	#common-header {
		min-height: 144px;
	}

	.header-load-error {
		padding: 16px;
	}
}

@media print {
	#common-header {
		min-height: 0;
	}
}
