/* Reset default margins/padding */
* {
  margin: 0;
  /* padding: 2px; */
  box-sizing: border-box;
}

.gallery-title {
  text-align: center;
  padding: 6px 10px;
  font-weight: light;
  letter-spacing: 0.025em;
  font-size: 18px;
  color: #1c1c1c;
  font-family: Montserrat, Arial, Helvetica, sans-serif;
}

body.dark-mode .gallery-title {
  color: #fbfbfb;
}

/* Site header with left-side navigation */
.site-header {
  position: relative;
  padding: 0.5rem 1rem;
  min-height: 56px;
}

.site-header .gallery-title {
  margin: 0;
  position: relative;
  text-align: left;
  padding: 0.5rem 0;
}

.gallery-subtitle {
  text-align: center;
  padding: 1rem 0;
  font-weight: 500;
  letter-spacing: 0.025em;
  font-size: 18px;
  color: #1c1c1c;
  font-family: Montserrat, Arial, Helvetica, sans-serif;
}

body.dark-mode .gallery-subtitle {
  color: #fbfbfb;
}

.side-nav {
  position: absolute;
  right: 2rem;
  top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  z-index: 20;
}

.nav-btn {
  display: inline-block;
  color: #1c1c1c;
  padding: 6px 10px;
  border-radius: 6px;
  text-decoration: none;
  font-family: Montserrat, Arial, Helvetica, sans-serif;
  font-size: 14px;
  letter-spacing: 1px;
  transition: background 0.2s, transform 0.15s;
  cursor: pointer;
}

.nav-btn:hover {
  background: #003e0529;
  transform: translateY(-2px);
}

body.dark-mode .nav-btn {
  /* background: #333; */
  color: #fbfbfb;
}

body.dark-mode .nav-btn:hover {
  background: #444;
}

/* Hamburger toggle (hidden on desktop, shown on small screens) */
.nav-toggle {
  display: none;
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  padding: 6px 8px;
  cursor: pointer;
  color: inherit;
  z-index: 30;
}

/* Small-screen nav behavior: hide the inline nav and show the hamburger */
@media (max-width: 640px) {
  .nav-toggle {
    display: inline-block;
  }

  /* Hide the side-nav by default on small screens */
  .side-nav {
    display: none;
  }

  /* When open, show nav as a centered vertical stack */
  .side-nav.open {
    display: flex;
    position: static;
    transform: none;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
    align-items: center;
  }

  .site-header {
    padding: 0.5rem 0.75rem;
  }
}

/* Gallery container takes full width */
.gallery {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
}

/* Each image container */
.gallery-item {
  flex: 1 0 33%;
  /* Show max of 3 images per row */
  position: relative;
  overflow: hidden;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.gallery-item img:hover {
  transform: scale(1.05);
}

/* Modal full screen overlay */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 1);
  align-items: center;
  justify-content: center;
}

/* Modal image styling */
.modal img {
  max-width: 90%;
  max-height: 90%;
}

/* Close button styling */
.close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #616161;
  font-size: 20px;
  font-weight: lighter;
  cursor: pointer;
  user-select: none;
  transition: background 0.3s;
  padding: 10px;
}

/* Modal Nav Arrows */
.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #616161;
  padding: 10px;
  cursor: pointer;
  user-select: none;
  z-index: 1001;
  transition: background 0.3s;
}

.arrow:hover,
.close:hover {
  background: rgba(58, 58, 58, 0.1);
}

.arrow.left {
  left: 20px;
}

.arrow.right {
  right: 20px;
}

/* Dark mode toggle button */
.dark-toggle {
  position: fixed;
  bottom: 15px;
  left: 15px;
  background: #222;
  color: #fbfbfb;
  border: none;
  border-radius: 20px;
  padding: 8px 12px;
  font-size: 8px;
  cursor: pointer;
  z-index: 2000;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

/* Dark mode styles */
body.dark-mode {
  background-color: rgba(1, 1, 1, 1);
  color: #fbfbfb;
}

body.dark-mode .dark-toggle {
  background: #fbfbfb;
  color: #000;
}

/* Dark mode: modal background */
body.dark-mode .modal {
  background-color: rgba(1, 1, 1, 1);
}

/* Dark mode: arrows */
body.dark-mode .arrow {
  color: #fbfbfb;
}

body.dark-mode .arrow:hover,
.close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Dark mode: close button */
body.dark-mode .close {
  color: #fbfbfb;
}


@media (max-width: 768px) {
  .gallery-item {
    flex: 1 0 100%;
    /* 1 image per row on smaller screens */
  }
}

@media (max-width: 480px) {
  .gallery-item {
    flex: 1 0 100%;
    /* 1 image per row on very small screens */
  }
}

.gallery-item-full-width {
  flex: 1 0 100%;
  /* Span full row */
  max-width: 100%;
}

.gallery-item-full-width img {
  width: 100%;
  height: auto;
  display: block;
}

.footer {
  text-align: center;
  font-family: Montserrat, Arial, Helvetica, sans-serif;
  font-size: 12px;
  margin: 0;
  height: 48px;
  /* single-line footer height */
  line-height: 48px;
  /* vertically center the single line */
  padding: 0 1rem;
  width: 100%;
  box-sizing: border-box;
}

.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 5.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(34, 34, 34, 0.9);
  color: #ffffff;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 2000;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: rgba(34, 34, 34, 1);
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 100%;
  margin: 2rem auto;
  padding: 0 1rem;
  align-items: start;
}

.home-card {
  display: block;
  text-align: center;
  color: inherit;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease;
}

/* Make the third card (landscape) span full width below the first two */
/* .home-card:nth-child(3) {
  right: 50%;
  left: 50%;
} */

.home-card img {
  width: 100%;
  height: auto;
  display: block;
}

.home-card-label {
  position: auto;
  color: #1e1e1e;
  padding: 8px 10px;
  border-radius: 4px;
  font-weight: 400;
  letter-spacing: 0.025em;
  text-align: center;
  font-size: 18px;
  font-family: Montserrat, Arial, Helvetica, sans-serif;
}

body.dark-mode .home-card-label {
  color: #fbfbfb;
}

.home-card:hover {
  transform: translateY(-4px);
}

@media (max-width: 900px) {
  .home-grid {
    grid-template-columns: 1fr 1fr;
  }

  .home-card img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
  }

  .home-grid {
    gap: 12px;
  }
}

@media (max-width: 640px) {
  .home-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .home-card {
    width: 100%;
  }
}

.back-link {
  padding-top: 2%;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 1);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  /* stack image and caption vertically */
}

.modal img {
  max-width: 80%;
  max-height: 80%;
  /* keep image sizing as before */
}

.modal-caption {
  display: block;
  width: 100%;
  max-width: 90%;
  margin-top: 8px;
  text-align: center;
  /* center the caption text under the image */
  color: #1c1c1c;
  font-size: 14px;
  word-break: break-word;
  font-family: Montserrat, Arial, Helvetica, sans-serif;
}

body.dark-mode .modal-caption {
  color: #fbfbfb;
}

@media (max-width: 640px) {
  .side-nav {
    position: static;
    transform: none;
    justify-content: center;
    margin-bottom: 0.5rem;
  }

  .site-header {
    padding: 0.5rem 0.75rem;
  }
}