/* GENERAL */
.main-color {
  color: #707071 !important;
  color: var(--main-color) !important;
}

a {
  color: #000;
  text-decoration-color: #707071;
  text-decoration-color: var(--main-color);
}

a:hover {
  color: #707071;
  color: var(--main-color);
}

a.link-gray-no-underline,
a.link-gray-underline-hover {
  color: rgba(0, 0, 0, 0.55);
  text-decoration: none;
}

a.link-gray-no-underline:hover,
a.link-gray-underline-hover:hover {
  color: rgba(0, 0, 0, 0.8);
}

a.link-main-no-underline,
a.link-main-underline-hover {
  color: rgba(0, 0, 0, 0.55);
  color: var(--main-color);
  text-decoration: none;
}

a.link-gray-underline-hover:hover,
a.link-main-underline-hover:hover {
  text-decoration: underline;
}

.above-stretched-link {
  position: relative;
  z-index: 2;
}

hr {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.icon-svg-inline {
  display: inline-block;
  font-size: inherit;
  height: 1em;
  overflow: visible;
  vertical-align: -0.125em;
}

/* SITE NAVIGATION */
.site-nav {
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 2px 2px -2px rgba(0, 0, 0, 0.15);
}

.site-nav .navbar-brand img {
  max-height: 30px;
}

.autohide {
  transition: transform 0.2s ease-in-out;
}

.autohide.scrolled-down {
  transform: translateY(-100%);
}

.autohide.scrolled-up {
  transform: translateY(0);
}

/* SITE HEADER */
.site-header {
  margin-top: 59px;
}

.site-header-img {
  background-color: #18191a;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  color: #fff;
}

.site-header-img-content {
  padding-top: 11vw;
  padding-bottom: 11vw;
  min-height: 200px;
  max-height: 450px;
  overflow: hidden;
}

.site-title {
  font-size: 3rem;
  font-weight: 300;
  line-height: 1.2;
}

.site-description {
  font-weight: 300;
  font-size: 1.4rem;
}

@media (min-width: 768px) {
  .site-title {
    font-size: 3.5rem;
  }
  .site-description {
    font-size: 1.8rem;
  }
}

@media (min-width: 992px) {
  .site-title {
    font-size: 4.5rem;
  }
  .site-description {
    font-size: 2.2rem;
  }
}

/* SITE MAIN */
.site-main {
  margin-bottom: 1.5rem;
}

/* SITE RELATED */
.site-related {
  background-color: var(--main-color);
  margin-top: 1.5rem;
}

.site-related .site-related-inner {
  background-color: rgba(255, 255, 255, 0.9); /* Make main color brighter. */
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.site-related .site-related-row {
  margin-top: 0;
}

/* SITE FOOTER */
.site-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.125);
  padding-top: 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.8rem;
  color: rgba(0, 0, 0, 0.55);
}

/* PAGINATION */
.site-pagination {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.site-pagination .page-link {
  color: rgba(0, 0, 0, 0.55);
  margin: 0 !important;
  border: none;
  border-radius: 0 !important;
  padding: 0.75rem;
}

.site-pagination .page-ellipse {
  color: rgba(0, 0, 0, 0.55);
  padding-top: 0.75rem;
  position: relative;
}

.site-pagination .page-link:hover {
  color: #000;
  text-decoration: none;
  background-color: #e9ecef;
}

.site-pagination .page-link:focus {
  box-shadow: 0 0 0.2em 0.1rem rgba(0, 0, 0, 0.25);
}

.site-pagination .page-item.active .page-link {
  background-color: transparent;
  color: #000;
  font-weight: 700;
}

.site-pagination .page-item .page-link:after,
.site-pagination .page-item .page-ellipse:after {
  content: "";
  background-color: rgba(0, 0, 0, 0.125);
  height: 1px;
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
}

.site-pagination .page-item.active .page-link:after {
  background-color: #000;
}

/* TAG & ARCHIVE PAGE */
.tag-header,
.archive-header {
  padding-top: 3rem;
}

.tag-title,
.archive-title {
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
}

.tag-title span,
.archive-title span {
  border-bottom: 1px solid rgba(0, 0, 0, 0.55);
  display: inline-block;
  padding-bottom: 20px;
  margin-bottom: -1px;
}

.archive-title .counter,
.archive-table .counter {
  font-size: 0.625em;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.55);
}

.tag-description,
.archive-description {
  font-weight: 400;
  margin-bottom: 20px;
}

.archive-table tr:not(:first-child) th {
  padding-top: 3rem;
}

/* POST CARDS (HOME) */
.post-card-deck {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.post-card {
  height: 100%;
  transition: box-shadow 0.2s ease-in-out;
}

@media (min-width: 576px) {
  .post-card:hover {
    box-shadow: 0 0.3rem 1rem 0.3rem rgba(0, 0, 0, 0.15);
  }
}

.post-card .card-header {
  background-position: 50% 50%;
  background-size: cover;
  overflow: hidden;
  height: 0;
  padding-top: 56.25%; /* 16:9 ratio */
  border-bottom: none;
}

.post-card .card-tags {
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}

.post-card .card-tags li:not(:last-child) {
  margin-right: 0rem;
}

.post-card .card-tags a {
  padding-top: 10px;
  padding-right: 5px;
}

.post-card .card-title,
.post-card .card-title a {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.25;
  color: rgba(0, 0, 0, 0.8);
  text-decoration: none;
}

.post-card .card-text {
  color: rgba(0, 0, 0, 0.55);
  font-size: 0.95rem;
}

.post-card .card-footer {
  padding-top: 0;
  padding-bottom: 1rem;
  border-top: none;
  background-color: transparent;
  font-size: 0.95rem;
}

/* POST */
.post-date {
  color: rgba(0, 0, 0, 0.55);
}

/* POST & PAGE */
.post-header,
.page-header {
  padding-top: 3rem;
  padding-bottom: 2rem;
}

.post-title,
.page-title {
  font-weight: 700;
  font-size: 3rem;
  margin-bottom: 1rem;
}

@media (max-width: 767px) {
  .post-title,
  .page-title {
    font-size: 2.2rem;
  }
}

/* POST */
.post-tags {
  margin-bottom: 0.5rem;
}

.post-tags a {
  text-decoration: none;
  color: rgba(0, 0, 0, 0.55);
  color: var(--main-color);
}

.post-tags a:hover {
  text-decoration: underline;
}

.post-meta {
  margin-top: 1.5rem;
}

.post-meta img {
  width: 30px;
  height: 30px;
  margin-right: 5px;
}

.post-meta .dot:after {
  content: "·";
  margin-left: 3px;
  margin-right: 3px;
}

/* POST & PAGE CONTENT */
.article-content {
  color: rgba(0, 0, 0, 0.8);
}

@media (min-width: 768px) {
  .article-content {
    font-size: 1.2rem;
  }

  .article-content .lead {
    font-size: 1.5rem;
  }
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  margin-top: 3rem;
}

@media (max-width: 767px) {
  .article-content h1 {
    font-size: 2rem;
    margin-top: 2rem;
  }
  .article-content h2 {
    font-size: 1.75rem;
    margin-top: 2rem;
  }
  .article-content h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
  }
  .article-content h4 {
    font-size: 1.3rem;
    margin-top: 2rem;
  }
  .article-content h5 {
    font-size: 1.15rem;
    margin-top: 2rem;
  }
  .article-content h6 {
    font-size: 1rem;
    margin-top: 2rem;
  }
}

.article-content > :first-child {
  margin-top: 0;
}

.article-content h1[id]::before,
.article-content h2[id]::before,
.article-content h3[id]::before,
.article-content h4[id]::before,
.article-content h5[id]::before,
.article-content h6[id]::before {
  display: block;
  height: 5rem;
  margin-top: -5rem;
  content: "";
}

.article-content blockquote {
  border-left: 4px solid #000;
  border-left-color: var(--main-color);
  padding: 0 20px;
  margin-top: 1rem;
  font-style: italic;
  font-size: 1.4rem;
  color: rgba(0, 0, 0, 0.55);
}

.article-content blockquote a {
  color: rgba(0, 0, 0, 0.55);
}

.article-content blockquote p {
  margin-bottom: 0.5rem;
}

.article-content blockquote p:last-child > em {
  font-size: 1.2rem;
}

.article-content blockquote p:last-child > em::before {
  content: "\2014\00A0";
}

.article-content p,
.article-content blockquote,
.article-content dl,
.article-content ol,
.article-content ul {
  margin-bottom: 1.5rem;
}

.article-content > div {
  margin-bottom: 1.5rem;
}

.article-content > pre {
  background: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.8);
  padding: 20px;
}

.article-content *:not(.highlight):not(pre) > code {
  background: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.8);
  padding: 3px 4px;
  margin: 0 2px;
}

.article-content .highlight pre {
  margin-bottom: 0;
}

.article-content li p {
  margin-bottom: 0.75rem;
}

.article-content figure {
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.article-content img {
  margin-bottom: 0.5rem;
  line-height: 1;
  max-width: 100%;
  height: auto;
}

.article-content figcaption {
  font-size: 1rem;
  color: rgba(0, 0, 0, 0.7);
  font-style: italic;
}

/* FOOTNOTES */
/* Note: .footnotes is also the class that blackfriday markdown parser creates for footnotes. */
.article-content .footnotes {
  font-size: 80%;
  margin-top: 3rem;
}

.article-content .footnotes p {
  margin-bottom: 0.5rem;
}

.article-content .footnotes .footnote-backref {
  box-shadow: none;
}

/* BOX */
.article-content .alert {
  color: rgba(0, 0, 0, 0.8);
  background-color: var(--bs-gray-300);
  border-color: var(--bs-gray-400);
}

.article-content .alert,
.article-content .accordion {
  margin-top: 3rem;
  margin-bottom: 3rem;
}

.article-content .alert > *:last-child,
.article-content .accordion-body > *:last-child {
  margin-bottom: 0;
}

.article-content .alert > *:first-child,
.article-content .accordion-body > *:first-child {
  margin-top: 0;
}

.article-content .accordion-item {
  color: rgba(0, 0, 0, 0.8);
  background-color: var(--bs-gray-300);
  border-color: var(--bs-gray-400);
}

.article-content .accordion-header {
  margin-top: 0;
}

.article-content .accordion-button {
  color: rgba(0, 0, 0, 0.8);
  font-size: inherit;
  font-weight: inherit;
  background-color: var(--bs-gray-300);
  border: none;
  box-shadow: none;
}

.article-content .accordion-button:not(.collapsed) {
  box-shadow: inset 0 -1px 0 var(--bs-gray-500);
}

.article-content .accordion-button:hover {
  background-color: var(--bs-gray-400);
}

.article-content .accordion-button:focus {
  box-shadow: var(--bs-accordion-btn-focus-box-shadow);
}

.article-content .accordion-button::after {
  background-image: var(--bs-accordion-btn-icon);
}

/* Make sure medium zoom image is on top of everything else, especially bootstrap navbar */
.medium-zoom-overlay {
  z-index: 9000;
}
.medium-zoom-image {
  z-index: 9001;
}

/* PRINT STYLES */
@media print {
  @page {
    margin: 60pt 60pt 60pt 60pt;
  }

  .article-content > *:last-child {
    margin-bottom: 0; /* Avoid empty last page. */
  }

  .site-header,
  .site-related,
  .site-footer {
    display: none;
  }

  .post-header,
  .page-header {
    padding-top: 0;
  }

  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  blockquote {
    break-inside: avoid;
  }

  /* Hack to avoid page break after headings. */
  h1::after,
  h2::after,
  h3::after,
  h4::after,
  h5::after,
  h6::after {
    display: block;
    height: 7rem;
    margin-bottom: -7rem;
    content: "";
  }

  h1::before,
  h2::before,
  h3::before,
  h4::before,
  h5::before,
  h6::before {
    display: none !important;
  }
}
