/* photo chorori 納品サイト — 試作で承認されたデザインを踏襲
   白ベース・シンプル・写真の角は丸くしない（border-radius: 0） */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP",
    "Yu Gothic", YuGothic, sans-serif;
  color: #333; background: #fff; line-height: 1.6;
}
button { font: inherit; cursor: pointer; }
input, select { font: inherit; }
img { border-radius: 0; display: block; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 14px 64px; }

/* ヘッダー */
.site-header { padding: 28px 0 18px; text-align: left; }
.logo-space { display: inline-block; height: 54px; width: auto; }
.album-title { font-size: 24px; font-weight: 600; margin-top: 18px; }
.album-date { font-size: 13px; color: #888; margin-top: 2px; }
.album-meta { font-size: 12px; color: #999; margin-top: 6px; }

/* パスワード画面 */
.gate {
  max-width: 420px; margin: 12vh auto 0; padding: 0 20px; text-align: center;
}
.gate .logo-space { margin-bottom: 22px; }
.gate h1 { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
.gate p { font-size: 13px; color: #777; margin-bottom: 18px; }
.gate input[type="password"] {
  width: 100%; padding: 13px 14px; font-size: 16px;
  border: 1px solid #ccc; border-radius: 0; margin-bottom: 12px;
}
.gate button, .btn-primary {
  width: 100%; padding: 13px; background: #8cb0bd; color: #fff; border: none;
  border-radius: 0; font-size: 15px;
}
.gate button:hover, .btn-primary:hover { background: #7ba5b4; }
.gate .error { color: #c0392b; font-size: 13px; min-height: 20px; margin-bottom: 8px; }

/* ツールバー */
.toolbar {
  position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,0.96);
  padding: 10px 0; border-bottom: 1px solid #eee;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.seg { display: inline-flex; border: 1px solid #ccc; }
.seg button {
  padding: 8px 14px; background: #fff; border: none; font-size: 13px; color: #555;
}
.seg button + button { border-left: 1px solid #ccc; }
.seg button.active { background: #333; color: #fff; }
.btn-bulk {
  padding: 9px 18px; background: #333; color: #fff; border: none; font-size: 14px;
}
.btn-ghost {
  padding: 8px 14px; background: #fff; color: #555; border: 1px solid #ccc; font-size: 13px;
}
.toolbar .spacer { flex: 1; }

/* 一括ダウンロードパネル */
.bulk-panel {
  display: none; border: 1px solid #e2e2e2; padding: 16px; margin: 14px 0;
  background: #fafafa;
}
.bulk-panel.open { display: block; }
.bulk-panel .bar { height: 8px; background: #e6e6e6; margin: 10px 0; }
.bulk-panel .bar > div { height: 100%; background: #333; width: 0%; transition: width .2s; }
.bulk-panel .status { font-size: 13px; color: #555; }
.bp-actions { display: none; margin-top: 12px; gap: 10px; flex-wrap: wrap; }
.bp-actions.open { display: flex; }
.bp-actions a, .bp-actions button {
  display: inline-block; padding: 12px 20px; background: #333; color: #fff;
  text-decoration: none; font-size: 15px; border: none;
}
.bp-guide { display: none; margin-top: 14px; font-size: 13px; color: #555; }
.bp-guide.open { display: block; }
.bp-guide h3 { font-size: 14px; margin: 10px 0 4px; color: #333; }
.bp-guide ul { padding-left: 18px; }
.bp-error { color: #c0392b; font-size: 13px; margin-top: 8px; white-space: pre-line; }

/* 写真グリッド：角は丸くしない・間隔3px・ファイル名なし */
.grid { columns: 2; column-gap: 3px; margin-top: 3px; }
@media (min-width: 700px) { .grid { columns: 3; } }
@media (min-width: 1024px) { .grid { columns: 4; } }
.grid figure {
  break-inside: avoid; margin: 0 0 3px; cursor: zoom-in; background: #f3f3f3;
}
.grid img { width: 100%; height: auto; border-radius: 0; }

/* 拡大表示（ライトボックス） */
.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(12,12,12,0.96);
  display: none; flex-direction: column; height: 100dvh;
}
.lightbox.open { display: flex; }
.lb-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; color: #ddd; font-size: 14px;
}
.lb-top button { background: none; border: none; color: #fff; font-size: 26px; line-height: 1; padding: 6px; }
.lb-stage { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; position: relative; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 0; }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.12); color: #fff; border: none;
  font-size: 26px; width: 44px; height: 64px;
}
.lb-nav.prev { left: 6px; } .lb-nav.next { right: 6px; }
.lb-bottom {
  padding: 12px 14px calc(28px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 10px; align-items: stretch;
}
@media (min-width: 700px) {
  .lb-bottom { flex-direction: row; align-items: center; justify-content: center; }
}
.lb-bottom .seg { border-color: #666; align-self: center; }
.lb-bottom .seg button { background: transparent; color: #ccc; }
.lb-bottom .seg button + button { border-left-color: #666; }
.lb-bottom .seg button.active { background: #fff; color: #111; }
.lb-dl {
  padding: 14px 22px; background: #fff; color: #111; border: none; font-size: 16px;
  min-height: 50px;
}
.lb-spacer { height: 10px; }

/* 期限切れ */
.expired { max-width: 480px; margin: 14vh auto 0; padding: 0 20px; text-align: center; }
.expired h1 { font-size: 20px; margin: 18px 0 8px; }
.expired p { font-size: 14px; color: #777; }

/* トースト */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: rgba(30,30,30,0.92); color: #fff; padding: 10px 18px;
  font-size: 14px; z-index: 80; display: none; max-width: 90vw; text-align: center;
}
.toast.open { display: block; }

/* 管理画面 */
.admin-wrap { max-width: 900px; margin: 0 auto; padding: 24px 14px 64px; }
.admin-wrap h1 { font-size: 20px; margin-bottom: 16px; }
.card { border: 1px solid #e2e2e2; padding: 16px; margin-bottom: 18px; background: #fff; }
.card h2 { font-size: 16px; margin-bottom: 12px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: #666; margin-bottom: 4px; }
.field input, .field select {
  width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 0; font-size: 15px;
}
table.albums { width: 100%; border-collapse: collapse; font-size: 13px; }
table.albums th, table.albums td { border-bottom: 1px solid #eee; padding: 8px 6px; text-align: left; vertical-align: top; }
.badge { display: inline-block; padding: 1px 8px; font-size: 11px; border: 1px solid #bbb; color: #666; }
.badge.expired { border-color: #c0392b; color: #c0392b; }
.small { font-size: 12px; color: #888; }
.result-box { background: #f6fbf6; border: 1px solid #bcd8bc; padding: 14px; font-size: 14px; display: none; }
.result-box.open { display: block; }
.result-box code { background: #fff; border: 1px solid #ddd; padding: 2px 6px; word-break: break-all; }
.row-flex { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.hidden { display: none !important; }

/* パスワード表示切り替え */
.show-pw { display: flex; align-items: center; gap: 6px; font-size: 13px;
  color: var(--muted, #666); margin: 8px 0 4px; cursor: pointer; text-align: left; }
.show-pw input { width: auto; margin: 0; }
