.admin-section {
  background: #fff;
  outline: 1px solid #000;
  outline-offset: -2px;
  padding: 20px;
  margin-top: var(--gap);
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.admin-section-title {
  font-weight: 700;
  font-size: 1.1rem;
}

.new-post-btn {
  font-size: 0.85rem;
  padding: 6px 12px;
  outline: 1px solid #000;
  border: none;
  background: var(--tea-green);
  cursor: pointer;
  transition: filter 1.8s ease;
}
.new-post-btn:hover { filter: brightness(0.92); }

.admin-post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-post-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  outline: 1px solid #000;
  outline-offset: -2px;
  background: var(--almond-silk);
  cursor: pointer;
  flex-wrap: wrap;
}

.admin-post-row-title {
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-post-row-status {
  font-size: 0.75rem;
  padding: 2px 8px;
  outline: 1px solid #000;
  background: #fff;
  flex-shrink: 0;
}
.admin-post-row-status.published { background: var(--tea-green); }

/* ---------------------------------------------------------
   diet admin
   --------------------------------------------------------- */
.diet-admin-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.diet-admin-card {
  outline: 1px solid #000;
  outline-offset: -2px;
  background: var(--eggshell);
  padding: 12px;
}

.diet-admin-label {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.diet-admin-current {
  font-size: 0.85rem;
  color: var(--cool-steel);
  margin-bottom: 8px;
}

.diet-admin-form {
  display: flex;
  gap: 6px;
}

.diet-admin-form input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 8px;
  outline: 1px solid #000;
  border: none;
  background: #fff;
  font-size: 16px;
}

.diet-admin-form button {
  flex-shrink: 0;
  font-size: 0.8rem;
  padding: 6px 10px;
  outline: 1px solid #000;
  border: none;
  background: var(--soft-blossom);
  cursor: pointer;
}
.diet-admin-form button:hover { filter: brightness(0.92); }

.diet-admin-history {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dotted #000;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.diet-admin-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
}

.diet-admin-history-item button {
  flex-shrink: 0;
  font-size: 0.7rem;
  padding: 2px 6px;
  outline: 1px solid #000;
  border: none;
  background: var(--pink-carn);
  cursor: pointer;
}

/* ---------------------------------------------------------
   post editor overlay
   --------------------------------------------------------- */
.editor-overlay {
  position: fixed;
  inset: 0;
  background: rgba(154, 160, 166, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  /* above the persistent footer player bar (site-player.css uses up to
     z-index: 600), otherwise its screen-time widget intercepts clicks on
     anything the modal renders near the bottom of the viewport */
  z-index: 700;
  padding: 20px;
}

.editor-box {
  background: #fff;
  outline: 1px solid #000;
  outline-offset: -2px;
  width: min(760px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid #000;
  flex-shrink: 0;
}

.editor-title {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
  outline: 1px solid #000;
  border: none;
  background: #fff;
  font-size: 1.1rem;
  font-weight: 700;
}

.close-editor-btn {
  flex-shrink: 0;
  font-size: 0.8rem;
  padding: 8px 12px;
  outline: 1px solid #000;
  border: none;
  background: var(--soft-blossom);
  cursor: pointer;
}

.editor-header-image {
  flex-shrink: 0;
  height: 120px;
  background-size: cover;
  background-position: center;
  filter: sepia(50%);
  image-rendering: pixelated;
  border-bottom: 1px dotted #000;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--almond-silk);
}

.editor-header-image-label {
  font-size: 0.85rem;
  background: #fff;
  padding: 4px 10px;
  outline: 1px solid #000;
}

.blog-toolbar {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid #000;
  background: var(--eggshell);
}

.blog-toolbar button {
  font-size: 0.8rem;
  padding: 5px 9px;
  outline: 1px solid #000;
  border: none;
  background: #fff;
  cursor: pointer;
}
.blog-toolbar button:hover { filter: brightness(0.92); }

.toolbar-sep {
  width: 1px;
  background: #000;
  margin: 0 4px;
}

.editor-body {
  flex: 1 1 auto;
  min-height: 260px;
  overflow-y: auto;
  padding: 16px;
}
.editor-body:focus { outline: none; }

.editor-body img { cursor: pointer; }

.editor-footer {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #000;
}

.editor-footer button {
  font-size: 0.85rem;
  padding: 8px 14px;
  outline: 1px solid #000;
  border: none;
  cursor: pointer;
  transition: filter 1.8s ease;
}
.editor-footer button:hover { filter: brightness(0.92); }

.publish-btn { background: #fff; }
.publish-btn.on { background: var(--tea-green); }
.delete-btn { background: var(--pink-carn); }
.save-btn { background: var(--soft-blossom); margin-left: auto; }

/* ---------------------------------------------------------
   editor content preview -- the toolbar-produced classes
   (.blog-banner, .potato, img sizes, etc.) rendered live as you type.
   This keeps the site's normal pastel/Inter look in the admin tool;
   the public site (assets/blog.css) renders the same classes in its
   own, unrelated visual language -- same HTML, two skins.
   --------------------------------------------------------- */
.editor-body p, .editor-body div { margin: 0 0 1em; }
.editor-body a { color: var(--pink-carn); text-decoration: underline; }

.editor-body blockquote {
  margin: 1em 0;
  padding: 4px 16px;
  border-left: 3px solid #000;
  font-style: italic;
}

.editor-body code {
  background: var(--tea-green);
  padding: 1px 5px;
  font-family: "VT323", monospace;
  font-size: 1.05em;
}

.editor-body mark {
  background: var(--soft-blossom);
  padding: 0 2px;
}

.editor-body .potato {
  font-style: italic;
  text-decoration: underline wavy #000;
}

.editor-body .blog-banner {
  background: #7d9267;
  color: #fcfae2;
  font-weight: 700;
  font-style: italic;
  font-size: 1.25rem;
  padding: 14px 20px;
  margin: 24px 0;
}

.editor-body img { display: block; outline: 1px solid #000; }
.editor-body .img-sm { max-width: 40%; margin: 1em auto; }
.editor-body .img-md { max-width: 65%; margin: 1em auto; }
.editor-body .img-lg { max-width: 90%; margin: 1em auto; }
.editor-body .img-full { width: 100%; margin: 1em 0; }

.editor-body .yt-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  outline: 1px solid #000;
  margin: 1em 0;
}

.editor-body .yt-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.editor-body .yt-embed .yt-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 40px;
  background: #ff0000;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.editor-body .yt-embed .yt-play::after {
  content: '';
  border-style: solid;
  border-width: 9px 0 9px 16px;
  border-color: transparent transparent transparent #fff;
  margin-left: 3px;
}
