:root {
  --navy-950: #041226;
  --navy-900: #071d3b;
  --navy-800: #0d2d55;
  --blue-600: #215fda;
  --blue-100: #e9f0ff;
  --red-600: #d92f49;
  --ink: #0c1a2d;
  --muted: #5e6c80;
  --line: #dce4ef;
  --surface: #ffffff;
  --soft: #f4f7fb;
  --shadow: 0 18px 45px rgba(4, 18, 38, .1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: #f7f9fc;
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 9px 13px;
  color: #fff;
  background: var(--navy-900);
  border-radius: 8px;
  transform: translateY(-150%);
}

.skip-link:focus { transform: none; }

.service-strip {
  padding: 9px 20px;
  color: #fff;
  background: var(--red-600);
  text-align: center;
  font-size: .88rem;
  font-weight: 700;
}

.page-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(14px);
}

.header-inner {
  width: min(1120px, calc(100% - 40px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  color: var(--navy-900);
  text-decoration: none;
}

.brand strong,
.brand small { display: block; }
.brand strong { font-size: 1.05rem; letter-spacing: -.03em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: .72rem; }

.header-actions { display: flex; align-items: center; gap: 10px; }

.header-logo { width: 74px; height: 48px; object-fit: contain; }

.nav-link,
.admin-link,
.back-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--navy-900);
  background: #fff;
  font-size: .9rem;
  font-weight: 800;
  text-decoration: none;
}

.admin-link { color: #fff; border-color: var(--navy-900); background: var(--navy-900); }

.board-hero {
  color: #fff;
  background:
    radial-gradient(circle at 85% 20%, rgba(61,116,226,.38), transparent 30%),
    linear-gradient(135deg, var(--navy-950), var(--navy-800));
}

.board-hero-inner {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 68px 0 62px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #adc7f8;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.board-hero h1 {
  margin: 0;
  font-size: clamp(2.3rem, 6vw, 4.4rem);
  line-height: 1.1;
  letter-spacing: -.055em;
}

.board-hero p:last-child { max-width: 690px; margin: 18px 0 0; color: #d7e4fa; }

.board-wrap {
  width: min(1120px, calc(100% - 40px));
  margin: 52px auto 90px;
}

.board-panel,
.detail-panel,
.admin-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.board-toolbar {
  min-height: 72px;
  padding: 15px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.board-toolbar p { margin: 0; color: var(--muted); font-size: .9rem; }
.board-toolbar strong { color: var(--blue-600); }

.notice-table { width: 100%; border-collapse: collapse; }
.notice-table th {
  padding: 15px 18px;
  color: var(--muted);
  background: var(--soft);
  font-size: .78rem;
  text-align: left;
}
.notice-table th:first-child,
.notice-table td:first-child { width: 90px; text-align: center; }
.notice-table th:last-child,
.notice-table td:last-child { width: 150px; text-align: center; }
.notice-table td { padding: 18px; border-top: 1px solid var(--line); }
.notice-table tbody tr:first-child td { border-top: 0; }
.notice-title { color: var(--navy-900); font-weight: 800; text-decoration: none; }
.notice-title:hover { color: var(--blue-600); text-decoration: underline; }
.notice-number,
.notice-date { color: var(--muted); font-size: .88rem; }

.board-state { padding: 44px 20px; color: var(--muted); text-align: center; }

.detail-panel { padding: 34px; }
.detail-header { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.detail-header h2 { margin: 14px 0 10px; color: var(--navy-900); font-size: clamp(1.6rem, 4vw, 2.35rem); line-height: 1.3; }
.detail-meta { margin: 0; color: var(--muted); font-size: .9rem; }
.detail-content { min-height: 190px; padding: 30px 0; white-space: pre-wrap; word-break: break-word; }
.detail-image-gallery {
  padding: 30px 0 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.detail-image-gallery:not([hidden]) + .detail-content { padding-top: 22px; }
.detail-image-gallery[data-count="1"] { grid-template-columns: minmax(0, 760px); }
.detail-image-link {
  overflow: hidden;
  display: block;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--soft);
}
.detail-image-link img { width: 100%; max-height: 760px; display: block; object-fit: contain; }

.admin-main { width: min(920px, calc(100% - 40px)); margin: 48px auto 90px; }
.admin-card { padding: 30px; }
.admin-card + .admin-card { margin-top: 22px; }
.admin-card h1,
.admin-card h2 { margin: 0 0 8px; color: var(--navy-900); letter-spacing: -.035em; }
.admin-card > p { margin: 0 0 24px; color: var(--muted); }

.field { margin-top: 18px; }
.field label { display: block; margin-bottom: 7px; color: var(--navy-900); font-size: .9rem; font-weight: 800; }
.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cbd6e5;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
}
.field textarea { min-height: 260px; resize: vertical; line-height: 1.7; }
.field input:focus,
.field textarea:focus { outline: 3px solid rgba(33,95,218,.18); border-color: var(--blue-600); }
.optional-label {
  margin-left: 4px;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}
.field-help { margin: 7px 0 0; color: var(--muted); font-size: .84rem; }
.file-input { padding: 10px !important; }
.file-input::file-selector-button {
  min-height: 36px;
  margin-right: 10px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--navy-900);
  background: var(--soft);
  font-weight: 800;
  cursor: pointer;
}
.image-preview-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.image-preview-item {
  position: relative;
  overflow: hidden;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}
.image-preview-item img { width: 100%; height: 150px; display: block; object-fit: cover; }
.image-preview-item button {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 34px;
  padding: 5px 10px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: rgba(4,18,38,.88);
  font-size: .78rem;
  font-weight: 800;
}
.image-preview-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  background: rgba(4,18,38,.8);
  font-size: .72rem;
  font-weight: 800;
}
.photo-count {
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--blue-600);
  background: var(--blue-100);
  font-size: .72rem;
  font-weight: 800;
  vertical-align: middle;
  white-space: nowrap;
}

.form-actions { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; }
.primary-button,
.secondary-button,
.danger-button {
  min-height: 44px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 800;
}
.primary-button { color: #fff; background: var(--blue-600); }
.secondary-button { color: var(--navy-900); border-color: var(--line); background: #fff; }
.danger-button { color: #9a1f32; border-color: #f0c7ce; background: #fff4f6; }
.primary-button:disabled { opacity: .55; cursor: wait; }

.message { min-height: 24px; margin: 14px 0 0; font-size: .9rem; }
.message.error { color: #b4233b; }
.message.success { color: #197340; }

.manage-list { margin-top: 20px; border-top: 1px solid var(--line); }
.manage-item { padding: 17px 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.manage-copy { min-width: 0; }
.manage-copy strong { display: block; overflow: hidden; color: var(--navy-900); text-overflow: ellipsis; white-space: nowrap; }
.manage-copy small { color: var(--muted); }
.manage-actions { flex: none; display: flex; gap: 7px; }
.manage-actions button { min-height: 36px; padding: 6px 11px; font-size: .82rem; }

.site-footer { padding: 25px 20px; color: #cbd8ec; background: var(--navy-950); text-align: center; font-size: .85rem; }
[hidden] { display: none !important; }

.compact-language-toggle {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
}
.compact-language-toggle button {
  min-width: 38px;
  min-height: 34px;
  padding: 5px 9px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: .78rem;
  font-weight: 900;
}
.compact-language-toggle button[aria-pressed="true"] { color: #fff; background: var(--navy-900); }

.calendar-hero .board-hero-inner { padding-block: 50px; }
.calendar-wrap { width: min(1500px, calc(100% - 40px)); margin: 42px auto 90px; }
.calendar-panel,
.calendar-detail {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}
.calendar-toolbar {
  min-height: 82px;
  padding: 16px 22px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}
.calendar-toolbar h2 { margin: 0; color: var(--navy-900); font-size: clamp(1.35rem, 3vw, 2rem); letter-spacing: -.04em; text-align: center; }
.calendar-navigation { display: flex; align-items: center; gap: 7px; }
.calendar-nav-button,
.calendar-today-button,
.admin-calendar-link {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--navy-900);
  background: #fff;
  font-weight: 800;
}
.calendar-nav-button { width: 40px; padding: 0; font-size: 1.45rem; line-height: 1; }
.calendar-today-button { padding: 7px 14px; }
.admin-calendar-link { justify-self: end; padding: 7px 14px; display: inline-flex; align-items: center; text-decoration: none; }
.calendar-nav-button:hover,
.calendar-today-button:hover,
.admin-calendar-link:hover { border-color: var(--blue-600); color: var(--blue-600); }
.calendar-legend { padding: 12px 22px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 18px; border-bottom: 1px solid var(--line); background: var(--soft); }
.calendar-legend span { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .78rem; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; }
.legend-dot.association { background: #087f73; }
.legend-dot.community { background: #1687c9; }
.legend-dot.education { background: #7b55c7; }
.legend-dot.facility { background: #d47a13; }
.legend-dot.holiday { background: #d52a3e; }
.calendar-state { padding: 70px 20px; color: var(--muted); text-align: center; }
.calendar-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
.month-calendar { min-width: 980px; }
.calendar-weekdays,
.calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays > div {
  padding: 12px 10px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: #fbfcfe;
  font-size: .78rem;
  font-weight: 900;
  text-align: center;
}
.calendar-weekdays > div:last-child { border-right: 0; }
.calendar-weekdays .sunday { color: #c4263d; }
.calendar-weekdays .saturday { color: #245dc1; }
.calendar-day {
  position: relative;
  min-height: 150px;
  padding: 10px 9px 12px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: #fff;
}
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.outside-month { background: #f9fafc; }
.calendar-day-number { display: flex; min-height: 27px; align-items: center; gap: 6px; color: var(--ink); font-size: .82rem; font-weight: 900; }
.calendar-day.sunday .calendar-day-number { color: #c4263d; }
.calendar-day.saturday .calendar-day-number { color: #245dc1; }
.calendar-day.outside-month .calendar-day-number { color: #a4adba; }
.calendar-day.is-today { box-shadow: inset 0 0 0 2px var(--blue-600); }
.today-mark { padding: 2px 6px; border-radius: 999px; color: #fff; background: var(--blue-600); font-size: .62rem; }
.calendar-event-list { display: grid; gap: 5px; }
.calendar-event {
  width: 100%;
  min-height: 28px;
  overflow: hidden;
  padding: 4px 8px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  font-size: .75rem;
  font-weight: 800;
  line-height: 1.35;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-event:hover { filter: brightness(.92); }
.calendar-event.association,
.calendar-detail-category.association { background: #087f73; }
.calendar-event.community,
.calendar-detail-category.community { background: #1687c9; }
.calendar-event.education,
.calendar-detail-category.education { background: #7b55c7; }
.calendar-event.facility,
.calendar-detail-category.facility { background: #d47a13; }
.calendar-event.holiday,
.calendar-detail-category.holiday { background: #d52a3e; }
.calendar-more { padding-left: 5px; color: var(--muted); font-size: .72rem; font-weight: 800; }
.calendar-detail { position: relative; margin-top: 22px; padding: 28px 30px; }
.calendar-detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.calendar-detail-category { padding: 5px 10px; border-radius: 999px; color: #fff; font-size: .75rem; font-weight: 900; }
.calendar-detail-close { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: #fff; font-size: 1.4rem; }
.calendar-detail h2 { margin: 15px 0 17px; color: var(--navy-900); font-size: clamp(1.45rem, 4vw, 2.2rem); letter-spacing: -.04em; }
.calendar-detail dl { margin: 0; display: grid; gap: 9px; }
.calendar-detail dl > div { display: grid; grid-template-columns: 70px 1fr; gap: 12px; }
.calendar-detail dt { color: var(--muted); font-size: .88rem; font-weight: 800; }
.calendar-detail dd { margin: 0; color: var(--ink); font-weight: 700; }
.calendar-detail > p { margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--line); white-space: pre-wrap; }
.calendar-note { margin: 16px 4px 0; color: var(--muted); font-size: .85rem; }

.admin-tabs { margin-bottom: 22px; display: flex; gap: 8px; }
.admin-tabs > .secondary-button { margin-left: auto; }
.admin-tab {
  min-height: 44px;
  padding: 8px 17px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--navy-900);
  background: #fff;
  font-weight: 900;
}
.admin-tab[aria-selected="true"] { color: #fff; border-color: var(--navy-900); background: var(--navy-900); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.field select {
  width: 100%;
  min-height: 50px;
  padding: 11px 14px;
  border: 1px solid #cbd6e5;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
}
.field select:focus { outline: 3px solid rgba(33,95,218,.18); border-color: var(--blue-600); }
.field textarea.event-description { min-height: 130px; }
.manage-category { display: inline-block; margin-right: 7px; padding: 2px 7px; border-radius: 999px; color: #fff; font-size: .68rem; font-weight: 900; vertical-align: 1px; }
.manage-category.association { background: #087f73; }
.manage-category.community { background: #1687c9; }
.manage-category.education { background: #7b55c7; }
.manage-category.facility { background: #d47a13; }
.manage-category.holiday { background: #d52a3e; }

@media (max-width: 680px) {
  .header-inner { width: min(100% - 28px, 1120px); min-height: 68px; }
  .header-logo { width: 56px; }
  .nav-link { display: none; }
  .board-hero-inner { width: min(100% - 28px, 1120px); padding: 48px 0; }
  .board-wrap,
  .admin-main { width: min(100% - 28px, 1120px); margin-top: 32px; }
  .board-toolbar { align-items: flex-start; }
  .notice-table thead { display: none; }
  .notice-table,
  .notice-table tbody,
  .notice-table tr,
  .notice-table td { display: block; width: 100% !important; text-align: left !important; }
  .notice-table tr { position: relative; padding: 16px 18px; border-top: 1px solid var(--line); }
  .notice-table tbody tr:first-child { border-top: 0; }
  .notice-table td { padding: 2px 0; border: 0; }
  .notice-table td:first-child { display: none; }
  .notice-table td:last-child { margin-top: 5px; }
  .detail-panel,
  .admin-card { padding: 23px 20px; }
  .detail-image-gallery,
  .image-preview-grid { grid-template-columns: 1fr; }
  .image-preview-item,
  .image-preview-item img { min-height: 190px; height: 190px; }
  .manage-item { align-items: flex-start; flex-direction: column; }
  .compact-language-toggle { display: none; }
  .calendar-wrap { width: min(100% - 20px, 1500px); margin-top: 24px; }
  .calendar-toolbar { padding: 14px; grid-template-columns: 1fr auto; }
  .calendar-toolbar h2 { grid-column: 1 / -1; grid-row: 1; }
  .calendar-navigation { grid-column: 1; grid-row: 2; }
  .admin-calendar-link { grid-column: 2; grid-row: 2; font-size: .78rem; }
  .calendar-legend { justify-content: flex-start; padding-inline: 14px; }
  .calendar-detail { padding: 22px 20px; }
  .field-grid { grid-template-columns: 1fr; }
  .admin-tabs { flex-wrap: wrap; }
  .admin-tabs > .secondary-button { width: 100%; margin-left: 0; }
}
