@charset "utf-8";
/*
 * 三甲ゴルフ倶楽部 京和コース テーマ：古い jQuery プラグインを置き換えた部分（2026-11 段階B）
 * 見た目と動きは、置き換え前と同じにしてある（理由と置き換え前の動きは docs/decisions.md）。
 * 対応範囲：2024年5月以降に出たブラウザー（Chrome 125・Safari 17.5・Firefox 126 以降）
 */

/* ------------------------------------------------------------
   スムーズスクロール（旧 smoothscroll.js。ページ内リンクで滑らかに移動）
------------------------------------------------------------ */
html {
	scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

/* ------------------------------------------------------------
   メイン画像の切り替え（旧 jquery.backstretch）
   トップ：PC は 4枚、スマホ（768px 以下）は 2枚。倶楽部の歴史：2枚。
   backstretch と同じく「0.7秒でフェード → フェードが終わってから 8秒（歴史は 6秒）表示」を繰り返す
   （1枚あたり 8.7秒・歴史は 6.7秒。周期はトップ PC 34.8秒・スマホ 17.4秒・歴史 13.4秒）。
   1枚目は最初から表示（JS を待たない）。新しい画像を上に重ねてフェードさせ、
   重ね終わってから前の画像を消す（backstretch と同じ重ね方。z-index をキーフレームで切り替える）
   計算：1枚あたり P 秒・フェード F 秒・周期 T 秒のとき、フェード終わり F/T、次の画像が重なり始める P/T、
   前の画像を消す (P+F)/T。i 枚目（0 から）の animation-delay は i×P−F 秒
------------------------------------------------------------ */
#mainVis:has(> .kv-slides) {
	position: relative;
	z-index: 0;
}
.kv-slides {
	position: absolute;
	inset: 0;
	overflow: hidden;
	z-index: 0;
	pointer-events: none;
}
.kv-slides img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: 50% 50%;
	opacity: 0;
	z-index: 1;
	animation: kv-cycle-4 34.8s infinite both;
}
.kv-slides img:nth-child(1) { animation-delay: -0.7s; }
.kv-slides img:nth-child(2) { animation-delay: 8s; }
.kv-slides img:nth-child(3) { animation-delay: 16.7s; }
.kv-slides img:nth-child(4) { animation-delay: 25.4s; }

@media only screen and (max-width: 768px) {
	.kv-slides.kv-top img {
		animation-name: kv-cycle-2;
		animation-duration: 17.4s;
	}
	.kv-slides.kv-top img:nth-child(n+3) {
		display: none;
	}
}

.kv-slides.kv-history img {
	animation-name: kv-cycle-2h;
	animation-duration: 13.4s;
}
.kv-slides.kv-history img:nth-child(2) { animation-delay: 6s; }

/* 4枚・1枚 8.7秒（周期 34.8秒）：F/T=2.0115%、P/T=25%、(P+F)/T=27.0115% */
@keyframes kv-cycle-4 {
	0%       { opacity: 0; z-index: 2; animation-timing-function: ease-in-out; }
	2.0115%  { opacity: 1; z-index: 2; }
	24.99%   { opacity: 1; z-index: 2; }
	25%      { opacity: 1; z-index: 1; }
	27.0115% { opacity: 1; z-index: 1; }
	27.02%   { opacity: 0; z-index: 1; }
	100%     { opacity: 0; z-index: 1; }
}
/* 2枚・1枚 8.7秒（周期 17.4秒。トップのスマホ）：F/T=4.023%、P/T=50%、(P+F)/T=54.023% */
@keyframes kv-cycle-2 {
	0%      { opacity: 0; z-index: 2; animation-timing-function: ease-in-out; }
	4.023%  { opacity: 1; z-index: 2; }
	49.99%  { opacity: 1; z-index: 2; }
	50%     { opacity: 1; z-index: 1; }
	54.023% { opacity: 1; z-index: 1; }
	54.04%  { opacity: 0; z-index: 1; }
	100%    { opacity: 0; z-index: 1; }
}
/* 2枚・1枚 6.7秒（周期 13.4秒。倶楽部の歴史）：F/T=5.2239%、P/T=50%、(P+F)/T=55.2239% */
@keyframes kv-cycle-2h {
	0%       { opacity: 0; z-index: 2; animation-timing-function: ease-in-out; }
	5.2239%  { opacity: 1; z-index: 2; }
	49.99%   { opacity: 1; z-index: 2; }
	50%      { opacity: 1; z-index: 1; }
	55.2239% { opacity: 1; z-index: 1; }
	55.24%   { opacity: 0; z-index: 1; }
	100%     { opacity: 0; z-index: 1; }
}

/* 動きを減らす設定の人には、1枚目だけを出す
   （上のトップのスマホ・倶楽部の歴史の指定に負けないよう、同じ詳細度のセレクタも並べる） */
@media (prefers-reduced-motion: reduce) {
	.kv-slides img,
	.kv-slides.kv-top img,
	.kv-slides.kv-history img {
		animation: none;
	}
	.kv-slides img:first-child,
	.kv-slides.kv-top img:first-child,
	.kv-slides.kv-history img:first-child {
		opacity: 1;
	}
}

/* ------------------------------------------------------------
   タブ（旧 tab_change.js と、トップのお知らせタブ。切り替えは asset/js/kyowa.js）
   選ばれていないパネルは HTML の hidden で隠す（既存の CSS の display 指定より優先させる）
   切り替えたパネルは 0.4秒でフェードイン（jQuery の fadeIn と同じ長さ）
------------------------------------------------------------ */
ul.panel > li[hidden],
#newsPanel > li[hidden] {
	display: none !important;
}
.kyowa-tab-enter {
	animation: kyowa-fade-in 0.4s ease-in-out;
}
@keyframes kyowa-fade-in {
	from { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.kyowa-tab-enter {
		animation: none;
	}
}

/* ------------------------------------------------------------
   ヘッダーのドロップダウン（旧 dropdown_menu.js。古いデザインのページ）
   マウスを乗せると 0.4秒でフェードイン、離すと 0.4秒でフェードアウト
   キーボードで項目に移ったときも開く（:focus-within）
------------------------------------------------------------ */
ul.nav li ul.sub {
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.4s ease-in-out, visibility 0s linear 0.4s;
}
ul.nav li:hover > ul.sub,
ul.nav li:focus-within > ul.sub {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.4s ease-in-out, visibility 0s linear 0s;
}
@media (prefers-reduced-motion: reduce) {
	ul.nav li ul.sub,
	ul.nav li:hover > ul.sub,
	ul.nav li:focus-within > ul.sub {
		transition: none;
	}
}

/* ============================================================
   2026-11 段階B②：スマホのメニュー（旧 slidebars）と画像の拡大表示（旧 jquery.lightbox・YouTube 用の独自の窓・swipebox）
   橋本が見本を見て決めた見た目（docs/decisions.md）
============================================================ */

/* ------------------------------------------------------------
   ページ全体の配置（slidebars.css にあった指定のうち、メニュー以外の部分を引き継ぐ）
   slidebars.css を読んでいたのは新しいデザインのページ（本文を #sb-site で包んでいる）だけなので、
   古いデザインのページに効かないよう :has(#sb-site) で絞る
------------------------------------------------------------ */
html:has(#sb-site),
html:has(#sb-site) body {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}
/* :has に対応していないブラウザーでも捨てられないよう、別の規則にしておく */
#sb-site,
.sb-slidebar {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}
html:has(#sb-site),
html:has(#sb-site) body {
	width: 100%;
	overflow-x: hidden;
}
html:has(#sb-site) {
	height: 100%;
}
html:has(#sb-site) body {
	min-height: 100%;
	height: auto;
	position: relative;
}
#sb-site {
	width: 100%;
	min-height: 100vh;
	position: relative;
	z-index: 1;
	background-color: #fff;
}
#sb-site::before,
#sb-site::after {
	content: ' ';
	display: table;
}
#sb-site::after {
	clear: both;
}


/* ------------------------------------------------------------
   スマホのメニュー（旧 slidebars）
   右から出る。幅は slidebars と同じ（480px 以下 70%・481px 以上 55%。≡ のボタンは 640px 以下でだけ出る（style-pc.css）ので、
   slidebars の 768px 以上の幅（40%・30%・20%）は使われない。念のため 768px 以上は 40% にしてある）
   閉じ方：右へスワイプ・暗い部分をタップ・× ボタン・Esc
------------------------------------------------------------ */
.kyowa-drawer {
	--drawer-width: 70vw;
	--drawer-backdrop: 0;
	inset: 0;
	width: auto;
	height: auto;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	overflow: visible;
}
@media (min-width: 481px) { .kyowa-drawer { --drawer-width: 55vw; } }
@media (min-width: 768px) { .kyowa-drawer { --drawer-width: 40vw; } }
/* <dialog> に対応していないブラウザー（対応範囲の外）で、メニューがページの下に出ないようにする */
.kyowa-drawer:not([open]) { display: none; }

.kyowa-drawer::backdrop {
	background: #000;
	opacity: calc(var(--drawer-backdrop) / 2);
}
/* 右から出すので、左に「閉じた位置」の余白、右にメニューを並べる。スクロール位置 0 が閉じた状態 */
.kyowa-drawer-scroller {
	display: grid;
	grid-template-columns: 100vw var(--drawer-width);
	overflow-x: scroll;
	overscroll-behavior: none;
	scrollbar-width: none;
	scroll-snap-type: x mandatory;
	height: 100svh;
}
.kyowa-drawer-scroller::-webkit-scrollbar { display: none; }
@media (prefers-reduced-motion: no-preference) {
	.kyowa-drawer-scroller { scroll-behavior: smooth; }
}
.kyowa-drawer-scroller::before {
	content: '';
	scroll-snap-align: start;
}
.kyowa-drawer-sheet {
	position: relative;
	height: 100svh;
	overflow-y: auto;
	scroll-snap-align: end;
	background: #f1f1f1;
	box-shadow: -4px 0 16px rgba(0, 0, 0, 0.25);
}
.kyowa-drawer-close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.06);
	color: #333;
	font-size: 26px;
	line-height: 40px;
	cursor: pointer;
}
.kyowa-drawer-close:focus-visible { outline: 2px solid #1a5c3a; outline-offset: 2px; }

/* ------------------------------------------------------------
   画像の拡大表示（旧 jquery.lightbox と、YouTube 用の独自の窓）
   写真・YouTube の動画・ヘルプのページを同じ窓で開く
   閉じ方：× ボタン・暗い部分をクリック・Esc
------------------------------------------------------------ */
.kyowa-lightbox {
	padding: 0;
	border: 0;
	background: transparent;
	max-width: 92vw;
	max-height: 92vh;
	overflow: visible;
}
.kyowa-lightbox::backdrop {
	background: rgba(0, 0, 0, 0.85);
}
.kyowa-lightbox[open] {
	animation: kyowa-lb-in 0.3s ease-out;
}
@keyframes kyowa-lb-in {
	from { opacity: 0; transform: scale(0.96); }
}
@media (prefers-reduced-motion: reduce) {
	.kyowa-lightbox[open] { animation: none; }
}
.kyowa-lightbox-frame {
	background: #fff;
	padding: 8px;
	border-radius: 4px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.kyowa-lightbox-frame img {
	display: block;
	max-width: calc(92vw - 16px);
	max-height: calc(92vh - 16px);
	width: auto;
	height: auto;
}
.kyowa-lightbox-frame iframe {
	display: block;
	border: 0;
	max-width: calc(92vw - 16px);
}
.kyowa-lightbox-frame.is-video {
	background: #000;
	padding: 0;
}
.kyowa-lightbox-frame.is-video iframe {
	width: min(960px, 92vw);
	aspect-ratio: 16 / 9;
	height: auto;
}
.kyowa-lightbox-close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 28px;
	line-height: 40px;
	cursor: pointer;
}
.kyowa-lightbox-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.kyowa-lightbox.has-caption .kyowa-lightbox-frame img {
	max-height: calc(92vh - 60px);
}
.kyowa-lightbox-caption[hidden] { display: none; }
.kyowa-lightbox-caption {
	/* 説明文の長さで枠の幅が広がらないよう、幅は写真（枠）に合わせて折り返す */
	contain: inline-size;
	color: #fff;
	text-align: center;
	font-size: 14px;
	margin-top: 8px;
}

/* 倶楽部の歴史の写真：読み込む前から場所を取るよう、テンプレートで width・height を書いた。
   表示の幅は CSS（max-width: 100%）で縮むので、高さは幅に合わせる（2026-11） */
div.historyBox img {
	height: auto;
}
