/*
 * Chiggle Academy — share bar.
 *
 * Companion to the OpenGraph + Twitter Card meta in inc/hooks-seo.php
 * (which handles link-preview unfurl when URLs are pasted into
 * WhatsApp / X / Facebook / Slack / LinkedIn). This adds the explicit
 * per-network buttons + a Web Share API trigger on supported browsers.
 *
 * Brand-consistent with the v0.11.52 sign-in modal aesthetic — navy +
 * gold palette, --radius-md corners, navy-at-low-alpha shadows. Two
 * tones:
 *   - light (default): on white/offwhite backgrounds (preview, certificate)
 *   - dark:            on navy backgrounds (homepage CTA section)
 *
 * Renderer: inc/hooks-share.php → chiggle_render_share_bar().
 */

/* ─────────────────────────────────────────────────────────────
 * Container + heading
 * ───────────────────────────────────────────────────────────── */
.ca-share-bar {
	margin: 36px auto 0;
	max-width: 640px;
	text-align: center;
}

.ca-share-heading {
	font-family: var(--font-body);
	font-size: 0.74rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--gray-500);
	margin: 0 0 16px;
}

.ca-share-buttons {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
}

/* ─────────────────────────────────────────────────────────────
 * Buttons — light tone (default)
 *
 * Navy ghost surface, gold-accent on hover, ~1px lift to read as
 * tactile. Same shape vocabulary as the social-login buttons in
 * the sign-in modal so the site feels consistent.
 * ───────────────────────────────────────────────────────────── */
.ca-share-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border: 1.5px solid var(--gray-200);
	border-radius: var(--radius-md);
	background: var(--white);
	color: var(--charcoal);
	font-family: var(--font-body);
	font-size: 0.88rem;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	text-decoration: none !important;
	white-space: nowrap;
	box-shadow: 0 1px 2px rgba(18, 43, 105, 0.05);
	transition:
		border-color 0.18s ease,
		color 0.18s ease,
		transform 0.14s ease,
		box-shadow 0.18s ease,
		background-color 0.18s ease;
	will-change: transform;
}
.ca-share-btn:hover {
	border-color: var(--navy);
	color: var(--navy);
	transform: translateY(-1px);
	box-shadow:
		0 6px 14px -4px rgba(18, 43, 105, 0.18),
		0 2px 4px -1px rgba(18, 43, 105, 0.08);
}
.ca-share-btn:active {
	transform: translateY(0);
	box-shadow: 0 1px 2px rgba(18, 43, 105, 0.06);
}
.ca-share-btn:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: 2px;
	border-color: var(--navy);
}
.ca-share-btn svg {
	flex-shrink: 0;
	color: currentColor;
}
.ca-share-btn-label {
	line-height: 1;
}

/* Native Web Share button — most prominent surface in the row.
 * Gold-pale background + gold border so it reads as the primary
 * action on supported devices. JS reveals it (hidden by default
 * via the `hidden` attribute set in the renderer). */
.ca-share-native {
	border-color: var(--gold);
	color: var(--navy);
	background: var(--gold-pale);
}
.ca-share-native:hover {
	border-color: var(--gold);
	color: var(--navy);
	background: var(--gold-light);
	box-shadow:
		0 6px 14px -4px rgba(255, 155, 3, 0.32),
		0 2px 4px -1px rgba(255, 155, 3, 0.16);
}

/* Copy-link confirmation state — brief green flash to confirm the
 * URL hit the clipboard. Uses the AA-passing green pair from
 * variables.css (--green-pale bg + --green-dark text). */
.ca-share-btn.ca-share-copied {
	border-color: var(--green);
	color: var(--green-dark);
	background: var(--green-pale);
}

/* ─────────────────────────────────────────────────────────────
 * Dark tone (use on navy-bg sections like the homepage CTA)
 *
 * Inverts surface + border to high-alpha-white-on-navy. Gold accent
 * still wins on hover so the brand colour is the primary "active"
 * signal regardless of tone.
 * ───────────────────────────────────────────────────────────── */
.ca-share-bar-dark {
	margin-top: 40px;
}
.ca-share-bar-dark .ca-share-heading {
	color: rgba(255, 255, 255, 0.55);
}
.ca-share-bar-dark .ca-share-btn {
	background: transparent;
	color: rgba(255, 255, 255, 0.9);
	border-color: rgba(255, 255, 255, 0.22);
	box-shadow: none;
}
.ca-share-bar-dark .ca-share-btn:hover {
	border-color: var(--gold);
	color: var(--gold);
	background: rgba(255, 155, 3, 0.10);
	box-shadow: 0 6px 14px -4px rgba(255, 155, 3, 0.22);
}
.ca-share-bar-dark .ca-share-btn:focus-visible {
	outline-color: var(--gold);
	border-color: var(--gold);
}
.ca-share-bar-dark .ca-share-native {
	background: var(--gold);
	color: var(--navy);
	border-color: var(--gold);
}
.ca-share-bar-dark .ca-share-native:hover {
	background: var(--gold-light);
	color: var(--navy);
	border-color: var(--gold-light);
}
.ca-share-bar-dark .ca-share-btn.ca-share-copied {
	background: rgba(46, 125, 50, 0.15);
	border-color: var(--green);
	color: #b8e3bb; /* lighter green for legibility on navy */
}

/* ─────────────────────────────────────────────────────────────
 * Mobile — tighten padding so 4-5 buttons wrap to two rows
 * cleanly rather than overflowing on a 360px viewport.
 * ───────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
	.ca-share-bar {
		margin-top: 28px;
	}
	.ca-share-btn {
		padding: 9px 12px;
		font-size: 0.82rem;
		gap: 6px;
	}
	.ca-share-buttons {
		gap: 8px;
	}
}
