/* ============================================================
   KANPEKI · MURAL INSTANTÁNEO — estilos del widget
   (el reset + centrado global vive en shared/css/base.css)
   ============================================================ */
body {
  padding: 14px;
  font-family: 'Space Grotesk', sans-serif;
}

/* ============================================================
   TOKENS — paleta NEUTRA para el menú desplegable
   (blanco / negro / gris; sin temas de color)
   ============================================================ */
:root {
  --bg-card: #ffffff;
  --bg-track: #f2f2f2;
  --bg-track-active: #e9e9e9;
  --accent: #2b2b2b;
  --accent2: #8a8a8a;
  --text: #2b2b2b;
  --text-muted: #8a8a8a;
  --border: #e2e2e2;
  --btn-icon-b: #555555;
  --modal-overlay: rgba(0,0,0,0.8);

  /* Tokens propios del mural (nada hardcodeado en línea) */
  --wood-dark:  linear-gradient(180deg,#6a4426,#40291653), repeating-linear-gradient(88deg, rgba(0,0,0,.18) 0 2px, transparent 2px 9px), linear-gradient(180deg,#5c3a20,#3a2413);
  --wood-light: repeating-linear-gradient(88deg, rgba(120,80,40,.14) 0 2px, transparent 2px 10px), linear-gradient(180deg,#e4c391,#c69c68);
  --wood-black: repeating-linear-gradient(88deg, rgba(255,255,255,.05) 0 2px, transparent 2px 9px), linear-gradient(180deg,#2c2c2c,#111111 60%,#050505);
  --frame-plain: linear-gradient(180deg,#efe8dd,#ddd2c2);
  --photo-bg: #ffffff;
  --string: #c9a06a;
  --clip: linear-gradient(90deg,#c1904f,#e6bd82,#c1904f);
}

/* ============================================================
   WRAPPER
   ============================================================ */
.mural-wrapper {
  position: relative;
  width: 100%;
  max-width: 560px;
}

/* ---- Marco ---- */
.mural-frame {
  border-radius: 8px;
  transition: padding .2s ease, background .2s ease, box-shadow .2s ease;
}
.mural-frame.mat-dark  { padding: 20px; background: var(--wood-dark);  box-shadow: 0 14px 34px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.06); }
.mural-frame.mat-light { padding: 20px; background: var(--wood-light); box-shadow: 0 14px 34px rgba(0,0,0,.3), inset 0 0 0 1px rgba(255,255,255,.14); }
.mural-frame.mat-plain { padding: 20px; background: var(--frame-plain); box-shadow: 0 12px 28px rgba(0,0,0,.28), inset 0 0 0 1px rgba(0,0,0,.05); }
.mural-frame.mat-black { padding: 20px; background: var(--wood-black); box-shadow: 0 16px 36px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.06); }
.mural-frame.mat-none  { padding: 0;   background: transparent; box-shadow: none; }

.mural-frame.th-thin.mat-dark,  .mural-frame.th-thin.mat-light,  .mural-frame.th-thin.mat-plain,  .mural-frame.th-thin.mat-black  { padding: 11px; }
.mural-frame.th-thick.mat-dark, .mural-frame.th-thick.mat-light, .mural-frame.th-thick.mat-plain, .mural-frame.th-thick.mat-black { padding: 34px; }

/* ---- Relleno (mat interior) ---- */
.mural-mat {
  border-radius: 4px;
  padding: 20px 16px 22px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,.18);
  transition: background .2s ease;
}
.mat-none .mural-mat { box-shadow: none; }

/* ---- Título ---- */
.mural-title {
  text-align: center;
  margin-bottom: 16px;
  line-height: 1.15;
  word-break: break-word;
  color: #33231b;
}
.mural-title:empty { display: none; }
.mural-title.f-clean { font-family:'Space Grotesk',sans-serif; font-weight:600; letter-spacing:.5px; font-size:20px; }
.mural-title.f-fun   { font-family:'Fredoka',sans-serif; font-weight:600; font-size:26px; }
.mural-title.f-sweet { font-family:'Pacifico',cursive; font-size:28px; }
.mural-title.f-bujo  { font-family:'Caveat',cursive; font-weight:700; font-size:30px; }

/* ============================================================
   POLAROID
   ============================================================ */
.polaroid {
  position: relative;
  background: var(--photo-bg);
  padding: 7px 7px 8px;
  border-radius: 2px;
  box-shadow: 0 4px 10px rgba(0,0,0,.22);
}
.polaroid .ph {
  display: block; width: 100%; aspect-ratio: 1/1;
  object-fit: cover; object-position: 50% 50%;
  background: #ece7df; border-radius: 1px;
  cursor: grab; touch-action: none; user-select: none;
  -webkit-user-drag: none;
}
.polaroid .ph.dragging { cursor: grabbing; }
.polaroid .rm {
  position: absolute; top: -8px; right: -8px;
  width: 22px; height: 22px; border-radius: 50%;
  border: none; background: #33231b; color: #fff;
  font-size: 13px; line-height: 1; cursor: pointer;
  display: none; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.35); z-index: 4;
}
.polaroid:hover .rm { display: flex; }

/* ---- Texto/fecha bajo la foto (zona blanca) ---- */
.polaroid .caption {
  display: block; width: 100%; margin-top: 6px;
  border: none; background: transparent; outline: none;
  text-align: center; color: #55463b;
  font-family: 'Caveat', cursive; font-weight: 600; font-size: 17px;
  line-height: 1.1; padding: 1px 2px;
}
.polaroid .caption::placeholder { color: #c3b6a6; font-style: normal; }

/* Placeholder "Añadir foto" */
.polaroid.add { background: rgba(255,255,255,.55); cursor: pointer; padding: 7px; }
.polaroid.add .drop {
  width: 100%; aspect-ratio: 1/1; border: 2px dashed #b7a894;
  border-radius: 3px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; color: #7a6c5b;
}
.polaroid.add .drop .plus { font-size: 26px; font-weight: 300; line-height: 1; }
.polaroid.add .drop small { font-size: 10px; font-weight: 500; letter-spacing:.3px; }
.polaroid.add:hover .drop { border-color: #33231b; color: #33231b; }

/* ============================================================
   DISEÑO 1 · CUADRÍCULA
   ============================================================ */
.grid { display: grid; gap: 14px; }

/* ============================================================
   DISEÑO 2 · COLGADO (hilo + ganchos siempre visibles)
   ============================================================ */
.clothesline { display: flex; flex-direction: column; gap: 26px; padding-top: 4px; }
.cl-line { position: relative; padding-top: 16px; }
/* Cuerda con leve pandeo (forma de U): sólo se pinta el borde inferior y el
   border-radius elíptico de las esquinas inferiores hace que el centro baje y
   los extremos suban hacia los ganchos. */
.cl-string {
  position: absolute; top: 10px; left: -6px; right: -6px; height: 10px;
  background: transparent;
  border-bottom: 2px solid var(--string);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.22));
}
.cl-pegs { position: relative; display: flex; justify-content: space-around; align-items: flex-start; gap: 8px; }
/* flex:1 1 0 → todos los ganchos (fotos y slots vacíos) reparten el ancho por
   igual, así todas las polaroid quedan del mismo tamaño sin importar la imagen.
   La rotación va como transform inline en .cl-hang y no se toca aquí. */
.cl-hang { display: flex; flex-direction: column; align-items: center; flex: 1 1 0; min-width: 0; max-width: 170px; }
.cl-clip {
  width: 12px; height: 24px; border-radius: 3px; margin-bottom: -7px;
  background: var(--clip); box-shadow: inset 0 0 0 1px rgba(0,0,0,.18);
  position: relative; z-index: 3;
}
.cl-clip::after {
  content: ''; position: absolute; left: 50%; top: 6px;
  width: 1.5px; height: 12px; background: rgba(0,0,0,.25); transform: translateX(-50%);
}
.cl-hang .polaroid { z-index: 2; width: 100%; }
/* gancho decorativo (slot vacío) para que el hilo nunca se vea pelón */
.cl-bareclip { width: 12px; height: 24px; }
/* Gancho-imagen (heart, sakura, snowflake, pumpkin, bat, maple_leafe):
   sustituye a la pinza CSS y cuelga desde el hilo sobre la polaroid. */
.cl-hook {
  width: 30px; height: 30px; object-fit: contain;
  margin-bottom: -10px; position: relative; z-index: 3;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.28));
  pointer-events: none;
}

/* ============================================================
   BOTÓN + PANEL DE AJUSTES
   ============================================================ */
.btn-settings {
  /* A la izquierda: a la derecha choca con el menú de Notion sobre embebidos. */
  position: absolute; top: -6px; left: -6px;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--btn-icon-b); background: var(--bg-card);
  color: var(--btn-icon-b); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .18s; z-index: 60;
  box-shadow: 0 3px 10px rgba(0,0,0,.3);
}
.btn-settings:hover { background: var(--bg-track); }
.btn-settings svg { transition: transform .4s; }
.btn-settings.open svg { transform: rotate(60deg); }

.settings-panel {
  /* Superpuesto sobre el widget, abarcando todo su ancho. La altura nunca
     supera la del widget (max-height:100% del wrapper) y el contenido hace
     scroll para aprovechar el espacio. */
  position: absolute; top: 0; left: 0; right: 0;
  max-height: 100%; overflow-y: auto;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 14px 16px;
  display: none; flex-direction: column; gap: 10px;
  z-index: 50; box-shadow: 0 12px 40px rgba(0,0,0,.28);
}
.settings-panel.open { display: flex; }
.settings-panel::-webkit-scrollbar { width: 6px; }
.settings-panel::-webkit-scrollbar-thumb { background: var(--bg-track); border-radius: 3px; }

.s-section { display: flex; flex-direction: column; gap: 8px; }
.s-title {
  font-size: 10px; font-weight: 600; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--text-muted);
}
.s-sub { font-size: 10px; font-weight: 500; color: var(--text-muted); margin-top: 2px; }
.s-divider { height: 1px; background: var(--border); margin: 2px 0; }

.s-input {
  background: var(--bg-track); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 9px 11px;
  font-family: 'Space Grotesk', sans-serif; font-size: 13px; width: 100%;
}
.s-input:focus { outline: none; border-color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-track); border: 1px solid transparent;
  color: var(--text); border-radius: 9px; padding: 7px 10px;
  font-size: 12px; font-weight: 500; cursor: pointer;
  font-family: 'Space Grotesk', sans-serif; transition: all .15s;
}
.chip:hover { border-color: var(--border); }
.chip.active { border-color: var(--accent); color: var(--accent); }
.chip .sw { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.sw-dark  { background: var(--wood-dark); }
.sw-light { background: var(--wood-light); }
.sw-plain { background: var(--frame-plain); }
.sw-noir  { background: var(--wood-black); }
.sw-none  { background: repeating-conic-gradient(#888 0% 25%, #ccc 0% 50%) 50%/8px 8px; }
/* Muestra de la pinza (gancho default) y previews de ganchos-imagen en los chips */
.sw-peg   { background: var(--clip); border-radius: 3px; }
.chip .hook-sw { width: 16px; height: 16px; object-fit: contain; flex-shrink: 0; }

/* Muestras de color neutro para el relleno */
.sw-white { background: #ffffff; box-shadow: inset 0 0 0 1px #ddd; }
.sw-black { background: #000000; }
.sw-gray  { background: #9e9e9e; }

.fill-row { display: flex; align-items: center; gap: 10px; }
.fill-row input[type=color] {
  width: 38px; height: 32px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg-track); cursor: pointer; padding: 2px;
}
.fill-row input[type=range] { flex: 1; accent-color: var(--accent); }
.fill-row .opv { font-size: 11px; color: var(--text-muted); min-width: 30px; text-align: right; }

.lang-toggle { display: flex; gap: 4px; }
.lang-toggle .chip { flex: 1; justify-content: center; }

.s-foot {
  display: flex; align-items: center; gap: 6px; justify-content: center;
  font-size: 10px; color: var(--text-muted); letter-spacing: .5px; padding-top: 2px;
  text-decoration: none; transition: color .15s ease; cursor: pointer;
}
.s-foot:hover { color: var(--text); }
.s-foot .star { color: var(--accent); }
