/*
 * front-page.css - front page only.
 *
 * Two presentations from one server-rendered document:
 *
 *   default   four reading groups, one photograph each, ordinary page flow.
 *             This is what arrives with no scripting, with reduced motion requested,
 *             and under reduced data use.
 *   immersive added only when the switch in the document head allows it. The eight
 *             photographs are stacked in a pinned frame and cross-faded by reading
 *             position; opacity and a very small scale are the only properties touched.
 */

/* ---------- default reading presentation ---------- */

.tta-front {
	display: block;
}

.tta-stage {
	display: none;
}

.tta-groups {
	display: block;
}

.tta-group {
	max-width: var(--tta-wide);
	margin: 0 auto;
	padding: 1.5rem 1rem 2rem;
}

.tta-group + .tta-group {
	border-top: 1px solid var(--tta-mint);
}

.tta-group-media {
	margin: 0 0 1.25rem;
}

.tta-group-media img {
	width: 100%;
	border-radius: 0.25rem;
}

.tta-group-copy > .tta-beat-slot + .tta-beat-slot {
	margin-top: 1.75rem;
}

.tta-beat-slot h1,
.tta-beat-slot h2 {
	margin-bottom: 0.5em;
}

.tta-beat-slot ul,
.tta-beat-slot ol {
	max-width: var(--tta-measure);
}

.tta-beat-hint {
	font-size: 0.9375rem;
	color: var(--tta-tea);
	letter-spacing: 0.08em;
}

.tta-beat-caption {
	font-size: 0.875rem;
	color: var(--tta-tea);
}

/* ---------- standing notice ---------- */

.tta-notice-block {
	padding-top: 0;
}

.tta-notice-block p {
	max-width: none;
	background: var(--tta-mint);
	border-left: 4px solid var(--tta-ink);
	padding: 1rem;
	margin: 0;
}

/* ---------- six problem entries ---------- */

.tta-cards {
	background: var(--tta-warm);
	max-width: none;
}

.tta-cards > * {
	max-width: var(--tta-wide);
	margin-inline: auto;
}

.tta-card-list {
	list-style: none;
	margin: 1.5rem auto 0;
	padding: 0;
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.25rem;
}

.tta-card-item {
	background: var(--tta-ivory);
	border: 1px solid var(--tta-mint);
	border-radius: 0.25rem;
	padding: 0 0 1.1rem;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.tta-card-picture img {
	width: 100%;
}

.tta-card-item h3 {
	margin: 1rem 1rem 0.4rem;
}

.tta-card-item p {
	margin: 0 1rem 0.9rem;
	max-width: none;
	font-size: 0.9375rem;
}

.tta-card-item .tta-actions {
	margin: auto 1rem 0;
}

/* ---------- five daily steps, eating and drinking, credibility, questions ---------- */

.tta-steps ol,
.tta-food ul,
.tta-credibility ul {
	list-style: none;
	padding: 0;
	margin: 1.25rem 0 0;
	display: grid;
	grid-template-columns: 1fr;
	gap: 0.75rem;
	counter-reset: tta-step;
	max-width: none;
}

.tta-steps li,
.tta-food li,
.tta-credibility li {
	background: var(--tta-warm);
	border-radius: 0.25rem;
	padding: 0.9rem 1rem;
	margin: 0;
}

.tta-steps li {
	counter-increment: tta-step;
}

.tta-steps li::before {
	content: counter(tta-step) "、";
	font-family: var(--tta-serif);
	color: var(--tta-tea);
}

.tta-faq {
	background: var(--tta-mint);
	max-width: none;
}

.tta-faq > * {
	max-width: var(--tta-wide);
	margin-inline: auto;
}

.tta-faq h3 {
	margin-top: 1.5rem;
	font-size: 1.0625rem;
}

.tta-faq p {
	max-width: none;
}

/* ---------- desktop reading presentation ---------- */

@media (min-width: 768px) {
	.tta-group {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: 2rem;
		align-items: center;
		padding: 2.5rem 1.5rem 3rem;
	}

	.tta-group-media {
		margin: 0;
		order: 2;
	}

	.tta-group-copy {
		order: 1;
	}

	.tta-card-list {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.tta-steps ol {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}

	.tta-food ul,
	.tta-credibility ul {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* ---------- immersive presentation ---------- */

.tta-immersive .tta-story {
	position: relative;
	background: var(--tta-ink);
}

.tta-immersive .tta-stage {
	display: block;
	position: sticky;
	top: 0;
	height: 100vh;
	height: 100svh;
	overflow: hidden;
	background: var(--tta-ink);
}

.tta-immersive .tta-frame {
	position: absolute;
	inset: 0;
	opacity: 0;
	will-change: opacity;
}

.tta-immersive .tta-frame[data-tta-frame="1"] {
	opacity: 1;
}

.tta-immersive .tta-frame-picture,
.tta-immersive .tta-frame-picture img {
	width: 100%;
	height: 100%;
}

.tta-immersive .tta-frame-picture img {
	object-fit: cover;
	object-position: 50% 40%;
}

.tta-immersive .tta-groups {
	position: relative;
	z-index: 2;
	margin-top: -100vh;
	margin-top: -100svh;
}

.tta-immersive .tta-group {
	display: block;
	min-height: 135vh;
	padding: 0 1rem;
	border-top: 0;
}

.tta-immersive .tta-group-media {
	display: none;
}

.tta-immersive .tta-group-copy {
	max-width: 32rem;
}

.tta-immersive .tta-beat-slot {
	min-height: 66vh;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 1.25rem 1.15rem;
}

.tta-immersive .tta-beat-slot > * {
	background: rgba(20, 35, 31, 0.78);
	color: var(--tta-ivory);
	padding: 0.55rem 0.85rem;
	border-radius: 0.2rem;
	max-width: none;
}

.tta-immersive .tta-beat-slot h1,
.tta-immersive .tta-beat-slot h2,
.tta-immersive .tta-beat-slot h3 {
	color: var(--tta-ivory);
}

.tta-immersive .tta-beat-slot a {
	color: var(--tta-ivory);
}

.tta-immersive [data-tta-group="3"] .tta-beat-slot > *,
.tta-immersive [data-tta-group="4"] .tta-beat-slot > * {
	background: rgba(247, 245, 239, 0.85);
	color: var(--tta-text);
}

.tta-immersive [data-tta-group="3"] .tta-beat-slot h1,
.tta-immersive [data-tta-group="3"] .tta-beat-slot h2,
.tta-immersive [data-tta-group="3"] .tta-beat-slot h3,
.tta-immersive [data-tta-group="4"] .tta-beat-slot h1,
.tta-immersive [data-tta-group="4"] .tta-beat-slot h2,
.tta-immersive [data-tta-group="4"] .tta-beat-slot h3,
.tta-immersive [data-tta-group="3"] .tta-beat-slot a,
.tta-immersive [data-tta-group="4"] .tta-beat-slot a {
	color: var(--tta-ink);
}

.tta-immersive .tta-beat-slot .tta-actions > * {
	background: none;
	padding: 0;
}

@media (min-width: 768px) {
	.tta-immersive .tta-group {
		min-height: 165vh;
		padding: 0 1.5rem;
	}

	.tta-immersive .tta-groups {
		max-width: var(--tta-wide);
		margin-left: auto;
		margin-right: auto;
	}

	.tta-immersive .tta-beat-slot {
		min-height: 82vh;
		padding-left: 0;
	}

	.tta-immersive .tta-group-copy {
		max-width: 30rem;
	}

	.tta-immersive .tta-frame-picture img {
		object-position: 60% 45%;
	}
}

/* ---------- reduced motion wins outright ---------- */

@media (prefers-reduced-motion: reduce) {
	.tta-immersive .tta-story {
		background: none;
	}

	.tta-immersive .tta-stage {
		display: none;
	}

	.tta-immersive .tta-groups {
		margin-top: 0;
	}

	.tta-immersive .tta-group {
		min-height: 0;
		padding: 1.5rem 1rem 2rem;
	}

	.tta-immersive .tta-group-media {
		display: block;
	}

	.tta-immersive .tta-beat-slot {
		min-height: 0;
		display: block;
		padding: 0;
	}

	.tta-immersive .tta-beat-slot > * {
		background: none;
		color: inherit;
		padding: 0;
	}

	.tta-immersive .tta-beat-slot h1,
	.tta-immersive .tta-beat-slot h2,
	.tta-immersive .tta-beat-slot h3 {
		color: var(--tta-ink);
	}

	.tta-immersive .tta-beat-slot a {
		color: var(--tta-tea);
	}
}
