:root {
	--arkb-btn-color--default: var(--ark-color--main, #000);
}

.ark-block-buttons {
	--arkb-gap--x: 1rem;
	--arkb-gap--y: 1rem;

	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;

	// エディター側は.ark-block-buttons__innerがあることに注意。

	&[data-orientation="horizontal"] {
		margin-left: calc(0px - var(--arkb-gap--x));
		column-gap: 0px;
		row-gap: var(--arkb-gap--y);

		.ark-block-button {
			margin-right: 0;
			margin-left: var(--arkb-gap--x);

			&[data-has-width] {
				width: calc(var(--arkb-btn-width) - var(--arkb-gap--x));
			}
		}
	}

	&[data-orientation="vertical"] {
		flex-direction: column;
		gap: var(--arkb-gap--y) var(--arkb-gap--x);

		.ark-block-button {
			margin-right: 0;
			margin-left: 0;

			&[data-has-width] {
				width: var(--arkb-btn-width);
			}
		}
	}

}

.ark-block-button {
	position: relative;
	margin-top: 0 !important;
	margin-bottom: 0 !important;

	&[data-has-width] {
		max-width: 100%;

		.ark-block-button__link {
			width: 100%;
		}
	}

	// 広告タグのimgに対処
	img {
		display: none;
	}

	.ark-block-button__link[data-has-icon] {
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}
}


.ark-block-button__link {
	position: relative;
	display: inline-flex;
	gap: .2em;
	align-items: center;
	justify-content: center;
	min-width: var(--arkb-btn-width, 3em);
	max-width: 100%;
	margin: 0;
	padding: .75em 1.75em;
	line-height: 1.5;
	text-align: center;
	text-decoration: none;
	border-radius: var(--arkb-btn-radius, 0px);
	transition: color .25s, background-color .25s;

	.ark-block-button__text {
		z-index: 0;
		min-width: 1em;
	}

	&::before {
		position: absolute;
		z-index: 1;
		border-radius: inherit;
		visibility: hidden;
		opacity: 0;
		transition: opacity .25s, visibility.25s;
		content: "";
		pointer-events: none;
		inset: 0;
	}

	&:hover::before {
		visibility: visible;
		opacity: 1;
	}
}

.ark-block-button__icon {
	z-index: 2;
	flex-shrink: 0;

	&.-left {
		transform: scale(1.25) translateX(-.25em);
	}

	&.-right {
		transform: scale(1.25) translateX(.25em);
	}

}

.ark-block-button[data-hover="bright"] .ark-block-button__link::before {
	background: rgba(#fff, .2);
}

.ark-block-button[data-hover="dark"] .ark-block-button__link::before {
	background: rgba(#000, .1);
}

.ark-block-button[data-hover="float"] .ark-block-button__link::before {
	box-shadow: 0px 8px 24px -4px rgba(0, 0, 0, .1), 0px 16px 32px -16px rgba(0, 0, 0, .2);
}


// normal
.is-btn-fill {
	--the-btn-color: var(--arkb-btn-color--bg, var(--arkb-btn-color--default));

	.ark-block-button__link {
		color: var(--arkb-btn-color--text, #fff);
		background: var(--the-btn-color);
	}

	&[data-hover="swap"] {

		.ark-block-button__link:hover {
			color: var(--the-btn-color);
			background: var(--arkb-btn-color--text, none);
			box-shadow: inset 0 0 0 1px var(--the-btn-color);
		}
	}
}

// アウトライン
.is-btn-outline {
	--the-btn-color: var(--arkb-btn-color--text, var(--arkb-btn-color--default));

	.ark-block-button__link {
		position: relative;
		color: var(--the-btn-color);
		background: var(--arkb-btn-color--bg, none);
		box-shadow: inset 0 0 0 1px var(--the-btn-color);
	}

	&[data-hover="swap"] {

		.ark-block-button__link:hover {
			color: var(--arkb-btn-color--bg, #fff);
			background: var(--the-btn-color);
		}
	}
}


// アウトライン
.is-btn-text {
	--the-btn-color: var(--arkb-btn-color--text, var(--arkb-btn-color--default));
	--arkb-btn-radius: 0px;

	.ark-block-button__link {
		position: relative;
		gap: .25em;
		padding: .5em;
		color: var(--the-btn-color);

		&::before {
			content: none;
		}
	}

	.ark-block-button__icon {
		padding: .2em;
		overflow: visible;
		font-size: 1.5em;
		border: solid 1px var(--the-btn-color);
		border-radius: 50%;
		transition: all .25s;
	}

	.ark-block-button__link:hover {
		text-decoration: underline;

		.ark-block-button__icon {
			color: #fff;
			background-color: var(--the-btn-color);
		}
	}
}
