figure figcaption,
figure .slot,
figure .post-media-caption-text {
  display: none !important;
}

.post-editable {
  position: relative;
}

.post-editor-btn {
  display: none !important;
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 3;
  appearance: none;
  min-height: 34px;
  border: 1px solid #eab308;
  border-radius: 8px;
  padding: 7px 11px;
  background: #facc15;
  color: #1f2933;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(31, 41, 51, .14);
}

.post-inline-editable {
  border-radius: 6px;
  outline: 1px dashed transparent;
}

.post-inline-editable:hover {
  outline-color: #facc15;
}

.post-inline-editable:focus {
  outline: 2px solid #facc15;
  background: #fffdf0;
}

.post-add-media-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 10px;
}

.post-add-media-input,
.post-media-replace-input {
  display: none;
}

.post-add-media-btn,
.post-media-mini-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border: 1px solid #0f766e;
  border-radius: 8px;
  padding: 6px 10px;
  background: #fff;
  color: #0f766e;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.post-add-media-btn {
  min-height: 36px;
  background: #0f766e;
  color: #fff;
}

.post-media-save-btn {
  border-color: #047857;
  background: #047857;
  color: #fff;
}

.post-media-save-btn[hidden] {
  display: none !important;
}

.post-media-save-btn:disabled {
  cursor: wait;
  opacity: .65;
}

.post-media-inline-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}

figure:hover .post-media-inline-controls,
figure:focus-within .post-media-inline-controls {
  opacity: 1;
  pointer-events: auto;
}

.post-media-delete-btn {
  border-color: #b42318;
  color: #b42318;
}

.post-editor-btn:hover {
  background: #fde047;
}

.post-editor-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  align-items: stretch;
  justify-content: center;
  overflow: auto;
  padding: 28px 18px;
  background: rgba(15, 23, 42, .54);
}

.post-editor-backdrop.is-open {
  display: flex;
}

.post-editor-modal {
  width: min(1040px, 100%);
  margin: auto;
  border-radius: 10px;
  border: 1px solid #d0d5dd;
  background: #fff;
  color: #1f2933;
  box-shadow: 0 20px 56px rgba(15, 23, 42, .28);
}

.post-editor-header,
.post-editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e4e7ec;
}

.post-editor-footer {
  justify-content: flex-end;
  border-top: 1px solid #e4e7ec;
  border-bottom: 0;
}

.post-editor-title {
  margin: 0;
  font-size: 20px;
}

.post-editor-body {
  display: grid;
  gap: 16px;
  max-height: min(76vh, 820px);
  overflow: auto;
  padding: 16px;
}

.post-editor-field {
  display: grid;
  gap: 7px;
}

.post-editor-field label,
.post-editor-media-title {
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

.post-editor-input,
.post-editor-textarea,
.post-editor-select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: #111827;
  font: inherit;
  font-size: 14px;
}

.post-editor-textarea {
  min-height: 140px;
  resize: vertical;
  white-space: pre-wrap;
}

.post-editor-media-list {
  display: grid;
  gap: 12px;
}

.post-editor-media-card {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  padding: 10px;
  background: #fbfaf7;
}

.post-editor-preview {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #f2f4f7;
}

.post-editor-preview img,
.post-editor-preview video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.post-editor-media-fields {
  display: grid;
  gap: 8px;
}

.post-editor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.post-editor-file-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.post-editor-file {
  display: none;
}

.post-editor-file-label,
.post-editor-action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid #0f766e;
  border-radius: 8px;
  padding: 8px 12px;
  background: #0f766e;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.post-editor-secondary {
  border-color: #94a3b8;
  background: #fff;
  color: #334155;
}

.post-editor-danger {
  border-color: #b42318;
  background: #fff;
  color: #b42318;
}

.post-editor-status {
  min-height: 20px;
  color: #0f766e;
  font-size: 13px;
}

.post-editor-sortable-grid figure {
  position: relative;
  cursor: grab;
}

.post-editor-sortable-grid figure:active {
  cursor: grabbing;
}

.post-editor-sortable-grid figure.is-dragging {
  opacity: .54;
  outline: 2px dashed #facc15;
  outline-offset: -4px;
}

.post-editor-sortable-grid img,
.post-editor-sortable-grid video {
  cursor: zoom-in;
}

.post-media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, .78);
}

.post-media-lightbox.is-open {
  display: flex;
}

.post-media-lightbox-frame {
  position: relative;
  width: min(1120px, 100%);
  max-height: 94vh;
  display: grid;
  gap: 10px;
}

.post-media-lightbox-body {
  display: grid;
  place-items: center;
  min-height: 260px;
}

.post-media-lightbox-body img,
.post-media-lightbox-body video {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
  box-shadow: 0 20px 56px rgba(0, 0, 0, .32);
}

.post-media-lightbox-caption {
  border-radius: 8px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, .95);
  color: #1f2933;
  font-size: 13px;
}

.post-media-lightbox-close {
  position: absolute;
  top: -16px;
  right: -16px;
  z-index: 2;
  appearance: none;
  min-height: 38px;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  color: #111827;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

@media (min-width: 700px) {
  .post-editable {
    padding-right: 18px;
  }
}

@media (max-width: 720px) {
  .post-editor-backdrop {
    padding: 14px;
  }

  .post-editor-header,
  .post-editor-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .post-editor-media-card,
  .post-editor-row {
    grid-template-columns: 1fr;
  }

  .post-editor-preview {
    max-width: 220px;
  }

  .post-editor-action,
  .post-editor-file-label {
    width: 100%;
  }

  .post-media-lightbox {
    padding: 12px;
  }

  .post-media-lightbox-close {
    top: 8px;
    right: 8px;
  }
}
