/*
Theme Name: FluxMag
Theme URI: https://www.tvflux.dk/
Author: Adam Hvidt
Description: Eget bloktema til tvflux.dk. Afløser Dynamico med samme udseende: Ubuntu og Francois One, 1340 px bred side med indhold og sidebar, videoer fra giornalismo-feltet som klik-for-afspil.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.0
Version: 2.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fluxmag
*/

/* ---------- Base ---------- */

:root {
	--fm-dark: #333;
	--fm-red: #ff0000;
	--fm-link: #e84747;
	--fm-border: 1px solid rgba(0, 0, 0, 0.1);
	--fm-shadow: 0 0 4px 0 #ddd;
	--fm-gap: 24px;
}

body {
	margin: 0;
	background-color: #f4f4f4;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Ccircle fill='rgba(0,0,0,0.05)' cx='10' cy='10' r='2'/%3E%3Ccircle fill='rgba(0,0,0,0.05)' cx='40' cy='40' r='2'/%3E%3Ccircle fill='rgba(0,0,0,0.05)' cx='70' cy='70' r='2'/%3E%3C/svg%3E");
	overflow-wrap: break-word;
}

img {
	max-width: 100%;
	height: auto;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
	outline: 2px solid var(--fm-link);
	outline-offset: 2px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.fm-container {
	box-sizing: border-box;
	max-width: 1340px;
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--fm-gap);
	padding-right: var(--fm-gap);
}

.fm-box,
.fm-card,
.fm-widget,
.fm-featured-video,
.fm-pagination {
	box-sizing: border-box;
	background: #fff;
	border: var(--fm-border);
	box-shadow: var(--fm-shadow);
	padding: var(--fm-gap);
	margin: 0 0 var(--fm-gap);
}

/* ---------- Header ---------- */

.fm-header {
	background: #fff;
}

.fm-header__main {
	padding-top: 40px;
	padding-bottom: 40px;
}

.fm-header .wp-block-site-logo {
	line-height: 0;
}

.fm-header .wp-block-site-logo img {
	width: 265px;
	max-width: 100%;
	height: auto;
}

.fm-navbar {
	background: var(--fm-dark);
}

.fm-nav {
	position: relative;
}

.fm-menu,
.fm-menu ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.fm-menu a {
	display: block;
	font-family: var(--wp--preset--font-family--francois-one);
	font-size: 16px;
	line-height: 28px;
	text-transform: uppercase;
	text-decoration: none;
}

.fm-nav__toggle,
.fm-submenu-toggle {
	display: none;
	background: none;
	border: 0;
	color: #fff;
	cursor: pointer;
	font: inherit;
}

@media (min-width: 800px) {
	.fm-menu {
		display: flex;
		flex-wrap: wrap;
	}

	.fm-menu > li {
		position: relative;
	}

	.fm-menu > li > a {
		color: #fff;
		padding: 18.4px 24px;
	}

	.fm-menu > li:first-child > a {
		padding-left: 0;
	}

	.fm-menu > li.menu-item-has-children > a::after {
		content: "";
		display: inline-block;
		width: 6px;
		height: 6px;
		margin: 0 0 4px 10px;
		border-right: 1px solid currentColor;
		border-bottom: 1px solid currentColor;
		transform: rotate(45deg);
	}

	.fm-menu > li > a:hover,
	.fm-menu > li:focus-within > a {
		color: #ccc;
	}

	.fm-menu ul {
		position: absolute;
		z-index: 99;
		left: -999em;
		top: 100%;
		width: 256px;
		background: #fff;
		box-shadow: var(--fm-shadow);
		border: var(--fm-border);
	}

	.fm-menu ul ul {
		top: 0;
		left: -999em;
	}

	.fm-menu li:hover > ul,
	.fm-menu li:focus-within > ul {
		left: 0;
	}

	.fm-menu ul li:hover > ul,
	.fm-menu ul li:focus-within > ul {
		left: 100%;
	}

	.fm-menu ul a {
		color: var(--fm-dark);
		padding: 12px 16px;
	}

	.fm-menu ul a:hover {
		background: #eee;
	}
}

@media (max-width: 799px) {
	.fm-nav__toggle {
		display: flex;
		align-items: center;
		gap: 10px;
		padding: 16px 0;
		font-family: var(--wp--preset--font-family--francois-one);
		font-size: 16px;
		text-transform: uppercase;
	}

	.fm-nav__bars,
	.fm-nav__bars::before,
	.fm-nav__bars::after {
		display: block;
		width: 20px;
		height: 2px;
		background: currentColor;
		position: relative;
	}

	.fm-nav__bars::before,
	.fm-nav__bars::after {
		content: "";
		position: absolute;
		left: 0;
	}

	.fm-nav__bars::before {
		top: -6px;
	}

	.fm-nav__bars::after {
		top: 6px;
	}

	.fm-menu {
		display: none;
		padding-bottom: 12px;
	}

	.fm-nav.is-open .fm-menu {
		display: block;
	}

	.fm-menu li {
		position: relative;
		border-top: 1px solid rgba(255, 255, 255, 0.1);
	}

	.fm-menu a {
		color: #fff;
		padding: 12px 48px 12px 0;
	}

	.fm-menu ul {
		display: none;
		padding-left: 16px;
	}

	.fm-menu li.is-open > ul {
		display: block;
	}

	.fm-submenu-toggle {
		display: block;
		position: absolute;
		right: 0;
		top: 0;
		width: 48px;
		height: 52px;
	}

	.fm-submenu-toggle::before {
		content: "";
		display: inline-block;
		width: 8px;
		height: 8px;
		border-right: 2px solid currentColor;
		border-bottom: 2px solid currentColor;
		transform: rotate(45deg);
		transition: transform 0.15s;
	}

	.is-open > .fm-submenu-toggle::before {
		transform: rotate(-135deg);
	}
}

/* ---------- Layout ---------- */

.fm-layout {
	display: flex;
	align-items: flex-start;
	padding-top: var(--fm-gap);
	padding-bottom: 1px;
}

.fm-content {
	flex: 1 1 auto;
	min-width: 0;
}

.fm-sidebar {
	box-sizing: border-box;
	flex: 0 0 392px;
	padding-left: var(--fm-gap);
}

@media (max-width: 1100px) {
	.fm-sidebar {
		flex-basis: 324px;
	}
}

@media (max-width: 960px) {
	.fm-header__main {
		padding-top: 32px;
		padding-bottom: 32px;
	}

	.fm-layout {
		display: block;
	}

	.fm-sidebar {
		padding-left: 0;
	}
}

/* ---------- Post grid ---------- */

.fm-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: var(--fm-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (max-width: 1240px) {
	.fm-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.fm-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

.fm-card {
	height: calc(100% - var(--fm-gap));
}

.fm-card__image {
	position: relative;
	margin: 0 0 16px;
}

.fm-card__image img {
	display: block;
	width: 100%;
	aspect-ratio: 32 / 15;
	object-fit: cover;
}

.fm-has-video .fm-card__image a::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 48px;
	height: 48px;
	margin: -24px 0 0 -24px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.65) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M8 5v14l11-7z'/%3E%3C/svg%3E") 55% 50% / 26px no-repeat;
	transition: background-color 0.15s;
}

.fm-has-video .fm-card__image a:hover::after {
	background-color: var(--fm-red);
}

.fm-card__title,
.fm-entry__title,
.fm-page-title {
	margin: 0 0 0;
	padding: 0 0 8px;
	border-bottom: 5px solid var(--fm-dark);
	color: var(--fm-dark);
	font-family: var(--wp--preset--font-family--francois-one);
	font-weight: 400;
	font-size: 20px;
	line-height: 28px;
}

.fm-entry__title {
	font-size: 28px;
	line-height: 1.4;
}

.fm-page-header {
	padding: 12px 16px;
}

.fm-page-header .fm-page-title {
	padding: 0;
	border: 0;
	font-size: 17px;
	line-height: 1.5;
}

.fm-page-search {
	margin-top: 12px;
}

.fm-list__item .fm-card__excerpt p {
	margin: 16px 0 0;
}

.fm-404 .fm-page-title {
	padding: 0;
	border: 0;
	font-size: 20px;
	line-height: 1.4;
	margin-bottom: 16px;
}

.fm-404 h2 {
	font-size: 20px;
	margin: 24px 0 8px;
}

.fm-404 .wp-block-latest-posts,
.fm-404 .wp-block-page-list {
	padding-left: 16px;
	list-style: circle;
}

.fm-404 a {
	color: var(--fm-link);
	text-decoration: none;
}

.fm-card__title a {
	color: var(--fm-dark);
	text-decoration: none;
}

.fm-card__title a:hover {
	text-decoration: underline;
}

.fm-meta {
	background: #eee;
	padding: 9.6px 16px;
	font-size: 15px;
	line-height: 26.25px;
	margin: 0 0 16px;
}

.fm-meta a {
	color: rgba(0, 0, 0, 0.6);
}

.fm-card__excerpt {
	font-size: 17px;
	line-height: 1.75;
}

.fm-card__excerpt p {
	margin: 0 0 24px;
}

.wp-block-post-excerpt__more-text a,
.wp-block-search__button {
	display: inline-block;
	border-radius: 20px;
	padding: 10px 20px;
	color: #fff;
	font-weight: 700;
	font-size: 16px;
	line-height: 28px;
	text-decoration: none;
}

.wp-block-post-excerpt__more-text a {
	background: var(--fm-red);
}

.wp-block-post-excerpt__more-text a:hover {
	background: var(--fm-dark);
	color: #fff;
}


/* ---------- Pagination ---------- */

.fm-pagination {
	display: flex;
	flex-wrap: wrap;
	padding: 12px 16px;
	gap: 8px;
	font-weight: 700;
}

.fm-pagination a,
.fm-pagination .page-numbers {
	padding: 6.4px 9.6px;
	color: var(--fm-link);
	text-decoration: none;
}

.fm-pagination .current {
	color: var(--fm-dark);
}

/* ---------- Single, page ---------- */

.fm-featured-video,
.fm-featured-image {
	margin: 0 0 var(--fm-gap);
}

.fm-featured-image img {
	display: block;
	width: 100%;
}

.fm-entry .fm-meta {
	margin-top: 0;
}

.fm-entry__content {
	font-size: 17px;
	line-height: 1.75;
}

.fm-entry__content > * {
	margin-top: 16px;
	margin-bottom: 24px;
}

.fm-entry__content a {
	text-decoration: underline;
}

.fm-entry__image {
	margin: calc(-1 * var(--fm-gap)) calc(-1 * var(--fm-gap)) var(--fm-gap);
}

.fm-post-nav {
	display: flex;
	justify-content: space-between;
	gap: var(--fm-gap);
}

.fm-meta--single > * {
	display: inline;
}

.fm-meta--single > * + *::before {
	content: " | ";
	color: rgba(0, 0, 0, 0.4);
}

.fm-post-nav .post-navigation-link__label {
	display: block;
	font-family: var(--wp--preset--font-family--ubuntu);
	font-size: 15px;
	color: rgba(0, 0, 0, 0.6);
}

.fm-post-nav a {
	font-family: var(--wp--preset--font-family--francois-one);
	font-size: 20px;
	color: var(--fm-dark);
	text-decoration: none;
}

.fm-post-nav__next {
	margin-left: auto;
	text-align: right;
}

.fm-comments:not(:has(.wp-block-comment-template, .comment-respond)) {
	display: none;
}

.fm-comment {
	margin-bottom: var(--fm-gap);
}

.fm-page-header .wp-block-term-description {
	margin-top: 16px;
}

/* ---------- Related posts ---------- */

.fm-related__heading {
	margin: 0 0 16px;
	padding: 0 0 8px;
	border-bottom: 5px solid var(--fm-dark);
	font-size: 20px;
}

.fm-related__list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--fm-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.fm-related__link {
	display: block;
	color: var(--fm-dark);
	text-decoration: none;
}

.fm-related__link:hover .fm-related__title {
	text-decoration: underline;
}

.fm-related .fm-card__image {
	display: block;
	position: relative;
	margin: 0 0 8px;
}

.fm-related .fm-card__image img {
	display: block;
	width: 100%;
	aspect-ratio: 32 / 15;
	object-fit: cover;
}

.fm-related .fm-has-video .fm-card__image::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 36px;
	height: 36px;
	margin: -18px 0 0 -18px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.65) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M8 5v14l11-7z'/%3E%3C/svg%3E") 55% 50% / 20px no-repeat;
}

.fm-related__title {
	display: block;
	font-family: var(--wp--preset--font-family--francois-one);
	font-size: 17px;
	line-height: 1.35;
}

.fm-related__date {
	display: block;
	margin-top: 4px;
	font-size: 14px;
	color: rgba(0, 0, 0, 0.6);
}

@media (max-width: 600px) {
	.fm-related__list {
		grid-template-columns: minmax(0, 1fr);
	}
}

.fm-page-intro {
	margin-top: 8px;
}

.fm-page-intro p {
	margin: 0;
}

/* ---------- Video ---------- */

.fm-video {
	position: relative;
	aspect-ratio: 16 / 9;
	background: #000;
	overflow: hidden;
}

.fm-video iframe,
.fm-video__play {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.fm-video__play {
	padding: 0;
	margin: 0;
	background: #000;
	cursor: pointer;
}

.fm-video__poster {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.fm-video__icon {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 68px;
	height: 48px;
	margin: -24px 0 0 -34px;
	border-radius: 12px;
	background: rgba(33, 33, 33, 0.8) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M8 5v14l11-7z'/%3E%3C/svg%3E") 55% 50% / 30px no-repeat;
	transition: background-color 0.15s;
}

.fm-video__play:hover .fm-video__icon,
.fm-video__play:focus-visible .fm-video__icon {
	background-color: var(--fm-red);
}

.fm-featured-video {
	padding: 0;
}

.fm-featured-video--embed iframe {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	height: auto;
}

/* ---------- Sidebar widgets ---------- */

.fm-widget {
	border-radius: 12px;
	font-size: 16px;
}

.fm-widget__title {
	margin: -8px -8px 16px;
	padding: 8px 12px;
	background: var(--fm-dark);
	color: #fff;
	font-family: var(--wp--preset--font-family--ubuntu);
	font-size: 15px;
	line-height: 21px;
	font-weight: 400;
	text-transform: uppercase;
}

.fm-widget ul {
	margin: 0;
	padding-left: 16px;
	list-style: circle;
}

.fm-widget li {
	margin: 0;
}

.fm-widget a {
	color: var(--fm-link);
	text-decoration: none;
}

.fm-widget a:hover {
	text-decoration: underline;
}

.fm-widget .wp-block-tag-cloud {
	margin: 0;
	line-height: 1.75;
}

.fm-widget .wp-block-tag-cloud a {
	display: inline;
	padding: 0;
	margin: 0 4px 0 0;
}

.wp-block-search__label {
	display: block;
	font-weight: 400;
	margin-bottom: 4px;
}

.wp-block-search__inside-wrapper {
	display: flex;
}

.wp-block-search__input {
	flex: 1 1 auto;
	min-width: 0;
	border: var(--fm-border);
	padding: 4.8px 9.6px;
	font: inherit;
	color: rgba(0, 0, 0, 0.6);
}

.wp-block-search__button {
	background: #32373c;
	border: 0;
	margin-left: 10px;
	padding: 12.7px 23.3px;
	font-weight: 400;
	cursor: pointer;
}

.wp-block-search__button:hover {
	background: var(--fm-red);
}

.fm-favorites {
	list-style: none !important;
	padding: 0 !important;
}

.fm-favorites li {
	background: #f0f2f4;
	padding: 24px;
	margin: 0 0 12px;
}

.fm-favorites a {
	color: #393f4c;
	font-size: 16px;
	text-decoration: none;
}

.fm-dice {
	text-align: center;
}

.fm-dice p {
	margin: 0 0 8px;
}

.fm-dice__link {
	display: inline-block;
	transition: transform 0.2s;
}

.fm-dice__link:hover,
.fm-dice__link:focus-visible {
	transform: rotate(-12deg);
}

.fm-dice svg {
	display: block;
	max-width: 200px;
	height: auto;
}

/* ---------- Footer ---------- */

.fm-footer {
	background: var(--fm-dark);
	color: rgba(255, 255, 255, 0.6);
	font-size: 15px;
	line-height: 26.25px;
}

.fm-footer__inner {
	padding-top: 20px;
	padding-bottom: 20px;
	background: rgba(255, 255, 255, 0.05);
}

.fm-footer p {
	margin: 0;
}

.fm-footer a {
	color: #fff;
}

.fm-widget .wp-block-latest-posts {
	padding-left: 16px;
	list-style: circle;
}

.fm-widget .wp-block-latest-posts li {
	margin: 0;
	color: var(--fm-link);
}

/* Phones: cards sit directly on the page, as on the old theme. */
@media (max-width: 600px) {
	.fm-container {
		--fm-gap: 20px;
	}

	.fm-header__main {
		padding-top: 20px;
		padding-bottom: 20px;
	}

	.fm-card {
		background: none;
		border: 0;
		box-shadow: none;
		padding: 0;
		margin-bottom: 40px;
	}

	.fm-nav__toggle {
		font-size: 0;
		height: 61px;
		padding: 0;
	}

	.fm-content .fm-box,
	.fm-featured-video {
		background: none;
		border: 0;
		box-shadow: none;
		padding: 0;
	}

	.fm-entry__title {
		font-size: 20px;
	}

	.fm-nav__bars {
		transform: scale(1.4);
		transform-origin: left center;
	}
}
