/* ============================================================================================================= */
/* トップページ専用スタイル（functions.php でトップページのみ読み込み） */
/* ============================================================================================================= */
:root {
	--th-primary: #FF8480;
	--th-secondary: #BD615E;
	--th-text: #333;
	--th-text-sub: #6b6b6b;
	--th-section-bg: #fdf4f3;
	--th-tab-bg: #fbe5e3;
	--th-border: #f1e4e2;
}

/* ------------------------------------------------------------------------------------------------------------- */
/* スライダー（inc/home-slider.php） */
/* ------------------------------------------------------------------------------------------------------------- */
/* 幅は親テーマのコンテンツ幅（.site-container .vc_row）に合わせる */
.th-slider {
	position: relative;
	max-width: 1230px;
	margin: 0 auto;
	overflow: hidden;
	border-radius: 6px;
	background: #f2f2f2;
}
.th-slider__viewport {
	position: relative;
	aspect-ratio: 16 / 9;
}
@media screen and (max-width: 1249px) {
	.th-slider {
		max-width: 990px;
	}
}
@media screen and (max-width: 1009px) {
	.th-slider {
		max-width: 750px;
	}
}
.th-slider__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity .8s ease, visibility 0s linear .8s;
}
.th-slider__slide.is-active {
	opacity: 1;
	visibility: visible;
	transition: opacity .8s ease, visibility 0s;
	z-index: 1;
}
.th-slider__image {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center 30%;
}
.th-slider__caption {
	position: absolute;
	top: 50%;
	left: 40px;
	transform: translateY(-50%);
	max-width: min(560px, 60%);
	padding: 24px 30px;
	background: rgba(255, 255, 255, .9);
	border-left: 6px solid var(--th-primary);
	border-radius: 0 4px 4px 0;
	box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
}
.th-slider p.th-slider__title {
	margin: 0;
	padding: 0;
	color: var(--th-secondary);
	font-size: clamp(20px, 2.2vw, 30px);
	font-weight: 700;
	line-height: 1.5;
}
.th-slider p.th-slider__text {
	margin: 10px 0 0;
	padding: 0;
	color: var(--th-text);
	font-size: clamp(14px, 1.2vw, 17px);
	line-height: 1.8;
}
.th-slider__arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	width: 44px;
	height: 44px;
	margin-top: -22px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .85);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
	cursor: pointer;
	transition: background-color .2s;
}
.th-slider__arrow::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 10px;
	height: 10px;
	border-top: 2px solid var(--th-secondary);
	border-right: 2px solid var(--th-secondary);
}
.th-slider__arrow--prev {
	left: 16px;
}
.th-slider__arrow--prev::before {
	transform: translate(-30%, -50%) rotate(-135deg);
}
.th-slider__arrow--next {
	right: 16px;
}
.th-slider__arrow--next::before {
	transform: translate(-70%, -50%) rotate(45deg);
}
.th-slider__arrow:hover,
.th-slider__arrow:focus-visible {
	background: #fff;
}
.th-slider__dots {
	position: absolute;
	right: 0;
	bottom: 16px;
	left: 0;
	z-index: 2;
	display: flex;
	justify-content: center;
	gap: 4px;
}
.th-slider__dot {
	position: relative;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}
.th-slider__dot::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 10px;
	height: 10px;
	margin: -5px 0 0 -5px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: rgba(255, 255, 255, .4);
	box-shadow: 0 0 3px rgba(0, 0, 0, .3);
	box-sizing: border-box;
	transition: background-color .2s, transform .2s;
}
.th-slider__dot.is-active::before {
	background: var(--th-primary);
	border-color: var(--th-primary);
	transform: scale(1.2);
}
.th-slider button:focus-visible {
	outline: 2px solid var(--th-secondary);
	outline-offset: 2px;
}

/* PC: 下端にテーマの3ボックス（約180px）が重なるので、文字・矢印・ドットはその上の領域に置く */
@media screen and (min-width: 1010px) {
	.th-slider__viewport {
		aspect-ratio: 2 / 1;
	}
	.th-slider__caption {
		top: calc((100% - 180px) / 2);
	}
	.th-slider__arrow {
		top: calc((100% - 180px) / 2);
	}
	.th-slider__dots {
		bottom: 192px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.th-slider__slide,
	.th-slider__slide.is-active {
		transition: none;
	}
}

/* スマホ: 画像は 16:9 で全体を見せ、文字は画像の下に置いて顔に重ねない */
@media screen and (max-width: 767px) {
	.th-slider {
		max-width: none;
		background: #fff;
		border: 1px solid var(--th-border);
	}
	.th-slider__viewport {
		aspect-ratio: auto;
		display: grid;
	}
	.th-slider__slide {
		position: relative;
		inset: auto;
		grid-area: 1 / 1;
		display: flex;
		flex-direction: column;
	}
	.th-slider__image {
		height: auto;
		aspect-ratio: 16 / 9;
	}
	.th-slider__caption {
		position: static;
		transform: none;
		flex: 1;
		max-width: none;
		padding: 14px var(--th-gutter) 44px;
		background: #fff;
		border-left: 0;
		border-top: 4px solid var(--th-primary);
		border-radius: 0;
		box-shadow: none;
	}
	.th-slider p.th-slider__title {
		font-size: 18px;
	}
	.th-slider p.th-slider__text {
		margin-top: 6px;
		font-size: 14px;
		line-height: 1.7;
	}
	.th-slider p.th-slider__text br {
		display: none;
	}
	.th-slider__arrow {
		/* 画像（幅 = 画面幅 − 左右余白）の縦中央 */
		top: calc((100vw - var(--th-gutter) * 2) * 9 / 16 / 2);
		width: 36px;
		height: 36px;
		margin-top: -18px;
	}
	.th-slider__arrow--prev {
		left: 8px;
	}
	.th-slider__arrow--next {
		right: 8px;
	}
	.th-slider__dots {
		bottom: 6px;
	}
	.th-slider__dot::before {
		border-color: #d9cfcd;
		background: #fff;
		box-shadow: none;
	}
}

/* ------------------------------------------------------------------------------------------------------------- */
/* スマホ（左右余白は site.css で全ページ共通に調整済み） */
/* ------------------------------------------------------------------------------------------------------------- */
@media screen and (max-width: 767px) {
	.home .home-box-container-list {
		width: auto;
		max-width: none;
	}

	/* スライダー下の3つのボックス（入会・研修会・看護職）: 重ねずに縦に並べる */
	.home .home-box-container-list.for-home-slider {
		position: static;
		margin: 0;
		padding-top: var(--th-gutter);
	}
	.home .home-box-container-list.for-home-slider > .wpb_wrapper > ul {
		display: grid;
		gap: 8px;
	}
	.home .home-box-container-list.for-home-slider .home-box-container {
		float: none;
		width: auto;
		padding: 14px var(--th-gutter);
		border-radius: 4px;
		visibility: visible;
		animation: none;
		transform: none;
		opacity: 1;
	}
	.home .home-box-container-list.for-home-slider .home-box {
		width: auto;
	}
}

/* タブレット: 3つのボックスがはみ出すので、重ねずにスライダーの下へ3列で並べる */
@media screen and (min-width: 768px) and (max-width: 1009px) {
	.home .home-box-container-list.for-home-slider {
		position: static;
		margin: 0 auto;
		padding-top: 12px;
	}
	.home .home-box-container-list.for-home-slider > .wpb_wrapper > ul {
		display: grid;
		grid-template-columns: repeat(3, 1fr);
		gap: 8px;
	}
	.home .home-box-container-list.for-home-slider .home-box-container {
		float: none;
		width: auto;
		padding: 16px 18px 20px;
		border-radius: 4px;
	}
	.home .home-box-container-list.for-home-slider .home-box {
		width: auto;
	}
	.home .home-box-container-list.for-home-slider .home-box h2 {
		font-size: 17px !important;
	}
}

/* ------------------------------------------------------------------------------------------------------------- */
/* NEWS & TOPICS */
/* ------------------------------------------------------------------------------------------------------------- */
/* セクション背景を画面幅いっぱいに敷く */
.home .vc_row:has(> .wpb_column > .wpb_wrapper > .tabs.type-big) {
	margin-top: 40px;
	padding-top: 8px;
	padding-bottom: 48px;
	background-color: var(--th-section-bg) !important;
	box-shadow: 0 0 0 100vmax var(--th-section-bg);
	clip-path: inset(0 -100vmax);
}
.home .vc_row:has(> .wpb_column > .wpb_wrapper > .tabs.type-big) > .wpb_column {
	margin-top: 24px !important;
}

/* タブ */
.home .tabs.type-big > .tabs-navigation {
	display: flex;
	width: 100%;
	margin: 0;
	padding: 0;
	background: var(--th-tab-bg);
	border-radius: 6px 6px 0 0;
	/* 幅が足りないときは折り返さず横スクロール */
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}
.home .tabs.type-big > .tabs-navigation::-webkit-scrollbar {
	display: none;
}
.home .tabs.type-big > .tabs-navigation li {
	flex: 1 0 auto;
	margin: 0;
	background: transparent;
}
.home div.type-big > .tabs-navigation li a {
	padding: 18px 12px;
	font-size: 16px;
	color: #555;
	white-space: nowrap;
	transition: color .2s, background-color .2s;
}
.home div.type-big > .tabs-navigation li a:hover {
	color: var(--th-secondary);
}
.home div.type-big > .tabs-navigation li.ui-tabs-active {
	background: #fff;
	box-shadow: inset 0 3px 0 var(--th-primary);
}
.home div.type-big > .tabs-navigation li.ui-tabs-active a {
	color: var(--th-secondary);
	font-weight: 700;
}
.home .tabs.type-big .ui-tabs-anchor:before {
	padding: 0 6px 0 0;
}

/* タブの中身: 白いカード */
.home .tabs.type-big > .wpb_tab {
	padding: 8px 28px 24px !important;
	background: #fff;
	border-radius: 0 0 6px 6px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
}
.home .tabs.type-big .vc_row.vc_inner,
.home .tabs.type-big .vc_column-inner {
	margin: 0;
	padding: 0;
}

/* 記事一覧 */
.home .tabs.type-big ul.blog {
	margin: 0;
	padding: 0;
}
.home .tabs.type-big ul.blog > li.post {
	float: none;
	display: flex;
	align-items: center;
	gap: 20px;
	width: auto;
	max-width: none;
	margin: 0;
	padding: 16px 0;
	border-bottom: 1px solid var(--th-border);
}
.home .tabs.type-big ul.blog > li.post:last-child {
	border-bottom: 0;
}
.home .tabs.type-big .comment-box {
	flex: 0 0 auto;
	float: none;
	width: auto;
	margin: 0;
}
.home .tabs.type-big .comment-box li {
	width: auto;
}
.home .tabs.type-big .comment-box .date .value {
	float: none;
	width: auto;
	white-space: nowrap;
	padding: 5px 8px;
	border-radius: 3px;
	font-size: 12px !important;
	line-height: 1.5;
	box-sizing: border-box;
}
.home .tabs.type-big .comment-box .date .arrow-date {
	display: none;
}
.home .tabs.type-big ul.blog .post-content {
	flex: 1 1 auto;
	float: none;
	width: auto;
	min-width: 0;
	margin: 0;
}
.home .tabs.type-big h2.post-title {
	margin: 0;
	padding: 0;
	font-size: 16px !important;
	font-weight: 400;
	line-height: 1.6;
	line-break: strict;
	overflow-wrap: anywhere;
}
.home .tabs.type-big h2.post-title a {
	color: var(--th-text);
}
.home .tabs.type-big h2.post-title a:hover {
	color: var(--th-secondary);
	text-decoration: underline;
}

/* ページ送り */
.home .tabs.type-big .pagination {
	display: flex;
	justify-content: center;
	gap: 6px;
	float: none;
	margin-top: 20px;
}
.home .tabs.type-big .pagination li {
	float: none;
	margin: 0;
}

/* 「行政からの委託事業」の表: 列を崩さず横スクロール */
.home .tabs.type-big .wpb_raw_html p {
	margin: 16px 0;
	padding: 0;
	font-size: 15px;
	line-height: 1.8;
}
.home .tabs.type-big .wp-block-table {
	float: none;
	width: 100%;
	margin: 0;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}
.home .tabs.type-big .wp-block-table table {
	width: 100%;
	min-width: 760px;
	table-layout: auto;
	border-collapse: collapse;
}
.home .tabs.type-big .wp-block-table td {
	display: table-cell;
	padding: 10px 12px;
	border: 1px solid var(--th-border);
	font-size: 14px;
	line-height: 1.6;
	vertical-align: top;
}
.home .tabs.type-big .wp-block-table tr:first-child td {
	background: #faf6f5;
	font-weight: 700;
	white-space: nowrap;
}

/* タブレット */
@media screen and (max-width: 1009px) {
	.home div.type-big > .tabs-navigation li a {
		padding: 16px 8px;
		font-size: 15px;
	}
	.home .tabs.type-big > .wpb_tab {
		padding: 4px 20px 20px !important;
	}
}

/* スマホ: タブは横スクロール（折り返さない）、記事は日付の下にタイトル */
@media screen and (max-width: 767px) {
	.home .vc_row:has(> .wpb_column > .wpb_wrapper > .tabs.type-big) {
		margin-top: 24px;
		padding-bottom: 32px;
	}
	.home .vc_row:has(> .wpb_column > .wpb_wrapper > .tabs.type-big) > .wpb_column {
		margin-top: 16px !important;
	}
	.home .tabs.type-big > .tabs-navigation {
		scroll-snap-type: x proximity;
		margin-right: calc(var(--th-gutter) * -1);
		border-radius: 6px 0 0 0;
	}
	.home .tabs.type-big > .tabs-navigation li {
		flex: 0 0 auto;
		scroll-snap-align: start;
	}
	.home div.type-big > .tabs-navigation li a {
		padding: 14px 14px;
		font-size: 14px;
	}
	.home .tabs.type-big > .wpb_tab {
		padding: 0 var(--th-gutter) 16px !important;
	}
	.home .tabs.type-big ul.blog > li.post {
		display: block;
		padding: 14px 0;
	}
	.home .tabs.type-big .comment-box {
		margin-bottom: 6px;
	}
	.home .tabs.type-big .comment-box li {
		float: none;
	}
	.home .tabs.type-big .comment-box .date .value,
	.vc_row .home .tabs.type-big .comment-box .date .value {
		display: inline-block;
		width: auto;
		padding: 3px 8px;
		font-size: 11px !important;
	}
	.home .tabs.type-big h2.post-title {
		font-size: 15px !important;
	}
	.home .tabs.type-big .pagination {
		margin-top: 12px;
	}
}
