/*
  This is the header styling logic.
*/
#header {
  background-color: #BFA6A0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  width: 100%;
  box-sizing: border-box;
  position: sticky;
  top: 0;
  z-index: 100;
  color: white;
  font-family: Garamond, Baskerville, "Baskerville Old Face", "Times New Roman", serif;
}

/*
  This is the styling for the navigation section.
*/
.horiz-list {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
  font-size: 30px;
}

/*
  This is the styling for the navigation buttons.
*/
.horiz-list a {
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  display: inline-block;
  color: white;
  border-radius: 8px;
  transition: background-color 0.2s, color 0.2s;
}

/*
  This is styling for when the cursor is hovering over the navigation buttons.
*/
.horiz-list a:hover {
  background-color: #A9746E;
  color: white;
}

/*
  This is styling for the name at the top of the page.
*/
#topname {
  margin: 0;
  font-size: 75px;
}

/*
  This is styling for the body of the website.
*/
body {
  margin: 0;
  padding: 0;
  background-color: #F5F5F5;
  color: #333333;
}

/*
  This is the styling for the mywork section.
*/
#mywork {
  background-color: #F5EEDF;
}

/*
  This is the styling for the gallery or grid area for the projects.
*/
.gallery {
  column-count: 2;
  column-gap: 5px;
  row-gap: 1rem;
  text-align: center;
}

/*
  This is the styling of the individual items in the gallery.
*/
.gallery-item {
  display: inline-block;
  max-width: 600px;
  margin: 2rem auto;
  text-align: center;
  cursor: pointer;
}

/*
  This is the styling for images inside each gallery item.
*/
.gallery-item img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: transform 0.2s;
}

.gallery-item figcaption {
  font-size: 20px;
  margin-top: 10px;
  text-align: center;
}

/*
  This is the styling for when you hover over any gallery item.
*/
.gallery-item img:hover {
  transform: scale(1.03);
}

/*
  This is the styling for all of the lightboxs that are used on the gallery.
*/
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  color: #333;
}

/*
  This is the styling for the content within the lightbox.
*/
.lightbox-content {
  display: flex;
  background: white;
  border-radius: 12px;
  max-width: 90%;
  max-height: 80%;
  overflow: hidden;
  position: relative;
  flex-direction: row;
}

/*
  This is the styling for the images within the ligthbox content section.
*/
.lightbox-content-image {
  position: relative;
  width: 700px;
  height: 700px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #111;
  overflow: hidden;
}

.lightbox-content-image img {
  display: none;
  max-width: 620px;
  max-height: 620px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-content-image img.active {
  display: block;
}

.lightbox-image-prev,
.lightbox-image-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.6);
  border: none;
  font-size: 2rem;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 50%;
  z-index: 10;
  transition: background 0.2s ease;
}

.lightbox-image-prev:hover,
.lightbox-image-next:hover {
  background: white;
}

.lightbox-image-prev {
  left: 0;
  padding-left: 10px;
}

.lightbox-image-next {
  right: 0;
  padding-right: 10px;
}

.lightbox-content-details {
  width: 300px;
  padding: 2rem;
  background: #fefefe;
  border-left: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
}

.lightbox-content-details h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
}

.lightbox-content-details p {
  margin: 0;
  font-size: 1.5rem;
}

.detail-field {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.lightbox-content-details a {
  color: blue;
  text-decoration: underline;
}

/* Close button for lightbox */
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  background: rgba(255,255,255,0.85);
  border: none;
  color: #333;
  font-size: 2rem;
  border-radius: 50%;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1001;
}

.lightbox-close:hover {
  background: #FF6B6B;
  color: white;
}

html {
  scroll-behavior: smooth;
}

#about {
  background-color: #333333;
  color: white;
  font-family: Garamond, Baskerville, "Baskerville Old Face", "Times New Roman", serif;
}

#about p {
  margin: 0;
  padding: 1rem;
  text-align: center;
  font-size: 20px;
}

#about h2 {
  margin: 0;
  padding-top: 1rem;
  text-align: center;
}

#contact {
  background-color: #333333;
  color: white;
  font-family: Garamond, Baskerville, "Baskerville Old Face", "Times New Roman", serif;
  justify-content: center;
}

#contact p {
  margin: 0;
  padding: 1rem;
  text-align: center;
  font-size: 20px;
}

#contact h2 {
  margin: 0;
  padding-top: 1rem;
  text-align: center;
}


/* =======================
   Responsive styling
======================= */
@media (max-width: 700px) {
    .gallery {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .lightbox-content {
        flex-direction: column;
        max-height: 90vh; /* make it scrollable */
        overflow-y: auto;
    }

    .lightbox-content-image {
        width: 90%;       /* scale image container to fit */
        max-width: 700px;
        aspect-ratio: 1/1; /* keeps square */
    }

    .lightbox-image-prev,
    .lightbox-image-next {
        font-size: 1.5rem;
        padding: 6px 10px;
        top: 50%;       /* keep arrows centered */
        transform: translateY(-50%);
    }

    .lightbox-close {
        position: fixed;  /* always visible */
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 2rem;
    }

    .lightbox-content-details {
        width: 100%;
        border-left: none;
        border-top: 1px solid #ddd;
        text-align: center;
        margin-top: 10px; /* space between image and details */
        padding: 1rem;    /* spacing for readability */
    }

    .lightbox-content-image img {
        max-width: 90%;
        max-height: 90%;
    }
}
