/* =========================================================
   GALLERY PAGE
   White page, big two-tone title, three portrait photos in a row.
========================================================= */

.gallery-wrap {
  width: min(1280px, 90%);
  margin-inline: auto;
}

/* ---------- SECTION + TITLE ---------- */

.gallery-section {
  --header-h: 153px; /* height of the header strip. Set to 0px if the header does NOT overlay the page */
  padding: calc(var(--header-h) + 1rem) 0 clamp(3rem, 6vw, 6rem) !important;
  background: #ffffff;
}

.gallery-title {
  margin: 0 0 clamp(1.5rem, 2.6vw, 3.1rem);

  font-family: var(--serif, "Playfair Display", Georgia, serif);
  font-size: clamp(3.4rem, 5.25vw, 6.25rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  color: #050505;
}

.gallery-title .accent {
  color: var(--gold, #eba42d);
}

/* ---------- PHOTO GRID ---------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 1.05vw, 1.25rem); /* 20px on a 1900px screen */
}

.gallery-item {
  margin: 0;
  overflow: hidden;
  background: #f2f2f2;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

/* =========================================================
   GALLERY LIGHTBOX (click a photo to view it full size)
========================================================= */

.gallery-item img {
  cursor: zoom-in;
  transition: transform 0.35s ease;
}

.gallery-item img:hover,
.gallery-item img:focus-visible {
  transform: scale(1.03);
}

.gallery-item img:focus-visible {
  outline: 3px solid var(--gold, #eba42d);
  outline-offset: -3px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lb-stage {
  position: relative;
  margin: 0;
  line-height: 0;
}

.lb-img {
  display: block;
  max-width: min(90vw, 1100px);
  max-height: 88vh;
  width: auto;
  height: auto;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.5);
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.lightbox.is-open .lb-img {
  transform: scale(1);
}

/* × button, top right of the photo */
.lb-close {
  position: absolute;
  top: -2.5rem;
  right: -0.5rem;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
}

.lb-close:hover {
  opacity: 1;
}

/* "3 of 13", bottom right under the photo */
.lb-count {
  position: absolute;
  right: 0;
  bottom: -1.6rem;
  color: #ddd;
  font-size: 0.85rem;
  line-height: 1;
}

/* Side arrows at the screen edges */
.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 90px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  opacity: 0.8;
}

.lb-arrow:hover {
  opacity: 1;
}

.lb-arrow::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
}

.lb-prev {
  left: 1rem;
}
.lb-prev::before {
  border-right: 16px solid #fff;
}

.lb-next {
  right: 1rem;
}
.lb-next::before {
  border-left: 16px solid #fff;
}

/* Mobile: smaller arrows, bigger photo */
@media (max-width: 560px) {
  .lb-img {
    max-width: 94vw;
    max-height: 80vh;
  }

  .lb-arrow {
    width: 44px;
  }

  .lb-prev {
    left: 0;
  }
  .lb-next {
    right: 0;
  }
}

/* ---------- TABLET ---------- */

@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- MOBILE ---------- */

@media (max-width: 860px) {
  .gallery-section {
    --header-h: 100px;
  }

  .gallery-title {
    text-align: center;
  }
}

@media (max-width: 560px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   FOOTER LINKS: no underline (email, phone, "Developed by")
========================================================= */

.site-footer a,
.site-footer a:hover,
.site-footer a:focus-visible {
  text-decoration: none !important;
  border-bottom: 0 !important;
}

/* =========================================================
   BUY SECTION (small banner with image background)
========================================================= */

.buy-section {
  position: relative;
  isolation: isolate;
  overflow: hidden;

  display: flex;
  align-items: center;

  min-height: clamp(380px, 35vw, 680px); /* keeps the section short */
  padding: 3rem 0 !important;

  background-color: #2cadbb;
}

/* Background image. If "buy-bg.jpg" is missing, the gradients
   recreate the teal background with the rose/grey left corner. */
.buy-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;

  background-image:
    url("Images/buy-bg.jpg"),
    radial-gradient(
      ellipse 32% 110% at 0% 100%,
      #d4868c 0%,
      rgba(212, 134, 140, 0) 100%
    ),
    linear-gradient(
      90deg,
      rgba(150, 160, 165, 0.55) 0%,
      rgba(150, 160, 165, 0) 28%
    );

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.buy-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 8vw, 9rem);
}

.buy-books img {
  width: clamp(260px, 21vw, 420px);
  height: auto;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.25));
}

.buy-title {
  margin: 0 0 1.4rem;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 3.6vw, 3.6rem);
  font-weight: 600;
  line-height: 1.1;
  color: #ffffff;
  white-space: nowrap;
}

.buy-accent {
  color: #e2b865;
}

/* Amazon button image */
.amazon-link {
  display: inline-block;
  line-height: 0;
  transition:
    transform 0.3s ease,
    filter 0.3s ease;
}

.amazon-link img {
  width: 250px; /* change this to resize your button */
  height: auto;
}

.amazon-link:hover {
  transform: translateY(-3px);
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.3));
}

/* Mobile */
@media (max-width: 860px) {
  .buy-section {
    min-height: 0;
    padding: 3rem 0 !important;
  }

  .buy-inner {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }

  .buy-books img {
    width: min(300px, 80%);
    margin-inline: auto;
  }

  .buy-title {
    white-space: normal;
  }
}

/* =========================================================
   BUY SECTION: BIGGER BOOKS, SAME SECTION SIZE
========================================================= */

.buy-section {
  height: clamp(380px, 35vw, 680px); /* original section size, now fixed */
  min-height: 0;
  padding: 0 !important;
}

.buy-books img {
  width: clamp(340px, 30vw, 600px); /* bigger books */
  height: auto;
  margin: 0;
}

/* Mobile */
@media (max-width: 860px) {
  .buy-section {
    height: auto;
    padding: 3rem 0 !important;
  }

  .buy-books img {
    width: min(380px, 90%);
  }
}
