/*
Theme Name: Motora Block Theme
Theme URI: https://motora.fi
Author: Motora
Description: An editor-friendly block theme for Motora, built with local fonts, reusable patterns, and no page-builder dependency.
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
Version: 0.1.5
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: motora-block-theme
*/

:root {
	--motora-header-height: 86px;
	--motora-menu-background: #475691;
	--motora-menu-top-height: 174px;
}

html {
	scroll-behavior: smooth;
}

body {
	-moz-osx-font-smoothing: grayscale;
	-webkit-font-smoothing: antialiased;
}

.wp-site-blocks {
	min-height: 100vh;
	overflow-x: clip;
}

.wp-block-button__link,
.wp-block-navigation a,
.motora-card,
.motora-news-card {
	transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.wp-block-button__link:hover {
	transform: translateY(-1px);
	text-decoration: none;
}

.is-style-outline > .wp-block-button__link:not(.has-background):hover {
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

.motora-header {
	position: sticky;
	top: 0;
	z-index: 80;
	box-shadow: 0 1px 0 rgba(7, 7, 7, 0.08);
}

.admin-bar .motora-header {
	top: 32px;
}

.motora-header-logo img {
	display: block;
	height: auto;
	max-height: 66px;
	width: auto;
}

.motora-header-row {
	min-height: 72px;
}

.motora-header .wp-block-navigation__responsive-container-open {
	padding: 0.35rem;
}

.motora-header .wp-block-navigation a:hover {
	color: var(--wp--preset--color--motora-blue);
	text-decoration: none;
}

.motora-menu-actions {
	align-items: center;
	display: flex;
	justify-content: flex-end;
}

.motora-menu-toggle {
	align-items: center;
	background: transparent;
	border: 0;
	color: var(--wp--preset--color--contrast);
	cursor: pointer;
	display: inline-flex;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 300;
	gap: 0.8rem;
	line-height: 1;
	padding: 0.5rem 0;
}

.motora-menu-toggle:hover {
	color: var(--wp--preset--color--motora-blue);
}

.motora-menu-icon {
	display: inline-block;
	height: 1.55rem;
	position: relative;
	width: 2.35rem;
}

.motora-close-icon {
	display: inline-block;
	height: 2.6rem;
	position: relative;
	width: 3.4rem;
}

.motora-menu-icon span {
	background: currentColor;
	display: block;
	height: 0.2rem;
	left: 0;
	position: absolute;
	right: 0;
}

.motora-menu-icon span:nth-child(1) {
	top: 0.05rem;
}

.motora-menu-icon span:nth-child(2) {
	top: 0.68rem;
}

.motora-menu-icon span:nth-child(3) {
	top: 1.31rem;
}

.motora-close-icon::before,
.motora-close-icon::after {
	background: currentColor;
	content: "";
	height: 0.3rem;
	left: 0.35rem;
	position: absolute;
	top: 1.15rem;
	width: 3.2rem;
}

.motora-close-icon::before {
	transform: rotate(45deg);
}

.motora-close-icon::after {
	transform: rotate(-45deg);
}

.motora-mega-menu[hidden] {
	display: none;
}

.has-motora-mega-menu-open {
	overflow: hidden;
}

.motora-mega-menu {
	background: var(--motora-menu-background);
	color: var(--wp--preset--color--base);
	inset: 0;
	margin: 0 !important;
	max-width: none !important;
	overflow-y: auto;
	position: fixed;
	width: 100vw;
	z-index: 100;
}

.motora-mega-menu__top {
	align-items: center;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	display: grid;
	gap: var(--wp--preset--spacing--40);
	grid-template-columns: 190px minmax(0, 1fr) auto;
	min-height: var(--motora-menu-top-height);
	padding: 28px clamp(1.75rem, 3vw, 3.5rem);
}

.motora-mega-menu__logo img {
	display: block;
	height: auto;
	max-height: 106px;
	width: 150px;
}

.motora-mega-menu__utility {
	align-items: center;
	display: flex;
	gap: clamp(2.5rem, 4vw, 4rem);
	justify-content: center;
	white-space: nowrap;
}

.motora-mega-menu__utility a,
.motora-mega-menu__panel a {
	color: inherit;
	text-decoration: none;
}

.motora-mega-menu__utility a {
	font-size: clamp(1.6rem, 2vw, 1.9rem);
	line-height: 1.2;
}

.motora-mega-menu__utility a:hover,
.motora-mega-menu__panel a:hover {
	text-decoration: underline;
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.18em;
}

.motora-menu-toggle--close {
	font-size: var(--wp--preset--font-size--x-large);
	gap: 1rem;
	white-space: nowrap;
}

.motora-mega-menu__panel {
	isolation: isolate;
	min-height: calc(100vh - var(--motora-menu-top-height));
	overflow: hidden;
	padding: clamp(2.25rem, 4vw, 2.75rem) clamp(2rem, 4.5vw, 4.5rem) clamp(2rem, 5vw, 3.5rem);
	position: relative;
}

.motora-mega-menu__panel::after {
	background: url("./assets/images/ribbon-red.svg") center / contain no-repeat;
	bottom: clamp(1rem, 3vw, 2.2rem);
	content: "";
	height: clamp(170px, 18vw, 260px);
	pointer-events: none;
	position: absolute;
	right: clamp(0.5rem, 1.5vw, 2rem);
	width: min(44vw, 700px);
	z-index: -1;
}

.motora-mega-menu__grid {
	display: grid;
	column-gap: clamp(4rem, 7vw, 8rem);
	grid-template-columns: minmax(20rem, 28rem) minmax(20rem, 27rem) minmax(18rem, 1fr);
	margin: 0 auto;
	max-width: 1480px;
	position: relative;
	row-gap: clamp(2rem, 5vw, 5rem);
	z-index: 1;
}

.motora-mega-menu__column {
	align-content: start;
	display: grid;
	gap: 0.5rem;
}

.motora-mega-menu__column:nth-child(3) {
	justify-self: end;
	max-width: 21rem;
	width: 100%;
}

.motora-mega-menu__primary,
.motora-mega-menu__column h2 {
	color: var(--wp--preset--color--base);
	font-family: var(--wp--preset--font-family--heading);
	font-size: clamp(1.6rem, 1.9vw, 1.95rem);
	font-weight: 900;
	line-height: 1.1;
	margin: 0;
	text-transform: uppercase;
}

.motora-mega-menu__column h2 {
	margin-top: 2.15rem;
}

.motora-mega-menu__column h2.motora-mega-menu__section--lower {
	margin-top: clamp(4rem, 6.5vw, 5.5rem);
}

.motora-mega-menu__column h2.motora-mega-menu__section--deep {
	margin-top: clamp(6rem, 9vw, 7.5rem);
}

.motora-mega-menu__primary {
	margin-bottom: 1.35rem;
}

.motora-mega-menu__column > a:not(.motora-mega-menu__primary) {
	font-size: clamp(1.35rem, 1.8vw, 1.85rem);
	line-height: 1.3;
}

.motora-hero,
.motora-about-actions,
.motora-news-section,
.motora-groups-band,
.motora-sponsors,
.motora-footer {
	margin: 0 !important;
	max-width: none !important;
}

.motora-button {
	align-items: center;
	background: var(--wp--preset--color--soft-blue);
	border-radius: 5px;
	box-sizing: border-box;
	color: var(--wp--preset--color--base);
	display: inline-flex;
	justify-content: center;
	line-height: 1.15;
	min-height: 48px;
	padding: 0.65rem 2.1rem;
	text-align: center;
	text-decoration: none;
	transition: background-color 160ms ease, transform 160ms ease;
}

.motora-button:hover {
	background: #3f548f;
	color: var(--wp--preset--color--base);
	text-decoration: none;
	transform: translateY(-1px);
}

.motora-front-hero {
	background-color: var(--wp--preset--color--contrast);
	isolation: isolate;
	overflow: hidden;
	position: relative;
}

.motora-front-hero__image {
	display: block;
	height: auto;
	width: 100%;
}

.motora-front-hero::before,
.motora-front-hero::after,
.motora-about-actions__ribbon,
.motora-action-card::after {
	background-position: center;
	background-repeat: no-repeat;
	background-size: contain;
	content: "";
	pointer-events: none;
	position: absolute;
}

.motora-front-hero::before {
	background-image: url("./assets/images/ribbon-blue.svg");
	bottom: -6%;
	height: 35%;
	left: -3%;
	width: 48%;
	z-index: 1;
}

.motora-front-hero::after {
	background-image: url("./assets/images/ribbon-red.svg");
	bottom: -7%;
	height: 38%;
	right: -2%;
	width: 58%;
	z-index: 1;
}

.motora-front-hero__inner {
	inset: 0;
	margin: 0 auto;
	max-width: var(--wp--style--global--wide-size);
	position: absolute;
	width: 100%;
	z-index: 2;
}

.motora-front-hero__wordmark {
	bottom: 20%;
	display: block;
	height: auto;
	left: 8%;
	max-width: 82vw;
	position: absolute;
	width: 320px;
}

.motora-about-actions {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	overflow: hidden;
	position: relative;
}

.motora-about-actions__copy {
	margin: 0 auto;
	max-width: 1040px;
	padding: clamp(2.4rem, 5vw, 4.6rem) var(--wp--preset--spacing--30) clamp(3.5rem, 7vw, 6rem);
	text-align: center;
}

.motora-about-actions__copy h2,
.motora-news-section h2,
.motora-groups-band h2 {
	font-size: 2.45rem;
	margin: 0 0 1.35rem;
	text-decoration: underline;
	text-decoration-thickness: 0.07em;
	text-underline-offset: 0.1em;
}

.motora-about-actions__copy p {
	color: rgba(255, 255, 255, 0.74);
	font-size: 1.25rem;
	line-height: 1.45;
	margin: 0 auto 2.6rem;
	max-width: 980px;
}

.motora-about-actions__copy .motora-button {
	font-size: 1.35rem;
	min-width: 240px;
}

.motora-about-actions__ribbons {
	height: clamp(100px, 13vw, 180px);
	position: relative;
}

.motora-about-actions__ribbon {
	background-image: url("./assets/images/ribbon-red.svg");
	bottom: 10%;
	height: 92%;
	width: min(34vw, 430px);
}

.motora-about-actions__ribbon--left {
	left: 5%;
	transform: scaleX(-1);
}

.motora-about-actions__ribbon--right {
	right: 5%;
}

.motora-action-grid {
	background: var(--wp--preset--color--charcoal);
	display: grid;
	gap: clamp(2rem, 5vw, 5rem);
	grid-template-columns: repeat(2, minmax(280px, 690px));
	justify-content: center;
	padding: clamp(3rem, 6vw, 5rem) var(--wp--preset--spacing--40);
}

.motora-action-card {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	min-height: 260px;
	overflow: hidden;
	padding: clamp(1.5rem, 3vw, 2.6rem);
	position: relative;
}

.motora-action-card::after {
	background-image: url("./assets/images/ribbon-red.svg");
	bottom: 0.3rem;
	height: 42%;
	right: 0.7rem;
	width: 30%;
}

.motora-action-card h3 {
	font-size: 2.25rem;
	margin: 0 0 1.4rem;
	position: relative;
	z-index: 1;
}

.motora-action-card p {
	font-size: 1.55rem;
	line-height: 1.14;
	margin: 0 0 2rem;
	max-width: 18ch;
	position: relative;
	z-index: 1;
}

.motora-action-card .motora-button {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.15rem;
	min-width: 0;
	position: relative;
	text-decoration: underline;
	width: min(100%, 350px);
	z-index: 1;
}

.motora-news-section {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	padding: 2.7rem var(--wp--preset--spacing--30) 4rem;
}

.motora-section-inner {
	margin: 0 auto;
	max-width: var(--wp--style--global--wide-size);
}

.motora-news-section h2 {
	margin-bottom: 3.2rem;
	text-align: center;
}

.motora-news-grid {
	display: grid;
	gap: clamp(2rem, 6vw, 5rem);
	grid-template-columns: repeat(2, minmax(280px, 1fr));
}

.motora-news-section .motora-news-card {
	background: var(--wp--preset--color--soft-blue);
	border: 0;
	border-radius: 6px;
	box-shadow: none;
	color: var(--wp--preset--color--base);
	min-height: 250px;
	padding: 1.35rem 1.45rem;
}

.motora-news-section .motora-news-card h3 {
	color: inherit;
	font-size: 1.3rem;
	margin: 0 0 0.35rem;
}

.motora-news-section .motora-news-card p {
	font-size: 1rem;
	line-height: 1.42;
	margin: 0 0 0.6rem;
}

.motora-news-section .motora-news-card a {
	color: inherit;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1rem;
	text-decoration: none;
}

.motora-news-section .motora-news-card a:hover {
	text-decoration: underline;
}

.motora-groups-band {
	background-color: var(--wp--preset--color--charcoal);
	color: var(--wp--preset--color--base);
	display: grid;
	position: relative;
	text-align: center;
}

.motora-groups-band__image {
	display: block;
	grid-area: 1 / 1;
	height: auto;
	width: 100%;
}

.motora-groups-band::before {
	background: rgba(7, 7, 7, 0.76);
	content: "";
	inset: 0;
	position: absolute;
}

.motora-groups-band__overlay {
	grid-area: 1 / 1;
	margin: 0 auto;
	max-width: 1120px;
	padding: 5.2rem var(--wp--preset--spacing--30);
	position: relative;
	z-index: 1;
}

.motora-groups-band h2 {
	color: inherit;
	margin-bottom: 5.7rem;
}

.motora-groups-band p {
	font-size: 1.8rem;
	line-height: 1.28;
	margin: 0 auto 2.1rem;
	max-width: 1000px;
}

.motora-sponsors {
	background: var(--wp--preset--color--contrast);
	padding: clamp(2.2rem, 4vw, 4rem) var(--wp--preset--spacing--30) clamp(3rem, 5vw, 4.8rem);
}

.motora-sponsors__grid {
	align-items: center;
	display: grid;
	gap: clamp(1rem, 2.2vw, 2rem);
	grid-template-columns: repeat(12, minmax(0, 1fr));
	margin: 0 auto;
	max-width: 1420px;
}

.motora-sponsor-text {
	color: rgba(255, 255, 255, 0.22);
	font-size: 1.25rem;
	grid-column: 1 / span 3;
	white-space: nowrap;
}

.motora-sponsor-box {
	align-items: center;
	background: var(--wp--preset--color--base);
	display: flex;
	justify-content: center;
	min-height: 0;
	min-width: 0;
	padding: 0.7rem;
	width: 100%;
}

.motora-sponsor-box--wide {
	aspect-ratio: 2.65 / 1;
}

.motora-sponsor-box--square {
	aspect-ratio: 1 / 1;
	margin-top: -3rem;
}

.motora-sponsor-box img,
.motora-sponsor-logo {
	display: block;
	height: auto;
	max-height: 100%;
	max-width: 100%;
	object-fit: contain;
}

.motora-sponsor-box--kkes {
	grid-column: 4 / span 3;
}

.motora-sponsor-box--lahitapiola {
	grid-column: 7 / span 2;
}

.motora-sponsor-box--op {
	grid-column: 9 / span 2;
}

.motora-sponsor-box--joensuu {
	grid-column: 11 / span 2;
}

.motora-sponsor-logo--kansalaisfoorumi {
	grid-column: 3 / span 5;
	justify-self: center;
	max-width: 560px;
}

.motora-sponsor-logo--pko {
	grid-column: 8 / span 3;
	justify-self: center;
	max-width: 250px;
}

.motora-footer {
	background: var(--wp--preset--color--soft-blue);
	color: var(--wp--preset--color--base);
	overflow: hidden;
	padding: clamp(4rem, 7vw, 6.2rem) var(--wp--preset--spacing--30) 1.5rem;
	position: relative;
	text-align: center;
}

.motora-footer__inner {
	margin: 0 auto;
	max-width: var(--wp--style--global--wide-size);
}

.motora-footer h2 {
	color: inherit;
	font-size: 1.55rem;
	margin: 0 0 2.5rem;
	text-transform: uppercase;
}

.motora-footer p {
	font-size: 1.45rem;
	line-height: 1.14;
	margin: 0 auto 2.2rem;
}

.motora-footer__bottom {
	align-items: end;
	display: grid;
	grid-template-columns: 1fr auto;
	margin-top: clamp(4rem, 9vw, 7.5rem);
}

.motora-footer__links {
	display: flex;
	font-size: 1.35rem;
	gap: clamp(3rem, 9vw, 9rem);
	justify-content: center;
	justify-self: center;
}

.motora-footer a {
	color: inherit;
	text-decoration: none;
}

.motora-footer a:hover {
	text-decoration: underline;
}

.motora-footer__social {
	display: flex;
	gap: 1.8rem;
	justify-self: end;
}

.motora-footer__social img {
	display: block;
	height: 64px;
	width: 64px;
}

@media (max-width: 1180px) {
	.motora-mega-menu__grid {
		column-gap: clamp(2rem, 4vw, 3rem);
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.motora-mega-menu__column:nth-child(3) {
		justify-self: stretch;
		max-width: none;
	}

	.motora-mega-menu__column h2.motora-mega-menu__section--lower,
	.motora-mega-menu__column h2.motora-mega-menu__section--deep {
		margin-top: clamp(3rem, 5vw, 4rem);
	}
}

@media (max-width: 900px) {
	.motora-header-logo img {
		max-height: 54px;
	}

	.motora-header .wp-block-navigation {
		display: none;
	}

	.motora-action-grid,
	.motora-news-grid {
		grid-template-columns: 1fr;
	}

	.motora-sponsors__grid {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}

	.motora-sponsor-text {
		grid-column: 1 / -1;
		justify-self: center;
		white-space: normal;
	}

	.motora-sponsor-box--kkes,
	.motora-sponsor-box--op {
		grid-column: span 3;
	}

	.motora-sponsor-box--lahitapiola,
	.motora-sponsor-box--joensuu {
		grid-column: span 3;
		margin-top: 0;
	}

	.motora-sponsor-logo--kansalaisfoorumi,
	.motora-sponsor-logo--pko {
		grid-column: 1 / -1;
	}
}

@media (max-width: 782px) {
	:root {
		--motora-menu-top-height: 96px;
	}

	.admin-bar .motora-header {
		top: 46px;
	}

	.motora-mega-menu__top {
		gap: var(--wp--preset--spacing--30);
		grid-template-columns: auto 1fr;
		min-height: var(--motora-menu-top-height);
		padding-bottom: 1rem;
		padding-top: 1rem;
	}

	.motora-mega-menu__logo img {
		max-height: 72px;
		width: 104px;
	}

	.motora-mega-menu__utility {
		display: none;
	}

	.motora-menu-toggle {
		font-size: 1.35rem;
		justify-self: end;
	}

	.motora-menu-icon {
		height: 1.4rem;
		width: 2.2rem;
	}

	.motora-close-icon {
		height: 2.1rem;
		width: 3rem;
	}

	.motora-menu-icon span {
		height: 0.18rem;
	}

	.motora-menu-icon span:nth-child(1) {
		top: 0.1rem;
	}

	.motora-menu-icon span:nth-child(2) {
		top: 0.61rem;
	}

	.motora-menu-icon span:nth-child(3) {
		top: 1.12rem;
	}

	.motora-close-icon::before,
	.motora-close-icon::after {
		height: 0.24rem;
		left: 0.25rem;
		top: 0.95rem;
		width: 2.5rem;
	}

	.motora-mega-menu__panel {
		padding: var(--wp--preset--spacing--50) var(--wp--preset--spacing--30) var(--wp--preset--spacing--70);
	}

	.motora-mega-menu__grid {
		gap: var(--wp--preset--spacing--50);
		grid-template-columns: 1fr;
	}

	.motora-mega-menu__column h2.motora-mega-menu__section--lower,
	.motora-mega-menu__column h2.motora-mega-menu__section--deep {
		margin-top: var(--wp--preset--spacing--50);
	}

	.motora-mega-menu__panel::after {
		opacity: 0.45;
		right: -2rem;
		width: 90vw;
	}
}

@media (max-width: 640px) {
	:root {
		--motora-header-height: 72px;
	}

	.motora-front-hero__wordmark {
		bottom: 19%;
		left: 5%;
		width: 220px;
	}

	.motora-front-hero::before {
		bottom: -2%;
		left: -26%;
		width: 82%;
	}

	.motora-front-hero::after {
		bottom: -1%;
		right: -24%;
		width: 92%;
	}

	.motora-about-actions__copy h2,
	.motora-news-section h2,
	.motora-groups-band h2 {
		font-size: 2rem;
	}

	.motora-about-actions__copy p {
		font-size: 1rem;
	}

	.motora-about-actions__ribbons {
		height: 96px;
	}

	.motora-about-actions__ribbon {
		width: 58vw;
	}

	.motora-action-card {
		min-height: 220px;
	}

	.motora-action-card h3 {
		font-size: 1.85rem;
	}

	.motora-action-card p,
	.motora-groups-band p,
	.motora-footer p {
		font-size: 1.15rem;
	}

	.motora-groups-band__overlay {
		padding-top: 4rem;
	}

	.motora-groups-band h2 {
		margin-bottom: 3rem;
	}

	.motora-sponsors__grid {
		grid-template-columns: 1fr;
	}

	.motora-sponsor-text,
	.motora-sponsor-box--kkes,
	.motora-sponsor-box--lahitapiola,
	.motora-sponsor-box--op,
	.motora-sponsor-box--joensuu,
	.motora-sponsor-logo--kansalaisfoorumi,
	.motora-sponsor-logo--pko {
		grid-column: 1;
	}

	.motora-sponsor-box {
		min-height: 104px;
	}

	.motora-sponsor-box--square {
		justify-self: center;
		width: 180px;
	}

	.motora-footer__bottom {
		gap: 2.5rem;
		grid-template-columns: 1fr;
	}

	.motora-footer__links {
		flex-wrap: wrap;
		font-size: 1.1rem;
		gap: 1.5rem;
	}

	.motora-footer__social {
		justify-self: center;
	}

	.motora-footer__social img {
		height: 52px;
		width: 52px;
	}
}
