/* ===================== GENERAL CLEANUP ===================== */
/* Hide hamburger + hidden menu */
.masthead .greedy-nav > button,
.greedy-nav__toggle,
.greedy-nav .hidden-links {
  display: none !important;
}

/* Hide dark-mode toggle */
#theme-toggle {
  display: none !important;
}

/* Hide “Follow” under photo + full footer block */
.author__urls-wrapper,
.page__footer,
.page__footer-follow,
.page__footer-copyright {
  display: none !important;
}

/* Keep site title on one line; size it nicely */
.masthead__menu-item.masthead__menu-item--lg a {
  font-size: 2rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px;
  text-transform: none;
  white-space: nowrap !important;
}

/* ===================== SIDEBAR PHOTO ===================== */
/* Responsive, square headshot; centered */
.author__avatar {
  width: 100% !important;
  max-width: 320px !important;   /* cap on mobile/tablet */
  aspect-ratio: 1 / 1;
  margin: 0 auto 12px auto !important;
  display: block !important;
  overflow: hidden !important;
  border-radius: 0 !important;   /* 50% = circle if desired */
  text-align: center;
}

.author__avatar img,
img.author__avatar {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  border-radius: 0 !important;
  display: block !important;
  margin: 0 auto !important;
}

.photo-credit {
  font-size: 0.65rem;
  color: #777;
  text-align: center;
  margin-top: 4px;
}

/* ===================== ABSTRACT DROPDOWNS ===================== */
.page__content details {
  margin-top: 0 !important;
  margin-bottom: 1rem;
}
.page__content p + details {
  margin-top: 0.25rem !important;
}
@supports selector(:has(*)) {
  .page__content p:has(+ details) {
    margin-bottom: 0.25rem !important;
  }
}
.page__content details summary {
  padding: 0.2rem 0;
  cursor: pointer;
  font-weight: 600;
}

/* ===================== DESKTOP LAYOUT: SIDEBAR + CONTENT ===================== */
@media (min-width: 1024px) {
  /* Grid layout: sidebar + main content */
  #main {
    display: grid !important;
    grid-template-columns: 420px minmax(0,1fr) !important; /* wider sidebar */
    gap: 32px !important;
    align-items: start !important;
  }

  /* Sidebar behavior */
  #main .sidebar {
    padding-top: 0 !important;
    margin-top: 0 !important;
    position: relative !important;
    width: auto !important;
    max-width: none !important;
    float: none !important;
    flex: none !important;
  }
  #main .sidebar.sticky {
    position: sticky !important;
    top: 100px !important;  /* breathing room under masthead when scrolling */
  }

  /* Uncap all theme width clamps */
  .initial-content,
  .page,
  .page__inner-wrap,
  .wrap,
  .container {
    max-width: none !important;
    width: auto !important;
    margin: 0 !important;
  }

  /* Wider reading column */
  .page__content {
    max-width: 1100px !important;  /* adjust: 1000–1200px to taste */
    width: 100% !important;
    margin: 0 !important;
    padding-right: 0 !important;
  }

  /* Bigger square avatar inside wider sidebar */
  #main .sidebar .author__avatar {
    width: 100% !important;
    max-width: 360px !important;   /* larger than mobile cap */
    aspect-ratio: 1 / 1;
    margin: 0 auto 12px auto !important;
    overflow: hidden !important;
  }
  #main .sidebar .author__avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
  }
}

/* ===================== MOBILE/TABLET: tighten headshot spacing ===================== */
@media (max-width:1023px){
  /* remove extra gap under the header */
  .masthead{ margin-bottom:0 !important; }

  /* zero out the sidebar's top spacing (affects when scrolled to top) */
  #main .sidebar,
  .sidebar{
    padding-top:0 !important;
    margin-top:0 !important;
  }

  /* make sure the avatar itself isn't adding spacing */
  .author__avatar{ margin-top:0 !important; }

  /* disable sticky on mobile to avoid offset gap */
  #main .sidebar.sticky{
    position:static !important;
    top:auto !important;
  }
}