/* Lightning のテーマカラー(--vk-color-primary)があれば追従します */
.ta-single, .ta-list { --ta-main: var(--vk-color-primary, #337ab7); }

/* 大会情報 */
.ta-meta { list-style: none; margin: 0 0 1.5em; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.ta-meta li span { display: inline-block; margin-right: 8px; padding: 1px 10px; font-size: .8em; color: #fff; background: var(--ta-main); border-radius: 3px; }

.ta-h { margin: 2em 0 1em; }

/* 入賞結果 */
.ta-class { margin-bottom: 2.5em; }
.ta-class-title { margin: 0 0 .8em; padding: .4em .8em; border-left: 6px solid var(--ta-main); background: rgba(0,0,0,.04); }
.ta-podium { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
/* 入賞者の件数に合わせた列数(1〜3件のときは、その件数ぶんだけ並べる) */
.ta-podium.ta-n1 { grid-template-columns: minmax(0, 1fr); max-width: 320px; }
.ta-podium.ta-n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 640px; }
.ta-podium.ta-n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ta-card { position: relative; padding: 14px; background: #fff; border: 2px solid #ddd; border-radius: 8px; text-align: center; }
.ta-rank-1 { border-color: #d4a72c; background: linear-gradient(#fffbea, #fff 60%); }
.ta-rank-2 { border-color: #9aa5ad; background: linear-gradient(#f5f7f8, #fff 60%); }
.ta-rank-3 { border-color: #b4743c; background: linear-gradient(#fbf3ec, #fff 60%); }
.ta-badge { display: inline-block; margin-bottom: 10px; padding: 2px 16px; font-weight: 700; color: #fff; border-radius: 999px; }
.ta-rank-1 .ta-badge { background: #d4a72c; font-size: 1.1em; }
.ta-rank-2 .ta-badge { background: #8a959d; }
.ta-rank-3 .ta-badge { background: #b4743c; }
.ta-photo { display: block; margin-bottom: 10px; }
.ta-photo img { width: 100%; height: auto; border-radius: 4px; display: block; }
.ta-name { font-size: 1.15em; font-weight: 700; }
.ta-affil { margin-top: 2px; font-size: .9em; color: #666; }
.ta-comment { margin: .6em 0 0; font-size: .9em; text-align: left; }

/* 成績表PDF */
.ta-pdfs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ta-pdfs a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: inherit; text-decoration: none; background: #fff; border: 1px solid #e3e3e3; border-radius: 6px; transition: box-shadow .2s; }
.ta-pdfs a:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.ta-pdf-icon { flex: none; padding: 2px 8px; font-size: .75em; font-weight: 700; color: #fff; background: #d33; border-radius: 3px; }
.ta-pdf-label { flex: 1; font-weight: 600; }
.ta-pdf-size { flex: none; font-size: .8em; color: #888; }

.ta-notice { margin: 0 0 1.5em; padding: 10px 14px; background: #fff8e1; border-left: 5px solid #f0b400; border-radius: 3px; }

/* 開催予定 */
.ta-sch-month { margin: 1.8em 0 .6em; padding-bottom: .3em; border-bottom: 2px solid var(--ta-main, #337ab7); }
.ta-sch-list { list-style: none; margin: 0; padding: 0; }
.ta-sch-item { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid #e8e8e8; }
.ta-sch-date { flex: none; width: 11em; font-weight: 700; }
.ta-sch-main { flex: 1; }
.ta-sch-title { font-weight: 700; }
.ta-sch-venue { margin-top: 2px; font-size: .9em; color: #666; }
.ta-sch-done { font-size: .8em; color: #888; }
.ta-sch-item.is-finished .ta-sch-date { color: #888; }
.ta-pdfs-inline { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.ta-pdfs-inline a { padding: 4px 10px; font-size: .88em; }
@media (max-width: 600px) { .ta-sch-item { flex-direction: column; gap: 4px; } .ta-sch-date { width: auto; } }

/* ギャラリー */
.ta-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ta-gallery a { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px; }
.ta-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.ta-gallery a:hover img { transform: scale(1.05); }
.ta-back { margin-top: 2.5em; }

/* 一覧 */
.ta-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1.5em; }
.ta-filter select { min-width: 150px; }
.ta-filter button { padding: 6px 18px; color: #fff; background: var(--ta-main); border: 0; border-radius: 4px; cursor: pointer; }
.ta-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.ta-item { display: block; color: inherit; text-decoration: none; background: #fff; border: 1px solid #e3e3e3; border-radius: 8px; overflow: hidden; transition: box-shadow .2s, transform .2s; }
.ta-item:hover { box-shadow: 0 6px 18px rgba(0,0,0,.12); transform: translateY(-2px); }
.ta-item-img { aspect-ratio: 4 / 3; background: #eee; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ta-item-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ta-noimg { color: #aaa; font-size: .85em; }
.ta-item-body { padding: 12px 14px 14px; }
.ta-tag { display: inline-block; margin-bottom: 6px; padding: 1px 10px; font-size: .75em; color: #fff; background: var(--ta-main); border-radius: 3px; }
.ta-item-title { font-weight: 700; line-height: 1.4; }
.ta-item-date { margin-top: 4px; font-size: .85em; color: #777; }
.ta-item-win { margin-top: 8px; font-size: .9em; }
.ta-item-win b { margin-right: 4px; color: #b8860b; }
.ta-pager { margin-top: 2em; text-align: center; }
.ta-pager .page-numbers { display: inline-block; margin: 0 2px; padding: 4px 12px; border: 1px solid #ddd; border-radius: 4px; text-decoration: none; }
.ta-pager .current { color: #fff; background: var(--ta-main); border-color: var(--ta-main); }

/* ライトボックス */
.ta-lb { position: fixed; inset: 0; z-index: 99999; display: none; align-items: center; justify-content: center; background: rgba(0,0,0,.88); }
.ta-lb.is-open { display: flex; }
.ta-lb img { max-width: 92vw; max-height: 88vh; box-shadow: 0 0 30px rgba(0,0,0,.5); }
.ta-lb button { position: absolute; width: 48px; height: 48px; font-size: 28px; line-height: 1; color: #fff; background: rgba(255,255,255,.15); border: 0; border-radius: 50%; cursor: pointer; }
.ta-lb button:hover { background: rgba(255,255,255,.3); }
.ta-lb-close { top: 16px; right: 16px; }
.ta-lb-prev { left: 16px; top: 50%; margin-top: -24px; }
.ta-lb-next { right: 16px; top: 50%; margin-top: -24px; }
.ta-lb-count { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: #ddd; font-size: .9em; }

@media (max-width: 600px) {
	.ta-podium, .ta-podium.ta-n3, .ta-podium.ta-n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: none; }
	.ta-podium.ta-n1 { grid-template-columns: minmax(0, 1fr); max-width: 320px; }
	.ta-gallery { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) and (min-width: 601px) {
	.ta-podium, .ta-podium.ta-n3, .ta-podium.ta-n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ta-podium.ta-n2 { max-width: none; }
	.ta-podium.ta-n1 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 380px) {
	.ta-podium, .ta-podium.ta-n2, .ta-podium.ta-n3, .ta-podium.ta-n4 { grid-template-columns: minmax(0, 1fr); max-width: none; }
}

/* Lightning の大会一覧:1行ですっきり。左に小さな画像、右に「[競技] 大会名」と「開催日・会場」。行のどこをクリックしても詳細へ */
.vk_post.vk_post-postType-tournament.media { position: relative; align-items: center; padding: .7em 0; }
.vk_post.vk_post-postType-tournament.media:hover { background: rgba(0, 0, 0, .025); }
.vk_post.vk_post-postType-tournament.media .media-img { box-sizing: border-box; flex: 0 0 64px; align-self: center; width: 64px; margin-right: 1em; }
.vk_post.vk_post-postType-tournament.media .vk_post_imgOuter:before { padding-top: 100%; }
.vk_post.vk_post-postType-tournament.media .vk_post_body { flex: 1 1 auto; width: auto; min-width: 0; height: auto; padding-bottom: 0; }
.vk_post.vk_post-postType-tournament.media .vk_post_title { margin: 0; line-height: 1.5; }
.vk_post.vk_post-postType-tournament.media .vk_post_title a::after { content: ""; position: absolute; inset: 0; }
.vk_post.vk_post-postType-tournament.media .vk_post_excerpt { margin: .2em 0 0; font-size: 13px; line-height: 1.7; opacity: 1; }
.ta-ex-item { display: inline-block; margin-right: 2em; }
.ta-terms { margin-left: .4em; white-space: normal; }
.ta-term { display: inline-block; margin-right: .4em; padding: .1em .8em; font-size: 12px; font-weight: 700; line-height: 1.6; vertical-align: .2em; color: #fff; background: var(--vk-color-primary, #337ab7); border-radius: 2px; }
@media (max-width: 480px) {
	.vk_post.vk_post-postType-tournament.media .media-img { flex-basis: 52px; width: 52px; }
	.ta-ex-item { margin-right: 1em; }
}

/* 大会ページ:タイトル下の投稿日・更新日・投稿者は表示しない(テーマ側の出力が変わっても隠れるように) */
.single-tournament .entry-header .entry-meta { display: none; }

/* 既定画像(ロゴ)は切り抜かず全体を見せる */
.ta-item-img img.ta-default-img { object-fit: contain; background: #fff; }

/* サイドバーの年度リンク */
.ta-years { list-style: none; margin: 0; padding: 0; }
.ta-years .is-current a { font-weight: 700; }

/* 大会ページ:前の記事・次の記事は表示しない(テーマ側の出力が変わっても隠れるように) */
.single-tournament .next-prev { display: none; }

/* サイドバーの競技リンク */
.ta-sports { list-style: none; margin: 0; padding: 0; }
.ta-sports .is-current a { font-weight: 700; }
.ta-sports .ta-dot { display: inline-block; width: .8em; height: .8em; margin-right: .5em; vertical-align: -.05em; background: var(--vk-color-primary, #337ab7); border-radius: 2px; }

.ta-sports .ta-sports-all a { padding-left: calc(.8em + .5em); }
