/*
Theme Name: うしぺでぃあ
Description: 島の闘牛を記録する、うしぺでぃあのオリジナルテーマ。紺の帯・朱の番付札・生成りの紙。牛・大会・取組・関係者・闘牛場のページと、BullSearch の検索画面に対応。
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.1
Text Domain: ushipedia
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* ==========================================================================
   色と書体(ここを変えるとサイト全体と BullSearch の検索画面に反映される)
   ========================================================================== */
@font-face {
	font-family: 'FOT-KsoTouryu';
	src: url('assets/fonts/FOT-KsoTouryu.woff2') format('woff2');
	font-style: normal;
	font-weight: 700;
	font-display: swap;
}

:root {
	--color-navy: #1d2a3c;        /* 紺: ヘッダー・牛の帯 */
	--color-navy-deep: #141e2c;
	--color-red: #963722;         /* 朱: 番付札・勝ち・大会バナー */
	--color-red-deep: #702b20;
	--color-paper: #faf9f5;       /* 紙: 背景 */
	--color-card: #ffffff;
	--color-line: #ddd9d1;        /* 罫線 */
	--color-line-strong: #aaa59b;
	--color-ink: #1c2330;         /* 文字 */
	--color-muted: #6b665e;
	--color-soft: #f0eee9;        /* 表の見出し */
	--color-draw: #dedbd4;
	--color-focus: #c87637;
	--color-photo-empty: #e7e3db; /* 写真がないときの無地 */

	--font-body: 'Zen Kaku Gothic New', -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
	--font-heading: 'Zen Old Mincho', 'Yu Mincho', 'Hiragino Mincho ProN', serif;
	--font-shikona: var(--font-heading); /* 四股名の書体。ここだけ差し替えれば四股名が変わる */
	--font-number: Georgia, 'Times New Roman', serif;

	--wrap: 1100px;
	--gutter: 24px;
	--radius: 6px;
}

/* ==========================================================================
   土台
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--color-paper);
	color: var(--color-ink);
	font: 15px/1.8 var(--font-body);
	overflow-wrap: anywhere;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select { touch-action: manipulation; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, p, figure { margin: 0; }
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; line-height: 1.4; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip { position: absolute; top: -100px; left: 8px; background: #fff; padding: 8px 12px; z-index: 100; }
.skip:focus { top: 8px; }

/* ==========================================================================
   ヘッダー(紺の帯 + 検索欄)
   ========================================================================== */
.site-header { background: var(--color-navy); color: #fff; }
.site-header .wrap { padding-bottom: 18px; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; padding-bottom: 10px; }
.brand small { font-size: .5em; letter-spacing: .04em; white-space: nowrap; font-weight: 400; }
.brand { font-family: var(--font-heading); font-weight: 700; font-size: 32px; letter-spacing: .12em; line-height: 1.3; }
.menu-toggle { display: none; flex-shrink: 0; white-space: nowrap; background: none; color: #fff; border: 0; padding: 6px 0; align-items: center; gap: 8px; cursor: pointer; }
.menu-toggle span { font-size: 24px; line-height: 1; }
.nav ul { list-style: none; margin: 0; padding: 0 0 14px; display: flex; flex-wrap: wrap; gap: 4px 24px; }
.nav a { display: inline-block; padding: 4px 0; opacity: .92; }
.nav a:hover, .nav .current-menu-item a { opacity: 1; text-decoration: underline; text-underline-offset: 6px; }
.search { display: flex; background: var(--color-paper); border: 1px solid #ddd; border-radius: 13px; overflow: hidden; color: var(--color-ink); max-width: 100%; }
.search input { flex: 1; width: 100%; min-width: 0; border: 0; background: none; padding: 10px 14px 10px 4px; }
.search input:focus { outline: none; }
.search:focus-within { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.search button { border: 0; background: none; padding: 8px 8px 8px 14px; cursor: pointer; display: grid; place-items: center; color: var(--color-ink); }

/* ==========================================================================
   トップ: ヒーロー・次の大会・地域・牛カード・最新の記録
   ========================================================================== */
.hero { position: relative; height: 490px; background: var(--color-navy); overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ''; position: absolute; inset: 40% 0 0; background: linear-gradient(transparent, rgba(0, 0, 0, .42)); pointer-events: none; }
.hero.is-plain { background: linear-gradient(180deg, var(--color-navy) 0%, var(--color-navy-deep) 100%); }
.hero.is-plain::after { display: none; }
.hero.is-plain { height: 260px; }
.hero h1 { position: absolute; bottom: 82px; left: max(var(--gutter), calc((100% - var(--wrap)) / 2 + var(--gutter))); right: var(--gutter); color: #fff; font-size: clamp(29px, 4.5vw, 54px); letter-spacing: .08em; z-index: 1; text-shadow: 0 2px 12px rgba(0, 0, 0, .4); }

.event { position: relative; margin-top: -54px; z-index: 2; background: linear-gradient(110deg, var(--color-red), var(--color-red-deep)); color: #fff; border-radius: var(--radius); box-shadow: 0 4px 14px rgba(0, 0, 0, .08); }
.event a { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; padding: 20px 26px; }
.event small { display: block; letter-spacing: .1em; font-size: 13px; }
.event h2 { font-size: clamp(26px, 4vw, 40px); }
.event span { flex-shrink: 0; }
.event a:hover span { text-decoration: underline; }
.event-spacer { height: 1px; }

.section { margin: 38px 0; }
.section-title { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.section-title h2, .section-title h3 { font-size: 27px; flex-shrink: 0; }
.section-title::after { content: ''; height: 1px; background: var(--color-line-strong); flex: 1; order: 1; }
.section-title a { font-size: 13px; order: 2; flex-shrink: 0; }
.section-title a:hover { color: var(--color-red); }

.filters { display: flex; gap: 10px; overflow-x: auto; padding: 0 0 18px; scrollbar-width: thin; }
.filters a { white-space: nowrap; border: 1px solid var(--color-line); border-radius: 30px; padding: 7px 22px; background: var(--color-card); }
.filters a:hover { border-color: var(--color-navy); }
.filter-group { display: flex; gap: 10px; padding-left: 14px; margin-left: 4px; border-left: 2px solid var(--color-line); }
.filters .active + .filter-group { border-left: 0; }
.filter-parent { font-weight: 700; }
.filters .active { background: var(--color-navy); color: #fff; border-color: var(--color-navy); }

.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.card { display: block; border: 1px solid var(--color-line); border-radius: var(--radius); overflow: hidden; background: var(--color-card); transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: 0 3px 15px rgba(0, 0, 0, .07); transform: translateY(-2px); }
.photo { background: var(--color-photo-empty); overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo.is-empty { display: flex; align-items: center; justify-content: center; }
.photo.is-empty::after { content: '写真募集中'; font-size: 12px; letter-spacing: .1em; color: var(--color-muted); opacity: .7; }
.card-photo { aspect-ratio: 1.28; }
.card-body { padding: 12px 40px 12px 16px; position: relative; }
.card-body::after { content: '›'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 25px; line-height: 1; color: var(--color-muted); }
.card p { font-size: 12px; color: var(--color-muted); }
.card-title { font-size: 19px; }
.bull-name { font-family: 'FOT-KsoTouryu', var(--font-shikona); font-weight: 700; font-size: 27px; line-height: 1.3; }

.updates { border-top: 1px solid var(--color-line); }
.update { display: flex; gap: 20px; align-items: center; padding: 12px 16px; border: 1px solid var(--color-line); border-top: 0; background: var(--color-card); }
.update time { font-size: 13px; color: var(--color-muted); flex-shrink: 0; font-family: var(--font-number); }
.update .title { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; position: relative; padding-right: 24px; }
.update .title::after { content: '→'; position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.update .title:hover .bout-names { text-decoration: underline; }
.update small { flex-basis: 100%; font-size: 12px; color: var(--color-muted); }
.bout-names { font-family: var(--font-shikona); font-size: 18px; }
.bout-names i { font-style: normal; font-family: var(--font-body); font-size: 13px; color: var(--color-muted); margin: 0 .5em; }
.bout-names .is-winner { color: var(--color-red); font-weight: 700; }
.bout-note { font-size: 13px; color: var(--color-muted); }

.empty { padding: 26px; border: 1px solid var(--color-line); background: var(--color-card); }

/* ==========================================================================
   個別ページ共通(紺の帯)
   ========================================================================== */
.detail { overflow-x: clip; }
.detail-hero { max-width: var(--wrap); margin: 0 auto; }
.detail-hero img { width: 100%; height: 420px; object-fit: cover; }
.identity { max-width: var(--wrap); margin: 0 auto; background: var(--color-navy); color: #fff; padding: 22px 30px; display: flex; gap: 12px 32px; align-items: center; flex-wrap: wrap; }
.identity-name { min-width: 0; }
.identity .yomi { font-size: 14px; letter-spacing: .12em; opacity: .9; }
.identity .bull-name { font-size: 64px; line-height: 1.15; letter-spacing: .04em; }
.identity .page-title { font-size: clamp(28px, 4vw, 44px); }
.identity-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.identity-meta p { font-size: 14px; }
.rank { background: var(--color-red); border: 1px solid #bb6f55; padding: 2px 24px; display: inline-block; font-family: var(--font-heading); font-weight: 700; letter-spacing: .1em; }
.identity-photo { width: 96px; height: 96px; border-radius: 50%; flex-shrink: 0; }

.stats { max-width: var(--wrap); margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--color-line); border-top: 0; padding: 14px 0; text-align: center; background: var(--color-card); }
.stats div + div { border-left: 1px solid var(--color-line); }
.stats strong { display: block; font-family: var(--font-number); font-weight: 400; font-size: 32px; line-height: 1.2; }
.stats-note { max-width: var(--wrap); margin: 8px auto 0; padding: 0 var(--gutter); text-align: center; font-size: 13px; color: var(--color-muted); }

.tabs { display: flex; margin: 20px 0; border-bottom: 1px solid var(--color-line); position: sticky; top: 0; background: var(--color-paper); z-index: 5; }
.tabs a { flex: 1; text-align: center; padding: 10px 4px; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current] { color: var(--color-red); border-bottom-color: var(--color-red); font-weight: 700; }
.tab-section { scroll-margin-top: 64px; }

.table-scroll { overflow-x: auto; position: relative; }
table { width: 100%; border-collapse: collapse; background: var(--color-card); }
th, td { padding: 9px 16px; border: 1px solid var(--color-line); text-align: left; font-weight: normal; vertical-align: top; }
th { background: var(--color-soft); }
.profile th { width: 9em; white-space: nowrap; }
td a, .content a { color: var(--color-red); text-decoration: underline; text-underline-offset: 3px; }
caption { text-align: left; margin: 24px 0 8px; font-family: var(--font-heading); font-weight: 700; font-size: 18px; }

.result { display: inline-flex; align-items: center; justify-content: center; width: 29px; height: 29px; border-radius: 50%; background: var(--color-red); color: #fff; font-size: 14px; flex-shrink: 0; }
.result.is-loss { background: var(--color-navy); }
.result.is-draw, .result.is-void { background: var(--color-draw); color: var(--color-ink); }

.gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.gallery img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.content { margin: 0 0 20px; }
.content > * + * { margin-top: 1em; }
.content img { height: auto; }
.content h2 { font-size: 24px; margin-top: 1.6em; }
.content h3 { font-size: 20px; margin-top: 1.4em; }
.cta { display: block; margin-top: 20px; background: var(--color-red); color: #fff; text-align: center; padding: 14px; border-radius: var(--radius); letter-spacing: .1em; }
.contribute-fields { margin-top: 14px; font-size: 13px; color: var(--color-muted); }
.contribute-fields ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.contribute-fields a { display: inline-block; padding: 6px 10px; border: 1px solid var(--color-line-strong); border-radius: var(--radius); background: var(--color-card); color: var(--color-ink); }
.contribute-fields a:hover, .contribute-fields a:focus-visible { border-color: var(--color-red); color: var(--color-red); }
.sources ul { margin: 0; padding-left: 1.2em; }
.sources li a { color: var(--color-red); text-decoration: underline; }
.sources small { margin-left: .5em; color: var(--color-muted); }

/* 取組表(大会のページ) */
.bouts td { vertical-align: middle; }
.bouts .num { width: 3em; text-align: center; font-family: var(--font-number); }
.bouts .side { white-space: nowrap; }
.bouts .side .result { margin-right: 8px; width: 26px; height: 26px; font-size: 13px; }
.bout-bull { font-family: var(--font-shikona); font-size: 18px; }
.bouts .side small { margin-left: 8px; color: var(--color-muted); font-size: 12px; }
.bouts .more { display: inline-block; padding: 0 8px; font-size: 22px; text-decoration: none; color: var(--color-muted); }

/* 取組のページ: 東西 */
.matchup { max-width: var(--wrap); margin: 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; padding: 24px 30px; background: var(--color-card); border: 1px solid var(--color-line); border-top: 0; }
.matchup-side { text-align: center; min-width: 0; }
.matchup-side small { display: block; color: var(--color-muted); letter-spacing: .2em; }
.matchup-photo { aspect-ratio: 1.28; border-radius: var(--radius); margin: 6px auto 10px; max-width: 280px; }
.matchup-side .bull-name { font-size: 34px; }
.matchup-side .bull-name a { text-decoration: none; }
.matchup-side.is-winner .bull-name { color: var(--color-red); }
.matchup-meta { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 29px; color: var(--color-muted); }
.matchup-vs { font-family: var(--font-heading); font-size: 22px; color: var(--color-muted); }
.compare-link { max-width: var(--wrap); margin: 10px auto 0; padding: 0 var(--gutter); text-align: center; font-size: 14px; }
.compare-link a { color: var(--color-red); text-decoration: underline; text-underline-offset: 3px; }

/* 2頭の比較ページ */
.compare-picker { max-width: var(--wrap); margin: 0 auto; display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: end; gap: 10px 14px; padding: 18px 30px; background: var(--color-card); border: 1px solid var(--color-line); border-top: 0; }
.compare-picker-field { min-width: 0; }
.compare-picker label { display: block; font-size: 12px; color: var(--color-muted); letter-spacing: .1em; }
.compare-picker select { width: 100%; padding: 9px 10px; border: 1px solid var(--color-line-strong); border-radius: var(--radius); background: var(--color-paper); font-family: var(--font-shikona); font-size: 17px; }
.compare-picker-vs { font-family: var(--font-heading); color: var(--color-muted); padding-bottom: 10px; }
.compare-picker button { padding: 10px 26px; border: 0; border-radius: var(--radius); background: var(--color-red); color: #fff; letter-spacing: .1em; cursor: pointer; }
.compare-picker button:hover { background: var(--color-red-deep); }
.compare-swap { grid-column: 1 / -1; justify-self: end; font-size: 13px; color: var(--color-muted); text-decoration: underline; text-underline-offset: 3px; }
.compare-empty { margin: 28px 0; }
.compare-score { border-top: 1px solid var(--color-line); margin-top: 0; }
.compare-score div { font-size: 13px; padding: 0 6px; }
.compare-table th, .compare-table td { text-align: center; vertical-align: middle; }
.compare-table thead th { background: var(--color-navy); color: #fff; }
.compare-table tbody th { width: 9em; white-space: nowrap; }
.compare-table .is-better { color: var(--color-red); font-weight: 700; }

.poster { max-width: 480px; margin-bottom: 20px; }

/* ==========================================================================
   一覧・固定ページ・404
   ========================================================================== */
.page-header { margin: 36px 0 20px; }
.page-header time { font-family: var(--font-number); color: var(--color-muted); font-size: 14px; }
.page-title { font-size: clamp(26px, 3.6vw, 36px); letter-spacing: .04em; }
.archive-description { margin-top: 8px; color: var(--color-muted); }
.archive-description a { color: var(--color-red); text-decoration: underline; }
.article { margin-bottom: 40px; }
.article:not(.is-page) .content, .article:not(.is-page) .page-header { max-width: 760px; }
.article-photo { margin-bottom: 24px; }
.pagination { padding: 24px 0; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--color-line); border-radius: var(--radius); background: var(--color-card); }
.pagination .current { background: var(--color-navy); color: #fff; border-color: var(--color-navy); }
.not-found { text-align: center; max-width: 640px; margin: 60px auto; }
.not-found-code { font-family: var(--font-number); font-size: 72px; line-height: 1; color: var(--color-red); }
.not-found .page-title { margin: 12px 0 16px; }
.not-found .search { margin: 24px 0; border-color: var(--color-line); }
.button { display: inline-block; padding: 10px 24px; border-radius: 30px; background: var(--color-navy); color: #fff; }
.button { border: 0; cursor: pointer; }
.button.is-secondary { background: var(--color-card); color: var(--color-navy); box-shadow: inset 0 0 0 1px var(--color-navy); }

/* ==========================================================================
   投稿ページ(閲覧者からの情報の修正・写真の追加)
   ========================================================================== */
.contribute { max-width: 760px; }
.contribute-target { font-size: 13px; margin-bottom: 6px; }
.contribute-target a { color: var(--color-muted); }
.contribute-target a:hover { color: var(--color-red); }
.contribute-nav { margin-top: 8px; }
.contribute-login { padding: 24px; border: 1px solid var(--color-line); background: var(--color-card); }
.contribute-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.notice { margin: 0 0 20px; padding: 14px 18px; border-left: 4px solid var(--color-navy); background: var(--color-card); }
.notice.is-success { border-color: var(--color-navy); }
.notice.is-error { border-color: var(--color-red); color: var(--color-red-deep); }
.contribute-current { margin-bottom: 20px; }
.contribute-current summary { cursor: pointer; color: var(--color-muted); margin-bottom: 8px; }
.contribute-current .is-blank { color: var(--color-muted); }
.contribute-form { padding: 24px; border: 1px solid var(--color-line); background: var(--color-card); border-radius: var(--radius); }
.contribute-form .field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.contribute-form label, .contribute-form legend { font-weight: 700; }
.contribute-form small { color: var(--color-muted); font-size: 12px; }
.contribute-form .required { margin-left: 6px; padding: 0 6px; font-size: 11px; font-weight: normal; color: #fff; background: var(--color-red); border-radius: 3px; vertical-align: 2px; }
.contribute-form input[type="text"], .contribute-form input[type="url"], .contribute-form input[type="date"], .contribute-form select, .contribute-form textarea {
	width: 100%; padding: 9px 12px; border: 1px solid var(--color-line-strong); border-radius: var(--radius); background: var(--color-paper);
}
.contribute-form input[type="file"] { padding: 8px 0; }
.contribute-form textarea:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.contribute-form .field-group { margin: 0 0 16px; padding: 12px 16px 0; border: 1px solid var(--color-line); border-radius: var(--radius); }
.contribute-form .field-group legend { padding: 0 6px; }
.contribute-form .is-check label { display: flex; gap: 8px; align-items: flex-start; font-weight: normal; }
.contribute-form .is-check input { margin-top: 7px; flex-shrink: 0; }
.contribute-mine { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--color-line); }
.contribute-mine li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--color-line); }
.contribute-mine time { margin-left: auto; color: var(--color-muted); font-family: var(--font-number); font-size: 13px; }
.contribute-mine small { flex-basis: 100%; color: var(--color-muted); }
.contribute-mine .status { padding: 1px 10px; border-radius: 30px; font-size: 12px; background: var(--color-soft); }
.contribute-mine .status.is-ushi_approved { background: var(--color-navy); color: #fff; }
.contribute-mine .status.is-ushi_rejected { background: var(--color-draw); }

/* ==========================================================================
   フッター
   ========================================================================== */
.site-footer { background: var(--color-navy); color: rgba(255, 255, 255, .85); padding: 32px 0; margin-top: 60px; font-size: 13px; }
.footer-brand { font-family: var(--font-heading); font-weight: 700; font-size: 22px; letter-spacing: .12em; color: #fff; }
.copyright { margin-top: 12px; font-size: 12px; opacity: .8; }

/* ==========================================================================
   BullSearch(検索画面・戦歴一覧)
   ========================================================================== */
body .bullsearch,
body .bullsearch-record {
	--bullsearch-accent: var(--color-red);
	--bullsearch-border: var(--color-line);
	--bullsearch-muted: var(--color-muted);
	--bullsearch-panel-bg: var(--color-paper);
	--bullsearch-gap: 20px;
}
.bullsearch-form { background: var(--color-card); }
.bullsearch-form input[type="search"], .bullsearch-form input[type="number"], .bullsearch-form select,
.bullsearch-record select { border: 1px solid var(--color-line); border-radius: var(--radius); padding: 6px 10px; background: #fff; max-width: 100%; }
.bullsearch-form__submit, .bullsearch-panel-close { background: var(--color-navy); color: #fff; border: 0; border-radius: 30px; padding: 8px 22px; cursor: pointer; }
.bullsearch-form__reset { color: var(--color-muted); text-decoration: underline; }
.bullsearch-card { background: var(--color-card); border-radius: var(--radius); transition: box-shadow .2s, transform .2s; }
.bullsearch-card:hover { box-shadow: 0 3px 15px rgba(0, 0, 0, .07); transform: translateY(-2px); }
.bullsearch-card__photo { aspect-ratio: 1.28; background: var(--color-photo-empty); }
.bullsearch-card__nophoto { display: none; }
.bullsearch-card__name { font-family: var(--font-shikona); font-weight: 700; font-size: 24px; line-height: 1.3; }
.bullsearch-row__title, .bullsearch-bout { font-family: var(--font-heading); }
.bullsearch-results__items--event, .bullsearch-results__items--bout, .bullsearch-results__items--person { background: var(--color-card); }
.bullsearch-row { padding-left: 12px; padding-right: 12px; }
.bullsearch-row a:hover { color: var(--color-red); }
.bullsearch-toggle { background: var(--color-card) !important; }

/* 戦歴一覧: 見出しを紙面の罫線つきに、結果を丸印に */
.bullsearch-record { margin-top: 0; }
.bullsearch-record__scroll { position: relative; }
.bullsearch-record__heading { display: flex; align-items: center; gap: 16px; margin: 0 0 18px; font-size: 27px; }
.bullsearch-record__heading::after { content: ''; height: 1px; background: var(--color-line-strong); flex: 1; }
.bullsearch-record table { background: var(--color-card); font-size: 14px; }
.bullsearch-record th, .bullsearch-record td { border: 1px solid var(--color-line); padding: 9px 14px; vertical-align: middle; }
.bullsearch-record thead th { background: var(--color-soft); font-weight: 700; }
.bullsearch-record td a { color: inherit; text-decoration: none; font-family: var(--font-shikona); font-size: 16px; }
.bullsearch-record td a:hover { color: var(--color-red); }
.bullsearch-record td[data-col="event"] a { font-family: var(--font-body); font-size: 14px; }
.bullsearch-record__result { display: inline-flex; align-items: center; justify-content: center; min-width: 3.4em; height: 29px; padding: 0 .6em; border-radius: 999px; background: var(--color-draw); color: var(--color-ink); font-size: 13px; }
.bullsearch-record tr.is-win .bullsearch-record__result { background: var(--color-red); color: #fff; font-weight: 400; }
.bullsearch-record tr.is-loss .bullsearch-record__result { background: var(--color-navy); color: #fff; }
.bullsearch-record tr.is-scheduled .bullsearch-record__result { background: transparent; border: 1px dashed var(--color-line-strong); color: var(--color-muted); }
.bullsearch-record__subheading { font-family: var(--font-heading); font-size: 18px; margin: 24px 0 8px; }
.bullsearch-record__vs th[scope="row"] { background: var(--color-card); font-weight: 400; }

/* ==========================================================================
   画面幅ごとの調整
   ========================================================================== */
@media (max-width: 900px) {
	.cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* 大会カレンダー */
.cal-tools { max-width: var(--wrap); margin: 0 auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 14px 30px; background: var(--color-card); border: 1px solid var(--color-line); border-top: 0; flex-wrap: wrap; }
.cal-tools form { display: flex; gap: 10px 14px; align-items: flex-end; flex-wrap: wrap; }
.cal-tools label { display: block; font-size: 12px; color: var(--color-muted); letter-spacing: .1em; }
.cal-tools select { display: block; min-width: 9em; max-width: 100%; margin-top: 2px; padding: 8px 10px; border: 1px solid var(--color-line-strong); border-radius: var(--radius); background: var(--color-paper); }
.cal-tools button { padding: 9px 22px; border: 0; border-radius: var(--radius); background: var(--color-red); color: #fff; letter-spacing: .1em; cursor: pointer; }
.cal-tools button:hover { background: var(--color-red-deep); }
.cal-reset { font-size: 13px; color: var(--color-muted); text-decoration: underline; text-underline-offset: 3px; padding-bottom: 8px; }
.cal-views { display: flex; border: 1px solid var(--color-line-strong); border-radius: var(--radius); overflow: hidden; }
.cal-views a { padding: 8px 20px; }
.cal-views a[aria-current] { background: var(--color-navy); color: #fff; }
.cal-month-nav { display: flex; align-items: center; justify-content: center; gap: 24px; margin: 24px 0 12px; }
.cal-month-nav h2 { font-size: 26px; min-width: 6em; text-align: center; }
.cal-month-nav a { font-size: 30px; line-height: 1; padding: 0 12px; color: var(--color-muted); }
.cal-month-nav a:hover { color: var(--color-red); }
.cal-grid { border-top: 1px solid var(--color-line); border-left: 1px solid var(--color-line); background: var(--color-card); }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow, .cal-day { border-right: 1px solid var(--color-line); border-bottom: 1px solid var(--color-line); }
.cal-dow { background: var(--color-soft); text-align: center; padding: 4px 0; font-size: 13px; }
.cal-dow.is-sun, .cal-day.is-sun .cal-num { color: var(--color-red); }
.cal-dow.is-sat { color: #2f5a8a; }
.cal-day { min-height: 92px; padding: 4px 6px; min-width: 0; }
.cal-day.is-out { background: var(--color-paper); color: var(--color-muted); }
.cal-day.is-today { box-shadow: inset 0 0 0 2px var(--color-focus); }
.cal-num { display: block; font-family: var(--font-number); font-size: 13px; }
.cal-chip { display: block; margin-top: 3px; padding: 2px 6px; border-radius: 3px; background: var(--color-red); color: #fff; font-size: 12px; line-height: 1.4; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-chip:hover { background: var(--color-red-deep); }
.cal-chip.is-off { background: var(--color-draw); color: var(--color-muted); text-decoration: line-through; }
.cal-items { border-top: 1px solid var(--color-line); }
.cal-item { display: flex; gap: 18px; padding: 14px 16px; background: var(--color-card); border: 1px solid var(--color-line); border-top: 0; }
.cal-item.is-off .cal-body h3 a { text-decoration: line-through; color: var(--color-muted); }
.cal-status { font-family: var(--font-body); font-size: 12px; color: #fff; background: var(--color-muted); border-radius: 3px; padding: 1px 6px; vertical-align: middle; }
.cal-date { flex: 0 0 64px; text-align: center; font-family: var(--font-number); line-height: 1.2; }
.cal-date small { display: block; font-size: 12px; color: var(--color-muted); white-space: nowrap; }
.cal-date strong { display: block; font-size: 34px; font-weight: 400; }
.cal-date span { font-size: 12px; color: var(--color-muted); }
.cal-body { min-width: 0; }
.cal-body h3 { font-size: 20px; }
.cal-body p { color: var(--color-muted); font-size: 14px; }
.cal-add { margin-top: 8px; font-size: 14px; }
.cal-add summary { display: inline-block; cursor: pointer; color: var(--color-red); text-decoration: underline; text-underline-offset: 3px; }
.cal-add div { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cal-add a { padding: 6px 14px; border: 1px solid var(--color-line-strong); border-radius: var(--radius); background: var(--color-card); }
.cal-add a:hover { border-color: var(--color-red); color: var(--color-red); }
@media (min-width: 701px) {
	.cal-list.is-month { display: none; }
}

@media (max-width: 799px) {
	.has-js .menu-toggle { display: flex; }
	.has-js .nav:not(.is-open) { display: none; }
	.nav ul { flex-direction: column; gap: 0; padding-bottom: 12px; border-top: 1px solid rgba(255, 255, 255, .2); }
	.nav li { border-bottom: 1px solid rgba(255, 255, 255, .12); }
	.nav a { display: block; padding: 10px 0; }
}
@media (max-width: 700px) {
	:root { --gutter: 16px; }
	.brand { font-size: 27px; }
	.hero { height: 390px; }
	.hero.is-plain { height: 240px; }
	.hero h1 { left: var(--gutter); bottom: 80px; }
	.event a { flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px 20px; }
	.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
	.section { margin: 28px 0; }
	.section-title { gap: 10px; }
	.section-title h2, .section-title h3, .bullsearch-record__heading { font-size: 24px; }
	.filters a { padding: 6px 20px; }
	.card-body { padding: 9px 30px 9px 12px; }
	.card-body::after { right: 12px; }
	.bull-name { font-size: 22px; }
	.card-title { font-size: 17px; }
	.identity { padding: 16px var(--gutter); gap: 8px 24px; }
	.identity .bull-name { font-size: 48px; }
	.detail-hero img { height: 260px; }
	.update { gap: 10px; padding: 10px 12px; font-size: 13px; align-items: flex-start; flex-direction: column; }
	.update time { font-size: 12px; }
	.update .title { width: 100%; }
	th, td { font-size: 13px; padding: 8px 12px; }
	.profile th { width: 7em; }
	.gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
	.matchup { padding: 16px var(--gutter); gap: 8px; }
	.matchup-side .bull-name { font-size: 24px; }
	.matchup-vs { font-size: 18px; }
	.compare-picker { grid-template-columns: 1fr; padding: 14px var(--gutter); }
	.compare-picker-vs { display: none; }
	.compare-picker button { width: 100%; }
	.compare-swap { justify-self: center; }
	.compare-table tbody th { width: auto; padding: 8px 6px; }
	.compare-table .bout-bull { font-size: 15px; }
	.bullsearch-card__name { font-size: 20px; }
	.bullsearch-record th, .bullsearch-record td { padding: 8px 10px; }
	.bouts .side { white-space: normal; }
	.bouts .side small { display: block; margin: 0 0 0 34px; }
	.bouts th, .bouts td { padding: 8px; }
	.cal-views { display: none; }
	.cal-tools { padding: 12px var(--gutter); }
	.cal-tools form, .cal-tools label, .cal-tools select { width: 100%; }
	.cal-tools button { width: 100%; }
	.cal-grid, .cal-month-nav { display: none; }
	.cal-item { gap: 12px; padding: 12px; }
	.cal-date { flex-basis: 76px; }
	.cal-date strong { font-size: 28px; }
	.cal-body h3 { font-size: 18px; }
	.contribute-form, .contribute-login { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
	* { scroll-behavior: auto !important; transition: none !important; }
}

/* ---- 番付表 /banzuke/ ---- */
.bz-regions { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 4px; }
.bz-regions a { padding: 6px 16px; border: 1px solid var(--color-line-strong); border-radius: 999px; background: var(--color-card); font-size: 14px; }
.bz-regions a[aria-current] { background: var(--color-navy); border-color: var(--color-navy); color: #fff; }
.bz-table { border: 1px solid var(--color-line-strong); background: var(--color-card); }
.bz-row { display: grid; grid-template-columns: 1fr 120px 1fr; border-top: 1px solid var(--color-line); }
.bz-row:first-child { border-top: 0; }
.bz-head { background: var(--color-soft); font-family: var(--font-heading); font-weight: 700; letter-spacing: .3em; color: var(--color-muted); }
.bz-head .bz-side { padding: 6px 14px; }
.bz-head .bz-side:first-child { text-align: right; }
.bz-rank { display: flex; align-items: center; justify-content: center; padding: 14px 6px; background: var(--color-soft); border-inline: 1px solid var(--color-line); }
.bz-rank .rank { color: #fff; padding: 2px 14px; }
.bz-side { padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.bz-west { align-items: flex-end; text-align: right; }
.bz-bull { display: inline-flex; flex-direction: column; line-height: 1.35; }
.bz-bull .bull-name { font-family: 'FOT-KsoTouryu', var(--font-shikona); font-size: 20px; font-weight: 700; }
.bz-bull small { font-size: 12px; color: var(--color-muted); }
.bz-bull:hover .bull-name { color: var(--color-red); }
.bz-note { margin-top: 18px; font-size: 13px; color: var(--color-muted); }
@media (max-width: 700px) {
	.bz-head { display: none; }
	.bz-row { grid-template-columns: 1fr 1fr; }
	.bz-rank { grid-column: 1 / -1; grid-row: 1; border-inline: 0; border-bottom: 1px solid var(--color-line); padding: 8px; }
	.bz-west { grid-row: 2; align-items: flex-start; text-align: left; border-right: 1px solid var(--color-line); }
	.bz-east { grid-row: 2; }
	.bz-side::before { content: attr(data-side); font-size: 11px; letter-spacing: .2em; color: var(--color-muted); }
	.bz-side:not(:has(.bz-bull))::before { content: attr(data-side) "は空き"; }
	.bz-bull .bull-name { font-size: 18px; }
}

/* ---- 記録集・殿堂 /records/ ---- */
.rec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.rec-box { min-width: 0; }
.rec-box h3 { font-family: var(--font-heading); font-size: 17px; margin: 0 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--color-red); }
.rec-box h3 small { margin-left: 8px; font-family: var(--font-body); font-size: 12px; font-weight: 400; color: var(--color-muted); }
.rec-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--color-line); background: var(--color-card); }
.rec-list li { display: flex; align-items: baseline; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--color-line); }
.rec-list li:first-child { border-top: 0; }
.rec-place { flex: 0 0 1.6em; font-family: var(--font-number); font-size: 18px; color: var(--color-red); text-align: center; }
.rec-list .bull-name { flex: 1; min-width: 0; font-family: 'FOT-KsoTouryu', var(--font-shikona); font-size: 18px; font-weight: 700; }
.rec-list .bull-name:hover { color: var(--color-red); }
.rec-value { font-family: var(--font-number); font-size: 17px; white-space: nowrap; }
.rec-bout { border: 1px solid var(--color-line); border-top: 0; background: var(--color-card); }
.rec-bout .update { border: 0; }
.rec-duration { margin: 0; padding: 8px 16px 0; font-size: 12px; color: var(--color-muted); }
.rec-duration strong { font-family: var(--font-number); font-size: 14px; color: var(--color-ink); }
.rec-note { margin-top: 14px; font-size: 13px; color: var(--color-muted); }
@media (max-width: 700px) {
	.rec-grid { grid-template-columns: 1fr; }
}

/* サンプル(表示確認用)の印 */
.sample-badge { display: inline-block; margin-left: .5em; padding: 1px 8px; border: 1px solid currentColor; border-radius: 999px; font-size: 12px; font-weight: 400; line-height: 1.6; vertical-align: middle; opacity: .75; }
