/* Theme switcher button */
.themeswitcher {
  display: flex;
  justify-content: center;
}

@media (min-width: 48em) {
  .themeswitcher {
    justify-content: left;
    margin-bottom: 20px;
  }
}

.themeswitcher-button {
  background-color: #8f2011; /* Berry */
  border: 1px transparent solid;
  height: 36px;
  width: 36px;
  cursor: pointer;
}

.themeswitcher-button:hover {
  background-color: #730e04; /* Maroon */
  border: 1px rgba(0, 0, 0, 0.1) solid;
}

.themeswitcher-button:active,
.themeswitcher-button-active,
.themeswitcher-button-active:hover {
  background-color: #4a0004; /* Mahogany */
  border: 1px rgba(0, 0, 0, 0.1) solid;
}

#themeswitcher-button-light {
  border-radius: var(--border-radius) 0px 0px var(--border-radius);
}

#themeswitcher-button-dark {
  border-radius: 0px var(--border-radius) var(--border-radius) 0px;
}

.themeswitcher-button-icon {
  filter: invert();
  margin: auto;
}

#themeswitcher-button-light > .themeswitcher-button-icon {
  width: 20px;
}

#themeswitcher-button-auto > .themeswitcher-button-icon {
  width: 6px;
}

#themeswitcher-button-dark > .themeswitcher-button-icon {
  width: 22px;
}

/* Dark theme */
@media (prefers-color-scheme: dark) {
  :root {
    --fc-border-color: #2c2c2c;
  }

  .theme-base-08-rip .sidebar {
    background-color: #730e04; /* Maroon */
  }

  body {
    background: #121212;
    color: #ddd;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    color: #eee;
  }

  .post-base {
    color: #bbb;
  }

  .sidebar a {
    color: #ddd !important;
  }

  .menuicon {
    filter: invert() brightness(0.9) !important;
  }

  blockquote {
    color: #ccc;
  }

  blockquote {
    border-color: #bbb;
  }

  code {
    background-color: #1c1c1c;
  }

  strong {
    color: #fff;
  }

  .post-date {
    color: #b9b9b9;
  }

  /* MD tables */
  table:not([style]):not([class]) tbody tr:nth-child(2n + 1) td,
  table:not([style]):not([class]) tbody tr:nth-child(2n + 1) th {
    background-color: #060606;
  }

  td,
  th {
    border-color: #2a2a2a;
  }

  hr {
    border-top-color: #232323;
    border-bottom-color: #121212;
  }

  pre {
    background: #222;
  }

  /* Calendar */
  #calendar a {
    color: #eeeeee !important;
  }

  .fc-theme-standard .fc-scrollgrid,
  .fc-theme-standard td,
  .fc-theme-standard th,
  .fc-theme-standard .fc-list {
    border-color: #222 !important;
    border-color: var(--fc-border-color, #222) !important;
  }

  .fc-scroller-harness {
    background: #121212;
  }

  :root {
    --fc-list-event-hover-bg-color: #222 !important;
  }

  #popup-content {
    background: #121212 !important;
  }

  #popup-close,
  .fc .fc-list-sticky .fc-list-day > * {
    background: #222 !important;
  }

  .fc-h-event,
  .fc-timegrid-event.fc-v-event.fc-event.fc-event-start.fc-event-end.fc-event-past,
  .fc-event.fc-event-start.fc-event-end.fc-event-future.fc-timegrid-event.fc-v-event {
    background-color: #8f2011 !important; /* Berry */
    border-color: #8f2011 !important; /* Berry */
    box-shadow: 0px 0px 0px 1px var(#000) !important;
  }

  .fc-daygrid-event-dot {
    border: calc(var(--fc-daygrid-event-dot-width, 8px) / 2) solid #8f2011 !important; /* Berry */
  }

  .fc-theme-standard .fc-list-day-cushion {
    background-color: #060606 !important;
  }

  .popup-icon {
    filter: invert();
  }
}