h4 {
  letter-spacing: .1rem; }
.container {
  max-width: 800px; }
.header {
  margin-top: 60px;
  margin-bottom: 60px; 
  text-align: left; }
.main-description h1 {
  margin-bottom: 0px; }
.main-description p {
  margin-bottom: 0px; }
.main-description .fa {
  font-size: 22px;
  margin-top: 5px; }
.paper {
  margin-bottom: 20px }
/* .paper .title { text-transform: uppercase; } */
.paper p {
  margin-bottom: 2px }
.paper-buttons {
  margin-top: 5px }
.paper .button {
  display: inline-block;
  height: 25px;
  padding: 0 25px;
  font-weight: 100;
  line-height: 25px;
  text-transform: none; }
.section-header {
  text-transform: uppercase;
  font-size: 1.5rem;
  letter-spacing: .2rem;
  font-weight: 600; }
.docs-section {
  border-top: 1px solid #eee;
  padding: 4rem 0;
  margin-bottom: 0;}
.footer {
  text-align: center;
  color: rgba(0, 0, 0, 0.4);
  border-top: 1px solid #eee;
  padding: 15px 0 40px 0;
  margin-bottom: 0;}
.navbar {
  display: none; }
.title-subtitle h3 {
  margin-bottom: 0px; }
.title-subtitle h5 {
  color: rgba(0, 0, 0, 0.60); }
.image {
  text-align: center; }

/*  ================ Project styling  ================ */
.project-container {
  margin-bottom: 30px;
}
.project-image-container {
  border: 1px solid rgba(0,0,0,0.2);
  padding: 3px;
  transition: 0.3s;
}
.project-image-container:hover {
  transition: 0.3s;
}
.project-image-container:hover img {
  opacity: 0.4;
}
.project-caption {
  padding: 3px;
}

/* Larger than phone */
@media (min-width: 550px) {
  .header {
    margin-top: 5rem; }
}

/* Larger than tablet */
@media (min-width: 750px) {
  /* Navbar */
  .navbar + .docs-section {
    border-top-width: 0; }
  .navbar,
  .navbar-spacer {
    display: block;
    width: 100%;
    height: 6.5rem;
    background: #fff;
    z-index: 99;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee; }
  .navbar-spacer {
    display: none; }
  /* Ensure anchored sections are fully visible below fixed navbar */
  .docs-section {
    scroll-margin-top: calc(6.5rem);
  }
  .navbar > .container {
    width: 100%; }
  .navbar-list {
    list-style: none;
    margin-bottom: 0; }
  .navbar-item {
    position: relative;
    float: left;
    margin-bottom: 0; }
  .navbar-link {
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .2rem;
    margin-right: 35px;
    text-decoration: none;
    line-height: 6.5rem;
    color: #222; }
  .navbar-link.active {
    color: #33C3F0; }
  .has-docked-nav .navbar {
    position: fixed;
    top: 0;
    left: 0; }
  .has-docked-nav .navbar-spacer {
    display: block; }
  /* Re-overiding the width 100% declaration to match size of % based container */
  .has-docked-nav .navbar > .container {
    width: 80%; }

  /* Popover */
  .popover.open {
    display: block;
  }
  .popover {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
    top: 92%;
    left: -50%;
    -webkit-filter: drop-shadow(0 0 6px rgba(0,0,0,.1));
       -moz-filter: drop-shadow(0 0 6px rgba(0,0,0,.1));
            filter: drop-shadow(0 0 6px rgba(0,0,0,.1)); }
  .popover-item:first-child .popover-link:after, 
  .popover-item:first-child .popover-link:before {
    bottom: 100%;
    left: 50%;
    border: solid transparent;
    content: " ";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none; }
  .popover-item:first-child .popover-link:after {
    border-color: rgba(255, 255, 255, 0);
    border-bottom-color: #fff;
    border-width: 10px;
    margin-left: -10px; }
  .popover-item:first-child .popover-link:before {
    border-color: rgba(238, 238, 238, 0);
    border-bottom-color: #eee;
    border-width: 11px;
    margin-left: -11px; }
  .popover-list {
    padding: 0;
    margin: 0;
    list-style: none; }
  .popover-item {
    padding: 0;
    margin: 0; }
  .popover-link {
    position: relative;
    color: #222;
    display: block;
    padding: 8px 20px;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 1.0rem;
    font-weight: 600;
    text-align: center;
    letter-spacing: .1rem; }
  .popover-item:first-child .popover-link {
    border-radius: 4px 4px 0 0; }
  .popover-item:last-child .popover-link {
    border-radius: 0 0 4px 4px;
    border-bottom-width: 0; }
  .popover-link:hover {
    color: #fff;
    background: #33C3F0; }
  .popover-link:hover,
  .popover-item:first-child .popover-link:hover:after {
    border-bottom-color: #33C3F0; }
}

/* Misc page: remove top border and add card styling */
#misc.docs-section {
  border-top: 0;
  padding-top: 2rem;
}

/* Footprint page: remove top border to match Misc */
#footprint.docs-section {
  border-top: 0;
  padding-top: 2rem;
}

/* Mobile menu: visible on small screens only */
.mobile-menu {
  display: block;
  position: relative;
  margin: 10px 0 20px;
}
@media (min-width: 750px) {
  .mobile-menu { display: none; }
}

/* Fixed topbar (always visible on all devices) */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3.5rem;
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid #eee;
  z-index: 1000;
}
.topbar-spacer {
  height: 3.5rem;
}
.topbar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.topbar-item {
  float: left;
}
.topbar-link {
  display: block;
  padding: 0 16px;
  line-height: 3.5rem;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2rem;
  color: #222;
}
.topbar-link:hover { color: #33C3F0; }
/* Clear floats inside container */
.topbar .container::after { content: ""; display: table; clear: both; }

/* Back-to-top button (mobile: in topbar) */
.topbar-backtotop-link {
  padding: 0 16px; /* keep spacing consistent with other topbar links */
  height: 3.5rem;
  display: inline-flex;
  align-items: center; /* equal top/bottom spacing */
}
.topbar-backtotop-square {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.92);
  color: rgba(0,0,0,0.55);
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
  vertical-align: middle;
}
.topbar-backtotop-link:hover .topbar-backtotop-square {
  color: rgba(0,0,0,0.75);
  border-color: rgba(0,0,0,0.16);
}

/* Hide topbar on desktop, keep only on mobile */
@media (min-width: 750px) {
  .topbar,
  .topbar-spacer {
    display: none;
  }
}

/* Back-to-top floating action button (desktop only, Footprint page via layout) */
.back-to-top-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(255,255,255,0.92);
  color: rgba(0,0,0,0.55);
  text-decoration: none;
  display: none; /* enabled on desktop */
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 34px rgba(0,0,0,0.14);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1200;
}
.back-to-top-fab:hover {
  color: rgba(0,0,0,0.78);
  border-color: rgba(0,0,0,0.16);
  transform: translateY(-1px);
}
.back-to-top-fab:active {
  transform: translateY(0);
}
@media (min-width: 750px) {
  .back-to-top-fab { display: inline-flex; }
}

/* Stars styling */
.stars i { color: #000000; margin-right: 2px; }

/* Footprint map + gallery */
.footprint-map-wrap { margin: 1rem 0 2rem; }
.footprint-map { width: 100%; height: 360px; border: 1px solid #eee; border-radius: 8px; }
@media (max-width: 750px) {
  .footprint-map { height: 280px; }
}

.footprint-trip { margin-top: 2.5rem; }
/* Slightly smaller typography for title/date/rating (all screen sizes) */
.footprint-trip-title { margin-bottom: 0.75rem; font-size: 1.5em; }
.footprint-trip-meta { font-weight: 300; font-size: 0.8em; color: rgba(0,0,0,0.55); }
.footprint-trip-blurb { margin: -0.25rem 0 1rem; color: rgba(0,0,0,0.7); }
.footprint-empty { color: rgba(0,0,0,0.55); }

@media (min-width: 750px) {
  .footprint-trip-blurb { font-size: 1.1em; }
}

.footprint-grid {
  column-count: 3;
  column-gap: 10px;
}
@media (max-width: 750px) {
  /* Mobile gallery: portrait = 2 columns, landscape = full width */
  .footprint-grid {
    column-count: initial;
    column-gap: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    grid-auto-flow: dense;
  }
  .footprint-thumb {
    display: block;
    margin: 0;
  }
  .footprint-thumb.landscape {
    grid-column: 1 / -1;
  }
  .footprint-thumb.full {
    grid-column: 1 / -1;
  }

  .footprint-trip-meta { font-weight: 300; font-size: 0.6em; color: rgba(0,0,0,0.55);}
}
.footprint-thumb {
  display: inline-block;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
  margin: 0 0 10px 0;
  break-inside: avoid;
}
.footprint-thumb img {
  width: 100%;
  height: auto;
  display: block;
}

/* Generic lazy image placeholder (used when src points to a small placeholder) */
img.lazy {
  background-image: url('../../assets/loading.gif');
  background-repeat: no-repeat;
  background-position: 50% 50%;
  background-size: 50px 50px;
  min-height: 80px;
}

/* Leaflet popup */
.footprint-popup-title { font-weight: 600; margin-bottom: 2px; }
.footprint-popup-sub { font-size: 12px; color: rgba(0,0,0,0.6); margin-bottom: 6px; }
.footprint-popup-img { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; border: 1px solid rgba(0,0,0,0.08); margin: 6px 0; }
.footprint-popup-link {
  display: block;
  margin-top: 8px;
  text-decoration: none;
}

/* Leaflet tooltip (legacy) */
.leaflet-tooltip.footprint-tooltip {
  background: #fff;
  color: #111;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.14);
  padding: 10px 12px;
  max-width: 260px;
  pointer-events: auto;
  white-space: normal;
}
.leaflet-tooltip.footprint-tooltip:before {
  border-top-color: rgba(0,0,0,0.12);
}

/* Leaflet popup styling for footprint (replaces tooltip on desktop to keep it clickable) */
.leaflet-popup.footprint-popup-leaflet .leaflet-popup-content-wrapper {
  background: #fff;
  color: #111;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.14);
  position: relative;
}
.leaflet-popup.footprint-popup-leaflet .leaflet-popup-content {
  margin: 10px 12px;
  max-width: 260px;
}

/* We draw our own arrow so we can flip it up/down/left/right */
.leaflet-popup.footprint-popup-leaflet .leaflet-popup-tip-container {
  display: none;
}

/* Base arrow pseudo-elements */
.leaflet-popup.footprint-popup-leaflet .leaflet-popup-content-wrapper::before,
.leaflet-popup.footprint-popup-leaflet .leaflet-popup-content-wrapper::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
}

/* UP (default): popup above marker, arrow points down */
.leaflet-popup.footprint-popup-leaflet.footprint-popup-dir-up .leaflet-popup-content-wrapper::before,
.leaflet-popup.footprint-popup-leaflet:not(.footprint-popup-dir-down):not(.footprint-popup-dir-left):not(.footprint-popup-dir-right) .leaflet-popup-content-wrapper::before {
  left: 50%;
  transform: translateX(-50%);
  bottom: -12px;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 12px solid rgba(0,0,0,0.12);
}
.leaflet-popup.footprint-popup-leaflet.footprint-popup-dir-up .leaflet-popup-content-wrapper::after,
.leaflet-popup.footprint-popup-leaflet:not(.footprint-popup-dir-down):not(.footprint-popup-dir-left):not(.footprint-popup-dir-right) .leaflet-popup-content-wrapper::after {
  left: 50%;
  transform: translateX(-50%);
  bottom: -11px;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-bottom: 11px solid #fff;
}

/* DOWN: popup below marker, arrow points up */
.leaflet-popup.footprint-popup-leaflet.footprint-popup-dir-down .leaflet-popup-content-wrapper::before {
  left: 50%;
  transform: translateX(-50%);
  top: -12px;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 12px solid rgba(0,0,0,0.12);
}
.leaflet-popup.footprint-popup-leaflet.footprint-popup-dir-down .leaflet-popup-content-wrapper::after {
  left: 50%;
  transform: translateX(-50%);
  top: -11px;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 11px solid #fff;
}

/* RIGHT: popup right of marker, arrow points left */
.leaflet-popup.footprint-popup-leaflet.footprint-popup-dir-right .leaflet-popup-content-wrapper::before {
  top: 50%;
  transform: translateY(-50%);
  left: -12px;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 12px solid rgba(0,0,0,0.12);
}
.leaflet-popup.footprint-popup-leaflet.footprint-popup-dir-right .leaflet-popup-content-wrapper::after {
  top: 50%;
  transform: translateY(-50%);
  left: -11px;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 11px solid #fff;
}

/* LEFT: popup left of marker, arrow points right */
.leaflet-popup.footprint-popup-leaflet.footprint-popup-dir-left .leaflet-popup-content-wrapper::before {
  top: 50%;
  transform: translateY(-50%);
  right: -12px;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-right: 12px solid rgba(0,0,0,0.12);
}
.leaflet-popup.footprint-popup-leaflet.footprint-popup-dir-left .leaflet-popup-content-wrapper::after {
  top: 50%;
  transform: translateY(-50%);
  right: -11px;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-right: 11px solid #fff;
}

/* Anchor offset so "View gallery" shows the title, not just the grid */
#footprint .footprint-trip { scroll-margin-top: calc(3.5rem + 1rem); }
@media (min-width: 750px) {
  #footprint .footprint-trip { scroll-margin-top: calc(6.5rem + 1rem); }
}