/* In-page anchor scrolling.
 *
 * Three nav items are anchors into a page rather than links to one:
 *   Events    → Rehearsal Dinners & After Wedding Brunches  (events#rehearsal-dinners)
 *   For Guests → Parking Info                               (for-guests#getting-here-parking)
 *   For Guests → Preferred Rate Info                        (for-guests#booking-your-room)
 * plus the Gallery, Our Story and Ottawa sublinks that already carry fragments.
 *
 * Two things they need, both handled here rather than in JS:
 *
 * 1. A transition instead of a jump when the visitor is already on the page.
 *    scroll-behavior on the scrolling element covers every same-page fragment
 *    click site-wide, so a new anchor link needs no wiring. Arriving from
 *    another page is a page load, so that one lands rather than animates —
 *    browsers don't animate the initial fragment scroll.
 *
 * 2. A landing position that clears the sticky nav. Only the mobile nav is
 *    sticky (68px = 67px bar + its 1px root border, offset below the admin bar
 *    for logged-in users, matching nav-bar.css) — the desktop nav scrolls away,
 *    so it needs no offset. scroll-margin-top applies to the initial fragment
 *    navigation too, so cross-page arrivals land correctly as well.
 */

html {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

@media (max-width: 767px) {
	/* Every anchored block, not just the content-page sections — an anchor set
	   on any block in the editor should land the same way. Inert until
	   something scrolls to it. */
	.wp-site-blocks [id] {
		scroll-margin-top: calc(68px + var(--wp-admin--admin-bar--height, 0px));
	}
}
