/* ─────────────────────────────────────────────────────────────
 * 14-notices.css — 공지/이벤트 페이지 + 인트로 상단 배지
 *
 * 적용 페이지:
 *   - /notices.html (목록 + 상세 모달)
 *   - / (index.html 인트로 상단 1행 배지)
 *
 * 디자인:
 *   - 글래스 카드 베이스 (02-glass.css 토큰 재사용)
 *   - 13-pager.css 페이저 그대로 사용 (notices-shell 안에 nav.pager)
 *   - 핀 고정 카드는 좌측 강조선
 *   - notice / event kind 별 색상 차별화 (notice=blue, event=warm)
 * ───────────────────────────────────────────────────────────── */

/* ─── 인트로 상단 1행 배지 (index.html) ─────────────────── */
.notice-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 1100px);
  margin: 16px auto 0;
  padding: 10px 16px;
  background: var(--surface-glass, rgba(255, 255, 255, 0.62));
  border: 1px solid var(--line, rgba(31, 58, 138, 0.12));
  border-radius: 12px;
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
  transition: transform 200ms cubic-bezier(.25, 1, .3, 1),
              box-shadow 200ms cubic-bezier(.25, 1, .3, 1),
              border-color 200ms cubic-bezier(.25, 1, .3, 1);
  cursor: pointer;
}
.notice-banner:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 58, 138, 0.28);
  box-shadow: 0 8px 24px rgba(31, 58, 138, 0.08);
}
.notice-banner[hidden] { display: none; }

.notice-banner__emoji {
  font-size: 1.1rem;
  line-height: 1;
}
.notice-banner__tag {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(31, 58, 138, 0.1);
  color: #1F3A8A;
}
.notice-banner__tag[data-kind="event"] {
  background: rgba(220, 120, 30, 0.12);
  color: #B05B12;
}
.notice-banner__title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.notice-banner__more {
  flex-shrink: 0;
  font-size: 0.8rem;
  opacity: 0.7;
}

[data-theme="dark"] .notice-banner {
  background: rgba(20, 30, 60, 0.6);
  border-color: rgba(140, 160, 220, 0.18);
  color: #E4E7F3;
}
[data-theme="dark"] .notice-banner__tag {
  background: rgba(140, 160, 220, 0.16);
  color: #B8C8FF;
}
[data-theme="dark"] .notice-banner__tag[data-kind="event"] {
  background: rgba(220, 150, 80, 0.18);
  color: #F5C28A;
}

/* ─── notices.html 목록 ─────────────────────────────── */
.notices-shell {
  max-width: 900px;
  margin: 32px auto 0;
}

.notices-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.notice-card {
  position: relative;
  padding: 16px 18px;
  background: var(--surface-glass, rgba(255, 255, 255, 0.62));
  border: 1px solid var(--line, rgba(31, 58, 138, 0.12));
  border-radius: 14px;
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  cursor: pointer;
  transition: transform 200ms cubic-bezier(.25, 1, .3, 1),
              box-shadow 200ms cubic-bezier(.25, 1, .3, 1),
              border-color 200ms cubic-bezier(.25, 1, .3, 1);
}
.notice-card:hover,
.notice-card:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(31, 58, 138, 0.28);
  box-shadow: 0 10px 28px rgba(31, 58, 138, 0.08);
  outline: none;
}
.notice-card.is-pinned {
  border-left: 3px solid #1F3A8A;
  background: linear-gradient(
    90deg,
    rgba(31, 58, 138, 0.04) 0%,
    var(--surface-glass, rgba(255, 255, 255, 0.62)) 28%
  );
}

.notice-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.notice-card__emoji {
  font-size: 1.2rem;
}
.notice-card__meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  opacity: 0.85;
}
.notice-card__tag {
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(31, 58, 138, 0.1);
  color: #1F3A8A;
}
.notice-card__tag[data-kind="event"] {
  background: rgba(220, 120, 30, 0.12);
  color: #B05B12;
}
.notice-card__pin {
  color: #1F3A8A;
  font-weight: 600;
}
.notice-card__date {
  color: var(--ink-mute, #5a6378);
}

.notice-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--ink);
}

.notice-card__excerpt {
  font-size: 0.92rem;
  margin: 0;
  color: var(--ink-mute, #4a5066);
  line-height: 1.55;
  white-space: pre-wrap;
}

.notices-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--ink-mute, #5a6378);
}

[data-theme="dark"] .notice-card {
  background: rgba(20, 30, 60, 0.6);
  border-color: rgba(140, 160, 220, 0.18);
  color: #E4E7F3;
}
[data-theme="dark"] .notice-card.is-pinned {
  border-left-color: #B8C8FF;
  background: linear-gradient(
    90deg,
    rgba(140, 160, 220, 0.1) 0%,
    rgba(20, 30, 60, 0.6) 28%
  );
}
[data-theme="dark"] .notice-card__tag {
  background: rgba(140, 160, 220, 0.16);
  color: #B8C8FF;
}
[data-theme="dark"] .notice-card__tag[data-kind="event"] {
  background: rgba(220, 150, 80, 0.18);
  color: #F5C28A;
}
[data-theme="dark"] .notice-card__pin { color: #B8C8FF; }
[data-theme="dark"] .notice-card__excerpt { color: #B0B8CC; }

/* ─── 상세 모달 (<dialog>) ────────────────────────── */
.notice-modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: min(640px, 92vw);
  width: 100%;
}
.notice-modal::backdrop {
  background: rgba(15, 20, 40, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.notice-modal__panel {
  padding: 24px 26px 26px;
  /* 모달 패널은 불투명 가까운 라이트 배경 — 어두운 backdrop이 비쳐 회색으로 보이지 않게.
     --surface-glass(0.55 투명도)는 카드용. 모달은 가독성 우선이라 --surface 사용. */
  background: var(--surface, #ffffff);
  border: 1px solid var(--line, rgba(31, 58, 138, 0.16));
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(15, 20, 40, 0.25);
  color: var(--ink, #0f1428);
}
.notice-modal__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.notice-modal__emoji {
  font-size: 1.6rem;
}
.notice-modal__title {
  flex: 1;
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
}
.notice-modal__close {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-mute, #5a6378);
  padding: 0 4px;
}
.notice-modal__close:hover { color: var(--ink); }

.notice-modal__meta {
  font-size: 0.82rem;
  color: var(--ink-mute, #5a6378);
  margin: 0 0 12px;
}
.notice-modal__body {
  font-size: 0.95rem;
  line-height: 1.65;
  white-space: pre-wrap;
  color: var(--ink);
  max-height: 60vh;
  overflow-y: auto;
}

[data-theme="dark"] .notice-modal__panel {
  background: #14182a;
  border-color: rgba(140, 160, 220, 0.22);
  color: #E4E7F3;
}
[data-theme="dark"] .notice-modal__meta { color: #B0B8CC; }

/* 필터 활성 상태 — 사이트 btn--ghost is-active를 그대로 활용. */
.notices-filter .btn.is-active {
  background: rgba(31, 58, 138, 0.12);
  border-color: rgba(31, 58, 138, 0.28);
  color: #1F3A8A;
  font-weight: 600;
}
[data-theme="dark"] .notices-filter .btn.is-active {
  background: rgba(140, 160, 220, 0.18);
  border-color: rgba(140, 160, 220, 0.4);
  color: #B8C8FF;
}

/* ─── 인트로 상단 1행 (반응형) ─────────────────────── */
@media (max-width: 600px) {
  .notice-banner {
    font-size: 0.88rem;
    padding: 8px 12px;
  }
  .notice-banner__tag { font-size: 0.65rem; }
  .notice-banner__more { display: none; }
}

/* 관리자 폼 wrapper — 입력 lag 방지용 non-glass panel.
   .glass-card의 backdrop-filter는 keystroke당 viewport 전체 blur 재합성을 유발 →
   GPU 가속이 software fallback인 환경에서 0.5s 이상 lag 보고됨. */
.notice-form-panel {
  background: var(--surface, #ffffff);
  border: 1px solid var(--line, rgba(31, 58, 138, 0.16));
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(14, 28, 64, 0.06);
}
[data-theme="dark"] .notice-form-panel {
  background: #14182a;
  border-color: rgba(140, 160, 220, 0.18);
}


.notice-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.notice-form-banner {
  display: none;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
}
.notice-form-banner.is-show { display: flex; }
.notice-form-banner[data-kind="ok"] {
  background: rgba(44, 138, 74, 0.12);
  border-color: rgba(44, 138, 74, 0.4);
  color: #1f6a3a;
}
.notice-form-banner[data-kind="err"] {
  background: rgba(181, 65, 63, 0.12);
  border-color: rgba(181, 65, 63, 0.4);
  color: #8e2f2d;
}
.notice-form-banner[data-kind="info"] {
  background: rgba(31, 58, 138, 0.1);
  border-color: rgba(31, 58, 138, 0.34);
  color: #1F3A8A;
}

.notice-form__row {
  display: grid;
  gap: 12px;
}
.notice-form__row--inline {
  grid-template-columns: 220px 220px;
  align-items: end;
}
@media (max-width: 560px) {
  .notice-form__row--inline { grid-template-columns: 1fr; }
}

.notice-form__field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.notice-form__field--block { width: 100%; }

.notice-form__label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-mute, #5a6378);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.notice-form__hint {
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--ink-faint, #8089a0);
}

.notice-form input[type="text"],
.notice-form input[type="number"],
.notice-form select,
.notice-form textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line, rgba(31, 58, 138, 0.18));
  border-radius: 8px;
  background: var(--surface-glass, rgba(255, 255, 255, 0.7));
  color: var(--ink);
  font: inherit;
  box-sizing: border-box;
}
.notice-form input:focus,
.notice-form select:focus,
.notice-form textarea:focus {
  outline: none;
  border-color: rgba(31, 58, 138, 0.55);
  box-shadow: 0 0 0 3px rgba(31, 58, 138, 0.12);
}
.notice-form textarea {
  resize: vertical;
  min-height: 140px;
  font-family: inherit;
  line-height: 1.55;
}
.notice-form__emoji-input {
  font-size: 1.25rem;
  text-align: center;
}

/* fieldset "노출 옵션" */
.notice-form__group {
  border: 1px solid var(--line, rgba(31, 58, 138, 0.16));
  border-radius: 10px;
  padding: 6px 16px 14px;
  margin: 4px 0 0;
  background: rgba(31, 58, 138, 0.035);
}
.notice-form__group legend {
  padding: 2px 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-mute, #5a6378);
  letter-spacing: 0.02em;
}

.notice-form__opt-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 14px;
  align-items: center;
  padding: 10px 0;
}
.notice-form__opt-row + .notice-form__opt-row {
  border-top: 1px dashed var(--line, rgba(31, 58, 138, 0.12));
}
.notice-form__opt-row--single {
  grid-template-columns: minmax(220px, 1fr);
}
@media (max-width: 560px) {
  .notice-form__opt-row { grid-template-columns: 1fr; gap: 8px; }
}

.notice-form__check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
}
.notice-form__check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #1F3A8A;
  cursor: pointer;
}

.notice-form__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.notice-form__actions .btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}
.notice-form__msg-inline {
  font-size: 0.85rem;
  color: var(--ink-mute, #5a6378);
}
.notice-form__msg-inline[data-kind="err"] { color: #b5413f; }
.notice-form__msg-inline[data-kind="ok"]  { color: #2c8a4a; font-weight: 600; }
.notice-form__msg-inline[data-kind="info"] { color: #1F3A8A; }

/* ─── 목록 카드 admin 보강 (기존 유지) ─── */
.admin-status-tag {
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.72rem;
  background: rgba(31, 58, 138, 0.1);
  color: #1F3A8A;
}
.admin-status-tag[data-status="draft"] {
  background: rgba(160, 80, 80, 0.12);
  color: #9a4848;
}
.admin-notice-row.is-draft {
  opacity: 0.78;
  border-style: dashed;
}
.admin-notice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.admin-notice-actions .btn {
  font-size: 0.78rem;
  padding: 4px 10px;
}

/* 다크 모드 */
[data-theme="dark"] .notice-form input,
[data-theme="dark"] .notice-form select,
[data-theme="dark"] .notice-form textarea {
  background: rgba(20, 30, 60, 0.6);
  border-color: rgba(140, 160, 220, 0.22);
  color: #E4E7F3;
}
[data-theme="dark"] .notice-form input:focus,
[data-theme="dark"] .notice-form select:focus,
[data-theme="dark"] .notice-form textarea:focus {
  border-color: rgba(184, 200, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(184, 200, 255, 0.12);
}
[data-theme="dark"] .notice-form__group {
  background: rgba(140, 160, 220, 0.06);
  border-color: rgba(140, 160, 220, 0.18);
}
[data-theme="dark"] .notice-form__check input[type="checkbox"] {
  accent-color: #B8C8FF;
}
[data-theme="dark"] .admin-status-tag {
  background: rgba(140, 160, 220, 0.18);
  color: #B8C8FF;
}
[data-theme="dark"] .admin-status-tag[data-status="draft"] {
  background: rgba(200, 130, 130, 0.16);
  color: #E89B9B;
}
[data-theme="dark"] .notice-form-banner[data-kind="ok"] {
  background: rgba(120, 220, 150, 0.15);
  border-color: rgba(120, 220, 150, 0.4);
  color: #b4e9c3;
}
[data-theme="dark"] .notice-form-banner[data-kind="err"] {
  background: rgba(240, 130, 130, 0.15);
  border-color: rgba(240, 130, 130, 0.4);
  color: #f5b0b0;
}
[data-theme="dark"] .notice-form-banner[data-kind="info"] {
  background: rgba(180, 200, 255, 0.12);
  border-color: rgba(180, 200, 255, 0.4);
  color: #B8C8FF;
}
