/* Blog: post typography, embeds, comments and the editor's dark theme. Layout and small UI use
   Tailwind classes in the pages; the rendered post body is plain HTML, so it's styled here. */

/* ---------- Post body ---------- */
.bp-prose {
  font-size: 1.125rem; line-height: 1.75; color: rgba(255, 255, 255, 0.86);
  overflow-wrap: break-word;
}
.bp-prose > * + * { margin-top: 1.4em; }
/* A locked post's opening fades out above the members-only box. */
.bp-locked { max-height: 28rem; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.bp-prose h2, .bp-prose h3, .bp-prose h4 {
  font-family: 'Space Grotesk', sans-serif; color: #fff; line-height: 1.25; font-weight: 700;
  margin-top: 2em; scroll-margin-top: 8rem;
}
.bp-prose h2 { font-size: 1.75rem; }
.bp-prose h3 { font-size: 1.4rem; }
.bp-prose h4 { font-size: 1.15rem; }
.bp-prose a { color: #15BBC1; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.bp-prose a:hover { color: #8ADDE0; }
.bp-prose b, .bp-prose strong { color: #fff; font-weight: 600; }
.bp-prose mark { background: rgba(230, 174, 92, 0.3); color: inherit; padding: 0 .15em; border-radius: 2px; }
.bp-prose code { font-size: .88em; background: rgba(255, 255, 255, 0.08); padding: .12em .35em; border-radius: 4px; }
.bp-prose pre {
  background: #0d0d0d; border: 1px solid #1f1f1f; border-radius: .6rem; padding: 1rem 1.2rem;
  overflow-x: auto; font-size: .9rem; line-height: 1.6;
}
.bp-prose pre code { background: none; padding: 0; }
.bp-prose ul, .bp-prose ol { padding-left: 1.4em; }
.bp-prose ul { list-style: disc; }
.bp-prose ol { list-style: decimal; }
.bp-prose li + li { margin-top: .4em; }
.bp-prose li > ul, .bp-prose li > ol { margin-top: .4em; }
.bp-prose ul.bp-checklist { list-style: none; padding-left: 0; }
.bp-check {
  display: inline-block; width: 1em; height: 1em; margin-right: .55em; vertical-align: -.12em;
  border: 1.5px solid rgba(255, 255, 255, 0.4); border-radius: 4px;
}
.bp-check.is-on { background: #15BBC1; border-color: #15BBC1; }
.bp-prose blockquote {
  border-left: 3px solid #15BBC1; padding: .2em 0 .2em 1.2em; font-style: italic; color: rgba(255, 255, 255, 0.8);
}
.bp-prose blockquote cite { display: block; margin-top: .5em; font-size: .9rem; font-style: normal; color: rgba(255, 255, 255, 0.5); }
.bp-prose blockquote cite::before { content: '— '; }
/* Delimiter block: a rule across the text column (blog/render.js); the editor shows the same.
   The same gap on both sides: whatever follows (often a heading, whose own top margin is larger)
   starts right after the rule's margin. */
.bp-prose hr { height: 0; border: 0; border-top: 1px solid rgba(255, 255, 255, 0.35); margin: 2em 0; }
.bp-prose hr + * { margin-top: 0; }
.bp-editor .ce-delimiter { line-height: 0; padding: 1em 0; text-align: left; }
.bp-editor .ce-delimiter::before {
  content: ''; display: block; width: 100%; height: 0; border-top: 1px solid rgba(255, 255, 255, 0.35);
}

.bp-figure img, .bp-figure video { display: block; width: 100%; height: auto; border-radius: .5rem; background: #0a0a0a; }
.bp-figure video { max-height: 80vh; }
.bp-prose figcaption { margin-top: .6em; text-align: center; font-size: .875rem; color: rgba(255, 255, 255, 0.5); }
.bp-border img { border: 1px solid #262626; }
.bp-bg { background: #111; padding: 1.5rem; border-radius: .6rem; }
.bp-bg img { width: auto; max-width: 100%; margin: 0 auto; }
/* "Stretched" images break out of the text column on wide screens. */
@media (min-width: 1024px) {
  .bp-prose .bp-wide { margin-left: -8rem; margin-right: -8rem; }
}

/* Callout box (Ghost's callout card) */
.bp-callout {
  display: flex; gap: .85rem; align-items: flex-start; padding: 1.1rem 1.25rem; border-radius: .6rem;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08); font-size: 1.02rem; line-height: 1.65;
}
.bp-callout__emoji { font-size: 1.25rem; line-height: 1.5; }
.bp-callout__text { min-width: 0; flex: 1; }
.bp-callout--blue { background: rgba(21, 187, 193, 0.08); border-color: rgba(21, 187, 193, 0.28); }
.bp-callout--green { background: rgba(34, 197, 94, 0.08); border-color: rgba(34, 197, 94, 0.28); }
.bp-callout--yellow { background: rgba(230, 174, 92, 0.09); border-color: rgba(230, 174, 92, 0.3); }
.bp-callout--red { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.28); }

/* Gallery: images side by side in rows of up to three */
.bp-gallery__row { display: flex; gap: .6rem; }
.bp-gallery__row + .bp-gallery__row { margin-top: .6rem; }
.bp-gallery__row img { flex: 1 1 0; min-width: 0; width: 100%; height: auto; object-fit: contain; }

.bp-table { overflow-x: auto; }
.bp-table table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.bp-table th, .bp-table td { border: 1px solid #262626; padding: .5rem .75rem; text-align: left; vertical-align: top; }
.bp-table th { background: #111; color: #fff; font-weight: 600; }

/* ---------- Image viewer (enableLightbox in render.js) ---------- */
.bp-prose img.bp-zoomable { cursor: zoom-in; }
.bp-prose img.bp-zoomable:focus-visible { outline: 2px solid #15BBC1; outline-offset: 3px; }
html.bp-noscroll { overflow: hidden; }
.bp-lightbox {
  position: fixed; inset: 0; z-index: 2100; display: grid; place-items: center; padding: 3.5rem 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.92); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  cursor: zoom-out; animation: bp-fade .15s ease-out;
}
.bp-lightbox[hidden] { display: none; }
.bp-lightbox figure { margin: 0; display: grid; justify-items: center; gap: .75rem; max-width: 100%; }
.bp-lightbox img {
  max-width: min(96vw, 100%); max-height: calc(100vh - 7rem); width: auto; height: auto;
  object-fit: contain; border-radius: .4rem; cursor: default; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.bp-lightbox figcaption { color: rgba(255, 255, 255, 0.65); font-size: .9rem; text-align: center; max-width: 60ch; }
.bp-lightbox figcaption:empty { display: none; }
.bp-lightbox__btn {
  position: absolute; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; cursor: pointer;
  font: 300 2rem/1 'Inter', system-ui, sans-serif; color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08); border: 0; border-radius: 50%; transition: background .15s, color .15s;
}
.bp-lightbox__btn:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.bp-lightbox__btn:focus-visible { outline: 2px solid #15BBC1; outline-offset: 2px; }
.bp-lightbox__close { top: 1rem; right: 1rem; }
.bp-lightbox__prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.bp-lightbox__next { right: 1rem; top: 50%; transform: translateY(-50%); }
/* Phones: arrows sit under the image instead of over it. */
@media (max-width: 640px) {
  .bp-lightbox { padding-bottom: 4.5rem; }
  .bp-lightbox__prev, .bp-lightbox__next { top: auto; bottom: 1rem; transform: none; }
  .bp-lightbox__prev { left: calc(50% - 3.25rem); }
  .bp-lightbox__next { right: calc(50% - 3.25rem); }
}
@keyframes bp-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bp-lightbox { animation: none; } }

/* ---------- Embeds ---------- */
.bp-yt__btn, .bp-yt iframe {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0;
  border-radius: .5rem; overflow: hidden; background: #000; cursor: pointer;
}
.bp-yt__btn img { width: 100%; height: 100%; object-fit: cover; transition: filter .2s; }
.bp-yt__btn:hover img { filter: brightness(.8); }
.bp-yt__play { position: absolute; inset: 0; display: grid; place-items: center; }
.bp-yt__btn:hover .bp-yt__play path:first-child { fill: #ff2b2b; }
.bp-tweet .twitter-tweet { margin: 0 auto !important; }
/* Before X's script swaps it for the card (or if it is blocked): a plain link panel. */
.bp-tweet blockquote.twitter-tweet {
  border: 1px solid #262626; border-radius: .6rem; padding: 1rem; font-style: normal; text-align: center; max-width: 550px;
}

/* ---------- Comments ---------- */
.bc-body { white-space: pre-wrap; overflow-wrap: anywhere; color: rgba(255, 255, 255, 0.85); line-height: 1.6; }
.bc-body a { color: #15BBC1; text-decoration: underline; text-underline-offset: 2px; }
.bc-replies { border-left: 1px solid #1f1f1f; margin-left: 1.1rem; padding-left: 1.1rem; }
@media (min-width: 640px) { .bc-replies { margin-left: 1.25rem; padding-left: 1.6rem; } }
.bc-flash { animation: bc-flash 2s ease-out; border-radius: .6rem; }
@keyframes bc-flash { from { background: rgba(21, 187, 193, 0.15); } to { background: transparent; } }

/* ---------- Editor (Editor.js) on the dark theme ---------- */
.bp-editor .codex-editor__redactor { padding-bottom: 12rem !important; }
.bp-editor .ce-block__content, .bp-editor .ce-toolbar__content { max-width: none; }
.bp-editor .ce-paragraph { line-height: 1.75; }
.bp-editor .ce-paragraph[data-placeholder]:empty::before { color: rgba(255, 255, 255, 0.3); }
.bp-editor .ce-header { padding: 0; margin: 0; }
.bp-editor .ce-block--selected .ce-block__content { background: rgba(21, 187, 193, 0.12); }
.bp-editor .ce-toolbar__plus, .bp-editor .ce-toolbar__settings-btn { color: rgba(255, 255, 255, 0.7); background: #0a0a0a; }
.bp-editor .ce-toolbar__plus:hover, .bp-editor .ce-toolbar__settings-btn:hover { background: #1a1a1a; color: #fff; }
.bp-editor ::selection { background: rgba(21, 187, 193, 0.35); }
.bp-editor .ce-popover, .bp-editor .ce-inline-toolbar, .bp-editor .ce-conversion-toolbar {
  --color-background: #111; --color-text-primary: #eee; --color-text-secondary: #888;
  --color-border: #2a2a2a; --color-background-item-hover: #1d1d1d; --color-background-item-focus: #1d1d1d;
  --color-background-icon-active: rgba(21, 187, 193, 0.2); --color-text-icon-active: #15BBC1;
  --color-shadow: rgba(0, 0, 0, 0.6); --color-line-gray: #2a2a2a;
  color: #eee;
}
.bp-editor .ce-popover__container, .bp-editor .ce-popover--inline .ce-popover__container { background: #111; border-color: #2a2a2a; }
.bp-editor .ce-popover-item__icon { background: #1a1a1a; box-shadow: none; color: #ddd; }
.bp-editor .cdx-search-field { background: #1a1a1a; border-color: #2a2a2a; }
.bp-editor .cdx-search-field__input { color: #eee; }
.bp-editor .cdx-input, .bp-editor .image-tool__caption, .bp-editor .cdx-quote__caption {
  background: #0d0d0d; border-color: #262626; color: rgba(255, 255, 255, 0.75); box-shadow: none;
}
.bp-editor .cdx-button { background: #111; border-color: #2a2a2a; color: #ddd; box-shadow: none; }
.bp-editor .cdx-button:hover { background: #1a1a1a; }
.bp-editor .ce-code__textarea { background: #0d0d0d; border-color: #262626; color: #ddd; }
.bp-editor .tc-wrap { --color-border: #2a2a2a; --color-background: #111; --color-text-secondary: #888; }
.bp-editor .tc-table, .bp-editor .tc-row, .bp-editor .tc-cell { border-color: #2a2a2a; }
.bp-editor .tc-popover { background: #111; border-color: #2a2a2a; }
.bp-editor .tc-add-row:hover, .bp-editor .tc-add-column:hover, .bp-editor .tc-add-row:hover::before { background: #1a1a1a; }
.bp-editor .image-tool__image { background: #0d0d0d; }
.bp-editor .image-tool--loading .image-tool__image { background: #0d0d0d; }
.bp-editor .cdx-list__checkbox-check { border-color: rgba(255, 255, 255, 0.4); background: transparent; }

/* Custom video / embed blocks (blog/admin/tools.js) */
.bt-block { display: grid; gap: .6rem; }
.bt-drop {
  display: grid; place-items: center; gap: .4rem; padding: 1.5rem; border: 1px dashed #333; border-radius: .6rem;
  color: rgba(255, 255, 255, 0.55); font-size: .9rem; text-align: center;
}
.bt-drop button { color: #15BBC1; font-weight: 600; cursor: pointer; background: none; border: 0; font: inherit; }
.bt-row { display: flex; gap: .5rem; }
.bt-row input { flex: 1; }
.bt-input {
  width: 100%; font: inherit; font-size: .9rem; color: #fff; background: #0d0d0d;
  border: 1px solid #262626; border-radius: .45rem; padding: .55rem .75rem;
}
.bt-input:focus { outline: none; border-color: #15BBC1; }
.bt-caption { font-size: .875rem; color: rgba(255, 255, 255, 0.7); }
.bt-caption:empty::before { content: attr(data-placeholder); color: rgba(255, 255, 255, 0.3); }
.bt-error { color: #ff7b72; font-size: .85rem; }
.bt-progress { height: 3px; border-radius: 3px; background: #1a1a1a; overflow: hidden; }
.bt-progress span { display: block; height: 100%; width: 40%; background: #15BBC1; animation: bt-slide 1.1s ease-in-out infinite; }
@keyframes bt-slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* Callout and gallery blocks in the editor */
.bt-emoji {
  width: 2.2rem; flex: none; font-size: 1.25rem; line-height: 1.5; text-align: center; color: inherit;
  background: transparent; border: 1px dashed transparent; border-radius: .35rem; padding: 0;
}
.bt-emoji:hover, .bt-emoji:focus { border-color: rgba(255, 255, 255, 0.25); outline: none; }
.bt-gallery { display: flex; flex-wrap: wrap; gap: .6rem; }
.bt-gallery__cell { position: relative; flex: 1 1 calc(33% - .6rem); min-width: 8rem; }
.bt-gallery__cell img { display: block; width: 100%; height: auto; border-radius: .4rem; background: #0d0d0d; }
.bt-gallery__del {
  position: absolute; top: .35rem; right: .35rem; width: 1.6rem; height: 1.6rem; cursor: pointer;
  font: 400 1.1rem/1 'Inter', system-ui, sans-serif; color: #fff; background: rgba(0, 0, 0, 0.75); border: 0; border-radius: 50%;
}
.bt-gallery__del:hover { color: #ff7b72; }

/* Title box grows with its text. */
.bp-title-input { field-sizing: content; resize: none; overflow: hidden; }
