/* Site footer. Sticky is desktop-only, off by default, toggled by the
   customizer's "Sticky footer" control — see inc/sticky.php, which sets
   --nonotami-sticky-footer to `sticky` or `static`. Mirrors the sticky
   header: position: sticky; bottom: 0 on a direct <body> child pins it
   to the viewport bottom for as long as there's room, same mechanism,
   opposite edge — no JS needed either way. */

#site-footer {
	background: var( --nonotami-color-bg );
	/* Top/bottom from the customizer's "Footer top/bottom padding"
	   (inc/footer-widgets.php, default 1rem); left/right stays a fixed
	   5%, same as the header. */
	padding: var( --nonotami-footer-padding-y, 1rem ) 5%;
	box-sizing: border-box;
	/* Toggled by the customizer's "Footer top border" control —
	   see inc/layout-customizer.php. */
	border-top: var( --nonotami-footer-border, none );
	/* No fixed height anywhere here — the content (widgets + bottom line)
	   decides it; this padding plus the widgets/bottom-line margins below
	   are the only spacing. */
}

.nonotami-footer-widgets {
	display: grid;
	grid-template-columns: repeat( var( --nonotami-footer-columns, 1 ), 1fr );
	gap: 2rem;
}

@media ( max-width: 782px ) {
	.nonotami-footer-widgets {
		grid-template-columns: 1fr;
	}
}

.nonotami-footer-bottom {
	text-align: center;
	/* No top margin by default — when there are no footer widgets (the
	   common case), .render_columns() outputs nothing above this at all,
	   so a margin here was pure dead space on top of #site-footer's own
	   padding already, nothing to separate from. The margin only exists
	   when there actually is a widgets block above it, below. */
	margin: 0;
}

.nonotami-footer-widgets + .nonotami-footer-bottom {
	margin-top: 2rem;
}

@media ( min-width: 783px ) {
	#site-footer {
		position: var( --nonotami-sticky-footer, static );
		bottom: 0;
		z-index: 100;
	}
}
