/* ===== Inline "edit the live page" mode (admins only) ===== */

.edit-toggle.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- generic hover affordance for anything clickable in edit mode ---------- */
/* links keep their normal click-through behaviour — their label text is edited from /admin → Texts */
html.edit-on [data-i18n]:not(a):not(button),
html.edit-on .feature[data-fid] h3,
html.edit-on .feature[data-fid] p,
html.edit-on .hero-art,
html.edit-on .page-hero,
html.edit-on .shot[data-gid],
html.edit-on figure[data-gid],
html.edit-on li.rule[data-id],
html.edit-on .card.post[data-id],
html.edit-on .card.event[data-id] {
  cursor: pointer;
}
html.edit-on [data-i18n]:not(a):not(button),
html.edit-on .feature[data-fid] h3,
html.edit-on .feature[data-fid] p {
  outline: 1px dashed var(--line);
  outline-offset: 3px;
  border-radius: 4px;
}
@media (hover: hover) {
  html.edit-on [data-i18n]:not(a):not(button):hover,
  html.edit-on .feature[data-fid] h3:hover,
  html.edit-on .feature[data-fid] p:hover,
  html.edit-on li.rule[data-id]:hover,
  html.edit-on .card.post[data-id]:hover,
  html.edit-on .card.event[data-id]:hover {
    outline: 2px dashed var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
  }
  html.edit-on .hero-art:hover,
  html.edit-on .page-hero:hover,
  html.edit-on .shot[data-gid]:hover,
  html.edit-on figure[data-gid]:hover {
    outline: 2px dashed var(--accent);
    outline-offset: -2px;
  }
}
html.edit-on li.rule[data-id],
html.edit-on .card.post[data-id],
html.edit-on .card.event[data-id],
html.edit-on figure[data-gid] {
  position: relative;
}

/* small "picture" hint chip on editable images (always visible, touch-friendly) */
html.edit-on .hero-art::before,
html.edit-on .page-hero::before,
html.edit-on .shot[data-gid]::after,
html.edit-on figure[data-gid]::before {
  content: "✎";
  position: absolute;
  z-index: 3;
  width: 30px; height: 30px;
  line-height: 30px;
  text-align: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
  pointer-events: none;
}
html.edit-on .hero-art::before,
html.edit-on .page-hero::before { right: 16px; bottom: 16px; }
html.edit-on .shot[data-gid]::after { right: 8px; top: 8px; }
html.edit-on figure[data-gid]::before { left: 8px; top: 8px; }
html.edit-on figure[data-gid] img { border-radius: 10px; }

/* ---------- delete buttons injected on list items ---------- */
.edit-del { display: none; }
html.edit-on .edit-del {
  display: inline-grid;
  place-items: center;
  position: absolute;
  top: 8px; right: 8px;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--bad);
  cursor: pointer;
  z-index: 3;
}
.edit-del .ico { width: 16px; height: 16px; }
html.edit-on .edit-del:hover { border-color: var(--bad); }

/* ---------- "add" tile appended to editable lists ---------- */
.edit-add-tile { display: none; }
html.edit-on .edit-add-tile {
  display: block;
  width: 100%;
  padding: 14px 18px;
  margin-top: 4px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}
html.edit-on .edit-add-tile:hover { border-color: var(--accent); color: var(--text); }

/* ---------- drawer / backdrop ---------- */
.edit-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .55);
  z-index: 200;
}
.edit-drawer {
  position: fixed;
  z-index: 201;
  left: 0; right: 0; bottom: 0;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .5);
  padding: 18px 18px 26px;
}
.edit-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.edit-drawer-title { margin: 0; font-size: 1.1rem; }
.edit-drawer-close {
  width: 36px; height: 36px; flex: none;
  display: inline-grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer;
}
.edit-drawer .thumb-preview { margin-bottom: 10px; }
@media (min-width: 860px) {
  .edit-drawer {
    left: auto;
    top: var(--header-h);
    width: min(420px, 92vw);
    max-height: calc(100vh - var(--header-h));
    border-radius: 0;
    border-left: 1px solid var(--line);
  }
}
