@import url('/static/css/themes/mtt_dark.css');

.light-mode {
  --background: #fefefe;
  --text: #121212;
  --text-soft: #2b2b2b;
  --link: #00508f;

  color-scheme: light;
}

*:focus {
  outline: none;
}

body {
  background: var(--background);
  color: var(--text);
  accent-color: var(--brand-color);
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, Aptos, Segoe UI Variable, Segoe UI, Roboto, Helvetica Neue, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: clip;
}

main {
  padding: 1rem;
  max-width: 62.5em;
  margin: 0 auto;
  min-height: 85vh;
}

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

hr {
  width: 100%;
  border-color: var(--brand-color-mid);
}

header {
  position: relative;
  top: 0;
  left: 0;
  right: 0;
  height: 20px;

  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;

  background: var(--banner);
  color: var(--text);
}

header nav {
  display: flex;
  width: 100%;
  max-width: 62.5em;
  margin: 0 auto;
}

header .header-left img {
  height: 35px;
  margin-top: 5px;
}

header .header-right {
  display: flex;
  align-items: center;
  position: relative;
  margin-left: auto;
}

header .burger-menu {
  cursor: pointer;
  width: 40px;
  height: 40px;
  padding: 6px;
  margin-top: -1px;
}

header .burger-menu .line {
  width: 30px;
  height: 3px;
  background-color: var(--text-soft);
  display: block;
  margin: 8px auto;
  border-radius: 2px;
  -webkit-transition: all 0.3s ease-in-out;
  -o-transition: all 0.3s ease-in-out;
  transition: all 0.3s ease-in-out;
}

header .burger-menu.is-active .line:nth-child(2) {
  opacity: 0;
}

header .burger-menu.is-active .line:nth-child(1) {
  -webkit-transform: translateY(11px) rotate(45deg);
  -ms-transform: translateY(11px) rotate(45deg);
  -o-transform: translateY(11px) rotate(45deg);
  transform: translateY(11px) rotate(45deg);
}

header .burger-menu.is-active .line:nth-child(3) {
  -webkit-transform: translateY(-11px) rotate(-45deg);
  -ms-transform: translateY(-11px) rotate(-45deg);
  -o-transform: translateY(-11px) rotate(-45deg);
  transform: translateY(-11px) rotate(-45deg);
}

header .burger-menu-item {
  background: var(--brand-color);
  padding: 1em;
  border-radius: 0 0 .75em .75em;

  opacity: 0;
  transform: translateY(-10px);

  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}

header .burger-menu-item.is-active {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}

header .burger-menu-item a {
  color: var(--text);
  text-align: left;
  font-size: 1em;
  --i: 0;
  opacity: 0;
  display: inline-flex;
  text-wrap: nowrap;
  align-items: center;
}

header .burger-menu-item.is-active a {
  opacity: 1;
  transform: translateY(0);
  border-radius: .5em;
  padding: .25em .5em;
}

header .burger-menu-item.is-active a:hover {
  background: var(--brand-color-darker);
}

header .burger-menu-item a[href*="logout"] {
  color: var(--brand-danger);
}

header .burger-menu-item a[href*="logout"]:hover {
  background: var(--brand-danger-hover);
}

header .burger-menu-item hr {
  margin: .5em 0;
  opacity: .6;
}

header .burger-menu-item img {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 2px solid var(--brand-color-lighter);
  background: var(--brand-color-mid);
}

header .burger-menu-item .placeholder-pfp {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 2px solid var(--brand-color-lighter);
  background: var(--brand-color-mid);
  content: "G";
  color: var(--text-soft);
  text-align: center;
  align-items: center;
  justify-content: center;
  display: flex;
  font-weight: bolder;
  font-size: 1.25em;
}

footer.site-footer {
  background: var(--brand-color);
  padding: 1rem;
  margin-top: 2rem;
}

footer.site-footer .footer-links {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  justify-content: center;
}

footer.site-footer .footer-links a {
  color: var(--text-soft);
  font-size: 0.875em;
}

footer.site-footer .footer-links a:hover {
  color: var(--text);
}

header .burger-menu-item span {
  margin-right: 10px;
  justify-content: center;
  display: inline-flex;
  align-content: center;
  flex-direction: column;
}

header .burger-menu-item .menu-tier {
  font-size: 0.75em;
  color: var(--text-soft);
  text-transform: capitalize;
}

header .burger-menu-items-wrapper {
  position: absolute;
  top: 100%;
  right: 0;
  width: auto;
  z-index: 1000;
  display: none;
}

header .header-right form {
  margin-top: -5px;
}

header .header-right input[type=submit] {
  background: var(--brand-color-lighter);
  border: none;
  border-radius: 0 .75em .75em 0;
  padding: .5em;
  font-size: 1em;
  width: auto;
}

header .header-right input[type=submit]:hover {
  cursor: pointer;
  background: var(--brand-color-mid);
}

header .header-right input[type=search] {
  background: var(--brand-color);
  border: 2px solid var(--brand-color-lighter);
  border-radius: .75em 0 0 .75em;
  padding: .5em;
  margin-right: 0;
  font-size: 1em;
  height: calc(2.5em - 5px);
  width: auto;
}

header .header-right input[type=search]:hover {
  cursor: text;
}


button,
.btn {
  background: var(--brand-color);
  color: var(--text);
  border: none;
  border-radius: .5em;
  padding: .5em 1em;
  font-size: 1em;
}

button:hover {
  cursor: pointer;
  background: var(--brand-color-mid);
}

.messages {
  margin-bottom: 1rem;
}

.message {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  background: var(--brand-color);
  color: var(--text);
  border: 1px solid var(--brand-color-lighter);
}

.message--success {
  background: #0d3320;
  color: #6ee7b7;
  border-color: #1a5c3a;
}

.message--error {
  background: var(--brand-danger-dark);
  color: var(--brand-danger);
  border-color: var(--brand-danger-mid);
}

.message--warning {
  background: #4a3b00;
  color: #facc15;
  border-color: #7c5e00;
}

.message--info {
  background: var(--brand-color-mid);
  border-color: var(--brand-color-lighter);
}

input:not(#headerSearch):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="color"]):not([type="range"]),
select,
textarea {
  background: var(--background);
  border: 1px solid var(--brand-color-lighter);
  border-radius: .75em !important;
  padding: .5em;
  margin-right: 0;
  font-size: .875em;
  width: 100%;
  min-height: 2.5em;
  box-sizing: border-box;
  color: var(--text);
  border-radius: .5em 0 0 .5em;
}

input:not(#headerSearch):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="color"]):not([type="range"]):focus,
select:focus,
textarea:focus {
  border-color: var(--brand-color-light);
  outline: none;
}

input[type=checkbox] {
  width: 1em;
  height: 1em;
  margin-right: .5em;
}

form p {
  display: grid;
}

#page-loading {
  position: fixed;
  inset: 0;
  background: #00000055;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

#page-loading.show {
  opacity: 1;
  visibility: visible;
}

.spinner {
  opacity: 0;
}

.spinner.show {
  opacity: 1;
  width: 40px;
  height: 40px;
  border: 4px solid var(--brand-color-mid);
  border-top-color: var(--brand-color-light);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-error-icon {
  display: none;
  position: relative;
  width: 58px;
  height: 58px;
  align-items: center;
  justify-content: center;

  border-radius: 50%;
  border: 2px solid var(--brand-danger-dark);
  color: var(--brand-danger-mid);
  animation: loading-error-in 0.25s ease-out;
}

.loading-error-icon span {
  display: block;
  margin-top: -6px;

  font-size: 42px;
  font-weight: 300;
  line-height: 1;
}


/* Show error instead of spinner */

#page-loading.loading-error .spinner {
  display: none;
}

#page-loading.loading-error .loading-error-icon {
  display: flex;
}


/* Error entrance animation */

@keyframes loading-error-in {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }

  70% {
    opacity: 1;
    transform: scale(1.08);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

table {
  border-collapse: collapse;
}

th,
td {
  border-left: 1px solid var(--brand-color-mid);
  padding: .25em .5em;
  text-align: left;

  &:first-child {
    border-left: 0;
    padding-left: 0;

    a {
      margin-left: 0;
      padding-left: 0;
    }
  }

  &:last-child {
    padding-right: 0;

    a {
      margin-right: 0;
      padding-right: 0;
    }
  }
}

td {
  border-top: 1px solid var(--brand-color-mid);
}

th a,
.link a,
.fleet a {
  display: block;
  margin: -.25em -.5em;
  padding: .25em .5em;
}

thead {
  th {
    padding-top: 0;
    vertical-align: bottom;
  }
}

tr:target {
  background: var(--brand-color);
}

.search-logo {
  border-radius: 5px;
}

main li {
  break-inside: avoid;
}

main li>a {
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: .125em 0;
  display: block;
  overflow: hidden;
  gap: 5px;
  align-items: center;
}

ul,
ol {
  margin: 1em 0;
  padding: 0;
}

ul {
  list-style: none;
}

.has-smalls {
  li {

    a,
    a:hover .name {
      text-decoration: none;
    }

    a:hover span {
      text-decoration: underline;
    }
  }

  span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  small {
    color: var(--text);
    display: block;
    float: left;
    font-size: .75em;
    margin-right: .5em;
  }

  small:last-child {
    margin: 0;
    padding-bottom: .33em;
    float: none;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.long {
  column-count: 1;
}

@media (min-width: 30em) {
  .long {
    column-count: 2;
  }
}

@media (min-width: 62.5em) {
  .long {
    column-count: 3;
  }
}

.regions {
  li {
    padding: .125em 0;
  }

  a {
    margin: -.125em 0;
  }

  ul {
    margin: .25em 0 .25em 1em;
  }
}


.services {
  column-width: 24em;
  column-gap: 1em;

  a {
    align-items: center;
    display: flex;
    padding: .5em 0;
    white-space: normal;

    small {
      color: var(--text);
      white-space: nowrap;
      margin-left: 1em;
    }
  }

  .description {
    align-content: center;
  }

  a:hover {
    text-decoration: none;

    .description {
      text-decoration: underline;
    }
  }

  a:focus,
  a:active {
    color: var(--link);
  }
}

.names.small .name {
  font-size: 14px;
  text-wrap: nowrap;
  line-height: 16px;
  margin: 11px 0;
}

.service-header {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  row-gap: 8px;

  .is-short {
    font-weight: 500;
  }

  .description {
    flex-basis: 70%;
    flex-grow: 1;
    align-self: center;
  }
}

.grid {
  display: grid;
}

.names {
  display: flex;
  margin-right: 16px;
  border-radius: 4px;
}

.name {
  border: 1px solid var(--brand-color-mid);
  color: var(--text);
  float: left;
  font-size: 16px;
  line-height: 18px;
  padding: 6px;
  text-align: center;
  font-weight: normal;
  white-space: nowrap;
  align-content: center;

  &.is-short {
    line-height: 36px;
    font-size: 30px;
    padding: 6px 8px;
  }

  &.is-short+.name {
    white-space: normal;
    align-content: center;
  }

  &:first-child {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
  }

  &:last-of-type {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
  }

  +.name {
    border-left: 0;
  }
}

.service-header {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  row-gap: 8px;

  .is-short {
    font-weight: 500;
  }

  .description {
    flex-basis: 70%;
    flex-grow: 1;
    align-self: center;
  }
}


.has-smalls .names {
  float: left;
  margin-right: .75em;
}

.breadcrumb {
  margin: -1em -1em 0;
  overflow: auto;
  padding: .5em 0 0 .5em;
  white-space: nowrap;

  border-bottom: 1px solid var(--brand-color-lighter);
  li {
    display: inline-block;
    margin: 0;
    margin-top: -.5em;

    &:after {
      color: var(--border-color-darker);
      content: '\203A';
      vertical-align: middle;
      padding: 0;
    }

    &:last-child:after {
      padding-right: 0;
      width: 0;
    }
  }

  a {
    display: inline-block;
    padding: .75em .5em;
    vertical-align: middle;
  }

}

.company-verified-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  line-height: 1;
  flex-shrink: 0;
  position: relative;
  top: -0.05em;
}

.company-verified-check svg {
  display: block;
  width: 0.85em;
  height: 0.85em;
  flex-shrink: 0;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
}

.search-form input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  margin-top: 0;
  width: auto;
}

.search-form button {
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 2.5em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}


.timetable-wrapper {
  font-size: 0.875em;
  overflow-x: auto;
  position: relative;

  &--wide {
    margin-left: 0;
  }
}

.stop-name {
  z-index: 1;
}

.timetable {
  border-collapse: separate;
  border-spacing: 0;
  padding: 0 1.14em;

  .timetable-wrapper--wide & {
    padding-left: 0;
  }

  .then-every {
    width: 0;
  }

  tbody td {
    border-left: 0;
    font-variant-numeric: tabular-nums;
  }

  td,
  th {
    height: 1.5em;
  }

  tbody tr:first-child {

    td,
    th {
      border-top: 0;
    }
  }

  .referrer,
  .referrer+.dep {

    td,
    th {
      background: var(--brand-color);
    }

    .then-every {
      background: none;
    }

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

  thead {
    th {
      border-top: 0;
      border-bottom: 1px solid var(--brand-color);
      text-align: center;
      padding-right: .5em;
      border-left: 0;
    }

    td {
      border: 1px solid var(--brand-color);
      border-width: 0 1px 1px 0;
      text-align: center;

      &:last-child {
        border-right: 0;
      }
    }
  }

  tfoot {
    td {
      border: 1px solid var(--brand-color);
      border-width: 1px 1px 0 0;
      vertical-align: top;

      &:last-child {
        border-right: 0;
      }

    }
  }

  .dep,
  .minor+.minor {

    th,
    td {
      border-top: 0;
    }
  }

  .dep {
    td:first-child {
      padding-left: .5em;
    }
  }

  .minor {
    .stop-name {
      padding-left: 1em;

      a {
        margin-left: -1em;
        padding-left: 1em;
      }
    }
  }

  th {
    background: var(--background);
    border-right: 1px solid var(--brand-color);
    border-top: 1px solid var(--brand-color);
    font-weight: normal;
    white-space: nowrap;
  }
}

.timetable-wrapper--wide {
    .stop-name,
    th {
        left: 0;
        overflow: hidden;
        position: sticky;
        max-width: calc(100vw - 14em);
    }
}

.tabs {
  list-style: none;
  display: flex;
  padding: 0;
  border-bottom: 2px solid var(--brand-color-mid);
  margin-left: calc(env(safe-area-inset-left) * -1 - 1em);
  margin-right: calc(env(safe-area-inset-right) * -1 - 1em);
  overflow-x: scroll;
  scrollbar-width: none;
  /* Firefox */
  scrollbar-color: transparent;
}

.tabs li {
  margin: 0 1em;
  margin-right: 5px;
  text-wrap: nowrap;
}

.tabs .active {
  border-bottom: 4px solid var(--brand-color-mid);
  margin-right: 5px;
  color: var(--text);
}

@media (max-width: 800px) {
  header {
    padding: 1rem 1rem !important;
  }

  header .header-left img {
    height: 25px;
    margin-top: 12px;
  }

  header .header-right form {
    width: 70px;
  }

  header .header-right input[type="submit"] {
    display: none;
  }

  header .header-right input[type="search"] {
    border: 0;
    text-align: right;
    background: none;
    width: inherit;
  }

  header .header-right input[type="search"]:focus {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    text-align: left;
    background: var(--background);
    border-radius: 0;
    margin-top: 0;
    height: 51px;
    font-size: 16px;
    padding: 1em;
    border: 5px solid var(--brand-color-lighter);
    width: 100%;
  }

  main {
    padding: 1rem !important;
  }
}