/* Shared post body + widget styles (frontend + TinyMCE content_css) */
:root {
  --pink: #8b3a52;
  --pink-pale: #e8d0d6;
  --pink-body: #6b2d40;
  --pink-muted: #8f5568;
  --pink-accent: #ff85c1;
  --latte-light: #f8f2ea;
  --latte-border: #d9c9b4;
  --white: #ffffff;
  --font-label: 'Cormorant SC', Georgia, serif;
  --font-serif: 'Cormorant Upright', Georgia, serif;
  --font-body: 'Open Sans', system-ui, sans-serif;
  --radius-sm: 8px;
}

.post-content,
body.mce-content-body {
  font-family: var(--font-serif);
  font-size: 19px;
  color: var(--pink-body);
  line-height: 1.5;
}

body.mce-content-body {
  box-sizing: border-box;
  width: 780px;
  max-width: 100%;
  margin: 0 auto;
  padding: 2rem 1.75rem 3rem;
  background: #f8f2ea;
  border: 1px solid #d9c9b4;
  border-radius: 20px;
}

body.mce-content-body *,
body.mce-content-body *::before,
body.mce-content-body *::after {
  box-sizing: border-box;
}

body.mce-content-body figure {
  display: block;
}

/* Cover preview in editor — same look as published .post-single__cover */
body.mce-content-body > .editor-cover-preview {
  display: block;
  margin: 0 0 1.5rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

body.mce-content-body > .editor-cover-preview img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 0;
  margin: 0;
}

body.mce-content-body blockquote {
  margin-left: 0;
  margin-right: 0;
}

.prose h2,
.prose h3,
.prose h4,
body.mce-content-body h2,
body.mce-content-body h3,
body.mce-content-body h4 {
  font-family: var(--font-label);
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--pink);
}

.prose img,
body.mce-content-body > img,
body.mce-content-body p > img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 1.25rem 0;
}

.prose img.img-float-left,
body.mce-content-body img.img-float-left {
  float: left;
  max-width: min(280px, 46%);
  margin: 0.35rem 1.25rem 1rem 0;
}

.prose img.img-float-right,
body.mce-content-body img.img-float-right {
  float: right;
  max-width: min(280px, 46%);
  margin: 0.35rem 0 1rem 1.25rem;
}

.prose img.img-float-center,
body.mce-content-body img.img-float-center {
  display: block;
  float: none;
  clear: both;
  margin: 1.25rem auto;
  max-width: min(640px, 100%);
}

.prose a,
body.mce-content-body a {
  color: var(--pink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Photo widgets — float left/right/center with caption */
.post-photo {
  margin: 1.5rem 0;
  max-width: 100%;
}

.post-photo img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 24px rgba(139, 58, 82, 0.12);
}

.post-photo--left,
.post-photo--right,
.post-photo--wrap-left,
.post-photo--wrap-right {
  max-width: min(280px, 46%);
}

.post-photo--left,
.post-photo--wrap-left {
  float: left;
  margin: 0.35rem 1.25rem 1rem 0;
}

.post-photo--right,
.post-photo--wrap-right {
  float: right;
  margin: 0.35rem 0 1rem 1.25rem;
}

.post-photo--center {
  display: block;
  clear: both;
  margin: 1.5rem auto;
  max-width: min(640px, 100%);
}

.post-photo figcaption,
.post-split__media figcaption,
.post-gallery figcaption {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  font-family: var(--font-label);
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--pink-muted);
  text-align: center;
}

/* Text beside photo */
.post-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1rem, 2.5vw, 1.75rem);
  align-items: center;
  clear: both;
  margin: 1.75rem 0;
}

.post-split--align-top {
  align-items: start;
}

.post-split--align-middle {
  align-items: center;
}

.post-split--align-bottom {
  align-items: end;
}

.post-split--photo-left .post-split__media {
  order: 0;
}

.post-split--photo-left .post-split__text {
  order: 1;
}

.post-split--photo-right .post-split__media {
  order: 1;
}

.post-split--photo-right .post-split__text {
  order: 0;
}

.post-split__media {
  margin: 0;
  text-align: center;
}

.post-split__media img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 24px rgba(139, 58, 82, 0.12);
}

.post-split__media img.post-cutout,
.post-split .post-cutout img,
.prose .post-split__media img[src$=".png"],
.prose .post-split__media img[src$=".PNG"],
body.mce-content-body .post-split__media img[src$=".png"],
body.mce-content-body .post-split__media img[src$=".PNG"] {
  box-shadow: none !important;
  filter: none !important;
  border-radius: 0;
}

.post-split__text {
  min-width: 0;
}

.post-split__text p:first-child {
  margin-top: 0;
}

.post-split__text p:last-child {
  margin-bottom: 0;
}

/* Photo gallery */
.post-gallery {
  display: grid;
  gap: 0.75rem;
  clear: both;
  margin: 1.75rem 0;
}

.post-gallery--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-gallery--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.post-gallery--4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-gallery figure {
  margin: 0;
}

/* Anything after photos that got stuck inside the gallery still spans full width */
.post-gallery > :not(figure),
.post-moodboard > :not(img),
.post-split > .post-steps,
.post-split > .post-gallery,
figure .post-steps,
figure .post-gallery,
.post-gallery figure > :not(img):not(figcaption):not(picture),
.post-moodboard > p,
.post-moodboard > div {
  grid-column: 1 / -1;
  display: block;
  width: 100% !important;
  max-width: none !important;
  float: none !important;
  clear: both;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.post-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  margin: 0;
  border-radius: var(--radius-sm);
}

.post-sticker,
.post-cutout,
.post-polaroid {
  margin: 1.5rem 0;
  max-width: 100%;
}

.post-sticker,
.post-cutout,
.post-sticker img,
.post-cutout img,
.prose .post-sticker img,
.prose .post-cutout img,
body.mce-content-body .post-sticker img,
body.mce-content-body .post-cutout img {
  box-shadow: none !important;
  filter: none !important;
}

.post-sticker img,
.post-cutout img {
  display: block;
  max-width: min(240px, 70vw);
  height: auto;
  border: 0;
  border-radius: 0;
}

.post-polaroid img {
  display: block;
  max-width: min(240px, 70vw);
  height: auto;
  border: 0;
  border-radius: 0;
  box-shadow: 0 10px 24px rgba(139, 58, 82, 0.14);
}

.post-sticker--left,
.post-cutout--left,
.post-polaroid {
  float: left;
  margin: 0.35rem 1.25rem 1rem 0;
}

.post-sticker--right,
.post-cutout--right {
  float: right;
  margin: 0.35rem 0 1rem 1.25rem;
}

.post-sticker figcaption,
.post-polaroid figcaption {
  margin-top: 0.35rem;
  font-family: var(--font-label);
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--pink-muted);
  text-align: center;
}

.post-gif-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin: 1.5rem 0;
}

.post-gif-row img {
  width: auto;
  max-width: min(220px, 45vw);
  max-height: 220px;
  object-fit: cover;
  margin: 0;
  border-radius: var(--radius-sm);
}

.post-moodboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 1.75rem 0;
}

.post-moodboard img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  margin: 0;
  border-radius: var(--radius-sm);
}

.post-quote-bubble {
  margin: 1.75rem auto;
  max-width: 34rem;
  padding: 1rem 1.25rem;
  background: rgba(255, 182, 209, 0.35);
  border: 2px solid rgba(255, 133, 193, 0.45);
  border-radius: 1.25rem;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--pink);
  text-align: center;
}

.post-quote-bubble p {
  margin: 0;
}

/* Full-width bubble, cutout sitting on the right over it */
.post-bubble-cutout {
  position: relative;
  clear: both;
  margin: 10rem 0;
}

.post-bubble-cutout .post-quote-bubble {
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
  text-align: center;
  padding: 1.2rem 15rem 1.2rem 1.6rem;
}

.post-bubble-cutout__photo {
  position: absolute;
  z-index: 2;
  right: 0.4rem;
  top: 50%;
  width: auto;
  margin: 0;
  transform: translateY(-50%);
  pointer-events: none;
}

.post-bubble-cutout__photo img,
.prose .post-bubble-cutout__photo img,
body.mce-content-body .post-bubble-cutout__photo img {
  display: block;
  width: auto;
  height: 22rem;
  max-width: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none !important;
  filter: none !important;
}

.post-bubble-cutout__photo:has(img[src$="39f84d99b864a35eac5a395488719d2d.png"]) {
  display: flow-root;
}

.prose img[src$="39f84d99b864a35eac5a395488719d2d.png"],
body.mce-content-body img[src$="39f84d99b864a35eac5a395488719d2d.png"] {
  margin-bottom: 80px;
}

.post-bubble-cutout:has(img[src$="39f84d99b864a35eac5a395488719d2d.png"]) {
  margin-top: calc(10rem + 48px);
}

@media (max-width: 640px) {
  .post-bubble-cutout,
  .post-bubble-cutout:has(img[src$="39f84d99b864a35eac5a395488719d2d.png"]) {
    margin: 3.25rem 0;
  }

  .post-bubble-cutout .post-quote-bubble {
    padding-right: 8.5rem;
  }

  .post-bubble-cutout__photo img,
  .prose .post-bubble-cutout__photo img,
  body.mce-content-body .post-bubble-cutout__photo img {
    height: 14rem;
  }
}

.post-steps {
  display: grid;
  gap: 0.85rem;
  margin: 1.5rem 0;
  width: 100%;
  max-width: 100%;
  clear: both;
  box-sizing: border-box;
}

.post-step {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: rgba(248, 242, 234, 0.75);
  border: 1px solid var(--latte-border);
  border-radius: var(--radius-sm);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.post-step__num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: max-content;
  max-width: 8rem;
  min-width: 1.75rem;
  min-height: 1.75rem;
  height: auto;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--pink-accent);
  color: var(--white);
  font-family: var(--font-label);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.post-step__text {
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.post-step__text p,
.post-step > p {
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.post-content--moodboard .post-moodboard,
body.post-content--moodboard .post-moodboard {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.post-content--scrapbook .post-sticker img,
.post-content--scrapbook .post-cutout img,
body.post-content--scrapbook .post-sticker img,
body.post-content--scrapbook .post-cutout img {
  transform: rotate(-3deg);
}

.post-content--routine .post-steps,
body.post-content--routine .post-steps {
  gap: 1rem;
}

/* Coraline theme — editor + live body */
.post-content--coraline,
body.post-content--coraline,
.post-content--coraline p,
.post-content--coraline li,
.post-content--coraline span:not(.post-step__num),
.post-content--coraline strong,
.post-content--coraline em,
.post-content--coraline b,
.post-content--coraline i,
.post-content--coraline u,
.post-content--coraline blockquote,
.post-content--coraline .post-step,
.post-content--coraline .post-step p,
.post-content--coraline .post-quote-bubble,
.post-content--coraline .post-quote-bubble p,
body.post-content--coraline p,
body.post-content--coraline li,
body.post-content--coraline span:not(.post-step__num),
body.post-content--coraline strong,
body.post-content--coraline em,
body.post-content--coraline b,
body.post-content--coraline i,
body.post-content--coraline u,
body.post-content--coraline blockquote,
body.post-content--coraline .post-step,
body.post-content--coraline .post-step p,
body.post-content--coraline .post-quote-bubble,
body.post-content--coraline .post-quote-bubble p {
  color: #f6e27a !important;
}

body.post-content--coraline {
  --coraline-gutter: 3.2rem;
  border-color: #2a3f6d;
  color: #f6e27a;
  padding: 4.1rem var(--coraline-gutter) 4rem;
  background-color: #122445;
  background-image:
    url('/assets/images/themes/coraline/button.svg'),
    url('/assets/images/themes/coraline/button.svg'),
    url('/assets/images/themes/coraline/button.svg'),
    url('/assets/images/themes/coraline/button.svg'),
    url('/assets/images/themes/coraline/button.svg'),
    url('/assets/images/themes/coraline/button.svg'),
    url('/assets/images/themes/coraline/star.svg'),
    url('/assets/images/themes/coraline/star.svg'),
    url('/assets/images/themes/coraline/star.svg'),
    url('/assets/images/themes/coraline/star.svg'),
    url('/assets/images/themes/coraline/star.svg'),
    url('/assets/images/themes/coraline/star.svg'),
    linear-gradient(180deg, rgba(8, 18, 42, 0.12), rgba(8, 18, 42, 0.42));
  background-repeat: no-repeat;
  background-position:
    right calc(1rem + 1.55rem) top 1.35rem,
    right calc(1rem + 5.25rem - 1.1rem) top calc(1.35rem + 1.85rem),
    right calc(1rem + 5.25rem - 3.35rem - 1.35rem) top calc(1.35rem + 1.65rem),
    left calc(1rem + 1.55rem) bottom calc(0.65rem + 3.5rem - 1.55rem),
    left 1rem bottom calc(0.65rem + 3.5rem - 1.85rem - 1.1rem),
    left calc(1rem + 3.35rem) bottom calc(0.65rem + 3.5rem - 1.65rem - 1.35rem),
    left 0.7rem top 22%,
    right 0.65rem top 34%,
    left 0.55rem top 48%,
    right 0.8rem top 56%,
    left 1.1rem top 1.55rem,
    right 1.15rem bottom 1.7rem,
    0 0;
  background-size:
    1.55rem,
    1.1rem,
    1.35rem,
    1.55rem,
    1.1rem,
    1.35rem,
    1rem,
    1.35rem,
    0.9rem,
    1.2rem,
    1.15rem,
    1.25rem,
    auto;
}

@media (max-width: 640px) {
  body.post-content--coraline {
    --coraline-gutter: 1.75rem;
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
    background-image:
      url('/assets/images/themes/coraline/button.svg'),
      url('/assets/images/themes/coraline/button.svg'),
      url('/assets/images/themes/coraline/button.svg'),
      url('/assets/images/themes/coraline/button.svg'),
      url('/assets/images/themes/coraline/button.svg'),
      url('/assets/images/themes/coraline/button.svg'),
      url('/assets/images/themes/coraline/star.svg'),
      url('/assets/images/themes/coraline/star.svg'),
      linear-gradient(180deg, rgba(8, 18, 42, 0.12), rgba(8, 18, 42, 0.42));
    background-position:
      right calc(0.55rem + 1.2rem) top 1rem,
      right calc(0.55rem + 4.2rem - 0.9rem) top calc(1rem + 1.5rem),
      right calc(0.55rem + 4.2rem - 2.65rem - 1.1rem) top calc(1rem + 1.35rem),
      left calc(0.55rem + 1.2rem) bottom calc(0.45rem + 2.85rem - 1.25rem),
      left 0.55rem bottom calc(0.45rem + 2.85rem - 1.5rem - 0.9rem),
      left calc(0.55rem + 2.65rem) bottom calc(0.45rem + 2.85rem - 1.35rem - 1.1rem),
      left 0.55rem top 1.15rem,
      right 0.55rem bottom 1.2rem,
      0 0;
    background-size:
      1.25rem,
      0.9rem,
      1.1rem,
      1.25rem,
      0.9rem,
      1.1rem,
      0.95rem,
      1rem,
      auto;
  }
}

.post-content--coraline h2,
.post-content--coraline h3,
.post-content--coraline h4,
.post-content--coraline a,
body.post-content--coraline h2,
body.post-content--coraline h3,
body.post-content--coraline h4,
body.post-content--coraline a {
  color: #f6e27a !important;
}

.post-content--coraline .post-quote-bubble,
body.post-content--coraline .post-quote-bubble {
  background: rgba(246, 226, 122, 0.12);
  border-color: rgba(246, 226, 122, 0.45);
}

.post-content--coraline .post-step,
body.post-content--coraline .post-step {
  background: rgba(18, 36, 69, 0.55);
  border-color: rgba(246, 226, 122, 0.28);
}

.post-content--coraline .post-step__num,
body.post-content--coraline .post-step__num {
  background: #f6e27a !important;
  color: #122445 !important;
}

.post-content--coraline .post-photo figcaption,
.post-content--coraline .post-split__media figcaption,
.post-content--coraline .post-gallery figcaption,
body.post-content--coraline .post-photo figcaption,
body.post-content--coraline .post-split__media figcaption,
body.post-content--coraline .post-gallery figcaption {
  color: #f6e27a !important;
}

/* Override leftover TinyMCE / pink body colors inside coraline */
.post-content--coraline [style*="color"],
body.post-content--coraline [style*="color"] {
  color: #f6e27a !important;
}

.post-content--coraline .post-step__num[style*="color"],
body.post-content--coraline .post-step__num[style*="color"] {
  color: #122445 !important;
}

@media (max-width: 640px) {
  .post-photo--left,
  .post-photo--right,
  .post-photo--wrap-left,
  .post-photo--wrap-right,
  .post-sticker--left,
  .post-sticker--right,
  .post-cutout--left,
  .post-cutout--right,
  .post-polaroid {
    float: none;
    max-width: min(320px, 100%);
    margin: 1rem auto;
    text-align: center;
  }

  .prose img.img-float-left,
  .prose img.img-float-right,
  body.mce-content-body img.img-float-left,
  body.mce-content-body img.img-float-right {
    float: none;
    display: block;
    max-width: min(320px, 100%);
    margin: 1rem auto;
  }

  .post-split {
    grid-template-columns: 1fr;
  }

  .post-split--photo-left .post-split__media,
  .post-split--photo-left .post-split__text,
  .post-split--photo-right .post-split__media,
  .post-split--photo-right .post-split__text {
    order: initial;
  }

  .post-gallery--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .post-moodboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.post-content img {
  cursor: zoom-in;
}

.post-bubble-cutout__photo img {
  pointer-events: auto;
}

body.is-lightbox-open {
  overflow: hidden;
}

.post-lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 8, 12, 0.92);
  padding: 3.5rem 4.5rem;
}

.post-lightbox[hidden] {
  display: none;
}

.post-lightbox__stage {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
}

.post-lightbox__img {
  display: block;
  max-width: min(1100px, 92vw);
  max-height: calc(100vh - 7rem);
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 0;
  box-shadow: none;
}

.post-lightbox__counter {
  margin: 0.7rem 0 0;
  text-align: center;
  color: #fff;
  font-family: var(--font-label, Georgia, serif);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}

.post-lightbox__close,
.post-lightbox__nav {
  position: absolute;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  line-height: 1;
}

.post-lightbox__close {
  top: 0.6rem;
  right: 0.8rem;
  font-size: 2.6rem;
}

.post-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 3.2rem;
  padding: 0.4rem 0.7rem;
}

.post-lightbox__nav--prev {
  left: 0.3rem;
}

.post-lightbox__nav--next {
  right: 0.3rem;
}

.post-lightbox:not(.is-multi) .post-lightbox__nav,
.post-lightbox:not(.is-multi) .post-lightbox__counter {
  display: none;
}
