/* Basic text and links */
header {
  margin: 0 auto;
  max-width: 90%;
  padding: 2.8rem 4rem 2rem 1rem;
}

h1 {
  color: aqua;
  font-size: 60px;
}

p, li {
  color: aqua;
  padding: 5px;
  background: none;
}

li em {
  color: rebeccapurple;
  background-color: black;
}

li {
  list-style-type: none;
}

a:link {
  color: lightgreen;
  background-color: black;
}

a:visited {
  color: pink;
  background-color: black;
}

a:hover {
  text-decoration: none;
}

/* Background */
body {
  background-image: url(https://bluemsx.neocities.org/Images/Earth_Mega_CD.png);
  background-repeat: repeat;
  margin: 0;
}

/* Grid container */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(216px, 255px));
  gap: 25px;
  padding: 0 55px; /* horizontal padding */
  text-align: center;
}

/* Grid items */
.grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.grid-item img,
.grid-item video {
  width: 100%;
  height: auto;
  object-fit: contain;
  border: 3px ridge #c3c3c3;
  box-shadow: 1px 1px 3px #667667;
  cursor: zoom-in;
}

.grid-item p {
  margin: 10px 0 0;
  padding: 0;
  background: none;
  text-align: center;
}

.grid-item p a {
  font-size: 1.5rem;
  text-decoration: none;
}

.grid-item p a:hover {
  color: lightgreen;
}

/* Other text elements */
span {
  font-size: 1.6rem;
}

.under {
  text-decoration: underline aqua;
}

.percent {
  font-size: 120%;
}

/* Viewer popup */
.displayer {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 75vw;
  height: 90vh;
  background-color: black;
  padding: 20px 20px 10px 20px;
  overflow: hidden;
  z-index: 9999;
  display: none;
  border: 3px ridge #c3c3c3;
  display: flex;           /* stack content vertically */
  flex-direction: column;  /* vertical stacking */
  align-items: center;
  justify-content: center; /* vertical center if small */
  pointer-events: auto;
}

.displayer-header {
  position: relative;
  width: 100%;
  margin-bottom: 10px;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;    /* vertical alignment */
}

.displayer-header h2 {
  margin: 0;
  padding: 0;
  line-height: 1;
  color: aqua;
  text-align: center;
  flex: none;              /* natural sizing */
  position: absolute;      /* remove from normal flow */
  left: 50%;               /* center horizontally */
  transform: translateX(-50%);
  width: auto;
}

.displayer-header input[type="button"] {
  position: absolute;      /* close button on right */
  right: 0;
  top: -10px;              /* nudge down a bit */
  padding: 5px 10px;
  background: aqua;
  color: black;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

.displayer-header input[type="button"]:hover {
  background: black;
  color: aqua;
}

/* Close button style */
.displayer input[type="button"] {
  height: auto;
  padding: 5px 10px;
  background: aqua;
  color: black;
  cursor: pointer;
  margin: 0;
  transition: background-color 0.3s, color 0.3s;
}

.displayer input[type="button"]:hover {
  background: black;
  color: aqua;
}

.displayer img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  margin-bottom: 0;
  border: 3px ridge #c3c3c3;
  object-fit: contain; /* keep aspect ratio */
}

.displayer h2,
.displayer h3 {
  color: aqua;
  text-align: center;
  margin-top: 0;
  margin-bottom: 0;
}

.displayer hr {
  margin: 0.5em 0;
  border: none;
  border-top: 2px solid aqua; /* or whatever style you want */
  display: block; /* so we can toggle it */
}

/* Center container for buttons and image */
.center {
  position: relative;
  text-align: center;
  width: 100%;
  height: 80vh;
  pointer-events: none;  /* disable pointer events on container */

  display: flex;
  align-items: center;     /* vertical center */
  justify-content: center; /* horizontal center */
  gap: 20px;               /* spacing between buttons and image */
}

.center a {
  pointer-events: auto; /* enable pointer events on link only */
}

.center button {
  position: absolute;
  top: 50%;                  /* vertical center */
  transform: translateY(50%); /* adjust placement */
  background: aqua;
  cursor: pointer;
  pointer-events: auto;
}

.center button:disabled {
  background: #999;
  color: #333;
  cursor: not-allowed;
}

.center button:disabled:hover {
  background: #999;
  color: #333;
  cursor: not-allowed;
}

.center button:first-of-type {
  left: 10px;  /* left margin */
}

.center button:last-of-type {
  right: 10px; /* right margin */
}

.center img {
  margin: 0 auto;
  border: 3px ridge #c3c3c3;
  display: block;
}

/* Image link styles */
#ImageLink {
  display: inline-block; /* shrink to image size */
  cursor: zoom-in;
}

#previewRow {
  width: 220px;
  height: 230px;
  position: absolute; /* or relative, fixed, sticky */
  top: 480px;   /* how far from the top */
  left: 0px; /* how far from the left */
  padding: 0px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* ✅ center items */
}

.headline-mark {
  background-color: black;
  color: aqua;
  display: inline;
}

/* Each preview item */
.preview-item {
  flex: 0 0 auto;
  width: 150px;
  text-align: center;
  cursor: pointer;
}

/* The image inside each preview */
.preview-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border: 3px ridge #c3c3c3;
  box-shadow: 1px 1px 3px #667;
}

/* The caption below each preview image */
.preview-caption {
  margin-top: 10px;
  color: aqua;
  font-size: 1rem;
  line-height: 1; /* more breathing room */
  word-wrap: break-word;
  overflow-wrap: break-word;
  text-align: center;
}