/**
 * HOPE Booking Availability — フロント表示スタイル
 *
 * すべてのセレクタを .hope-ba 配下に限定し、テーマ（SWELL）側の
 * スタイルと干渉しないようにしています。
 */

.hope-ba {
	--hope-ba-main: #1f3354;
	--hope-ba-sub: #2c4a78;
	--hope-ba-text: #232730;
	--hope-ba-muted: #6b7280;
	--hope-ba-line: #d8dee8;
	--hope-ba-bg: #f7f8fa;
	--hope-ba-white: #ffffff;
	--hope-ba-tel-text: #7a5a20;
	--hope-ba-tel-bg: #fcf7ec;
	--hope-ba-tel-line: #e6d7b4;
	--hope-ba-off-text: #8b929c;
	--hope-ba-off-bg: #f1f3f6;
	--hope-ba-sun: #a8404a;

	box-sizing: border-box;
	margin: 2em 0;
	color: var(--hope-ba-text);
	font-size: 15px;
	line-height: 1.7;
	-webkit-text-size-adjust: 100%;
}

.hope-ba *,
.hope-ba *::before,
.hope-ba *::after {
	box-sizing: border-box;
}

.hope-ba__inner {
	padding: 24px;
	background: var(--hope-ba-bg);
	border: 1px solid var(--hope-ba-line);
	border-radius: 8px;
}

/* ---------- 見出し ---------- */

.hope-ba__header {
	margin: 0 0 18px;
}

.hope-ba__title {
	margin: 0 0 8px;
	padding: 0 0 0 12px;
	border-left: 4px solid var(--hope-ba-main);
	color: var(--hope-ba-main);
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.02em;
}

.hope-ba__lead {
	margin: 0 0 12px;
	color: var(--hope-ba-muted);
	font-size: 0.875rem;
	line-height: 1.75;
}

.hope-ba__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.8125rem;
	color: var(--hope-ba-muted);
}

.hope-ba__legend-item {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hope-ba__legend-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 20px;
	padding: 0 6px;
	border: 1px solid var(--hope-ba-line);
	border-radius: 3px;
	background: var(--hope-ba-white);
	font-size: 0.6875rem;
	font-weight: 700;
	line-height: 1;
}

.hope-ba__legend-mark--available {
	border-color: var(--hope-ba-sub);
	color: var(--hope-ba-sub);
}

.hope-ba__legend-mark--tel {
	border-color: var(--hope-ba-tel-line);
	background: var(--hope-ba-tel-bg);
	color: var(--hope-ba-tel-text);
}

.hope-ba__legend-mark--off {
	background: var(--hope-ba-off-bg);
	color: var(--hope-ba-off-text);
}

/* ---------- 日付一覧 ---------- */

.hope-ba__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
	gap: 12px;
	margin: 0;
}

.hope-ba__day {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 14px 16px 16px;
	background: var(--hope-ba-white);
	border: 1px solid var(--hope-ba-line);
	border-radius: 6px;
}

.hope-ba__day--available,
.hope-ba__day--partial {
	border-color: #c4d0e2;
	box-shadow: inset 3px 0 0 var(--hope-ba-main);
}

.hope-ba__day--tel {
	box-shadow: inset 3px 0 0 var(--hope-ba-tel-line);
}

.hope-ba__day--unavailable,
.hope-ba__day--full {
	background: #fafbfc;
	border-style: dashed;
}

.hope-ba__day--today {
	border-color: var(--hope-ba-sub);
}

.hope-ba__day-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding-bottom: 9px;
	border-bottom: 1px solid var(--hope-ba-line);
}

.hope-ba__date {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 2px 6px;
	margin: 0;
	color: var(--hope-ba-main);
	font-weight: 700;
	line-height: 1.2;
}

.hope-ba__date-md {
	display: inline-flex;
	align-items: baseline;
	gap: 2px;
}

.hope-ba__date-month {
	font-size: 0.9375rem;
}

.hope-ba__date-day {
	font-size: 1.375rem;
	letter-spacing: 0.01em;
}

.hope-ba__date-unit {
	margin-left: 1px;
	font-size: 0.75rem;
	font-weight: 500;
}

.hope-ba__date-week {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--hope-ba-muted);
}

.hope-ba__date-week--0 {
	color: var(--hope-ba-sun);
}

.hope-ba__date-week--6 {
	color: var(--hope-ba-sub);
}

.hope-ba__today-tag {
	display: inline-block;
	padding: 1px 7px;
	border-radius: 3px;
	background: var(--hope-ba-main);
	color: #fff;
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.04em;
}

/* ---------- ステータスバッジ ---------- */

.hope-ba__badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	flex-shrink: 0;
	margin: 0;
	padding: 3px 10px;
	border: 1px solid var(--hope-ba-line);
	border-radius: 999px;
	background: var(--hope-ba-white);
	font-size: 0.75rem;
	font-weight: 600;
	white-space: nowrap;
}

.hope-ba__badge-mark {
	font-size: 0.75rem;
	line-height: 1;
}

.hope-ba__badge--available {
	border-color: #bccbe0;
	background: #eef2f8;
	color: var(--hope-ba-main);
}

.hope-ba__badge--partial {
	border-color: #bccbe0;
	background: #eef2f8;
	color: var(--hope-ba-sub);
}

.hope-ba__badge--tel {
	border-color: var(--hope-ba-tel-line);
	background: var(--hope-ba-tel-bg);
	color: var(--hope-ba-tel-text);
}

.hope-ba__badge--unavailable,
.hope-ba__badge--full {
	background: var(--hope-ba-off-bg);
	color: var(--hope-ba-off-text);
}

/* ---------- 時間帯 ---------- */

.hope-ba__slots {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hope-ba__slot-item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.hope-ba__slot {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	min-height: 36px;
	padding: 6px 11px;
	border: 1px solid #c8d2e1;
	border-radius: 999px;
	background: var(--hope-ba-white);
	color: var(--hope-ba-main);
	font-size: 0.8125rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	line-height: 1.2;
	white-space: nowrap;
}

.hope-ba__slot-mark {
	font-size: 0.6875rem;
	font-weight: 700;
	line-height: 1;
	opacity: 0.9;
}

.hope-ba__slot--available {
	border-color: #bfcde1;
	background: #f4f7fb;
}

.hope-ba__slot--tel {
	border-color: var(--hope-ba-tel-line);
	background: var(--hope-ba-tel-bg);
	color: var(--hope-ba-tel-text);
}

.hope-ba__slot--busy,
.hope-ba__slot--unavailable {
	border-color: #dfe3e9;
	border-style: dashed;
	background: var(--hope-ba-off-bg);
	color: var(--hope-ba-off-text);
	font-weight: 500;
}

.hope-ba__slot-note {
	font-size: 0.6875rem;
	font-weight: 500;
}

/* カード表示 */

.hope-ba--slots-card .hope-ba__slots {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
	gap: 6px;
}

.hope-ba--slots-card .hope-ba__slot {
	justify-content: center;
	width: 100%;
	min-height: 44px;
	border-radius: 4px;
	white-space: normal;
	text-align: center;
}

/* ---------- 補助表示 ---------- */

.hope-ba__no-slot {
	margin: 0;
	color: var(--hope-ba-off-text);
	font-size: 0.8125rem;
}

.hope-ba__empty {
	margin: 0;
	padding: 20px;
	background: var(--hope-ba-white);
	border: 1px dashed var(--hope-ba-line);
	border-radius: 6px;
	color: var(--hope-ba-muted);
	font-size: 0.875rem;
	text-align: center;
}

.hope-ba__more {
	margin-top: 14px;
	text-align: center;
}

.hope-ba__more-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 28px;
	border: 1px solid var(--hope-ba-main);
	border-radius: 4px;
	background: var(--hope-ba-white);
	color: var(--hope-ba-main);
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.hope-ba__more-button:hover,
.hope-ba__more-button:focus-visible {
	background: var(--hope-ba-main);
	color: #fff;
}

.hope-ba__more-button:focus-visible {
	outline: 2px solid var(--hope-ba-sub);
	outline-offset: 2px;
}

.hope-ba__footer {
	margin-top: 16px;
	padding-top: 12px;
	border-top: 1px solid var(--hope-ba-line);
}

.hope-ba__note {
	margin: 0 0 4px;
	color: var(--hope-ba-muted);
	font-size: 0.8125rem;
	line-height: 1.7;
}

.hope-ba__updated {
	margin: 0;
	color: #9aa1ac;
	font-size: 0.75rem;
}

.hope-ba__status-live {
	margin: 0;
	color: var(--hope-ba-muted);
	font-size: 0.8125rem;
}

.hope-ba__status-live:empty {
	display: none;
}

.hope-ba__admin-alert {
	margin: 0 0 16px;
	padding: 12px 14px;
	border: 1px solid #e2c99a;
	border-left-width: 4px;
	border-radius: 4px;
	background: #fdf8ee;
	color: #6f5320;
	font-size: 0.8125rem;
	line-height: 1.7;
}

.hope-ba__admin-alert-detail {
	color: #8a6a34;
	word-break: break-word;
}

/* スクリーンリーダー専用テキスト */
.hope-ba__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.hope-ba__day[hidden],
.hope-ba__more[hidden] {
	display: none !important;
}

/* ---------- レスポンシブ ---------- */

@media screen and (max-width: 782px) {
	.hope-ba__inner {
		padding: 18px 14px 20px;
	}

	.hope-ba__list {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	.hope-ba__title {
		font-size: 1.125rem;
	}

	.hope-ba__slot {
		min-height: 40px;
		padding: 8px 12px;
		font-size: 0.875rem;
	}

	.hope-ba--slots-card .hope-ba__slots {
		grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
	}

	.hope-ba__day-head {
		flex-wrap: wrap;
	}
}

@media print {
	.hope-ba__more {
		display: none;
	}

	.hope-ba__day {
		break-inside: avoid;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hope-ba__more-button {
		transition: none;
	}
}
