/* ==========================================================================
   LittlePanda — main stylesheet
   Palette taken from the logo: navy ring, steel shield, circuit blue,
   and the red shared by the Union Flag and the Hinomaru.
   System fonts only: no font downloads, no third-party requests.
   ========================================================================== */

:root {
	--ink: #0f2242;
	--ink-2: #1a3560;
	--steel: #3d5f8c;
	--silver: #d5dce5;
	--paper: #f4f6f9;
	--signal: #b2434a;
	--trace: #7dbfe3;

	--bg: var(--paper);
	--surface: #ffffff;
	--text: #1a2233;
	--muted: #55627a;
	--line: #d5dce5;
	--field: #8e9bb0;
	--link: #24497a;
	--link-hover: var(--signal);
	--focus: var(--signal);
	--button: var(--ink);

	--sans: "Avenir Next", Avenir, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
	--serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, "Hiragino Mincho ProN", "Yu Mincho", serif;
	--mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;

	--step--1: 0.875rem;
	--step-0: 1.125rem;
	--step-1: 1.375rem;
	--step-2: 1.75rem;
	--step-3: clamp(2rem, 1.5rem + 2vw, 2.75rem);
	--step-4: clamp(2.25rem, 1.4rem + 3.4vw, 3.75rem);

	--wrap: 72rem;
	--narrow: 42rem;
	--gutter: clamp(1rem, 4vw, 2rem);
	--radius: 4px;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0b1830;
		--surface: #112340;
		--text: #e3e8ef;
		--muted: #9fb0c6;
		--line: #243c62;
		--field: #4a6488;
		--link: #8cc8ea;
		--link-hover: #f2a7ab;
		--focus: var(--trace);
		--button: var(--steel);
	}
}

/* Base --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--serif);
	font-size: var(--step-0);
	line-height: 1.65;
	font-kerning: normal;
	text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; }

h1, h2, h3, h4, h5, h6 {
	margin: 0;
	font-family: var(--sans);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.012em;
	text-wrap: balance;
}

p { margin: 0 0 1em; }

a {
	color: var(--link);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}
a:hover { color: var(--link-hover); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	left: 1rem; top: -10rem;
	z-index: 100;
	padding: 0.6rem 1rem;
	background: #fff;
	color: var(--ink);
	font-family: var(--sans);
	border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.wrap--narrow { --wrap: var(--narrow); }

/* Masthead ----------------------------------------------------------------- */
.masthead {
	--focus: var(--trace);
	background-color: var(--ink);
	background-image: radial-gradient(rgba(125, 191, 227, 0.14) 1px, transparent 1.4px);
	background-size: 24px 24px;
	color: #e8edf4;
}
@media (prefers-color-scheme: dark) {
	.masthead { border-bottom: 1px solid var(--line); }
}

.masthead__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 1.5rem;
	padding-block: 1rem;
}

.brand {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	color: #fff;
	text-decoration: none;
}
.brand:hover { color: #fff; }
.site-nav__toggle { margin-left: auto; }
.brand__logo { width: 56px; height: 56px; flex: none; }
.brand__text { display: flex; flex-direction: column; font-family: var(--sans); }
.brand__name { font-size: 1.35rem; font-weight: 700; letter-spacing: 0.04em; line-height: 1.2; }
.brand__tag { font-size: var(--step--1); color: #a9b8cc; }

/* Navigation */
.site-nav { font-family: var(--sans); font-size: 1rem; }
.site-nav__list { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin: 0; padding: 0; list-style: none; }
.site-nav__list ul { margin: 0; padding: 0; list-style: none; }
.site-nav__list a {
	display: block;
	padding: 0.4rem 0;
	color: #dfe6ef;
	text-decoration: none;
	border-bottom: 2px solid transparent;
}
.site-nav__list a:hover { color: #fff; border-bottom-color: var(--trace); }
.site-nav__list .current-menu-item > a,
.site-nav__list .current_page_item > a,
.site-nav__list .current-menu-ancestor > a { color: #fff; border-bottom-color: var(--signal); }

.site-nav__toggle {
	display: none;
	padding: 0.45rem 0.9rem;
	background: transparent;
	color: #fff;
	font: 600 0.95rem var(--sans);
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: var(--radius);
	cursor: pointer;
}
.site-nav__toggle[aria-expanded="true"] { background: var(--ink-2); }

@media (min-width: 48.01rem) {
	.site-nav__list li { position: relative; }
	.site-nav__list .sub-menu {
		display: none;
		position: absolute;
		top: 100%; left: -1rem;
		z-index: 20;
		min-width: 14rem;
		padding: 0.5rem 1rem;
		background: var(--ink-2);
		border-radius: var(--radius);
	}
	.site-nav__list li:hover > .sub-menu,
	.site-nav__list li:focus-within > .sub-menu { display: block; }
}

@media (max-width: 30rem) {
	.masthead__bar { gap: 0.75rem; }
	.masthead__bar { flex-wrap: wrap; }
	.brand { gap: 0.6rem; flex: 1 1 0; min-width: 0; }
	.brand__text { min-width: 0; }
	.brand__logo { width: 44px; height: 44px; }
	.brand__name { font-size: 1.15rem; }
	.brand__tag { font-size: 0.72rem; line-height: 1.35; }
}

@media (max-width: 48rem) {
	.has-js .site-nav__toggle { display: inline-block; }
	.site-nav { flex-basis: 100%; }
	.has-js .site-nav:not(.is-open) { display: none; }
	.site-nav__list { flex-direction: column; gap: 0; padding-bottom: 0.5rem; }
	.site-nav__list a { padding: 0.7rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
	.site-nav__list .sub-menu { padding-left: 1rem; }
}

/* Homepage hero ------------------------------------------------------------ */
.hero-band--image { background-size: cover; background-position: center; }

.hero {
	display: grid;
	align-items: center;
	gap: 2rem;
	padding-block: clamp(2rem, 6vw, 4.5rem) clamp(2.5rem, 6vw, 4.5rem);
}
@media (min-width: 52rem) {
	.hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
}

.hero__title {
	max-width: 16ch;
	color: #fff;
	font-size: var(--step-4);
	line-height: 1.08;
	letter-spacing: -0.02em;
}
.hero__text {
	max-width: 36ch;
	margin: 1.25rem 0 0;
	color: #c3cfdd;
	font-size: 1.25rem;
	line-height: 1.55;
}

/* The one moment of motion: the trace draws from the UK node to the Japan node on load. */
.circuit { width: 100%; max-width: 32rem; justify-self: end; overflow: visible; }
.circuit__bg path { fill: none; stroke: var(--steel); stroke-width: 2; opacity: 0.6; }
.circuit__vias circle { fill: var(--ink); stroke: var(--steel); stroke-width: 2; }
.circuit__main {
	fill: none;
	stroke: var(--trace);
	stroke-width: 3;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-dasharray: 1;
	stroke-dashoffset: 1;
	animation: lp-draw 1.6s 0.25s cubic-bezier(0.65, 0, 0.25, 1) forwards;
}
.circuit__node { fill: var(--ink); stroke-width: 4; }
.circuit__node--uk { stroke: var(--signal); }
.circuit__node--jp { stroke: var(--trace); opacity: 0.25; animation: lp-arrive 0.35s 1.8s ease-out forwards; }
.circuit__label { fill: #a9b8cc; font-family: var(--sans); font-size: 14px; }

@keyframes lp-draw { to { stroke-dashoffset: 0; } }
@keyframes lp-arrive { to { opacity: 1; } }

@media (max-width: 51.99rem) {
	.circuit { max-width: 24rem; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
	.circuit__main { animation: none; stroke-dashoffset: 0; }
	.circuit__node--jp { animation: none; opacity: 1; }
}

/* Layout ------------------------------------------------------------------- */
.site-main { display: block; padding-block: clamp(2rem, 5vw, 3.5rem) 4rem; }
.site-main:focus { outline: none; }

.layout { display: grid; gap: 3rem; }
@media (min-width: 60rem) {
	.layout { grid-template-columns: minmax(0, 1fr) 17rem; gap: 4rem; }
}

.page-header { margin-bottom: 2rem; }
.page-title { font-size: var(--step-3); }
.page-header__desc { max-width: 60ch; margin-top: 0.5rem; color: var(--muted); }
.page-header__desc p:last-child { margin-bottom: 0; }

.section-title { margin-bottom: 0.75rem; color: var(--muted); font-size: var(--step-1); font-weight: 600; }

.meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1rem;
	margin: 0.6rem 0 0;
	color: var(--muted);
	font-family: var(--sans);
	font-size: var(--step--1);
}
.meta a { color: var(--muted); }
.meta a:hover { color: var(--link-hover); }

/* Post list */
.entry-list { border-top: 1px solid var(--line); }

.entry-row {
	display: grid;
	gap: 0.25rem 1.5rem;
	padding-block: 1.5rem;
	border-bottom: 1px solid var(--line);
}
@media (min-width: 40rem) {
	.entry-row { grid-template-columns: 7.5rem minmax(0, 1fr); }
}
.entry-row__date {
	margin: 0;
	padding-top: 0.3rem;
	color: var(--muted);
	font-family: var(--sans);
	font-size: var(--step--1);
	font-variant-numeric: tabular-nums;
}
.entry-row__title { font-size: var(--step-1); line-height: 1.25; }
.entry-row__title a { color: var(--text); text-decoration: none; }
.entry-row__title a:hover { color: var(--link-hover); text-decoration: underline; }
.entry-row__excerpt { max-width: 62ch; margin: 0.4rem 0 0; }
.sticky .entry-row__title::after {
	content: "Pinned";
	margin-left: 0.6rem;
	padding: 0.1rem 0.45rem;
	color: var(--signal);
	font-size: 0.75rem;
	font-weight: 600;
	vertical-align: middle;
	border: 1px solid currentColor;
	border-radius: var(--radius);
}

/* Single post / page -------------------------------------------------------- */
.entry__header { margin-bottom: 2rem; }
.entry__title { margin-top: 0.5rem; font-size: var(--step-3); }
.entry__header .meta { margin-top: 0; }
.entry__lede { margin: 1rem 0 0; color: var(--muted); font-size: 1.3rem; line-height: 1.5; }
.entry__image { margin: 0 auto 2.5rem; }
.entry__image img { display: block; width: 100%; border-radius: var(--radius); }

.entry__content { overflow-wrap: break-word; }
.entry__content > * { margin-block: 0; }
.entry__content > * + * { margin-top: 1.3em; }
.entry__content h2 { margin-top: 2.2em; font-size: var(--step-2); }
.entry__content h3 { margin-top: 1.8em; font-size: var(--step-1); }
.entry__content h4 { margin-top: 1.6em; font-size: var(--step-0); }
.entry__content ul, .entry__content ol { padding-left: 1.4em; }
.entry__content li + li { margin-top: 0.35em; }
.entry__content blockquote {
	margin-inline: 0;
	padding-left: 1.25rem;
	border-left: 3px solid var(--signal);
	font-style: italic;
}
.entry__content .alignwide { margin-inline: calc(50% - min(50vw - var(--gutter), 30rem)); max-width: none; }
.entry__content .alignfull { margin-inline: calc(50% - 50vw); max-width: 100vw; }
.alignleft { float: left; margin: 0.3em 1.5em 1em 0; }
.alignright { float: right; margin: 0.3em 0 1em 1.5em; }
.aligncenter { margin-inline: auto; }

figure { margin: 0; }
figcaption, .wp-element-caption, .wp-caption-text {
	margin-top: 0.5rem;
	color: var(--muted);
	font-family: var(--sans);
	font-size: var(--step--1);
}

code, kbd, samp, pre { font-family: var(--mono); font-size: 0.88em; }
:not(pre) > code { padding: 0.1em 0.35em; background: rgba(61, 95, 140, 0.13); border-radius: 3px; }
pre {
	padding: 1rem 1.25rem;
	overflow-x: auto;
	background: var(--ink);
	color: #e3e8ef;
	line-height: 1.5;
	tab-size: 2;
	border-radius: var(--radius);
}
@media (prefers-color-scheme: dark) {
	pre { background: #07101f; border: 1px solid var(--line); }
}

table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 1rem; }
th, td { padding: 0.5rem 0.75rem; text-align: left; border-bottom: 1px solid var(--line); }
th { font-weight: 600; }
.wp-block-table { overflow-x: auto; }

hr { margin-block: 2.5rem; border: 0; border-top: 1px solid var(--line); }

.entry__footer { margin-top: 3rem; }
.entry__tags { margin-bottom: 1.5rem; }

.post-navigation .nav-links {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
	margin-top: 2rem;
	padding-top: 1.5rem;
	font-family: var(--sans);
	border-top: 1px solid var(--line);
}
.post-navigation .nav-next { text-align: right; }
.post-navigation a { font-weight: 600; text-decoration: none; }
.nav-label { display: block; color: var(--muted); font-size: var(--step--1); font-weight: 400; }

/* Links & Resources --------------------------------------------------------- */
.lp-links { margin: 0; padding: 0; list-style: none; }
.lp-link { padding-block: 0.85rem; border-bottom: 1px solid var(--line); }
.lp-link:last-child { border-bottom: 0; }
.lp-link__title { font-family: var(--sans); font-size: 1.05rem; font-weight: 600; }
.lp-link__where {
	margin-left: 0.4rem;
	color: var(--muted);
	font-family: var(--sans);
	font-size: var(--step--1);
	white-space: nowrap;
}
.lp-link__desc { max-width: 60ch; margin: 0.25rem 0 0; font-size: 1rem; }

.lp-links--compact .lp-link { padding-block: 0.6rem; }
.lp-links--compact .lp-link__title { font-size: 1rem; }
.lp-links--compact .lp-link__where { display: block; margin: 0; }
.lp-links--compact .lp-link__desc { color: var(--muted); font-size: 0.925rem; line-height: 1.5; }

.lp-directory { margin-top: 2.5rem; }
.lp-jump ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.25rem;
	margin: 0 0 2rem;
	padding: 0 0 1.25rem;
	font-family: var(--sans);
	font-size: 1rem;
	list-style: none;
	border-bottom: 1px solid var(--line);
}
.lp-jump li + li { margin-top: 0; }
.lp-group { scroll-margin-top: 1.5rem; }
.lp-group + .lp-group { margin-top: 3rem; }
.entry__content .lp-group__title { margin-top: 0; font-size: var(--step-2); }
.lp-group__desc { margin: 0.4rem 0 0.5rem; color: var(--muted); }
.entry__content .lp-links { padding-left: 0; }

.lp-related {
	margin-bottom: 2.5rem;
	padding: 1.25rem 1.5rem;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
}
.lp-related__title { margin-bottom: 0.25rem; font-size: var(--step-1); }

/* Sidebar ------------------------------------------------------------------- */
.layout__side { font-size: 1rem; }
.widget + .widget { margin-top: 2.5rem; }
.widget-title, .widget .wp-block-heading {
	margin-bottom: 0.75rem;
	padding-bottom: 0.5rem;
	font-size: 1rem;
	border-bottom: 2px solid var(--text);
}
.widget ul { margin: 0; padding: 0; list-style: none; }
.widget li { padding: 0.3rem 0; }
.widget li .children { padding-left: 1rem; }

/* Forms --------------------------------------------------------------------- */
label { display: block; margin-bottom: 0.3rem; font-family: var(--sans); font-size: 0.95rem; font-weight: 600; }

input[type="text"], input[type="email"], input[type="url"], input[type="search"],
input[type="password"], input[type="number"], textarea, select {
	width: 100%;
	padding: 0.6rem 0.75rem;
	background: var(--surface);
	color: var(--text);
	font: 1rem/1.4 var(--sans);
	border: 1px solid var(--field);
	border-radius: var(--radius);
}
textarea { min-height: 8rem; resize: vertical; }

.button, button[type="submit"], input[type="submit"] {
	display: inline-block;
	padding: 0.7rem 1.25rem;
	background: var(--button);
	color: #fff;
	font: 600 1rem/1.2 var(--sans);
	text-decoration: none;
	border: 0;
	border-radius: var(--radius);
	cursor: pointer;
}
.button:hover, button[type="submit"]:hover, input[type="submit"]:hover { background: var(--steel); color: #fff; }

.search-form { display: flex; gap: 0.5rem; }
.search-form input[type="search"] { flex: 1; min-width: 0; }

/* Comments ------------------------------------------------------------------ */
.comments { margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }
.comments__title, .comment-reply-title { margin-bottom: 1.25rem; font-size: var(--step-2); }
.comment-reply-title small { margin-left: 0.75rem; font-size: var(--step--1); font-weight: 400; }

.comment-list, .comment-list .children { margin: 0; padding: 0; list-style: none; }
.comment-list .children {
	margin-left: clamp(0.75rem, 3vw, 2rem);
	padding-left: clamp(0.75rem, 3vw, 1.5rem);
	border-left: 2px solid var(--line);
}
.comment-body { padding-block: 1.25rem; border-bottom: 1px solid var(--line); }
.comment-author { font-family: var(--sans); font-size: 1rem; font-weight: 600; }
.comment-author .says { display: none; }
.comment-metadata { font-family: var(--sans); font-size: var(--step--1); }
.comment-metadata a { color: var(--muted); }
.comment-content { margin-top: 0.5rem; overflow-wrap: break-word; }
.comment-content p { margin: 0.5em 0; }
.reply { font-family: var(--sans); font-size: var(--step--1); }
.comment-awaiting-moderation { display: block; margin-top: 0.4rem; color: var(--signal); font-family: var(--sans); font-size: var(--step--1); }
.bypostauthor > .comment-body .fn::after {
	content: "Author";
	margin-left: 0.5rem;
	color: var(--muted);
	font-size: 0.8rem;
	font-weight: 400;
}

.comment-respond { margin-top: 2.5rem; }
.comment-form > p { margin: 0 0 1.1rem; }
.comment-notes { color: var(--muted); font-size: 1rem; }
.comment-form-cookies-consent { display: flex; gap: 0.5rem; align-items: flex-start; }
.comment-form-cookies-consent label { display: inline; font-weight: 400; }
.required { color: var(--signal); }
.lp-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* Pagination ---------------------------------------------------------------- */
.pagination .nav-links, .comments-pagination .nav-links, .page-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 2rem;
	font-family: var(--sans);
	font-size: 1rem;
}
.page-numbers {
	padding: 0.35rem 0.75rem;
	text-decoration: none;
	border: 1px solid var(--line);
	border-radius: var(--radius);
}
.page-numbers.current { background: var(--button); color: #fff; border-color: var(--button); }
.page-numbers.dots { border-color: transparent; }

/* Empty / 404 --------------------------------------------------------------- */
.empty, .not-found { max-width: 42rem; }
.not-found .search-form { margin: 1.5rem 0; }

/* Footer -------------------------------------------------------------------- */
.site-footer {
	--focus: var(--trace);
	background: var(--ink);
	color: #a9b8cc;
	font-family: var(--sans);
	font-size: 0.95rem;
}
.site-footer a { color: #dfe6ef; }
.site-footer a:hover { color: #fff; }
.site-footer__inner { display: grid; gap: 1.5rem; padding-block: 2.5rem; }
@media (min-width: 48rem) {
	.site-footer__inner { grid-template-columns: auto 1fr; align-items: center; }
}
.site-footer__brand { display: flex; align-items: center; gap: 0.75rem; color: #fff; font-weight: 600; text-decoration: none; }
.site-footer__brand .brand__logo { width: 40px; height: 40px; }
.footer-menu { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0; padding: 0; list-style: none; }
@media (min-width: 48rem) {
	.footer-menu { justify-content: flex-end; }
}
.site-footer__legal {
	grid-column: 1 / -1;
	margin: 0;
	padding-top: 1.5rem;
	font-size: var(--step--1);
	border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.site-footer__privacy { margin-left: 0.75rem; }

/* WordPress core bits ------------------------------------------------------- */
.wp-caption { max-width: 100%; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: 0.75rem; }
.gallery-item { margin: 0; }

@media print {
	.masthead, .site-footer, .layout__side, .comment-respond, .post-navigation { display: none; }
	body { background: #fff; color: #000; }
	a { color: #000; }
}
