/* Insight Split — fixed visual language (text/image only editable) */

.shop-insight-split {
  --insight-bg: #f7f4f0;
  --insight-title: #1c1917;
  --insight-accent: #8a6a8a;
  --insight-body: #3f3f46;
  --insight-pill-bg: #f3e6df;
  --insight-pill-border: #e5d4cb;
  --insight-pill-text: #3f3f46;
  --insight-pill-icon: #9a9a9a;
  --insight-radius: 14px;
  --insight-font: var(--font-body, Arial, Helvetica, sans-serif);

  box-sizing: border-box;
  width: 100%;
  margin: 1.75em 0;
  padding: 28px 24px;
  background: var(--insight-bg);
  border-radius: 0;
  font-family: var(--insight-font);
  color: var(--insight-body);
}

/* Full-bleed background (frontend only): the block background spans the full
   viewport width, while __inner stays centered at max-width:1100px so the
   internal layout is unchanged. Editor (.is-editor) keeps the card look. */
.shop-insight-split:not(.is-editor) {
  width: 100vw;
  max-width: 100vw;
  margin-top: 0;
  margin-bottom: 0;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  border-radius: 0;
}

/* Deletable elements: hover an element in the editor to reveal its × button.
   Only rendered inside the editor (root has .is-editor). */
.shop-insight-split .is-deletable {
  position: relative;
}
.shop-insight-split__icon-slot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.shop-insight-split .shop-del-btn {
  position: absolute;
  top: -9px;
  right: -9px;
  z-index: 6;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid #e11d48;
  border-radius: 50%;
  background: #fff;
  color: #e11d48;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.is-editor .is-deletable:hover > .shop-del-btn,
.is-editor .shop-del-btn:focus {
  display: inline-flex;
}

.shop-insight-split *,
.shop-insight-split *::before,
.shop-insight-split *::after {
  box-sizing: border-box;
}

.shop-insight-split__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 36px 40px;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
}

.shop-insight-split__content {
  min-width: 0;
  padding-top: 4px;
}

.shop-insight-split__title {
  margin: 0 0 18px;
  font-family: var(--insight-font);
  font-size: clamp(1.65rem, 2.4vw, 2.15rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-transform: none; /* override global h1/h2/h3 uppercase in base.css */
}

.shop-insight-split__title-dark,
.shop-insight-split__title-accent {
  display: block;
  margin: 0;
  font-family: var(--insight-font);
  font-size: clamp(1.65rem, 2.4vw, 2.15rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-transform: none; /* override global h1/h2/h3 uppercase in base.css */
}

.shop-insight-split__title-dark {
  color: var(--insight-title);
}

.shop-insight-split__title-accent {
  color: var(--insight-accent);
}

.shop-insight-split__subtitle {
  margin: 0 0 22px;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--insight-title);
  text-transform: none; /* override global h1/h2/h3 uppercase in base.css */
}

.shop-insight-split__pills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.shop-insight-split__pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px 8px 12px;
  border: 1px solid var(--insight-pill-border);
  border-radius: 999px;
  background: var(--insight-pill-bg);
  color: var(--insight-pill-text);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.3;
}

.shop-insight-split__pill-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  color: var(--insight-pill-icon);
}

.shop-insight-split__pill-icon svg {
  display: block;
}

.shop-insight-split__pill-text {
  min-width: 0;
}

.shop-insight-split__footer-bold {
  margin: 0 0 8px;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--insight-title);
}

.shop-insight-split__footer-text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--insight-body);
}

.shop-insight-split__media {
  min-width: 0;
}

.shop-insight-split__image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
  border-radius: var(--insight-radius);
  background: transparent;
}

.shop-insight-split__image-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--insight-radius);
  background: #e8e4de;
}

/* ---------- Editor-only ---------- */
.shop-insight-split.is-editor
  .shop-insight-split__title
  .block-editor-rich-text__editable,
.shop-insight-split.is-editor
  .shop-insight-split__subtitle.block-editor-rich-text__editable,
.shop-insight-split.is-editor
  .shop-insight-split__footer-bold.block-editor-rich-text__editable,
.shop-insight-split.is-editor
  .shop-insight-split__footer-text.block-editor-rich-text__editable,
.shop-insight-split.is-editor
  .shop-insight-split__pill-text.block-editor-rich-text__editable {
  outline: none;
}

.shop-insight-split.is-editor .shop-insight-split__pill {
  position: relative;
  padding-right: 28px;
}

.shop-insight-split__pill-remove {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(28, 25, 23, 0.12);
  color: #1c1917;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.shop-insight-split__pill-remove:hover {
  background: rgba(28, 25, 23, 0.22);
}

.shop-insight-split__pill-actions {
  margin: -10px 0 18px;
}

.shop-insight-split__image-btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.shop-insight-split__image-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(28, 25, 23, 0.72);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.shop-insight-split__image-btn:hover .shop-insight-split__image-hint,
.shop-insight-split__image-btn:focus-visible .shop-insight-split__image-hint {
  opacity: 1;
}

.shop-insight-split__image-placeholder.is-button {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #c5c0b8;
  background: #efeae4;
  color: #57534e;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.shop-insight-split__image-placeholder.is-button:hover {
  background: #e8e1d9;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .shop-insight-split {
    padding: 22px 18px;
  }

  .shop-insight-split__inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .shop-insight-split__media {
    order: -1;
    max-width: 420px;
  }

  .shop-insight-split__title {
    font-size: clamp(1.45rem, 5vw, 1.85rem);
  }
}

@media (max-width: 520px) {
  .shop-insight-split__pills {
    grid-template-columns: 1fr;
  }

  .shop-insight-split {
    padding: 18px 14px;
  }
}

/* ---------- Rich-text inline formats (system toolbar) ---------- */
.shop-insight-split mark,
.shop-insight-split mark.has-inline-background-color {
  padding: 0.05em 0.25em;
  border-radius: 3px;
  background-color: #fdeeb3;
  color: inherit;
}

.shop-insight-split code {
  padding: 0.1em 0.4em;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.06);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.shop-insight-split kbd {
  padding: 0.1em 0.4em;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.04);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
}

.shop-insight-split a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.shop-insight-split sub,
.shop-insight-split sup {
  font-size: 0.72em;
  line-height: 0;
}

.shop-insight-split img {
  max-width: 100%;
  height: auto;
}

.shop-insight-split .rich-text *,
.shop-insight-split [data-rich-text-format-boundary] {
  box-sizing: border-box;
}
