/**
 * Site frame without Elementor: design tokens, heading font, header, mobile menu and footer (header.php and
 * footer.php). Loaded on every page (inc/artikkeli.php) after the theme style.css. Rules that style.css or the
 * Elementor kit (".elementor-kit-N h2") would override have an element or a second class.
 * The base styles and Open Sans for pages without style.css are in css/artikkeli.css. Elsewhere Open Sans comes from
 * mu-plugins/pa-performance.php and Elementor, with other files: a second face of the family here would load twice.
 *
 * The custom properties in :root are the one place for colours, fonts and widths. Every other stylesheet of
 * these templates uses them, and the episode cards (pa-episode-groups) follow them when they are defined.
 */

:root {
	/* Colours */
	--pa-color-bg: #000;
	--pa-color-surface: #111;
	--pa-color-surface-2: #181818;
	--pa-color-line: #262626;
	--pa-color-ink: #f4f4f4;       /* headings and strong text */
	--pa-color-text: #c8c8c8;      /* body text */
	--pa-color-muted: #8a8a8a;     /* labels and captions */
	--pa-color-accent: #ff6400;    /* links and highlights */
	--pa-color-tape: #ffc200;      /* logo slogan yellow */
	--pa-color-spotify: #1db954;
	--pa-color-youtube: #ff0000;

	/* Fonts: headings in one weight of Barlow Condensed, text in Open Sans (the logo is outlined, see images/) */
	--pa-font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
	--pa-font-text: "Open Sans", Arial, sans-serif;
	--pa-weight-display: 600;

	/* Layout grid: two widths. The page width is shared by the header, footer and wide blocks,
	   the reading column (centred) by running text. Side padding is 20px on every screen. */
	--pa-shape-radius: 10px;
	--pa-width-read: 720px;
	--pa-width-wide: 1160px;
	--pa-gutter: 20px;

	/* Icons used as CSS masks (they take the text colour) */
	--pa-icon-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E");
}

@font-face {
	font-family: "Barlow Condensed";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url(../fonts/barlow-condensed-600.woff2) format("woff2");
}
/* Only the second menu level (Julma historia) in the mobile menu: loads when the menu opens */
@font-face {
	font-family: "Barlow Condensed";
	font-style: normal;
	font-weight: 300;
	font-display: swap;
	src: url(../fonts/barlow-condensed-300.woff2) format("woff2");
}

/* Logo: outlined SVG (images/logo-sprite.svg), white name and the slogan in tape yellow.
   a.pa-logo: the name takes the link colour, so the theme style.css a:visited and a:hover must not win. */
a.pa-logo {
	display: inline-flex;
	color: #fff;
}
.pa-logo__svg {
	display: block;
	width: auto;
	height: 46px;
}
.pa-logo__tape {
	fill: var(--pa-color-tape);
}

/* Header: sticky, translucent */
.pa-site-header {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 1000; /* above Elementor content (up to 999), below the fixed bottom bars */
	background: rgba(0, 0, 0, .88);
	-webkit-backdrop-filter: saturate(140%) blur(10px);
	backdrop-filter: saturate(140%) blur(10px);
	border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.pa-site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	max-width: calc(var(--pa-width-wide) + 2 * var(--pa-gutter));
	margin: 0 auto;
	padding: 14px var(--pa-gutter);
}
/* Front page: transparent on the hero and without the logo (the hero has the big one), menu centred */
.pa-site-header--home {
	position: absolute;
	right: 0;
	left: 0;
	background: none;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
	border-bottom: 0;
}
.pa-site-header--home .pa-site-header__inner {
	justify-content: center;
}
.pa-nav__list {
	display: flex;
	gap: 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.pa-nav__list a {
	position: relative;
	display: block;
	padding: 8px 0;
	font-family: var(--pa-font-display);
	font-size: 17px;
	font-weight: var(--pa-weight-display);
	letter-spacing: .06em;
	line-height: 1.2;
	text-decoration: none;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .82);
	transition: color .15s ease;
}
.pa-nav__list a::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: 2px;
	left: 0;
	height: 2px;
	background: var(--pa-color-accent);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform .2s ease;
}
.pa-nav__list a:hover {
	color: #fff;
}
.pa-nav__list a:hover::after,
.pa-nav__list .current-menu-item > a::after {
	transform: scaleX(1);
}
.pa-nav__list .current-menu-item > a {
	color: #fff;
}
/* Second level (Julma historia under Rikosarkisto): a small panel on hover and keyboard focus, a chevron on the parent */
.pa-nav__list > li {
	position: relative;
}
.pa-nav__list .menu-item-has-children > a {
	padding-right: 16px;
}
.pa-nav__list .menu-item-has-children::before {
	content: "";
	position: absolute;
	top: 50%;
	right: 0;
	width: 10px;
	height: 10px;
	margin-top: -5px;
	background: rgba(255, 255, 255, .6);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
	pointer-events: none;
}
.pa-nav__list .sub-menu {
	position: absolute;
	top: 100%;
	left: -16px;
	min-width: 190px;
	margin: 0;
	padding: 6px 0;
	list-style: none;
	border: 1px solid var(--pa-color-line);
	border-radius: var(--pa-shape-radius);
	background: var(--pa-color-surface);
	opacity: 0;
	visibility: hidden;
	transform: translateY(4px);
	transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.pa-nav__list li:hover > .sub-menu,
.pa-nav__list li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}
.pa-nav__list .sub-menu a {
	padding: 9px 16px;
	font-size: 16px;
	white-space: nowrap;
}
.pa-nav__list .sub-menu a::after {
	content: none;
}
/* Action item (CSS class pa-nav__toiminto, Ehdota jaksoa): an outlined button */
.pa-nav__list .pa-nav__toiminto > a {
	padding: 6px 14px;
	border: 1px solid rgba(255, 255, 255, .35);
	border-radius: 999px;
	color: #fff;
}
.pa-nav__list .pa-nav__toiminto > a::after {
	content: none;
}
.pa-nav__list .pa-nav__toiminto > a:hover {
	border-color: #fff;
	background: #fff;
	color: #000;
}
.pa-nav__list > .pa-nav__toiminto {
	align-self: center;
}
.pa-menu-btn,
.pa-mobile-menu__close {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	cursor: pointer;
}
.pa-menu-btn:focus-visible,
.pa-mobile-menu__close:focus-visible,
.pa-nav__list a:focus-visible,
.pa-logo:focus-visible {
	outline: 2px solid var(--pa-color-accent);
	outline-offset: 3px;
}

/* Mobile menu: a panel from the right */
.pa-mobile-menu {
	position: fixed;
	inset: 0 0 0 auto;
	width: min(420px, 100%);
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 0;
	overflow-y: auto;
	border: 0;
	border-left: 1px solid var(--pa-color-line);
	background: var(--pa-color-surface);
	color: #fff;
}
.pa-mobile-menu[open] {
	animation: pa-menu-in .25s ease;
}
.pa-mobile-menu::backdrop {
	background: rgba(0, 0, 0, .7);
}
@keyframes pa-menu-in {
	from {
		opacity: 0;
		transform: translateX(32px);
	}
}
.pa-mobile-menu__inner {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 28px;
	min-height: 100%;
	padding: 0 20px 28px;
}
/* The latest episode from edge to edge at the top, the close button on it */
.pa-mobile-menu__uusin {
	margin: 0 -20px;
}
.pa-mobile-menu__close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 10; /* above the links of the latest episode card (up to 6) */
	display: inline-flex;
	background: rgba(0, 0, 0, .6);
}
.pa-mobile-menu__list {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: pa-menu;
}
.pa-mobile-menu__list li {
	counter-increment: pa-menu;
}
.pa-mobile-menu__list a {
	display: flex;
	align-items: baseline;
	gap: 14px;
	padding: 12px 0;
	border-bottom: 1px solid var(--pa-color-line);
	font-family: var(--pa-font-display);
	font-size: 30px;
	font-weight: var(--pa-weight-display);
	letter-spacing: .02em;
	line-height: 1.1;
	text-decoration: none;
	text-transform: uppercase;
	color: #fff;
}
.pa-mobile-menu__list a::before {
	content: counter(pa-menu, decimal-leading-zero);
	min-width: 22px;
	font-family: var(--pa-font-text);
	font-size: 12px;
	font-weight: 400;
	letter-spacing: .04em;
	color: var(--pa-color-muted);
}
.pa-mobile-menu__list .current-menu-item > a {
	color: var(--pa-color-accent);
}
/* Second level: smaller, without a number, aligned with the text of the parent */
.pa-mobile-menu__list .sub-menu {
	margin: 0;
	padding: 0;
	list-style: none;
}
.pa-mobile-menu__list .sub-menu li,
.pa-mobile-menu__list .pa-nav__toiminto {
	counter-increment: none;
}
.pa-mobile-menu__list .sub-menu a {
	padding: 10px 0 10px 36px;
	font-size: 22px;
	font-weight: 300;
}
.pa-mobile-menu__list .sub-menu a::before,
.pa-mobile-menu__list .pa-nav__toiminto > a::before {
	content: none;
}
/* Action item: an outlined button under the list */
.pa-mobile-menu__list .pa-nav__toiminto > a {
	justify-content: center;
	margin-top: 20px;
	padding: 12px 20px;
	border: 1px solid rgba(255, 255, 255, .35);
	border-radius: 999px;
	font-size: 20px;
}
.pa-mobile-menu__channels {
	margin-top: auto;
}

/* Listening channels: Spotify highlighted, the others outlined. On hover Patreon inverts and YouTube turns red. */
.pa-listen {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.pa-listen a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 42px;
	padding: 0 18px 0 14px;
	border: 1px solid var(--pa-color-line);
	border-radius: 999px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
	color: var(--pa-color-ink);
	transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.pa-listen a:hover {
	border-color: #555;
}
.pa-listen svg {
	flex: 0 0 auto;
}
.pa-listen .pa-listen__spotify {
	border-color: var(--pa-color-spotify);
	background: var(--pa-color-spotify);
	color: #000;
}
.pa-listen .pa-listen__spotify:hover {
	border-color: #1ed760;
	background: #1ed760;
}
.pa-listen .pa-listen__patreon:hover {
	border-color: #fff;
	background: #fff;
	color: #000;
}
.pa-listen .pa-listen__youtube:hover {
	border-color: var(--pa-color-youtube);
	background: var(--pa-color-youtube);
	color: #fff;
}

/* Footer: three columns on a hairline, quiet labels */
.pa-site-footer {
	border-top: 1px solid var(--pa-color-line);
	background: var(--pa-color-surface);
	color: var(--pa-color-text);
}
.pa-site-footer__inner {
	display: grid;
	grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.1fr) minmax(0, .8fr);
	gap: 64px;
	max-width: calc(var(--pa-width-wide) + 2 * var(--pa-gutter));
	margin: 0 auto;
	padding: 80px var(--pa-gutter) 96px;
}
.pa-site-footer .pa-logo__svg {
	height: 34px;
}
.pa-footer-logo__sub {
	margin: 12px 0 40px;
	font-family: var(--pa-font-display);
	font-size: 15px;
	font-weight: var(--pa-weight-display);
	letter-spacing: .32em;
	line-height: 1.2;
	text-transform: uppercase;
	color: var(--pa-color-tape);
}
.pa-site-footer .pa-site-footer__title {
	margin: 0 0 18px;
	font-family: var(--pa-font-text);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .14em;
	line-height: 1.3;
	text-transform: uppercase;
	color: var(--pa-color-muted);
}
.pa-footer-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.pa-footer-list a,
a.pa-footer-mail {
	font-size: 15px;
	line-height: 1.4;
	text-decoration: none;
	color: var(--pa-color-ink);
	transition: color .15s ease;
}
.pa-footer-list a:hover,
.pa-footer-mail:hover {
	color: var(--pa-color-accent);
}
/* Small arrow in front of the popular episodes, accent on hover */
.pa-footer-list a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.pa-footer-list a::before {
	content: "";
	flex: 0 0 auto;
	width: 12px;
	height: 12px;
	background: var(--pa-color-muted);
	-webkit-mask: var(--pa-icon-arrow) center / contain no-repeat;
	mask: var(--pa-icon-arrow) center / contain no-repeat;
	transition: background .15s ease, transform .15s ease;
}
.pa-footer-list a:hover::before {
	background: var(--pa-color-accent);
	transform: translateX(2px);
}
.pa-footer-mail {
	display: inline-block;
	margin-bottom: 20px;
}
.pa-social {
	display: flex;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.pa-social a {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border: 1px solid var(--pa-color-line);
	border-radius: 50%;
	color: var(--pa-color-ink);
	transition: border-color .15s ease, color .15s ease;
}
.pa-social a:hover {
	border-color: var(--pa-color-accent);
	color: var(--pa-color-accent);
}

@media (max-width: 767px) {
	.pa-nav {
		display: none;
	}
	.pa-menu-btn {
		display: inline-flex;
	}
	/* The menu icon sits 8px inside its button, so the icon lines up with the 20px edge */
	.pa-site-header__inner {
		padding: 10px calc(var(--pa-gutter) - 8px) 10px var(--pa-gutter);
	}
	.pa-site-header .pa-logo__svg {
		height: 38px;
	}
	.pa-site-header--home .pa-site-header__inner {
		justify-content: flex-end;
	}
}

@media (max-width: 480px) {
	.pa-listen {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
	.pa-listen a {
		justify-content: center;
		padding: 0 10px;
	}
}

@media (max-width: 900px) {
	.pa-site-footer__inner {
		grid-template-columns: 1fr;
		gap: 48px;
		padding: 56px var(--pa-gutter) 72px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pa-mobile-menu[open] {
		animation: none;
	}
	.pa-nav__list .sub-menu {
		transition: none;
	}
}
