body {
  font-family: 'Times New Roman', Times, serif;
  line-height: 1.8;
  letter-spacing: 0.02em;
}

/* ---------- Hamburger button ---------- */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 0.35rem;
  cursor: pointer;
  line-height: 1;
  z-index: 20;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #000;
  margin: 5px 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Open state – turns into an X */
.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
/* Hide arrow buttons on mobile – use swipe instead */
@media (max-width: 640px) {
  #prev-image,
  #next-image {
    display: none !important;
  }
}
/* ---------- Mobile nav ---------- */
@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }

  /* Hide desktop-style horizontal list */
  nav .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    flex-direction: column;
    padding: 0.75rem 1rem 1.25rem;
    gap: 0;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
  }

  nav .nav-links.is-open {
    display: flex;
  }

  nav .nav-links li {
    border-bottom: 1px solid #f0f0f0;
  }

  nav .nav-links li:last-child {
    border-bottom: none;
  }

  nav .nav-links li a {
    display: block;
    padding: 0.85rem 0.25rem;
    font-size: 14px;
    letter-spacing: 0.04em;
  }

  nav .container {
    position: relative;
  }
}
section {
  scroll-margin-top: 100px;
}

/* Gallery + subfolder thumbnails + modal image – block save/drag */
#gallery img,
#subfolder-items img,
#large-image,
.author-photo {
  transition: opacity 0.3s ease, transform 0.3s ease;
  border: none;                        /* removed the gray line */
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  -webkit-touch-callout: none;
  pointer-events: auto;
}

#gallery img:hover,
#subfolder-items img:hover,
.author-photo:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

#year-select {
  transition: border-color 0.3s ease;
}

#year-select:focus {
  border-color: #000000;
}

#subfolder-items p {
  transition: opacity 0.3s ease;
}

#subfolder-items a:hover p {
  opacity: 0.75;
}

#subfolder-items a.bg-gray-200 {
  opacity: 0.5;
}
section.py-32 .md\:w-2\/3 a:hover {
  color: #1d4ed8;
  opacity: 0.85;
}

/* ============================================================
   CLOSE BUTTON – completely transparent, only the × is visible
   ============================================================ */
#close-modal {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  width: 2.6rem;
  height: 2.6rem;
  font-size: 1.9rem;
  line-height: 1;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: none !important;
  border-radius: 0;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  color: #000;
  opacity: 0.85;
}

#close-modal:hover {
  opacity: 1;
}

@media (min-width: 641px) {
  #close-modal {
    top: 1rem;
    right: 1rem;
    width: 2.8rem;
    height: 2.8rem;
    font-size: 2.1rem;
  }
}

/* ============================================================
   MODAL LAYOUT – perfect centering + no cut-off
   ============================================================ */
#image-modal {
  touch-action: none;
  overscroll-behavior: none;
}

.modal-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
  /* Top padding creates safe zone for the transparent × */
  padding: 3.4rem 0.75rem 0.5rem;
}

#large-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border: none !important;
  transform-origin: center center;
  transition: none;
  will-change: transform;
  touch-action: none;
}

/* Desktop */
@media (min-width: 641px) {
  .modal-content {
    padding: 4rem 2rem 1rem;
  }

  /* Extra breathing room at the bottom on desktop only */
  #modal-controls {
    padding-bottom: 1.75rem;
    padding-top: 0.75rem;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .modal-content {
    padding: 3.2rem 0.5rem 0.25rem;
  }

  #modal-controls {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: none; 
    padding-bottom: calc(0.7rem + env(safe-area-inset-bottom, 0px));
  }

  #prev-image,
  #next-image {
    display: none !important;
  }
}

/* ============================================================
   FRAME VIEW – only breathing room, no border
   ============================================================ */
#large-image.frame-view {
  max-width: calc(100% - 1.6rem) !important;
  max-height: calc(100% - 1.2rem) !important;
}

@media (max-width: 640px) {
  #large-image.frame-view {
    max-width: calc(100% - 2rem) !important;
    max-height: calc(100% - 1.5rem) !important;
  }
}

/* ============================================================
   MODAL THUMBNAIL STRIP – under main image, above counter
   ============================================================ */
#modal-thumbs-wrap {
  max-width: 100%;
  margin: 0.15rem 0 0.35rem;
}

.modal-thumbs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  padding: 0.35rem 0.15rem 0.45rem;
  /* hide scrollbar but keep scroll */
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}

.modal-thumbs::-webkit-scrollbar {
  height: 3px;
}

.modal-thumbs::-webkit-scrollbar-track {
  background: transparent;
}

.modal-thumbs::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.22);
  border-radius: 3px;
}

.modal-thumbs .thumb-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border: 1.5px solid transparent;
  border-radius: 2px;
  background: #f5f5f5;
  cursor: pointer;
  overflow: hidden;
  scroll-snap-align: center;
  transition: border-color 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  line-height: 0;
}

.modal-thumbs .thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.modal-thumbs .thumb-btn:hover {
  opacity: 0.85;
}

.modal-thumbs .thumb-btn.is-active {
  border-color: #000;
  opacity: 1;
  transform: scale(1.06);
}

.modal-thumbs .thumb-btn:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}

/* Slightly larger thumbs on desktop */
@media (min-width: 641px) {
  .modal-thumbs .thumb-btn {
    width: 52px;
    height: 52px;
  }

  .modal-thumbs {
    gap: 0.5rem;
    justify-content: center; /* center when few items */
  }

  /* When many items, still scroll; center only if content fits */
  .modal-thumbs.is-scrollable {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  #modal-thumbs-wrap {
    margin: 0.1rem 0 0.25rem;
  }

  .modal-thumbs .thumb-btn {
    width: 40px;
    height: 40px;
  }
}