/**
 * SDGs 17目標 クリッカブルバー + モーダル
 */

/* ---------- 17色バー ---------- */

.sacs-sdg {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	width: 100%;
}

.sacs-sdg li { flex: 1; margin: 0; min-width: 0; }

.sacs-sdg__i {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: var(--c);
	cursor: pointer;
	/* tiles は <a> で出るので、下線と既定色を打ち消しておく */
	text-decoration: none;
	color: inherit;
	position: relative;
	transition: transform .16s ease, filter .16s ease;
	transform-origin: center bottom;
}

.sacs-sdg__i:hover,
.sacs-sdg__i:focus-visible {
	transform: scaleY(1.7);
	filter: saturate(1.15);
	z-index: 2;
}

.sacs-sdg__i:focus-visible { outline: 2px solid #17231e; outline-offset: 1px; }

/* 番号は帯では出さない。タイル表示のときだけ出す */
.sacs-sdg__n { display: none; }

/* 細帯（ヒーロー下・フッター） */
.sacs-sdg--bar .sacs-sdg__i { height: 7px; }

/* 大きめタイル */
.sacs-sdg--tiles { gap: 3px; }

.sacs-sdg--tiles .sacs-sdg__i {
	height: 46px;
	border-radius: 2px;
}

.sacs-sdg--tiles .sacs-sdg__n {
	display: block;
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	line-height: 46px;
	text-align: center;
}

.sacs-sdg--tiles .sacs-sdg__i:hover,
.sacs-sdg--tiles .sacs-sdg__i:focus-visible { transform: translateY(-3px); }

/* スクリーンリーダー専用テキスト（親テーマに無い場合の保険） */
.sacs-sdg .screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- モーダル ---------- */

.sacs-modal {
	position: fixed;
	inset: 0;
	z-index: 300;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.sacs-modal[hidden] { display: none; }

.sacs-modal__scrim {
	position: absolute;
	inset: 0;
	background: rgba(23, 35, 30, .5);
	opacity: 0;
	transition: opacity .22s ease;
}

.sacs-modal.is-open .sacs-modal__scrim { opacity: 1; }

.sacs-modal__box {
	position: relative;
	width: min(560px, 100%);
	max-height: calc(100svh - 48px);
	overflow-y: auto;
	background: #fff;
	border-radius: 8px;
	padding: 38px 38px 34px;
	box-shadow: 0 24px 60px rgba(23, 35, 30, .28);
	opacity: 0;
	transform: translateY(12px) scale(.98);
	transition: opacity .22s ease, transform .22s ease;
}

.sacs-modal.is-open .sacs-modal__box {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.sacs-modal__close {
	position: absolute;
	right: 12px;
	top: 12px;
	width: 38px;
	height: 38px;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background-color .16s;
}

.sacs-modal__close:hover { background: var(--sacs-bg, #f7f8f3); }

.sacs-modal__close span,
.sacs-modal__close span::before {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 15px;
	height: 2px;
	margin: -1px 0 0 -7.5px;
	background: #17231e;
}

.sacs-modal__close span { transform: rotate(45deg); }
.sacs-modal__close span::before { content: ""; margin: -1px 0 0 -7.5px; transform: rotate(90deg); }

.sacs-modal__head {
	display: flex;
	align-items: center;
	gap: 18px;
	margin-bottom: 22px;
}

.sacs-modal__no {
	flex: 0 0 auto;
	width: 62px;
	height: 62px;
	border-radius: 4px;
	color: #fff;
	font-size: 30px;
	font-weight: 700;
	line-height: 62px;
	text-align: center;
}

.sacs-modal__eyebrow {
	margin: 0 0 2px;
	font-size: 10px;
	letter-spacing: .14em;
	color: #9aa79f;
	font-weight: 700;
}

.sacs-modal__title {
	margin: 0;
	font-size: 21px;
	line-height: 1.45;
	font-weight: 700;
}

.sacs-modal__desc {
	margin: 0 0 16px;
	font-size: 14.5px;
	line-height: 1.95;
	color: #5d6b64;
}

.sacs-modal__count {
	margin: 0 0 20px;
	font-size: 12.5px;
	color: #9aa79f;
}

.sacs-modal__count[hidden] { display: none; }

.sacs-modal__cta {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 12px 21px;
	background: #fff;
	border: 1px solid var(--sacs-green, #125b43);
	color: var(--sacs-green, #125b43);
	border-radius: 3px;
	font-size: 14.5px;
	font-weight: 700;
	text-decoration: none;
	transition: background-color .18s, color .18s;
}

.sacs-modal__cta:hover { background: var(--sacs-bg, #f7f8f3); color: var(--sacs-green-dark, #0e4735); }
.sacs-modal__cta[hidden] { display: none; }

body.sacs-modal-open { overflow: hidden; }

@media screen and (max-width: 560px) {
	.sacs-modal { padding: 16px; }
	.sacs-modal__box { padding: 30px 22px 26px; }
	.sacs-modal__no { width: 52px; height: 52px; font-size: 25px; line-height: 52px; }
	.sacs-modal__title { font-size: 18px; }
	.sacs-sdg--bar .sacs-sdg__i { height: 9px; }
	.sacs-sdg__i:hover, .sacs-sdg__i:focus-visible { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.sacs-modal__scrim,
	.sacs-modal__box,
	.sacs-sdg__i { transition: none !important; }
}
