/* 행사 안내 팝업 (assets/js/event-popup.js). 움직임은 첫 화면 움직임과 같이 html.lm(나타나기)·html.lm-loop(계속 도는 움직임) 아래에서만 건다.
   움직임은 transform·opacity만 쓴다. */

.ev-wrap { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 16px; }
.ev-wrap.out { opacity: 0; }
html.lm .ev-wrap.out { transition: opacity .2s ease !important; }
.ev-back { position: absolute; inset: 0; background: rgba(10, 31, 71, .48); backdrop-filter: blur(2px); }
.ev-pop { position: relative; width: min(440px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: var(--radius-lg, 20px); box-shadow: 0 24px 60px rgba(10, 31, 71, .35); outline: none; }

/* 머리: 파스텔 그림(전북교육청 본청에서 AI 연결망이 하늘로 이어지는 풍경) + 꽃가루 + 만세하는 선생님. 아래쪽 띠는 그림 자리로 비워 둔다 */
.ev-top { position: relative; overflow: hidden; padding: 22px 70px 84px 24px; color: var(--navy); background: #f1f2fe; }
.ev-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.ev-chips, .ev-top h2, .ev-sub { position: relative; z-index: 1; }
.ev-chips { display: flex; gap: 6px; margin-bottom: 10px; }
.ev-tag, .ev-dday { font-size: 12.5px; font-weight: 800; border-radius: 999px; padding: 3px 10px; line-height: 1.4; }
.ev-tag { background: var(--yellow, #ffcd1b); color: var(--navy); }
.ev-dday { background: var(--orange, #f07d00); color: #fff; }
.ev-top h2 { font-size: 23px; line-height: 1.25; letter-spacing: -0.03em; }
.ev-sub { margin-top: 4px; padding-right: 64px; font-size: 15px; font-weight: 700; color: #4f5f8c; } /* 오른쪽 선생님 앞에서 줄바꿈 */
.ev-top > .ev-msc { position: absolute; z-index: 2; right: 24px; bottom: 2px; width: 100px; }
.ev-msc .msc { display: block; width: 100px; height: auto; }
.ev-x { position: absolute; right: 10px; top: 10px; z-index: 3; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .75); color: var(--navy); display: grid; place-items: center; cursor: pointer; }
.ev-x:hover, .ev-x:focus-visible { background: #fff; }
.ev-x .ic { width: 18px; height: 18px; }

.ev-cf { position: absolute; inset: 0; pointer-events: none; }
.ev-cf i { position: absolute; top: -12px; left: calc(var(--k) * 8% + 3%); width: 6px; height: 10px; border-radius: 2px; background: var(--yellow, #ffcd1b); opacity: .85;
  transform: translateY(calc(var(--k) * 9px + 14px)) rotate(calc(var(--k) * 37deg)); }
.ev-cf i:nth-child(3n+2) { background: #ff9fb0; width: 7px; height: 7px; border-radius: 50%; }
.ev-cf i:nth-child(3n) { background: #7fd8cf; }

/* 본문 */
.ev-body { padding: 20px 24px 20px; }
.ev-lead { color: var(--ink-2); font-size: 15px; }
.ev-info { margin: 14px 0 0; padding: 14px 16px; border-radius: 14px; background: var(--bg-2, #f6f8fb); display: grid; gap: 10px; }
.ev-info > div { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.ev-info dt { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--ink-3); }
.ev-info dt .ic { width: 17px; height: 17px; color: var(--blue); }
.ev-info dd { margin: 0; font-size: 15.5px; color: var(--ink); }
.ev-info dd b { color: var(--navy); }
.ev-info dd a { font-size: 13.5px; color: var(--blue-2, #1463d8); margin-left: 4px; white-space: nowrap; }
.ev-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 16px; }
.ev-actions .ic { width: 18px; height: 18px; }
.ev-hide { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-size: 13.5px; color: var(--ink-3); cursor: pointer; }
.ev-hide input { width: 16px; height: 16px; accent-color: var(--navy); }

/* ---------- 움직임 ---------- */
@keyframes ev-fade { from { opacity: 0; } }
@keyframes ev-in { from { opacity: 0; transform: translateY(18px) scale(.92); } }
@keyframes ev-rise { from { transform: translateY(70px); } }
@keyframes ev-fall { 0% { transform: translateY(0) rotate(0); opacity: 0; } 10% { opacity: .9; } 85% { opacity: .9; } 100% { transform: translateY(190px) rotate(360deg); opacity: 0; } }
@keyframes ev-beat { 0%, 100% { transform: none; } 50% { transform: scale(1.1); } }
html.lm .ev-back { animation: ev-fade .3s ease both !important; }
html.lm .ev-pop { animation: ev-in .55s cubic-bezier(.3, 1.4, .5, 1) both !important; }
html.lm .ev-msc .msc { animation: ev-rise .8s cubic-bezier(.3, 1.5, .5, 1) .35s backwards !important; }
html.lm-loop .ev-cf i { animation: ev-fall 3.6s linear infinite !important; animation-delay: calc(var(--k) * -.31s) !important; }
html.lm-loop .ev-dday { animation: ev-beat 1.6s ease-in-out infinite !important; }
@keyframes ev-signal { to { stroke-dashoffset: -75; } }
@keyframes ev-twinkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(1.35); } }
@keyframes ev-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes ev-sway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@keyframes ev-gleam { 0%, 45% { transform: translateX(0); opacity: 0; } 50% { opacity: .6; } 80%, 100% { transform: translateX(19px); opacity: 0; } }
.ev-art .ev-node, .ev-art .ev-beacon, .ev-art .ev-tree, .ev-art .ev-float { transform-box: fill-box; transform-origin: 50% 50%; }
.ev-art .ev-tree { transform-origin: 50% 100%; }
.ev-art .ev-screen { opacity: 0; }
html.lm-loop .ev-art .ev-signal { animation: ev-signal 2.6s linear infinite !important; }
html.lm-loop .ev-art .ev-node, html.lm-loop .ev-art .ev-beacon { animation: ev-twinkle 2.2s ease-in-out infinite !important; }
html.lm-loop .ev-art .ev-float { animation: ev-bob 3s ease-in-out infinite !important; }
html.lm-loop .ev-art .ev-tree { animation: ev-sway 5s ease-in-out infinite !important; }
html.lm-loop .ev-art .ev-tree:nth-of-type(2n) { animation-duration: 6.2s !important; }
html.lm-loop .ev-art .ev-screen { animation: ev-gleam 4s ease-in-out infinite !important; }

html:not(.lm-loop) .ev-msc .msc * { animation-play-state: paused !important; }

@media (max-width: 480px) {
  .ev-top { padding: 20px 60px 80px 20px; }
  .ev-top h2 { font-size: 22px; }
  .ev-top > .ev-msc, .ev-msc .msc { width: 88px; }
  .ev-top > .ev-msc { right: 12px; }
  .ev-body { padding: 18px 20px; }
  .ev-actions { grid-template-columns: minmax(0, 1fr); }
}
@media print { .ev-wrap { display: none; } }
