/* ================= 광주시립통합도서관 통합 홈페이지 스타일 ================= */
/* 미니멀 · 일관 · 접근성. 토큰/클래스명은 유지하고 값만 정교화. */
:root {
  /* Brand */
  --primary: #0e5b8a;
  --primary-dark: #0a4266;
  --primary-soft: #e9f2f9;
  --accent: #15a06e;
  --accent-dark: #0e7a52;
  --accent-soft: #e6f6ee;
  /* Ink & neutrals */
  --text: #22323f;
  --ink: #14212c;
  --muted: #5d6f7e;
  --faint: #8695a3;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --line: #eceef2;
  --line-strong: #dfe3e9;
  /* Feedback */
  --danger: #d64545;
  --danger-soft: #fdeaea;
  --danger-line: #f6cfcf;
  /* Shape */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --pill: 999px;
  /* Elevation (minimal, restrained) */
  --shadow-sm: 0 1px 2px rgba(20, 40, 60, .05);
  --shadow: 0 1px 2px rgba(20, 40, 60, .04), 0 8px 20px rgba(20, 40, 60, .06);
  --shadow-lg: 0 16px 40px rgba(20, 40, 60, .12);
  --ring: 0 0 0 3px rgba(14, 91, 138, .16);
  /* Rhythm */
  --gutter: 24px;
  --max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; color-scheme: light; }
body {
  margin: 0;
  font-family: "Pretendard Variable", "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { letter-spacing: -0.022em; color: var(--ink); text-wrap: balance; }
p { text-wrap: pretty; }
strong { font-weight: 700; }
hr { border: none; border-top: 1px solid var(--line); margin: 24px 0; }
::selection { background: var(--primary); color: #fff; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* Skip link (웹 접근성) */
.skip { position: absolute; left: -9999px; top: 0; background: var(--primary); color: #fff; padding: 10px 16px; z-index: 1000; border-radius: 0 0 8px 0; font-weight: 700; }
.skip:focus { left: 0; }

/* Focus visibility (접근성) */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(14, 91, 138, .38); outline-offset: 2px; border-radius: 6px;
}

/* ---------- Header (2단: 1행=로고+유틸 / 2행=중앙 GNB) ---------- */
.site-header { background: rgba(255,255,255,.9); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; column-gap: 20px; width: 100%; }
.brand { order: 1; display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 19px; color: var(--primary); white-space: nowrap; padding: 14px 0; flex-shrink: 0; letter-spacing: -0.03em; }
.brand .logo { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; display: grid; place-items: center; font-size: 19px; font-weight: 900; flex-shrink: 0; box-shadow: 0 2px 8px rgba(14,91,138,.28); }
.header-util { order: 2; margin-left: auto; display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.btn-util { padding: 8px 15px; border-radius: 9px; border: 1px solid var(--line-strong); font-size: 14px; font-weight: 600; color: var(--muted); background: #fff; white-space: nowrap; transition: color .16s ease, border-color .16s ease, background .16s ease; }
.btn-util:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-util.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.gnb { order: 3; flex-basis: 100%; display: flex; justify-content: space-between; align-items: center; gap: 0; border-top: 1px solid var(--line); padding: 2px 0; flex-wrap: nowrap; width: 100%; }
.gnb-item { position: relative; display: flex; align-items: center; justify-content: center; flex: 1; text-align: center; }
.gnb-item > a { display: block; width: 100%; text-align: center; padding: 11px 4px; font-weight: 700; font-size: 13.5px; letter-spacing: -0.035em; color: #0f172a; white-space: nowrap; border-bottom: 2px solid transparent; transition: color .16s ease, border-color .16s ease, background .16s ease; }
.gnb a:hover, .gnb a[aria-current="page"] { color: #0e5b8a; background: var(--primary-soft, #e0f2fe); border-bottom-color: #0e5b8a; border-radius: 6px; }
.gnb-sub { display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); min-width: 220px; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 36px rgba(0,0,0,0.12); padding: 8px; z-index: 100; text-align: left; }
.gnb-item:hover .gnb-sub, .gnb-item:focus-within .gnb-sub { display: block; }
.gnb-item:first-child .gnb-sub { left: 0; transform: none; }
.gnb-item:nth-last-child(-n+4) .gnb-sub { left: auto !important; right: 0 !important; transform: none !important; }
.gnb-sub a { padding: 8px 12px; font-size: 13.5px; font-weight: 600; color: #334155; border-bottom: none; border-radius: 6px; text-align: left; }
.gnb-sub a:hover { background: var(--primary-soft, #e0f2fe); color: var(--primary, #0e5b8a); border-bottom-color: transparent; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line-strong); border-radius: 9px; width: 44px; height: 44px; font-size: 22px; color: var(--text); cursor: pointer; flex-shrink: 0; }

/* ---------- Hero / Main banners (컴팩트 최적화) ---------- */
.hero { position: relative; background: linear-gradient(122deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; padding: 30px 0 34px; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(1100px 420px at 88% -25%, rgba(255,255,255,.16), transparent 60%); pointer-events: none; }
.hero .container { position: relative; z-index: 1; }
.hero h1 { font-size: 25px; margin: 0 0 8px; font-weight: 800; line-height: 1.24; letter-spacing: -0.035em; color: #fff; }
.hero p { margin: 0 0 16px; opacity: .92; font-size: 14.5px; }
.search-bar { display: flex; gap: 8px; max-width: 680px; background: #fff; border-radius: var(--pill); padding: 8px 8px 8px 10px; box-shadow: 0 10px 30px rgba(6, 26, 44, .22); }
.search-bar select, .search-bar input { border: none; outline: none; font-size: 16px; padding: 12px 14px; background: transparent; color: var(--text); font-family: inherit; }
.search-bar input { flex: 1; min-width: 0; }
.search-bar select { border-right: 1px solid var(--line); border-radius: 0; font-weight: 600; color: var(--primary); }
.search-bar button { background: var(--primary); color: #fff; border: none; border-radius: var(--pill); padding: 0 30px; font-weight: 700; font-size: 16px; cursor: pointer; transition: background .16s ease; }
.search-bar button:hover { background: var(--primary-dark); }
.quick-banners { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 30px; }
.quick-banners a { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); border-radius: var(--radius); padding: 18px 20px; font-weight: 700; display: flex; align-items: center; gap: 12px; transition: background .18s ease, transform .18s ease, box-shadow .18s ease; }
.quick-banners a:hover { background: rgba(255,255,255,.2); transform: translateY(-3px); box-shadow: 0 14px 28px rgba(0,0,0,.16); }
.quick-banners .ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: rgba(255,255,255,.2); font-size: 16px; flex-shrink: 0; }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section + .section { padding-top: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head h2 { position: relative; font-size: 23px; margin: 0; font-weight: 800; padding-left: 15px; letter-spacing: -0.03em; }
.section-head h2::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 4px; border-radius: 2px; background: linear-gradient(var(--primary), var(--accent)); }
.section-head a.more { color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; transition: color .15s ease; }
.section-head a.more:hover { color: var(--primary); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* Card / list */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow .18s ease, border-color .18s ease; }
.card:hover { box-shadow: var(--shadow); border-color: var(--line-strong); }
.card .card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card .card-head h3 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.card .card-head a.more { color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; transition: color .15s ease; }
.card .card-head a.more:hover { color: var(--primary); }
.post-list { list-style: none; margin: 0; padding: 6px 0; }
.post-list li { display: flex; align-items: center; gap: 10px; padding: 12px 22px; border-bottom: 1px solid var(--line); transition: background .13s ease; }
.post-list li:last-child { border-bottom: none; }
.post-list li:hover { background: var(--primary-soft); }
.post-list .title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; min-width: 0; }
.post-list li:hover .title { color: var(--primary); }
.post-list .date { color: var(--faint); font-size: 13px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: var(--pill); background: var(--primary-soft); color: var(--primary); flex-shrink: 0; letter-spacing: .02em; white-space: nowrap; line-height: 1.5; }
.badge.notice { background: var(--danger-soft); color: var(--danger); }
.badge.event { background: var(--accent-soft); color: var(--accent-dark); }
.badge.ok { background: var(--accent-soft); color: var(--accent-dark); }
.badge.no { background: var(--danger-soft); color: var(--danger); }

/* Library grid */
.lib-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.lib-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; box-shadow: var(--shadow-sm); }
.lib-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.lib-card .lib-ico { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, var(--accent), var(--primary)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 19px; margin-bottom: 14px; box-shadow: 0 3px 10px rgba(14,91,138,.22); }
.lib-card h4 { margin: 0 0 5px; font-size: 16px; font-weight: 700; }
.lib-card p { margin: 0; color: var(--muted); font-size: 13px; }

/* Event cards */
.event-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.event-card { display: flex; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.event-card:hover { box-shadow: var(--shadow); border-color: var(--line-strong); transform: translateY(-2px); }
.event-date { flex-shrink: 0; width: 64px; text-align: center; background: var(--primary-soft); border: 1px solid var(--line); border-radius: 12px; padding: 10px 0; align-self: flex-start; }
.event-date .m { font-size: 12px; color: var(--muted); font-weight: 600; }
.event-date .d { font-size: 26px; font-weight: 800; color: var(--primary); line-height: 1.1; font-variant-numeric: tabular-nums; }
.event-card .info { min-width: 0; }
.event-card .info h4 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.event-card .info h4 a:hover { color: var(--primary); }
.event-card .info p { margin: 0; color: var(--muted); font-size: 13px; }

/* Book grid / card (통합검색 · 신착/인기 · 홈 도서 카드) */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 16px; }
.book-card { position: relative; display: flex; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); color: inherit; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.book-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.book-card .rank { position: absolute; top: 10px; right: 12px; font-weight: 800; font-size: 17px; color: var(--primary); font-variant-numeric: tabular-nums; }
.book-cover { flex: 0 0 64px; width: 64px; height: 88px; border-radius: 8px; color: #fff; font-size: 11px; font-weight: 700; line-height: 1.25; padding: 8px; overflow: hidden; display: flex; align-items: flex-end; box-shadow: inset -6px 0 12px rgba(0,0,0,.18); background: var(--primary); }
.book-info { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; }
.book-title { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; }
.book-meta { font-size: 13px; color: var(--muted); }
.book-info .badge { margin-right: 4px; }

/* ---------- Footer ---------- */
.site-footer { background: #12263a; color: #b9c6d3; padding: 46px 0 34px; margin-top: 56px; }
.footer-policy { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid rgba(255,255,255,.1); font-size: 14px; }
.footer-policy a { color: #cdd8e2; }
.footer-policy a:hover { color: #fff; text-decoration: underline; }
.footer-policy strong { color: #ffd66b; font-weight: 700; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.footer-links a { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); padding: 9px 15px; border-radius: 9px; font-size: 14px; font-weight: 500; transition: background .15s ease, color .15s ease; }
.footer-links a:hover { background: rgba(255,255,255,.16); color: #fff; }
.site-footer .addr { font-size: 13px; opacity: .78; line-height: 1.9; margin: 0; }

/* ---------- Sub page ---------- */
.subpage { padding: 34px 0 60px; }
.page-title { font-size: 28px; font-weight: 800; margin: 0 0 8px; letter-spacing: -0.032em; }
.breadcrumb { color: var(--muted); font-size: 14px; margin-bottom: 26px; }
.breadcrumb a:hover { color: var(--primary); }
.board-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.board-tabs a { padding: 9px 18px; border-radius: var(--pill); border: 1px solid var(--line-strong); background: #fff; font-weight: 600; font-size: 14px; color: var(--muted); transition: color .15s ease, border-color .15s ease, background .15s ease; }
.board-tabs a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.board-tabs a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

table.board-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
table.board-table th, table.board-table td { padding: 15px 18px; text-align: left; border-bottom: 1px solid var(--line); }
table.board-table thead th { background: var(--surface-2); font-size: 13.5px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line-strong); letter-spacing: -0.01em; }
table.board-table td.num, table.board-table th.num { width: 78px; text-align: center; color: var(--faint); padding-left: 10px; padding-right: 10px; font-variant-numeric: tabular-nums; }
table.board-table td.date, table.board-table th.date { width: 130px; text-align: center; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
table.board-table td.views, table.board-table th.views { width: 80px; text-align: center; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
table.board-table tbody tr { transition: background .12s ease; }
table.board-table tbody tr:last-child td { border-bottom: none; }
table.board-table tbody tr:hover { background: var(--primary-soft); }
table.board-table a.subject { font-weight: 500; }
table.board-table a.subject:hover { color: var(--primary); font-weight: 600; }

.search-form { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 26px 0; }
.search-form input { padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); min-width: 280px; font-size: 15px; font-family: inherit; transition: border-color .15s ease, box-shadow .15s ease; }
.search-form input:focus { border-color: var(--primary); outline: none; box-shadow: var(--ring); }
.search-form button { padding: 12px 24px; background: var(--primary); color: #fff; border: none; border-radius: var(--radius-sm); font-weight: 700; cursor: pointer; transition: background .15s ease; }
.search-form button:hover { background: var(--primary-dark); }

.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 30px; }
.pagination a, .pagination span { min-width: 40px; height: 40px; padding: 0 6px; display: grid; place-items: center; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: #fff; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; transition: color .14s ease, border-color .14s ease, background .14s ease; }
.pagination a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.pagination .cur { background: var(--primary); color: #fff; border-color: var(--primary); }

.post-view { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.post-view .pv-head { padding: 28px 30px; border-bottom: 1px solid var(--line); background: var(--surface); }
.post-view .pv-head h1 { font-size: 24px; margin: 0 0 12px; font-weight: 800; line-height: 1.35; }
.post-view .pv-meta { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 18px; }
.post-view .pv-body { padding: 34px 30px; min-height: 220px; white-space: pre-wrap; line-height: 1.85; }
.post-view .pv-foot { padding: 16px 30px; border-top: 1px solid var(--line); background: var(--surface-2); }
.post-view .pv-foot a:hover { color: var(--primary); text-decoration: underline; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 20px; border-radius: var(--radius-sm); font-weight: 700; font-size: 15px; line-height: 1.2; cursor: pointer; border: 1px solid var(--line-strong); background: #fff; color: var(--text); white-space: nowrap; transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease; }
.btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-dark); color: #fff; }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.accent:hover { background: var(--accent-dark); color: #fff; }
.btn.danger { color: var(--danger); border-color: var(--danger-line); background: #fff; }
.btn.danger:hover { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn.sm { padding: 7px 14px; font-size: 13.5px; border-radius: 9px; gap: 5px; }
.btn.lg { padding: 14px 26px; font-size: 16px; border-radius: 12px; }
.btn.full { display: flex; width: 100%; }

.placeholder-box { background: var(--surface); border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 64px 24px; text-align: center; color: var(--muted); }
.placeholder-box .big { font-size: 44px; margin-bottom: 14px; }

/* ---------- Popups ---------- */
.popup { position: fixed; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; z-index: 500; border: 1px solid var(--line); }
.popup .p-body { padding: 24px; min-height: 120px; background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft)); }
.popup .p-body h4 { margin: 0 0 8px; color: var(--primary); font-size: 18px; font-weight: 800; }
.popup .p-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.popup .p-foot a { cursor: pointer; transition: color .14s ease; }
.popup .p-foot a:hover { color: var(--primary); }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .lib-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .container { padding: 0 18px; }
  .grid-2 { grid-template-columns: 1fr; }
  .lib-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-banners { grid-template-columns: repeat(2, 1fr); }
  .event-grid { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 54px; }
  .hero h1 { font-size: 28px; }
  .section { padding: 42px 0; }
  .gnb { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px; gap: 2px; box-shadow: var(--shadow-lg); z-index: 90; }
  .gnb.open { display: flex; }
  .gnb a { border-bottom: none; border-radius: 9px; padding: 13px 16px; }
  .gnb a:hover, .gnb a[aria-current="page"] { background: var(--primary-soft); border-bottom: none; }
  .gnb-item { position: static; flex-direction: column; }
  .gnb-item > a { font-weight: 700; }
  .gnb-sub { display: flex; position: static; transform: none; min-width: 0; border: none; border-radius: 0; box-shadow: none; padding: 0 0 6px 14px; }
  .gnb-sub a { padding: 9px 14px; }
  .nav-toggle { display: block; }
  .header-util .btn-util.hide-m { display: none; }
  .popup { display: none !important; }
}
@media (max-width: 560px) {
  .lib-grid { grid-template-columns: 1fr 1fr; }
  .quick-banners { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 24px; }
  .hero p { font-size: 15.5px; }
  .page-title { font-size: 23px; }
  .book-grid { grid-template-columns: 1fr; }
  .search-form input { min-width: 0; flex: 1; }
  table.board-table td.views, table.board-table th.views { display: none; }
  table.board-table th, table.board-table td { padding: 12px 12px; }
  .post-view .pv-head, .post-view .pv-body, .post-view .pv-foot { padding-left: 20px; padding-right: 20px; }
}

/* ---------- Auth forms / Member card ---------- */
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }
.auth-card .form-row { margin-bottom: 18px; }
.auth-card label { display: block; font-weight: 700; margin-bottom: 7px; font-size: 14px; }
.auth-card input[type=text], .auth-card input[type=password], .auth-card input[type=date] {
  width: 100%; padding: 12px 13px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-size: 15px; font-family: inherit; transition: border-color .15s ease, box-shadow .15s ease; }
.auth-card input[type=text]:focus, .auth-card input[type=password]:focus, .auth-card input[type=date]:focus { border-color: var(--primary); outline: none; box-shadow: var(--ring); }
.auth-card .check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.auth-card .req { color: var(--danger); }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; }
.alert.error { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-line); }
.alert.ok { background: var(--accent-soft); color: var(--accent-dark); border: 1px solid #c7ebd8; }

.member-card { background: linear-gradient(150deg, var(--primary), var(--accent-dark)); color: #fff; border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-lg); text-align: center; }
.member-card .mc-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; opacity: .95; }
.member-card .mc-type { background: rgba(255,255,255,.2); padding: 4px 11px; border-radius: var(--pill); font-weight: 700; }
.member-card .mc-name { font-size: 27px; font-weight: 800; margin: 14px 0 18px; }
.member-card .mc-qr { background: #fff; display: inline-block; padding: 12px; border-radius: 12px; }
.member-card .mc-qr img { display: block; }
.member-card .mc-barcode { background: #fff; border-radius: 10px; padding: 10px; margin-top: 16px; }
.member-card .mc-barcode img { width: 100%; height: auto; display: block; }
.member-card .mc-no { letter-spacing: 3px; font-weight: 700; margin-top: 12px; font-size: 16px; font-variant-numeric: tabular-nums; }

/* ---------- Motion preferences (접근성) ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ===================================================================
   공공도서관 톤 정리 — 플랫 · 단색 · 절제 (AI풍 장식 제거)
   =================================================================== */
:root { --radius: 8px; --radius-sm: 6px; --radius-lg: 10px; --pill: 8px; }
.site-header { background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; }
.brand .logo { background: var(--primary); box-shadow: none; }
.hero { background: var(--primary-dark); }
.hero::after { display: none; }
.hero-eyebrow { display: none; }
.section-head h2::before { background: var(--primary); }
.event-date { background: var(--primary-soft); }
.card:hover, .lib-card:hover, .event-card:hover, .book-card:hover,
.quick-banners a:hover, .board-tabs a:hover, .cat-tabs a:hover { transform: none; }
.lib-card:hover, .event-card:hover, .book-card:hover { box-shadow: var(--shadow-sm); }
.quick-banners a:hover { box-shadow: none; }
.ico:empty, .lib-ico:empty, .stat-ico:empty { display: none; }
.quick-banners .ico { display: none; }
.search-bar { border-radius: 8px; }
.search-bar button, .btn, .btn-util { border-radius: 6px; }
.board-tabs a, .cat-tabs a, .search-form input, .search-form button,
.pagination a, .pagination span { border-radius: 6px; }
.badge, .tag, .ext-src { border-radius: 4px; }
.nav-toggle::before { content: "\2261"; font-size: 24px; line-height: 1; }
/* 이모지 제거로 비어버린 장식 아이콘 상자 숨김 */
[class*="ico"]:empty, [class*="-n"]:empty { display: none !important; }

/* ===================================================================
   관공서 실사이트 톤 — 밀집 · 각진 모서리 · 절제색 (AI 기본형 탈피)
   =================================================================== */
:root {
  --primary: #123a6b; --primary-dark: #0e2b50; --primary-soft: #eef2f8;
  --radius: 3px; --radius-sm: 3px; --radius-lg: 4px; --pill: 3px;
}
body { font-size: 15px; line-height: 1.55; }
h1, h2, h3, h4 { text-wrap: initial; }
.card, .btn, .btn-util, .search-bar, .board-tabs a, .cat-tabs a,
.badge, .tag, .pagination a, .pagination span, .lib-card,
.auth-card, .post-view, table.board-table, .book-card, .placeholder-box {
  border-radius: 3px !important;
}
.card, .lib-card, table.board-table { box-shadow: none; }
.card:hover, .lib-card:hover { box-shadow: none; }
.page-title { font-size: 24px; }
.section { padding: 34px 0; }
/* 상단 유틸리티 바 */
.util-bar { background: #f0f2f5; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.util-bar .container { display: flex; justify-content: flex-end; align-items: center; gap: 4px; height: 34px; }
.util-bar a, .util-bar form button { color: var(--muted); padding: 0 10px; font-weight: 500; background: none; border: none; cursor: pointer; font-family: inherit; font-size: 12.5px; }
.util-bar a + a, .util-bar span + a { border-left: 1px solid var(--line-strong); }
.util-bar a:hover, .util-bar button:hover { color: var(--primary); }

/* 헤딩 색을 문맥 상속으로 — 어두운 배경 위 제목이 같은 남색이라 안 보이던 문제 수정 */
h1, h2, h3, h4 { color: inherit; }

/* ===================================================================
   서브페이지 인트로 통일 — 색 밴드 제거, 전 페이지 동일한 플레인 헤더
   (밝은 그라디언트가 남색으로 치환돼 글자가 안 보이던 문제도 함께 해결)
   =================================================================== */
.evx-intro, .survey-intro, .mrt-hero {
  background: none !important; border: none !important; box-shadow: none !important;
  padding: 0 !important; border-radius: 0 !important; margin: 0 0 24px !important; color: var(--text) !important;
}
.mrt-hero::before, .mrt-hero::after { display: none !important; }
.evx-intro .page-title, .survey-intro .page-title,
.mrt-hero h1, .mrt-hero h2, .mrt-hero h3 { color: var(--ink) !important; }
.evx-lead, .survey-intro p, .mrt-hero p { color: var(--muted) !important; opacity: 1 !important; }
/* 밴드 안 통계/버튼을 밝은 배경에 맞게 */
.mrt-hero-stats { border-top: 1px solid var(--line) !important; }
.mrt-hero-stats strong { color: var(--primary) !important; }
.mrt-hero-stats span { color: var(--muted) !important; opacity: 1 !important; }
.mrt-hero-actions a, .mrt-hero-actions .btn { background: var(--primary) !important; color: #fff !important; border: 1px solid var(--primary) !important; }
.mrt-hero-actions a:nth-child(2), .mrt-hero-actions .btn.ghost { background: #fff !important; color: var(--primary) !important; }
/* 마라톤 상단 배지(2026 독서마라톤) 밝은 배경용 */
.mrt-hero .mrt-eyebrow, .mrt-hero [class*="eyebrow"], .mrt-hero [class*="badge"] {
  background: var(--primary-soft) !important; color: var(--primary) !important; border: 1px solid var(--line-strong) !important;
}

/* 페이지 간 화면 폭 흔들림 방지 — 짧은 페이지도 스크롤바 자리 고정 */
html { overflow-y: scroll; }
/* 헤더 통합검색 박스(메뉴 '자료검색'과 구분되는 빠른검색) */
.hdr-search { display: flex; align-items: center; height: 40px; border: 1px solid var(--line-strong); border-radius: 4px; overflow: hidden; background: #fff; }
.hdr-search input { border: none; outline: none; padding: 0 12px; font-size: 14px; width: 190px; background: transparent; color: var(--text); }
.hdr-search button { border: none; background: var(--primary); color: #fff; font-weight: 600; padding: 0 16px; height: 100%; cursor: pointer; font-size: 14px; white-space: nowrap; }
.hdr-search button:hover { background: var(--primary-dark); }

/* 헤더 레이아웃: 로고+유틸 1행, GNB 2행 중앙 정렬 (가로 오버플로우 및 우측 삐져나옴 완벽 방지) */
@media (min-width: 901px) {
  .header-inner { flex-wrap: wrap !important; align-items: center; justify-content: space-between; column-gap: 20px; width: 100%; box-sizing: border-box; }
  .brand { order: 1 !important; flex-shrink: 0; padding: 12px 0 !important; }
  .header-util { order: 2 !important; flex-shrink: 0; margin-left: auto !important; display: flex; align-items: center; gap: 6px; }
  .header-util span { display: inline-flex; align-items: center; }
  .header-util a, .header-util button[type=submit] { color: var(--muted); font-size: 13px; font-weight: 600; padding: 5px 10px; background: none; border: none; cursor: pointer; font-family: inherit; white-space: nowrap; }
  .header-util a:hover, .header-util button[type=submit]:hover { color: var(--primary); }
  .gnb { order: 3 !important; flex-basis: 100% !important; flex-grow: 1; margin: 0 !important; justify-content: space-between !important; border-top: 1px solid var(--line) !important; gap: 0 !important; flex-wrap: nowrap !important; width: 100% !important; }
  .gnb-item { flex: 1 !important; }
  .gnb-item > a { padding: 11px 4px !important; font-size: 13.5px !important; letter-spacing: -0.035em !important; text-align: center !important; }
}

/* 우측 드롭다운 서브메뉴 화면 밖 튀어나옴 방지 */
.gnb-item:nth-last-child(-n+3) .gnb-sub {
  left: auto !important;
  right: 0 !important;
  transform: none !important;
}

/* 전체 컨테이너 가로 오버플로우 방지 */
html, body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
/* ===== 서브페이지 비주얼 히어로 배너 (A영역) ===== */
.subpage-visual-hero {
    position: relative;
    width: 100%;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.subpage-visual-hero h1 {
    font-size: 26px;
    font-weight: 900;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.03em;
}
.subpage {
    padding-top: 24px;
    padding-bottom: 48px;
    min-height: 60vh;
}
/* breadcrumb를 제목 바로 오른쪽에 (먼 우측 아님) */
.pt-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; }
.pt-row .page-title { margin: 0; font-size: 22px; font-weight: 800; color: #0f172a; }
.pt-row .breadcrumb { margin: 0; font-size: 13px; color: var(--muted, #475569); }

/* ===== 알림 뱃지(헤더) ===== */
.noti-bell { position: relative; }
.noti-badge {
    position: absolute; top: -7px; right: -12px;
    min-width: 16px; height: 16px; padding: 0 4px;
    background: #d64545; color: #fff; font-size: 10px; font-weight: 800;
    line-height: 16px; text-align: center; border-radius: 999px;
}

/* ===== 다국어 스위처 ===== */
.lang-switch { display: inline-flex; gap: 6px; margin-left: 10px; font-size: 12px; }
.lang-switch a { color: var(--muted); }
.lang-switch a:hover { color: var(--primary); }

/* ===== 웹접근성: 키보드 포커스 가시화(WCAG 2.4.7) ===== */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
    outline: 3px solid #ffbf47;
    outline-offset: 2px;
}

/* ========================================================================= */
/* 📱 스마트폰 모바일 극강 최적화 (Mobile Responsive System for Smartphones) */
/* ========================================================================= */
@media (max-width: 768px) {
    /* 1. 컨테이너 & 사이드바 반응형 재배치 */
    .container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    .has-sidebar-left, .has-sidebar-right {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }
    .home-sidebar {
        width: 100% !important;
        order: 2 !important;
    }
    .home-main-blocks {
        width: 100% !important;
        order: 1 !important;
    }

    /* 2. 히어로 배너 스마트폰 최적화 */
    .mv-main {
        padding: 24px 16px !important;
    }
    .mv-eyebrow {
        font-size: 11.5px !important;
        margin-bottom: 6px !important;
    }
    .mv-title {
        font-size: 20px !important;
        line-height: 1.35 !important;
        margin-bottom: 12px !important;
    }
    .mv-keywords {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        font-size: 11.5px !important;
    }
    .mv-keywords a {
        padding: 3px 8px !important;
        font-size: 11.5px !important;
    }
    .mv-stats {
        flex-wrap: wrap !important;
        gap: 8px !important;
        font-size: 11.5px !important;
    }

    /* 3. 통합 검색창 스마트폰 터치 최적화 */
    .mv-search {
        flex-direction: column !important;
        gap: 8px !important;
    }
    .mv-search select {
        width: 100% !important;
        height: 44px !important;
        font-size: 13.5px !important;
    }
    .mv-search input {
        width: 100% !important;
        height: 44px !important;
        font-size: 14px !important;
    }
    .mv-search button {
        width: 100% !important;
        height: 44px !important;
        font-size: 15px !important;
    }
    .mv-sub {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        font-size: 12px !important;
    }

    /* 4. 섹션 박스 및 그리드 모바일 재배치 */
    .home-sec {
        padding: 16px 14px !important;
        margin-bottom: 16px !important;
    }
    .sec-hd {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
    }
    .sec-hd h2 {
        font-size: 16px !important;
    }

    /* 5. GNB 헤더 모바일 스크롤 */
    .gnb {
        overflow-x: auto !important;
        white-space: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        justify-content: flex-start !important;
        padding: 6px 0 !important;
    }
    .gnb a {
        padding: 8px 12px !important;
        font-size: 13px !important;
    }

    /* 6. 공지/행사 분할판 모바일 1열 전환 */
    .notice-event-split {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 13.5px !important;
    }
    .mv-title {
        font-size: 18px !important;
    }
    .btn {
        min-height: 42px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

