/* SRP Bio Carousel — News and Links card types (v1.2).
   Loaded only on pages that show a News or Links card. Every selector sits under .srpbc, and the
   colours come from the card itself (currentColor) plus the carousel's accent glow, so both types
   follow the same colour settings as every other card. */

/* ---------- Shared ---------- */

.srpbc .srpbc-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.srpbc .srpbc-ty-news .srpbc-card__content,
.srpbc .srpbc-ty-links .srpbc-card__content {
	text-align: start;
}

/* News reads from the top; Links follow the card's vertical setting. */
.srpbc .srpbc-ty-news .srpbc-card__content { margin-block: 0; }

.srpbc .srpbc-card__body .srpbc-empty-note {
	margin: 0;
	text-align: center;
	font-style: italic;
	opacity: 0.7;
}

/* ======================================================================
   NEWS
   ====================================================================== */

/* ---------- Sort control (sits between the title and the scrolling list) ---------- */

.srpbc .srpbc-news__bar {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
	margin: 0;
}

.srpbc .srpbc-news__sortlabel {
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.6;
}

.srpbc .srpbc-news__sort {
	display: inline-flex;
	padding: 3px;
	border: 1px solid rgba(128, 128, 128, 0.35);
	border-radius: 999px;
	background: rgba(128, 128, 128, 0.08);
}

.srpbc .srpbc-news__sortbtn,
.srpbc .srpbc-news__sortbtn:hover,
.srpbc .srpbc-news__sortbtn:focus,
.srpbc .srpbc-news__sortbtn:active {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	padding: 0.3em 0.95em;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: inherit;
	box-shadow: none;
	font: inherit;
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1.3;
	text-transform: none;
	cursor: pointer;
	opacity: 0.68;
	transition: background-color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.srpbc .srpbc-news__sortbtn:hover { opacity: 1; }

.srpbc .srpbc-news__sortbtn.is-on,
.srpbc .srpbc-news__sortbtn.is-on:hover,
.srpbc .srpbc-news__sortbtn.is-on:focus {
	background: rgba(var(--srpbc-glow-rgb), 0.24);
	box-shadow: inset 0 0 0 1px rgba(var(--srpbc-glow-rgb), 0.6);
	opacity: 1;
}

.srpbc .srpbc-news__sortbtn:focus-visible {
	outline: 2px solid var(--srpbc-accent);
	outline-offset: 2px;
}

/* ---------- The list ---------- */

.srpbc .srpbc-card__body .srpbc-news__list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
	padding: 3px 4px 4px;
	list-style: none;
}

.srpbc .srpbc-news__item {
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: 1px solid rgba(128, 128, 128, 0.3);
	border-radius: 14px;
	background: rgba(128, 128, 128, 0.09);
	transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.srpbc .srpbc-news__item.is-open {
	border-color: rgba(var(--srpbc-glow-rgb), 0.65);
	background: rgba(var(--srpbc-glow-rgb), 0.08);
	box-shadow: inset 3px 0 0 rgb(var(--srpbc-glow-rgb)), 0 8px 20px -14px rgba(0, 0, 0, 0.5);
}

@media (hover: hover) {
	.srpbc .srpbc-news__list.is-js .srpbc-news__item:not(.is-open):hover {
		border-color: rgba(var(--srpbc-glow-rgb), 0.5);
		background: rgba(var(--srpbc-glow-rgb), 0.06);
	}
}

/* Theme-proof resets: the headline wrapper is an <h4>, the tab itself a <button>. */
.srpbc .srpbc-card__body .srpbc-news__h {
	margin: 0;
	padding: 0;
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	letter-spacing: normal;
	text-transform: none;
}

.srpbc .srpbc-news__toggle,
.srpbc .srpbc-news__toggle:hover,
.srpbc .srpbc-news__toggle:focus,
.srpbc .srpbc-news__toggle:active {
	-webkit-appearance: none;
	appearance: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	width: 100%;
	margin: 0;
	padding: 0.85em 0.95em 0.85em 1.05em;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: inherit;
	box-shadow: none;
	font: inherit;
	letter-spacing: normal;
	text-align: start;
	text-decoration: none;
	text-transform: none;
	cursor: pointer;
}

.srpbc .srpbc-news__toggle:focus-visible {
	outline: 3px solid var(--srpbc-accent);
	outline-offset: -3px;
}

.srpbc .srpbc-news__text {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.srpbc .srpbc-news__headline {
	font-size: 1.02rem;
	font-weight: 650;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

.srpbc .srpbc-news__date {
	font-size: 0.76rem;
	font-weight: 500;
	letter-spacing: 0.03em;
	opacity: 0.62;
}

.srpbc .srpbc-news__chev {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: rgba(var(--srpbc-glow-rgb), 0.16);
	color: inherit;
	transition: transform 0.35s cubic-bezier(0.22, 0.8, 0.24, 1), background-color 0.25s ease;
}

.srpbc .srpbc-news__chev svg { display: block; }

.srpbc .srpbc-news__item.is-open .srpbc-news__chev {
	background: rgba(var(--srpbc-glow-rgb), 0.38);
	transform: rotate(180deg);
}

/* ---------- Expanding panel (animates height without measuring it) ---------- */

.srpbc .srpbc-news__panel {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.36s cubic-bezier(0.22, 0.8, 0.24, 1);
}

.srpbc .srpbc-news__item.is-open .srpbc-news__panel { grid-template-rows: 1fr; }

/* Closed panels are also removed from tab order / screen readers once the fold has finished. */
.srpbc .srpbc-news__panel-in {
	min-height: 0;
	overflow: hidden;
	visibility: hidden;
	transition: visibility 0s linear 0.36s;
}

.srpbc .srpbc-news__item.is-open .srpbc-news__panel-in {
	visibility: visible;
	transition-delay: 0s;
}

.srpbc .srpbc-news__details {
	margin: 0 1.05em;
	padding: 0.9em 0 1.05em;
	border-top: 1px solid rgba(128, 128, 128, 0.28);
	font-size: 0.97rem;
	line-height: 1.7;
	text-align: start;
	overflow-wrap: break-word;
}

.srpbc .srpbc-news__details > :first-child { margin-top: 0; }
.srpbc .srpbc-news__details > :last-child { margin-bottom: 0; }

/* Without the script nothing can be opened, so show everything in full. */
.srpbc .srpbc-news__list:not(.is-js) .srpbc-news__panel { grid-template-rows: 1fr; }
.srpbc .srpbc-news__list:not(.is-js) .srpbc-news__panel-in { visibility: visible; }
.srpbc .srpbc-news__list:not(.is-js) .srpbc-news__toggle { cursor: default; }
.srpbc .srpbc-news__list:not(.is-js) .srpbc-news__chev { display: none; }

/* A soft fade when the order is flipped. */
.srpbc .srpbc-news__list.is-swap .srpbc-news__item { animation: srpbc-swap 0.38s cubic-bezier(0.22, 0.8, 0.24, 1) both; }
.srpbc .srpbc-news__list.is-swap .srpbc-news__item:nth-child(2) { animation-delay: 0.04s; }
.srpbc .srpbc-news__list.is-swap .srpbc-news__item:nth-child(3) { animation-delay: 0.08s; }
.srpbc .srpbc-news__list.is-swap .srpbc-news__item:nth-child(4) { animation-delay: 0.12s; }
.srpbc .srpbc-news__list.is-swap .srpbc-news__item:nth-child(n+5) { animation-delay: 0.16s; }

@keyframes srpbc-swap {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

/* ======================================================================
   LINKS
   ====================================================================== */

.srpbc .srpbc-card__body .srpbc-links {
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: 100%;
	max-width: 520px;
	margin: 0 auto;
	padding: 4px;
	list-style: none;
}

.srpbc .srpbc-links__item {
	margin: 0;
	padding: 0;
}

.srpbc .srpbc-card__body a.srpbc-link,
.srpbc .srpbc-card__body a.srpbc-link:visited {
	display: flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	margin: 0;
	padding: 0.7em 0.95em 0.7em 0.7em;
	border: 1px solid rgba(128, 128, 128, 0.32);
	border-radius: 16px;
	background: rgba(128, 128, 128, 0.09);
	color: inherit;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: 0.01em;
	text-align: start;
	text-decoration: none;
	transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background-color 0.22s ease;
}

.srpbc .srpbc-card__body a.srpbc-link:focus-visible {
	border-color: rgba(var(--srpbc-glow-rgb), 0.75);
	background: rgba(var(--srpbc-glow-rgb), 0.1);
	box-shadow: 0 0 0 3px rgba(var(--srpbc-glow-rgb), 0.22);
	outline: 3px solid var(--srpbc-accent);
	outline-offset: 2px;
	text-decoration: none;
}

@media (hover: hover) {
	.srpbc .srpbc-card__body a.srpbc-link:hover {
		transform: translateY(-2px);
		border-color: rgba(var(--srpbc-glow-rgb), 0.75);
		background: rgba(var(--srpbc-glow-rgb), 0.1);
		box-shadow: 0 12px 24px -12px rgba(0, 0, 0, 0.45), 0 0 0 3px rgba(var(--srpbc-glow-rgb), 0.18);
		text-decoration: none;
	}

	.srpbc .srpbc-link:hover .srpbc-link__ico { transform: scale(1.07) rotate(-4deg); }
	.srpbc .srpbc-link:hover .srpbc-link__go { opacity: 1; transform: translateX(3px); }
}

.srpbc .srpbc-card__body a.srpbc-link:active {
	transform: translateY(0) scale(0.99);
	box-shadow: 0 2px 6px -3px rgba(0, 0, 0, 0.4);
}

/* Icon chip: platform colour with a white glyph. */
.srpbc .srpbc-link__ico {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: var(--srpbc-ic, #64748b);
	color: #ffffff;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 5px 12px -5px rgba(0, 0, 0, 0.5);
	transition: transform 0.25s cubic-bezier(0.22, 0.8, 0.24, 1);
}

.srpbc .srpbc-link__svg {
	display: block;
	width: 20px;
	height: 20px;
}

/* "One quiet color": every chip uses the carousel's accent glow instead of the brand colours. */
.srpbc .srpbc-links--mono .srpbc-link__ico {
	background: rgba(var(--srpbc-glow-rgb), 0.16);
	color: rgb(var(--srpbc-glow-rgb));
	box-shadow: inset 0 0 0 1px rgba(var(--srpbc-glow-rgb), 0.45);
}

/* The person's own icon image. */
.srpbc .srpbc-link__ico--img {
	padding: 6px;
	background: rgba(255, 255, 255, 0.94);
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08), 0 5px 12px -5px rgba(0, 0, 0, 0.45);
}

.srpbc .srpbc-card__body .srpbc-link__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	border-radius: 6px;
	object-fit: contain;
}

.srpbc .srpbc-link__label {
	flex: 1 1 auto;
	min-width: 0;
	overflow-wrap: anywhere;
}

.srpbc .srpbc-link > .srpbc-link__label:first-child { padding-inline-start: 0.5em; }

.srpbc .srpbc-link__go {
	display: inline-flex;
	flex: none;
	opacity: 0.5;
	transition: transform 0.22s ease, opacity 0.22s ease;
}

.srpbc .srpbc-link__go svg { display: block; }

[dir="rtl"] .srpbc .srpbc-link__go svg { transform: scaleX(-1); }

/* ---------- Narrow screens ---------- */

@media (max-width: 640px) {
	.srpbc .srpbc-news__toggle { padding: 0.8em 0.8em 0.8em 0.9em; }
	.srpbc .srpbc-news__headline { font-size: 1rem; }
	.srpbc .srpbc-news__details { margin-inline: 0.9em; }
	.srpbc .srpbc-news__sortlabel { display: none; }

	.srpbc .srpbc-card__body .srpbc-links { gap: 10px; padding: 3px; }
	.srpbc .srpbc-card__body a.srpbc-link,
	.srpbc .srpbc-card__body a.srpbc-link:visited { gap: 12px; padding: 0.6em 0.8em 0.6em 0.6em; }
	.srpbc .srpbc-link__ico { width: 38px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
	.srpbc .srpbc-news__item,
	.srpbc .srpbc-news__chev,
	.srpbc .srpbc-news__panel,
	.srpbc .srpbc-news__panel-in,
	.srpbc .srpbc-news__sortbtn,
	.srpbc .srpbc-card__body a.srpbc-link,
	.srpbc .srpbc-link__ico,
	.srpbc .srpbc-link__go {
		transition: none;
	}

	.srpbc .srpbc-news__list.is-swap .srpbc-news__item { animation: none; }

	.srpbc .srpbc-card__body a.srpbc-link:hover,
	.srpbc .srpbc-card__body a.srpbc-link:active,
	.srpbc .srpbc-link:hover .srpbc-link__ico,
	.srpbc .srpbc-link:hover .srpbc-link__go {
		transform: none;
	}
}


/* ---------- YouTube card (v1.4) ----------
   The card keeps its normal size. The player is fitted INSIDE the space left under the title (and above the
   optional description), at the video's own shape: as wide as the space allows, never taller than it, so it is
   never clipped and never leaves a strip of empty card. --srpbc-yt-r is width / height of the video. */

.srpbc .srpbc-ty-youtube .srpbc-card__inner,
.srpbc .srpbc-ty-youtube.srpbc-l-stack.has-video .srpbc-card__inner {
	overflow: hidden; /* the description scrolls by itself; the card never does */
}

.srpbc .srpbc-yt__stage {
	display: flex;
	flex: 1 1 0;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 96px;
	container-type: size;
}

.srpbc .srpbc-yt__stage .srpbc-yt__player {
	flex: none;
	width: min(100cqw, calc(100cqh * var(--srpbc-yt-r, 1.7778)));
	max-width: 100%;
	margin: 0;
}

/* Description: takes only the room it needs, never more than ~40% of the card, then scrolls. */
.srpbc .srpbc-ty-youtube.srpbc-l-stack.has-video .srpbc-card__body {
	flex: 0 1 auto;
	max-height: 40%;
	overflow-x: hidden;
	overflow-y: auto;
}

.srpbc .srpbc-ty-youtube .srpbc-card__content { margin-block: 0; }
