/* =========================================================================
 * style.css — お問い合わせフォーム(index.php / thanks.php)用CSS
 * =========================================================================
 * ニジポスト本体(nijipost.com)の style.css(app/lib/render.php の STYLE_CSS)と
 * 同じデザイントークン・同じ部品を使っています。
 *   ・上部の4色ライン / ブランド名 / カテゴリのピル型ボタン / 新作・特集の文字リンク / フッター
 *   ・本文は720px幅の1カラム、見出しは左に棒、リンクは赤(.page a)、ダークモード対応
 * 「①本体と共通の部分」は本体の値のコピーです。本体のデザインを変えたら、ここも同じように直してください。
 * 「②フォーム専用の部分」だけが、このお問い合わせフォーム独自です。
 *
 * ※ 外部フォント(Google Fonts)は読み込みません。本体と同じ端末標準フォントを使います。
 * ※ 管理画面は assets/css/admin.css を使うので、このファイルの影響を受けません。
 * ========================================================================= */


/* ===================== ① 本体と共通の部分 ===================== */

:root {
  --fg: #1a1a1a;
  --bg: #fdfdfb;
  --muted: #666;
  --accent: #b4181a;
  --border: #e3e3e0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  color-scheme: light dark;
  --lead: #333; --link: #1d4ed8; --card: #fff;
  --c-console: #2563eb; --c-mobile: #ea580c; --c-weeklyAnime: #db2777; --c-manga: #059669;
  --t-console: #1d4ed8; --t-mobile: #c2410c; --t-weeklyAnime: #be185d; --t-manga: #047857;
}
* { box-sizing: border-box; }
img { max-width: 100%; height: auto; }
body { margin: 0; color: var(--fg); background: var(--bg); line-height: 1.75; }
/* 上部の4色ライン(ゲーム機=青 / スマホゲー=橙 / アニメ=ピンク / 漫画=緑) */
body::before { content: ""; display: block; height: 6px; background: linear-gradient(90deg, var(--c-console) 0 25%, var(--c-mobile) 25% 50%, var(--c-weeklyAnime) 50% 75%, var(--c-manga) 75% 100%); }
main { max-width: 720px; margin: 0 auto; padding: 0 1.25rem 3rem; }
h1 { font-size: 1.5rem; line-height: 1.4; margin-bottom: .5rem; }
h2 { font-size: 1.15rem; margin-top: 2rem; border-left: 4px solid var(--muted); padding-left: .5rem; }
.lead { color: var(--lead); font-size: 1.02rem; }
.muted { color: var(--muted); font-size: .85rem; }
.crumb { font-size: .8rem; color: var(--muted); margin: .6rem 0 0; }
.crumb a { color: var(--link); display: inline-block; padding: .45rem .15rem; text-decoration: underline; text-underline-offset: 3px; }
.page a { color: var(--accent); }
.page h2 { margin-top: 2rem; }
.page ul { padding-left: 1.3rem; }
.page li { margin: .35rem 0; }
main a { color: var(--link); }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 10; padding: .5rem 1rem; background: var(--card); color: var(--link); }
.skip-link:focus { left: 0; }

/* ---- ヘッダー ---- */
.site-header { max-width: 720px; margin: 0 auto; padding: 2rem 1.25rem 1rem; }
.brand { font-size: 1.8rem; font-weight: 700; letter-spacing: .02em; color: var(--fg); text-decoration: none; }
.global-nav, .footer-nav { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.global-nav { gap: .5rem .5rem; margin-top: .6rem; }
.global-nav a, .site-header nav a { display: inline-block; padding: .3rem .85rem; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--fg); font-size: .9rem; font-weight: 600; text-decoration: none; }
.global-nav a:hover { border-color: var(--accent); color: var(--accent); }
.global-nav a.nav-console { border-color: var(--c-console); color: var(--t-console); }
.global-nav a.nav-mobile { border-color: var(--c-mobile); color: var(--t-mobile); }
.global-nav a.nav-weeklyAnime { border-color: var(--c-weeklyAnime); color: var(--t-weeklyAnime); }
.global-nav a.nav-manga { border-color: var(--c-manga); color: var(--t-manga); }
.sub-nav { margin-top: .5rem; align-items: center; }
.sub-nav a { font-size: .85rem; font-weight: 500; }
.nav-label { font-size: .75rem; color: var(--muted); font-weight: 700; margin-right: .2rem; }
/* 新作・特集・一覧は枠なしの文字リンク */
.site-header .global-nav.sub-nav { gap: .1rem 1.1rem; margin-top: .6rem; }
.site-header .global-nav.sub-nav a { padding: .25rem 0; border: 0; border-radius: 0; background: none; font-size: .85rem; font-weight: 500; text-decoration: none; }
.site-header .global-nav.sub-nav a:hover { text-decoration: underline; text-underline-offset: 3px; border: 0; }
/* スマホ用のメニュー(PCでは出さない) */
.nl-short { display: none; }
.nav-more { display: none; margin-top: .5rem; }
.nav-more summary { display: flex; justify-content: center; align-items: center; gap: .4rem; min-height: 44px; padding: .4rem 1rem; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--fg); font-size: .88rem; font-weight: 700; cursor: pointer; list-style: none; user-select: none; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary::after { content: "▾"; font-size: .8em; }
.nav-more[open] summary::after { content: "▴"; }
.nav-more summary:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.nav-more-list { display: grid; gap: .35rem; margin-top: .5rem; padding: .6rem; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.nav-more-h { margin: .3rem 0 0; font-size: .72rem; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.nav-more-h:first-child { margin-top: 0; }
.site-header .nav-more-list a { display: flex; align-items: center; min-height: 44px; padding: .4rem .8rem; border: 1px solid var(--border); border-left: 4px solid var(--muted); border-radius: 8px; color: var(--fg); font-size: .9rem; font-weight: 600; text-decoration: none; }
.site-header .nav-more-list a.nav-console { border-left-color: var(--c-console); }
.site-header .nav-more-list a.nav-mobile { border-left-color: var(--c-mobile); }
.site-header .nav-more-list a.nav-weeklyAnime { border-left-color: var(--c-weeklyAnime); }
.site-header .nav-more-list a.nav-manga { border-left-color: var(--c-manga); }
.site-header .nav-more-list a:hover { border-color: var(--accent); }

/* ---- フッター ---- */
.site-footer { max-width: 720px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; color: var(--muted); font-size: .8rem; border-top: 1px solid var(--border); }
.site-footer a { color: inherit; }
.footer-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 1rem 1.5rem; margin-bottom: 1.2rem; }
.fn-h { margin: 0 0 .15rem; font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
.fn-group a { display: block; padding: .4rem 0; }

@media (max-width: 480px) {
  .site-header { padding: 1.1rem 1.25rem .4rem; }
  .brand { font-size: 1.5rem; }
  /* カテゴリ5つは短い名前で1行に収める。新作・特集・一覧は、押すと開くメニューにする */
  .site-header .global-nav { gap: .25rem; margin: .6rem 0 0; justify-content: space-between; }
  .site-header .global-nav a { padding: .5rem .28rem; font-size: clamp(.68rem, 3.2vw, .8rem); white-space: nowrap; }
  .nl-full { display: none; }
  .nl-short { display: inline; }
  .nav-pc { display: none; }
  .nav-more { display: block; }
  .footer-nav { grid-template-columns: 1fr; gap: .5rem; }
  .fn-group { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.1rem; }
  .fn-h { flex: 0 0 100%; }
  .fn-group a { display: inline-block; padding: .4rem 0; }
}

/* ---- 本体の部品(フォームでも使うもの) ---- */
/* 「NEW」と同じ小さな札 → 必須マークに使う */
.tag { font-size: .7rem; padding: .05rem .4rem; border-radius: 4px; color: #fff; background: #777; margin-right: .3rem; }
.tag.new { background: #fdecec; color: #b4181a; box-shadow: inset 0 0 0 1px #f1b8b9; }
/* 注意書き(本体の .carried-note と同じ) */
.carried-note { background: rgba(217,119,6,.14); border-left: 3px solid #d97706; border-radius: 4px; padding: .45rem .8rem; margin: .8rem 0; font-size: .85rem; }
/* カード(本体の .today-note と同じ。左に棒) */
.today-note { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--muted); border-radius: 10px; padding: .4rem 1rem .6rem; margin: 1.2rem 0; }
/* 表(本体の .data-table / .info-table と同じ) */
.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 1rem 0; }
.data-table th, .data-table td { border-bottom: 1px solid var(--border); padding: .5rem .4rem; text-align: right; }
.info-table th { text-align: left; width: 8em; color: var(--muted); font-weight: 600; }
.info-table td { text-align: left; }
/* ボタン(本体の .btn-source と同じ丸いボタン) */
.btn-primary, .btn-secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .45rem 1.3rem; border: 1px solid var(--link); border-radius: 999px; font: inherit; font-size: .95rem; font-weight: 700; text-decoration: none; cursor: pointer; text-align: center; }
.btn-primary { background: var(--link); color: #fff; }
.btn-secondary { background: var(--card); color: var(--link); }
main .btn-primary { color: #fff; }
main .btn-secondary { color: var(--link); }
.btn-primary:hover { opacity: .9; }
.btn-secondary:hover { background: rgba(128,128,128,.12); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

@media (prefers-color-scheme: dark) {
  :root { --fg: #ececec; --lead: #d8d8d8; --bg: #14161a; --muted: #9a9a9a; --accent: #ff8a8c; --border: #2b2e34; --link: #8ab4ff; --card: #1c1f25; --t-console: #8ab4ff; --t-mobile: #fb923c; --t-weeklyAnime: #f472b6; --t-manga: #34d399; }
  .tag.new { background: #3a1c1d; color: #ff9fa1; box-shadow: inset 0 0 0 1px #6b2c2e; }
  main .btn-primary { color: #111; }
}


/* ===================== ② フォーム専用の部分 ===================== */

/* ---- 入力欄(本体のカードと同じ、細い枠・角丸。スマホで拡大されないよう文字は16px) ---- */
.field { margin-bottom: 1.25rem; }
.field label, .field .label { display: block; font-size: .9rem; font-weight: 700; margin-bottom: .35rem; }
.field .tag { margin-left: .4rem; margin-right: 0; font-weight: 700; vertical-align: .1em; }
.contact-form input, .contact-form textarea, .contact-form select {
  display: block; width: 100%; padding: .6rem .8rem; border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); color: var(--fg); font: inherit; font-size: 16px; line-height: 1.6;
}
.contact-form input::placeholder, .contact-form textarea::placeholder { color: var(--muted); opacity: .75; }
.contact-form input:focus, .contact-form textarea:focus, .contact-form select:focus {
  outline: 2px solid var(--link); outline-offset: 1px; border-color: var(--link);
}
.contact-form select { min-height: 44px; }
.contact-form textarea { min-height: 9.5rem; resize: vertical; line-height: 1.7; }
.hint { font-size: .8rem; color: var(--muted); margin: .35rem 0 0; line-height: 1.6; }

/* スパム対策の計算問題(本体の .today-note と同じカード) */
.captcha-box { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: 0 0 1.4rem; padding: .7rem 1rem; background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--muted); border-radius: 10px; }
.captcha-question { font-size: 1.3rem; font-weight: 700; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.contact-form .captcha-box input { width: 5.5rem; text-align: center; font-size: 1.1rem; padding: .45rem .5rem; }
.captcha-label { flex: 1 1 9em; font-size: .8rem; color: var(--muted); line-height: 1.55; }
.captcha-refresh { min-height: 44px; padding: .3rem .9rem; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--fg); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.captcha-refresh:hover { border-color: var(--accent); color: var(--accent); }
.captcha-refresh:disabled { opacity: .5; cursor: default; }

.submit-btn { width: 100%; min-height: 48px; font-size: 1rem; letter-spacing: .04em; }
.privacy-note { font-size: .78rem; color: var(--muted); text-align: center; margin: 1rem 0 0; line-height: 1.7; }
.page .privacy-note a { color: inherit; }

/* エラー(赤の棒)。注意書きは上の .carried-note を使う */
.alert { background: rgba(180,24,26,.08); border-left: 3px solid var(--accent); border-radius: 4px; padding: .6rem .9rem; margin: 0 0 1.2rem; font-size: .9rem; }
.alert strong { color: var(--accent); }

/* 「ご連絡の前に」の枠 */
.contact-intro { margin: 1rem 0; }
.contact-intro p { margin: .4rem 0; }
.contact-intro ul { margin: .4rem 0; }
.contact-actions { margin: 1.4rem 0 0; }

/* ---- やり取り(メールのリンクから開く続きの画面) ---- */
.thread { display: flex; flex-direction: column; gap: .8rem; margin: .9rem 0 .4rem; }
.msg { max-width: 92%; }
.msg-meta { font-size: .75rem; color: var(--muted); margin-bottom: .2rem; display: flex; gap: .6rem; align-items: baseline; }
.msg-meta b { color: var(--fg); }
.msg-body { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--muted); border-radius: 8px; padding: .55rem .8rem; font-size: .95rem; line-height: 1.8; white-space: pre-wrap; word-break: break-word; }
.msg-user { align-self: flex-start; }
.msg-admin { align-self: flex-end; }
.msg-admin .msg-meta { justify-content: flex-end; }
.msg-admin .msg-body { border-left-color: var(--link); background: rgba(128,128,128,.08); }
.fixed-info { margin: 0; padding: .55rem .8rem; background: var(--card); border: 1px solid var(--border); border-radius: 8px; word-break: break-all; }
@media (max-width: 480px) { .msg { max-width: 100%; } }

/* ---- 送信完了ページ ---- */
.thanks-card { text-align: center; margin-top: 1.2rem; }
.thanks-card h1 { text-align: center; }
.success-ring { width: 64px; height: 64px; border-radius: 50%; background: var(--c-manga); color: #fff; display: flex; align-items: center; justify-content: center; margin: 1.4rem auto 1rem; font-size: 32px; font-weight: 700; animation: popIn .45s cubic-bezier(.175,.885,.32,1.275) both; }
@keyframes popIn { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .success-ring { animation: none; } }
.thanks-card .lead { margin: .3rem 0 1.4rem; }
.receipt { text-align: left; background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--c-manga); border-radius: 10px; padding: .3rem 1rem; margin: 0 0 1.2rem; }
.receipt .info-table { margin: 0; }
.receipt .info-table tr:last-child th, .receipt .info-table tr:last-child td { border-bottom: 0; }
.receipt-id { font-size: 1.15rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.autoreply-note { text-align: left; background: rgba(5,150,105,.1); border-left: 3px solid var(--c-manga); border-radius: 4px; padding: .5rem .8rem; margin: 0 0 1.4rem; font-size: .88rem; line-height: 1.7; }
.autoreply-note strong { word-break: break-all; }
.countdown-wrap { margin: 0 0 1.2rem; }
.countdown-label { font-size: .85rem; color: var(--muted); margin-bottom: .5rem; }
.countdown-ring-wrap { position: relative; width: 60px; height: 60px; margin: 0 auto .4rem; }
.countdown-ring-wrap svg { transform: rotate(-90deg); }
.ring-bg { stroke: var(--border); fill: none; }
.ring-fg { stroke: var(--link); fill: none; stroke-linecap: round; transition: stroke-dashoffset .9s linear; }
.countdown-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.countdown-text { font-size: .85rem; color: var(--muted); }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
