/* perennial — footer
   The grounded plane: one tone-step down from the page (paper-100), no rules
   anywhere, the brand name ghosted large behind it. Site-wide.

   Left: the newsletter — an underline field with a chevron that appears once
   the address looks complete — and a row of social glyphs. Right: four link
   columns (關於 · 幫助 · 合作 · 內容) from pn_footer_columns(). A base line
   under it carries the copyright and the language toggle (hidden in v1).

   Lines and dots still have to mean something: the one hover signal here is the
   line under the newsletter field you write on. There is no rule above the footer and
   none between its columns — the tone shift is what sets it apart. */

.pn-footer {
	position: relative;
	overflow: hidden;
	background: var(--paper-100);
	color: var(--text-secondary);
	font-size: var(--text-small);
	line-height: var(--lh-small);
}

/* The brand name, large and faint, clipped by the footer's own edge. Live text,
   not the wordmark PNG, which goes soft at this size. Decoration in the strict
   sense — so aria-hidden, inert, and gone below the width where it would crowd
   the columns rather than sit behind them. */
.pn-footer__ghost {
	position: absolute;
	left: var(--pn-gutter);
	bottom: -0.16em;
	z-index: 0;
	margin: 0;
	max-width: none;
	font-family: var(--font-serif);
	font-size: clamp(120px, 22vw, 300px);
	font-weight: var(--weight-regular);
	line-height: 1;
	letter-spacing: 0.02em;
	color: var(--green-950);
	opacity: 0.05;
	white-space: nowrap;
	pointer-events: none;
	user-select: none;
}

.pn-footer__inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: var(--space-8);
	padding-block: var(--space-9) var(--space-7);
}

/* ── Top: newsletter + social beside the four columns ───────────────────── */
.pn-footer__top {
	display: grid;
	gap: var(--space-8);
}

@media (min-width: 1024px) {
	.pn-footer__top {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		gap: var(--space-9);
		align-items: start;
	}
}

.pn-footer__lead { max-width: 34rem; }

.pn .pn-footer__heading {
	max-width: 24ch;
	color: var(--text-primary);
	font-family: var(--font-serif);
	font-size: var(--pn-text-lead);
	line-height: var(--lh-lead);
	font-weight: var(--weight-regular);
	letter-spacing: var(--ls-lead);
}

.pn-footer__subscribe {
	margin-top: var(--space-5);
	max-width: 22rem;
}

.pn-footer__hp {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

.pn-footer__field {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: var(--space-3);
}

/* One rule under the field, nothing around it — in ink, so it reads as a line
   you write on rather than a disabled box. */
.pn .pn-footer__input {
	width: 100%;
	min-height: 44px;
	padding: var(--space-2) 0;
	background: none;
	color: var(--text-primary);
	border: 0;
	border-bottom: var(--line-weight) solid var(--line-strong);
	border-radius: 0;
	font-family: var(--font-sans);
	font-size: var(--text-body);
	line-height: 1.4;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}
.pn .pn-footer__input::placeholder { color: var(--text-tertiary); opacity: 1; }
.pn .pn-footer__input[aria-invalid="true"] { border-bottom-color: var(--error); }

.pn .pn-footer__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin-right: calc(var(--space-3) * -1);
	color: var(--text-primary);
	background: none;
	border: 0;
}
.pn-footer__submit .pn-icon { width: 20px; height: 20px; color: currentColor; }

/* The chevron is only there once the address looks complete: the field stays
   calm until there is something to send, and a stray Return has nothing to
   submit. Without JavaScript it is simply always visible. */
.pn-js .pn-footer__submit {
	opacity: 0;
	visibility: hidden;
	transform: translateX(-6px);
	transition:
		opacity var(--dur-base) var(--ease-out),
		transform var(--dur-base) var(--ease-out),
		visibility 0s linear var(--dur-base);
}
.pn-js .pn-footer__subscribe.is-valid .pn-footer__submit {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition-delay: 0s;
}

.pn .pn-footer__message {
	margin-top: var(--space-3);
	min-height: calc(var(--text-small) * var(--lh-small));
	color: var(--text-secondary);
	font-size: var(--text-small);
}
.pn .pn-footer__message.is-error { color: var(--error); }

/* Social: glyphs, quiet until hover. A dim non-link until the handle is set
   through the perennial_footer_social filter. */
.pn-footer__social {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-2);
	margin-top: var(--space-6);
}
.pn .pn-footer__social a,
.pn .pn-footer__social span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	color: var(--text-tertiary);
}
.pn .pn-footer__social a {
	color: var(--text-secondary);
	transition: color var(--dur-fast) var(--ease-out);
}
.pn .pn-footer__social a:hover,
.pn .pn-footer__social a:focus-visible { color: var(--text-primary); }
.pn-footer__social .pn-icon { width: 20px; height: 20px; color: currentColor; }

/* ── Columns ───────────────────────────────────────────────────────────── */
.pn-footer__cols {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--space-6) var(--space-5);
}

@media (min-width: 768px) {
	.pn-footer__cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.pn .pn-footer__col-title {
	color: var(--text-primary);
	font-family: var(--font-sans);
	font-size: var(--text-small);
	line-height: var(--lh-small);
	font-weight: var(--weight-medium);
	letter-spacing: 0;
}

.pn .pn-footer__col-links { margin-top: var(--space-3); }
.pn .pn-footer__col-links li + li { margin-top: var(--space-2); }

/* A live link reads in ink and fades on hover — the same signal the header nav
   and utilities use. The quiet body colour is kept for the not-yet entries. */
.pn .pn-footer__col-links a {
	color: var(--text-primary);
	transition: opacity var(--dur-fast) var(--ease-out);
}
.pn .pn-footer__col-links a:hover { opacity: var(--hover-opacity); }

/* A destination with no page yet: shown so the map reads whole, not a link. */
.pn-footer__soon { color: var(--text-secondary); }

/* ── Base line ─────────────────────────────────────────────────────────── */
.pn-footer__base {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-3) var(--space-5);
	color: var(--text-secondary);
	font-size: var(--text-caption);
	line-height: var(--lh-caption);
}
.pn-footer__legal {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3) var(--space-4);
}
.pn .pn-footer__legal a {
	color: inherit;
	transition: color var(--dur-fast) var(--ease-out);
}
.pn .pn-footer__legal a:hover,
.pn .pn-footer__legal a:focus-visible { color: var(--text-primary); }

.pn .pn-footer__lang {
	min-height: 44px;
	margin-left: auto;
	padding: 0;
	color: inherit;
	background: none;
	border: 0;
	font-size: inherit;
}

@media (min-width: 1024px) {
	.pn-footer__ghost { font-size: clamp(220px, 19vw, 340px); }
}

@media (max-width: 767px) {
	.pn-footer__ghost { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.pn-js .pn-footer__submit { transform: none; }
}
