/* ============================================================
   吹奏楽部サイトの見た目
   色やサイズを変えたいときは、まず下の :root の値を書き換える
   ============================================================ */

:root {
  --kon: #1b2a4e;          /* 紺：文字とヘッダー */
  --kon-soft: #56627f;     /* 補足の文字 */
  --paper: #eef1f6;        /* ページの背景 */
  --surface: #ffffff;      /* カードや入力欄 */
  --line: #d3d9e5;         /* 罫線 */
  --brass: #e2b23c;        /* 真鍮：ボタン */
  --brass-deep: #7d5a0c;   /* 真鍮の濃い色：白地の上の文字用 */
  --shu: #c5352b;          /* 朱：はんこ・注意 */
  --green: #25714f;        /* 納入済み */
  --green-pale: #e2f1ea;

  --radius: 10px;
  --gap: 16px;
  --font: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "BIZ UDPGothic", "Yu Gothic", "Noto Sans JP", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--kon);
  font-family: var(--font);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.7;
  font-feature-settings: "palt";
}

h1, h2, p, ul, fieldset, legend { margin: 0; padding: 0; }
ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 3px; }
small { font-size: 0.8em; color: var(--kon-soft); font-weight: 500; }

:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.wrap { width: 100%; max-width: 720px; margin-inline: auto; padding-inline: var(--gap); }

/* ---------- ヘッダー ---------- */

.site-header { background: var(--kon); color: #fff; }
.site-header__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px 12px; }
.site-name { font-size: 1.15rem; font-weight: 900; text-decoration: none; letter-spacing: 0.04em; }
.logout { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; }
.logout .link-button { color: #fff; }
.role-mark { border: 1px solid rgb(255 255 255 / 0.55); border-radius: 4px; padding: 0 6px; font-size: 0.75rem; }

/* 五線：ヘッダーの下に5本の線を引く */
.staff {
  height: 21px;
  background: repeating-linear-gradient(to bottom, rgb(255 255 255 / 0.4) 0 1px, transparent 1px 5px);
  background-size: 100% 21px;
  margin-bottom: 10px;
}

.nav { background: var(--surface); color: var(--kon); border-bottom: 1px solid var(--line); }
.nav__row { display: flex; align-items: stretch; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav__row::-webkit-scrollbar { display: none; }
.nav a {
  flex: none; padding: 12px 10px 9px; text-decoration: none; font-weight: 700; font-size: 0.95rem;
  color: var(--kon-soft); border-bottom: 3px solid transparent;
}
.nav a:hover { color: var(--kon); }
.nav a[aria-current="page"] { color: var(--kon); border-bottom-color: var(--brass); }
.nav__sep { flex: none; width: 1px; background: var(--line); margin: 10px 6px; }

/* ---------- 本文の基本 ---------- */

.main { padding-block: 24px 64px; }
.main > * + * { margin-top: var(--gap); }
.main > section { margin-top: 32px; }
.main > section > * + * { margin-top: 12px; }

h1 { font-size: 1.6rem; font-weight: 900; line-height: 1.35; }
h2 { font-size: 1.1rem; font-weight: 700; line-height: 1.4; }
.main > h2 { margin-top: 36px; }
.lead { color: var(--kon-soft); }
.back, .more { font-size: 0.95rem; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px var(--gap); }

.empty {
  border: 1px dashed #aab3c6; border-radius: var(--radius);
  padding: 18px var(--gap); color: var(--kon-soft);
}

.notice { border-radius: var(--radius); padding: 12px var(--gap); font-weight: 700; border-left: 5px solid; }
.notice--ok { background: var(--green-pale); border-color: var(--green); color: #174a33; }
.notice--error { background: #fbe7e4; border-color: var(--shu); color: #8a211a; }

/* ---------- ボタン・リンク ---------- */

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 10px 22px;
  background: var(--brass); color: var(--kon);
  border: 0; border-radius: var(--radius);
  font: inherit; font-weight: 900; text-decoration: none; cursor: pointer;
}
.button:hover { background: #ecc254; }
.button:active { transform: translateY(1px); }
.button--big { width: 100%; min-height: 60px; font-size: 1.1rem; }
.button--quiet { background: var(--surface); border: 2px solid var(--kon); min-height: 44px; padding: 6px 18px; }
.button--quiet:hover { background: var(--paper); }

.link-button {
  background: none; border: 0; padding: 8px 4px; min-height: 40px;
  font: inherit; font-size: 0.9rem; color: var(--kon); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.link-button--danger { color: var(--shu); }
.button-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.danger-zone { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------- フォーム ---------- */

.form > * + * { margin-top: 18px; }
.form > input[type="hidden"] + * { margin-top: 0; }   /* 見えない入力欄の直後には余白をつけない */
.field { display: block; }
.field__label { display: block; font-weight: 700; }
.field__hint { display: block; font-size: 0.85rem; color: var(--kon-soft); line-height: 1.5; }
.field__label + input, .field__label + select, .field__label + textarea,
.field__hint + input, .field__hint + select, .field__hint + textarea,
.field__label + .choices { margin-top: 6px; }
textarea + .field__hint { margin-top: 6px; }

input[type="text"], input[type="password"], input[type="date"], input[type="time"],
input[type="number"], input[type="file"], select, textarea {
  display: block; width: 100%; min-height: 48px; padding: 10px 12px;
  background: var(--surface); color: var(--kon);
  border: 2px solid #aab3c6; border-radius: 8px;
  font: inherit; font-size: 16px;   /* 16px未満だとiPhoneで画面が勝手に拡大される */
}
input[type="file"] { padding: 9px 12px; }
textarea { resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: var(--kon); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row .field { margin-top: 0; }
@media (max-width: 440px) { .field-row { grid-template-columns: 1fr; gap: 18px; } }

.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 22px; height: 22px; margin: 3px 0 0; accent-color: var(--kon); flex: none; }

/* 欠席／遅刻／早退 などの選択ボタン */
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice { position: relative; display: block; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice span {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 48px; padding: 6px 4px; line-height: 1.3; font-size: 0.92rem;
  border: 2px solid #aab3c6; border-radius: 8px; background: var(--surface); font-weight: 700;
}
.choice input:checked + span { background: var(--kon); border-color: var(--kon); color: #fff; }
.choice input:focus-visible + span { outline: 3px solid var(--brass); outline-offset: 2px; }

/* ---------- はんこ ---------- */

.stamp {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 2.5em; height: 2.5em; border: 0.16em solid currentColor; border-radius: 50%;
  font-weight: 900; line-height: 1; transform: rotate(-8deg);
  color: var(--shu); background: transparent;
}
.stamp--late { color: var(--brass-deep); }
.stamp--early { color: #3b5391; }
.stamp--small { font-size: 0.7rem; vertical-align: middle; }
.stamp--big { font-size: 1.7rem; }

@media (prefers-reduced-motion: no-preference) {
  .stamp--press { animation: press 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
  @keyframes press {
    from { opacity: 0; transform: rotate(-8deg) scale(1.9); }
    to   { opacity: 1; transform: rotate(-8deg) scale(1); }
  }
}

/* ---------- ホーム ---------- */

.today { display: grid; gap: 14px; }
.today__date { display: flex; align-items: baseline; gap: 12px; line-height: 1; }
.today__md { font-size: 3.4rem; font-weight: 900; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.today__md small { font-size: 0.36em; font-weight: 700; color: var(--kon); margin: 0 0.12em 0 0.06em; }
.today__week { font-size: 1.1rem; font-weight: 700; color: var(--kon-soft); }

.admin-summary > * + * { margin-top: 8px; }
.summary-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.summary-list a { font-weight: 700; }
.summary-list__value { color: var(--kon-soft); font-size: 0.95rem; }
.summary-list__warn .summary-list__value { color: var(--shu); font-weight: 700; }

.event-list li + li { margin-top: 8px; }
.event-list a {
  display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: baseline;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px var(--gap); text-decoration: none;
}
.event-list__date { font-weight: 900; }
.event-list__title { font-weight: 700; }
.event-list__action { grid-column: 2; font-size: 0.85rem; color: var(--kon-soft); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 出欠連絡 ---------- */

.sent {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--surface); border: 2px solid var(--kon); border-radius: var(--radius); padding: 18px var(--gap);
}
.sent__title { font-weight: 900; font-size: 1.1rem; }
.sent__note { font-size: 0.85rem; color: var(--kon-soft); margin-top: 6px; line-height: 1.55; }

/* ---------- 日付・月の切り替え ---------- */

.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pager > a {
  flex: none; padding: 10px 14px; min-height: 44px; display: inline-flex; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  text-decoration: none; font-weight: 700; font-size: 0.9rem;
}
.pager__now { flex: 1; text-align: center; font-size: 1.15rem; min-width: 0; }
.pager__now input { max-width: 200px; margin-inline: auto; }

.day-summary { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; }
.day-summary strong { font-size: 1.1rem; margin-right: auto; }
.day-summary__item { color: var(--kon-soft); font-size: 0.95rem; }
.day-summary__item b { color: var(--kon); font-size: 1.15rem; font-variant-numeric: tabular-nums; }

/* ---------- パートごとのまとまり ---------- */

.part-group > h2 {
  font-size: 0.95rem; color: var(--kon-soft);
  padding-bottom: 6px; border-bottom: 2px solid var(--kon);
}
.main > .part-group { margin-top: 26px; }
.main > .part-group > * + * { margin-top: 0; }

.att { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.att__body { flex: 1; min-width: 0; }
.att__name { font-weight: 700; }
.att__time { margin-left: 8px; font-size: 0.9rem; font-weight: 700; color: var(--brass-deep); white-space: nowrap; }
.att__reason { overflow-wrap: anywhere; }
.att__meta { font-size: 0.8rem; color: var(--kon-soft); }

/* ---------- 集金 ---------- */

.fee-list li + li { margin-top: 10px; }
.fee {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px var(--gap); text-decoration: none;
}
.fee:hover { border-color: var(--kon); }
.fee__title { font-weight: 900; font-size: 1.05rem; }
.fee__meta { grid-column: 1; font-size: 0.85rem; color: var(--kon-soft); }
.fee__count { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-weight: 700; color: var(--shu); white-space: nowrap; }
.fee__count--done { color: var(--green); }
.fee .meter { grid-column: 1 / -1; margin-top: 8px; }

.meter { display: block; height: 8px; background: var(--paper); border-radius: 4px; overflow: hidden; }
.meter__fill { display: block; height: 100%; background: var(--green); border-radius: 4px; transition: width 0.25s ease; }

.progress-panel__numbers { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; align-items: baseline; margin-bottom: 10px; }
.progress-panel__numbers b { font-size: 1.5rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.progress-panel__money { color: var(--kon-soft); }
.progress-panel__money b { color: var(--kon); }

.pay { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pay__name { font-weight: 700; min-width: 0; }
.pay__button {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 124px; min-height: 44px; padding: 4px 12px;
  background: var(--surface); color: var(--kon-soft);
  border: 2px solid #aab3c6; border-radius: 22px;
  font: inherit; font-weight: 700; font-size: 0.95rem; cursor: pointer;
}
.pay__button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.pay__button[aria-busy="true"] { opacity: 0.55; }
.pay__date { font-size: 0.8rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.pay__date:empty { display: none; }

/* ---------- 資料（写真） ---------- */

.photo { display: block; text-decoration: none; }
.photo img { width: 100%; background: #dfe4ee; border: 1px solid var(--line); border-radius: var(--radius); }
.photo--wide img { max-height: 70vh; object-fit: contain; background: var(--surface); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.photo-grid .photo img { aspect-ratio: 3 / 4; object-fit: cover; object-position: top; }
.photo__caption { display: block; margin-top: 6px; font-weight: 700; font-size: 0.9rem; line-height: 1.4; overflow-wrap: anywhere; }
.photo__date { display: block; font-size: 0.8rem; color: var(--brass-deep); }

.file-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.file-row__thumb { flex: none; }
.file-row__thumb img { width: 56px; height: 56px; object-fit: cover; object-position: top; border-radius: 6px; border: 1px solid var(--line); }
.file-row__body { flex: 1; min-width: 0; }
.file-row__title { font-weight: 700; overflow-wrap: anywhere; line-height: 1.4; }
.file-row__meta { font-size: 0.85rem; color: var(--kon-soft); }

/* 写真の拡大表示 */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgb(13 20 40 / 0.92); }
.lightbox__inner { display: flex; flex-direction: column; height: 100%; }
.lightbox__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px var(--gap); color: #fff; }
.lightbox__title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox__close { flex: none; background: #fff; color: var(--kon); border: 0; border-radius: 8px; min-height: 40px; padding: 4px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.lightbox__stage { flex: 1; min-height: 0; overflow: auto; display: flex; padding: 0 8px 12px; }
.lightbox__stage img { margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox__stage.is-zoomed img { max-width: none; max-height: none; }

/* ---------- 名簿 ---------- */

.member { border-bottom: 1px solid var(--line); }
.member summary { padding: 11px 0; cursor: pointer; list-style-position: outside; margin-left: 1.2em; }
.member__name { font-weight: 700; }
.member__form { padding: 4px 0 18px; }
.member-inactive { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); color: var(--kon-soft); }

/* ---------- ログイン ---------- */

.login { max-width: 420px; margin: 24px auto 0; }
.login > * + * { margin-top: var(--gap); }
