/*--------------------------------- */
/* ---- Case study layout ---- */
/*--------------------------------- */

/* ---- Main content ---- */
/* The articles should be wider than the main site */
main {
  width: 90%;
  max-width: 1400px;
  margin: 0 auto;
}

.case-study {
    margin: 0 auto;
    padding: 2rem;
}

.case-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  gap: 1rem;
  width:100%;
  min-width: 800px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 0rem;
}

.case-layout h1{
  font-size: clamp(2.5rem, 3vw, 4rem);
  font-weight: 900;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.case-article {
    background: #fff;
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}

.case-header {
    text-align: center;
    max-width: 900px;
    margin: 0 auto 1rem auto;
}

.case-header p {
    text-align: center; /* Explicitly center text inside header paragraphs */
    margin-left: auto;
    margin-right: auto;
}

.case-header .description {
  font-style: italic;
  text-align: left;
  max-width: 600px; 
  margin: 1rem auto;
}

.case-lead-img{
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 1.5rem auto;
}

.case-lead-img img{
  width: 80%;
  max-width: 900px;
  height: auto;
}

.case-lead-img figcaption {
    width: 80%; /* Match the image width */
    max-width: 75ch;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    text-align: left; /* Left-align the caption text */
    padding-left: 1rem;
}


.case-content {
    text-align: left;
    max-width: 70ch;
    margin: 0 auto 1rem auto;
}

.case-content p {
    text-align: justify;
    margin: 0 auto 1rem auto;
    max-width: 900px; /* Match .case-content */
    width: 100%; /* Take full width of parent */
}

.case-content ul {
  margin-bottom: 1rem;
}

.case-study a {
  text-decoration: none;
}


.case-sidebar {
  font-size: 0.9rem;
  font-family: var(--body-font); 
  align-self: start;
  border-left: none;
  padding: 0;
  background: transparent;
  padding-top: 0.5rem;
}

.sidebar-box {
  /* background: #fcfcfc; */
  padding: 1.5rem 1.75rem;
  border-left: 1px solid rgba(0,0,0,0.08);
  box-shadow: none;
  width: 100%;
  max-width: 320px; /* optional but very NYT */
  background: linear-gradient(#fcfcfc, #fafafa);
}

.case-sidebar h3 {
  font-family: serif;
  font-size: 1.5rem;
  font-weight: 600;
  /* letter-spacing: -0.12em; */
  /* text-transform: uppercase; */
  color: #666;
  margin-bottom: 1rem;
}

.sidebar-links {
  padding: 0;
  border-top: none;
}

.sidebar-links a {
  display: block;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #222;
  text-decoration: none;
  padding: 0.4rem 0;
}

.sidebar-links a:hover {
  color: #000;
  text-decoration: underline;
}

.pull-quote {
  font-size: 2rem;
  font-style: italic;
  color: #666;
  border-left: 6px solid #787878;
  padding-left: 1.5rem;
  margin: 3rem 0;
}

.pull-quote .bi-quote {
  font-size: 3rem;
  color: #bbb;
  display: block;
  /* margin-bottom: 0.5rem; */
}


.pull-quote p {
  margin: 0;
  font-size: 2rem;
  color: #666;
  max-width: none;
  line-height: 1.3;
}


/*--------------------------------- */
/* ---- Lightbox Stuff (view larger images) ---- */
/*--------------------------------- */

.clickable-image {
  cursor: zoom-in;
  transition: opacity 0.2s ease;
}

.clickable-image:hover {
  opacity: 0.9;
}

/* Lightbox overlay */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  cursor: zoom-out;
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 10000;
}

.lightbox-close:hover {
  color: #ccc;
}


/*--------------------------------- */
/* ---- Responsive Design ---- */
/*--------------------------------- */

@media (max-width: 768px) {

  main {
    width: 100%;
    padding: 0;
  }

  .case-study {
    padding: 1rem;
  }

  .case-layout {
    display: flex;
    flex-direction: column;
    min-width: 0;  /* Remove the 800px minimum */
    max-width: 100%;
    padding: 1rem 0;
    gap: 0;
  }

    .case-article {
    padding: 1.5rem;
    border-radius: 8px;
  }

  .case-header {
    max-width: 100%;
  }

  .case-lead-img img {
    width: 100%;  /* Full width on mobile instead of 80% */
  }

  .case-lead-img figcaption {
    width: 100%;
    padding-left: 0;
    padding-right: 0;
  }

  .case-content {
    max-width: 100%;
  }

  .case-content p {
    text-align: left;  /* Switch from justify to left on mobile */
    max-width: 100%;
  }

  .pull-quote {
    font-size: 1.5rem;
    margin: 2rem 0;
    padding-left: 1rem;
  }

  .pull-quote p {
    font-size: 1.5rem;
  }

  .sidebar-box {
    max-width: 100%;
    border-left: none;
    border-top: 1px solid rgba(0,0,0,0.08);
  }

  .case-sidebar {
    display: flex;
    flex-direction: column;
    width: 90%;
    gap: 1.5rem;
    margin-top: 2rem;
    align-items: center;
    padding: 0 auto;
    margin: 1rem auto;
  }
}