/* Target the homepage only */
[data-md-page="index"] .homepage-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Force main and sub title to center even if Markdown tweaks them */
[data-md-page="index"] .main-title,
[data-md-page="index"] .sub-title {
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
  text-align: center !important;
  width: 100% !important;
}

.logo-wrapper {
  text-align: center;
  width: 100%;
}

.cover-logo {
  display: block;
  margin: 1em auto 0.5em;
  width: 400px;
}

/* Main title spacing and centering */
.main-title {
  font-size: 1.6rem;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  text-align: center;
  display: inline-block;
  width: 100%;
}

/* Sub-title spacing and centering */
.sub-title {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  text-align: center;
  display: inline-block;
  width: 100%;
}

/* Image scaled up a bit */
.cover-image {
  display: block;
  margin: 20px auto;
  width: 60%;
  max-width: 500px;
  border: 2px solid #ccc;
}

/* Revision text */
/* .revision {
  font-size: 0.9em;
  font-weight: bold;
  color: #888;
  margin-top: 2em;
  text-align: center;
} */

/* Smooth fade-in animation without layout shift */
.cover-fade {
  opacity: 0;
  animation: fadeIn 1.2s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Hide the page title only on the homepage */
.md-content__inner h1:first-of-type {
  display: none;
}

/* Fade-in base */
.fade-in-image {
  opacity: 0;
  animation: fadeIn ease-in forwards;
}

/* Logo */
.fade-delay-1 {
  animation-delay: 0.3s;
  animation-duration: 1.2s;
}

/* Photo */
.fade-delay-2 {
  animation-delay: 1s;
  animation-duration: 2.5s;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.custom-footer {
  text-align: center;
  font-size: 0.7rem;         /* Slightly smaller */
  line-height: 1.2;          /* Tighter line spacing */
  color: #aaa;
  margin-top: 3em;
  padding: 1em 0;
  border-top: 1px solid #444;
}

/* Brighter body text for dark mode */
[data-md-color-scheme="slate"] .md-typeset {
  color: #ddd;
}

/* Default/light theme stays darker for contrast */
[data-md-color-scheme="default"] .md-typeset {
  color: #333;
}

/* START: Fix right-floating print/PDF icon positioning */
.md-header__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.md-header__title::after {
  content: "";
  flex-grow: 1;
}

.md-content__button {
  position: absolute;
  top: 0.2rem;
  right: 2.0rem; /* adjust as needed to tuck beside search */
  z-index: 10;
  color: #fff !important;      /* Force bright white */
  opacity: 1;                  /* Fully visible */
}

.md-content__button:hover {
  transform: scale(1.05);
  transition: all 0.2s ease-in-out;
}
/* END: Fix right-floating print/PDF icon positioning */

/* Hide empty TOC sidebar */
.md-sidebar--secondary:empty {
  display: none;
}

/* Prevent shrinking main content if TOC is empty */
.md-content {
  grid-template-columns: auto !important;
}
