/*
 * site-additions.css — 縦スクロールビューア / NEWS / 漫画一覧の最小スタイル（御家騒動 / A-GARTEN）
 *  ヘッダー/フッター（.gh-header/.gh-footer）は廃止し、実サイトのデザインである
 *  assets/css/site-header.css・site-footer.css（＋assets/js/site-parts.jsの注入）に統一した。
 *  ここには manga/news ページ固有の中身のスタイルのみ残す。
 */

/* ── ページ全体（introduction/index.html と同じダークテーマ・スクロール型） ── */
html {
  min-height: 100%;
  background: var(--bg) url('/img/PC_haikei.png') no-repeat center center fixed;
  background-size: cover;
  scroll-behavior: smooth;
}
body {
  min-height: 100vh;
  color: var(--paper);
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 300;
  line-height: 1.9;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 70% 0%, rgba(166,134,63,0.18), transparent 55%),
    linear-gradient(180deg, rgba(23,25,15,0.6) 0%, rgba(15,16,12,0.88) 100%);
}
/* スクロールするページなのでヘッダーを上に固定 */
.site-header { position: sticky; top: 0; }

/* ── 縦スクロールビューア ── */
.gh-reader { flex: 1 1 auto; width: 100%; max-width: 800px; margin: 0 auto; padding: 24px 16px; }
.gh-reader__title {
  text-align: center;
  font-family: 'Shippori Mincho', serif;
  font-size: 20px;
  letter-spacing: 0.1em;
  color: var(--paper);
  margin-bottom: 24px;
  opacity: 0;
  transform: translateX(-16px);
  animation: paraTextIn 1s cubic-bezier(0.215, 0.610, 0.355, 1) forwards;
  animation-delay: 0.2s;
}
.gh-reader__pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  opacity: 0;
  transform: translateY(16px);
  animation: newsCardIn 0.9s cubic-bezier(0.215, 0.610, 0.355, 1) forwards;
  animation-delay: 0.35s;
}
.gh-reader__page { width: 100%; max-width: 720px; height: auto; display: block; }
.gh-reader__nav {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; margin-top: 32px;
  opacity: 0;
  animation: paraTextIn 1s cubic-bezier(0.215, 0.610, 0.355, 1) forwards;
  animation-delay: 0.55s;
}
.gh-reader__navbtn { color: var(--paper); text-decoration: none; font-size: 14px; padding: 8px 12px; transition: color 0.3s; }
.gh-reader__navbtn:not(.is-disabled):hover { color: var(--gold); }
.gh-reader__navbtn.is-disabled { color: var(--paper-dim); opacity: .6; pointer-events: none; }

/* ── NEWS ── */
.gh-newspage { flex: 1 1 auto; width: 100%; max-width: 720px; margin: 0 auto; padding: 24px 16px; }
.gh-newspage__title {
  font-family: 'Shippori Mincho', serif;
  font-size: 20px;
  letter-spacing: 0.1em;
  color: var(--paper);
  margin-bottom: 16px;
  opacity: 0;
  transform: translateX(-16px);
  animation: paraTextIn 1s cubic-bezier(0.215, 0.610, 0.355, 1) forwards;
  animation-delay: 0.2s;
}
.gh-news { list-style: none; margin: 0; padding: 0; }
.gh-news__item {
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transform: translateY(16px);
  animation: newsCardIn 0.8s cubic-bezier(0.215, 0.610, 0.355, 1) forwards;
}
.gh-news__item:nth-child(1) { animation-delay: 0.35s; }
.gh-news__item:nth-child(2) { animation-delay: 0.45s; }
.gh-news__item:nth-child(3) { animation-delay: 0.55s; }
.gh-news__item:nth-child(4) { animation-delay: 0.65s; }
.gh-news__item:nth-child(5) { animation-delay: 0.75s; }
.gh-news__item:nth-child(6) { animation-delay: 0.85s; }
.gh-news__row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 4px; color: var(--paper); text-decoration: none; flex-wrap: wrap;
  background: none; border: none; font: inherit; text-align: left; cursor: pointer;
  transition: color 0.3s;
}
.gh-news__row:hover, .gh-news__row:focus-visible { color: var(--gold); }
.gh-news__row:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
.gh-news__date { font-size: 12px; color: var(--paper-dim); opacity: 1; min-width: 92px; }
.gh-news__badge {
  font-size: 11px; padding: 2px 8px; border-radius: 999px; color: #fff; white-space: nowrap;
}
.gh-news__badge--manga { background: #7b5ea7; } /* 漫画 */
.gh-news__badge--booth { background: #3a8fb7; } /* BOOTH */
.gh-news__badge--info  { background: #8a8a8a; } /* お知らせ */
.gh-news__title { font-size: 14px; }
.gh-news__empty { color: var(--paper-dim); font-size: 14px; }

/* ── NEWS モーダル（行クリックで本文を表示） ── */
body.is-news-modal-open { overflow: hidden; }
.gh-news-modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  visibility: hidden; pointer-events: none;
}
.gh-news-modal.is-open { visibility: visible; pointer-events: auto; }
.gh-news-modal__overlay {
  position: absolute; inset: 0;
  background: rgba(6, 6, 4, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.gh-news-modal.is-open .gh-news-modal__overlay { opacity: 1; }
.gh-news-modal__box {
  position: relative;
  width: min(92vw, 480px);
  max-height: 80vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  padding: 32px 28px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.gh-news-modal.is-open .gh-news-modal__box { opacity: 1; transform: translateY(0); }
.gh-news-modal__close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--paper-dim);
  font-size: 22px; line-height: 1; cursor: pointer;
  transition: color 0.3s;
}
.gh-news-modal__close:hover, .gh-news-modal__close:focus-visible { color: var(--gold); }
.gh-news-modal__head { display: flex; align-items: center; gap: 10px; padding-right: 32px; }
.gh-news-modal__date { font-size: 12px; color: var(--paper-dim); }
.gh-news-modal__title {
  margin: 12px 0 0;
  font-family: 'Shippori Mincho', serif;
  font-size: 18px;
  letter-spacing: 0.06em;
  color: var(--paper);
}
.gh-news-modal__body {
  margin: 16px 0 0;
  font-size: 14px;
  line-height: 1.9;
  color: var(--paper);
  white-space: pre-line;
}

/* ── 漫画一覧 ── */
.gh-mangapage { flex: 1 1 auto; width: 100%; max-width: 1000px; margin: 0 auto; padding: 24px 16px 60px; }
.gh-manga-intro {
  max-width: 720px;
  padding: clamp(24px, 3.5vh, 36px) 0 12px;
  border-bottom: 1px solid var(--line);
}
.gh-manga-intro__no {
  margin: 0;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: .28em;
  color: var(--gold);
  opacity: 0;
  transform: translateY(8px);
  animation: mangaIntroIn .85s cubic-bezier(0.215, 0.610, 0.355, 1) forwards;
  animation-delay: .08s;
}
.gh-manga-intro__copy {
  margin: 10px 0 0;
  font-family: 'Shippori Mincho', serif;
  font-size: clamp(20px, 2.2vw, 25px);
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: .14em;
  color: var(--paper);
  opacity: 0;
  transform: translateY(8px);
  animation: mangaIntroIn .9s cubic-bezier(0.215, 0.610, 0.355, 1) forwards;
  animation-delay: .16s;
}
.gh-manga-intro__body {
  max-width: 38em;
  margin-top: clamp(16px, 2.4vh, 24px);
  color: var(--paper-dim);
  font-size: clamp(13px, 1.2vw, 14px);
  line-height: 1.75;
  letter-spacing: .08em;
  opacity: 0;
  transform: translateY(8px);
  animation: mangaIntroIn .9s cubic-bezier(0.215, 0.610, 0.355, 1) forwards;
  animation-delay: .26s;
}
.gh-manga-intro__body p { margin: 0; }
.gh-manga-intro__body p + p { margin-top: .55em; }
.gh-manga-catalog { padding-top: clamp(28px, 4vh, 42px); }
.gh-mangapage__title {
  font-family: 'Shippori Mincho', serif;
  font-size: 20px;
  letter-spacing: 0.1em;
  color: var(--paper);
  margin-bottom: 16px;
  opacity: 0;
  transform: translateX(-16px);
  animation: paraTextIn 1s cubic-bezier(0.215, 0.610, 0.355, 1) forwards;
  animation-delay: 0.2s;
}
/* 「第1話から読む」導線（絞り込みタブの影響を受けない固定リンク） */
.gh-manga__start {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Shippori Mincho', serif;
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--paper);
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 12px 20px;
  margin-bottom: 28px;
  transition: color 0.3s, border-color 0.3s;
  opacity: 0;
  animation: paraTextIn 1s cubic-bezier(0.215, 0.610, 0.355, 1) forwards;
  animation-delay: 0.35s;
}
.gh-manga__start:hover { color: var(--gold); border-color: var(--gold); }

/* 絞り込み（すべて／日常／ストーリー）＋ 並び順の並び ── 同じ行の左右に配置 */
.gh-manga__toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 28px;
  opacity: 0;
  animation: paraTextIn 1s cubic-bezier(0.215, 0.610, 0.355, 1) forwards;
  animation-delay: 0.45s;
}
.gh-manga__filter { display: flex; gap: 24px; }
.gh-manga__tab {
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--paper-dim);
  padding: 4px 2px;
  transition: color 0.3s;
}
.gh-manga__tab:hover { color: var(--paper); }
.gh-manga__tab.current { color: var(--gold); }
.gh-manga__tab.current::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -11px;
  height: 1px;
  background: var(--gold);
}

/* 並び順トグル（最新話順／古い順）── フィルタと独立した小さなボタン */
.gh-manga__sort { display: flex; align-items: center; gap: 14px; }
.gh-manga__sortbtn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--paper-dim);
  padding: 4px 2px;
  transition: color 0.3s;
}
.gh-manga__sortbtn:hover { color: var(--paper); }
.gh-manga__sortbtn.current { color: var(--gold); }

/* 一覧グリッド */
.gh-manga__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px 20px;
}
.gh-manga__card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--paper);
  opacity: 0;
  transform: translateY(16px);
  animation: newsCardIn 0.8s cubic-bezier(0.215, 0.610, 0.355, 1) forwards;
}
.gh-manga__card:nth-child(1) { animation-delay: 0.55s; }
.gh-manga__card:nth-child(2) { animation-delay: 0.65s; }
.gh-manga__card:nth-child(3) { animation-delay: 0.75s; }
.gh-manga__card:nth-child(4) { animation-delay: 0.85s; }
.gh-manga__card:nth-child(5) { animation-delay: 0.95s; }
.gh-manga__card:nth-child(6) { animation-delay: 1.05s; }
/* 絞り込み/並び替えタブでの再描画時は登場アニメを止め、瞬時に切り替える */
.gh-manga__grid--noanim .gh-manga__card {
  animation: none;
  opacity: 1;
  transform: none;
}
.gh-manga__thumb {
  width: 100%;
  height: 240px;
  overflow: hidden;
  background: var(--bg-alt);
  border: 1px solid var(--line);
}
.gh-manga__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.gh-manga__card:hover .gh-manga__thumb img { transform: scale(1.05); }
.gh-manga__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--paper-dim);
}
.gh-manga__badge {
  font-size: 10px; padding: 2px 8px; border-radius: 999px; color: #fff; white-space: nowrap;
}
.gh-manga__badge--story { background: var(--gold); } /* ストーリー */
.gh-manga__badge--daily { background: #4d7a63; } /* 日常 */
.gh-manga__title {
  font-family: 'Shippori Mincho', serif;
  font-size: 14px;
  letter-spacing: 0.05em;
  line-height: 1.4;
  margin-top: 6px;
  color: var(--paper);
}
.gh-manga__date { font-family: 'Space Mono', monospace; font-size: 10px; color: var(--paper-dim); margin-top: 4px; }
.gh-manga__empty { color: var(--paper-dim); font-size: 14px; }

/* ── 登場アニメーション（他ページと同じトーン。TOPからの遷移が唐突に見えないための着地演出） ── */
@keyframes paraTextIn { to { opacity: 1; transform: translateX(0); } }
@keyframes newsCardIn { to { opacity: 1; transform: translateY(0); } }
@keyframes mangaIntroIn { to { opacity: 1; transform: none; } }

/* ── スマホ幅（375/390）調整 ── */
@media (max-width: 480px) {
  .gh-manga-intro { padding: 36px 0 28px; }
  .gh-manga-intro__copy { font-size: clamp(19px, 5.4vw, 23px); }
  .gh-manga-intro__body { margin-top: 16px; font-size: 12px; line-height: 1.8; }
  .gh-manga-catalog { padding-top: 28px; }
  .gh-news__row { gap: 6px; }
  .gh-news__date { min-width: auto; width: 100%; }
  .gh-manga__grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 20px 14px; }
  .gh-manga__thumb { height: 190px; }
  .gh-manga__filter { gap: 18px; }
  .gh-manga__sort { gap: 10px; }
  .gh-news-modal { padding: 16px; }
  .gh-news-modal__box { padding: 26px 20px; max-height: 85vh; }
}

/* モーション減設定への配慮（他ページと同じ方針） */
@media (prefers-reduced-motion: reduce) {
  .gh-newspage__title,
  .gh-mangapage__title,
  .gh-manga-intro__no,
  .gh-manga-intro__copy,
  .gh-manga-intro__body,
  .gh-manga__start,
  .gh-manga__toolbar,
  .gh-news__item,
  .gh-manga__card,
  .gh-reader__title,
  .gh-reader__pages,
  .gh-reader__nav {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .gh-news-modal__overlay,
  .gh-news-modal__box {
    transition: none !important;
  }
}
