/* =====================================================================
 * ygotac.com サイト共通 CSS（site-ops 管理）
 *
 * 置き場所: 子テーマ直下 ygt-site.css（ygt-tile.php が wp_enqueue_style で全ページに読み込む）
 * 設置:     wp-page/upload-theme-file.ps1 -File ygt-site.css（FTPS。バックアップ→上書き→再取得検証）
 * 対象:     トップ（.ygp14）・デッキ一覧／カード一覧（.ygx）・記事末尾の「一覧へ戻る」（.ygt-back）
 *
 * 注意:
 *   - 確認用ページ（プレビュー）にはビルド時にこのファイルの中身が <style> として埋め込まれ REST で投稿される。
 *     そのため WAF の禁止パターンを避ける: コメントはビルド時に除去されるので書いてよいが、
 *     「disabled」という語と「&&」は書かない（DESIGN §5）。
 *   - 色は :root のトークンで持つ。新しい色は増やさず、ここにある役割から選ぶ（ui-design DESIGN §5）。
 *   - .ygp13-lv / .ygp13-h / .ygp13-sel は子テーマの ygt_tile ショートコードが出力するクラス名（変えない）。
 * ===================================================================== */

:root {
    --ygt-navy: #1a3a5c;      /* 章相当の面・名前・強調 */
    --ygt-navy-mid: #4a749c;  /* 中間の紺（新着のチップ・新着帯の色帯） */
    --ygt-head: #04384c;      /* 見出し色（SWELL の --color_main と同じ） */
    --ygt-act: #1d5bbf;       /* 操作の青（ボタン・件数・リンク） */
    --ygt-band: #e8eef8;      /* 帯の地色 */
    --ygt-panel: #f6f9fc;     /* 行のホバー地色 */
    --ygt-pale: #eaf3fb;      /* 行見出しの淡い青の面 */
    --ygt-line: #c9dcf5;      /* 薄い罫線 */
    --ygt-line2: #b9cfe8;     /* 補助ボタン・入力欄の枠線 */
    --ygt-rule: #edf1f6;      /* 行の間の細い罫線 */
    --ygt-border: #e2e8f0;    /* タイルの枠線 */
    --ygt-note: #556;         /* 弱い注記 */
    --ygt-label: #5b6472;     /* 帯の中のラベル */
    --ygt-text: #2c3e50;      /* 本文 */
    --ygt-syn: #4299e1;       /* シンクロの色帯 */
    --ygt-xyz: #d69e2e;       /* エクシーズの色帯 */
    --ygt-xyz-text: #8a5410;  /* エクシーズタイルの文字 */
    --ygt-purple: #a78bfa;    /* 出張セット・モンスター別の色帯 */
    --ygt-count: #94a3b8;     /* タイルの「N選」 */
    --ygt-new: #d6243d;       /* NEW バッジ */
    --ygt-soon: #c79733;      /* 準備中 */
}

/* ---------------------------------------------------------------------
 * デッキ一覧・カード一覧（.ygx）
 * ------------------------------------------------------------------- */
body:has(.ygx) #sidebar { display: none !important; }
body:has(.ygx) .l-mainContent { width: 100% !important; max-width: 100% !important; flex: 1 1 100% !important; }

.ygx { max-width: 900px; margin: 0 auto; line-height: 1.6; color: var(--ygt-text); --ygx-top: 0px; }
.ygx a { text-decoration: none; color: inherit; }
/* 帯の下の 1 行（トップの .ygp14-sub と同じ小さな灰色） */
.ygx-lead { font-size: .82em; color: var(--ygt-note); margin: 0 0 14px 4px; line-height: 1.6; }

/* ページの見出し: トップの節の帯（.ygp13-h）と同じ形にする（ui-design 追記 4 §11）。
   テーマのページタイトル（h1）をそのまま帯に作り替えるので、ページの h1 は 1 つのまま。
   色帯はトップのタイルと同じ役割: デッキ＝中間の紺（濃紺の地では濃紺の帯が見えないため）、カード＝紫。幅は一覧本体の 900px */
body:has(.ygx) .c-pageTitle { display: flex; align-items: center; max-width: 900px; margin: 0 auto 8px; padding: 11px 18px; background: var(--color_main, var(--ygt-head)); color: #fff; font-size: 1.12rem; font-weight: 700; line-height: 1.5; border: none; border-left: 5px solid var(--ygt-navy-mid); border-radius: 8px; box-shadow: 0 2px 8px rgba(4,56,76,0.18); }
body:has(.ygx-card) .c-pageTitle { border-left-color: var(--ygt-purple); }
/* テーマは見出しと本文の間を 64px 空けるので詰め、帯の直下に 1 行が来るようにする（トップの帯と 1 行の間隔にそろえる） */
body:has(.ygx) .c-pageTitle + .post_content { margin-top: 0; }
/* SWELL の下線スタイル（data-style=b_bottom）は中の文字を float させて下線を引くので、float と下線を外す。
   h1 の ::after はその float を解除する clearfix なので消さない（消すと帯の高さが潰れて文字が切れる） */
body:has(.ygx) .c-pageTitle[data-style] .c-pageTitle__inner { float: none; margin: 0; padding: 0; border: none; background: none; color: inherit; }

/* 帯（絞り込み／行）: 記事の型・展開の切り替え帯と同じ語彙 */
.ygx-band { background: var(--ygt-band); border-radius: 12px; padding: 12px 16px; display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.ygx-band-rows { position: sticky; top: var(--ygx-top); z-index: 20; }
.ygx-lbl { font-size: .82em; font-weight: 500; color: var(--ygt-label); letter-spacing: .06em; flex: 0 0 auto; }
.ygx-q { flex: 1 1 auto; min-width: 0; max-width: 22em; font: inherit; padding: 7px 12px; border: 1.5px solid var(--ygt-line2); border-radius: 8px; background: #fff; color: inherit; }
.ygx-q:focus-visible { outline: 2px solid var(--ygt-act); outline-offset: -1px; }
.ygx-n { font-size: .85em; color: var(--ygt-note); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* 行ボタン: 連結しない枠付きボタン。塗り＝いま表示している行 */
.ygx-rows { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; min-width: 0; }
.ygx-rows button { font: inherit; font-size: .92em; font-weight: 700; color: var(--ygt-act); background: #fff; border: 1.5px solid var(--ygt-line2); border-radius: 8px; padding: 5px 0; min-width: 2.6em; margin: 0; cursor: pointer; line-height: 1.4; box-shadow: none; }
.ygx-rows button.all { padding: 5px 12px; }
.ygx-rows button:hover { background: var(--ygt-pale); }
.ygx-rows button[aria-pressed="true"] { background: var(--ygt-act); border-color: var(--ygt-act); color: #fff; }
.ygx-rows button[aria-pressed="true"]:hover { background: var(--ygt-act); }
.ygx-rows button:focus-visible { outline: 2px solid var(--ygt-navy); outline-offset: 1px; }

/* 行見出し: ラベルなので名前より弱く（小さく・中太・淡い青の面） */
.ygx-gyo { margin: 0 0 14px; }
.ygx-gh { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; background: var(--ygt-pale); color: var(--ygt-navy); font-weight: 500; font-size: .85em; letter-spacing: .08em; padding: 6px 12px; margin: 14px 0 2px; border-radius: 4px; }
.ygx-gh .ygx-gc { font-weight: 400; font-size: .85em; letter-spacing: 0; color: var(--ygt-note); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* 行 */
.ygx-row { display: grid; grid-template-columns: minmax(0, 1fr) 7em 6.5em; gap: 0 14px; align-items: baseline; padding: 7px 4px; border-bottom: 1px solid var(--ygt-rule); }
.ygx-card .ygx-row { grid-template-columns: minmax(0, 1fr) auto; }
.ygx-row:hover { background: var(--ygt-panel); }
.ygx-row .nm { font-weight: 700; color: var(--ygt-navy); line-height: 1.35; }
.ygx-row .nm small { font-weight: 400; color: var(--ygt-note); font-size: .82em; margin-left: .4em; }
.ygx-row .rt, .ygx-row .to, .ygx-row .dt { font-size: .85em; color: var(--ygt-note); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ygx-row .rt b { color: var(--ygt-navy); font-weight: 700; }
.ygx-row .dt, .ygx-row .to { text-align: right; }
.ygx-row .to i { font-style: normal; color: var(--ygt-navy); font-weight: 700; }
.ygx-kana { font-size: .78em; color: var(--ygt-note); letter-spacing: .1em; padding: 8px 4px 0; }
.ygx-hide { display: none !important; }
.ygx-cross { margin: 14px 0 0; font-size: .9em; }
.ygx-cross a { color: var(--ygt-act); font-weight: 700; }

@media (max-width: 600px) {
    body:has(.ygx) .c-pageTitle { font-size: 1rem; padding: 9px 12px; }
    .ygx-band { padding: 10px; gap: 8px; border-radius: 10px; }
    .ygx-rows { gap: 3px; flex-wrap: nowrap; }
    .ygx-rows button { flex: 1 1 0; min-width: 0; padding: 4px 0; font-size: .85em; }
    .ygx-rows button.all { flex: 0 0 auto; padding: 4px 7px; }
    .ygx-row, .ygx-card .ygx-row { grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; }
    .ygx-row .dt { display: none; }
    .ygx-row .nm small.yomi { display: block; margin-left: 0; }
    .ygx-row .to { white-space: normal; }
}

/* ---------------------------------------------------------------------
 * トップ（.ygp14）
 * ------------------------------------------------------------------- */
.ygp14 { line-height: 1.7; color: var(--ygt-text); }
.ygp14 a { text-decoration: none; }

/* 一覧への画像つきタイル 2 枚（レベル別タイルと同じ高さ 133px） */
.ygp14-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 0 26px; }
.ygp14-list { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; column-gap: 14px; min-height: 133px; background: #fff; border: 1px solid var(--ygt-border); border-left: 4px solid var(--ygt-navy); border-radius: 8px; padding: 12px 14px; box-shadow: 0 2px 6px rgba(0,0,0,0.06); color: inherit; transition: transform 0.15s, box-shadow 0.15s; }
.ygp14-list.card { border-left-color: var(--ygt-purple); }
.ygp14-list:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(44,82,130,0.16); }
.ygp14-list .bn { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; border: 1px solid #e3e8ef; border-radius: 4px; background: #f4f6f9; }
.ygp14-list .tx { min-width: 0; }
.ygp14-list .tx b { display: block; font-size: 1.08em; line-height: 1.3; color: var(--ygt-navy); }
.ygp14-list .tx b span { white-space: nowrap; }   /* 語の途中で折らない（折れるのは <wbr> の位置だけ） */
.ygp14-list .tx small { display: block; color: var(--ygt-note); font-size: .8em; margin-top: 2px; }
.ygp14-list .cnt { display: block; margin-top: 6px; font-size: .95em; color: var(--ygt-act); font-weight: 700; white-space: nowrap; }

/* 帯（見出し）: SWELL 記事 h2 と同じ濃紺バー。ygt_tile と共有するため .ygp13-h のまま。
   帯は h2 タグ（2026-09-29〜）。SWELL の本文 h2（.post_content h2）の装飾より強くするため .ygp14 から指定し、
   SWELL が h2 に付ける疑似要素（::before の枠など）は消す */
.ygp14-sec { margin-bottom: 26px; }
.ygp14 .ygp13-h::before, .ygp14 .ygp13-h::after { content: none; display: none; }
.ygp14 .ygp13-h { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 11px 18px; border: none; border-left: 5px solid var(--ygt-syn); border-radius: 8px; background: var(--color_main, var(--ygt-head)); font-size: 1.12em; font-weight: 700; line-height: 1.7; letter-spacing: normal; color: #fff; box-shadow: 0 2px 8px rgba(4,56,76,0.18); scroll-margin-top: 90px; }
.ygp14 .ygp13-h.xyz { border-left-color: var(--ygt-xyz); }
.ygp14 .ygp13-h.mon { border-left-color: var(--ygt-purple); }
.ygp14 .ygp13-h.news { border-left-color: var(--ygt-navy-mid); }
/* 「すべて見る」は見出し（h2）の外に置き、帯の右端に重ねる（h2 の下余白は外へ抜けるので枠の高さ＝帯の高さ）。SWELL の h2 は z-index:1 なので、リンクはそれより手前に出す */
.ygp14-hrow { position: relative; }
.ygp14-hrow .ygp14-all { position: absolute; z-index: 2; top: 0; right: 18px; bottom: 0; display: flex; align-items: center; font-size: .88em; font-weight: 500; color: #dbe7f5; white-space: nowrap; }
.ygp14-hrow .ygp14-all:hover { color: #fff; text-decoration: underline; }
.ygp14-sub { font-size: .82em; color: var(--ygt-note); margin: -8px 0 12px 4px; line-height: 1.6; }

/* レベル別・ランク別・モンスター別のタイル（ygt_tile / ygt_post_tile の出力） */
.ygp13-sel { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.ygp13-lv { display: flex; flex-direction: column; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--ygt-border); border-left: 4px solid var(--ygt-syn); border-radius: 8px; padding: 11px 6px; box-shadow: 0 2px 6px rgba(0,0,0,0.06); color: inherit; transition: transform 0.15s, box-shadow 0.15s; }
.ygp13-lv.x { border-left-color: var(--ygt-xyz); }
.ygp13-lv.m { border-left-color: var(--ygt-purple); }
.ygp13-lv:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(44,82,130,0.16); }
.ygp13-lv .av { width: 58px; height: 58px; border-radius: 8px; object-fit: cover; object-position: center 20%; box-shadow: 0 3px 8px rgba(0,0,0,0.22); background: var(--ygt-border); }
.ygp13-lv .n { font-weight: 900; font-size: 1em; color: var(--ygt-navy); text-align: center; line-height: 1.3; }
.ygp13-lv.x .n { color: var(--ygt-xyz-text); }
.ygp13-lv.m .n { font-size: .9em; }
.ygp13-lv .c { font-size: 0.7em; color: var(--ygt-count); font-weight: 700; }
.ygp13-lv.soon { opacity: 0.6; }
.ygp13-lv.soon .c { color: var(--ygt-soon); }

/* 新着・更新（SWELL 投稿リストのテキスト型を「日付・チップ・記事名」の 1 行に組み替える） */
.ygp14-news .p-postListWrap { padding: 0; }
.ygp14-news .p-postList { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; margin: 0; }
.ygp14-news .p-postList__item { margin: 0; padding: 0; border-bottom: 1px solid var(--ygt-rule); }
/* 日付・チップ・記事名は、記事名の 1 行目と同じ高さ（1.45em）の行に並べ、縦の中央で揃える（記事名が折り返しても 1 行目に揃う） */
.ygp14-news .p-postList__link { display: flex; align-items: flex-start; gap: 10px; padding: 8px 4px; font-size: .9em; }
.ygp14-news .p-postList__item:hover { background: var(--ygt-panel); }
.ygp14-news .p-postList__thumb { order: 2; position: static; width: auto; height: 1.45em; padding: 0; margin: 0; flex: 0 0 auto; box-shadow: none; background: none; display: flex; align-items: center; line-height: 1; }
/* SWELL はサムネ枠に影を付け、枠が行の高さ分チップより高くなる（チップの下に白い面と影が出て浮いて見えた）。影を消し、枠の高さをチップに合わせる */
.ygp14-news .p-postList__thumb::before, .ygp14-news .p-postList__thumb::after { content: none; display: none; }
.ygp14-news .c-postThumb__figure { display: none; }
.ygp14-news .c-postThumb__cat { position: static; display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .02em; line-height: 1; background: var(--ygt-navy-mid); color: #fff; border-radius: 2px; padding: 4px 6px 2px; margin: 0; }
/* 日本語フォントは字面が上に寄るので、チップは上の余白を 1px 多くして文字を地色の中央に置く（実測で上下の余白差 0） */
.ygp14-news .c-postThumb__cat::before { display: none; }
.ygp14-news .p-postList__body { display: contents; }
.ygp14-news .p-postList__meta { display: contents; }
.ygp14-news .p-postList__title::before, .ygp14-news .p-postList__title::after { content: none; display: none; }
.ygp14-news .p-postList__title { order: 3; background: none; letter-spacing: normal; margin: 0; padding: 0; border: none; font-size: 1em; font-weight: 700; color: var(--ygt-text); line-height: 1.45; flex: 1 1 auto; min-width: 0; }
.ygp14-news .p-postList__item:hover .p-postList__title { color: var(--ygt-new); }
.ygp14-news .p-postList__times { order: 1; margin: 0; flex: 0 0 auto; height: 1.45em; display: flex; align-items: center; }
.ygp14-news .c-postTimes__posted { font-size: .89em; color: var(--ygt-note); font-weight: 400; font-variant-numeric: tabular-nums; }
.ygp14-news .c-postTimes__posted::before { display: none; }
.ygp14-new { display: inline-block; background: var(--ygt-new); color: #fff; font-size: 0.62em; font-weight: 900; border-radius: 4px; padding: 1px 6px; margin-right: 6px; vertical-align: middle; letter-spacing: 0.05em; }

@media (max-width: 700px) {
    .ygp13-sel { grid-template-columns: repeat(3, 1fr); gap: 7px; }
    .ygp13-lv { padding: 9px 5px; }
    .ygp13-lv .av { width: 50px; height: 50px; }
}
@media (max-width: 600px) {
    .ygp14-two { grid-template-columns: 1fr; gap: 8px; }
    .ygp14-list { grid-template-columns: 110px minmax(0, 1fr); column-gap: 10px; padding: 10px; min-height: 0; }
    .ygp14 .ygp13-h { font-size: 1em; padding: 9px 12px; }
    .ygp14-hrow .ygp14-all { right: 12px; font-size: .74em; }
    .ygp14-news .p-postList { grid-template-columns: 1fr; }
}

/* フロントのメインビジュアル（表示している場合）をスマホで全体表示にする上書き（DESIGN §4） */
@media (max-width: 599px) {
    #main_visual.p-mainVisual.-height-set .p-mainVisual__inner,
    #main_visual.p-mainVisual.-height-set .p-mainVisual__slide { height: auto !important; }
    #main_visual .p-mainVisual__slide::before { display: none !important; }
    #main_visual .p-mainVisual__imgLayer { position: relative !important; height: auto !important; }
    #main_visual .p-mainVisual__img { position: relative !important; height: auto !important; width: 100% !important; }
}

/* ---------------------------------------------------------------------
 * 記事末尾の「一覧へ戻る」1 行（ygt-tile.php の the_content フィルタが出力）
 * ------------------------------------------------------------------- */
.ygt-back { margin-top: 2em; padding-top: 1em; border-top: 1px solid var(--ygt-border); font-size: .95em; }
.ygt-back a { color: var(--ygt-act); font-weight: 700; }
