:root {
  --brand: #7A3E50;
  --brand-dark: #5E2F3E;
  --brand-50: #F7EDEF;
  --bg: #FFFFFF;      /* ページの地色（作品写真の色が正しく見えるよう白） */
  --surface: #FFFFFF; /* カード・入力欄など */
  --paper: #FBF8F4;   /* カード内などの淡い面 */
  --washi: #F4EEE6;
  --line: #EDE5DC;
  /* 紙の質感（ヘッダー・フッター・ヒーローだけに使う）：細かい粒と、和紙の繊維のようなかすれ */
  --tex: url("/assets/img/paper.png");
  --ink: #3B2F2F;
  --muted: #8A7D77;
  --gold: #A8875A;
  --shadow-soft: 0 1px 2px rgba(59, 47, 47, .04), 0 4px 16px -8px rgba(59, 47, 47, .08);
  --shadow-lift: 0 2px 4px rgba(59, 47, 47, .04), 0 18px 36px -16px rgba(122, 62, 80, .28);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif;
  line-height: 1.85;
  letter-spacing: 0.03em;
  animation: page-in .5s var(--ease) both;
}
h1, h2, h3, .font-mincho {
  font-family: "Shippori Mincho", "Yu Mincho", serif;
  letter-spacing: 0.06em;
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--brand-50); color: var(--brand-dark); }

/* ---------- 地紋・ヒーロー ---------- */
.bg-seigaiha {
  background-color: var(--washi);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='20' viewBox='0 0 40 20'%3E%3Cg fill='none' stroke='%237A3E50' stroke-opacity='.07'%3E%3Cpath d='M0 20a20 20 0 0 1 40 0M6 20a14 14 0 0 1 28 0M12 20a8 8 0 0 1 16 0M-20 10a20 20 0 0 1 40 0M20 10a20 20 0 0 1 40 0M-14 10a14 14 0 0 1 28 0M26 10a14 14 0 0 1 28 0'/%3E%3C/g%3E%3C/svg%3E");
}

/* ヒーローは白（柄・にじみなし） */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--bg);
}
/* ---------- 見出し ---------- */

.section-head h2 { font-size: 1.45rem; font-weight: 700; line-height: 1.5; margin-top: .15rem; }

.section-title {
  display: flex; align-items: center; gap: .7rem;
  font-family: "Shippori Mincho", serif; font-weight: 700;
  font-size: 1.2rem; color: var(--ink);
}
.section-title::before {
  content: ""; width: 1.1rem; height: 1px; background: var(--gold);
}

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .5rem 1.2rem; border-radius: 9999px;
  font-weight: 500; font-size: .95rem; line-height: 1.2;
  transition: background-color .2s, color .2s, border-color .2s, box-shadow .25s, transform .15s, opacity .2s;
  cursor: pointer; white-space: nowrap; text-decoration: none;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; border: 1px solid var(--brand); box-shadow: 0 6px 16px -8px rgba(122, 62, 80, .6); }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); box-shadow: 0 10px 22px -10px rgba(122, 62, 80, .7); }
.btn-ghost { background: var(--surface); color: var(--brand); border: 1px solid var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-50); }
.btn-danger { background: var(--surface); color: #A3312F; border: 1px solid #EBC9C6; }
.btn-danger:hover:not(:disabled) { background: #FBEDEC; }
.btn-sm { min-height: 36px; padding: .3rem .9rem; font-size: .85rem; }

/* ---------- フォーム ---------- */
.label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .35rem; }
.hint { font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: .55rem .9rem;
  border: 1px solid var(--line); border-radius: .75rem; background: var(--surface);
  font-size: 1rem; /* iOS のズーム防止 */ color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.textarea { min-height: 8rem; line-height: 1.7; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(122, 62, 80, .1);
}

/* 検索ボックス（ボタン内蔵） */
.search-box {
  display: flex; align-items: center; gap: .25rem;
  background: var(--surface); border-radius: 9999px; padding: .3rem .3rem .3rem 1.2rem;
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px -16px rgba(122, 62, 80, .3);
  transition: box-shadow .25s;
}
.search-box:focus-within { box-shadow: 0 0 0 4px rgba(122, 62, 80, .1), 0 12px 32px -14px rgba(122, 62, 80, .35); }
.search-box input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 1rem; min-height: 44px; }

/* ---------- カード ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 1.25rem; }
/* ヘッダー・フッターに紙の質感を重ねる（作家一覧などは白のまま） */
[class*="bg-chrome"] { background-image: var(--tex); }
.card-hover { transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s; }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: rgba(122, 62, 80, .25); }
.card-hover .zoom { transition: transform .8s var(--ease); }
.card-hover:hover .zoom { transform: scale(1.06); }

/* 日付タイル（イベント） */
.date-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 3.6rem; height: 3.9rem; border-radius: .9rem; flex-shrink: 0;
  background: var(--brand-50); color: var(--brand); line-height: 1.1;
}
.date-tile:has(.y) { height: auto; padding: .35rem 0; }
.date-tile .y { font-size: .58rem; letter-spacing: .08em; opacity: .75; }
.date-tile .m { font-size: .65rem; letter-spacing: .1em; }
.date-tile .d { font-family: "Shippori Mincho", serif; font-size: 1.5rem; font-weight: 700; }
.date-tile .w { font-size: .6rem; opacity: .8; }

/* ---------- チップ・タグ ---------- */
.chip {
  display: inline-flex; align-items: center; min-height: 36px;
  padding: .25rem .95rem; border-radius: 9999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: .875rem; cursor: pointer; user-select: none; white-space: nowrap;
  transition: background-color .2s, border-color .2s, color .2s, transform .15s;
}
.chip:hover { border-color: rgba(122, 62, 80, .45); }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-sm { min-height: 32px; padding: .15rem .75rem; font-size: .8rem; }

/* ページ送り */
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 .6rem; border-radius: 9999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: .9rem;
  transition: border-color .15s, background-color .15s;
}
a.page-btn:hover { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.page-btn[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.page-btn[aria-disabled="true"] { opacity: .35; }

.tag {
  display: inline-block; padding: .05rem .6rem; border-radius: 9999px;
  background: var(--brand-50); color: var(--brand-dark); font-size: .72rem; line-height: 1.75;
}
.tag-muted { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }

/* PR 表記 */
.pr-badge {
  display: inline-block; padding: 0 .45rem; border: 1px solid var(--gold); border-radius: 4px;
  color: var(--gold); background: var(--surface); font-size: .68rem; font-weight: 700; letter-spacing: .12em; line-height: 1.6;
}

/* ---------- 改行の整え（サイト全体） ----------
   対応ブラウザでは、日本語を語の途中で改行しない（例：「ご購／入」にならない）。
   非対応のブラウザでは従来どおりの改行になるだけで、表示が崩れることはない。 */
body { word-break: auto-phrase; }
/* 文章：最後の行に1〜2文字だけ残らないようにする */
p, li, dd, dt, label, summary, .hint { text-wrap: pretty; }
/* 見出し・中央寄せの文：各行の長さをそろえる */
h1, h2, h3, .section-title, .text-center p, p.text-center { text-wrap: balance; }
/* URL など区切りのない長い文字列は、はみ出さないよう折り返す */
p, li, dd { overflow-wrap: anywhere; }

/* 中央寄せの日本語文（個別指定用） */
.text-balance-ja { text-wrap: balance; word-break: auto-phrase; }

/* 改行を保持してプレーンテキストを表示 */
.pre-line { white-space: pre-line; overflow-wrap: anywhere; }

/* 規約ページ等の本文 */
.doc h2 { font-size: 1.15rem; font-weight: 700; margin: 2.2rem 0 .6rem; color: var(--brand-dark); }
.doc p, .doc li { font-size: .95rem; }
.doc ol { list-style: decimal; padding-left: 1.4rem; }
.doc ul { list-style: disc; padding-left: 1.4rem; }
.doc li { margin: .25rem 0; }

/* ---------- ヘッダー ---------- */
.site-header { transition: box-shadow .3s, background-color .3s; }
.site-header.scrolled { box-shadow: 0 6px 20px -16px rgba(59, 47, 47, .3); }

/* ---------- ドロップダウン ---------- */
.dropdown:not(.hidden) { animation: drop-in .18s var(--ease); transform-origin: top right; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- 作品の拡大表示 ---------- */
dialog.lightbox::backdrop { background: rgba(40, 25, 30, .6); backdrop-filter: blur(3px); }
dialog.lightbox[open] { animation: pop-in .35s var(--ease); }
dialog.lightbox[open]::backdrop { animation: fade-in .3s ease; }

/* ---------- トースト ---------- */
#toast {
  position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%) translateY(150%);
  background: var(--ink); color: #fff; padding: .75rem 1.3rem; border-radius: 9999px;
  font-size: .9rem; z-index: 60; transition: transform .35s var(--ease); max-width: calc(100% - 2rem);
  box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .4);
}
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.error { background: #A3312F; }

/* ---------- 読み込み中のスケルトン ---------- */
.skeleton {
  background: linear-gradient(90deg, #F1EBE4 25%, #F8F4EF 50%, #F1EBE4 75%);
  background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; border-radius: .6rem;
}

/* ---------- スクロールで現れる ---------- */
.js-reveal .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js-reveal .reveal.is-visible { opacity: 1; transform: none; }

/* ヒーローの登場 */
.fade-up { animation: fade-up .9s var(--ease) both; }
.delay-1 { animation-delay: .08s; }
.delay-2 { animation-delay: .18s; }
.delay-3 { animation-delay: .28s; }
.delay-4 { animation-delay: .38s; }

@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* 動きを減らす設定の方には、アニメーションを止める */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js-reveal .reveal { opacity: 1; transform: none; }
}

.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.scroll-x { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.scroll-x::-webkit-scrollbar { display: none; }
