@charset "utf-8";

/*
 * Selected Works（論文紹介のスライド）
 *
 * 1枚のスライド（.sw-slide）に画像と説明文をまとめて入れ、全スライドを
 * CSSグリッドの同じマスに重ねる。表示中のスライドだけ .is-active で不透明にするので、
 * 画像と説明文は必ず同時に切り替わる。件数が増えても位置の指定は不要。
 */

#selected_works {
	position: relative;
	margin-top: 20px;
}

.sw-track {
	display: grid;
}

.sw-slide {
	grid-area: 1 / 1;            /* 全スライドを同じ場所に重ねる */
	display: flex;
	align-items: flex-start;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.8s ease-in-out, visibility 0.8s ease-in-out;
}
.sw-slide.is-active {
	opacity: 1;
	visibility: visible;
}

.sw-img {
	flex: none;
	width: 500px;
	height: 300px;
	margin-left: 70px;
	margin-right: 13px;
}
.sw-img img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.sw-desc {
	width: 340px;
	margin-left: 10px;
	margin-right: 70px;
}
.sw-desc p {
	margin: 0 0 10px 0;
}
.sw-title {
	font-weight: bold;
}

/* リンクのバッジ（以前の shields.io のバッジ画像と同じ見た目を、文字とCSSで再現） */
.sw-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
a.badge:link,
a.badge:visited {
	display: inline-flex;
	height: 20px;
	line-height: 20px;
	font-family: Verdana, "DejaVu Sans", Geneva, sans-serif;
	font-size: 11px;
	white-space: nowrap;
	border-radius: 3px;
	overflow: hidden;
	color: #fff;
	text-shadow: 0 1px 0 rgba(1, 1, 1, 0.3);
	background-image: linear-gradient(rgba(187, 187, 187, 0.1), rgba(0, 0, 0, 0.1));
	transition: filter 0.2s ease, transform 0.2s ease;
}
a.badge:hover {
	color: #fff;
	filter: brightness(1.08);
	transform: translateY(-1px);
}
.badge-l,
.badge-r {
	padding: 0 6px;
}
.badge-l { background-color: #555; }
/* 右側の色（以前のバッジで選んでいた色） */
.c-lightblue { background-color: lightblue; color: #333; text-shadow: none; }
.c-orange    { background-color: #fe7d37; }
.c-green     { background-color: #44cc11; }
.c-github    { background-color: #24292f; }
.c-arxiv     { background-color: #b31b1b; }

/* 図はクリックで拡大できる */
.sw-img img[data-full] {
	cursor: zoom-in;
}

/* 拡大表示 */
.sw-lightbox {
	position: fixed;
	inset: 0;
	z-index: 2000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(20, 20, 20, 0.82);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	cursor: zoom-out;
}
.sw-lightbox.is-open {
	opacity: 1;
	visibility: visible;
}
.sw-lightbox img {
	max-width: 94vw;
	max-height: 90vh;
	background: #fefdfd;
	border-radius: 8px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.sw-lightbox-close {
	position: absolute;
	top: 14px;
	right: 20px;
	border: none;
	background: none;
	color: #fff;
	font-size: 36px;
	line-height: 1;
	cursor: pointer;
}

/* 左右の矢印 */
.sw-arrow {
	position: absolute;
	top: 150px;                  /* 画像の高さ(300px)の中央 */
	transform: translateY(-50%);
	width: 50px;
	height: 50px;
	border: none;
	border-radius: 50%;
	background: none;
	color: gray;
	font-size: 30px;
	cursor: pointer;
	z-index: 2;
	transition: all 0.3s ease;
}
.sw-arrow:hover {
	color: darkgray;
	transform: translateY(-50%) scale(1.1);
}
.sw-prev { left: 0; }
.sw-next { right: 0; }

/* 下の丸印（押すとそのスライドへ） */
.sw-dots {
	display: flex;
	justify-content: center;
	gap: 14px;
	margin-top: 1px;   /* 上のスライドとの余白 */
}
/* ボタン自体はクリックしやすいように縦にも余裕を持たせ、見た目は中の細い棒（.sw-dot-bar）で描く */
.sw-dot {
	display: flex;
	align-items: center;
	width: 15px;
	height: 10px;   /* クリックできる範囲の高さ（棒はこの中央に描かれる） */
	padding: 0;
	border: none;
	background: none;
	cursor: pointer;
}
.sw-dot-bar {
	position: relative;
	overflow: hidden;
	width: 15px;   /* 棒の幅 */
	height: 2px;   /* 棒の高さ（背景の灰色・満たす水色とも） */
	background-color: rgba(129, 129, 129, 0.25);   /* 表示していないスライド（薄い灰色） */
}
/* 棒の中身：表示中のスライドだけ、ページのテーマカラー（トップは水色）で満たす */
.sw-dot-fill {
	position: absolute;
	inset: 0;
	background-color: var(--theme, rgb(60, 188, 205));
	transform-origin: left center;
	pointer-events: none;
	/* 表示が終わったスライドの丸印は、スライドのフェード（0.8秒）と同じ速さで元の薄い色に戻る */
	opacity: 0;
	transition: opacity 0.8s ease-in-out;
}
.sw-dot.is-active .sw-dot-fill {
	opacity: 1;
	transition: none;
}
/* 自動送り中は、次に切り替わるまでの時間に合わせて左から右へ満たしていく */
.sw-dot.is-active.is-timing .sw-dot-fill {
	animation: sw-fill var(--sw-interval, 15000ms) linear forwards;
}
.sw-paused .sw-dot.is-active.is-timing .sw-dot-fill {
	animation-play-state: paused;
}
@keyframes sw-fill {
	from { transform: scaleX(0); }
	to   { transform: scaleX(1); }
}

.sw-arrow:focus-visible,
.sw-dot:focus-visible,
a.badge:focus-visible {
	outline: 2px solid rgb(60, 188, 205);
	outline-offset: 2px;
}

/* 動きを減らす設定の人には、ふわっと切り替える演出をしない */
@media (prefers-reduced-motion: reduce) {
	.sw-slide, .sw-dot-fill { transition: none; }
}

/* タブレット・スマートフォン：今までどおり全件を縦に並べ、矢印と丸印は出さない */
@media screen and (max-width: 959px) {
	.sw-track { display: block; }
	.sw-slide {
		display: block;
		opacity: 1;
		visibility: visible;
		transition: none;
		margin-bottom: 40px;
	}
	.sw-img {
		width: 95%;
		height: auto;
		margin: 0 auto 10px auto;
	}
	.sw-img img { height: auto; }
	.sw-desc {
		width: auto;
		margin: 0;
	}
	.sw-arrow, .sw-dots { display: none; }
}
