/**
 * Social Rail — fixed-position vertical social media rail.
 *
 * A two-tone pill flush against the right edge of every page above 768px,
 * with rounded corners on the left only. Switches between a light theme
 * (Parish Gold pill / Parish Blue contents) and a dark theme (Parish Blue
 * pill / Parish Gold contents) based on the section behind it. The two
 * brand colours stay constant; only their roles swap.
 *
 * The JS theme switcher lives at /assets/js/social-rail.js.
 *
 * Token references (defined in /assets/css/tokens.css):
 *   --pb   Parish Blue
 *   --py   Parish Gold
 *   --ease standard transition curve
 *
 * @package cove-parish
 */

.social-rail {
	/* Pin to right edge, vertically centred. Position is fixed because
	   sticky won't work — there's no single scrolling ancestor that spans
	   the whole page on Cove Parish layouts. */
	position: fixed;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	z-index: 40;

	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	padding: 18px 12px;

	/* Rounded on the left only — flat against the page edge on the right.
	   This is the "tab pulled out from the page" silhouette. */
	border-radius: 16px 0 0 16px;

	/* Soft lift away from the page. Uses the Deep Blue–tinted shadow
	   convention from the brand token system (--sh-md is the same family). */
	box-shadow: -4px 6px 20px rgba(30, 58, 82, .14);

	/* Theme transition — pill colour and contents colour fade together
	   so the swap reads as a single, deliberate change. */
	transition: background-color .35s var(--ease),
				color .35s var(--ease);

	/* Default theme: LIGHT — gold pill, blue contents.
	   Applied when the rail is over cream or white sections. */
	background-color: var(--py);
	color: var(--pb);
}

/* DARK theme — blue pill, gold contents.
   Applied by JS when the rail is over Parish Blue or Deep Blue sections. */
.social-rail[data-theme="dark"] {
	background-color: var(--pb);
	color: var(--py);
}

/* ─── Vertical FOLLOW US label ─────────────────────────────────── */

.social-rail__label {
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	font-family: var(--fb);
	font-size: .66rem;
	font-weight: 700;
	letter-spacing: .28em;
	text-transform: uppercase;
	color: var(--db); /* #1E3A52 on gold pill: 5.89:1 — passes WCAG 1.4.3 */
}
.social-rail[data-theme="dark"] .social-rail__label {
	color: #fff; /* white on blue pill: 6.68:1 — passes WCAG 1.4.3 */
}

/* ─── Icon stack ───────────────────────────────────────────────── */

.social-rail__icons {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

/* Hairline tick above the icon stack — separates label from icons.
   Drawn as a ::before so it inherits `currentColor` and flips theme with
   everything else. */
.social-rail__icons::before {
	content: '';
	display: block;
	width: 1px;
	height: 14px;
	margin: -6px auto 6px;
	background: currentColor;
	opacity: .35;
}

.social-rail__link {
	width: 36px;
	height: 36px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	color: currentColor;
	transition: background-color .25s var(--ease),
				color .25s var(--ease),
				transform .25s var(--ease);
}

/* Hover/active — INVERT the pill's two colours inside the link.
   Light theme: gold pill, blue icon → hover gives a blue disc with a gold
   icon at the centre. Same pattern in reverse on dark theme. This keeps
   the rail strictly inside the Parish Blue / Parish Gold palette in every
   state. */
.social-rail__link:hover {
	background-color: var(--pb);   /* opposite of the light-theme pill */
	color: var(--py);
	transform: scale(1.06);
}

.social-rail[data-theme="dark"] .social-rail__link:hover {
	background-color: var(--py);   /* opposite of the dark-theme pill */
	color: var(--pb);
}

/* Focus indicator — inset 2px ring in currentColor. currentColor on the
   link is whichever brand colour is opposite the pill bg, so the ring is
   always visible. Inset keeps the ring inside the link bounds so it can't
   clip against the page edge on the right. */
.social-rail__link:focus-visible {
	outline: none;
	box-shadow: inset 0 0 0 2px currentColor;
}

.social-rail__link svg {
	width: 17px;
	height: 17px;
	fill: currentColor;
}

/* ─── Mobile: hide the rail ────────────────────────────────────── */

/* On tablet and below the rail crowds the content. Socials live in the
   footer on these breakpoints — see footer.php / footer.css. */
@media (max-width: 768px) {
	.social-rail {
		display: none;
	}
}

/* ─── Reduced motion ───────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.social-rail,
	.social-rail__link {
		transition: none;
	}
	.social-rail__link:hover {
		transform: none;
	}
}
