/*
  Front page styles, ported from the EmDash theme (src/styles/theme.css "Home" and
  components/PostCard.astro). Loaded on the front page only (functions.php).
  The EmDash tokens are redefined here under .cashless-home so the rules below stay as they were.
*/

.cashless-home {
	--mint-50: #eaf6f1;
	--mint-100: #cfe9de;
	--mint-500: #3cb88f;
	--line: #dce5df;
	--line-strong: #c8d8d0;
	--coral-500: #ef7a63;
	--yellow-200: #ffe58a;
	--cream-50: #fff8ec;
	--color-bg: #f7f9f8;
	--color-surface: #ffffff;
	--color-fill: #f1f5f3;
	--color-text: #26312d;
	--color-text-secondary: #52635b;
	--color-muted: #5f6f68;
	--color-border: var(--line);
	--color-border-subtle: #e8eeea;
	--color-media-outline: rgb(0 0 0 / 0.1);
	--color-shadow-strong: rgb(30 60 50 / 0.12);
	--color-brand: #0b7a5e;
	--color-brand-hover: #086149;
	--color-on-brand: #ffffff;
	--font-rounded: "M PLUS Rounded 1c";
	--font-body: "Noto Sans JP";
	--font-size-xs: 0.8125rem;
	--font-size-sm: 0.875rem;
	--font-size-base: 1rem;
	--font-size-lg: 1.125rem;
	--font-size-xl: 1.25rem;
	--leading-snug: 1.55;
	--leading-normal: 1.5;
	--spacing-1: 0.25rem;
	--spacing-2: 0.5rem;
	--spacing-3: 0.75rem;
	--spacing-4: 1rem;
	--spacing-5: 1.25rem;
	--spacing-6: 1.5rem;
	--spacing-8: 2rem;
	--radius: 8px;
	--radius-lg: 10px;
	--radius-xl: 12px;
	--radius-full: 999px;
	--card-padding: 6px;
	--shadow-card: 0 0 0 1px var(--line);
	--shadow-card-hover: 0 0 0 1px var(--line-strong), 0 6px 16px -8px var(--color-shadow-strong);
	--ease-out: cubic-bezier(0.2, 0, 0, 1);
	--transition-fast: 150ms var(--ease-out);
	--transition-base: 250ms var(--ease-out);
	color: var(--color-text);
}

/* SWELL wraps content in a centred container; the home bands run full width instead. */
.home #content.l-content {
	max-width: none;
	margin: 0;
	padding: 0;
}

.home .l-mainContent.cashless-home {
	width: 100%;
	margin: 0;
	padding: 0;
}

.cashless-home .frame {
	box-sizing: border-box;
	width: min(100%, 1200px);
	margin-inline: auto;
	padding-inline: clamp(1rem, 3vw, 2rem);
}

.cashless-home :is(h1, h2, h3, p, ul) {
	margin: 0;
}

.cashless-home :is(h1, h2, h3) {
	word-break: auto-phrase;
	text-wrap: pretty;
}

.cashless-home a:focus-visible,
.cashless-home button:focus-visible,
.cashless-home input:focus-visible {
	outline: 3px solid var(--color-brand);
	outline-offset: 2px;
}

/* ---------- Home ---------- */

.cashless-home .home-hero {
	background: var(--cream-50);
	border-block-end: 1px solid var(--line);
}

.cashless-home .home-hero__inner {
	display: grid;
	grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
	align-items: center;
	gap: var(--spacing-8);
	padding-block: clamp(1.5rem, 0.75rem + 3vw, 3rem);
}

.cashless-home .home-hero__badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-block-end: var(--spacing-3);
	padding: 4px 12px;
	border: 1px solid var(--mint-100);
	border-radius: var(--radius-full);
	background: var(--color-surface);
	color: var(--color-brand);
	font-size: var(--font-size-sm);
	font-weight: 700;
}

.cashless-home .home-hero__badge::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--coral-500);
}

.cashless-home .home-hero__title {
	display: flex;
	align-items: center;
	gap: clamp(12px, 0.5rem + 1vw, 20px);
	font-family: var(--font-rounded), var(--font-body);
	font-size: clamp(1.75rem, 1.3rem + 2vw, 2.6rem);
	font-weight: 800;
	letter-spacing: 0.02em;
	line-height: 1.3;
	color: var(--color-text);
}

.cashless-home .home-hero__mark {
	flex-shrink: 0;
	width: clamp(48px, 2.5rem + 2vw, 72px);
	height: auto;
}

/* Phones: "キャッシュレスお助け帳" plus the mark must fit in about 340px. */
@media (max-width: 560px) {
	.cashless-home .home-hero__title {
		font-size: 1.45rem;
		gap: 10px;
	}

	.cashless-home .home-hero__mark {
		width: 44px;
	}

	.cashless-home .home-hero__badge {
		padding-inline: 10px;
		font-size: 0.75rem;
	}

	/* Five 44px links stack on phones; tighten the spacing, not the tap height. */
	.cashless-home .faq {
		margin-block-start: var(--spacing-4);
	}

	.cashless-home .faq__list {
		gap: 6px;
	}
}

.cashless-home .home-hero__accent {
	color: var(--color-brand);
	background: linear-gradient(transparent 68%, var(--yellow-200) 68%);
}

.cashless-home .home-hero__promises {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin-block-start: var(--spacing-3);
	padding: 0;
	list-style: none;
	font-size: var(--font-size-sm);
	font-weight: 700;
	color: var(--color-text-secondary);
}

.cashless-home .home-hero__promises li {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

/* Check mark drawn with borders, so no icon font is needed. */
.cashless-home .home-hero__promises li::before {
	content: "";
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	border-radius: 50%;
	background:
		linear-gradient(45deg, transparent 45%, #fff 45% 58%, transparent 58%) 3px 5px / 6px 6px no-repeat,
		linear-gradient(-45deg, transparent 42%, #fff 42% 56%, transparent 56%) 6px 3px / 8px 9px no-repeat,
		var(--color-brand);
}

.cashless-home .home-hero__lead {
	margin-block-start: var(--spacing-3);
	font-size: var(--font-size-base);
	line-height: 1.8;
	color: var(--color-text-secondary);
}

.cashless-home .home-hero__search {
	display: flex;
	gap: 8px;
	max-width: 32rem;
	margin-block-start: var(--spacing-5);
	padding: 4px;
	border: 2px solid var(--line-strong);
	border-radius: var(--radius-lg);
	background: var(--color-surface);
}

.cashless-home .home-hero__search input {
	flex: 1;
	min-width: 0;
	min-height: 44px;
	padding-inline: 12px;
	border: 0;
	background: transparent;
	color: var(--color-text);
	font: inherit;
	outline: none;
}

.cashless-home .home-hero__search button {
	min-height: 44px;
	padding: 0 22px;
	border: 0;
	border-radius: var(--radius);
	background: var(--color-brand);
	color: var(--color-on-brand);
	font-weight: 700;
	cursor: pointer;
}

.cashless-home .home-hero__search button:hover {
	background: var(--color-brand-hover);
}

/* The input drops its own outline, so the field frame shows focus instead. */
.cashless-home .home-hero__search:focus-within {
	border-color: var(--color-brand);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-brand) 25%, transparent);
}

.cashless-home .faq {
	margin-block-start: var(--spacing-5);
}

.cashless-home .faq__title {
	font-size: var(--font-size-sm);
	font-weight: 700;
	color: var(--color-text-secondary);
}

.cashless-home .faq__list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-block-start: var(--spacing-2);
	padding: 0;
	list-style: none;
}

.cashless-home .faq__list a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius-full);
	background: var(--color-surface);
	color: var(--color-brand);
	font-size: var(--font-size-sm);
	font-weight: 700;
	text-decoration: none;
}

.cashless-home .faq__list a:hover {
	border-color: var(--color-brand);
	background: var(--mint-50);
}

.cashless-home .home-hero__art {
	width: 100%;
	max-width: 22rem;
	height: auto;
	justify-self: end;
	border-radius: var(--radius-xl);
}

.cashless-home .home-section {
	padding-block: clamp(2rem, 1.25rem + 2.5vw, 3.25rem);
}

.cashless-home .home-section--tint {
	background: var(--color-fill);
}

.cashless-home .home-section__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--spacing-3);
}

.cashless-home .home-section__title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-block-end: var(--spacing-5);
	font-size: var(--font-size-xl);
	font-weight: 700;
}

.cashless-home .home-section__title::before {
	content: "";
	width: 4px;
	height: 1.2em;
	border-radius: 2px;
	background: var(--color-brand);
}

.cashless-home .home-section__title--sub {
	margin-block-start: var(--spacing-8);
	font-size: var(--font-size-lg);
}

.cashless-home .home-section__more {
	color: var(--color-brand);
	font-weight: 700;
}

.cashless-home .trouble-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--spacing-3);
	padding: 0;
	list-style: none;
}

.cashless-home .trouble-card {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr);
	grid-template-rows: auto auto;
	column-gap: var(--spacing-3);
	align-items: center;
	height: 100%;
	padding: var(--spacing-4);
	border: 1px solid var(--line);
	border-radius: var(--radius-xl);
	background: var(--color-surface);
	color: var(--color-text);
	text-decoration: none;
	transition: border-color var(--transition-fast);
}

.cashless-home .trouble-card:hover {
	border-color: var(--color-brand);
}

.cashless-home .trouble-card img {
	grid-row: 1 / 3;
	width: 56px;
	height: 56px;
	padding: 6px;
	border-radius: var(--radius-lg);
	background: var(--mint-50);
	object-fit: contain;
}

.cashless-home .trouble-card__label {
	align-self: end;
	font-size: var(--font-size-base);
	font-weight: 700;
}

.cashless-home .trouble-card__desc {
	align-self: start;
	font-size: 0.875rem;
	line-height: 1.6;
	color: var(--color-text-secondary);
}

.cashless-home .service-list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding: 0;
	list-style: none;
}

.cashless-home .service-link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 18px;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius-lg);
	background: var(--color-surface);
	color: var(--color-text);
	font-weight: 700;
	text-decoration: none;
}

.cashless-home .service-link:hover {
	border-color: var(--color-brand);
	color: var(--color-brand);
}

.cashless-home .policy__list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--spacing-4);
	padding: 0;
	list-style: none;
}

.cashless-home .policy__list li {
	padding: var(--spacing-4);
	border-block-start: 3px solid var(--mint-500);
	background: var(--color-surface);
	font-size: 0.9375rem;
	line-height: 1.8;
	color: var(--color-text-secondary);
}

.cashless-home .policy__list strong {
	display: block;
	margin-block-end: 4px;
	color: var(--color-text);
}

.cashless-home .home-empty {
	color: var(--color-muted);
}

@media (max-width: 1000px) {
	.cashless-home .trouble-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.cashless-home .home-hero__inner {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--spacing-4);
	}

	/* Search and questions first; the illustration is decoration. */
	.cashless-home .home-hero__art {
		max-width: 240px;
		justify-self: center;
	}

	.cashless-home .policy__list {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 560px) {
	.cashless-home .trouble-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.cashless-home .home-hero__art {
		display: none;
	}
}


/* ---------- Post cards (components/PostCard.astro, card variant) ---------- */

.cashless-home .post-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
}

@media (max-width: 1000px) {
	.cashless-home .post-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.cashless-home .post-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

.cashless-home .post {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	transition: box-shadow var(--transition-base);
}

.cashless-home .post__media {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 10;
	border-radius: var(--radius-lg);
	background: var(--color-fill);
}

.cashless-home .post__media::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	outline: 1px solid var(--color-media-outline);
	outline-offset: -1px;
	pointer-events: none;
}

.cashless-home .post__media img {
	width: 100%;
	max-width: none;
	height: 100%;
	object-fit: cover;
	transition: scale 500ms var(--ease-out);
}

.cashless-home .post:has(.post__link:hover, .post__media:hover) .post__media img {
	scale: 1.03;
}

.cashless-home .post__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
}

.cashless-home .post__link {
	display: flex;
	flex-direction: column;
	gap: var(--spacing-2);
	color: inherit;
	text-decoration: none;
}

.cashless-home .post__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	column-gap: var(--spacing-2);
	font-size: var(--font-size-xs);
	color: var(--color-muted);
	font-variant-numeric: tabular-nums;
}

.cashless-home .post__meta > :not(:last-child)::after {
	content: "·";
	margin-inline-start: var(--spacing-2);
}

.cashless-home .post__title {
	font-size: var(--font-size-lg);
	font-weight: 700;
	line-height: var(--leading-snug);
	color: var(--color-text);
	text-decoration-line: underline;
	text-decoration-thickness: 1px;
	text-decoration-color: transparent;
	text-underline-offset: 0.18em;
	transition: text-decoration-color var(--transition-fast);
}

.cashless-home .post__excerpt {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: var(--font-size-sm);
	line-height: var(--leading-normal);
	color: var(--color-text-secondary);
}

.cashless-home .post__footer {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--spacing-3);
	margin-top: auto;
	padding: 0 var(--spacing-3) var(--spacing-3);
}

.cashless-home .post--card {
	padding: var(--card-padding);
	border-radius: var(--radius-xl);
	background: var(--color-surface);
	box-shadow: var(--shadow-card);
}

.cashless-home .post--card:has(.post__link:hover, .post__media:hover) {
	box-shadow: var(--shadow-card-hover);
}

.cashless-home .post--card .post__link {
	padding: var(--spacing-4) var(--spacing-3);
}

.cashless-home .byline {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: var(--font-size-xs);
	color: var(--color-text-secondary);
}

.cashless-home .byline__avatar {
	display: inline-grid;
	place-items: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--color-fill);
	box-shadow: inset 0 0 0 1px var(--line);
	font-size: 0.625rem;
	color: var(--color-muted);
}

.cashless-home .chips {
	display: flex;
	flex-wrap: wrap;
	gap: var(--spacing-1);
	padding: 0;
	list-style: none;
}

.cashless-home .chip {
	display: inline-block;
	padding: 1px 10px;
	border-radius: var(--radius-full);
	background: var(--mint-50);
	color: var(--color-brand);
	font-size: var(--font-size-xs);
	font-weight: 700;
	line-height: 1.375rem;
	text-decoration: none;
}
