/* Base template — defaults match the rest of the site */
.case-study {
  --cs-accent: #C41E3A;
  --cs-header-bg: #FAFAF8;
  --cs-header-text: #111111;
  max-width: 760px;
  margin: 0 auto;
  padding: calc(var(--nav-height,68px) + 5rem) 1.5rem 6rem;
}

/* Brahmi override — teal + brass, pulled from the actual packaging colors */
.case-study.theme-brahmi {
  --cs-accent: #C99A4B;
  --cs-header-bg: #0F3B3E;
  --cs-header-text: #F5F1E8;
}

.cs-header {
  position: relative;
  overflow: hidden;
  margin-bottom: 3rem;
}
.case-study.theme-brahmi .cs-header {
  background-color: var(--cs-header-bg);
  color: var(--cs-header-text);
  padding: 6rem 2rem 4rem;
  margin: calc(0rem - var(--nav-height,68px) - 5rem) -1.5rem 3rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='%23F5F1E8' stroke-opacity='0.08' stroke-width='1'%3E%3Cpath d='M30 0 L60 30 L30 60 L0 30 Z'/%3E%3Ccircle cx='30' cy='30' r='14'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
}
.cs-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  color: inherit;
  margin-bottom: 1rem;
  position: relative;
  z-index: 4;
}
.cs-subtitle {
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 55ch;
  position: relative;
  z-index: 4;
}
.case-study.theme-brahmi .cs-subtitle {
  color: #C9BFA8;
}

.cs-overview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem 1.5rem;
  padding: 1.25rem 0;
  border-top: 1px solid #e5e5e5;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 3rem;
}
.cs-overview > div {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.cs-label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #999999;
}
.cs-value {
  font-size: 0.95rem;
  color: #111111;
}

.cs-block {
  margin-bottom: 3rem;
}
.cs-block-label {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cs-accent, #C41E3A);
  margin-bottom: 0.9rem;
}
.cs-block-text {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #222222;
  max-width: 65ch;
}

.cs-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 3rem;
}
.cs-gallery picture {
  display: block;
  overflow: hidden;
  border-radius: 8px;
}
.cs-gallery img {
  width: 100%;
  height: auto;
  display: block;
}

.cs-lotus-divider {
  display: flex;
  justify-content: center;
  margin: 3rem 0;
  opacity: 0.7;
}

.cs-next {
  border-top: 1px solid #e5e5e5;
  padding-top: 2rem;
  text-align: center;
}
.cs-next-link {
  font-size: 1rem;
  font-weight: 500;
  color: #111111;
  text-decoration: none;
  border-bottom: 1px solid #111111;
  padding-bottom: 3px;
}
.cs-next-link:hover {
  color: var(--cs-accent, #C41E3A);
  border-bottom-color: var(--cs-accent, #C41E3A);
}

.blend-selector {
  margin-bottom: 3rem;
}

@media (max-width: 768px) {
  .case-study {
    padding: calc(var(--nav-height,68px) + 3rem) 1rem 4rem;
  }
  .case-study.theme-brahmi .cs-header {
    padding: 4rem 1.5rem 3rem;
    margin: calc(0rem - var(--nav-height,68px) - 3rem) -1rem 3rem;
  }
  .cs-overview {
    grid-template-columns: 1fr;
  }
  .cs-gallery {
    grid-template-columns: 1fr;
  }
}

.cs-media-figure .cs-media-static {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

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

@media (prefers-reduced-motion: reduce) {
  .cs-media-figure .cs-media-static {
    display: block;
  }
  .cs-media-video {
    display: none !important;
  }
}
