.bookcases-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  font-family: Arial, sans-serif;
  color: #000;
}

.bookcases-header {
  width: 60%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  margin-bottom: 20px;
}

.bookcases-subheader {
  font-size: 1.5rem;
  margin: 10px 0 20px;
  text-align: left;
}

.bookcases-image-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 30px;
}

.bookcases-image-row img {
  height: 225px;
  width: auto;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
}

.bookcases-depth-section {
  text-align: center;
  margin-bottom: 40px;
}

.bookcases-depth-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  align-items: center;
}

.depth-main {
  height: 250px;
  width: auto;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
}

.depth-options {
  max-width: 400px;
  text-align: center;
}

.depth-heading {
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.depth-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.depth-links img {
  height: 140px;
  width: auto;
  border-radius: 6px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

.bookcases-full-img {
  text-align: center;
  margin-top: 40px;
}

.bookcases-full-img img {
  width: 100%;
  height: auto;
  max-width: 1000px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}


/* ---- SEO content sections ---- */

.bookcases-intro {
  max-width: 900px;
  margin: 30px auto;
  padding: 0 10px;
  line-height: 1.65;
}

.bookcases-intro h2 {
  font-size: 1.75rem;
  margin-bottom: 18px;
  color: #1a1a1a;
}

.bookcases-intro p {
  font-size: 1.05rem;
  margin-bottom: 16px;
}

.bookcases-benefits {
  max-width: 900px;
  margin: 40px auto;
  padding: 25px 30px;
  background: #f7f5f1;
  border-left: 5px solid #6b4226;
  border-radius: 6px;
}

.bookcases-benefits h2 {
  font-size: 1.6rem;
  margin-bottom: 18px;
  color: #1a1a1a;
}

.bookcases-benefits ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.bookcases-benefits li {
  font-size: 1.02rem;
  line-height: 1.6;
  margin-bottom: 14px;
  padding-left: 22px;
  position: relative;
}

.bookcases-benefits li::before {
  content: "\2713";
  color: #6b4226;
  font-weight: bold;
  position: absolute;
  left: 0;
}

.bookcases-faq {
  max-width: 900px;
  margin: 50px auto 30px;
  padding: 0 10px;
}

.bookcases-faq h2 {
  font-size: 1.7rem;
  margin-bottom: 24px;
  text-align: center;
}

.faq-item {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e5e2dc;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  color: #1a1a1a;
}

.faq-item p {
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

.bookcases-cta {
  max-width: 900px;
  margin: 30px auto 50px;
  padding: 35px 30px;
  background: #6b4226;
  color: #fff;
  border-radius: 10px;
  text-align: center;
}

.bookcases-cta h2 {
  font-size: 1.7rem;
  margin-bottom: 12px;
  color: #fff;
}

.bookcases-cta p {
  font-size: 1.05rem;
  margin-bottom: 22px;
  line-height: 1.5;
}

.bookcases-cta-button {
  display: inline-block;
  background: #fff;
  color: #6b4226;
  padding: 14px 32px;
  font-size: 1.1rem;
  font-weight: bold;
  text-decoration: none;
  border-radius: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bookcases-cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

@media (max-width: 600px) {
  .bookcases-intro h2,
  .bookcases-benefits h2,
  .bookcases-faq h2,
  .bookcases-cta h2 {
    font-size: 1.4rem;
  }

  .bookcases-benefits {
    padding: 20px 18px;
  }

  .bookcases-cta {
    padding: 28px 20px;
  }
}


/* ---- Photo Gallery (hover centers full image on viewport) ---- */

.gallery-intro {
  max-width: 900px;
  margin: 20px auto 30px;
  padding: 0 15px;
  text-align: center;
  font-size: 1.05rem;
  line-height: 1.6;
}

.bookcase-gallery-grid {
  max-width: 1300px;
  margin: 0 auto 50px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  align-items: start;
}

.gallery-card {
  position: relative;
  border-radius: 8px;
  cursor: zoom-in;
}

/* Card holds its grid cell open so layout doesn't collapse when the img goes fixed */
.bookcase-gallery-grid .gallery-card {
  height: 280px;
}

.gallery-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Dim backdrop when image is zoomed; pointer-events:none so click passes through */
.gallery-card::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.gallery-card.is-zoomed::before {
  opacity: 1;
}

/* Enlarged image: fixed-positioned at viewport center, full uncropped image. Toggled by js/gallery.js click handler. */
.gallery-card.is-zoomed img {
  position: fixed;
  top: 50%;
  left: 50%;
  width: auto;
  height: auto;
  max-width: min(1100px, 92vw);
  max-height: 88vh;
  object-fit: contain;
  z-index: 9999;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  border-radius: 6px;
  cursor: zoom-out;
  animation: galleryZoom 0.25s ease forwards;
}

@keyframes galleryZoom {
  from {
    transform: translate(-50%, -50%) scale(0.88);
    opacity: 0.6;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

/* Teaser grid (used inside the bookcases page) */
/* Width matches the .bookcases-image-row above by using the same container */
.gallery-teaser {
  margin: 40px auto;
  padding: 0;
}

.gallery-teaser h2 {
  font-size: 1.6rem;
  text-align: center;
  margin-bottom: 8px;
}

.gallery-teaser-sub {
  text-align: center;
  font-size: 1rem;
  color: #555;
  margin-bottom: 22px;
}

.gallery-teaser-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
  align-items: start;
}

.gallery-teaser-grid .gallery-card {
  height: 225px;
}

@media (max-width: 768px) {
  .gallery-teaser-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .gallery-teaser-grid {
    grid-template-columns: 1fr;
  }
}

.gallery-teaser-cta {
  text-align: center;
}

.gallery-teaser-cta a {
  display: inline-block;
  background: #6b4226;
  color: #fff;
  padding: 12px 26px;
  font-size: 1.05rem;
  font-weight: bold;
  text-decoration: none;
  border-radius: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-teaser-cta a:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

.gallery-link-inline {
  text-align: center;
  margin: 0 0 30px;
  font-size: 1.05rem;
}

.gallery-link-inline a {
  color: #6b4226;
  font-weight: bold;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease;
}

.gallery-link-inline a:hover {
  border-bottom-color: #6b4226;
}


/* ---- Depth pages (12" / 15" Bookcases) ---- */

/* Quick-link tabs: Starter Frames | Add-On Frames | Shelves */
.depth-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 1100px;
  margin: 30px auto;
  padding: 0 10px;
}
.depth-tabs a {
  display: inline-block;
  padding: 12px 24px;
  background: #f7f5f1;
  color: #6b4226;
  font-weight: bold;
  text-decoration: none;
  border: 2px solid #6b4226;
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}
.depth-tabs a:hover {
  background: #6b4226;
  color: #fff;
}

/* Step-by-step builder section */
.build-steps {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 10px;
}
.build-steps h2 {
  text-align: center;
  font-size: 1.6rem;
  margin-bottom: 30px;
  color: #1a1a1a;
}
.build-step {
  margin-bottom: 40px;
  text-align: center;
}
.build-step h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: #1a1a1a;
}
.build-step p {
  max-width: 700px;
  margin: 0 auto 16px;
  font-size: 1.02rem;
  line-height: 1.55;
}
.build-step img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.build-step a {
  display: inline-block;
  max-width: 100%;
}

@media (max-width: 600px) {
  .build-steps h2 {
    font-size: 1.35rem;
  }
  .build-step h3 {
    font-size: 1.1rem;
  }
  .depth-tabs a {
    padding: 10px 16px;
    font-size: 0.95rem;
  }
}
