@layer reset {
	* {
		box-sizing: border-box;
		margin: 0;
	}

	a {
		color: inherit;
		text-decoration: none;
	}

	img {
		width: 100%;
		height: auto;
	}

	button {
		padding: 0;
		font: unset;
		color: inherit;
		text-align: left;
		cursor: pointer;
		background: none;
		border: none;
	}
}

@layer base {
	:root {
		--side-space: 20px;
	}

	body {
		font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
	}

	img {
		aspect-ratio: 2 / 1;
		object-fit: cover;
		vertical-align: bottom;
	}

	/* 一覧 */
	#photos,
	#cards {
		display: grid;
		grid-template-columns: repeat(2, 1fr);
		gap: 16px 20px;
		max-width: 500px;
		margin: 30px auto;
		padding-inline: var(--side-space);

		&[hidden] {
			display: none;
		}

		h2 {
			font-size: 14px;
			font-weight: normal;
			color: #444;
			text-transform: capitalize;
		}
	}

	/* 詳細 */
	article {
		> :not(img) {
			margin-inline: var(--side-space);
		}

		h1 {
			margin-block: 12px 4px;
			font-size: 32px;
			text-transform: capitalize;
		}

		.back {
			display: inline-block;
			margin-top: 4px;
			padding: 2px 16px;
			font-size: 14px;
			border: solid 1px gray;
		}

		@media (width >= 700px) {
			--side-space: 0;

			max-width: 680px;
			margin: 20px auto;
		}
	}
}
