/* ═══════════════════════════════════════════════════════════════
   NOTICE PAGE — 공지사항 게시판
   ═══════════════════════════════════════════════════════════════ */

.notice-section { padding: clamp(40px, 6vw, 70px) 0 clamp(70px, 9vw, 120px); }

/* 보기 전환 토글 */
.notice-viewtoggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.notice-viewtoggle button {
  display: grid; place-items: center;
  width: 36px; height: 36px;
  background: #fff; border: 0; cursor: pointer; color: var(--ink-3);
  border-right: 1px solid var(--line);
}
.notice-viewtoggle button:last-child { border-right: 0; }
.notice-viewtoggle button.on { background: var(--accent); color: #fff; }

/* 카드형 그리드 */
.notice-cardgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.notice-card {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, border-color .2s ease;
  display: flex; flex-direction: column;
}
.notice-card:hover { transform: translateY(-5px); box-shadow: 0 16px 34px -12px rgba(26,41,66,.2); border-color: var(--accent); }
.notice-card-thumb { position: relative; aspect-ratio: 16/10; background: var(--bg-2); }
.notice-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.notice-card-noimg {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, color-mix(in oklab, var(--accent) 14%, #fff), color-mix(in oklab, var(--accent) 5%, #fff));
}
.notice-card-noimg span { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: color-mix(in oklab, var(--accent) 60%, #fff); }
.notice-card-cat {
  position: absolute; top: 12px; left: 12px;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: 12px; font-weight: 600;
  padding: 4px 11px; border-radius: 999px;
}
.notice-card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.notice-card-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--ink); line-height: 1.45; margin: 0; display: flex; align-items: center; gap: 8px; }
.notice-card-excerpt { font-size: 13.5px; color: var(--ink-3); line-height: 1.6; margin: 0; flex: 1; }
.notice-card-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 900px) { .notice-cardgrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .notice-cardgrid { grid-template-columns: 1fr; } }

/* 상세 — 카드뉴스형 여러 이미지 */
.notice-detail-imgs { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.notice-detail-imgs .notice-detail-img { margin: 0; }

/* 첨부파일 목록 */
.notice-files { margin-top: 26px; border-top: 1px solid var(--line-soft); padding-top: 20px; }
.notice-files-head { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 12px; }
.notice-files-head svg { color: var(--accent); }
.notice-file-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border: 1px solid var(--line-soft); border-radius: 10px;
  margin-bottom: 8px; background: #fafbfd;
  transition: background .18s ease, border-color .18s ease;
}
.notice-file-item:hover { background: color-mix(in oklab, var(--accent) 7%, #fff); border-color: var(--accent); }
.notice-file-ic { flex: 0 0 auto; color: var(--accent); display: grid; place-items: center; }
.notice-file-name { flex: 1; min-width: 0; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-file-size { flex: 0 0 auto; font-size: 12.5px; color: var(--ink-3); }
.notice-file-dl { flex: 0 0 auto; color: var(--accent); display: grid; place-items: center; }

/* 상세 푸터 수정 버튼 */
.notice-detail-edit {
  padding: 9px 18px; border-radius: 8px;
  border: 1px solid var(--accent); background: color-mix(in oklab, var(--accent) 8%, #fff);
  color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer;
}
.notice-detail-edit:hover { background: color-mix(in oklab, var(--accent) 16%, #fff); }

/* 글쓰기 — 여러 이미지 그리드 */
.notice-imgs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.notice-img-thumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--line-soft); }
.notice-img-thumb img { width: 100%; height: 100%; object-fit: cover; }
.notice-img-del {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; border: 0; cursor: pointer;
  font-size: 16px; line-height: 1; display: grid; place-items: center;
}
.notice-img-add {
  aspect-ratio: 1; border: 1.5px dashed var(--line); border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  color: var(--ink-3); cursor: pointer; font-size: 12px; background: #fafbfd;
  transition: border-color .2s ease, color .2s ease;
}
.notice-img-add:hover { border-color: var(--accent); color: var(--accent); }

/* 글쓰기 — 첨부파일 */
.notice-attach-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--line-soft); border-radius: 8px;
  margin-bottom: 7px; background: #fafbfd;
}
.notice-attach-del {
  flex: 0 0 auto; padding: 4px 10px; border-radius: 6px;
  border: 1px solid color-mix(in oklab, #b8493a 40%, var(--line));
  background: #fff; color: #b8493a; font-size: 12px; cursor: pointer;
}
.notice-attach-add {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border: 1.5px dashed var(--line); border-radius: 8px;
  color: var(--ink-2); cursor: pointer; font-size: 13.5px; background: #fafbfd;
  transition: border-color .2s ease, color .2s ease;
}
.notice-attach-add:hover { border-color: var(--accent); color: var(--accent); }
.notice-attach-add svg { color: var(--accent); }

/* 네이버 블로그형 본문 에디터 */
.notice-editor-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.notice-editor-imgbtn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border-radius: 8px;
  border: 1px solid var(--accent); background: color-mix(in oklab, var(--accent) 8%, #fff);
  color: var(--accent); font-size: 13.5px; font-weight: 600; cursor: pointer;
  flex: 0 0 auto;
}
.notice-editor-imgbtn:hover { background: color-mix(in oklab, var(--accent) 16%, #fff); }
.notice-editor-hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; flex: 1; min-width: 180px; }
.notice-editor {
  min-height: 240px;
  max-height: 480px;
  overflow-y: auto;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px; line-height: 1.8; color: var(--ink);
  background: #fff;
  outline: none;
}
.notice-editor:focus { border-color: var(--accent); }
.notice-editor:empty::before { content: attr(data-placeholder); color: var(--ink-3); }
.notice-editor img {
  max-width: 100%; height: auto;
  border-radius: 8px;
  margin: 10px 0;
  display: block;
}

/* 상세 — 리치 본문 */
.notice-detail-rich { font-size: 15.5px; line-height: 1.85; color: var(--ink-2); word-break: keep-all; }
.notice-detail-rich img {
  max-width: 100%; height: auto;
  border-radius: 10px;
  margin: 14px auto;
  display: block;
}

.notice-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.notice-count {
  font-size: 14px;
  color: var(--ink-2);
}
.notice-count b { color: var(--accent); }
.notice-write-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.notice-write-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); background: color-mix(in oklab, var(--accent) 88%, #000); }

/* 테이블형 목록 */
.notice-table {
  border-top: 2px solid var(--ink);
}
.notice-row {
  display: grid;
  grid-template-columns: 70px 1fr 120px 80px;
  align-items: center;
  gap: 16px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  transition: background .15s ease;
}
.notice-row:hover { background: color-mix(in oklab, var(--accent) 5%, transparent); }
.notice-row.head {
  cursor: default;
  background: var(--bg-2);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  padding: 14px 16px;
}
.notice-row.head:hover { background: var(--bg-2); }
.notice-col-no {
  text-align: center;
  font-size: 14px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.notice-col-no .pin {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 3px 9px;
  border-radius: 999px;
}
.notice-col-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.notice-col-title .t {
  font-size: 15.5px;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notice-row:hover .notice-col-title .t { color: var(--accent); }
.notice-new {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #b8493a;
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.02em;
}
.notice-has-img {
  flex: 0 0 auto;
  color: var(--ink-3);
  display: inline-flex;
}
.notice-col-date {
  text-align: center;
  font-size: 13px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.notice-col-views {
  text-align: center;
  font-size: 13px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 680px) {
  .notice-row { grid-template-columns: 44px 1fr 84px; }
  .notice-col-views { display: none; }
  .notice-row.head .notice-col-views { display: none; }
}

.notice-empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--ink-3);
  font-size: 15px;
  border-bottom: 1px solid var(--line-soft);
}

/* ── 상세 보기 모달 ─────────────────────────────────────────── */
.notice-modal {
  position: fixed; inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: color-mix(in oklab, #1a1208 78%, transparent);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.notice-modal.open { opacity: 1; pointer-events: auto; }
.notice-modal-inner {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 1040px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
  position: relative;
  transform: translateY(12px) scale(.98);
  transition: transform .25s ease;
}
.notice-modal.open .notice-modal-inner { transform: none; }
.notice-detail-head {
  padding: clamp(28px, 3.5vw, 40px) clamp(28px, 3.5vw, 40px) 22px;
  border-bottom: 1px solid var(--line-soft);
}
.notice-detail-cat {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 10%, var(--surface));
  padding: 5px 13px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.notice-detail-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 12px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  word-break: keep-all;
}
.notice-detail-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.notice-detail-body {
  padding: clamp(28px, 3.5vw, 40px);
  overflow-x: hidden;
}
/* 붙여넣은 표·이미지가 잘리지 않고 폭에 맞게 축소되도록 */
.notice-detail-body table {
  width: 100% !important;
  max-width: 100% !important;
  table-layout: fixed;
  border-collapse: collapse;
  word-break: break-word;
}
.notice-detail-body table td,
.notice-detail-body table th {
  word-break: break-word;
  white-space: normal !important;
  max-width: none !important;
}
.notice-detail-body img,
.notice-detail-body video,
.notice-detail-body iframe { max-width: 100%; height: auto; }
.notice-detail-body * { max-width: 100%; box-sizing: border-box; }
/* 붙여넣기 시 딸려온 스크롤 컨테이너 해제 */
.notice-detail-body div,
.notice-detail-body section,
.notice-detail-body figure,
.notice-detail-body td div {
  overflow-x: visible !important;
  overflow: visible !important;
  width: auto !important;
  min-width: 0 !important;
}
.notice-detail-body table { min-width: 0 !important; }

/* 모바일: 상세 모달이 화면에 꽉 차고 표·이미지가 폭에 맞게 축소 */
@media (max-width: 760px) {
  .notice-modal { padding: 12px; align-items: flex-start; }
  .notice-modal-inner { max-width: 100%; width: 100%; max-height: 92vh; margin-top: 12px; }
  .notice-detail-head, .notice-detail-body, .notice-detail-foot { padding-left: 18px; padding-right: 18px; }
  .notice-detail-title { font-size: 19px; line-height: 1.4; }
  .notice-detail-body { font-size: 15px; }
  .notice-detail-body table { font-size: 12.5px; }
  .notice-detail-body table td, .notice-detail-body table th { padding: 6px 5px !important; }
}
.notice-detail-body pre { white-space: pre-wrap; word-break: break-word; }
.notice-detail-img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 22px;
  display: block;
}
.notice-detail-text {
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--ink-2);
  white-space: pre-line;
  word-break: keep-all;
}
.notice-detail-foot {
  padding: 18px clamp(28px, 3.5vw, 40px);
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.notice-detail-delete {
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid color-mix(in oklab, #b8493a 40%, var(--line));
  background: color-mix(in oklab, #b8493a 8%, var(--surface));
  color: #b8493a;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.notice-detail-delete:hover { background: color-mix(in oklab, #b8493a 16%, var(--surface)); }
.notice-modal-close {
  position: absolute;
  top: 18px; right: 20px;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: 21px;
  cursor: pointer;
  display: grid; place-items: center;
  z-index: 2;
}
.notice-modal-close:hover { background: var(--soft); }

/* ── 글쓰기 모달 (활동앨범과 동일 톤) ───────────────────────── */
.notice-writer {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.4);
}
.notice-writer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line-soft);
}
.notice-writer-head h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin: 0;
}
.notice-writer-x {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--bg-2);
  color: var(--ink-2);
  font-size: 20px;
  cursor: pointer;
  display: grid; place-items: center;
}
.notice-writer-x:hover { background: var(--soft); }
.notice-writer-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.notice-field { display: flex; flex-direction: column; gap: 8px; }
.notice-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.notice-field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.notice-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  box-sizing: border-box;
}
.notice-input:focus { outline: none; border-color: var(--accent); }
.notice-textarea { resize: vertical; line-height: 1.6; min-height: 140px; }
.notice-upload-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px 20px;
  border: 2px dashed var(--line);
  border-radius: 12px;
  color: var(--ink-3);
  font-size: 14px;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
.notice-upload-drop:hover { border-color: var(--accent); color: var(--accent); }
.notice-upload-preview { position: relative; border-radius: 12px; overflow: hidden; }
.notice-upload-preview img { width: 100%; max-height: 240px; object-fit: cover; display: block; }
.notice-upload-remove {
  position: absolute;
  bottom: 12px; right: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 0;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.notice-writer-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 24px;
  border-top: 1px solid var(--line-soft);
}
.notice-writer-foot .btn { padding: 11px 22px; font-size: 14px; }

@media (max-width: 560px) {
  .notice-field-row { grid-template-columns: 1fr; }
}
