/* Nobis · editor dei minisiti (caricato solo con ?edit) */

body.editing{--edit-top:56px;padding-top:56px}
.ed-ui{font-family:var(--font);color:var(--ink);-webkit-font-smoothing:antialiased}
.ed-ui *{box-sizing:border-box}

/* barra in alto */
.ed-bar{position:fixed;top:0;left:0;right:0;height:56px;z-index:1000;background:#141312;color:#fff;display:flex;align-items:center;gap:12px;padding:0 14px;box-shadow:0 1px 0 #ffffff14}
.ed-bar a,.ed-bar button{font:600 14px/1 var(--font);color:#fff;border-radius:999px;height:36px;padding:0 14px;display:inline-flex;align-items:center;gap:8px;white-space:nowrap}
.ed-back{background:#ffffff14}
.ed-back:hover{background:#ffffff26}
.ed-title{font-size:15px;font-weight:600;letter-spacing:-.01em;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ed-title small{display:block;font-size:11.5px;font-weight:500;color:#a19c93;margin-top:2px}
.ed-status{margin-left:auto;font-size:12.5px;color:#a19c93;white-space:nowrap}
.ed-status.dirty{color:#ffb27f}
.ed-btn{background:#ffffff14}
.ed-btn:hover{background:#ffffff26}
.ed-pub{background:var(--orange)}
.ed-pub:hover{background:var(--orange-deep)}
.ed-pub[disabled]{opacity:.45;cursor:default}

/* testi modificabili */
body.editing [data-k][contenteditable]{outline:1px dashed transparent;outline-offset:3px;border-radius:4px;transition:outline-color .15s,background .15s;cursor:text;min-width:1ch}
body.editing [data-k][contenteditable]:hover{outline-color:#f26b2199}
body.editing [data-k][contenteditable]:focus{outline:2px solid var(--orange);background:#f26b210d}
body.editing [data-k].is-empty{display:revert}
body.editing [data-k].is-empty::before{content:"(vuoto: scrivi qui o lascia vuoto per nascondere)";color:#a19c93;font-weight:400;font-size:13px;font-style:normal}
body.editing .hero::after,body.editing .emotion::after{pointer-events:none}

/* immagini modificabili */
.ed-chip{position:absolute;right:12px;top:12px;z-index:20;display:inline-flex;align-items:center;gap:7px;height:34px;padding:0 14px;border-radius:999px;background:#141312e6;color:#fff;font:600 13px/1 var(--font);box-shadow:0 6px 20px #0004;cursor:pointer;opacity:.0;transition:opacity .2s;backdrop-filter:blur(8px)}
.ed-chip::before{content:"";width:14px;height:14px;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='9' cy='10' r='2'/%3E%3Cpath d='m21 16-5-5-8 8'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='9' cy='10' r='2'/%3E%3Cpath d='m21 16-5-5-8 8'/%3E%3C/svg%3E") center/contain no-repeat}
.slot:hover>.ed-chip,.ed-chip:focus-visible,.slot:not(.filled)>.ed-chip{opacity:1}
.hero .ed-chip,.emotion>.slot>.ed-chip{top:calc(var(--header) + 16px);opacity:1}
.presenter .ed-chip,.my-config .ed-chip{display:none}
body.editing .slot[data-m]{cursor:pointer}
body.editing .slot[data-m]:hover{box-shadow:inset 0 0 0 2px #f26b21aa}
body.editing .hotspot{cursor:grab;outline:2px dashed #f26b21aa;outline-offset:4px}
body.editing .hotspot:active{cursor:grabbing}

/* pannello laterale */
.ed-panel{position:fixed;top:56px;right:0;bottom:0;width:min(420px,100%);z-index:999;background:#fff;box-shadow:-30px 0 80px #0003;transform:translateX(105%);transition:transform .35s var(--ease);display:flex;flex-direction:column}
.ed-panel.open{transform:none}
.ed-panel header{display:flex;align-items:flex-start;gap:12px;padding:22px 22px 14px;border-bottom:1px solid var(--line)}
.ed-panel header h3{font-size:19px;font-weight:700;letter-spacing:-.02em;flex:1}
.ed-panel header p{font-size:13px;color:var(--muted);margin-top:4px;font-weight:500}
.ed-x{width:34px;height:34px;border-radius:50%;background:var(--paper);font-size:18px;flex:none}
.ed-body{padding:20px 22px 28px;overflow:auto;flex:1}
.ed-preview{aspect-ratio:16/10;border-radius:14px;background:var(--paper) center/contain no-repeat;display:grid;place-items:center;overflow:hidden;color:var(--muted);font-size:13px}
.ed-preview img,.ed-preview video{width:100%;height:100%;object-fit:contain}
.ed-spec{margin:16px 0 4px;padding:14px 16px;border-radius:12px;background:#f26b210f;font-size:14px;line-height:1.45}
.ed-spec b{display:block;font-size:12px;color:var(--orange);font-weight:700;margin-bottom:4px}
.ed-drop{margin-top:16px;border:2px dashed var(--line);border-radius:14px;padding:22px;text-align:center;font-size:14px;color:var(--muted);transition:border-color .2s,background .2s}
.ed-drop.over{border-color:var(--orange);background:#f26b210a}
.ed-drop .btn{margin-bottom:10px}
.ed-actions{display:flex;gap:8px;margin-top:14px;flex-wrap:wrap}
.ed-actions button{height:38px;padding:0 16px;border-radius:999px;background:var(--paper);font-size:14px;font-weight:600}
.ed-actions button:hover{background:var(--paper-2)}
.ed-msg{margin-top:14px;font-size:13.5px;color:var(--muted);min-height:20px}
.ed-msg.err{color:#c0392b}
.ed-bar-prog{height:4px;border-radius:4px;background:var(--paper-2);overflow:hidden;margin-top:12px}
.ed-bar-prog i{display:block;height:100%;width:0;background:var(--orange);transition:width .2s}
.ed-field{display:flex;flex-direction:column;gap:6px;margin-bottom:16px}
.ed-field label{font-size:12.5px;font-weight:600;color:var(--muted)}
.ed-field input{font:inherit;font-size:15px;padding:11px 13px;border-radius:10px;border:1px solid var(--line);background:#fff;color:var(--ink);outline:0}
.ed-field input:focus{border-color:var(--orange)}
.ed-sec{font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--orange);margin:22px 0 12px}
.ed-sec:first-child{margin-top:0}

/* accesso */
.ed-login{position:fixed;inset:0;z-index:2000;background:#141312f2;display:grid;place-items:center;padding:20px}
.ed-login form{background:#fff;border-radius:24px;padding:34px 30px 28px;width:min(380px,100%);text-align:center}
.ed-login .logo{color:var(--ink);display:inline-block;margin-bottom:18px}
.ed-login .logo svg{height:24px}
.ed-login h2{font-size:22px;font-weight:700;letter-spacing:-.02em}
.ed-login p{color:var(--muted);font-size:14px;margin:6px 0 20px}
.ed-pass{position:relative}
.ed-pass input{width:100%;font:inherit;font-size:16px;padding:13px 48px 13px 15px;border-radius:12px;border:1px solid var(--line);outline:0}
.ed-pass input:focus{border-color:var(--orange)}
.ed-eye{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:38px;height:38px;border-radius:10px;font-size:17px;color:var(--muted)}
.ed-login .btn{width:100%;margin-top:14px}
.ed-login .ed-msg{text-align:center}

.ed-toast{position:fixed;left:50%;bottom:24px;transform:translate(-50%,20px);opacity:0;z-index:2100;background:#141312;color:#fff;padding:12px 18px;border-radius:999px;font:600 14px/1.2 var(--font);transition:opacity .25s,transform .25s;box-shadow:0 10px 30px #0004;pointer-events:none}
.ed-toast.on{opacity:1;transform:translate(-50%,0)}

@media (max-width:700px){
  .ed-status,.ed-title small{display:none}
  .ed-bar{gap:6px;padding:0 8px}
  .ed-bar a,.ed-bar button{padding:0 11px;font-size:13px}
  .ed-hide-m{display:none}
}
