nav.navigation a.CVbutton {
  background: #f05b5b;
  color: #fff;
  margin-left: 12px;
}

/* ========================================
   RESPONSIVE HAMBURGER NAVIGATION (CSS-only)
   ======================================== */

/* Hidden checkbox */
.nav-toggle {
  display: none !important;
  visibility: hidden;
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

/* Hamburger icon - hidden on desktop */
.hamburger {
  display: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #5badf0;
  margin: 5px 0;
  transition: 0.3s;
}

/* Nav links - inline on desktop */
.nav-links {
  display: inline;
}

/* Mobile styles */
@media (max-width: 600px) {
  nav.navigation {
    padding: 15px 20px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: relative;
  }

  .hamburger {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
    flex-direction: column;
  }

  .nav-links a {
    display: block;
    padding: 12px 20px;
    color: #404040;
    border-bottom: 1px solid #eee;
  }

  .nav-links a:last-child {
    border-bottom: none;
  }

  .nav-links a:hover {
    background: #f5f5f5;
  }

  .nav-links a.CVbutton,
  .nav-links a.button {
    background: none !important;
    color: #5badf0 !important;
    margin: 0;
    padding: 12px 20px;
    text-align: right;
    border-bottom: 1px solid #eee;
    border-radius: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .nav-links a.CVbutton:last-child,
  .nav-links a.button:last-child {
    border-bottom: none;
  }

  /* Show nav when checkbox is checked */
  .nav-toggle:checked~.nav-links {
    display: flex;
  }

  /* Animate hamburger to X */
  .nav-toggle:checked~.hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .nav-toggle:checked~.hamburger span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle:checked~.hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

ul.tl-list {
  list-style-type: none;
}

ul.tl-list li p {
  margin-top: 0;
  padding-left: 20px;
}

.hr-dark {
  margin-top: 0;
  margin-bottom: 10px;
  border: none;
  border-top: 2px solid #4e4e4e;
}

.hr-light {
  margin-top: 0;
  margin-bottom: 10px;
  border: none;
  border-top: 2px solid #bbbbbb;
}

/* Remove bottom padding from images */
.markdown-image {
  padding-bottom: 0;
  margin-bottom: 0;
}

/* Hide empty paragraph tags that cause unwanted spacing */
p:empty {
  display: none;
  margin: 0;
  padding: 0;
}

/* Responsive styles for recent posts section */
@media (max-width: 700px) {
  #list-page {
    padding: 0 18px;
  }

  #list-page .item {
    margin: 24px 0;
  }

  #list-page .item>div {
    display: flex;
    flex-direction: column;
  }

  #list-page .title {
    width: 100%;
    font-size: 18px;
    margin-bottom: 8px;
  }

  #list-page .date {
    width: 100%;
    float: none;
    text-align: left;
    position: static;
    margin-top: 4px;
    font-size: 14px;
  }

  #list-page .summary {
    margin-top: 8px;
    margin-bottom: 24px;
  }
}

@media (max-width: 480px) {
  #list-page {
    padding: 0 12px;
  }

  #list-page .title {
    font-size: 16px;
  }

  #list-page .date {
    font-size: 13px;
  }
}

/* Responsive styles for navigation bar - tablet */
@media (max-width: 700px) and (min-width: 601px) {
  nav.navigation {
    padding: 15px 15px 10px;
  }

  nav.navigation .nav-links a {
    padding: 8px 10px;
    font-size: 14px;
  }

  nav.navigation .nav-links a.button,
  nav.navigation .nav-links a.CVbutton {
    padding: 8px 14px;
    font-size: 14px;
  }
}

/* ========================================
   Reference tooltips [1], [2], etc.
   ======================================== */

/* Allow tooltips to escape content area */
#single .content {
  overflow: visible;
}

/* Inline reference [1], [2] – trigger */
.ref-tooltip-trigger {
  cursor: help;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px dotted #888;
  padding: 0 1px;
}

.ref-tooltip-trigger:hover {
  border-bottom-color: #5badf0;
  color: #5badf0;
}

/* Container: inline-block so absolute child is out of flow on all devices (fixes mobile) */
.ref-tooltip-wrap {
  position: relative;
  display: inline-block;
  z-index: 1;
}

.ref-tooltip-wrap:hover,
.ref-tooltip-wrap:focus-within {
  z-index: 10000;
}

/* Tooltip box – hidden by default: off-screen and collapsed so it never appears inline */
.ref-tooltip-box {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  min-width: 0;
  max-width: none;
  overflow: hidden;
  font-size: 0.9em;
  line-height: 1.5;
  color: #333;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  word-break: normal;
  overflow-wrap: normal;
  white-space: normal;
  text-align: left;
}

/* Only when shown: real position, size, and interactive */
.ref-tooltip-trigger:hover+.ref-tooltip-box,
.ref-tooltip-wrap:hover .ref-tooltip-box,
.ref-tooltip-trigger:focus+.ref-tooltip-box,
.ref-tooltip-trigger:focus-visible+.ref-tooltip-box,
.ref-tooltip-trigger+.ref-tooltip-box.visible,
.ref-tooltip-box.tooltip-visible {
  left: 50%;
  top: auto;
  bottom: 100%;
  width: max-content;
  height: auto;
  min-width: 260px;
  max-width: min(360px, 90vw);
  max-height: 280px;
  margin-bottom: 6px;
  padding: 12px 14px;
  overflow: auto;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%);
}

.ref-tooltip-box a {
  color: #5badf0;
}

/* Keep tooltip content flowing normally (lists, paragraphs) */
.ref-tooltip-box p,
.ref-tooltip-box li,
.ref-tooltip-box ul {
  word-break: normal;
  overflow-wrap: normal;
  white-space: normal;
  text-align: left;
}

.ref-tooltip-box ul {
  padding-left: 1.2em;
  margin: 0.25em 0;
}