/* ================================
   CSS VARIABLES — Global Site Theme
================================ */
:root {
  --main-bg: #ffffff;
  --main-text: #333;
  --header-bg: #0d1a26;
  --accent-color: #aad3ff;
  --footer-bg: #222;
  --footer-text: #ccc;
  --highlight-bg: #eef;
  --dropdown-bg: #f9f9f9;
  --submenu-bg: #f0f0f0;
  --hover-bg: #eee;
  --hover-text: #555;
}

/* ================================
   BASE RESET AND GLOBAL TEXT STYLING
================================ */
html, body {
  font-family: system-ui, sans-serif;
  margin: 0;
  padding: 0;
  background: var(--main-bg);
  color: var(--main-text);
  line-height: 1.6;
  max-width: 100%;
  overflow-x: hidden;
}

/* ================================
   HERO SECTION (default desktop alignment = left)
================================ */
.hero {
  display: block;
  width: 100%;
  padding: 0.5rem 0;
  margin-top: 0rem;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1.4rem;
  line-height: 1.4;
  text-align: center;
  color: #0d1a26;
  background-color: #f9f9f9;
}

/* MOBILE OVERRIDE: center the hero text */
@media (max-width: 600px) {
  .hero {
    text-align: center;
  }
}

/* ================================
   MAIN NAVIGATION MENU
================================ */
.site-nav ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.site-nav a,
.top-menu a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: bold;
}

.site-nav a:hover,
.top-menu a:hover {
  text-decoration: underline;
  background-color: var(--highlight-bg);
}

/* ================================
   PAGE CONTENT AREA
================================ */
.content {
  max-width: 960px;
  margin: auto;
  padding: 2rem;
}

/* ================================
   MODULE STYLING (FOR CGI OUTPUT)
================================ */
.cgi-module {
  background: white;
  padding: 1.9rem;
  margin-bottom: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* ================================
   FOOTER STYLING
================================ */
.site-footer {
  text-align: center;
  padding: 1rem;
  background: var(--footer-bg);
  color: var(--footer-text);
  font-size: 0.9rem;
}

.site-footer a:link,
.site-footer a:visited {
  color: #fff;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ================================
   Footer-popup link padding
   – Adjust padding or margin below to change space around each link
================================ */
.footer-popups .footer-link {
  display: inline-block;
  padding: 0.5rem 1rem;   /* ? change these values to add more/less inset padding */
  margin: 0.5 0.5rem;       /* ? change horizontal margin to adjust spacing between links */
  color: inherit;         /* keep existing white color */
  text-decoration: none;  /* preserve hover underline */
}

/* ================================
   TILE-BASED MODULE MENU SYSTEM
================================ */
.menu-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin: 2rem 0;
}

.menu-item {
  flex: 0 1 30%;
  background-color: #fff;
  padding: 1rem;
  border: 1px solid var(--main-text);
  border-radius: 5px;
  box-sizing: border-box;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.menu-item a,
.menu-item pre {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ================================
   RESPONSIVE TWEAKS
================================ */
@media screen and (max-width: 768px) {
  .menu-item {
    flex: 0 1 100%;
  }

  .content {
    padding: 1rem;
  }

  #about-skygaze {
    font-size: 1rem;
    padding: 12px 16px;
    max-width: 90%;
  }
}

/* ================================
   ACCESSIBILITY
================================ */
a:focus, .dropbtn:focus {
  outline: 2px solid #66afe9;
  outline-offset: 2px;
}

.about-box,
.modal-content {
  text-align: left;
  max-height: 80vh;    /* limit height to 80% of viewport */
  overflow-y: auto;    /* allow vertical scrolling when content exceeds max-height */
}

/*–– Category icon that appears on scroll ––*/
.category-hover {
  position: fixed;
  bottom: 5rem;        /* ? move it up/down */
  right: 1rem;           /* ? move it left/right */
  width: 80px;           /* ? icon size */
  height: 80px;
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;  /* ? fade duration & easing */
  z-index: 1000;
}

.auto-scroll-container {
  position: relative;
  overflow: hidden;
}

.scroll-wrapper {
  display: flex;
  overflow-x: scroll;               /* enable horizontal scrolling */
  scroll-behavior: auto;            /* we’ll control smoothness in JS */
  -webkit-overflow-scrolling: touch; /* iOS momentum scrolling */
  scrollbar-width: none;
}

/* hide the scrollbar, if you like */
.scroll-wrapper::-webkit-scrollbar {
  display: none;
  height: 0;
}

.thumb-tile {
  flex: 0 0 auto;
  width: 120px;
  margin-right: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.thumb-tile img {
  display: block;
  max-height: 120px;
  height: auto;
  width: auto;
  object-fit: contain;
  border-radius: 4px;
  transition: opacity 0.5s ease-in;
}

.thumb-tile img {
  height: 120px;
  width: auto;
  object-fit: contain;
}

.thumb-label {
  font-size: 13px;
  margin-top: 6px;
  padding: 2px 6px;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  text-align: center;
  line-height: 1.3;
  max-width: 100%;
  word-wrap: break-word;
}

     .scroll-btn {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      z-index: 2;
      background-color: rgba(0, 0, 0, 0.5);
      color: #fff;
      border: none;
      padding: 10px 14px;
      font-size: 20px;
      cursor: pointer;
      border-radius: 50%;
      box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
    }

     .scroll-btn.left {
     left: 10px;
    }

     .scroll-btn.right {
      right: 10px;
    }

/* hook up your three category images */
body.facts-page   .category-hover { background-image: url('/images/preview-facts.png'); }
body.strange-page .category-hover { background-image: url('/images/preview-strange.png'); }
body.mysteries-page .category-hover { background-image: url('/images/preview-mysteries.png'); }
