/* ----------------------------------------------------
   BACK TO TOP BUTTON
---------------------------------------------------- */
#backToTopBtn {
  display: none;
  position: fixed;
  top: 50%;
  right: 20px;                     /* sits inside reserved gutter */
  transform: translateY(-50%);
  z-index: 999;

  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 18px;
  line-height: 36px;
  text-align: center;

  background: rgba(255,255,255,0.92);
  color: #000;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  backdrop-filter: blur(5px);
}

#backToTopBtn:hover {
  background: #fff;
}

/* small screens */
@media (max-width: 600px) {
  #backToTopBtn {
    right: 12px;
    top: auto;
    bottom: 20px;
    transform: none;
  }
}


/* ----------------------------------------------------
   GLOBAL BODY
---------------------------------------------------- */
body {
  font-family: Arial, sans-serif;
  background-color: #000;
  line-height: 1;
  margin: 0;
  padding-top: 1em;
  color: #fff;
}


/* ----------------------------------------------------
   HEADER / NAVIGATION
---------------------------------------------------- */
.header-menu {
  background-color: #111;
  border-bottom: 2px solid #333;
  box-shadow: 0 4px 4px rgba(0, 0, 0, .4);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

.container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  max-width: 1200px;
  margin: 0;
}

.logo {
  height: 40px;
  width: 40px;
}

ul {
  flex-direction: row;
  width: 100%;
  text-align: center;
  display: flex;
  list-style: none;
}

ul li {
  margin-left: 0;
  margin-right: 2em;
}

ul li a {
  text-decoration: none;
  color: #fff;       /* readable on black */
  font-weight: 500;
  transition: color 0.2s;
}

/* link hover */
ul li a:hover {
  color: #4da3ff;
}


/* ----------------------------------------------------
   dropdown menu
---------------------------------------------------- */

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #222;
  min-width: 100px;
  box-shadow: 0px 8px 16px rgba(0,0,0,0.5);
  z-index: 1;
}

.dropdown-content a {
  color: #fff;
  padding: 10px 16px;
  text-decoration: none;
  display: block;
  text-align: left;
}

.dropdown-content a:hover {
  background-color: #333;
}

/*.dropdown:hover .dropdown-content {
  display: block;
}*/

/* Only show first-level dropdown on hover */
ul > li.dropdown:hover > .dropdown-content {
  display: block;
}

/* Only show nested dropdown on hover */
.dropdown-content .dropdown:hover > .dropdown-content {
  display: block;
}

/* Make nested dropdown appear to the right */
.dropdown-content .dropdown {
  position: relative;
}

.dropdown-content .dropdown-content {
  position: absolute;
  left: 50%;
  top: 0;
  display: none;
  min-width: 150px;
}

@media (max-width: 600px) {
  .dropdown-content .dropdown-content {
    left: 25%;
  }
}

.dropdown-content .dropdown:hover > .dropdown-content {
  display: block;
}

/* ----------------------------------------------------
   SECTION BASE STYLES
---------------------------------------------------- */
section {
  padding: 2em;
}

section h2 {
  padding: 1em 0 0.5em 0;
  margin: 1em;
}


/* ----------------------------------------------------
   IMAGE + FIGURE
---------------------------------------------------- */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

figure {
  margin: 0;
}

figure img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

figcaption {
  text-align: center;
  font-size: 0.9em;
  color: #444;
  margin-top: 8px;
}


/* ----------------------------------------------------
   PHOTO SECTION WIDTH + GUTTER (fix for button overlap)
---------------------------------------------------- */
:root {
  --content-max: 1000px;    /* you set 1000px – keeping it */
  --button-gutter: 96px;
}

#photos {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 16px;
  padding-right: var(--button-gutter); /* permanent safe space */
  position: relative;
  box-sizing: border-box;
}


/* ----------------------------------------------------
   RESPONSIVE PHOTO GRID
---------------------------------------------------- */
.photo-category {
  margin-bottom: 2em;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  padding: 10px 0;
}


/* ----------------------------------------------------
   CARD-STYLE FIGURES
---------------------------------------------------- */
.photo-category figure {
  background: #ffffff;
  padding: 12px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}


/* ----------------------------------------------------
   CARD IMAGE STYLE
---------------------------------------------------- */
.photo-category img {
  width: 100%;
  display: block;
  border-radius: 8px;
  border: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}


/* ----------------------------------------------------
   LINKS IN PHOTO PAGES
---------------------------------------------------- */
#links a {
  color: #4da3ff;
  text-decoration: none;
}

#links a:hover {
  text-decoration: underline;
}


/* ----------------------------------------------------
   IFRAMES (ancestry maps, etc.)
---------------------------------------------------- */
iframe {
  border: 2px solid #4da3ff;
  border-radius: 18px;
}

/* ----------------------------------------------------
   PREV / NEXT — minimal, container-based (no wrappers)
---------------------------------------------------- */
#prevBtn,
#nextBtn {
  background: rgba(255,255,255,0.90);
  color: #000;
  border: none;
  padding: 10px 18px;
  font-size: 15px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  backdrop-filter: blur(5px);

  margin: 40px 0;
  display: inline-block; /* avoids float collapse */
  vertical-align: middle;
}

/* keep Next on the right of the container */
#nextBtn {
  float: right;
}

/* hover */
#prevBtn:hover,
#nextBtn:hover {
  background: #fff;
}

/* disabled state (JS sets disabled=true) */
#prevBtn:disabled,
#nextBtn:disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

/* ensure floats don't collapse the section layout */
section::after {
  content: "";
  display: table;
  clear: both;
}

/* small screens */
@media (max-width: 600px) {
  #prevBtn,
  #nextBtn {
    padding: 8px 12px;
    font-size: 13px;
    margin: 20px 0;
  }
  #nextBtn { float: right; } /* keep behavior, but still within container */
}

