/*
Theme Name: matomeba GT
Description: まとめサイト用テーマ「ガールズトーク型」（デザイン案12）。人気＝何サイトが扱ったか（話題度）で並べる。
Version: 1.0.0
Requires PHP: 8.0
Text Domain: matomeba-gt
*/

/* ------------------------------------------------------------------
   配色（2026-10-18 決定。根拠は Matome_site プロジェクトの システム解説.md §6-3）
   - 看板色: サンゴピンク（女性は赤〜ピンク寄りを好む傾向: Hurlbert & Ling 2007）
   - リンク・補助色: 青（性別・文化を問わず最も好まれる／信頼感: Hurlbert & Ling 2007, Palmer & Schloss 2010）
   - 背景: ピンク寄りの温かい白（くすんだ黄・茶は好まれにくい: Palmer & Schloss 2010）
   - 文字のコントラストは 4.5:1 以上（WCAG 2.x AA）
   ------------------------------------------------------------------ */
:root {
  --pink: #FF8A97;        /* 看板色（帯・タブ）。上の文字は --on-pink */
  --pink-soft: #FFC2CA;   /* 順位の丸（上位） */
  --pink-tint: #FFF0F2;   /* 薄い面 */
  --pink-text: #C2364E;   /* 白地の上のピンク文字（5.3:1） */
  --on-pink: #3B1A22;     /* ピンクの上の文字（8:1） */
  --blue: #1F6FB2;        /* リンク（5.3:1） */
  --blue-tint: #E6F1FA;
  --bg: #FFF9F6;          /* 背景（温かい白） */
  --card: #FFFFFF;
  --line: #F2DCD8;
  --ink: #3B3335;         /* 本文（12:1） */
  --muted: #7A6569;       /* 補足（5.4:1） */
  --radius: 10px;
  --font: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.7; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.mgt-wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------- ヘッダー ---------------- */
.mgt-header { background: var(--pink); }
.mgt-header__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding-top: 14px; padding-bottom: 14px; }
.mgt-logo { font-weight: 800; font-size: 28px; line-height: 1.2; color: var(--on-pink); letter-spacing: .02em; }
.mgt-logo:hover { text-decoration: none; }
.mgt-catch { display: block; font-size: 12px; font-weight: 700; color: var(--on-pink); margin-top: 2px; }
.mgt-search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 8px; background: #fff; flex: 0 1 340px; min-width: 200px; }
.mgt-search input { border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; width: 100%; min-width: 0; color: var(--ink); }
.mgt-search button { border: 0; background: transparent; padding: 0; cursor: pointer; color: var(--muted); display: flex; }
.mgt-nav { background: #fff; border-bottom: 3px solid var(--pink); }
.mgt-nav ul { list-style: none; margin: 0 auto; padding-top: 0; padding-bottom: 0; display: flex; flex-wrap: wrap; }
.mgt-nav a { display: block; padding: 12px 16px; font-size: 14px; font-weight: 700; color: var(--ink); }
.mgt-nav a:hover, .mgt-nav .is-current a { color: var(--pink-text); text-decoration: none; }

/* ---------------- レイアウト ---------------- */
.mgt-body { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; padding-top: 20px; padding-bottom: 56px; }
.mgt-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.mgt-side { flex: 1 1 290px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.mgt-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mgt-box__title { margin: 0; padding: 10px 14px; background: var(--pink); color: var(--on-pink); font-size: 15px; font-weight: 800; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mgt-box__title a { color: var(--on-pink); font-size: 12px; }

/* ---------------- タブ・一覧 ---------------- */
.mgt-tabs { display: flex; font-weight: 800; font-size: 15px; }
.mgt-tabs a { flex: 1; text-align: center; padding: 14px; background: var(--pink-tint); color: var(--pink-text); }
.mgt-tabs a.is-on { background: var(--pink); color: var(--on-pink); }
.mgt-tabs a:hover { text-decoration: none; }
.mgt-date { padding: 10px 16px; font-size: 13px; color: var(--muted); font-weight: 700; border-bottom: 1px dashed var(--line); }
.mgt-list { list-style: none; margin: 0; padding: 0; }
.mgt-row { border-bottom: 1px dashed var(--line); }
.mgt-row > a { display: flex; gap: 12px; padding: 12px 16px; align-items: center; color: var(--ink); }
.mgt-row > a:hover { background: var(--pink-tint); text-decoration: none; }
.mgt-rank { flex: none; width: 36px; height: 36px; border-radius: 50%; background: #EFE4E5; color: var(--on-pink); font-weight: 800; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.mgt-rank.is-top { background: var(--pink-soft); }
.mgt-thumb { flex: none; width: 128px; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 6px; background: var(--pink-tint); }
.mgt-row__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.mgt-row__title { font-weight: 800; font-size: 16px; line-height: 1.5; }
.mgt-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); font-weight: 700; align-items: center; }
.mgt-heat { color: var(--pink-text); }
.mgt-more { display: block; text-align: center; padding: 16px; font-weight: 800; font-size: 15px; color: var(--pink-text); background: var(--pink-tint); }
.mgt-empty { padding: 24px 16px; color: var(--muted); }

/* カテゴリのラベル（薄い面＋濃い文字。すべて 4.5:1 以上） */
.mgt-cat { padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; background: #F3EEEE; color: var(--ink); }
.mgt-cat--politics { background: var(--blue-tint); color: #1A5E97; }
.mgt-cat--entertainment { background: var(--pink-tint); color: var(--pink-text); }
.mgt-cat--game { background: #E5F5EE; color: #1E7050; }
.mgt-cat--general { background: #FFF1DD; color: #8F4E00; }
.mgt-cat--incident { background: #ECEEF2; color: #3D4655; }
.mgt-cat--anime { background: #E0F3F3; color: #0B6464; }
.mgt-cat--it { background: #ECEEFA; color: #3342A0; }
.mgt-cat--world { background: #F5ECF7; color: #73398A; }

/* 記事のタグ（本文の下） */
.mgt-tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 20px; }
.mgt-tag { padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--blue-tint); color: #1A5E97; }
.mgt-tag:hover { text-decoration: none; filter: brightness(.97); }

/* ページ送り */
.mgt-pager { display: flex; justify-content: center; gap: 6px; padding: 16px; flex-wrap: wrap; }
.mgt-pager .page-numbers { min-width: 44px; height: 44px; padding: 0 12px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--pink-tint); color: var(--pink-text); font-weight: 800; }
.mgt-pager .page-numbers.current { background: var(--pink); color: var(--on-pink); }

/* ---------------- サイドバー ---------------- */
.mgt-mini > a { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px dashed var(--line); align-items: center; color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.5; }
.mgt-mini > a:hover { background: var(--pink-tint); text-decoration: none; }
.mgt-mini img { flex: none; width: 72px; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 4px; }
.mgt-mini__note { display: block; margin-top: 2px; font-size: 11px; font-weight: 700; color: var(--pink-text); }
.mgt-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
.mgt-chips a { padding: 8px 12px; border-radius: 6px; font-size: 13px; font-weight: 700; }
.mgt-chips a:hover { text-decoration: none; filter: brightness(.97); }

/* ---------------- 記事 ---------------- */
.mgt-article__head { padding: 16px 18px; border-bottom: 1px dashed var(--line); display: flex; flex-direction: column; gap: 8px; }
.mgt-article__title { margin: 0; font-size: 24px; font-weight: 800; line-height: 1.5; }
.mgt-article__eye { padding: 18px 18px 0; }
.mgt-article__eye img { width: 100%; max-width: 640px; border-radius: 8px; }
.mgt-eye-credit { margin: 4px 18px 0; max-width: 640px; text-align: right; font-size: 11px; color: var(--muted); }
.mgt-eye-credit a { color: var(--muted); }
.mgt-entry { padding: 8px 18px 20px; font-size: 16px; line-height: 1.95; }
.mgt-entry p { margin: 1em 0; }
.mgt-entry h2 { margin: 1.6em 0 .6em; padding: 8px 12px; font-size: 19px; border-radius: 6px; background: var(--pink-tint); color: var(--on-pink); line-height: 1.5; }
.mgt-entry h3 { margin: 1.6em 0 .6em; padding-bottom: 6px; font-size: 18px; border-bottom: 2px solid var(--pink); line-height: 1.5; }
.mgt-entry ul, .mgt-entry ol { padding-left: 1.4em; }
.mgt-entry blockquote { margin: 1em 0; padding: 12px 16px; border-radius: 8px; background: var(--blue-tint); color: #24486A; }
.mgt-entry blockquote p { margin: 0; }
/* 記事内のスレ画（publish.py の add_inline_images）。縦長の画像が画面を占領しないように */
.mgt-entry .wp-block-image { margin: 1.2em 0; text-align: center; }
.mgt-entry .wp-block-image img { width: auto; max-width: 100%; max-height: 480px; margin: 0 auto; border-radius: 6px; }
.mgt-entry .wp-block-image figcaption { margin-top: 4px; font-size: 11px; color: var(--muted); }
/* 出典: 見出しにせず小さく URL だけ（publish.py の sources_block） */
.mgt-entry .mgt-sources { margin: 2em 0 0; font-size: 12px; line-height: 1.7; color: var(--muted); word-break: break-all; }
.mgt-entry .mgt-sources a { color: var(--muted); }
/* みんなの反応（編集部の要約） */
.mgt-reactions { margin: 1.6em 0 1em; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mgt-entry .mgt-reactions__title { margin: 0; padding: 12px 16px; border: 0; background: var(--pink); color: var(--on-pink); font-size: 16px; font-weight: 800; }
.mgt-reactions__title small { font-size: 12px; font-weight: 700; }
.mgt-reactions ol { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.mgt-reactions li { counter-increment: r; position: relative; padding: 14px 16px 14px 62px; border-bottom: 1px dashed var(--line); line-height: 1.8; }
.mgt-reactions li::before { content: counter(r); position: absolute; left: 16px; top: 14px; width: 32px; height: 32px; border-radius: 50%; background: var(--pink-soft); color: var(--on-pink); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.mgt-reactions li strong { color: var(--pink-text); }
.mgt-reactions__note { margin: 0; padding: 10px 16px; font-size: 12px; color: var(--muted); }
.mgt-related { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; padding: 14px 16px; }
.mgt-related a { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; line-height: 1.5; color: var(--ink); }
.mgt-related img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 6px; }

/* ---------------- コメント ---------------- */
.mgt-ccount { color: var(--blue); }
.mgt-comment-list { list-style: none; margin: 0; padding: 0; }
.mgt-comment { padding: 14px 16px; border-bottom: 1px dashed var(--line); }
.mgt-comment__head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 13px; color: var(--muted); }
.mgt-comment__no { font-weight: 800; color: var(--pink-text); }
.mgt-comment__name { font-weight: 700; color: var(--ink); }
.mgt-comment__body { font-size: 15px; line-height: 1.85; overflow-wrap: anywhere; }
.mgt-comment__body p { margin: .4em 0 0; }
.comment-respond { padding: 12px 16px 18px; }
.mgt-form__title { margin: 12px 0 6px; font-size: 16px; }
.mgt-form__note { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.mgt-form__row { margin: 0 0 12px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 700; }
.mgt-form__row input, .mgt-form__row textarea { font: inherit; font-weight: 400; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); min-height: 44px; }
.mgt-form__row input:focus, .mgt-form__row textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.mgt-comment.is-pending { background: #FFFBEA; }
.mgt-comment.is-hidden { opacity: .4; }
.mgt-comment__pending { margin: 6px 0 0; font-size: 12px; color: #8F4E00; }
.mgt-comment__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.mgt-vote, .mgt-act { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.mgt-vote.is-plus { color: #1A5E97; border-color: #BFD8EE; background: var(--blue-tint); }
.mgt-vote.is-minus { color: var(--pink-text); border-color: #F5C9D0; background: var(--pink-tint); }
.mgt-act.is-report { color: var(--muted); margin-left: auto; }
.mgt-vote:disabled, .mgt-act:disabled { opacity: .55; cursor: default; }
.mgt-anchor { font-weight: 700; }
.mgt-comment:target { background: #FFF6D6; }
.mgt-tabs a { padding-left: 6px; padding-right: 6px; }
.mgt-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.mgt-btn, .comment-form input[type=submit] { min-height: 44px; padding: 0 28px; border: 0; border-radius: 999px; background: var(--pink); color: var(--on-pink); font: inherit; font-weight: 800; cursor: pointer; }
.mgt-btn:hover, .comment-form input[type=submit]:hover { filter: brightness(.96); }
.mgt-cdigest > a { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; border-bottom: 1px dashed var(--line); color: var(--ink); }
.mgt-cdigest > a:hover { background: var(--pink-tint); text-decoration: none; }
.mgt-cdigest__text { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.mgt-cdigest__post { color: var(--blue); }

/* ---------------- フッター ---------------- */
.mgt-footer { background: var(--pink); color: var(--on-pink); }
.mgt-footer .mgt-wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 22px; padding-bottom: 22px; font-size: 13px; font-weight: 700; }
.mgt-footer a { color: var(--on-pink); }
.mgt-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; }

/* ---------------- スマホ ---------------- */
@media (max-width: 600px) {
  .mgt-logo { font-size: 24px; }
  .mgt-search { flex: 1 1 100%; }
  .mgt-nav ul { flex-wrap: nowrap; overflow-x: auto; }
  .mgt-nav a { white-space: nowrap; padding: 12px 12px; }
  .mgt-body { padding-left: 10px; padding-right: 10px; }
  .mgt-row > a { padding: 12px; gap: 10px; }
  .mgt-thumb { width: 104px; }
  .mgt-rank { width: 30px; height: 30px; font-size: 14px; }
  .mgt-article__title { font-size: 21px; }
  .mgt-entry, .mgt-article__head { padding-left: 14px; padding-right: 14px; }
}
