/* ============================================
   MANDELSON.CO — Case Study Page Styles
   ============================================ */

/* --- Hero --- */
.cs-hero {
  position: relative;
  width: 100%;
  height: 80vh;
  min-height: 500px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.cs-hero__bg {
  position: absolute;
  inset: 0;
}

.cs-hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cs-hero__gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 15, 28, 0.2) 0%, rgba(10, 15, 28, 0.85) 100%);
}

.cs-hero__content {
  position: relative;
  z-index: 1;
  padding-bottom: var(--space-3xl);
  color: var(--text-on-dark);
}

.cs-hero__label {
  color: var(--accent-soft);
  margin-bottom: var(--space-md);
}

.cs-hero__title {
  margin-bottom: var(--space-md);
}

.cs-hero__subtitle {
  color: rgba(255, 255, 255, 0.7);
  max-width: 560px;
}

/* --- Meta row --- */
.cs-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
}

.cs-meta__item .label {
  margin-bottom: var(--space-sm);
}

@media (max-width: 768px) {
  .cs-meta {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .cs-meta {
    grid-template-columns: 1fr;
  }
}

/* --- Body content --- */
.cs-body p {
  margin-bottom: var(--space-lg);
  line-height: 1.75;
  color: var(--text-secondary);
}

.cs-body p:last-child {
  margin-bottom: 0;
}

.cs-body h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

.cs-body h3:first-child {
  margin-top: 0;
}

.cs-body h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
}

.cs-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* --- Fullwidth image --- */
.cs-fullwidth-img {
  width: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--sand);
}

.cs-fullwidth-img img {
  width: 100%;
  height: auto;
  display: block;
}

/* --- Content + Sidebar Layout --- */
.cs-layout {
  padding: var(--space-2xl) 0 var(--space-3xl);
}

.cs-layout__grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-3xl);
  align-items: start;
}

.cs-layout__main {
  min-width: 0;
}

/* Main content section spacing */
.cs-section-text {
  padding: var(--space-2xl) 0;
}

.cs-section-text:first-child {
  padding-top: 0;
}

.cs-section-image {
  padding: var(--space-lg) 0 var(--space-2xl);
}

.cs-fullwidth-img img,
.cs-two-up__img img {
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.cs-fullwidth-img img:hover,
.cs-two-up__img img:hover {
  opacity: 0.9;
}

.cs-caption {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-md);
  line-height: 1.5;
}

.cs-two-up__img .cs-caption {
  font-size: var(--text-xs);
  margin-top: var(--space-sm);
}

/* --- Sidebar --- */
.cs-layout__sidebar {
  align-self: stretch;
}

.cs-sidebar-inner {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.cs-sidebar-inner .section-header__label {
  margin-bottom: var(--space-sm);
}

.cs-feature {
  padding: var(--space-md) var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-light);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.cs-feature.is-active {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.cs-feature__header {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  cursor: pointer;
}

.cs-feature__num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.cs-feature h3 {
  font-size: var(--text-base);
  margin-bottom: 0;
}

.cs-feature__desc {
  font-size: var(--text-xs);
  line-height: 1.5;
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.3s ease,
              margin-top 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cs-feature.is-active .cs-feature__desc {
  max-height: 200px;
  opacity: 1;
  margin-top: var(--space-sm);
}

@media (max-width: 1024px) {
  .cs-layout__grid {
    grid-template-columns: 1fr;
  }
  .cs-layout__sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
  }
  .cs-sidebar-inner {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    position: static;
  }
  .cs-sidebar-inner .section-header__label {
    grid-column: 1 / -1;
  }
  /* On mobile, show all cards expanded */
  .cs-feature__desc {
    max-height: 200px;
    opacity: 1;
    margin-top: var(--space-sm);
  }
}

@media (max-width: 640px) {
  .cs-sidebar-inner {
    grid-template-columns: 1fr;
  }
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox__close {
  position: absolute;
  top: var(--space-xl);
  right: var(--space-xl);
  color: white;
  background: none;
  border: none;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.3s ease;
  z-index: 2;
  cursor: pointer;
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.3s ease;
  z-index: 2;
  cursor: pointer;
}

.lightbox__nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox__nav--prev {
  left: var(--space-xl);
}

.lightbox__nav--next {
  right: var(--space-xl);
}

.lightbox__content {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox__img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.lightbox__caption {
  color: rgba(255, 255, 255, 0.6);
  font-size: var(--text-sm);
  margin-top: var(--space-lg);
  text-align: center;
}

.lightbox__unmute {
  display: flex;
  align-items: center;
  gap: 8px;
  position: absolute;
  bottom: var(--space-3xl);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 20px;
  border-radius: 100px;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s ease;
  z-index: 2;
}

.lightbox__unmute:hover {
  background: rgba(255, 255, 255, 0.25);
}

@media (max-width: 768px) {
  .lightbox__nav {
    display: none;
  }
}

/* --- Two-up image --- */
.cs-two-up {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

.cs-two-up__img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--sand);
}

.cs-two-up__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .cs-two-up {
    grid-template-columns: 1fr;
  }
}

/* --- Three-up images --- */
.cs-three-up {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-md);
}

.cs-three-up__img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--sand);
}

.cs-three-up__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.cs-three-up__img img:hover {
  opacity: 0.9;
}

.cs-three-up__img .cs-caption {
  font-size: var(--text-xs);
  margin-top: var(--space-sm);
}

@media (max-width: 640px) {
  .cs-three-up {
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-sm);
  }
}

/* --- Quote block --- */
.cs-quote {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: var(--space-2xl) 0;
}

.cs-quote__text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: var(--text-2xl);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.cs-quote__attr {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-md);
}

/* --- Video Grid (side-by-side vertical videos) --- */
.cs-video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.cs-video-grid__item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  max-height: 420px;
}

.cs-video-grid__item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cs-video-grid__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.15);
  transition: background 0.3s ease;
}

.cs-video-grid__item:hover .cs-video-grid__play {
  background: transparent;
}

.cs-video-grid__play svg {
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.cs-video-grid__item:hover .cs-video-grid__play svg {
  opacity: 0;
}

@media (max-width: 640px) {
  .cs-video-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
  }
  .cs-video-grid__item {
    max-height: 280px;
  }
}

/* --- Embedded Mockup Frame --- */
.cs-mockup-frame {
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  overflow: hidden;
  background: white;
  box-shadow:
    0 20px 60px -15px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(0, 0, 0, 0.04);
}

.cs-mockup-frame iframe {
  width: 100%;
  border: none;
  display: block;
}

@media (max-width: 768px) {
  .cs-mockup-frame {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .cs-mockup-frame iframe {
    min-width: 900px;
    height: 560px;
  }
}
