/* ───────────────────────────────────────────────────────────────
   SOCIAL RAIL — four fixed buttons, centre left, every page

   Added 2026-11-06. Markup is printed at wp_footer by
   superfly_social_rail() in functions.php; there is no partial to
   paste anywhere and nothing to add per page.

   Namespace is `sfsr`. Do NOT reuse `sf-social` — that belongs to
   the home page's "Follow the ride" band (social-reveal.css) and
   the two would collide on the front page, which loads both.

   Colour comes from the theme, not a hex: the brand magenta is
   accent-1 (#ec1e79) and anything hardcoded here would stop
   following theme.json. See CLAUDE.md, "Brand colours".

   Z-INDEX, and why it is low. The rail sits at 90 — under the
   navbar (100), under the menu drawer (120/121) and far under the
   cart drawer (99990). That is deliberate: every one of those is
   a surface the visitor opened on purpose, and the rail must not
   float over it. It is also hidden outright while either drawer is
   open (see below), because on a phone the drawer covers the whole
   screen and a magenta stack punched through it reads as a bug.
   ─────────────────────────────────────────────────────────────── */

.sfsr {
	--sfsr-pink: var(--wp--preset--color--accent-1, #ec1e79);
	--sfsr-size: 46px;          /* the square button */
	--sfsr-gap: 2px;            /* hairline between buttons */
	--sfsr-radius: 0 12px 12px 0;

	position: fixed;
	left: 0;
	z-index: 90;

	/* CENTRED ON A TALL SCREEN, LIFTED ON A SHORT ONE.
	   Dead centre collides with the home hero on a laptop. The
	   headline is at a FIXED x (52px) at every size, so the sideways
	   gap is 6px whatever the screen — the sideways room is not what
	   changes. What changes is how far down the headline sits:
	   measured on the live page, "Ride." starts at y=504 in a 790
	   window and y=761 in a 1080 one, while the centred rail only
	   drops from 490 to 635. So the gap collapses from 126px to 14px
	   as the window gets shorter, and the rail lands on the type.

	   Break-even is a window about 900px tall. Below that this
	   subtracts up to 60px, 0.4px per px of missing height — which
	   restores ~58px of clearance at 790 and leaves every taller
	   screen exactly where it was. It is a ramp, not a breakpoint,
	   so there is no snap as the window is dragged.

	   Slightly above centre is the right look for the whole site,
	   not just the front page, so the lift is deliberately NOT
	   scoped to body.home: a rail that jumped position between
	   pages would be worse than one sitting 40px high on a laptop.

	   It IS scoped to desktop widths, though — see the phone block
	   at the bottom of this file for why. The base here is plain
	   centre, which is what a phone keeps. */
	top: 50%;
	transform: translateY(-50%);

	display: flex;
	flex-direction: column;
	gap: var(--sfsr-gap);

	margin: 0;
	padding: 0;
	list-style: none;

	/* The list is only a container; the buttons take the clicks. With
	   pointer-events on the <ul> its full width — which grows to the
	   widest open label — would eat clicks on the page behind it. */
	pointer-events: none;
}

/* The laptop lift, desktop only. A phone's hero is stacked quite
   differently and the rail already clears it at dead centre, so the
   phone keeps the plain 50% above — measured at 375x812, where this
   would otherwise have moved it 35px for no reason. */
@media (min-width: 783px) {
	.sfsr {
		top: calc(50% - clamp(0px, (900px - 100vh) * 0.4, 60px));
	}
}

.sfsr__item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sfsr__link {
	pointer-events: auto;

	display: flex;
	align-items: center;
	gap: 10px;

	width: var(--sfsr-size);
	height: var(--sfsr-size);
	padding: 0;
	overflow: hidden;

	background: var(--sfsr-pink);
	color: #fff;
	border-radius: var(--sfsr-radius);
	box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
	text-decoration: none;

	/* background-color and box-shadow are still listed on purpose,
	   though nothing animates them today - hover changes the width
	   alone. They are here so putting a colour back is one
	   declaration and not a jump. See the hover rule below. */
	transition: width .28s cubic-bezier(.22, 1, .36, 1),
	            background-color .2s ease,
	            box-shadow .2s ease;
}

/* The glyph keeps the square to itself whatever the link's width is,
   so the icon does not drift left as the label opens. */
.sfsr__glyph {
	flex: 0 0 var(--sfsr-size);
	width: var(--sfsr-size);
	height: var(--sfsr-size);
	display: grid;
	place-items: center;
}

.sfsr__glyph svg {
	width: 20px;
	height: 20px;
	display: block;
	fill: currentColor;
}

/* The name slides out of the square on hover. It is NOT
   display:none — a screen reader should still read it, and the
   link's accessible name is this text plus nothing else. */
.sfsr__name {
	flex: 0 0 auto;
	padding-right: 16px;
	white-space: nowrap;

	font-family: "Chakra Petch", "Archivo", system-ui, sans-serif;
	font-weight: 700;
	font-size: .78rem;
	letter-spacing: .08em;
	text-transform: uppercase;

	opacity: 0;
	transform: translateX(-6px);
	transition: opacity .2s ease, transform .28s cubic-bezier(.22, 1, .36, 1);
}

.sfsr__link:hover,
.sfsr__link:focus-visible {
	/* HOVER CHANGES THE WIDTH AND NOTHING ELSE. No colour change, no
	   glow - the pill stays exactly the accent-1 pink it is at rest,
	   and keeps the same quiet dark drop shadow as its neighbours.
	   The label sliding out of the square IS the hover feedback.

	   THAT IS THE ANSWER TO THREE ROUNDS OF "the icon and the label
	   look pink on hover" (operator, 2026-11-16), and it is worth
	   knowing why, because the obvious reading was wrong twice.

	   THE INK WAS NEVER PINK. It computes rgb(255,255,255) on all
	   four links, at opacity 1, with no fill attribute on any path,
	   in every state. What changed on hover was the GROUND under it:
	   the rule used to repaint the pill #ff2f8c, a step UP from
	   accent-1, which dropped white from 4.18:1 to 3.48:1 - the one
	   state on the rail under AA. At 12.48px/700 with .08em of
	   tracking, and a 20px glyph, strokes that thin antialias INTO a
	   saturated magenta and read as the TYPE going pink rather than
	   as the background going light. More so on the operator's
	   display, which runs at 142% scaling.

	   DARKENING IT IS NOT THE FIX, THOUGH IT MEASURES BETTER.
	   #c91765 (5.54:1) was still reported pink, and #8f1046 (9.01:1)
	   was read as a SHADOW over the pink rather than as a colour.
	   Both are in git. Holding the rest colour is what works: the
	   un-hovered buttons are this same pink and their white has never
	   been questioned, so a hover that does not touch the colour
	   cannot read worse than they do.

	   A z-index ON THE GLYPH AND LABEL WOULD BE A NO-OP, and was
	   asked for and ruled out rather than quietly added:
	   elementsFromPoint at the glyph centre returns the <svg> ITSELF
	   as the topmost element, social-rail.css is the only file in the
	   document carrying a .sfsr rule, it declares no pseudo-element
	   at all, and no ancestor up to <html> has a filter, a
	   mix-blend-mode, a backdrop-filter or an opacity under 1.
	   Nothing is over this type. A stale stylesheet was ruled out the
	   same way - every LiteSpeed CSS option (minify, combine, async,
	   UCSS, critical) is off and wp-content/litespeed/ holds no
	   generated CSS, so the filemtime ?ver= is the whole cache story.

	   SO THE DIAL HERE IS THE PILL, NEVER THE INK, and the ink cannot
	   go any whiter than it already is. If hover ever has to change
	   colour again, move the type with it - 14px, or a heavier glyph
	   - and check the CONTRAST, not the computed colour, which says
	   rgb(255,255,255) in the good state and the bad one alike. */
	width: var(--sfsr-open, 150px);
}

.sfsr__link:hover .sfsr__name,
.sfsr__link:focus-visible .sfsr__name {
	opacity: 1;
	transform: none;
}

.sfsr__link:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -4px;
}


/* ── Out of the way of the drawers ──────────────────────────────
   Both drawers lock the page and cover it. Watching the body
   classes the cart and menu already set means neither of those
   files had to learn about this one. Same classes smooth-scroll.js
   watches, for the same reason. */
body.sf-cart-open .sfsr,
body.sf-drawer-open .sfsr {
	opacity: 0;
	pointer-events: none;
	visibility: hidden;
	transition: opacity .15s ease;
}


/* ── Phones ─────────────────────────────────────────────────────
   Smaller, and the label never opens: there is no hover on a touch
   screen, so a first tap would only widen the button and a second
   would follow the link. Tapping goes straight through instead. */
@media (max-width: 782px) {
	.sfsr {
		--sfsr-size: 40px;
	}

	.sfsr__glyph svg {
		width: 18px;
		height: 18px;
	}

	.sfsr__link:hover,
	.sfsr__link:focus-visible {
		width: var(--sfsr-size);
	}

	.sfsr__name {
		/* Kept for assistive tech, never painted. */
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
}

/* Very short windows: a 4-high stack centred would collide with the
   navbar. Let it sit a little lower than centre rather than clip. */
@media (max-height: 420px) {
	.sfsr {
		top: auto;
		bottom: 12px;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sfsr__link,
	.sfsr__name {
		transition-duration: .01ms;
	}
}
