/* brera（2026-11-08）。美術館の壁の色に、絵だけが浮かぶようにする。飾りは額の線と題の書体だけだ */

:root {
  --wall: #efeae1;
  --paper: #f8f5ef;
  --ink: #1f1c18;
  --mute: #6f675c;
  --line: #d8d0c3;
  --accent: #a2472a;        /* テラコッタ。塗りのボタンだけに使う */
  --accent-ink: #fffaf3;
  --frame: #2b2620;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --wall: #1c1a17; --paper: #24211d; --ink: #ece6dc; --mute: #a39a8c; --line: #3a352e;
    --accent: #d0704c; --accent-ink: #1c1a17; --frame: #0d0c0a; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --wall: #1c1a17; --paper: #24211d; --ink: #ece6dc; --mute: #a39a8c; --line: #3a352e;
  --accent: #d0704c; --accent-ink: #1c1a17; --frame: #0d0c0a; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--wall); color: var(--ink);
  font: 400 15px/1.75 "IBM Plex Sans JP", system-ui, sans-serif;
}
a { color: inherit; text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
.quiet { color: var(--mute); }
.small { font-size: 13px; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* 上の帯 */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px clamp(16px, 4vw, 48px);
  background: color-mix(in srgb, var(--wall) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font: italic 500 28px/1 "Cormorant Garamond", serif; text-decoration: none; letter-spacing: .02em; }
.me { display: flex; align-items: center; gap: 14px; }
.me-link { display: inline-flex; }

main { max-width: 1440px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px) 64px; }

/* ボタン。塗りは .primary（贈る）だけ。.ink はログインと載せるで、縁だけの濃い字 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  font: 500 14px/1.2 inherit; font-family: inherit; text-decoration: none; cursor: pointer;
}
.btn:hover:not(:disabled) { border-color: var(--ink); }
.btn:disabled { cursor: default; opacity: .7; }
.btn.ink { border-color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); border-color: var(--accent); }
.btn.big { min-height: 52px; padding: 12px 34px; font-size: 17px; }
.btn.small { min-height: 34px; padding: 6px 14px; font-size: 13px; }
.link { background: none; border: 0; padding: 0; color: var(--mute); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link.small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 顔 */
.face { border-radius: 50%; object-fit: cover; background: var(--line); flex: none; }
.face.s { width: 30px; height: 30px; }
.face.m { width: 40px; height: 40px; }
.face.l { width: 88px; height: 88px; }
.face.none { display: inline-block; }

/* 一覧の頭 */
.intro { padding: 48px 0 28px; max-width: 640px; }
.intro h1 { margin: 0 0 6px; font: italic 500 clamp(52px, 9vw, 88px)/1 "Cormorant Garamond", serif; }
.intro.small h1 { font: 500 26px/1.3 inherit; font-family: inherit; }
.intro p { margin: 0; color: var(--mute); }

/* 絵の壁。段組みで縦横比のまま詰める */
.wall { columns: 4 260px; column-gap: 20px; }
@media (max-width: 600px) { .wall { columns: 2; column-gap: 10px; } .wall .tile { margin-bottom: 14px; } }
.tile { position: relative; display: block; break-inside: avoid; margin: 0 0 20px; text-decoration: none; }
.tile img { width: 100%; height: auto; object-fit: cover; background: var(--line); box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
.tile .count {
  position: absolute; top: 8px; right: 8px; min-width: 22px; padding: 0 6px;
  border-radius: 11px; background: rgb(0 0 0 / .55); color: #fff; font-size: 12px; line-height: 22px; text-align: center;
}
.tile .cap { display: flex; justify-content: space-between; gap: 8px; padding: 6px 2px 0; font-size: 13px; }
.tile .cap .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .cap .by { color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: auto; }
.tile:hover img { box-shadow: 0 6px 24px rgb(0 0 0 / .18); }

/* 絵のページ。絵は壁に掛けた形で、画面の高さに収める */
.frames { display: grid; gap: 40px; justify-items: center; padding: 40px 0 8px; }
.frame { margin: 0; }
.frame img {
  max-height: 82vh; width: auto; max-width: min(100%, 1200px); height: auto;
  border: 10px solid var(--frame); outline: 1px solid var(--line); outline-offset: 0;
  box-shadow: 0 18px 40px rgb(0 0 0 / .22);
  background: var(--paper);
}
.plate { max-width: 560px; margin: 24px auto 0; text-align: center; }
.plate .title { margin: 0 0 12px; font: italic 500 34px/1.2 "Cormorant Garamond", "IBM Plex Sans JP", serif; }
.artist { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; text-align: left; }
.artist b { display: block; font-weight: 500; }
.artist .quiet { font-size: 13px; }
.plate .text { white-space: pre-wrap; text-align: left; margin: 16px 0 4px; }
.gift { margin: 28px 0 8px; }
.gift .note { margin: 10px 0 0; color: var(--mute); font-size: 13px; }
.gift .note a { color: var(--accent); }
.gift .note.warn { color: var(--ink); font-weight: 500; }
.record.lit .num { color: var(--accent); transition: color 2s; }
/* 絵の下の「贈る」が最初の画面に入るように、絵の高さを抑える */
.frames:has(.frame:only-child) .frame img { max-height: 70vh; }
@media (max-width: 600px) { .frames { padding-top: 20px; } .frame img { max-height: 58vh; border-width: 6px; } }
.record { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.record .num, .tally .num { font: 500 30px/1 "Cormorant Garamond", serif; }
.more { margin-top: 64px; }
.more h2 { font-size: 15px; font-weight: 500; color: var(--mute); margin: 0 0 16px; }

/* 絵師のページ */
.profile {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px 20px;
  padding: 40px 0 32px; margin-bottom: 28px; border-bottom: 1px solid var(--line);
}
.profile h1 { margin: 0; font-size: 24px; font-weight: 500; line-height: 1.3; }
.profile p { margin: 2px 0 0; }
.tally { display: grid; justify-items: end; line-height: 1.4; }
.tally .num { font-size: 52px; }
.profile > .btn { grid-column: 1 / -1; justify-self: start; }
@media (max-width: 640px) {
  .profile { grid-template-columns: auto 1fr; }
  .tally { grid-column: 1 / -1; justify-items: start; }
}

/* 絵を載せる */
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.cand { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 8px; align-content: start; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 4px; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.clip { margin: 0; color: var(--mute); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; min-width: 0; }
input[type="text"] {
  min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--wall); color: var(--ink); font: inherit;
}

/* 空のときと、ログインの小窓 */
.empty { max-width: 520px; margin: 32px auto; text-align: center; display: grid; gap: 14px; justify-items: center; }
.empty p { margin: 0; }
.signin { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.signin input { flex: 1 1 220px; }
.sheet { border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); padding: 24px; width: min(440px, calc(100vw - 32px)); }
.sheet::backdrop { background: rgb(0 0 0 / .4); }
.sheet p { margin: 0 0 14px; }
.sheet form.center { margin-top: 12px; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 10;
  max-width: calc(100vw - 32px); margin: 0; padding: 10px 18px; border-radius: 10px;
  background: var(--ink); color: var(--wall); font-size: 14px;
}
.toast a { color: inherit; }

footer.site { border-top: 1px solid var(--line); padding: 20px clamp(16px, 4vw, 48px); }
.fine { margin: 0; font-size: 12px; color: var(--mute); text-align: center; }
