/* Coding Horror inspired styles */

:root {
  --background-color: #ffffff;
  --text-color: #333333;
  --heading-color: #0b57a3;
  --link-color: #0b57a3;
  --border-color: #e0e0e0;
  --light-gray: #f5f5f5;
  --container-width: 1000px;
  --content-width: 720px;
}

html {
  box-sizing: border-box;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-color);
  background-color: var(--background-color);
  margin: 0;
  padding: 0;
}

.gh-viewport {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.gh-head {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.gh-head-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 4vmin;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gh-head-brand {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0 0 1.5rem 0;
  display: flex;
  align-items: center;
  position: relative;
}

.gh-head-brand a {
  color: var(--heading-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
}

/* .gh-head-brand a img {
  max-height: 45px;
  max-width: 320px;
  object-fit: contain;
  margin: 0 auto;
} */

.gh-navigation-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
}

/* .gh-navigation-logo.is-title {
  max-height: 45px;
  width: auto;
} */

@media (max-width: 768px) {
  .gh-navigation-logo.is-title {
    max-width: 70%;
    height: auto;
  }
}

.gh-head-title {
  font-weight: 700;
  font-family: 'Frutiger', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 2.4rem;
  color: var(--heading-color);
  position: relative;
}

.gh-head-title::before {
  content: "W";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 55px;
  height: 55px;
  background-color: var(--heading-color);
  color: white;
  border-radius: 5px;
  font-size: 2rem;
  font-weight: 800;
  margin-right: 12px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.gh-head-menu {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: center;
}

.gh-head-menu ul {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gh-head-menu li {
  margin: 0 0 0 1.5rem;
  padding: 0;
}

.gh-head-menu li a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
}

.gh-head-menu li a:hover {
  color: var(--link-color);
  text-decoration: underline;
}

.gh-container {
  flex-grow: 1;
  padding: 3rem 0;
}

.gh-container-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 4vmin;
}

.gh-feed {
  max-width: var(--content-width);
  margin: 0 auto;
}

.gh-post {
  margin-bottom: 4rem;
}

.gh-post-title {
  font-family: 'Merriweather', serif;
  font-size: 2.4rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

.gh-post-title a {
  color: var(--heading-color);
  text-decoration: none;
}

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

.gh-post-meta {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
  font-size: 1rem;
  color: #666666;
}

.gh-post-date {
  margin-right: 10px;
}

.gh-post-excerpt {
  margin-bottom: 1rem;
}

.gh-read-more {
  color: var(--link-color);
  text-decoration: none;
}

.gh-read-more:hover {
  text-decoration: underline;
}

.gh-pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.gh-pagination-item {
  color: var(--link-color);
  text-decoration: none;
}

.gh-pagination-item:hover {
  text-decoration: underline;
}

.gh-page-number {
  color: #666666;
}

.gh-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: #666666;
}

.gh-footer-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 4vmin;
}

.gh-footer ul {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gh-footer li {
  margin-right: 1.5rem;
}

.gh-footer a {
  color: #666666;
  text-decoration: none;
}

.gh-footer a:hover {
  color: var(--link-color);
  text-decoration: underline;
}

.gh-copyright {
  margin-top: 1rem;
}

/* Tags section */
.gh-tags {
  background-color: var(--light-gray);
  border-radius: 5px;
  padding: 2rem;
  margin-bottom: 3rem;
}

.gh-tags h3 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--heading-color);
}

.gh-tags-list {
  display: flex;
  flex-wrap: wrap;
}

#tag_cloud {
  margin-bottom: 2rem;
}

#tag_cloud a {
  display: inline-block;
  margin: 0 10px 10px 0;
  padding: 5px 10px;
  background: var(--light-gray);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  color: var(--text-color);
  text-decoration: none;
}

#tag_cloud a:hover {
  background: var(--border-color);
  color: var(--link-color);
}

/* Donate section */
.donate {
  background-color: var(--light-gray);
  border-radius: 5px;
  padding: 2rem;
  margin: 3rem auto;
  text-align: center;
  max-width: var(--content-width);
}

.donate h3 {
  margin-top: 0;
  color: var(--heading-color);
}

.donate em {
  font-style: italic;
  display: block;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

#QR {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

#QR > div {
  text-align: center;
}

#QR img {
  width: 180px;
  border-radius: 5px;
}

p>img{
  max-width: 100%;
  height: auto;
}


/* Post navigation */
.gh-post-navigation {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.gh-post-previous,
.gh-post-next {
  color: var(--link-color);
  text-decoration: none;
  font-weight: 500;
}

.gh-post-previous {
  margin-right: auto;
}

.gh-post-next {
  margin-left: auto;
}

.gh-post-previous:hover,
.gh-post-next:hover {
  text-decoration: underline;
}


/* Search box */
.search-form {
  display: flex;
  align-items: center;
}

#search-box {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px 0 0 4px;
  font-size: 16px;
  width: 200px;
}

#search-submit {
  padding: 8px 16px;
  background: var(--link-color);
  color: white;
  border: none;
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  font-size: 16px;
}

/* Dropdown menu */
.drop-down > ul {
  position: relative;
}

.drop-down > ul > li {
  position: relative;
}

.drop-down > ul > li > ul {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  padding: 10px;
  min-width: 200px;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  display: none;
  z-index: 100;
}

.drop-down > ul > li:hover > ul {
  display: block;
}

.drop-down > ul > li > ul > li {
  display: block;
  margin: 8px 0;
}

/* Mobile navigation and responsiveness */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--heading-color);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 5px;
}

.mobile-menu-toggle:before {
  content: "☰";
}


/* Hide GitHub ribbon on mobile devices */
@media (max-width: 768px) {
  .github-fork-ribbon {
    display: none;
  }
}

@media (max-width: 768px) {
  .gh-head {
    padding: 1rem 0;
  }

  .gh-head-inner {
    flex-direction: column;
    align-items: center;
  }
  
  .gh-head-brand {
    margin-bottom: 1rem;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  .mobile-menu-toggle {
    display: block;
    position: absolute;
    right: 20px;
    top: 20px;
  }

  .gh-head-menu {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
  }
  
  .gh-head-menu.active {
    max-height: 500px;
  }

  .gh-head-menu ul {
    flex-direction: column;
    padding: 0;
    width: 100%;
  }

  .gh-head-menu li {
    margin: 0;
    padding: 0;
    width: 100%;
    text-align: center;
    border-top: 1px solid var(--border-color);
  }
  
  .gh-head-menu li a {
    display: block;
    padding: 12px;
  }
  
  .drop-down > ul > li > ul {
    position: static;
    box-shadow: none;
    padding: 0;
    width: 100%;
  }
  
  .drop-down > ul > li > ul > li {
    margin: 0;
    border-top: 1px solid var(--border-color);
  }
  
  .drop-down > ul > li > ul > li a {
    padding-left: 25px;
    background-color: #f9f9f9;
  }
  
  .gh-post-title {
    font-size: 1.8rem;
  }
  
  .gh-tags {
    display: none;
  }
  
  .gh-main {
    width: 100% !important;
  }
  
  #QR {
    flex-direction: column;
    align-items: center;
  }
}

/* GitHub ribbon */
.github-fork-ribbon {
  width: 12.1em;
  height: 12.1em;
  position: absolute;
  overflow: hidden;
  top: 0;
  right: 0;
  z-index: 9999;
  pointer-events: none;
  font-size: 13px;
  text-decoration: none;
  text-indent: -999999px;
}

.github-fork-ribbon:before, .github-fork-ribbon:after {
  position: absolute;
  display: block;
  width: 15.38em;
  height: 1.54em;
  top: 3.23em;
  right: -3.23em;
  transform: rotate(45deg);
}

.github-fork-ribbon:before {
  content: "";
  padding: 0.38em 0;
  background-color: #a00;
  background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15));
  box-shadow: 0 0.15em 0.23em 0 rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.github-fork-ribbon:after {
  content: attr(title);
  color: #fff;
  font: 700 1em "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.54em;
  text-decoration: none;
  text-shadow: 0 -0.08em rgba(0, 0, 0, 0.5);
  text-align: center;
  text-indent: 0;
  padding: 0.15em 0;
  margin: 0.15em 0;
  border-width: 0.08em 0;
  border-style: dotted;
  border-color: #fff;
  border-color: rgba(255, 255, 255, 0.7);
}
