@use "../../mixins/utilities";
@use "../../variables-site/structure";

/* Headers */

.accent-header,
#secondary .widgettitle,
.article-section-title {
	border-bottom: 4px solid var(--newspack-theme-color-border);
	color: var(--newspack-theme-color-primary-against-white);
	padding-bottom: #{structure.$size__spacing-unit * 0.33};
}

.accent-header,
.article-section-title {
	font-size: var(--newspack-theme-font-size-sm);
}

.accent-header,
.wp-block-columns .wp-block-column > .accent-header,
.entry-content .wpnbha .article-section-title {
	margin-bottom: #{structure.$size__spacing-unit * 0.75};
}

/* Navigation */

.nav3 {
	a {
		background-color: var(--newspack-theme-color-bg-pre);
		color: var(--newspack-theme-color-text-main);
		@include utilities.button-transition;

		border-radius: 5px;
		font-size: var(--newspack-theme-font-size-sm);
		font-weight: 700;
		padding: #{structure.$size__spacing-unit * 0.5} #{structure.$size__spacing-unit * 0.75};
	}

	.menu-highlight a {
		background-color: var(--newspack-theme-color-primary);
		border: 0;
		color: var(--newspack-theme-color-against-primary);
		padding: #{structure.$size__spacing-unit * 0.5} #{structure.$size__spacing-unit * 0.75};
	}
}

.h-sb .site-header .nav3 {
	a {
		background-color: var(--newspack-theme-color-primary-darken-10);
		color: var(--newspack-theme-color-against-primary);
	}

	.menu-highlight a {
		background-color: var(--newspack-theme-color-secondary);
		color: var(--newspack-theme-color-against-secondary);
	}
}

.nav3,
.h-sb .nav3 {
	li a,
	li.menu-highlight a {
		&:hover,
		&:focus {
			background-color: var(--newspack-theme-color-text-main);
			color: #fff;
			opacity: 1;
		}
	}
}

.mobile-sidebar .nav3 {
	a {
		background: transparent;
		padding: #{structure.$size__spacing-unit * 0.5} #{structure.$size__spacing-unit * 0.75};
	}

	.menu-highlight a {
		background-color: var(--newspack-theme-color-primary-darken-10);
		color: var(--newspack-theme-color-against-primary);
	}
}

.subpage-sidebar .nav3 a {
	padding: #{structure.$size__spacing-unit * 0.5} #{structure.$size__spacing-unit * 0.75};
}

/* Posts and pages */

.cat-links {
	a {
		background-color: var(--newspack-theme-color-primary);
		color: var(--newspack-theme-color-against-primary);
		display: inline-block;
		line-height: 1;
		margin: 0 #{0.25 * structure.$size__spacing-unit} #{0.25 * structure.$size__spacing-unit} 0;
		padding: 0.3em 0.5em;

		&:visited {
			color: var(--newspack-theme-color-against-primary);
		}

		&:hover {
			background-color: var(--newspack-theme-color-primary-variation);
			color: var(--newspack-theme-color-against-primary);
		}
	}
}

.wpnbha,
.wpnbpc {
	.cat-links a {
		margin: 0;
		padding: 0;
		&,
		&:visited,
		&:hover {
			background-color: transparent;
			color: inherit;
		}
	}
}

//! Newspack Article Carousel
.wp-block-newspack-blocks-carousel {
	.cat-links a {
		background: transparent;
		padding: 0;
	}
}

.featured-image-behind .cat-links {
	font-size: var(--newspack-theme-font-size-sm);
	a,
	a:hover,
	a:visited {
		background-color: transparent;
		color: inherit;
		margin: 0;
		padding: 0;
	}
	.sep {
		display: inline;
	}
}

@include utilities.media( tablet ) {
	.featured-image-beside .cat-links {
		a,
		a:hover,
		a:visited {
			background-color: transparent;
			color: inherit;
			margin: 0;
			padding: 0;
		}
		.sep {
			display: inline;
		}
	}
}

.tags-links a {
	background-color: #f1f1f1;
	margin: 0 #{0.25 * structure.$size__spacing-unit} #{0.25 * structure.$size__spacing-unit} 0;
	padding: #{0.25 * structure.$size__spacing-unit} #{0.5 * structure.$size__spacing-unit};
}

.cat-links,
.tags-links {
	.sep {
		display: none;
	}
}

div.author-bio {
	.author-link,
	h2 a {
		color: var(--newspack-theme-color-primary-against-white);
	}
}

/* Archives */

.blog,
.search,
.archive {
	.cat-links {
		margin-bottom: #{0.5 * structure.$size__spacing-unit};
		a {
			font-size: 0.65rem;
			margin-bottom: 0;
			padding: 0.25em 0.5em;
		}
	}
}

/* Footer */

.site-footer .footer-branding,
.site-footer .footer-widgets:first-child {
	.wrapper {
		border-top: 4px solid var(--newspack-theme-color-border);
	}
}

.af-widget {
	.site-footer .footer-branding,
	.site-footer .footer-widgets:first-child {
		.wrapper {
			border: 0;
		}
	}
}

// Sponsored Content
.single.sponsors-show-cats .sponsor-label,
.single.sponsors-show-cats .sponsor-label + button {
	margin-bottom: #{0.25 * structure.$size__spacing-unit};
}
