/* 이벤트 탭 */

/* ── 이벤트 탭 (맨 뒤, 강조) ── */
.sort { flex-wrap: wrap; }
.sort a.sort-event {
  position: relative;
  border-color: transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box,
              linear-gradient(120deg, #ff5f6d, #ffb347, #c471ed) border-box;
  color: #d6336c;
  font-weight: 700;
}
.sort a.sort-event:hover { color: #b0154e; }
.sort a.sort-event.on {
  background: linear-gradient(120deg, #ff5f6d, #ff8f5a 45%, #c471ed) border-box;
  color: #fff;
}
.sort-event-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff3b5c;
  box-shadow: 0 0 0 2px var(--bg);
}
.sort-event-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  animation: event-ping 1.6s ease-out infinite;
}
@keyframes event-ping { to { transform: scale(2.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sort-event-dot::after { animation: none; } }
.sort-event-dot[hidden] { display: none; }

.events[hidden], .grid[hidden] { display: none; }
.events {
  display: grid;
  gap: 28px;
  max-width: 560px;
  margin: 0 auto 48px;
}
.events-empty {
  padding: 48px 20px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
}
.event-note { margin: 0 0 10px; font-size: 16px; font-weight: 700; }
.event blockquote.text-post-media {
  margin: 0;
  min-width: 0 !important;
  max-width: 100%;
  min-height: 160px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.event blockquote.text-post-media a { color: var(--muted); font-size: 14px; }
.event iframe { max-width: 100% !important; }
.event blockquote.text-post-media-registered { display: none; } /* 임베드가 뜨면 자리표시는 숨김 */
.event.is-hidden { opacity: .45; }

/* 관리자만 보이는 편집 도구 */
.event-admin {
  font-size: 13px;
  border: 1px dashed var(--accent);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface);
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.event-admin button {
  font: inherit;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
.event-admin form { margin: 0; }
.event-admin-badge { flex-basis: 100%; color: var(--accent); font-weight: 700; }
.event-admin-link { color: var(--muted); margin-left: auto; }
.event-admin-flash { margin: 0; color: #2b8a3e; font-weight: 700; text-align: center; }
.event-admin-flash.is-error { color: #c92a2a; }

/* 이벤트: 구역 제목·기간·지난 이벤트·추가 버튼·팝업 */
.events-head { margin: 8px 0 -14px; font-size: 18px; }
.event-period { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.event-chip { padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--muted); }
.event-chip-on { border-color: transparent; background: linear-gradient(120deg, #ff5f6d, #ff8f5a); color: #fff; }
.events-past { border-top: 1px dashed var(--line); padding-top: 16px; }
.events-past summary { cursor: pointer; color: var(--muted); font-size: 14px; text-align: center; list-style: none; padding: 8px; border-radius: 999px; }
.events-past summary::-webkit-details-marker { display: none; }
.events-past summary:hover { color: var(--text); background: var(--surface); }
.events-past[open] summary { margin-bottom: 20px; }
.events-past .event { opacity: .8; }
.event-add {
  font: inherit; font-size: 15px; font-weight: 700; padding: 14px; cursor: pointer;
  border: 1.5px dashed var(--accent); border-radius: 14px; background: transparent; color: var(--accent);
}
.event-add small { font-weight: 400; color: var(--muted); }
.event-add:hover { background: var(--surface); }
.event-dialog { width: min(480px, calc(100vw - 32px)); }
.event-form { display: grid; gap: 14px; padding: 4px 22px 22px; }
.event-form label, .event-when { display: grid; gap: 6px; font-size: 14px; font-weight: 700; }
.event-form small { font-weight: 400; color: var(--muted); }
.event-when { border: 0; margin: 0; padding: 0; }
.event-when legend { padding: 0; margin-bottom: 6px; }
.event-form textarea, .event-form input[type=text], .event-form input[type=date], .event-form select {
  font: inherit; font-weight: 400; font-size: 15px; padding: 8px 10px; min-width: 0;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text);
}
.event-when-row { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; }
.event-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.event-quick button {
  font: inherit; font-size: 12px; font-weight: 400; padding: 4px 10px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text);
}
.event-submit { font: inherit; font-weight: 700; padding: 11px; border: 0; border-radius: 12px; background: var(--text); color: var(--bg); cursor: pointer; }

/* 이벤트: Threads 글 아래쪽(작성 시각·좋아요·댓글·공유 줄)을 잘라내고 우리 좋아요를 붙임 */
.event-embed { overflow: hidden; border-radius: 16px; }
.event-embed iframe { margin-bottom: -84px !important; display: block; }
.event-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.event-heart { font-size: 14px; padding: 6px 14px 6px 11px; }
.event-heart svg { width: 17px; height: 17px; }

/* 이벤트 목록 열 수: 모바일 1열 → 760px 이상 2열 → 1400px 이상은 이벤트 구역만 넓혀 3열 (Threads 글은 폭이 너무 좁으면 깨짐) */
.events-list { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 760px) {
  .events { max-width: none; }
  .events-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; }
}
@media (min-width: 1400px) {
  .events { --events-w: min(1320px, calc(100vw - 80px)); width: var(--events-w); margin-inline: calc((100% - var(--events-w)) / 2); }
  .events-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
