/*
 * Tamfis Magazine design layer.
 * Palette and component treatment blended from the Newsflux look.
 * Colours come from tokens that switch with the light/dark mode (body.dark).
 * The header band stays dark sea blue in both modes.
 * Loaded last so it overrides the theme defaults.
 */

/* Light tokens (default) */
:root {
	--tamfis-primary: #ab052d;
	--tamfis-header: #0a2e75;
	--tamfis-cat-blue: #2457a7;
	--tamfis-cat-green: #24734a;
	--tamfis-cat-brown: #a65b16;
	--tamfis-card: #ffffff;
	--tamfis-text: #616c74;
	--tamfis-title: #121213;
	--tamfis-border: #dddcdc;
}

/* Dark tokens: follow the theme's light/dark switch */
body.dark {
	--tamfis-card: #1c1f24;
	--tamfis-text: #c9ced4;
	--tamfis-title: #ffffff;
	--tamfis-border: #3a3f46;
}

/* Text and links */
body {
	color: var(--tamfis-text);
}
.site-description,
h1, h2, h3, h4, h5, h6,
.entry-title,
.title a,
.bs-blog-post .title a {
	color: var(--tamfis-title);
}
a:hover,
.title a:hover,
.entry-title a:hover,
.bs-blog-post .title a:hover {
	color: var(--tamfis-primary);
}

/* Full-width sea-blue navigation band with white links and light-red hover */
.bs-menu-full,
.bs-menu-full.sticky-header {
	background-color: var(--tamfis-header) !important;
}
.bs-menu-full .navbar-wp,
.bs-menu-full .sm-clean a,
.bs-menu-full .sm-clean a:link,
.bs-menu-full .sm-clean a:visited {
	color: #ffffff !important;
	background: transparent !important;
}
.bs-menu-full .sm-clean a:hover,
.bs-menu-full .sm-clean a:focus,
.bs-menu-full .sm-clean .current-menu-item > a {
	color: #ff6b81 !important;
}
.bs-menu-full .menu-btn,
.bs-menu-full .navbar-toggler,
.bs-menu-full .search-icon,
.bs-menu-full .bs-search-icon {
	color: #ffffff;
}

/* Site title and header icons stay white on the blue band */
.bs-menu-full .site-title,
.bs-menu-full .site-title a,
.bs-menu-full .site-title a:link,
.bs-menu-full .site-title a:visited,
.bs-menu-full .site-description {
	color: #ffffff !important;
}
.bs-menu-full .site-title a:hover {
	color: #ff6b81 !important;
}
.bs-menu-full i,
.bs-menu-full .fa,
.bs-menu-full svg {
	color: #ffffff;
	fill: #ffffff;
}

/* Cards follow the mode */
.bs-blog-post,
.bs-blog-post.three,
.bs-blog-post.four {
	background-color: var(--tamfis-card);
	border: 1px solid var(--tamfis-border);
	border-radius: 4px;
}
.bs-blog-post .bs-blog-meta,
.bs-blog-meta,
.bs-blog-date,
.bs-author {
	color: var(--tamfis-text);
}

/* Section titles with a red accent bar */
.bs-widget-title,
.widget-title,
.bs-widget .title-wrap {
	border-left: 4px solid var(--tamfis-primary);
	padding-left: 10px;
	color: var(--tamfis-title);
}

/* Colour-coded category labels */
.bs-blog-category a,
.bs-blog-category .cat-links a,
a.newsup-categories {
	background: var(--tamfis-primary);
	color: #ffffff;
	border-radius: 2px;
	padding: 2px 8px;
	font-size: .72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	text-decoration: none;
}
.bs-blog-category a:nth-child(3n+2),
a.newsup-categories.category-color-2 { background: var(--tamfis-cat-blue); }
.bs-blog-category a:nth-child(3n+3),
a.newsup-categories.category-color-3 { background: var(--tamfis-cat-green); }
a.newsup-categories.category-color-4 { background: var(--tamfis-cat-brown); }

/* Latest-news ticker and time pill */
.mg-menu-full .info-left li span.time,
.bs-ticker .time {
	background: var(--tamfis-primary);
	color: #ffffff;
}

/* Footer */
footer,
.bs-footer-bottom-area {
	background-color: #121213;
	color: #d7d7d7;
}
footer a,
.bs-footer-bottom-area a {
	color: #ffffff;
}
footer a:hover,
.bs-footer-bottom-area a:hover {
	color: var(--tamfis-primary);
}

/* Borders and separators follow the mode */
.bs-widget,
.widget,
hr {
	border-color: var(--tamfis-border);
}

/* Dropdown panels on the blue band: same sea blue in both modes, white links */
.bs-menu-full ul ul,
.bs-menu-full .sm-clean ul,
.bs-menu-full .sub-menu {
	background-color: var(--tamfis-header) !important;
	border: 0;
	box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
}
.bs-menu-full ul ul a,
.bs-menu-full .sm-clean ul a,
.bs-menu-full .sub-menu a {
	color: #ffffff !important;
	background: transparent !important;
}
.bs-menu-full ul ul a:hover,
.bs-menu-full .sm-clean ul a:hover,
.bs-menu-full .sub-menu a:hover {
	color: #ff6b81 !important;
	background: rgba(255, 255, 255, .08) !important;
}

/* Magazine footer: sea-blue band, four columns, bottom bar */
footer.footer,
footer.footer .overlay {
	background-color: var(--tamfis-header) !important;
	background-image: none;
}
footer.footer { padding: 0; }
footer.footer .overlay { padding: 0; }

.fv-footer {
	color: rgba(255, 255, 255, .85);
	padding: 56px 24px 0;
	font-size: .95rem;
	line-height: 1.6;
}
.fv-footer-grid {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
	gap: 40px;
	max-width: 1200px;
	margin: 0 auto;
	padding-bottom: 40px;
}
.fv-footer-name {
	font-size: 1.6rem;
	font-weight: 800;
	color: #ffffff;
	margin: 0 0 10px;
}
.fv-footer-text {
	margin: 0 0 14px;
	color: rgba(255, 255, 255, .75);
}
.fv-footer-badge {
	display: inline-block;
	margin: 0;
	padding: 3px 10px;
	border-radius: 2px;
	background: var(--tamfis-primary);
	color: #ffffff;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}
.fv-footer-title {
	font-size: .9rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: #ffffff;
	margin: 0 0 16px;
	padding-left: 10px;
	border-left: 3px solid var(--tamfis-primary);
}
.fv-footer-links {
	list-style: none;
	margin: 0;
	padding: 0;
}
.fv-footer-links li {
	margin: 0 0 9px;
}
.fv-footer-links a {
	color: rgba(255, 255, 255, .85);
	text-decoration: none;
}
.fv-footer-links a:hover {
	color: #ff6b81;
	text-decoration: underline;
}
.fv-footer-button {
	display: inline-block;
	padding: 10px 22px;
	border-radius: 4px;
	background: var(--tamfis-primary);
	color: #ffffff !important;
	font-weight: 700;
	text-decoration: none;
}
.fv-footer-button:hover {
	background: #ff6b81;
	color: #0a2e75 !important;
}
.fv-footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, .18);
	max-width: 1200px;
	margin: 0 auto;
	padding: 18px 0 22px;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px 24px;
	font-size: .85rem;
	color: rgba(255, 255, 255, .7);
}
.fv-footer-bottom p { margin: 0; }
.fv-footer-credit a {
	color: #ffffff;
	font-weight: 700;
}
@media (max-width: 900px) {
	.fv-footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 560px) {
	.fv-footer-grid { grid-template-columns: 1fr; }
}

/* Category and archive pages: masonry of image cards in two columns (one column on phones) */
#grid.d-grid.column2,
#grid.d-grid {
	display: block;
	column-count: 2;
	column-gap: 28px;
}
#grid.d-grid > div {
	break-inside: avoid;
	-webkit-column-break-inside: avoid;
	display: inline-block;
	width: 100%;
	margin: 0 0 28px;
	vertical-align: top;
}
#grid.d-grid .bs-blog-post {
	background-color: var(--tamfis-card);
	border: 1px solid var(--tamfis-border);
	border-radius: 6px;
	overflow: hidden;
}
#grid.d-grid .bs-blog-post .bs-blog-thumb {
	position: relative;
}
#grid.d-grid .bs-blog-post .bs-thumb-bg {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	background-size: cover;
	background-position: center;
	background-color: #7f7f7f;
}
#grid.d-grid .bs-blog-post article,
#grid.d-grid .bs-blog-post .small {
	padding: 14px 16px 18px;
}
@media (max-width: 640px) {
	#grid.d-grid,
	#grid.d-grid.column2 {
		column-count: 1;
	}
}

/* Header spacing: the brand, the menu and the actions never touch, at every width */
.bs-menu-full .main.d-lg-flex {
	display: flex !important;
	align-items: center;
	justify-content: space-between;
	gap: clamp(20px, 3vw, 48px);
	width: 100%;
}
.bs-menu-full .main.d-lg-flex > [class*="col-width"] {
	width: auto !important;
	max-width: none !important;
	flex: 0 0 auto;
	padding: 0;
	margin: 0;
	text-align: left;
}
.bs-menu-full .main.d-lg-flex > .col-width-45 {
	flex: 1 1 auto;
	min-width: 0;
	text-align: center;
}
.bs-menu-full .site-title {
	margin: 0;
	line-height: 1.1;
}
.bs-menu-full .site-title a {
	font-weight: 800;
	letter-spacing: -0.01em;
	white-space: nowrap;
	font-size: clamp(1.35rem, 2.2vw, 2rem);
}
.bs-menu-full .site-title a::after {
	content: '';
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--tamfis-primary);
	margin-left: 8px;
	vertical-align: middle;
}
.bs-menu-full .navbar-wp .sm-clean a {
	padding-left: .32rem !important;
	padding-right: .32rem !important;
}
@media (max-width: 991px) {
	.bs-menu-full .mobile-main {
		padding-top: 14px;
		padding-bottom: 14px;
	}
	.bs-menu-full .mobile-main .site-title a {
		font-size: clamp(1.25rem, 6vw, 1.7rem);
	}
}
@media (min-width: 992px) {
	.bs-menu-full .main.d-lg-flex { gap: 20px; }
	.bs-menu-full .navbar-wp .sm-clean a { font-size: .9rem; }
}
@media (min-width: 992px) {
	.bs-menu-full .main.d-lg-flex > .col-width-45 {
		padding-left: 12px;
		padding-right: 12px;
	}
}

/* Full menu only where it fits: from 1340px up. Below that the compact bar with the menu button shows. */
@media (max-width: 1339px) {
	.bs-menu-full .main.d-lg-flex { display: none !important; }
	.bs-menu-full .mobile-main { display: flex !important; }
}
@media (min-width: 1340px) {
	.bs-menu-full .mobile-main { display: none !important; }
	.bs-menu-full .navbar-wp .sm-clean a { font-size: .8rem; }
}

/* Dropdowns must stay visible: the menu column is not clipped */
@media (min-width: 1340px) {
	.bs-menu-full .main.d-lg-flex > .col-width-45 { overflow: visible; }

}

/* Homepage hero: slider in the centre, two stacked cards on each side */
.fv-hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
	gap: 20px;
	align-items: stretch;
	max-width: 1240px;
	margin: 24px auto 8px;
	padding: 0 16px;
}
.fv-hero-side {
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-width: 0;
}
.fv-hero-card {
	position: relative;
	display: flex;
	flex-direction: column;
	flex: 1 1 0;
	min-height: 210px;
	border-radius: 6px;
	overflow: hidden;
	background: #7f7f7f center / cover no-repeat;
	color: #ffffff;
	text-decoration: none;
}
.fv-hero-card::after,
.fv-slide::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, .85) 100%);
}
.fv-hero-card-inner {
	position: relative;
	z-index: 1;
	margin-top: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.fv-hero-cat {
	align-self: flex-start;
	background: var(--tamfis-primary);
	color: #ffffff;
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
	padding: 3px 8px;
	border-radius: 2px;
}
.fv-hero-title {
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.3;
	color: #ffffff;
}
.fv-hero-date {
	font-size: .75rem;
	color: rgba(255, 255, 255, .8);
}
.fv-hero-center {
	min-width: 0;
}
.fv-hero-slider {
	height: 100%;
	min-height: 460px;
	border-radius: 6px;
	overflow: hidden;
	background: #111111;
}
.fv-slide {
	position: relative;
	display: block;
	height: 100%;
	min-height: 460px;
	color: #ffffff;
	text-decoration: none;
}
.fv-slide img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.fv-slide-text {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1;
	padding: 28px 32px 52px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.fv-slide-title {
	font-size: clamp(1.4rem, 2.6vw, 2.1rem);
	font-weight: 800;
	line-height: 1.2;
	color: #ffffff;
}
.fv-hero-slider .swiper-pagination { bottom: 16px; }
.fv-hero-slider .swiper-pagination-bullet {
	background: #ffffff;
	opacity: .6;
}
.fv-hero-slider .swiper-pagination-bullet-active {
	background: var(--tamfis-primary);
	opacity: 1;
}
.fv-hero-slider .swiper-button-next,
.fv-hero-slider .swiper-button-prev {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(0, 0, 0, .35);
	color: #ffffff;
}
.fv-hero-slider .swiper-button-next::after,
.fv-hero-slider .swiper-button-prev::after {
	font-size: 16px;
}
@media (max-width: 899px) {
	.fv-hero {
		grid-template-columns: 1fr;
		gap: 16px;
	}
	.fv-hero-center { order: -1; }
	.fv-hero-slider,
	.fv-slide { min-height: 340px; }
	.fv-hero-side {
		flex-direction: row;
		gap: 12px;
	}
	.fv-hero-side .fv-hero-card { min-height: 170px; }
	.fv-slide-text { padding: 20px 20px 46px; }
}

/* Hero is a little taller than the content below it */
@media (min-width: 900px) {
	.fv-hero-slider,
	.fv-slide { min-height: 580px; }
	.fv-hero-card { min-height: 270px; }
}

/* Hero: full-width and taller, so it is clearly larger than the stories below */
@media (min-width: 900px) {
	.fv-hero {
		width: 100vw;
		max-width: none;
		margin-left: calc(50% - 50vw);
		margin-right: calc(50% - 50vw);
		margin-top: 20px;
		padding: 0 clamp(16px, 2.2vw, 40px);
		grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr) minmax(0, 1fr);
	}
	.fv-hero-slider,
	.fv-slide { min-height: 680px; }
	.fv-hero-card { min-height: 330px; }
}

/* Subscribe button: keep a red fill with white text in every state, so hover never turns white on white */
.subscribe-btn.btn,
.subscribe-btn.btn-five,
.subscribe-btn.btn-five:link,
.subscribe-btn.btn-five:visited {
	background-color: var(--tamfis-primary) !important;
	color: #ffffff !important;
	border-color: var(--tamfis-primary) !important;
}
.subscribe-btn.btn-five:hover,
.subscribe-btn.btn-five:focus,
.subscribe-btn.btn-five:active {
	background-color: #ff6b81 !important;
	color: #0a2e75 !important;
	border-color: #ff6b81 !important;
}

/* Desktop dropdowns open on hover and keyboard focus, independent of the menu script */
@media (min-width: 1340px) {
	.bs-menu-full .sm-clean li:hover > ul.dropdown-menu,
	.bs-menu-full .sm-clean li:focus-within > ul.dropdown-menu {
		display: block;
	}
}

/* Phones: the slider has a fixed height, so its dots and arrows stay on the slide, not on the cards below */
@media (max-width: 899px) {
	.fv-hero-center { height: auto; }
	.fv-hero-slider { height: 340px; min-height: 0; }
	.fv-slide { height: 340px; min-height: 0; }
	.fv-hero-slider .swiper-pagination { bottom: 12px; }
}

/* The slider and its centre column are positioned containers, so dots and arrows sit on the slider */
.fv-hero-center,
.fv-hero-slider { position: relative; }

/* Subscribe hover: white button, red label, icon and badge, so no layer covers the text */
.subscribe-btn.btn-five:hover,
.subscribe-btn.btn-five:focus-visible {
	background-color: #ffffff !important;
	color: var(--tamfis-primary) !important;
	border-color: #ffffff !important;
}
.subscribe-btn.btn-five:hover span,
.subscribe-btn.btn-five:hover i,
.subscribe-btn.btn-five:focus-visible span,
.subscribe-btn.btn-five:focus-visible i {
	color: var(--tamfis-primary) !important;
}
.subscribe-btn.btn-five:hover::before,
.subscribe-btn.btn-five:focus-visible::before {
	background-color: var(--tamfis-primary) !important;
}
.subscribe-btn.btn-five:hover,
.subscribe-btn.btn-five:focus-visible {
	background-image: none !important;
}

/* Subscribe hover: the theme's badge grows to cover the button on hover, so hide it there */
.subscribe-btn.btn-five:hover::before,
.subscribe-btn.btn-five:focus-visible::before {
	display: none !important;
}

/* Footer arrangement (after the finima.net layout): social icons, archive dates, text links */
.fv-footer-social { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0 0 22px; }
.fv-footer-social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .12);
	color: #ffffff;
	text-decoration: none;
}
.fv-footer-social a:hover { background: var(--tamfis-primary); }
.fv-footer-date { display: block; font-size: .75rem; color: rgba(255, 255, 255, .6); margin-top: 2px; }
.fv-footer-links li a { line-height: 1.35; }
.fv-footer-col > .fv-footer-title:not(:first-child) { margin-top: 28px; }

/* Post lists (Categories page sections, Latest stories): a horizontal and vertical grid of cards */
.wp-block-post-template {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 24px;
	list-style: none;
	padding: 0;
	margin: 0 0 32px;
}
.wp-block-post-template > li {
	margin: 0;
	display: flex;
	flex-direction: column;
	background: var(--tamfis-card);
	border: 1px solid var(--tamfis-border);
	border-radius: 6px;
	overflow: hidden;
}
.wp-block-post-template .wp-block-post-featured-image img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	display: block;
}
.wp-block-post-template .wp-block-post-title {
	font-size: 1.05rem;
	line-height: 1.3;
	margin: 12px 14px 6px;
}
.wp-block-post-template .wp-block-post-excerpt,
.wp-block-post-template .wp-block-post-date,
.wp-block-post-template .wp-block-post-terms {
	margin-left: 14px;
	margin-right: 14px;
}
.wp-block-post-template .wp-block-post-excerpt { font-size: .9rem; color: var(--tamfis-text); }
.wp-block-post-template .wp-block-post-date { font-size: .8rem; color: var(--tamfis-text); margin-bottom: 14px; }

/* Right sidebar: a fixed, narrower column on desktop; the content takes the rest */
@media (min-width: 992px) {
	.row > .sidebar-right {
		flex: 0 0 300px !important;
		width: 300px !important;
		max-width: 300px !important;
	}
	.row > .content-right {
		flex: 1 1 0% !important;
		width: auto !important;
		max-width: none !important;
		min-width: 0;
	}
}

/* Archive and category masonry: two flexible columns built by masonry-grid.js */
#grid.d-grid,
#grid.d-grid.column2 {
	display: flex;
	column-count: auto;
	gap: 28px;
	align-items: flex-start;
}
#grid.d-grid > .fv-col {
	flex: 1 1 0%;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 28px;
}
#grid.d-grid > .fv-col > div {
	width: 100%;
	margin: 0;
	display: block;
}
