/* ==========================================================================
   article.css — Inline Photo Article Studio
   All rules scoped under .view-article so the other tool views are unaffected.
   ========================================================================== */

.view-article {
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.55), transparent 28%),
    linear-gradient(180deg, #f5eee4 0%, var(--bg) 100%);
  color: var(--ink);
  overflow: hidden;
}

.view-article .editor {
  background: linear-gradient(180deg, #111a29 0%, #09111f 100%);
  color: #fff;
  padding: 28px 22px 30px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  height: 100%;
  overflow: auto;
}

.view-article .badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 16px;
}

.view-article .editor h1 {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.4px;
}

.view-article .editor .desc {
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.7;
}

.view-article .section-title {
  margin: 26px 0 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: rgba(255, 255, 255, 0.52);
}

.view-article .field {
  margin-bottom: 16px;
}

.view-article .field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.94);
}

.view-article .field input[type="text"],
.view-article .field textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--panel-soft);
  color: #fff;
  border-radius: 14px;
  padding: 13px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: 0.2s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.view-article .field input[type="text"]:focus,
.view-article .field textarea:focus {
  border-color: rgba(138, 180, 255, 0.9);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(138, 180, 255, 0.12);
}

.view-article .field textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.75;
}

.view-article .date-input-wrap {
  position: relative;
}

.view-article .date-input-wrap input[type="text"] {
  padding-right: 46px;
}

.view-article .date-picker-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: 0.15s ease;
}

.view-article .date-picker-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.view-article .date-picker-btn:focus-visible {
  outline: 2px solid rgba(138, 180, 255, 0.7);
  outline-offset: 2px;
}

.view-article #datePicker {
  position: absolute;
  right: 6px;
  bottom: -2px;
  width: 32px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  border: 0;
  padding: 0;
}

.view-article .hint {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.58);
}

.view-article .upload-zone {
  display: block;
  position: relative;
  border: 1.5px dashed rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  padding: 24px 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
  transition: 0.2s ease;
  cursor: pointer;
}

.view-article .upload-zone:hover,
.view-article .upload-zone.dragover {
  border-color: rgba(138, 180, 255, 0.9);
  background: linear-gradient(180deg, rgba(138, 180, 255, 0.12), rgba(255, 255, 255, 0.05));
  box-shadow: 0 0 0 4px rgba(138, 180, 255, 0.10);
}

.view-article .upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.view-article .upload-content {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
  pointer-events: none;
}

.view-article .upload-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  font-size: 22px;
}

.view-article .upload-title {
  font-weight: 700;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.95);
}

.view-article .upload-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.6;
}

.view-article .control-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.view-article button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
  font-family: inherit;
}

.view-article .btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.view-article .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.view-article .btn-danger {
  background: rgba(196, 55, 55, 0.14);
  color: #ffd2d2;
  border: 1px solid rgba(196, 55, 55, 0.18);
}

.view-article .btn-danger:hover {
  background: rgba(196, 55, 55, 0.22);
}

.view-article .placement-area {
  margin-top: 14px;
}

.view-article .placement-hint {
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.58);
}

.view-article .slot-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.view-article .placement-slot {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.view-article .placement-slot-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.55);
  padding-top: 18px;
  text-align: right;
}

.view-article .placement-slot-zone {
  min-height: 60px;
  border-radius: 14px;
  border: 1.5px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  transition: 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.view-article .placement-slot-zone.drop-active {
  border-color: rgba(138, 180, 255, 0.95);
  background: rgba(138, 180, 255, 0.10);
}

.view-article .placement-slot-zone .thumb-item {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.view-article .placement-slot-empty {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
}

.view-article .unplaced-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 8px;
}

.view-article .unplaced-tray {
  min-height: 70px;
  border-radius: 14px;
  border: 1.5px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: 0.15s ease;
}

.view-article .unplaced-tray.drop-active {
  border-color: rgba(138, 180, 255, 0.95);
  background: rgba(138, 180, 255, 0.10);
}

@keyframes view-article-tray-flash {
  0% {
    border-color: rgba(255, 200, 60, 0.95);
    background: rgba(255, 200, 60, 0.18);
    box-shadow: 0 0 0 4px rgba(255, 200, 60, 0.16);
  }
  100% {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.02);
    box-shadow: 0 0 0 0 rgba(255, 200, 60, 0);
  }
}

.view-article .unplaced-tray.flash-warning {
  animation: view-article-tray-flash 1.4s ease-out;
}

.view-article .unplaced-tray:empty {
  align-items: center;
  justify-content: center;
}

.view-article .unplaced-tray:empty::before {
  content: '슬롯에서 끌어다 놓으면 본문 끝으로 이동합니다';
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
  text-align: center;
  padding: 14px;
}

.view-article .thumb-item {
  position: relative;
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  cursor: grab;
}

.view-article .thumb-item.dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.view-article .thumb-item input[type="text"],
.view-article .thumb-item .thumb-remove {
  cursor: auto;
}

.view-article .thumb-item .thumb-remove { cursor: pointer; }
.view-article .thumb-item input[type="text"] { cursor: text; }

.view-article .thumb-item img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.view-article .thumb-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.view-article .thumb-name {
  font-size: 11px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.55);
  word-break: break-all;
}

.view-article .thumb-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.view-article .thumb-field-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.5);
}

.view-article .thumb-field select,
.view-article .thumb-field input[type="text"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: 0.15s ease;
}

.view-article .thumb-field select:focus,
.view-article .thumb-field input[type="text"]:focus {
  border-color: rgba(138, 180, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
}

.view-article .thumb-field select option {
  background: #0f1827;
  color: #fff;
}

.view-article .thumb-remove {
  align-self: flex-start;
  background: rgba(196, 55, 55, 0.14);
  color: #ffd2d2;
  border: 1px solid rgba(196, 55, 55, 0.18);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  margin-top: 2px;
  cursor: pointer;
  transition: 0.15s ease;
}

.view-article .thumb-remove:hover {
  background: rgba(196, 55, 55, 0.22);
}

.view-article .preview-wrap {
  padding: 42px 28px 60px;
  height: 100%;
  overflow: auto;
}

.view-article .article-shell {
  /* width is driven by the sidebar slider via the --article-width CSS var.
     No max-width: when the slider exceeds the preview-wrap content area
     the preview scrolls horizontally (intentional). */
  width: var(--article-width, 1020px);
  margin: 0 auto;
  /* positioned ancestor for the absolutely-positioned effects overlay.
     The overlay sits as a sibling of .article inside the shell so that
     effects can be placed across the whole shell (topline + article) and
     extend into the gray preview-wrap margin without being clipped by
     .article's overflow: hidden. */
  position: relative;
}

.view-article .width-slider {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.view-article .width-value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-left: 8px;
}

.view-article .topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: #7e7265;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.8px;
}

.view-article .feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}

.view-article .feature-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b42318;
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.14);
}

.view-article .article {
  background: var(--paper);
  border: 1px solid rgba(110, 85, 58, 0.08);
  border-radius: 30px;
  overflow: hidden;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.view-article .article-head {
  padding: 42px 46px 30px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.16));
  border-bottom: 1px solid var(--line);
}

.view-article .kicker {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.8px;
}

.view-article .headline {
  margin: 0 0 18px;
  font-family: "Merriweather", Georgia, serif;
  font-size: 58px;
  line-height: 1.06;
  letter-spacing: -1px;
  color: #121212;
}

.view-article .standfirst {
  margin: 0;
  max-width: 780px;
  color: #4f4942;
  font-size: 21px;
  line-height: 1.7;
}

.view-article .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  padding: 20px 46px;
  background: rgba(255, 255, 255, 0.54);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #665d53;
}

.view-article .meta strong { color: #1b1b1b; }

.view-article .article-body {
  padding: 28px 46px 50px;
}

/* ============================================================
 * EFFECTS — overlay layer + sidebar controls
 * ============================================================ */

.view-article .effects-hint {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.58);
}

.view-article .effects-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 8px;
}

.view-article .effects-group-row {
  margin-bottom: 12px;
}

.view-article .effects-group-row .btn-secondary {
  width: 100%;
  padding: 7px 12px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.85);
  border: 1px dashed rgba(255, 255, 255, 0.18);
}

.view-article .effects-group-row .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(138, 180, 255, 0.55);
  color: #fff;
}

.view-article .effects-add-row select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  min-width: 0;
}

.view-article .effects-add-row select option {
  background: #0f1827;
  color: #fff;
}

.view-article .effects-add-row .btn-secondary {
  padding: 8px 14px;
  font-size: 13px;
  background: rgba(138, 180, 255, 0.18);
  color: #cfe0ff;
  border: 1px solid rgba(138, 180, 255, 0.28);
}

.view-article .effects-add-row .btn-secondary:hover {
  background: rgba(138, 180, 255, 0.28);
}

.view-article .effects-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.view-article .effects-list:empty::before {
  content: '아직 추가된 이펙트가 없어요.';
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
  padding: 10px 4px;
}

.view-article .effect-list-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  transition: 0.15s ease;
}

.view-article .effect-list-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 30px 26px;
  gap: 8px;
  align-items: center;
}

.view-article .effect-list-stroke {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 22px;
  gap: 8px;
  align-items: center;
  padding: 2px 2px 0;
}

.view-article .effect-list-stroke-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
}

.view-article .effect-list-stroke input[type="range"] {
  width: 100%;
  accent-color: #d6201f;
  cursor: pointer;
}

.view-article .effect-list-stroke-value {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.7);
  text-align: right;
}

/* color picker row — same visual language as the headline tab's
   highlight swatches: 22px squares, blue ring on the active one. */
.view-article .effect-list-color {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  padding: 2px 2px 0;
}

.view-article .effect-list-color-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  margin-right: 3px;
}

.view-article .effect-color-swatch {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  flex-shrink: 0;
  transition: 0.15s ease;
}

.view-article .effect-color-swatch:hover {
  transform: scale(1.08);
}

.view-article .effect-color-swatch.is-active {
  border-color: rgba(138, 180, 255, 0.95);
  border-width: 2px;
  box-shadow: 0 0 0 2px rgba(138, 180, 255, 0.25);
}

/* === group container ==================================== */
.view-article .effect-group {
  border-left: 2px solid rgba(138, 180, 255, 0.35);
  padding-left: 8px;
  margin-bottom: 4px;
}

.view-article .effect-group-header {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 26px 26px;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  background: rgba(138, 180, 255, 0.10);
  border: 1px solid rgba(138, 180, 255, 0.22);
  border-radius: 8px;
  margin-bottom: 4px;
}

.view-article .effect-group-header.is-hidden {
  opacity: 0.6;
}

.view-article .effect-group-icon {
  font-size: 13px;
  line-height: 1;
}

.view-article .effect-group-name {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  padding: 3px 6px;
  border-radius: 6px;
  outline: none;
}

.view-article .effect-group-name:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.view-article .effect-group-name:focus {
  border-color: rgba(138, 180, 255, 0.7);
  background: rgba(255, 255, 255, 0.06);
}

.view-article .effect-group-visibility,
.view-article .effect-group-delete {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
}

.view-article .effect-group-visibility:hover {
  background: rgba(255, 255, 255, 0.12);
}

.view-article .effect-group-delete {
  background: rgba(196, 55, 55, 0.14);
  color: #ffd2d2;
  border-color: rgba(196, 55, 55, 0.18);
  font-size: 16px;
  font-weight: 700;
}

.view-article .effect-group-delete:hover {
  background: rgba(196, 55, 55, 0.24);
}

.view-article .effect-group-effects {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.view-article .effect-group-effects:empty::before {
  content: '비어있어요. 효과의 "그룹" 드롭다운에서 이 그룹을 선택하세요.';
  display: block;
  font-size: 11px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.4);
  padding: 6px 4px;
}

/* === per-effect group selector ========================== */
.view-article .effect-list-group {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 2px 2px 0;
}

.view-article .effect-list-group-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
}

.view-article .effect-list-group-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.view-article .effect-list-group-select:focus {
  border-color: rgba(138, 180, 255, 0.7);
}

.view-article .effect-list-group-select option {
  background: #0f1827;
  color: #fff;
}

.view-article .effect-list-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.view-article .effect-list-item.is-selected {
  border-color: rgba(138, 180, 255, 0.7);
  background: rgba(138, 180, 255, 0.12);
}

.view-article .effect-list-item.is-hidden {
  opacity: 0.55;
}

.view-article .effect-list-thumb {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: #d6201f;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.view-article .effect-list-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.view-article .effect-list-visibility,
.view-article .effect-list-delete {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
}

.view-article .effect-list-visibility:hover {
  background: rgba(255, 255, 255, 0.12);
}

.view-article .effect-list-delete {
  background: rgba(196, 55, 55, 0.14);
  color: #ffd2d2;
  border-color: rgba(196, 55, 55, 0.18);
  font-size: 16px;
  font-weight: 700;
}

.view-article .effect-list-delete:hover {
  background: rgba(196, 55, 55, 0.24);
}

/* === Overlay layer over the article body ================ */
.view-article .effects-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

/* moveable mounts its control box inside the overlay so its coords match
   the effects. Re-enable pointer events on its own children since the
   overlay itself stays click-through. */
.view-article .effects-overlay .moveable-control-box,
.view-article .effects-overlay .moveable-control-box * {
  pointer-events: auto;
}

.view-article .article-effect {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: auto;
  transform-origin: center center;
  cursor: move;
  user-select: none;
  touch-action: none;
}

.view-article .article-effect.is-hidden {
  display: none;
}

.view-article .article-effect svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

/* === brush strokes (shared base) ======================= */
.view-article .brush-path {
  fill: none;
  stroke: #d6201f;
  stroke-width: 22;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* === Red brush check (draw-on animation) =============== */
.view-article .brush-check-path {
  /* --dash-len is set from JS via getTotalLength() */
  stroke-dasharray: var(--dash-len, 600);
  stroke-dashoffset: var(--dash-len, 600);
  animation: article-effect-brush-check 6s linear infinite;
}

/* 1s draw (0 → 16.667%) then hold drawn for 5s. Loop wraps back to
   the invisible start state in a single frame, giving the
   "instant disappear → immediately redraw" effect the user asked for. */
@keyframes article-effect-brush-check {
  0% {
    stroke-dashoffset: var(--dash-len, 600);
  }
  16.667% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

/* === Arrow (oscillation animation) ===================== */
/* The wrapping SVG <g> shifts along its local +X axis (= the arrow's
   head direction in user space). When the outer .article-effect rotates,
   this local translate rotates with it, so the arrow always wobbles
   along the direction it points. */
.view-article .brush-arrow-anim {
  animation: article-effect-arrow-oscillate 1.6s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center center;
}

@keyframes article-effect-arrow-oscillate {
  0%, 100% { transform: translate(-8px, 0); }
  50%      { transform: translate(20px, 0); }
}

.view-article .content {
  font-family: "Merriweather", Georgia, serif;
}

.view-article .content p {
  margin: 0 0 26px;
  font-size: 21px;
  line-height: 1.95;
  color: #1f1f1f;
}

.view-article .content p.first::first-letter {
  float: left;
  font-size: 4.2em;
  line-height: 0.9;
  padding-right: 10px;
  padding-top: 7px;
  font-weight: 700;
  color: #111;
}

.view-article .pullquote {
  clear: both;
  margin: 34px 0;
  padding: 20px 22px;
  border-left: 4px solid var(--accent);
  background: linear-gradient(180deg, rgba(122, 31, 31, 0.03), rgba(122, 31, 31, 0.07));
  border-radius: 0 18px 18px 0;
  font-size: 24px;
  line-height: 1.7;
  color: #332d28;
}

.view-article .content mark,
.view-article .pullquote mark,
.view-article .standfirst mark {
  background: rgba(255, 230, 80, 0.65);
  color: inherit;
  padding: 0 2px;
  border-radius: 1px;
}

.view-article .paragraph-block {
  display: flow-root;
}

/* ============================================================
 * ORIGINAL: half-width floating layout that wraps body copy
 * around inline images. Disabled in favor of the FULL-WIDTH
 * layout below. To revert, remove the FULL-WIDTH block and
 * unwrap this comment.
 * ============================================================
.view-article .inline-figure {
  float: left;
  width: 50%;
  max-width: 380px;
  margin: 8px 28px 14px 0;
  border-radius: 20px;
  overflow: hidden;
  background: #ede3d8;
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(52, 37, 20, 0.07);
}

.view-article .inline-figure img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: cover;
}

.view-article .inline-figure--trailing {
  clear: both;
  float: none;
  width: 100%;
  max-width: 100%;
  margin: 36px 0;
}

.view-article .inline-figure--trailing img {
  max-height: 460px;
}
*/

/* === FULL-WIDTH: every inline figure spans the article column === */
.view-article .inline-figure {
  width: 100%;
  max-width: 100%;
  margin: 36px 0;
  border-radius: 20px;
  overflow: hidden;
  background: #ede3d8;
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(52, 37, 20, 0.07);
}

.view-article .inline-figure img {
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: cover;
}

.view-article .content::after {
  content: '';
  display: block;
  clear: both;
}

.view-article .inline-figure figcaption {
  padding: 12px 14px 14px;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  line-height: 1.6;
  color: #6c6156;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.96));
}

.view-article .empty {
  color: #8a8076;
  font-style: italic;
}

@media (max-width: 1180px) {
  .view-article {
    grid-template-columns: 340px minmax(0, 1fr);
  }
  .view-article .preview-wrap { padding: 24px 16px 40px; }
  .view-article .headline { font-size: 42px; }
  .view-article .standfirst { font-size: 18px; }
}

@media (max-width: 760px) {
  .view-article {
    grid-template-columns: 1fr;
    overflow: auto;
  }
  .view-article .editor {
    height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 20px 16px 24px;
  }
  .view-article .preview-wrap {
    height: auto;
    overflow: visible;
  }
  .view-article .article-head,
  .view-article .meta,
  .view-article .article-body {
    padding-left: 20px;
    padding-right: 20px;
  }
  .view-article .headline { font-size: 33px; }
  .view-article .content p { font-size: 18px; line-height: 1.85; }
  .view-article .article { border-radius: 22px; }
  .view-article .inline-figure {
    float: none;
    width: 100%;
    max-width: 100%;
    margin: 32px 0;
  }
  .view-article .inline-figure img { max-height: 280px; }
}

/* ============================================================
 * AUTOMATION — script of scroll / wait / effect-toggle steps
 *   run sequentially during recording. Scoped under .view-article
 *   so styles never leak. Layout intentionally mirrors the
 *   effects-list above so the panel feels like a sibling.
 * ============================================================ */

.view-article .automation-play-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 10px;
}

.view-article .automation-play-row .btn-primary {
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 10px;
  background: linear-gradient(180deg, #2e6bff 0%, #1f54e0 100%);
  color: #fff;
  border: 1px solid rgba(138, 180, 255, 0.4);
  cursor: pointer;
  transition: 0.15s ease;
}

.view-article .automation-play-row .btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
}

.view-article .automation-play-row .btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.view-article .automation-play-row .btn-secondary {
  padding: 9px 14px;
  font-size: 13px;
  background: rgba(255, 80, 80, 0.18);
  color: #ffd5d5;
  border: 1px solid rgba(255, 80, 80, 0.35);
  border-radius: 10px;
  cursor: pointer;
}

.view-article .automation-play-row .btn-secondary:hover {
  background: rgba(255, 80, 80, 0.28);
}

.view-article .automation-add-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.view-article .automation-add-row .btn-secondary {
  padding: 8px 6px;
  font-size: 12px;
  background: rgba(138, 180, 255, 0.14);
  color: #cfe0ff;
  border: 1px solid rgba(138, 180, 255, 0.24);
  border-radius: 8px;
  cursor: pointer;
  transition: 0.15s ease;
}

.view-article .automation-add-row .btn-secondary:hover:not(:disabled) {
  background: rgba(138, 180, 255, 0.22);
}

.view-article .automation-add-row .btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.view-article .automation-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.view-article .automation-list:empty::before {
  content: '아직 단계가 없어요. 위 버튼으로 추가해 보세요.';
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  font-style: italic;
  padding: 10px 4px;
}

/* during playback, dim the list so the user sees the script is "locked" */
.view-article .automation-list.is-playing {
  opacity: 0.55;
  pointer-events: none;
}

.view-article .automation-step-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.view-article .automation-step-head {
  display: grid;
  grid-template-columns: 22px 18px minmax(0, 1fr) 22px 22px 24px;
  gap: 6px;
  align-items: center;
}

.view-article .automation-step-index {
  font-size: 11px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}

.view-article .automation-step-icon {
  font-size: 14px;
  text-align: center;
}

.view-article .automation-step-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #e9eef9;
}

.view-article .automation-step-move,
.view-article .automation-step-delete {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.view-article .automation-step-move:hover:not(:disabled),
.view-article .automation-step-delete:hover {
  background: rgba(255, 255, 255, 0.12);
}

.view-article .automation-step-move:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.view-article .automation-step-delete {
  width: 24px;
  height: 24px;
  background: rgba(196, 55, 55, 0.18);
  color: #ffd2d2;
  border-color: rgba(196, 55, 55, 0.28);
  font-size: 14px;
}

.view-article .automation-step-delete:hover {
  background: rgba(196, 55, 55, 0.32);
}

.view-article .automation-step-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 2px 2px;
}

.view-article .automation-step-field {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.view-article .automation-step-field-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.62);
  font-weight: 600;
}

.view-article .automation-step-num,
.view-article .automation-step-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  min-width: 0;
}

.view-article .automation-step-select option {
  background: #0f1827;
  color: #fff;
}

/* scroll step's "위치" controls — 3 capture buttons + current target display */
.view-article .automation-step-scroll-target {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.view-article .automation-step-scroll-btns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.view-article .automation-step-target-btn {
  appearance: none;
  border: 1px solid rgba(138, 180, 255, 0.24);
  background: rgba(138, 180, 255, 0.14);
  color: #cfe0ff;
  border-radius: 6px;
  padding: 5px 4px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.view-article .automation-step-target-btn:hover {
  background: rgba(138, 180, 255, 0.24);
}

.view-article .automation-step-scroll-display {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 8px;
  border-radius: 6px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.view-article .automation-step-num:focus,
.view-article .automation-step-select:focus {
  border-color: rgba(138, 180, 255, 0.55);
}

