:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --text: #222222;
  --muted: #6b6b6b;
  --line: #dddad3;
  --primary: #2f5d50;          /* お店のしつらえで上書きされる（admin.js の applyTheme） */
  --primary-text: #ffffff;
  --focus: color-mix(in srgb, var(--primary) 45%, #ffffff);
  --danger: #b3261e;
  --badge-draft: #8a6d1d;
  --badge-future: #2b5e9e;
  --radius: 10px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  font-size: 16px; /* iPhone で入力時に拡大されない大きさ */
  line-height: 1.6;
}

h1 { font-size: 1.25rem; margin: 0 0 16px; }
h2 { font-size: 1.05rem; margin: 28px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); }
h1 + h2 { border-top: 0; padding-top: 0; margin-top: 0; }

.topbar {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.app-name { font-size: .8rem; color: var(--muted); }
.site-name { font-weight: bold; }
.site-select { font-size: 1rem; min-height: 44px; padding: 6px 10px; }
.topbar-menu { display: flex; gap: 16px; }
.small-btn { min-height: 44px; padding: 6px 14px; font-size: .9rem; font-weight: normal; }
.footer-links { margin-top: 40px; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 16px; }
.footer-links a { display: inline-block; padding: 12px; color: var(--primary); }
.req, .opt { font-size: .75rem; font-weight: normal; padding: 0 6px; border-radius: 4px; vertical-align: 2px; }
.req { background: #fdecea; color: var(--danger); }
.opt { background: var(--bg); color: var(--muted); }

main { max-width: 720px; margin: 0 auto; padding: 20px 16px 80px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 16px;
}
.narrow { max-width: 420px; margin: 24px auto; }

label { display: block; margin-bottom: 18px; font-weight: bold; }
label.check { font-weight: normal; display: flex; gap: 10px; align-items: flex-start; }
label.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }

input[type="text"], input[type="email"], input[type="password"], input[type="date"], textarea {
  display: block; width: 100%;
  margin-top: 6px; padding: 12px;
  font: inherit; font-weight: normal;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--text);
}
textarea { resize: vertical; min-height: 10em; }
input[type="date"] { -webkit-appearance: none; appearance: none; min-height: 48px; text-align: left; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
input:focus, textarea:focus, .btn:focus-visible, select:focus { outline: 3px solid var(--focus); outline-offset: 1px; }

.hint { display: block; font-weight: normal; font-size: .85rem; color: var(--muted); margin-top: 4px; }
.counter { font-weight: normal; font-size: .8rem; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 10px 18px;
  font: inherit; font-weight: bold; text-decoration: none;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--text);
  cursor: pointer;
}
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: wait; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); text-decoration: underline; cursor: pointer; }

.error { color: var(--danger); background: #fdecea; border-radius: 8px; padding: 10px 12px; }

.help { margin-top: 16px; font-size: .9rem; }
.help summary { cursor: pointer; color: var(--primary); }

.list-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.list-head h1 { margin: 0; }

.post-list { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 10px; }
.post-list a {
  display: flex; gap: 12px; align-items: center;
  padding: 12px; min-height: 72px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: inherit; text-decoration: none;
}
.post-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; flex: none; background: var(--bg); }
.post-meta { min-width: 0; }
.post-date { font-size: .85rem; color: var(--muted); }
.post-title { font-weight: bold; overflow-wrap: anywhere; }
.badge { display: inline-block; font-size: .75rem; padding: 0 8px; border-radius: 999px; border: 1px solid currentColor; margin-left: 6px; }
.badge.draft { color: var(--badge-draft); }
.badge.future { color: var(--badge-future); }

.photo { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 0 0 18px; }
.photo legend { font-weight: bold; padding: 0 4px; }
.photo-preview img { display: block; max-width: 100%; max-height: 320px; border-radius: 6px; margin-bottom: 10px; }
.photo-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.file-btn { margin: 0; font-weight: bold; position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.form-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.form-actions .btn.primary { flex: 1 1 200px; }
.danger-zone { margin-top: 32px; padding-top: 16px; border-top: 1px dashed var(--line); text-align: right; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  max-width: calc(100% - 32px);
  width: max-content; background: #222; color: #fff; padding: 12px 20px; border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.file-btn.busy { opacity: .6; pointer-events: none; }

/* お店のしつらえ */
body.font-mincho { font-family: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif; }
.brand-logo { display: block; max-height: 32px; max-width: 160px; object-fit: contain; }
.login-logo { max-height: 64px; max-width: 240px; margin: 0 auto 16px; }
.topbar-title { align-items: center; }
h1 { color: var(--primary); }
