/*
 * Date archive + front-page hero button patch for the Cocoon child theme.
 * Date archive rules are strictly scoped to body.date.
 */

body.date {
	--nk-bg: #fffaf2;
	--nk-paper: #fff;
	--nk-ink: #2f281d;
	--nk-muted: #706757;
	--nk-line: #eadfce;
	--nk-primary: #7c61d4;
	--nk-radius: 8px;
	--nk-max: 1180px;
	background: linear-gradient(180deg, #fff7e7 0, var(--nk-bg) 330px, #fffdf8 100%);
	color: var(--nk-ink);
	font-family: "Noto Sans JP", system-ui, sans-serif;
}

/* Replace only the date archive's Cocoon shell with the shared new shell. */
body.date .header-container,
body.date #navi,
body.date .mobile-menu-buttons,
body.date footer.footer {
	display: none !important;
}

body.date .content {
	margin-top: 0;
}

body.date .content-in {
	width: min(var(--nk-max), calc(100% - 32px));
	margin: 0 auto;
	padding: 24px 0 72px;
}

body.date .main {
	width: 100% !important;
	border: 0;
	padding: 0;
	background: transparent;
	box-shadow: none;
}

body.date .sidebar {
	display: none !important;
}

body.date .breadcrumb {
	margin: 0 0 28px;
	color: var(--nk-muted);
	font-size: 12px;
	font-weight: 700;
}

/* New-design header/navigation, matching category and article-list pages. */
body.date .nk-post-header {
	position: sticky;
	top: 0;
	z-index: 100;
	border-bottom: 1px solid rgba(234, 223, 206, .85);
	background: rgba(255, 250, 242, .9);
	backdrop-filter: blur(16px);
}

body.date .nk-post-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	width: min(var(--nk-max), calc(100% - 32px));
	min-height: 72px;
	margin: 0 auto;
}

body.date .nk-post-brand {
	display: grid;
	gap: 2px;
	color: var(--nk-ink);
	text-decoration: none;
}

body.date .nk-post-brand strong {
	font-family: "M PLUS Rounded 1c", "Noto Sans JP", sans-serif;
	font-size: clamp(18px, 2.3vw, 24px);
}

body.date .nk-post-brand span {
	color: var(--nk-muted);
	font-size: 13px;
	font-weight: 700;
}

body.date .nk-post-nav {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: 6px;
}

body.date .nk-post-nav a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	border: 1px solid transparent;
	border-radius: 999px;
	padding: 0 13px;
	color: #463d31;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
}

body.date .nk-post-nav a:hover {
	border-color: var(--nk-line);
	background: var(--nk-paper);
}

body.date .nk-post-brand:focus-visible,
body.date .nk-post-nav a:focus-visible,
body.date .nk-post-footer-nav a:focus-visible {
	outline: 3px solid var(--nk-primary);
	outline-offset: 4px;
}

/* Date title. */
body.date .archive-title,
body.date .list-title {
	max-width: 820px;
	margin: 0;
	border: 0;
	padding: 34px 0 28px;
	background: transparent;
	color: var(--nk-ink);
	font-family: "M PLUS Rounded 1c", "Noto Sans JP", sans-serif;
	font-size: clamp(38px, 6vw, 64px);
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: 0;
}

/* Cocoon still generates every article card dynamically. */
body.date #list,
body.date .list {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
	border-top: 1px solid var(--nk-line);
	padding-top: 30px;
}

body.date .entry-card-wrap {
	display: block !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
}

body.date .entry-card {
	display: block !important;
	height: 100%;
	overflow: hidden;
	border: 1px solid var(--nk-line);
	border-radius: var(--nk-radius);
	padding: 0 !important;
	background: var(--nk-paper);
	box-shadow: 0 10px 26px rgba(47, 40, 29, .05);
}

body.date .entry-card-thumb {
	position: relative;
	float: none !important;
	width: 100% !important;
	margin: 0 !important;
}

body.date .entry-card-thumb img {
	width: 100% !important;
	height: auto !important;
	aspect-ratio: 16 / 10;
	border-radius: 0 !important;
	object-fit: cover;
}

body.date .entry-card .cat-label {
	display: inline-flex;
	align-items: center;
	min-height: 30px;
	border: 0;
	border-radius: 999px;
	padding: 0 10px;
	background: #eee9ff;
	color: #5e45b8;
	font-size: 12px;
	font-weight: 800;
}

body.date .entry-card-content {
	margin: 0 !important;
	padding: 16px !important;
}

body.date .entry-card-title {
	margin: 0 0 8px;
	font-family: "M PLUS Rounded 1c", "Noto Sans JP", sans-serif;
	font-size: 19px;
	font-weight: 800;
	line-height: 1.5;
}

body.date .entry-card-snippet {
	margin: 0;
	color: #5b5143;
	font-size: 13px;
	line-height: 1.7;
}

body.date .entry-card-meta,
body.date .post-date {
	margin-top: 12px;
	color: var(--nk-muted);
	font-size: 12px;
	font-weight: 700;
}

body.date .pagination {
	grid-column: 1 / -1;
	margin-top: 18px;
}

/* New-design footer. */
body.date .nk-post-footer {
	border-top: 1px solid var(--nk-line);
	background: rgba(255, 255, 255, .66);
}

body.date .nk-post-footer-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	width: min(var(--nk-max), calc(100% - 32px));
	min-height: 110px;
	margin: 0 auto;
	color: var(--nk-muted);
	font-size: 13px;
}

body.date .nk-post-footer-brand {
	display: grid;
	gap: 2px;
}

body.date .nk-post-footer strong {
	color: var(--nk-ink);
	font-family: "M PLUS Rounded 1c", "Noto Sans JP", sans-serif;
	font-size: 18px;
}

body.date .nk-post-footer-nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 6px 18px;
}

body.date .nk-post-footer-nav a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: #5e45b8;
	font-size: 13px;
	font-weight: 800;
}

/* Front-page CTA height fix remains isolated from all archive rules. */
body.home .nk-hero-actions .nk-button {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 48px;
	min-height: 48px;
	padding-block: 0 !important;
	padding-inline: 20px !important;
	line-height: 1.4;
}

@media (max-width: 920px) {
	body.date #list,
	body.date .list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	body.date .content-in,
	body.date .nk-post-header-inner,
	body.date .nk-post-footer-inner {
		width: min(100% - 24px, var(--nk-max));
	}

	body.date .content-in {
		padding-top: 16px;
	}

	body.date .nk-post-header {
		position: relative;
	}

	body.date .nk-post-header-inner {
		align-items: flex-start;
		flex-direction: column;
		gap: 8px;
		padding: 10px 0;
	}

	body.date .nk-post-nav {
		width: 100%;
		flex-wrap: nowrap;
		justify-content: flex-start;
		overflow-x: auto;
		padding-bottom: 4px;
		scrollbar-width: none;
	}

	body.date .nk-post-nav::-webkit-scrollbar {
		display: none;
	}

	body.date .nk-post-nav a {
		flex: 0 0 auto;
		min-height: 40px;
		border-color: var(--nk-line);
		padding: 0 12px;
		background: rgba(255, 255, 255, .78);
	}

	body.date .archive-title,
	body.date .list-title {
		font-size: 38px;
	}

	body.date #list,
	body.date .list {
		grid-template-columns: 1fr;
	}

	body.date .entry-card .cat-label {
		font-size: 13px;
	}

	body.date .entry-card-title {
		font-size: 20px;
	}

	body.date .entry-card-snippet {
		font-size: 15px;
		line-height: 1.8;
	}

	body.date .entry-card-meta,
	body.date .post-date {
		font-size: 13px;
	}

	body.date .nk-post-footer-inner {
		align-items: flex-start;
		flex-direction: column;
		justify-content: center;
		gap: 5px;
	}

	body.date .nk-post-footer-nav {
		justify-content: flex-start;
	}
}
