/* Lore Lab 会員サイト 共通スタイル */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --brand: #1a6e5a;
  --brand-dark: #10493c;
  --bg: #f6f7f5;
  --card: #ffffff;
  --text: #22302c;
  --muted: #6b7a75;
  --line: #e2e7e4;
  --danger: #b3362c;
}
html { font-size: 16px; }
body {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.7;
  min-height: 100vh;
}
a { color: var(--brand); }

/* ---------- ログイン画面 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 40px 32px; width: 100%; max-width: 420px; box-shadow: 0 4px 24px rgba(0,0,0,.06);
}
.login-card h1 { font-size: 1.3rem; margin-bottom: 4px; color: var(--brand-dark); }
.login-card .sub { color: var(--muted); font-size: .85rem; margin-bottom: 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.field input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 1rem; background: #fff;
}
.field input:focus { outline: 2px solid var(--brand); border-color: transparent; }
.btn {
  display: inline-block; width: 100%; padding: 12px; border: none; border-radius: 8px;
  background: var(--brand); color: #fff; font-size: 1rem; font-weight: 700; cursor: pointer;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .5; cursor: wait; }
.btn-sub {
  background: none; border: none; color: var(--brand); cursor: pointer;
  font-size: .85rem; text-decoration: underline; padding: 0;
}
.msg { margin-top: 14px; font-size: .9rem; min-height: 1.4em; }
.msg.error { color: var(--danger); }
.msg.ok { color: var(--brand); }

/* ---------- 会員エリア ---------- */
header.site {
  background: var(--brand-dark); color: #fff; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
header.site .name { font-weight: 700; font-size: 1.05rem; }
header.site button {
  background: rgba(255,255,255,.15); color: #fff; border: none; border-radius: 6px;
  padding: 6px 14px; cursor: pointer; font-size: .85rem;
}
header.site button:hover { background: rgba(255,255,255,.3); }

.layout { display: flex; max-width: 1100px; margin: 0 auto; gap: 24px; padding: 24px 20px; }
nav.cats { flex: 0 0 200px; }
nav.cats h2 { font-size: .8rem; color: var(--muted); margin-bottom: 10px; letter-spacing: .1em; }
nav.cats ul { list-style: none; }
nav.cats li button {
  display: block; width: 100%; text-align: left; padding: 10px 12px; margin-bottom: 4px;
  background: none; border: none; border-radius: 8px; font-size: .95rem; cursor: pointer; color: var(--text);
}
nav.cats li button:hover { background: #e9efec; }
nav.cats li button.active { background: var(--brand); color: #fff; font-weight: 700; }

main.contents { flex: 1; min-width: 0; }
main.contents h2 { font-size: 1.15rem; margin-bottom: 16px; color: var(--brand-dark); }
.card-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.content-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px; cursor: pointer; transition: box-shadow .15s;
}
.content-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.content-card .type {
  display: inline-block; font-size: .7rem; font-weight: 700; color: #fff; background: var(--brand);
  border-radius: 4px; padding: 2px 8px; margin-bottom: 8px;
}
.content-card h3 { font-size: .98rem; margin-bottom: 6px; }
.content-card p { font-size: .82rem; color: var(--muted); }
.empty { color: var(--muted); padding: 24px 0; }

/* ---------- 視聴・閲覧ビュー ---------- */
.viewer { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 24px; }
.viewer .back { margin-bottom: 16px; }
.viewer h2 { margin-bottom: 4px; }
.viewer .desc { color: var(--muted); font-size: .9rem; margin-bottom: 18px; white-space: pre-wrap; }
.viewer .media { margin-bottom: 18px; }
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 8px; }
.viewer audio { width: 100%; }
.viewer img { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.viewer .pdf-frame { width: 100%; height: 75vh; border: 1px solid var(--line); border-radius: 8px; }
.dl-row { display: flex; gap: 10px; flex-wrap: wrap; }
.dl-row .btn { width: auto; padding: 10px 20px; }
.loading { color: var(--muted); padding: 20px 0; }

@media (max-width: 720px) {
  .layout { flex-direction: column; }
  nav.cats { flex: none; }
  nav.cats ul { display: flex; flex-wrap: wrap; gap: 6px; }
  nav.cats li button { padding: 8px 12px; }
}
