/*
 * 旧サイトの見た目をそのまま使うページ（トップ・一覧）の切り替えと補い（旧サイトの CSS は assets/legacy/{pc,sp}/top.css・list.css）。
 *   - 960px 以上は PC 版、それより狭いとスマホ版（もう一方は display:none）
 *   - 旧サイトでは jQuery のプラグイン（mmenu・Swiper・ddaccordion）がしていた見た目を CSS で補う（動きは assets/js/legacy.js）
 */

body.is-legacy {
	margin: 0;
	background: #fff;
}

@media (max-width: 959px) {
	.legacy-pc {
		display: none !important;
	}
}

@media (min-width: 960px) {
	.legacy-sp {
		display: none !important;
	}
}

/* ---------------------------------------------------------------- PC */

/* 旧 CSS の body{overflow-y:scroll} がラッパーに付くと、ラッパーにスクロールバーの溝が出るので消す（float の囲みは flow-root で保つ） */
.legacy-pc {
	display: flow-root;
	overflow-y: visible;
}

/* 業種職種から探す: 旧サイトは JS で全部開いた状態（.active）にしていた */
.legacy-pc #type .more_box {
	display: block;
}

/* ---------------------------------------------------------------- スマホ */

/*
 * 旧サイトのスマホ版は <meta viewport width=375> で、どの端末でも 375px の画面を拡大・縮小して見せていた（body{width:375px}）。
 * このテーマは width=device-width なので、375px のままだと広い端末で左右が空き、狭い端末では横にはみ出す。
 * → 画面の幅いっぱいにする。旧 CSS で 355px（375 − 左右 10px）に決め打ちしていたところも幅に合わせる（2026-11-06 ユーザー指示）
 */
.legacy-sp {
	position: relative;
	width: auto;
}

.legacy-sp .over-ray { /* 条件のパネル */
	right: 10px;
	left: 10px;
	width: auto;
}

.legacy-sp #dk_feature,
.legacy-sp #dk_feature div,
.legacy-sp #dk_feature li,
.legacy-sp #dk_feature dd,
.legacy-sp .dk_accbox {
	width: auto;
}

.legacy-sp .job_list {
	width: auto;
	margin: 0 10px 10px;
}

.legacy-sp .pickup {
	width: auto;
	margin: 0 10px 10px;
	background-size: 100% 40px;
}

/* トップの特集バナー（2列。旧 CSS は 175px 決め打ち） */
.legacy-sp #parts_sp_banner #banner4 ul.dk_banner {
	box-sizing: border-box;
}

.legacy-sp #parts_sp_banner #banner4 ul.dk_banner li {
	width: calc(50% - 8px);
}

.legacy-sp #parts_sp_banner #banner4 ul.dk_banner li img {
	width: 100%;
	height: auto;
}

/* サイドメニュー（旧サイトは mmenu。右から出る黒いメニュー） */
.legacy-sp #sidemenu {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 10000;
	width: 80%;
	max-width: 320px;
	overflow-y: auto;
	background: #333;
	transform: translateX(100%);
	transition: transform 0.25s ease-out;
	visibility: hidden;
}

.legacy-sp #sidemenu.is-open,
.legacy-sp #sidemenu:target { /* :target は JS が無いとき用 */
	transform: translateX(0);
	visibility: visible;
}

.legacy-sp #sidemenu .close {
	display: block;
	width: 32px;
	margin: 10px 10px 4px auto;
}

.legacy-sp #sidemenu ul li span,
.legacy-sp #sidemenu ul li a {
	display: block;
	padding: 10px 16px;
	border-bottom: 1px solid #444;
	color: #fff;
	font-size: 14px;
}

.legacy-sp #sidemenu ul li span {
	background: #222;
	color: #bbb;
	font-size: 12px;
}

.legacy-sp #sidemenu:target {
	transition: none;
}

.legacy-sp .menu-shade {
	position: fixed;
	inset: 0;
	z-index: 9998;
	background: rgba(0, 0, 0, 0.5);
}

/* その他条件から探す: 押すと開くパネル（旧サイトは fadeIn） */
.legacy-sp .over-ray {
	display: none;
}

.legacy-sp .over-ray.is-open {
	display: block;
}

.legacy-sp .and_more > div {
	display: none;
}

.legacy-sp .and_more.active > div {
	display: block;
}

/* ランキング: 旧サイトは Swiper（2件ずつ・横送り）。横スクロールで同じ見た目にする */
.legacy-sp #ranking .swiper-container {
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.legacy-sp #ranking .swiper-container::-webkit-scrollbar {
	display: none;
}

/* 1画面に2件（画面の幅に合わせる。旧サイトは 375px の画面で 167px） */
.legacy-sp #ranking .swiper-wrapper {
	display: flex;
	gap: 15px;
}

.legacy-sp #ranking .swiper-slide {
	flex: 0 0 calc((100% - 15px) / 2);
	width: auto;
	scroll-snap-align: start;
}

/* 旧 CSS は高さが 153px 固定で、キャッチ・エリアが長いとカードの下にはみ出す。高さは中身に合わせ、
   同じ列のカードは一番高いものにそろえる（flex の stretch）。区切りの点線もカードの高さに合わせる（2026-11-12） */
.legacy-sp ol.ranking_list {
	height: auto;
}

.legacy-sp ol.ranking_list > li::after {
	height: 100%;
}

/* 旧 Swiper の CSS の .swiper-slide { height: 100% } があると高さがそろわないので外す */
.legacy-sp #ranking .swiper-slide {
	height: auto;
}

/* PC のランキング: カードの下にも余白を取り、1〜5位の高さの固定（163px）を外す（文字が多いとはみ出すため）。
   11/12〜18 の間に生成物の assets/legacy/pc/top.css へ直接入っていた直しを、作り直しで消えないようここへ移した（2026-11-18） */
.legacy-pc #ranking ol li {
	padding-bottom: 10px;
}

.legacy-pc #ranking ol li:nth-child(-n+5) {
	height: auto;
	padding-bottom: 10px;
}

.legacy-sp #ranking .swiper-pagination {
	position: static;
	margin-top: 8px;
	text-align: center;
}

.legacy-sp #ranking .swiper-pagination-bullet {
	display: inline-block;
	width: 8px;
	height: 8px;
	margin: 0 4px;
	border-radius: 50%;
	background: #000;
	opacity: 0.2;
}

.legacy-sp #ranking .swiper-pagination-bullet-active {
	background: #007aff;
	opacity: 1;
}

/* フッターのアコーディオン（旧サイトは ddaccordion。最初は閉じている） */
.legacy-sp #parts_sp_footer .categoryitems {
	display: none;
}

.legacy-sp #parts_sp_footer .openheader + .categoryitems {
	display: block;
}

.legacy-sp #parts_sp_footer .expandable {
	cursor: pointer;
}

/* 求人TOPICS: 記事の RSS のアイキャッチ（150×150）を旧サイトの大きさで出す（inc/topics.php） */
.legacy-pc #dk_mag_contents .dk_mag_photo img,
.legacy-sp #dk_column .at_photo img {
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

/* ---------------------------------------------------------------- 一覧（PC） */

/* 絞込む・から探すのメニュー: 旧サイトは最初は閉じていて、ボタンで開く（slideToggle） */
.legacy-pc #conditions_select .search_menu_btn:not(.active) + .search_menu {
	display: none !important;
}

.legacy-pc #conditions_select .search_menu_btn {
	cursor: pointer;
}

/* 業種の開閉（旧サイトは最初から開いている = .active） */
.legacy-pc .and_more_in:not(.active) > .more_box {
	display: none;
}

/* 急募求人（旧サイトは Swiper。2件ずつ・左右の矢印・ループ） */
.legacy-pc .swiper-container_dispatch {
	overflow: hidden;
}

.legacy-pc .swiper-container_dispatch .swiper-wrapper {
	display: flex;
	transition: transform 0.6s ease;
}

.legacy-pc .swiper-container_dispatch .swiper-slide {
	flex: 0 0 calc((100% - 19px) / 2);
	margin-right: 19px;
}

/* ---------------------------------------------------------------- 一覧（スマホ） */

/* 急募・注目・新着の横送り（旧サイトは Swiper。横スクロールで同じ見た目にする） */
.legacy-sp .swiper-container_dispatch,
.legacy-sp .swiper-container_attention,
.legacy-sp .swiper-container_new {
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.legacy-sp .swiper-container_dispatch::-webkit-scrollbar,
.legacy-sp .swiper-container_attention::-webkit-scrollbar,
.legacy-sp .swiper-container_new::-webkit-scrollbar {
	display: none;
}

.legacy-sp .swiper-container_dispatch .swiper-wrapper,
.legacy-sp .swiper-container_attention .swiper-wrapper,
.legacy-sp .swiper-container_new .swiper-wrapper {
	display: flex;
	gap: 10px;
}

.legacy-sp .swiper-container_new .swiper-wrapper {
	gap: 0;
}

.legacy-sp .swiper-container_dispatch .swiper-slide,
.legacy-sp .swiper-container_attention .swiper-slide,
.legacy-sp .swiper-container_new .swiper-slide {
	width: auto;
	scroll-snap-align: start;
}

/* 1画面の件数（急募 3・注目 2・新着 1）が画面の幅にちょうど入るようにする（旧サイトは 375px の画面で 110px・170px・350px） */
.legacy-sp .swiper-container_dispatch .swiper-slide {
	flex: 0 0 calc((100% - 20px) / 3);
}

.legacy-sp .swiper-container_attention .swiper-slide {
	flex: 0 0 calc((100% - 10px) / 2);
}

.legacy-sp .swiper-container_new .swiper-slide {
	flex: 0 0 100%;
}

/* 急募: 旧 CSS の左右の padding（10px）だと、右の padding に次のカードがのぞくので margin にする。カード（旧 105px）は枠いっぱいに */
.legacy-sp .swiper-container_dispatch {
	margin: 0 10px;
	padding: 0;
}

.legacy-sp .dispatch_job {
	width: auto;
}

.legacy-sp .dispatch_job li:nth-child(1) {
	text-align: center;
}

.legacy-sp .swiper-pagination_dispatch,
.legacy-sp .swiper-pagination_attention,
.legacy-sp .swiper-pagination_new {
	position: static;
	display: block;
	width: auto;
	margin-top: 8px;
	transform: none;
	text-align: center;
}

.legacy-sp .swiper-pagination_dispatch .swiper-pagination-bullet,
.legacy-sp .swiper-pagination_attention .swiper-pagination-bullet,
.legacy-sp .swiper-pagination_new .swiper-pagination-bullet {
	display: inline-block;
	width: 8px;
	height: 8px;
	margin: 0 4px;
	border-radius: 50%;
	background: #000;
	opacity: 0.2;
}

.legacy-sp .swiper-pagination_dispatch .swiper-pagination-bullet-active,
.legacy-sp .swiper-pagination_attention .swiper-pagination-bullet-active,
.legacy-sp .swiper-pagination_new .swiper-pagination-bullet-active {
	background: #007aff;
	opacity: 1;
}

/* 求人詳細のサブ画像（旧サイトは Swiper。1枚ずつ横送り） */
.legacy-sp .swiper-custom-parent .swiper-container {
	width: auto;
	margin: 0 35px; /* 旧 CSS は padding（そこに次の画像がのぞく）。画像（240px）の幅だけ見せる */
	padding: 0;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.legacy-sp .swiper-custom-parent .swiper-container::-webkit-scrollbar {
	display: none;
}

.legacy-sp .swiper-custom-parent .swiper-wrapper {
	display: flex;
}

.legacy-sp .swiper-custom-parent .swiper-slide {
	flex: 0 0 100%;
	width: auto;
	scroll-snap-align: start;
}

.legacy-sp .swiper-custom-parent .swiper-pagination {
	position: static;
	margin-top: 8px;
	text-align: center;
}

.legacy-sp .swiper-custom-parent .swiper-pagination-bullet {
	display: inline-block;
	width: 8px;
	height: 8px;
	margin: 0 4px;
	border-radius: 50%;
	background: #000;
	opacity: 0.2;
}

.legacy-sp .swiper-custom-parent .swiper-pagination-bullet-active {
	background: #007aff;
	opacity: 1;
}

/* PR の「続きを読む」: 縮めるのは JS（縮めなくてよい短い PR はボタンを出さない） */
.legacy-sp #job .grad-trigger {
	cursor: pointer;
}

/* 注目・新着の点は、上の空き（旧 CSS のスライドの高さ）を詰めて 20px 上に（11/6 ユーザー指示） */
.legacy-sp .swiper-pagination_attention,
.legacy-sp .swiper-pagination_new {
	margin-top: -12px;
	position: relative;
	z-index: 1;
}

/* 条件のパネルの後ろの幕（旧サイトの handyGadget.css の #close_screen と同じ色。パネルは z-index 9999） */
.legacy-sp #close_screen {
	position: fixed;
	inset: 0;
	z-index: 999;
	background-color: rgba(255, 255, 255, 0.8);
}

/* 求人詳細のシェアボタンの Facebook のアイコン: 旧 CSS は Font Awesome 5（外部の CDN）。テーマにある Font Awesome 4 の同じ字で出す */
.legacy-sp div.sns_buttons div.button_facebook a::before {
	font-family: FontAwesome;
}

/* 求人詳細のメイン画像: 旧 CSS の width:350px をやめて画面の幅に合わせる（2026-11-06 ユーザー指示）。
   高さ（旧 135px）も固定のままだと広い画面で画像がはみ出すので、画像に合わせる */
.legacy-sp .detail_img {
	width: auto;
	height: auto;
}

/* キープリスト（page-a_keep_list.php）: キープが0件のときの文 */
.legacy-pc .keep_list_empty {
	padding: 0 20px 40px;
	font-size: 15px;
	line-height: 1.8;
	text-align: center;
}

.legacy-sp .keep_list_empty {
	margin: 0 10px 20px;
	font-size: 14px;
	line-height: 1.7;
	text-align: center;
}

/* スマホのヘッダーのキープ: 旧 CSS は #keep（40px のアイコン）に背景を敷くだけで、リンク（a）は件数の丸（12px）の大きさしかない。
   アイコンを押しても移れなかったので、リンクをアイコン全体に広げる（2026-11-19 ユーザー指摘）。件数の丸の位置は #keep が基準のまま */
.legacy-sp #header_container #keep a {
	display: block;
	width: 100%;
	height: 100%;
}
