/**
 * 求人ブックマークボタン（一覧・詳細・マイページ共通）
 *
 * @package Matching
 */

.matching-job-bookmark-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	min-height: var(--matching-bookmark-btn-min-height, 4rem);
	padding: var(--matching-bookmark-btn-pad-y, 0.7rem) var(--matching-bookmark-btn-pad-x, 1.15rem);
	border: 1px solid var(--matching-color-border);
	border-radius: var(--matching-radius-sm);
	background: var(--matching-color-bg);
	color: var(--matching-color-secondary);
	font-size: var(--matching-bookmark-btn-font-size, 1.3rem);
	font-weight: 600;
	line-height: 1.5;
	cursor: pointer;
	text-decoration: none;
	box-sizing: border-box;
	transition: border-color var(--matching-transition), color var(--matching-transition), background var(--matching-transition);
}

.matching-job-bookmark-btn-icon {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	line-height: 0;
}

.matching-job-bookmark-btn-icon svg {
	display: block;
	width: 1.15em;
	height: 1.15em;
}

.matching-job-bookmark-btn-label {
	display: inline-flex;
	align-items: center;
	line-height: 1.5;
}

.matching-job-bookmark-btn:hover,
.matching-job-bookmark-btn:focus-visible {
	border-color: var(--matching-color-primary);
	color: var(--matching-color-primary);
}

.matching-job-bookmark-btn.is-bookmarked {
	border-color: var(--matching-color-primary);
	background: color-mix(in srgb, var(--matching-color-primary) 8%, white);
	color: var(--matching-color-primary);
}

.matching-job-bookmark-btn:disabled {
	opacity: 0.6;
	cursor: wait;
}

.requirement-card-bookmark {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	margin-bottom: var(--matching-space-2);
}

/* 一覧カード：メタ pill と同じ高さ・字サイズ */
.requirement-card-bookmark .matching-job-bookmark-btn {
	min-height: var(--matching-req-card-control-height);
	height: var(--matching-req-card-control-height);
	padding: 0 0.85rem;
	font-size: var(--matching-req-card-meta-fs, 1.5rem);
	line-height: var(--matching-req-card-meta-line-height, 1.5);
}

@media (min-width: 768px) {
	.requirement-detail-sticky-actions .matching-job-bookmark-btn,
	.requirement-detail-sticky-actions .matching-job-bookmark-btn-label {
		font-size: var(--matching-req-card-meta-fs, 1.5rem);
		line-height: var(--matching-req-card-meta-line-height, 1.5);
	}
}

.requirement-detail-bookmark {
	display: flex;
	justify-content: stretch;
	margin: 0;
}

.requirement-detail-bookmark .matching-job-bookmark-btn {
	width: 100%;
	min-height: var(--matching-req-card-control-height);
	height: var(--matching-req-card-control-height);
	padding: 0 1rem;
	font-size: var(--matching-req-card-meta-fs, 1.5rem);
	line-height: var(--matching-req-card-meta-line-height, 1.5);
	justify-content: center;
}

.requirement-detail-entry-actions {
	display: flex;
	flex-direction: column;
	gap: var(--matching-space-2);
}

.matching-job-bookmark-btn--login {
	font: inherit;
}

body.matching-job-bookmark-gate-open {
	overflow: hidden;
}

.matching-job-bookmark-gate {
	position: fixed;
	inset: 0;
	z-index: 10050;
	display: grid;
	place-items: center;
	padding: max(1.2rem, env(safe-area-inset-top)) max(1.2rem, env(safe-area-inset-right)) max(1.2rem, env(safe-area-inset-bottom)) max(1.2rem, env(safe-area-inset-left));
}

.matching-job-bookmark-gate[hidden] {
	display: none !important;
}

.matching-job-bookmark-gate-backdrop {
	position: absolute;
	inset: 0;
	background: color-mix(in srgb, var(--matching-color-text) 52%, transparent);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.matching-job-bookmark-gate-panel {
	position: relative;
	z-index: 1;
	width: min(100%, 38rem);
	padding: 0;
	background: var(--matching-color-bg);
	border: var(--matching-card-border);
	border-radius: var(--matching-card-radius);
	box-shadow:
		0 24px 48px color-mix(in srgb, var(--matching-color-text) 18%, transparent),
		0 8px 16px color-mix(in srgb, var(--matching-color-text) 8%, transparent);
	overflow: hidden;
}

.matching-job-bookmark-gate-dismiss {
	position: absolute;
	top: 0.85rem;
	right: 0.85rem;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 4rem;
	height: 4rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--matching-radius-sm);
	background: transparent;
	color: var(--matching-color-muted);
	font: inherit;
	line-height: 1;
	cursor: pointer;
	transition: background var(--matching-transition), color var(--matching-transition);
}

.matching-job-bookmark-gate-dismiss:hover,
.matching-job-bookmark-gate-dismiss:focus-visible {
	background: var(--matching-color-surface);
	color: var(--matching-color-heading);
}

.matching-job-bookmark-gate-dismiss-icon {
	font-size: 2.4rem;
	font-weight: 300;
	line-height: 1;
}

.matching-job-bookmark-gate-body {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 2.6rem 2.15rem 2rem;
	text-align: center;
}

.matching-job-bookmark-gate-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 5.6rem;
	height: 5.6rem;
	margin-bottom: 1.2rem;
	border-radius: 50%;
	background: color-mix(in srgb, var(--matching-color-primary) 10%, var(--matching-color-bg));
	color: var(--matching-color-primary);
}

.matching-job-bookmark-gate-title {
	margin: 0 0 0.65rem;
	font-size: 1.85rem;
	font-weight: 700;
	color: var(--matching-color-heading);
	line-height: 1.4;
	text-wrap: balance;
}

.matching-job-bookmark-gate-lead {
	max-width: 28em;
	margin: 0 0 1.6rem;
	font-size: var(--matching-public-lead-fs, 1.5rem);
	line-height: 1.6;
	color: var(--matching-color-muted);
	text-wrap: pretty;
}

.matching-job-bookmark-gate-actions {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 0.75rem;
	width: 100%;
	max-width: 26rem;
}

.matching-job-bookmark-gate-actions .btn {
	width: 100%;
	justify-content: center;
}

.matching-job-bookmark-gate-cancel {
	display: block;
	width: 100%;
	max-width: 26rem;
	margin: 1rem 0 0;
	padding: 0.55rem 0.75rem;
	border: 0;
	background: transparent;
	color: var(--matching-color-muted);
	font: inherit;
	font-size: var(--matching-public-meta-fs, 1.5rem);
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	text-decoration: none;
	transition: color var(--matching-transition);
}

.matching-job-bookmark-gate-cancel:hover,
.matching-job-bookmark-gate-cancel:focus-visible {
	color: var(--matching-color-link);
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

@media (prefers-reduced-motion: no-preference) {
	.matching-job-bookmark-gate:not([hidden]) .matching-job-bookmark-gate-backdrop {
		animation: matching-job-bookmark-gate-backdrop-in 0.2s ease;
	}

	.matching-job-bookmark-gate:not([hidden]) .matching-job-bookmark-gate-panel {
		animation: matching-job-bookmark-gate-panel-in 0.24s ease;
	}
}

@keyframes matching-job-bookmark-gate-backdrop-in {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

@keyframes matching-job-bookmark-gate-panel-in {
	from {
		opacity: 0;
		transform: translateY(0.75rem) scale(0.98);
	}

	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@media (max-width: 767px) {
	.matching-job-bookmark-gate {
		place-items: end center;
		padding: 0;
	}

	.matching-job-bookmark-gate-panel {
		width: 100%;
		max-width: none;
		border-radius: calc(var(--matching-card-radius) + 4px) calc(var(--matching-card-radius) + 4px) 0 0;
		border-bottom: 0;
	}

	.matching-job-bookmark-gate-body {
		padding: 2.2rem 1.75rem max(1.85rem, env(safe-area-inset-bottom));
	}

	.matching-job-bookmark-gate-title {
		font-size: 1.75rem;
	}

	.matching-job-bookmark-gate-lead {
		font-size: var(--matching-public-label-fs, 1.5rem);
	}

	@media (prefers-reduced-motion: no-preference) {
		.matching-job-bookmark-gate:not([hidden]) .matching-job-bookmark-gate-panel {
			animation: matching-job-bookmark-gate-sheet-in 0.28s ease;
		}
	}

	@keyframes matching-job-bookmark-gate-sheet-in {
		from {
			opacity: 0;
			transform: translateY(100%);
		}

		to {
			opacity: 1;
			transform: translateY(0);
		}
	}
}
