/* 올공 출석부 페이지 레이아웃과 섹션별 스타일 */

html { scroll-behavior: smooth; }

@keyframes flagPan { 0%, 100% { background-position: center 22%; } 50% { background-position: center 38%; } }
@keyframes wiggle { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes popIn { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
@keyframes spinSlow { to { transform: rotate(360deg); } }

/* — 지면 공통 — */
.sheet { max-width: 1160px; margin: 0 auto; padding-inline: 40px; }
.kicker {
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-neutral-700); margin-bottom: 14px;
}
.display { font-size: clamp(32px, 4vw, 48px); font-weight: 700; line-height: 1.1; margin: 0 0 20px; }
.lede { font-size: 16px; line-height: 1.7; max-width: 58ch; margin: 0 0 10px; }
.fine-print { font-size: 13.5px; color: var(--color-neutral-700); margin: 14px 0 0; }
/* 얇고 굵은 두 줄 괘선 — 신문 1면의 유일한 칸막이 */
.rule-double { height: 5px; border-top: 2px solid var(--color-text); border-bottom: 1px solid var(--color-text); }
.rule-thin { border-top: 1px solid var(--color-text); }
.num { font-feature-settings: 'tnum' 1; }

/* — 머리기사 영역 — */
.masthead {
  position: relative;
  background-image:
    linear-gradient(color-mix(in srgb, var(--color-bg) 88%, transparent), color-mix(in srgb, var(--color-bg) 88%, transparent)),
    url('../img/header-rally.png');
  background-size: cover;
  background-position: center 30%;
  animation: flagPan 14s ease-in-out infinite;
}
.masthead > .sheet { padding-top: 48px; }
.masthead-top { display: flex; flex-direction: column; gap: 20px; margin-bottom: 24px; }
.masthead-title { display: flex; align-items: baseline; gap: 18px; flex-wrap: nowrap; min-width: 0; }
.masthead-title h1 {
  font-size: clamp(28px, 4vw, 50px); font-weight: 900; letter-spacing: -0.02em;
  margin: 0 0 0 -0.035em; white-space: nowrap;
}
.masthead-title h1:hover { animation: wiggle 0.5s ease; display: inline-block; }
.day-count {
  font-size: clamp(20px, 3vw, 34px); font-weight: 900;
  font-family: var(--font-heading); white-space: nowrap; flex-shrink: 0;
}
.masthead-nav { display: flex; gap: 24px; font-size: 14.5px; flex-wrap: wrap; }
.dateline {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 28px;
  padding: 12px 0; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-neutral-700);
}
.dateline .weather { display: inline-flex; align-items: center; gap: 5px; }
.sun { display: inline-block; animation: spinSlow 6s linear infinite; }

/* 밑줄이 자라 오르는 내비 링크 */
.nav-link { position: relative; transition: color 0.2s, transform 0.2s; }
.nav-link:hover { transform: translateY(-2px); text-decoration: none; }
.nav-link::after {
  content: ''; position: absolute; left: 0; right: 100%; bottom: -4px;
  height: 2px; background: var(--color-accent); transition: right 0.25s ease;
}
.nav-link:hover::after { right: 0; }

/* — 의원 출석부 — */
.section { padding-top: 112px; }
#roll { padding-top: 64px; }
.roll-intro {
  display: grid; grid-template-columns: 1fr 240px; gap: 56px;
  align-items: end; margin-bottom: 56px;
}
.stamp {
  position: absolute; top: -14px; right: -10px;
  background: var(--color-bg); border: 2px solid var(--color-text);
  padding: 6px 12px; font-size: 13.5px; font-weight: 700;
  box-shadow: var(--shadow-sm); animation: floaty 1.8s ease-in-out infinite;
}
.roll-list { display: flex; flex-direction: column; margin-bottom: 64px; }
.roll-row {
  display: grid; grid-template-columns: 72px 200px 1fr 90px; gap: 24px;
  align-items: center; padding: 18px 0;
}
.roll-rank { font-size: 32px; font-weight: 900; }
.roll-rank.is-king { color: var(--color-accent-2-700); }
.roll-name { display: flex; align-items: center; gap: 8px; }
.roll-name b { font-size: 19px; font-weight: 700; }
.roll-meta { font-size: 13.5px; color: var(--color-neutral-700); }

/* 결승선을 향해 달리는 트랙 */
.track { position: relative; height: 52px; border-bottom: 2px dotted var(--color-neutral-400); }
.racer {
  position: absolute; bottom: 2px; display: flex; flex-direction: column;
  align-items: center; animation: floaty 1.8s ease-in-out infinite;
}
.racer-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--color-text); background: var(--color-surface);
  display: grid; place-items: center; font-size: 17px; font-weight: 700;
}
.racer .ph-duotone { font-size: 18px; color: var(--color-accent-700); margin-top: -6px; }
.finish { position: absolute; right: 0; bottom: 8px; font-size: 24px; color: var(--color-neutral-500); }

.roll-visits { font-size: 28px; font-weight: 900; text-align: right; }
.roll-visits small { font-size: 15px; font-weight: 400; }

.cheer { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.cheer-form { display: flex; gap: 8px; }
.cheer-form .input { flex: 1; }
.cheer-btn {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  border: 1px solid var(--color-neutral-300); background: none;
  padding: 5px 16px; font: inherit; font-size: 13.5px; color: var(--color-accent-700);
  cursor: pointer; transition: transform 0.15s ease, background 0.2s ease;
}
.cheer-btn:hover { background: var(--color-accent-100); }
.cheer-btn:active { transform: scale(0.9); }
/* 최근 한 마디만 세운다 — 메시지가 쌓여도 순위표 높이가 흔들리지 않게 */
.cheer-latest { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cheer-msg {
  flex: 1; min-width: 0;
  font-size: 14px; color: var(--color-neutral-800);
  padding: 6px 12px; background: var(--color-accent-100); animation: popIn 0.35s ease;
}
.cheer-more { font-size: 13.5px; white-space: nowrap; }

/* 이름을 눌러 상세 지면으로 */
.roll-link { color: inherit; font-size: 19px; font-weight: 700; display: inline-flex; align-items: center; gap: 2px; }
.roll-link:hover { color: var(--color-accent-700); text-decoration: none; }
.roll-link i { font-size: 15px; color: var(--color-neutral-500); transition: transform 0.2s ease; }
.roll-link:hover i { transform: translateX(3px); color: var(--color-accent-700); }

/* 8위부터는 접어 두고 이 버튼으로 편다 */
.roll-more {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 8px; padding: 16px;
  border: none; border-top: 1px solid var(--color-divider);
  background: none; cursor: pointer;
  font: inherit; font-size: 15.5px; color: var(--color-accent-700);
  transition: background 0.2s ease;
}
.roll-more:hover { background: var(--color-accent-100); }
.roll-more i { font-size: 16px; }

/* 아직 제보가 없을 때의 지면 */
.empty {
  padding: 40px 0 44px; border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
}
.empty h3 { font-size: 21px; margin: 0 0 10px; }
.empty p { font-size: 15.5px; color: var(--color-neutral-800); max-width: 52ch; margin: 0; }

/* — 당적별 합산 — */
.party-block { max-width: 720px; margin-bottom: 16px; }
.party-block h3 { font-size: 15px; font-weight: 700; margin-bottom: 24px; }
.party-list { display: flex; flex-direction: column; gap: 20px; }
.party-row { display: grid; grid-template-columns: 180px 1fr auto; gap: 20px; align-items: center; }
/* 정당 로고 이미지 대신 이름을 그대로 세운다 — 출처·라이선스 확인이 안 된 마크를 쓰지 않기 위해 */
.party-name { font-size: 16.5px; font-weight: 700; }
.party-leader { border-bottom: 1px dotted var(--color-neutral-400); align-self: end; margin-bottom: 10px; }
.party-total { font-size: 30px; font-weight: 900; }
.party-total small { font-size: 15px; font-weight: 400; }

/* — 시민 제보 — */
.tips-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 56px; align-items: start; }
.tip-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px; background: var(--color-accent-100); margin-bottom: 16px;
}
.tip-chip b { font-weight: 700; }
.tip-chip span { font-size: 13px; color: var(--color-neutral-700); }
.tip-chip button {
  border: none; background: none; cursor: pointer;
  color: var(--color-accent-700); font: inherit; font-size: 16px; line-height: 1;
}
/* 입력 검증 안내 — 마젠타 잉크로 한 줄, 지면을 어지럽히지 않게 */
.form-msg {
  font-size: 13.5px; line-height: 1.5; color: var(--color-accent-2-700);
  margin: 0 0 14px; max-width: 44ch;
}
.form-msg.is-hint { color: var(--color-neutral-700); }
.form-msg.is-done { color: var(--color-accent-700); font-weight: 700; }
.tip-matches {
  display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto;
  border: 1px solid var(--color-neutral-300); margin-bottom: 20px;
}
.tip-match {
  display: flex; justify-content: space-between; gap: 12px; text-align: left;
  padding: 10px 14px; border: none; border-bottom: 1px solid var(--color-neutral-200);
  background: var(--color-bg); cursor: pointer; font: inherit; font-size: 14.5px;
}
.tip-match:hover { background: var(--color-accent-100); }
.tip-match b { font-weight: 700; }
.tip-match > span { color: var(--color-neutral-700); font-size: 13px; }
.tip-match > span:first-child { display: inline-flex; align-items: center; gap: 8px; color: var(--color-text); font-size: 14.5px; }
.tip-feed-title { font-size: 15px; font-weight: 700; margin-bottom: 20px; }
.tip-feed { display: flex; flex-direction: column; max-height: 520px; overflow-y: auto; }
.tip-item { padding: 16px 0; border-bottom: 1px solid var(--color-neutral-200); animation: popIn 0.35s ease; }
.tip-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.tip-head b { font-weight: 700; font-size: 16px; }
.tip-when { font-size: 12.5px; color: var(--color-neutral-600); margin-left: auto; }
.tip-note { margin: 0; font-size: 15px; line-height: 1.6; color: var(--color-neutral-800); }

/* — 게시판 미리보기 — */
.boards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 56px; align-items: start; }
.board {
  display: flex; flex-direction: column; gap: 18px; padding: 12px; margin: -12px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.board:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.board h3 { font-size: 21px; font-weight: 700; margin: 0; }
.board p { font-size: 15px; line-height: 1.65; margin: 0; color: var(--color-neutral-800); }
.board-thumb { aspect-ratio: 16 / 10; overflow: hidden; }
.board-thumb img { width: 100%; height: 100%; object-fit: cover; }
.board-glyph { aspect-ratio: 16 / 10; display: grid; place-items: center; font-size: 64px; font-weight: 900; }
.board-glyph.is-cyan { background: var(--color-accent-100); color: var(--color-accent-300); }
.board-glyph.is-magenta { background: var(--color-accent-2-100); color: var(--color-accent-2-300); }
.board-rows { display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; }
.board-rows div { display: flex; justify-content: space-between; gap: 12px; }
.board-rows time { color: var(--color-neutral-600); flex-shrink: 0; white-space: nowrap; }

/* — 의원 상세 지면 — */
.masthead.is-slim > .sheet { padding-top: 28px; }
.masthead.is-slim h1 { font-size: clamp(20px, 2.4vw, 28px); }
.masthead.is-slim h1 a { color: inherit; }
.masthead.is-slim h1 a:hover { text-decoration: none; }
.masthead.is-slim .day-count { font-size: clamp(15px, 1.8vw, 20px); }
.masthead.is-slim .dateline { text-transform: none; letter-spacing: 0.04em; }

.member-head { margin-bottom: 56px; }
.member-head .display { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.member-total { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin-top: 10px; }
.member-total .fine-print { margin: 0; }
.member-block { margin-bottom: 64px; }
.member-block > h3 { font-size: 15px; font-weight: 700; margin: 0 0 20px; }
.member-block .fine-print { margin-top: 16px; }

/* 출석 달력 — 채워진 칸이 출석한 날 */
.cal-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.cal-bar h3 { font-size: 15px; font-weight: 700; margin: 0; margin-right: auto; }
.cal-bar .cheer-btn { padding: 3px 12px; font-size: 16px; line-height: 1.2; }
.cal-label { font-size: 15px; font-weight: 700; min-width: 8.5em; text-align: center; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; max-width: 560px; }
.cal-head {
  font-size: 12px; letter-spacing: 0.08em; text-align: center; padding-bottom: 6px;
  color: var(--color-neutral-600);
}
.cal-cell {
  position: relative; aspect-ratio: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px;
  border: 1px solid var(--color-divider); font-size: 14px;
}
.cal-cell.is-blank { border-color: transparent; }
.cal-cell.is-present {
  background: var(--color-accent-2); border-color: var(--color-accent-2);
  color: var(--color-bg); font-weight: 700;
}
.cal-cell.is-today { outline: 2px solid var(--color-text); outline-offset: -1px; }
.cal-count { font-size: 10px; font-weight: 400; }

/* 지난 응원 메시지 */
.msg-list { display: flex; flex-direction: column; max-width: 720px; }
.msg-item {
  display: flex; justify-content: space-between; align-items: baseline; gap: 20px;
  padding: 14px 0; border-bottom: 1px solid var(--color-neutral-200);
}
.msg-text { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--color-neutral-800); }
.msg-when { font-size: 12.5px; color: var(--color-neutral-600); white-space: nowrap; flex-shrink: 0; }

/* — 관리자 지면 — */
.warn-box {
  border: 2px solid var(--color-accent-2); padding: 18px 20px;
  max-width: 62ch; margin: 0 0 44px;
}
.warn-box b { display: block; font-size: 15.5px; color: var(--color-accent-2-700); margin-bottom: 6px; }
.warn-box p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--color-neutral-800); }
.warn-box code { font-family: ui-monospace, "Cascadia Mono", Menlo, monospace; font-size: 13px; }

/* 준비 중 안내 — 경고가 아니라 담담한 알림이라 잉크색 테두리를 쓴다 */
.notice-box { border: 1px solid var(--color-text); padding: 20px 24px; max-width: 58ch; }
.notice-box b { display: block; font-size: 16px; margin-bottom: 8px; }
.notice-box p { margin: 0; font-size: 15px; line-height: 1.65; color: var(--color-neutral-800); }

.colophon-note {
  margin: 14px 0 0; font-size: 13px; line-height: 1.6;
  color: var(--color-neutral-700); max-width: 72ch;
}

.admin-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 32px; }
.admin-tab {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--color-neutral-300); background: none;
  padding: 7px 16px; font: inherit; font-size: 14.5px; cursor: pointer;
}
.admin-tab:hover { background: var(--color-accent-100); }
.admin-tab.is-on { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }
.admin-tab-count { font-weight: 700; }

.admin-row {
  display: grid; grid-template-columns: 220px 1fr auto; gap: 24px;
  align-items: start; padding: 20px 0; border-bottom: 1px solid var(--color-neutral-200);
}
.admin-row.is-rejected { opacity: 0.55; }
.admin-who .roll-name { margin-bottom: 2px; }
.admin-who b { font-size: 17px; font-weight: 700; }
.admin-when { font-size: 12.5px; color: var(--color-neutral-600); margin-bottom: 4px; }
.admin-detail .tip-note { margin: 0; }
.admin-detail .tip-note.is-empty { color: var(--color-neutral-600); font-style: italic; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

@media (max-width: 900px) {
  .admin-row { grid-template-columns: 1fr; gap: 12px; }
  .admin-actions { justify-content: flex-start; }
}

/* — 마감 — */
.colophon { padding-top: 112px; padding-bottom: 72px; }
.colophon .rule-double { margin-bottom: 16px; }
.colophon-lines {
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  font-size: 13.5px; color: var(--color-neutral-700);
}

/* — 좁은 지면 — */
@media (max-width: 900px) {
  .sheet { padding-inline: 24px; }
  .section { padding-top: 72px; }
  .roll-intro, .tips-grid { grid-template-columns: 1fr; gap: 32px; }
  .roll-intro figure { display: none; }
  .boards { grid-template-columns: 1fr; gap: 44px; }
  .roll-row { grid-template-columns: 56px 1fr 72px; row-gap: 12px; }
  .track { grid-column: 1 / -1; order: 1; }
  .cheer { order: 2; }
  .colophon { padding-top: 72px; }
}

@media (max-width: 520px) {
  .masthead-title { flex-wrap: wrap; gap: 10px; }
  .masthead-title h1 { white-space: normal; }
  .masthead-nav { gap: 14px; font-size: 13.5px; }
  .roll-rank { font-size: 24px; }
  .roll-visits { font-size: 22px; }
  .party-row { grid-template-columns: 1fr auto; }
  .party-leader { display: none; }
}

/* — 움직임을 줄여 달라는 설정을 존중 — */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
