/* @import url("https://fonts.googleapis.com/css2?family=Montserrat&display=swap"); */

body {
  background-color: #292c35;
  color: #fff;
  min-height:100%;
  position:relative;

  /* fallback height */
  min-height:100vh;

  /* new small viewport height for modern browsers */
  min-height:100svh;
}

.imgbox {
  display: grid;
  height: 100%;
}

.center-fit {
  text-align: center;
  margin-left: 15em;
  max-height: 100%;
  max-width: 60%;
}

* {box-sizing: border-box;}

header {
  text-align: center;
}

#subheader {
  all: unset;
  display: block;
  font-size: 1.15em;
  margin-top: 1em;
  margin-bottom: 1em;
  margin-left: 0;
  margin-right: 0;
  font-weight: bold;
}

main {
  padding-bottom: 60px;
}

h3 {
  text-indent: 0.8em;
}

main p {
  margin-left: 1.8em;
}

main span.callsign {
  font-family: monaco,Consolas,Lucida Console,monospace;
}

footer {
  position: absolute;
  height: 40px;
  bottom: 50px;
  padding-top: 2em;
}

a {
  color: #fff;
  text-decoration: underline;
}

a:hover {
  color: #292c35;
  background-color: #fff;
}

a:visited {
  text-decoration: none;
}

a:active {
  text-decoration: none;
}

a[target="_blank"]::after {
  content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVR42qXKwQkAIAxDUUdxtO6/RBQkQZvSi8I/pL4BoGw/XPkh4XigPmsUgh0626AjRsgxHTkUThsG2T/sIlzdTsp52kSS1wAAAABJRU5ErkJggg==);
  filter: invert(100%);
  margin: 0 3px 0 5px;
}

a[target=_blank]:hover::after {
  all: unset;
  content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVR42qXKwQkAIAxDUUdxtO6/RBQkQZvSi8I/pL4BoGw/XPkh4XigPmsUgh0626AjRsgxHTkUThsG2T/sIlzdTsp52kSS1wAAAABJRU5ErkJggg==);
  margin: 0 3px 0 5px;
}

blockquote.code {
  background-color: #1e1e1e;
  padding: 0.3em 0.8em 0.3em 0.8em;
  width: fit-content;
  border-radius: 0.30rem;
}

/* Mobile responsive PGP key display - only for standalone pre blocks */
main > pre {
  overflow-x: auto;
  white-space: pre;
  word-wrap: normal;
  background-color: #1e1e1e;
  padding: 1em;
  border-radius: 0.30rem;
  font-size: 0.85em;
  line-height: 1.4;
  width: fit-content;
}

@media only screen and (max-width: 783px) {
  main > pre {
    font-size: 0.75em;
    padding: 0.8em;
    overflow-x: auto;
    max-width: 100%;
    width: 100%;
    white-space: pre;
  }
  
  main > pre code {
    font-size: inherit;
  }
}

@media only screen and (max-width: 783px) {
  .hamburger {
    display: block;
  }
  
  .subtitle-break {
    font-size: 0;
  }
  
  .subtitle-break::before {
    content: "\A";
    white-space: pre;
    font-size: 1.15em;
  }
}

@media only screen and (min-width: 784px) {
  body {
    margin-left: 15em;
  }

  main {
    max-width: 70%;
  }

  header {
    text-align: left;
  }

  .imgbox {
    display: grid;
    height: 100%;
  }

  .center-fit {
    margin-top: 2.3em;
    margin-left: -7.2em;
    max-height: 100%;
    max-width: 100%;
  }

  .hamburger {
    display: none;
  }

  #nav {
    margin-left: -15em;
    padding-left: 1.8em;
    width: 14em;
    position: fixed;
    top: 0;
    overflow: auto;
    height: 100%;
    right: auto;
    background-color: transparent;
    box-shadow: none;
    padding-top: 0;
    padding-right: 0;
    padding-bottom: 0;
  }
  
  #nav ul {
    margin-top: 0;
  }
}

/* Hamburger menu for mobile */
.hamburger {
  position: absolute;
  top: 1em;
  right: 1em;
  width: 30px;
  height: 30px;
  cursor: pointer;
  z-index: 1001;
  background: none;
  border: none;
  padding: 0;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: #fff;
  margin: 5px auto;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Navigation styles */
#nav {
  text-align: left;
}

#nav a {
}

#nav ul  {
  list-style: none;
  padding-left: 0;
}

#nav ul li {
  font-size: 1.17em;
  margin-top: 1em;
  margin-bottom: 1em;
  margin-left: 0;
  margin-right: 0.5em;
  font-weight: bold;
}

#nav ul li a:hover {
  text-decoration: underline;
}

/* Mobile navigation */
@media only screen and (max-width: 783px) {
  #nav {
    position: fixed;
    top: 0;
    right: -250px;
    width: 250px;
    height: 100vh;
    background-color: #292c35;
    transition: right 0.3s ease;
    z-index: 1000;
    padding: 2em 1em;
    box-shadow: -2px 0 5px rgba(0,0,0,0.3);
  }

  #nav.active {
    right: 0;
  }
  
  #nav ul {
    margin-top: 2em;
  }
}

/* Mobile subtitle line break */
.subtitle-break {
  display: inline;
}

/* Blog-specific styles */
.post {
  margin-bottom: 2em;
}

.post-header {
  margin-bottom: 1.5em;
}

.post-title {
  margin-bottom: 0.5em;
}

.post-meta {
  font-size: 0.9em;
  color: #ccc;
  margin-left: 1.8em;
}

.post-content {
  line-height: 1.6;
}

.post-navigation {
  margin: 2em 0;
  padding: 1em 0;
  border-top: 1px solid #444;
  display: flex;
  justify-content: space-between;
}

.post-navigation a {
  color: #fff;
  text-decoration: none;
}

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

.tag {
  background-color: #444;
  padding: 0.2em 0.5em;
  border-radius: 0.3em;
  font-size: 0.8em;
}

.blog-posts {
  list-style: none;
  padding: 0;
}

.blog-posts li {
  margin-bottom: 1.5em;
  padding-bottom: 1em;
  border-bottom: 1px solid #444;
}

.blog-posts li:last-child {
  border-bottom: none;
}

.post-excerpt {
  margin-left: 1.8em;
  color: #ccc;
}
