.wp-block-table {
	.wp-element-caption {
		margin-block-start: var(--wp--preset--spacing--20);
	}

	&:not([class*="is-style-"]),
	&.is-style-regular {
		table {
			width: 100%;
			vertical-align: middle;
			background-color: var(--wp--preset--color--white);

			&:has(thead) {
				thead {
					border: 1px solid var(--wp--preset--color--contrast);
					th {
						color: var(--wp--preset--color--white);
						background-color: var(--wp--preset--color--accent-1);
					}
				}
			}

			&:not(:has(thead)) {
				tbody {
					tr {
						> *:nth-child(1) {
							background-color: color-mix(
								in srgb,
								var(--wp--preset--color--accent-1),
								white 70%
							);
						}
					}
				}
			}

			th,
			td {
				padding: 1rem;
				border: 1px solid var(--wp--preset--color--contrast-1);
				@media (width < 600px) {
					padding: 0.2rem;
				}
			}

			th {
				font-weight: 500;
				text-align: center;

				@media (width < 600px) {
					width: 30%;
				}
			}

			td {
				+ td {
					@media (width < 600px) {
						margin-block-start: 0;
					}
				}
			}

			thead {
				border: 1px solid var(--wp--preset--color--contrast);

				th {
					color: var(--wp--preset--color--white);
					background-color: var(--wp--preset--color--accent-1);
				}
			}

			tbody {
				th {
					background-color: var(--wp--preset--color--contrast-4);
				}

				td {
					vertical-align: top;
				}
			}
		}

		figcaption {
			margin-block-start: 0.5rem;
			color: var(--wp--preset--color--dark-02);
			font-size: var(--wp--preset--font-size--small);
		}

		&.js-scrollable {
			table {
				@media (width < 600px) {
					width: var(--wp--style--global--content-size);
				}
			}
		}
	}

	&.is-style-time {
		width: 100%;
		overflow: auto;

		@media (width <= 1340px) {
			font-size: 0.8rem;
		}

		table {
			width: 100%;
			background-color: var(--wp--preset--color--white);

			tr {
				+ tr {
					border-block-start: 1px solid var(--wp--preset--color--contrast-3);
				}
			}

			td, th {
				border: none;
			}

			th,
			td {
				padding: 0.5rem;
				text-align: center;

				@media (width <= 1340px) {
					padding: 0.4rem;
				}
			}

			th {
				font-weight: 700;
			}

			thead {
				border-block-start: 1px solid var(--wp--preset--color--contrast-3);
				border-block-end: none;
				border-inline: 1px solid var(--wp--preset--color--contrast-3);
				background-color: var(--wp--preset--color--contrast-3);
			}

			tbody {
				border-inline: 1px solid var(--wp--preset--color--contrast-3);
				border-block-end: 1px solid var(--wp--preset--color--contrast-3);
				th {
					background-color: var(--wp--preset--color--contrast-4);
				}
			}
		}
	}

	&.is-style-price-col2,
	&.is-style-price-col3 {
		table {
			width: fit-content;
			vertical-align: middle;
			background-color: var(--wp--preset--color--white);

			th,
			td {
				padding: 1rem;
				border: 1px solid var(--wp--preset--color--contrast-3);
			}

			th {
				font-variation-settings: "wght" 600;
				text-align: center;
			}

			thead {
				background-color: var(--wp--preset--color--accent-1);
				color: var(--wp--preset--color--base);
				border-bottom: 0;
			}

			tbody {
				tr {
					&:has(th) {
						th {
							background-color: color-mix(in srgb, var(--wp--preset--color--accent-1) 10%, var(--wp--preset--color--white));
						}
						td {
							&:nth-of-type(1),
							&:nth-of-type(2) {
								font-size: var(--wp--preset--font-size--large);
								text-align: center;
								font-variation-settings: "wght" 600;
								color: var(--wp--preset--color--contrast-1);
							}
						}
					}

					&:not(:has(th)) {
						td {
							&:nth-of-type(1) {
								background-color: color-mix(in srgb, var(--wp--preset--color--accent-1) 10%, var(--wp--preset--color--white));
							}
							&:nth-of-type(2),
							&:nth-of-type(3) {
								font-size: var(--wp--preset--font-size--large);
								text-align: center;
								font-variation-settings: "wght" 600;
								color: var(--wp--preset--color--contrast-1);
							}
						}
					}
				}
			}
		}
	}

	&.is-style-stripes {
		th {
			word-break: keep-all;
		}
	}
}
