.dwcb {
  --dwcb-container: 1040px;
  --dwcb-wide: 1200px;
  --dwcb-gap: 56px;
  --dwcb-text: inherit;
  --dwcb-muted: #66706b;
  --dwcb-accent: currentColor;
  display: flex;
  flex-direction: column;
  gap: var(--dwcb-gap);
  width: min(100% - 32px, var(--dwcb-wide));
  margin-right: auto;
  margin-left: auto;
}

.dwcb-block {
  width: min(100%, var(--dwcb-container));
}

.dwcb-rich-text.is-wide,
.dwcb-single-image.is-wide,
.dwcb-image-pair,
.dwcb-text-image,
.dwcb-gallery,
.dwcb-video,
.dwcb-cta {
  width: 100%;
}

.dwcb-rich-text.is-full,
.dwcb-single-image.is-full {
  width: 100%;
}

.dwcb-rich-text,
.dwcb-text-image__text,
.dwcb-cta,
.dwcb-quote {
  color: var(--dwcb-text);
  line-height: 1.55;
}

.dwcb-rich-text > :first-child,
.dwcb-text-image__content > :first-child,
.dwcb-cta > :first-child {
  margin-top: 0;
}

.dwcb-rich-text > :last-child,
.dwcb-text-image__content > :last-child,
.dwcb-cta > :last-child {
  margin-bottom: 0;
}

.dwcb-figure {
  margin: 0;
}

.dwcb-image {
  display: block;
  width: 100%;
  height: auto;
}

.dwcb-figure figcaption {
  margin-top: 10px;
  color: var(--dwcb-muted);
  font-size: 0.875rem;
  line-height: 1.35;
}

.dwcb-image-pair,
.dwcb-text-image {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 5vw, 68px);
  align-items: start;
}

.dwcb-text-image.is-image-left .dwcb-text-image__image {
  order: -1;
}

.dwcb-text-image.has-secondary-image .dwcb-text-image__text {
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 5vw, 68px);
}

.dwcb-text-image.is-equal-height {
  align-items: stretch;
}

.dwcb-text-image.is-equal-height .dwcb-text-image__image,
.dwcb-text-image.is-equal-height .dwcb-text-image__image .dwcb-figure {
  height: 100%;
}

.dwcb-text-image.is-equal-height .dwcb-text-image__image .dwcb-image {
  height: 100%;
  object-fit: cover;
}

.dwcb-gallery.is-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.dwcb-gallery.is-slider {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.dwcb-gallery.is-slider::-webkit-scrollbar {
  display: none;
}

.dwcb-gallery.is-slider .dwcb-figure {
  flex: 0 0 min(760px, 82vw);
  scroll-snap-align: start;
}

.dwcb-video__poster {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #000;
  cursor: pointer;
}

.dwcb-video__poster img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0.82;
}

.dwcb-video__poster span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  transform: translate(-50%, -50%);
}

.dwcb-video__poster span::after {
  position: absolute;
  top: 50%;
  left: 52%;
  width: 0;
  height: 0;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-left: 20px solid #111;
  content: "";
  transform: translate(-50%, -50%);
}

.dwcb-quote {
  padding: 32px;
  border-left: 4px solid var(--dwcb-accent);
  background: rgba(0, 0, 0, 0.035);
}

.dwcb-quote p {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.45;
}

.dwcb-quote cite {
  display: block;
  margin-top: 16px;
  color: var(--dwcb-muted);
  font-style: normal;
}

.dwcb-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 18px;
  padding: 0 22px;
  background: var(--dwcb-accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.dwcb-modal {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.78);
}

.dwcb-modal__inner {
  position: relative;
  width: min(960px, 100%);
  aspect-ratio: 16 / 9;
  background: #000;
}

.dwcb-modal iframe,
.dwcb-modal video {
  width: 100%;
  height: 100%;
  border: 0;
}

.dwcb-modal__close {
  position: absolute;
  right: -12px;
  bottom: 100%;
  width: 40px;
  height: 40px;
  border: 0;
  background: #fff;
  color: #111;
  font-size: 26px;
  cursor: pointer;
}

@media (max-width: 767px) {
  .dwcb {
    --dwcb-gap: 40px;
  }

  .dwcb-image-pair,
  .dwcb-text-image,
  .dwcb-gallery.is-grid {
    grid-template-columns: 1fr;
  }

  .dwcb-text-image.is-image-left .dwcb-text-image__image {
    order: 0;
  }
}

/* Grouped content uses the existing block templates inside each area. */
.dwcb-group { display: grid; width: 100%; gap: clamp(24px, 4vw, 48px); }
.dwcb-group.is-columns, .dwcb-group.is-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dwcb-group__area { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.dwcb-group__area > .dwcb-block { width: 100%; min-width: 0; margin: 0; box-sizing: border-box; }
.dwcb-group__area .dwcb-gallery.is-slider .dwcb-figure { flex-basis: 85%; }
.dwcb-group__area .dwcb-text-image, .dwcb-group__area .dwcb-image-pair { gap: 24px; }
@media (max-width: 767px) {
  .dwcb-group.is-columns, .dwcb-group.is-grid { grid-template-columns: 1fr; }
}
