/* Redigerings-tilstand (demo) */

.ed-link { border-bottom: 1px solid var(--line-strong); }
.ed-link:hover { color: var(--ink); border-color: var(--ink); }

/* Bar i toppen */
.ed-bar { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 300; width: min(980px, calc(100% - 24px)); display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 18px; border-radius: 18px; background: var(--ink); color: var(--on-ink); box-shadow: var(--sh-lg); font-size: 14px; animation: edin .5s var(--ease); }
@keyframes edin { from { opacity: 0; transform: translate(-50%, -12px); } }
.ed-dot { width: 9px; height: 9px; border-radius: 50%; background: #e0a066; flex: none; box-shadow: 0 0 0 4px rgba(224, 160, 102, .25); }
.ed-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.ed-txt b { font-weight: 600; }
.ed-txt span { opacity: .75; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-btn { height: 40px; padding: 0 16px; border-radius: 999px; background: var(--clay); color: #fff; font-weight: 600; font-size: 14px; white-space: nowrap; transition: opacity .2s, background-color .2s; }
.ed-btn:disabled { opacity: .4; cursor: default; }
.ed-btn.ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 30%, transparent); }
.ed-btn.ghost:hover { box-shadow: inset 0 0 0 1px currentColor; }

/* Plads til baren, og menuen skubbes ned under den */
body.editing { padding-top: 76px; }
body.editing .nav { top: 76px; }

/* Redigerbare tekster */
body.editing [contenteditable="true"] { outline: 1px dashed transparent; outline-offset: 4px; border-radius: 4px; cursor: text; transition: outline-color .2s, background-color .2s; }
body.editing [contenteditable="true"]:hover { outline-color: color-mix(in srgb, var(--clay) 70%, transparent); }
body.editing [contenteditable="true"]:focus { outline: 2px solid var(--clay); background: color-mix(in srgb, var(--clay) 6%, transparent); }

/* Fotos: "Skift foto"-knap */
.ed-imghost:not(.hs) { position: relative; }
/* Slideshowet står stille under redigering; vælg foto med stregerne */
body.editing .hs-dots button.on::after { animation: none; width: 100%; }
.ed-img-btn { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; height: 42px; padding: 0 18px; border-radius: 999px; background: rgba(20, 18, 16, .78); color: #fff; font-weight: 600; font-size: 14px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 8px 24px rgba(0, 0, 0, .3); opacity: .9; transition: opacity .2s, transform .2s; }
.ed-img-btn:hover { opacity: 1; transform: translate(-50%, -50%) scale(1.04); }
body.editing .hero-photo .ed-img-btn { left: 62%; }

/* Introduktion */
.ed-modal { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 16px; background: rgba(20, 18, 16, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity .3s; }
.ed-modal.on { opacity: 1; }
.ed-card { width: min(460px, 100%); padding: 32px; border-radius: 22px; background: var(--paper); color: var(--ink); box-shadow: var(--sh-lg); transform: translateY(10px); transition: transform .4s var(--ease); }
.ed-modal.on .ed-card { transform: none; }
.ed-card .lotus { width: 44px; color: var(--clay); }
.ed-card h3 { margin: 14px 0 10px; font: 400 32px/1.1 var(--serif); }
.ed-card p { margin: 0 0 12px; color: var(--ink-2); font-size: 15px; }
.ed-card .ed-note { font-size: 13px; color: var(--muted); }
.ed-card .ed-row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.ed-card .ed-btn.ghost { color: var(--ink); }

@media (max-width: 860px) {
  .ed-bar { flex-wrap: wrap; top: auto; bottom: calc(12px + env(safe-area-inset-bottom)); border-radius: 22px; }
  .ed-txt { flex-basis: 100%; }
  .ed-dot { display: none; }
  .ed-btn { flex: 1; padding: 0 10px; font-size: 13px; }
  body.editing { padding-top: 0; padding-bottom: 170px; }
  body.editing .nav { top: 0; }
  body.editing .mbar { display: none; }
  body.editing .hero-photo .ed-img-btn { left: 50%; }
}
