/* FondsKonzept Brevo Newsletters: tabs layout of [brevo_newsletters].
   Change the colours by overriding the custom properties on .fkbn-tabs in the theme. */

.fkbn-tabs {
	--fkbn-accent: #0b4f8a;
	--fkbn-accent-soft: color-mix(in srgb, var(--fkbn-accent) 9%, transparent);
	--fkbn-text: #16202b;
	--fkbn-muted: #5d6b7a;
	--fkbn-line: #e3e8ee;
	--fkbn-track: #f2f5f8;
	--fkbn-surface: #fff;
	--fkbn-radius: 14px;

	container-type: inline-size;
	color: var(--fkbn-text);
	margin: 2rem 0;
	font-size: 1rem;
}

.fkbn-tabs *,
.fkbn-tabs *::before,
.fkbn-tabs *::after {
	box-sizing: border-box;
}

/* Tab bar */

.fkbn-tabs__list {
	display: none;
}

.fkbn-tabs--js .fkbn-tabs__list {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 6px;
	padding: 6px;
	margin-bottom: 1.25rem;
	background: var(--fkbn-track);
	border-radius: calc(var(--fkbn-radius) + 4px);
}

.fkbn-tabs__tab {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 2px;
	min-height: 64px;
	margin: 0;
	padding: 12px 16px 14px;
	font: inherit;
	text-align: left;
	color: var(--fkbn-muted);
	background: transparent;
	border: 0;
	border-radius: var(--fkbn-radius);
	box-shadow: none;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.fkbn-tabs__tab:hover {
	color: var(--fkbn-text);
	background: rgba(255, 255, 255, .6);
}

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

.fkbn-tabs__tab[aria-selected="true"] {
	color: var(--fkbn-text);
	background: var(--fkbn-surface);
	box-shadow: 0 1px 2px rgba(16, 32, 48, .06), 0 6px 16px rgba(16, 32, 48, .08);
}

.fkbn-tabs__tab[aria-selected="true"]::after {
	content: "";
	position: absolute;
	left: 16px;
	right: 16px;
	bottom: 0;
	height: 3px;
	border-radius: 3px 3px 0 0;
	background: var(--fkbn-accent);
}

.fkbn-tabs__kicker {
	font-size: .7rem;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	line-height: 1.2;
	color: var(--fkbn-muted);
}

.fkbn-tabs__tab[aria-selected="true"] .fkbn-tabs__kicker {
	color: var(--fkbn-accent);
}

.fkbn-tabs__title {
	font-size: .95rem;
	font-weight: 700;
	line-height: 1.25;
	overflow-wrap: anywhere;
}

/* Panels */

.fkbn-tabs__panel {
	padding: 4px 0 0;
	background: var(--fkbn-surface);
	border: 1px solid var(--fkbn-line);
	border-radius: var(--fkbn-radius);
	overflow: hidden;
}

.fkbn-tabs:not(.fkbn-tabs--js) .fkbn-tabs__panel + .fkbn-tabs__panel {
	margin-top: 1.5rem;
}

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

.fkbn-tabs__fallback-title {
	margin: 0;
	padding: 16px 20px 4px;
	font-size: 1.05rem;
}

.fkbn-tabs--js .fkbn-tabs__fallback-title {
	display: none;
}

.fkbn-empty {
	margin: 0;
	padding: 32px 20px;
	color: var(--fkbn-muted);
	text-align: center;
}

/* Table */

.fkbn-tabs .fkbn-table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	table-layout: auto;
	background: transparent;
}

.fkbn-tabs .fkbn-table th,
.fkbn-tabs .fkbn-table td {
	padding: 12px 20px;
	font-size: .95rem;
	border: 0;
	border-bottom: 1px solid var(--fkbn-line);
	background: transparent;
	text-align: left;
	vertical-align: middle;
}

.fkbn-tabs .fkbn-table th {
	padding-top: 12px;
	padding-bottom: 12px;
	font-size: .72rem;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--fkbn-muted);
}

.fkbn-tabs .fkbn-table tbody tr {
	transition: background-color .15s ease;
}

.fkbn-tabs .fkbn-table tbody tr:hover {
	background: var(--fkbn-accent-soft);
}

.fkbn-tabs .fkbn-table tbody tr:last-child td {
	border-bottom: 0;
}

.fkbn-tabs .fkbn-table td.fkbn-table__date {
	font-size: .9rem;
}

.fkbn-tabs .fkbn-table .fkbn-table__date {
	width: 8.5em;
	white-space: nowrap;
	color: var(--fkbn-muted);
	font-variant-numeric: tabular-nums;
}

.fkbn-tabs .fkbn-table td.fkbn-table__title {
	font-weight: 600;
	line-height: 1.4;
}

.fkbn-tabs .fkbn-table .fkbn-table__open {
	width: 1%;
	white-space: nowrap;
	text-align: right;
}

.fkbn-tabs .fkbn-table tr[hidden] {
	display: none;
}

.fkbn-open {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	font-size: .875rem;
	font-weight: 600;
	line-height: 1.2;
	color: var(--fkbn-accent);
	text-decoration: none;
	background: transparent;
	border: 1.5px solid currentColor;
	border-radius: 999px;
	transition: background-color .15s ease, color .15s ease;
}

.fkbn-open:hover,
.fkbn-open:focus-visible {
	color: #fff;
	background: var(--fkbn-accent);
	border-color: var(--fkbn-accent);
	text-decoration: none;
}

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

/* Pagination */

.fkbn-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 20px;
	border-top: 1px solid var(--fkbn-line);
	background: var(--fkbn-track);
}

.fkbn-pagination[hidden] {
	display: none;
}

.fkbn-pagination__info {
	font-size: .85rem;
	color: var(--fkbn-muted);
}

.fkbn-pagination__pages {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
}

.fkbn-pagination button {
	min-width: 36px;
	height: 36px;
	margin: 0;
	padding: 0 10px;
	font: inherit;
	font-size: .875rem;
	font-weight: 600;
	color: var(--fkbn-text);
	background: var(--fkbn-surface);
	border: 1px solid var(--fkbn-line);
	border-radius: 10px;
	box-shadow: none;
	cursor: pointer;
	transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}

.fkbn-pagination button:hover:not(:disabled) {
	color: var(--fkbn-accent);
	border-color: var(--fkbn-accent);
}

.fkbn-pagination button:focus-visible {
	outline: 2px solid var(--fkbn-accent);
	outline-offset: 2px;
}

.fkbn-pagination button[aria-current="page"] {
	color: #fff;
	background: var(--fkbn-accent);
	border-color: var(--fkbn-accent);
}

.fkbn-pagination button:disabled {
	opacity: .4;
	cursor: default;
}

.fkbn-pagination__gap {
	padding: 0 4px;
	color: var(--fkbn-muted);
}

/* Sizes follow the width of the listing itself (container queries), so the layout also fits
   narrow content columns. Medium: tabs in a 2 × 2 grid. */

@container (max-width: 820px) {
	.fkbn-tabs--js .fkbn-tabs__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Narrow: each newsletter becomes a compact card */

@container (max-width: 560px) {
	.fkbn-tabs__tab {
		min-height: 58px;
		padding: 10px 12px 12px;
	}

	.fkbn-tabs__title {
		font-size: .88rem;
	}

	.fkbn-tabs .fkbn-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}

	.fkbn-tabs .fkbn-table,
	.fkbn-tabs .fkbn-table tbody {
		display: block;
	}

	.fkbn-tabs .fkbn-table tbody tr {
		display: grid;
		grid-template-columns: 1fr auto;
		grid-template-areas: "date open" "title open";
		align-items: center;
		column-gap: 12px;
		padding: 14px 16px;
		border-bottom: 1px solid var(--fkbn-line);
	}

	.fkbn-tabs .fkbn-table tbody tr:last-child {
		border-bottom: 0;
	}

	.fkbn-tabs .fkbn-table td {
		display: block;
		padding: 0;
		border: 0;
	}

	.fkbn-tabs .fkbn-table td.fkbn-table__date {
		grid-area: date;
		width: auto;
		font-size: .8rem;
	}

	.fkbn-tabs .fkbn-table td.fkbn-table__title {
		grid-area: title;
		margin-top: 2px;
	}

	.fkbn-tabs .fkbn-table td.fkbn-table__open {
		grid-area: open;
		width: auto;
	}

	.fkbn-pagination {
		justify-content: center;
		padding: 12px;
	}

	.fkbn-pagination__info {
		width: 100%;
		text-align: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fkbn-tabs * {
		transition: none !important;
	}
}
