.image-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.image-modal.open {
  display: flex;
}

.image-modal-content {
  position: relative;
  max-width: min(95vw, 70rem);  /* or whatever width you like */
  /* remove max-height here */
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-modal-content img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 0.4rem;
  box-shadow: var(--shadow-soft);
  object-fit: contain;
  background: #ffffff;
}

.image-modal-close {
  position: absolute;
  top: 0.35rem;
  right: 0.5rem;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
  border-radius: 999px;
}

.image-modal-close:hover {
  background: rgba(0, 0, 0, 0.9);
}

.book-cover img {
  cursor: pointer;
}

.nav-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.nav-popup-overlay.open {
  display: flex;
}

.nav-popup-shell {
  width: 90vw;
  height: 90vh;
  background: var(--banner-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  position: relative;
  padding: 1.5rem 2rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.nav-popup-inner {
  flex: 1;
  overflow-y: auto;
  padding-right: 1rem;
  padding-bottom: 1rem;
  margin-right: -1rem;
}

.nav-popup-panel {
  color: #000000;
}

.nav-popup-panel h2 {
  margin-bottom: 0.75rem;
}

.nav-popup-panel p {
  max-width: 60rem;
}

.nav-popup-close {
  position: absolute;
  top: 1.5rem;
  right: 3rem;
  border: none;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  font-size: 1.6rem;
  line-height: 1;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
}

.nav-popup-close:hover {
  background: rgba(0, 0, 0, 0.9);
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2rem;
  margin-top: 1.2rem;
}

.resource-card {
  background: #888888;
  border-radius: var(--radius);
  padding: 0.8rem 0.8rem 0.6rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
}

.resource-image-btn {
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.resource-image-shell {
  background: #888888;
  border-radius: calc(var(--radius) - 0.15rem);
  overflow: hidden;
  width: 100%;
  height: 14rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.resource-video-shell {
  background: #888888;
  border-radius: calc(var(--radius) - 0.15rem);
  overflow: hidden;
  width: 100%;
  height: 14rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.resource-video-shell video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.resource-image-shell img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.resource-card-footer {
  margin-top: 0.6rem;
  padding-top: 0.3rem;
  display: flex;
  align-items: center;
  color: #f2f2f2;
  font-style: italic;
}

.resource-title {
  flex: 1;
  text-align: center;
  font-size: 0.95rem;
}

.resource-download {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid rgba(242, 242, 242, 0.9);
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.resource-download:hover {
  background: rgba(0, 0, 0, 0.45);
  box-shadow: var(--shadow-soft);
}

.download-icon {
  width: 1.2rem;
  height: 1.2rem;
  fill: #f2f2f2;
}

.popup-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.8rem;
}

.popup-download-all {
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 0.08rem solid rgba(0, 0, 0, 0.5);
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.popup-download-all:hover {
  background: rgba(255, 255, 255, 0.45);
  transform: translateY(-0.03rem);
  box-shadow: var(--shadow-soft);
}

.nav-popup-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.nav-popup-header h2 {
  margin: 0;
}

/* ============================
   FOOTER BANNER OVERLAY
   ============================ */

.footer-banner-overlay {
  position: fixed;
  inset: 0;
  display: none;                     /* hidden by default */
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  z-index: 9997;
}

.footer-banner-overlay.open {
  display: flex;
}

.footer-banner-shell {
  width: min(75vw, 1000px);          /* nice width on desktop */
  max-height: 80vh;                  /* never taller than viewport */
  background: var(--top-band-bg);
  color: #ffffff;
  border-radius: 0.8rem;
  box-shadow: var(--shadow-soft);
  padding: 2rem 2.4rem 1.8rem;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow-y: auto;                  /* scroll if content is tall */
}

.footer-banner-close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  border: none;
  color: #ffffff;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

/* each "tab" inside: About / Contact / Privacy / Terms */
.footer-banner-content {
  margin: 0;                         /* no negative offset */
}

.footer-banner-content h3 {
  margin: 0 0 0.8rem;
  font-size: 1.7rem;
  font-weight: 600;
}

.footer-banner-content p {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
}


/* =========================================
   MOBILE TWEAKS FOR POPUPS
   ========================================= */
@media (max-width: 1600px) {

  /* ---------- Image modal ---------- */
  .image-modal-content {
    max-width: 100vw;
    padding: 0 1rem;              /* keep it away from the edges */
  }

  .image-modal-content img {
    max-height: 80vh;             /* a bit shorter so it doesn't hit top/bottom */
    border-radius: 0.3rem;
  }

  .image-modal-close {
    top: 0.5rem;
    right: 0.7rem;
    font-size: 1.4rem;
    padding: 0.2rem 0.5rem;
  }

  /* ---------- Chapter / videos popup ---------- */
  .nav-popup-overlay {
    align-items: flex-start;      /* start from top on phones */
  }

  .nav-popup-shell {
    width: 100vw;
    height: 100vh;
    border-radius: 0;             /* full-screen sheet */
    padding: 0.75rem 1rem 1rem;
  }

  .nav-popup-close {
    top: 0.6rem;
    right: 1rem;
    font-size: 1.4rem;
    padding: 0.2rem 0.6rem;
  }

  .nav-popup-inner {
    margin-top: 2.4rem;           /* space under close button */
    margin-right: 0;
    padding-right: 0;
    padding-bottom: 1rem;
  }

  .nav-popup-panel h2 {
    font-size: 1.1rem;
  }

  /* Grid: 2 columns on phones */
  .resource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: 0.9rem;
  }

  /* Slightly shorter cards so you see more at once */
  .resource-image-shell,
  .resource-video-shell {
    height: 10rem;
  }

  .resource-title {
    font-size: 0.85rem;
  }

  .popup-download-all {
    font-size: 0.85rem;
    padding: 0.3rem 0.7rem;
  }

  /* ---------- Footer banner popup ---------- */
.footer-banner-shell {
  width: 75vw;
  max-width: 1000px;
  height: auto;              /* let height grow with content */
  min-height: 280px;         /* a bit taller base */
  background: var(--top-band-bg);
  color: #ffffff;
  border-radius: 0.8rem;
  box-shadow: var(--shadow-soft);
  padding: 2rem 2.4rem 1.8rem;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;  /* start at top, content can fill down */
}

.footer-banner-content {
  margin-top: 0;             /* no negative pull-up anymore */
}


  .footer-banner-content h3 {
    font-size: 1.4rem;
    margin-bottom: 0.6rem;
  }

  .footer-banner-content p {
    font-size: 0.9rem;
    line-height: 1.5;
  }
}

/* ============================
   About Us cards inside footer banner
   ============================ */
.about-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-top: 1rem;
  justify-content: center;   /* ⬅ center cards horizontally */
  align-items: flex-start;   /* or center if you want vertical centering too */
}


.about-card {
  flex: 1 1 180px;
  max-width: 220px;
  text-align: center;
  text-decoration: none;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.6rem 0.4rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.about-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 25px rgba(0,0,0,0.35);
}

.about-photo-shell {
  width: 110px;
  height: 110px;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.55rem;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-photo-shell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.about-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.about-role {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  opacity: 0.9;
}

.about-extra-link {
  margin-top: 0.9rem;
  font-size: 0.9rem;
}

.about-extra-link a {
  color: #ffffff;
  text-decoration: underline;
}


/* Extra-narrow phones: 1 column grid */
@media (max-width: 480px) {
  .resource-grid {
    grid-template-columns: 1fr;
  }

  .resource-image-shell,
  .resource-video-shell {
    height: 11rem;
  }
}
/* Justify text in Privacy + Terms popups */
.footer-banner-content[data-banner-key="privacy"] p,
.footer-banner-content[data-banner-key="terms"] p {
  text-align: justify;
  text-justify: inter-word;
}
