#blog-controls { min-width: 0; max-width: 100%; }
.blog-actions, .blog-form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}
.blog-actions { justify-content: flex-end; }
.blog-button, .blog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .5rem 1rem;
  border: 1px solid #c9d7df;
  border-radius: 999px;
  background: var(--paper, #fff);
  color: #244c69;
  font: 550 .9rem/1.4 var(--sans, sans-serif);
  white-space: nowrap;
  cursor: pointer;
}
.blog-button:hover, .blog-close:hover { background: #f0f5f8; border-color: #9cb3c2; }
.blog-primary { color: white; background: #163950; border-color: #163950; }
.blog-primary:hover { background: #234c65; border-color: #234c65; }
.blog-quiet { color: #536571; border-color: transparent; background: transparent; }
.blog-danger-text { color: #8c3e40; }
.blog-danger-solid { color: white; background: #953f42; border-color: #953f42; }
.blog-danger-solid:hover { background: #7f3034; border-color: #7f3034; }
.blog-button:disabled, .blog-close:disabled { cursor: wait; opacity: .65; }
.blog-controls-status, .blog-form-feedback {
  color: #3c586b;
  font: 400 .9rem/1.65 var(--sans, sans-serif);
  overflow-wrap: anywhere;
}
.blog-controls-status { max-width: 32rem; margin: .45rem 0 0 auto; text-align: end; }
.blog-controls-status:empty, .blog-form-feedback:empty { display: none; }
.blog-form-feedback a { color: #135a90; text-decoration: underline; text-underline-offset: .21em; }

.blog-dialog {
  width: min(27rem, calc(100% - 2rem));
  max-width: none;
  max-height: min(52rem, calc(100dvh - 2rem));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #c8d6df;
  border-radius: 18px;
  background: white;
  color: var(--ink, #102534);
  box-shadow: 0 22px 90px rgb(18 44 66 / 16%);
}
.blog-dialog-wide { width: min(54rem, calc(100% - 2rem)); }
.blog-dialog::backdrop { background: rgb(19 35 50 / 42%); }
html:has(.blog-dialog[open]) { overflow: hidden; }
.blog-dialog form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 2.25rem);
  max-height: min(51.8rem, calc(100dvh - 2.25rem));
  margin: 0;
}
.blog-dialog-header, .blog-dialog-footer { flex-shrink: 0; padding-inline: clamp(1rem, 3vw, 2rem); }
.blog-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding-block: .9rem;
  border-bottom: 1px solid var(--line, #dce4ec);
}
.blog-dialog-header h2 {
  margin: 0;
  font: 630 clamp(1.22rem, 2vw, 1.55rem)/1.4 var(--sans, sans-serif);
  letter-spacing: -.035em;
}
.blog-close { width: 44px; padding: 0; font-size: 1.55rem; font-weight: 400; border-color: transparent; }
.blog-fields {
  display: grid;
  align-content: start;
  gap: 1.1rem;
  min-height: 0;
  padding: clamp(1rem, 3vw, 2rem);
  overflow: auto;
  overscroll-behavior: contain;
}
.blog-field { display: grid; min-width: 0; gap: .4rem; color: #294657; font: 580 .91rem/1.5 var(--sans, sans-serif); }
.blog-field small { margin-inline-start: .4rem; color: #586b77; font-size: .82rem; font-weight: 400; }
.blog-field :is(input,textarea,select) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #b7c9d4;
  border-radius: 8px;
  padding: .65rem .8rem;
  background: #fff;
  color: #162d3c;
  font: 400 1rem/1.55 var(--sans, sans-serif);
}
.blog-field textarea { resize: vertical; }
.blog-field :is(input,textarea)::placeholder { color: #617685; }
.blog-field :is(input,textarea,select):focus-visible, .blog-button:focus-visible, .blog-close:focus-visible {
  outline: 3px solid #397bae;
  outline-offset: 2px;
}
.blog-field .blog-title-input { font-size: 1.13rem; font-weight: 560; }
.blog-field .blog-body-input { min-height: 13rem; line-height: 1.8; }
.blog-meta-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.blog-field select {
  appearance: none;
  padding-inline-end: 2.1rem;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23496678' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right .75rem center;
}
.blog-delete-description { margin: 0; color: #3d5361; font-size: 1rem; line-height: 1.8; overflow-wrap: anywhere; }
.blog-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem 1rem;
  padding-block: .85rem;
  border-top: 1px solid var(--line, #dce4ec);
}
.blog-form-actions { margin-inline-start: auto; flex-wrap: nowrap; }
@media (max-width: 42rem) {
  .blog-actions { justify-content: flex-start; }
  .blog-controls-status { margin-inline: 0; text-align: start; }
  .blog-dialog-footer { flex-wrap: wrap; }
  .blog-dialog-footer .blog-form-feedback { flex-basis: 100%; }
}
@media (max-width: 30rem) {
  .blog-meta-fields { grid-template-columns: minmax(0, 1fr); }
  .blog-dialog-wide { width: calc(100% - 1rem); }
  .blog-dialog-header { padding-block: .55rem; }
  .blog-field .blog-body-input { min-height: 10rem; }
}
