:root {
  --bg: #fffdfa;
  --paper: #ffffff;
  --ink: #2b2320;
  --sub: #7a6c62;
  --line: #eadfd2;
  --accent: #e8743b;
  --accent-ink: #ffffff;
  --accent-soft: #fde7da;
  --wall: #c9b8a6;
  --heart: #e0457b;
  --ok: #2f8f5b;
  --danger: #c0392b;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(80, 50, 30, .08);
}
/* スマホがダークモードでも白ベースのまま（殿の指定） */
:root { color-scheme: light; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Meiryo", sans-serif;
  font-weight: 500; line-height: 1.7; font-size: 16px;
}
a { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* ヘッダー */
.site-head { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.head-in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 900; font-size: 20px; }
.logo-cat { width: 40px; height: 25px; color: var(--ink); }
.head-nav { display: flex; align-items: center; gap: 14px; }
.head-nav a { text-decoration: none; color: var(--ink); font-weight: 700; }
.head-nav .btn-post { background: var(--accent); color: var(--accent-ink); padding: 6px 14px; border-radius: 999px; }

.flash { background: var(--accent-soft); border-radius: 12px; padding: 12px 16px; margin: 16px 0; }
.error { background: #fde2e0; color: #8a1f14; border-radius: 12px; padding: 12px 16px; }

/* トップ */
/* トップ画像：画像中央の壁の上に文字を重ねる（スマホは正方形に切り出した画像を使う） */
.hero { text-align: center; margin: 16px 0 8px; }
.hero-visual { position: relative; }
.hero-img img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); }
/* 見出しだけ画像に重ね、説明文とボタンは画像の下（殿の指定・スマホもPCも同じ） */
.hero-text {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 60%; padding: 18px 8px; border-radius: 20px;
  background: radial-gradient(closest-side, rgba(251, 246, 239, .94), rgba(251, 246, 239, .8) 70%, rgba(251, 246, 239, 0));
  color: #2b2320;
}
.hero h1 { font-size: clamp(24px, 8vw, 34px); font-weight: 900; margin: 0; letter-spacing: .04em; line-height: 1.3; }
.hero-sub { padding: 16px 0 4px; }
.hero-sub p { color: var(--sub); margin: 0 0 14px; font-size: 15px; }
@media (min-width: 701px) {
  .hero-text { width: 36%; padding: 24px 12px; }
  .hero h1 { font-size: clamp(30px, 4.2vw, 52px); }
  .hero-sub { padding-top: 20px; }
  .hero-sub p { font-size: 16px; }
}
.btn-big {
  display: inline-block; background: var(--accent); color: var(--accent-ink); border: 0; cursor: pointer;
  padding: 14px 28px; border-radius: 999px; font: inherit; font-weight: 700; font-size: 17px; text-decoration: none;
  box-shadow: 0 4px 0 rgba(0,0,0,.12);
}
.btn-big:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.12); }
.btn-big:disabled { opacity: .6; }

.tabs { display: flex; gap: 6px; align-items: center; margin: 12px 0 16px; flex-wrap: wrap; }
.tabs a { text-decoration: none; color: var(--sub); padding: 6px 14px; border-radius: 999px; font-weight: 700; }
.tabs a.on { background: var(--ink); color: var(--bg); }
.tabs .count { margin-left: auto; color: var(--sub); font-size: 14px; }

/* 写真一覧（高さそろえない＝写真の縦横をそのまま見せる） */
.grid { columns: 2; column-gap: 12px; }
@media (min-width: 700px) { .grid { columns: 3; column-gap: 16px; } }
@media (min-width: 1000px) { .grid { columns: 4; } }
.card, .grid .aff {
  break-inside: avoid; display: block; margin-bottom: 12px; background: var(--paper);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: var(--ink);
}
.card img { width: 100%; transition: transform .3s; }
.card:hover img { transform: scale(1.03); }
.card-meta { display: flex; justify-content: space-between; padding: 8px 12px; font-size: 14px; }
.card-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-like { color: var(--heart); flex: none; }
.empty { text-align: center; color: var(--sub); padding: 48px 0; }

.aff { position: relative; padding: 12px; background: var(--paper); border-radius: var(--radius); margin: 16px 0; box-shadow: var(--shadow); }
.aff .pr { display: inline-block; font-size: 11px; font-weight: 700; color: var(--sub); border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; margin-bottom: 6px; }

.pager { display: flex; justify-content: center; gap: 20px; align-items: center; margin: 28px 0; }
.pager a { font-weight: 700; text-decoration: none; }
/* 1枚ページの「一覧にもどる」は押しやすい大きなボタンに（殿の指定） */
.pager .back-list {
  display: inline-block; background: var(--accent); color: var(--accent-ink);
  padding: 12px 28px; border-radius: 999px; font-size: 17px; box-shadow: 0 4px 0 rgba(0,0,0,.12);
}
@media (max-width: 700px) {
  .pager:has(.back-list) { flex-wrap: wrap; gap: 12px 20px; }
  .pager .back-list { order: -1; flex-basis: 100%; text-align: center; padding: 15px 0; font-size: 18px; }
}

/* 1枚ページ */
.post { background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-top: 20px; }
@media (min-width: 860px) { .post { display: grid; grid-template-columns: 3fr 2fr; } }
.post-photo { margin: 0; background: #000; display: flex; align-items: center; justify-content: center; }
.post-photo img { max-height: 80vh; width: auto; }
.post-body { padding: 20px; }
.post-body h1 { margin: 0; font-size: 28px; font-weight: 900; }
.post-by { color: var(--sub); font-size: 14px; margin: 4px 0 12px; }
.post-comment { font-size: 17px; }
.post-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.like { font: inherit; font-weight: 700; font-size: 18px; border: 2px solid var(--heart); color: var(--heart); background: none; border-radius: 999px; padding: 6px 20px; cursor: pointer; }
.like.on { background: var(--heart); color: #fff; }
.like.pop { animation: pop .35s; }
@keyframes pop { 50% { transform: scale(1.2); } }
.shares { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.shares-label { flex-basis: 100%; margin: 0; color: var(--sub); font-size: 13px; font-weight: 700; }
.share {
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; border: 0; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 14px; color: #fff; border-radius: 999px; padding: 8px 16px;
}
.share[hidden] { display: none; }
.hero-sub .shares { justify-content: center; max-width: 560px; margin: 20px auto 0; }
.share-x { background: #000; }
.share-line { background: #06c755; }
.share-facebook { background: #1877f2; }
.share-threads { background: #101010; }
.share-native { background: linear-gradient(45deg, #f9a825, #e1306c 55%, #833ab4); }
.share-copy { background: var(--paper); color: var(--ink); border: 1.5px solid var(--line); }

/* フォーム */
.form-page { max-width: 560px; margin: 24px auto; }
.form-page.narrow { max-width: 380px; }
.form-page h1 { font-weight: 900; margin-bottom: 4px; }
.lead { color: var(--sub); margin-top: 0; }
.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 4px; font-weight: 700; }
.form input[type=text], .form input[type=password], .form textarea {
  font: inherit; font-weight: 500; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--paper); color: var(--ink); width: 100%;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); }
.req { font-size: 11px; background: var(--accent); color: var(--accent-ink); border-radius: 4px; padding: 1px 6px; margin-left: 4px; vertical-align: 2px; }
.drop {
  position: relative; border: 2.5px dashed var(--wall); border-radius: var(--radius); min-height: 200px;
  display: flex !important; align-items: center; justify-content: center; cursor: pointer; background: var(--paper); overflow: hidden;
}
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-empty { display: grid; text-align: center; gap: 4px; font-size: 18px; }
.drop-empty small { color: var(--sub); font-size: 13px; font-weight: 500; }
.drop.has { border-style: solid; }
.drop.has .drop-empty { display: none; }
.drop img { max-height: 360px; width: auto; }
.only-peek { background: var(--accent-soft); border: 2px solid var(--accent); border-radius: var(--radius); padding: 14px 16px; margin: 4px 0 20px; }
.only-peek p { margin: 0 0 6px; }
.only-peek-title { font-size: 19px; font-weight: 900; color: var(--accent); }
.only-peek ul { list-style: none; margin: 8px 0 0; padding: 0; font-size: 14px; }
.only-peek li { margin-top: 4px; }
.only-peek .ng { color: var(--sub); }
.notes { margin: 0; padding-left: 20px; color: var(--sub); font-size: 14px; }
.form .check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* 規約など */
.doc { max-width: 720px; margin: 24px auto; background: var(--paper); padding: 24px; border-radius: var(--radius); }
.doc h1 { margin-top: 0; }
.doc h2 { font-size: 18px; margin-top: 28px; }
.doc-date { color: var(--sub); font-size: 14px; margin-top: 32px; }

/* フッター */
.site-foot { border-top: 1px solid var(--line); margin-top: 48px; padding: 24px 0; font-size: 14px; background: var(--paper); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; }
.site-foot a { color: var(--sub); text-decoration: none; }
.copy { text-align: center; color: var(--sub); margin: 12px 0 0; font-size: 13px; }

/* 管理画面 */
.admin-head { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.admin-head h1 { margin: 0; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--line); color: var(--ink); font-size: 12px; text-align: center; }
.badge.hot { background: var(--accent); color: var(--accent-ink); }
.bulk { margin-bottom: 16px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.admin-card { background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.admin-card img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #111; }
.admin-edit { padding: 12px; display: grid; gap: 6px; font-size: 13px; }
.admin-edit label { display: grid; gap: 2px; color: var(--sub); }
.admin-edit input, .admin-edit textarea { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
.admin-meta { color: var(--sub); margin: 0; }
.admin-link { font-size: 13px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.row-btns form { margin: 0; }
.btn-ok, .btn-sub, .btn-danger { font: inherit; font-size: 14px; font-weight: 700; border-radius: 999px; padding: 6px 14px; cursor: pointer; border: 1.5px solid transparent; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-sub { background: none; border-color: var(--line); color: var(--ink); }
.btn-danger { background: none; border-color: var(--danger); color: var(--danger); }
.msg { background: var(--paper); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; border-left: 4px solid var(--accent); }
.msg.read { border-left-color: var(--line); opacity: .75; }
.msg-meta, .msg-ref { color: var(--sub); font-size: 13px; margin: 0; word-break: break-all; }
