/* My stories dialog contents. The dialog shell is the shared .mm-dialog. */

.mc-dialog[open] {
  display: flex;
  flex-direction: column;
}

.mc-body { min-height: 0; }

/* minmax(0, 1fr): grid items won't shrink below their content by default,
   so a long one-line excerpt would widen the list instead of truncating */
.mc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

/* The bordered row holds two buttons: the story (opens it) and a small
   Delete icon at the trailing edge */
.mc-item {
  display: flex;
  align-items: stretch;
  min-width: 0;
  border: 1px solid var(--rule-soft);
  background: var(--paper);
}

.mc-row {
  appearance: none;
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 10px 4px 10px 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--text);
  text-align: left;
  cursor: pointer;
}

.mc-row:focus-visible,
.mc-row-delete:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

.mc-row-delete {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
}

.mc-row-delete svg { width: 16px; height: 16px; }

.mc-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.mc-row-title {
  min-width: 0;
  /* Stacked on phones, the title isn't stretched, so cap it to truncate */
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--display);
  font-size: 1.05rem;
}

.mc-row-date {
  flex-shrink: 0;
  color: var(--ink-muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mc-row-excerpt {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.mc-footnote {
  margin: 16px 0 0;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.mc-btn {
  appearance: none;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  font-family: var(--text);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.mc-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Same as the library's Delete: quiet until hovered, since both can be undone */
.mc-btn-danger { border-color: var(--rule-soft); color: var(--ink-soft); }

.mc-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 0;
  padding-right: 10px;
  border-color: transparent;
}

.mc-back svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.mc-story-head { margin: 4px 0 18px; }

.mc-story-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.mc-story-subtitle { margin: 4px 0 0; color: var(--ink-soft); }

.mc-story-date {
  margin: 8px 0 0;
  color: var(--ink-muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mc-story-text {
  font-size: 1.15rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.mc-story-text p { margin: 0 0 1em; }

.mc-word {
  display: inline-block;
  padding: 0 5px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 500;
  line-height: 1.35;
}

.mc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--rule-soft);
}

@media (hover: hover) and (pointer: fine) {
  .mc-item:has(.mc-row:hover) { border-color: var(--ink); }
  .mc-row-delete:hover { color: var(--err); }
  .mc-btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
  .mc-btn-danger:hover { background: var(--err-soft); color: var(--err); border-color: var(--err); }
  .mc-back:hover { background: transparent; color: var(--ink-soft); border-color: transparent; }
}

@media (max-width: 560px) {
  .mc-row-top { flex-direction: column; gap: 2px; }
}
