/*
Theme Name: Mandala Messages
Theme URI: https://mandalamessages.com
Description: Recreates the Mandala Messages oracle site: the home mandala with clickable links laid over the image, the nine-mandala portal with its 108 video messages, per-page artwork backgrounds and the original colours. Pair with the "Mandala Video Importer" plugin to copy the Vimeo-hosted videos into the Media Library.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mandala-messages
Tags: custom-background, one-column, custom-menu, featured-images, block-styles, wide-blocks
*/

:root {
	--mm-gold: #f4c138;
	--mm-orange: #f7941c;
	--mm-purple: #6600cc;
	--mm-violet: #8035d4;
	--mm-indigo: #4400c6;
	--mm-font: "Trebuchet MS", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Tahoma, sans-serif;
	--mm-display: "Trajan Pro", "Trajan", "Cinzel", "Optima", "Palatino Linotype", Palatino, Georgia, serif;
}

/* ---------- Base -------------------------------------------------------- */
html {
	background-color: #1b0f2e;
	background-position: top center;
	background-repeat: no-repeat;
	background-size: cover;
	background-attachment: fixed;
	min-height: 100%;
}
body {
	margin: 0;
	min-height: 100vh;
	background: transparent;
	font-family: var(--mm-font);
	font-size: 16px;
	line-height: 24px;
	color: #fff;
}
a { color: var(--mm-gold); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
img { max-width: 100%; height: auto; border: 0; }
.mm-content p { margin: 0 0 24px; }
.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute !important;
	width: 1px; word-wrap: normal !important;
}
.skip-link:focus {
	clip: auto; clip-path: none; height: auto; width: auto; z-index: 100000;
	left: 8px; top: 8px; padding: 12px 16px; background: #fff; color: #000;
}

/* ---------- Header ------------------------------------------------------ */
.mm-header {
	position: relative;
	z-index: 5;
	display: flex;
	align-items: center;
	gap: 24px;
	padding: 10px 20px 0;
	min-height: 37px;
}
.mm-home-logo { display: inline-block; line-height: 0; }
.mm-menu ul { display: flex; flex-wrap: wrap; gap: 4px 18px; list-style: none; margin: 0; padding: 0; }
.mm-menu a { color: var(--mm-gold); text-transform: uppercase; font-size: 14px; letter-spacing: .04em; text-shadow: 1px 1px 1px #000; }

/* ---------- Page shell -------------------------------------------------- */
.mm-main { padding: 0 16px 72px; }
.mm-article { position: relative; margin: 0 auto; max-width: 960px; }
.mm-title {
	font-family: var(--mm-font);
	font-size: 30px;
	line-height: 1.1;
	margin: 0 0 18px;
	color: var(--mm-gold);
	text-transform: uppercase;
	text-shadow: 1px 1px 1px rgba(0, 0, 0, .3);
}
.mm-title--category { text-align: center; letter-spacing: -1px; }
.mm-content h2, .mm-content h3 { color: #fff; font-size: 22px; line-height: 1.1; letter-spacing: -1px; margin: 0 0 8px; }
.mm-content strong { color: var(--mm-gold); }

/* Mission: text on the right half, white. */
.mm-page-mission .mm-article { max-width: none; margin-left: 47%; width: 50%; }
.mm-page-mission .mm-title { margin-top: -12px; }

/* How to use: indigo text, narrow column. */
.mm-page-how-to-use .mm-article { margin-left: max(0px, calc((100% - 960px) / 2 + 269px)); max-width: 530px; }
.mm-page-how-to-use .mm-title { color: #ff8f05; }
.mm-page-how-to-use .mm-content,
.mm-page-how-to-use .mm-content strong { color: var(--mm-indigo); }
.mm-page-how-to-use .mm-content a { color: var(--mm-indigo); }

/* Membership: left column. */
.mm-page-membership .mm-article { margin-left: 5%; max-width: 475px; }
.mm-page-membership .mm-title { margin-top: -12px; }

/* About us: three columns. */
.mm-page-about-us .mm-article { max-width: 900px; }
.mm-page-about-us .mm-title { margin-top: -12px; }
.mm-about-columns { gap: 30px; }
.mm-page-about-us .mm-content p { margin: 0 0 12px; }
.mm-page-about-us .mm-donate { margin: 12px 0 0 104px; }

/* Testimonials: translucent boxes. */
.mm-page-testimonials .mm-article { max-width: 900px; text-align: center; }
.mm-page-testimonials .mm-title { margin: -8px 0 42px; text-shadow: 1px 1px 1px #000; }
.mm-testimonial.wp-block-quote {
	box-sizing: border-box;
	max-width: 690px;
	margin: 10px auto;
	padding: 6px;
	border: 1px solid #cbc4c4;
	border-radius: 10px;
	box-shadow: 3px 3px 11px 1px rgba(0, 0, 0, .1);
	background: rgba(255, 255, 255, .6);
	color: #000;
	text-align: left;
	font: 16px/22px var(--mm-font);
}
.mm-testimonial p { margin: 0; }
.mm-testimonial cite { display: block; font-style: normal; padding-left: 1.2em; }
.mm-testimonial cite::before { content: "~ "; }

/* Terms of service. */
.mm-page-terms-of-service .mm-article { margin-left: 5%; max-width: 615px; color: #000; }
.mm-page-terms-of-service .mm-content p { margin: 0 0 14px; }
.mm-page-terms-of-service .mm-content h3 { color: var(--mm-gold); text-shadow: 1px 1px 1px #000; font-size: 16px; letter-spacing: 0; margin: 18px 0 4px; }
.mm-page-terms-of-service .mm-content a { color: inherit; text-decoration: underline; }

/* Sample videos: gold centred text on the home artwork. */
.mm-page-sample-videos .mm-title { text-align: center; margin-top: 36px; }
.mm-page-sample-videos .mm-content { color: var(--mm-gold); text-align: center; text-shadow: 1px 1px 1px #000; font-size: 21px; line-height: 26px; font-weight: bold; letter-spacing: .06em; }
.mm-page-sample-videos .mm-content h2 { color: var(--mm-gold); font-size: 26px; letter-spacing: .05em; text-shadow: 1px 1px 1px #000; margin: 32px 0 16px; }
.mm-page-sample-videos .mm-content p { margin: 0 0 22px; }
.mm-page-sample-videos .mm-content strong { color: inherit; }
.mm-samples { width: 100%; box-sizing: border-box; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 24px; max-width: 824px; margin: 0 auto 40px; order: -1; }
.mm-page-sample-videos .mm-content { display: flex; flex-direction: column; }
.mm-page-sample-videos .wp-block-shortcode, .mm-page-sample-videos .mm-content > .mm-samples { order: -1; }
.mm-sample { flex: 1 1 180px; color: var(--mm-gold); font-size: 18px; line-height: 1.35; text-shadow: 2px 2px 1px #000; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mm-sample img { width: 140px; height: 140px; transition: transform .6s ease; }
.mm-sample:hover, .mm-sample:focus-visible { text-decoration: none; }
.mm-sample:hover img, .mm-sample:focus-visible img { transform: rotate(30deg) scale(1.05); }
.mm-video-link a { color: var(--mm-violet); text-shadow: none; }

/* Donate button. */
.mm-donate { margin: 8px 0 0 90px; display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.mm-donate input[type="image"] { width: 77px; height: 34px; }
.mm-donate__label { font: 17px/19px var(--mm-display); color: var(--mm-purple); }

/* ---------- Home: the mandala with clickable links ----------------------- */
.mm-front .mm-main { padding: 0; }
.mm-front .mm-article { max-width: none; }
.mm-front .mm-header { position: absolute; }
.mm-home { margin: 0 auto; max-width: 988px; padding: 12px 0 40px; }
.mm-home__stage { position: relative; container-type: inline-size; aspect-ratio: 988 / 766; animation: mm-fade 1s ease both; }
.mm-home__img { position: absolute; inset: 0; width: 100%; height: 100%; }
.mm-home__hotspots { position: absolute; inset: 0; width: 100%; height: 100%; }
.mm-home__hotspots polygon { fill: transparent; cursor: pointer; }
.mm-pos { position: absolute; left: calc(var(--x) / 988 * 100%); top: calc(var(--y) / 766 * 100%); margin: 0; }
.mm-home__nav ul { list-style: none; margin: 0; padding: 0; }
.mm-home__link a, .mm-home__title {
	font-family: var(--mm-display);
	font-weight: normal;
	color: var(--mm-purple);
	white-space: nowrap;
	letter-spacing: .02em;
}
.mm-home__link--h3 a { font-size: calc(17 / 988 * 100cqi); line-height: 1.12; }
.mm-home__link--h2 a { font-weight: bold; }
.mm-home__link--h2 a, .mm-home__title { font-size: calc(30 / 988 * 100cqi); line-height: 1; }
.mm-home__trailer a { color: var(--mm-violet); font-size: calc(18 / 988 * 100cqi); }
.mm-home__donate .mm-donate { margin: 0; }
.mm-home__donate .mm-donate__label { font-size: calc(17 / 988 * 100cqi); }
.mm-home__donate input[type="image"] { width: calc(77 / 988 * 100cqi); height: auto; }

.mm-home__list { display: none; grid-template-columns: 1fr 1fr; gap: 10px 16px; list-style: none; margin: 16px; padding: 16px; background: rgba(255, 255, 255, .75); border-radius: 8px; }
.mm-home__list a { font-family: var(--mm-display); color: var(--mm-purple); font-size: 16px; }

@keyframes mm-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Portal ------------------------------------------------------ */
.mm-article--portal { max-width: 988px; }
.mm-portal { max-width: 988px; margin: 0 auto; }
.mm-portal__stage { position: relative; aspect-ratio: 988 / 740; container-type: inline-size; opacity: 0; transition: opacity 1s ease 1s; }
.mm-portal.is-ready .mm-portal__stage { opacity: 1; }
.mm-mandala {
	position: absolute;
	aspect-ratio: 1024 / 768;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	color: inherit;
	font: inherit;
}
.mm-mandala img { display: block; width: 100%; height: 100%; transition: transform .4s ease; }
.mm-mandala:hover img, .mm-mandala:focus-visible img { transform: scale(1.08); }
.mm-mandala:focus-visible { outline: 2px solid var(--mm-gold); outline-offset: 4px; border-radius: 50%; }
.mm-mandala__label {
	position: absolute;
	left: 50%;
	top: 100%;
	transform: translateX(-50%);
	width: 140%;
	font-size: max(12px, calc(24 / 988 * 100cqi));
	line-height: 1.05;
	color: var(--mm-orange);
	text-transform: uppercase;
	text-align: center;
	text-shadow: 2px 2px 1px #000;
}
.mm-spinner { position: fixed; z-index: 100001; pointer-events: none; transform-origin: center center; }
.mm-theatre { position: fixed; inset: 0; z-index: 100000; background: #000; opacity: 0; }
.mm-theatre video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .8s ease; pointer-events: none; }
.mm-theatre video.is-visible { opacity: 1; pointer-events: auto; }
.mm-theatre__message { max-width: 1024px; max-height: 576px; margin: auto; }
.mm-theatre__return { position: absolute; top: 10px; left: 20px; z-index: 3; line-height: 0; }
.mm-theatre__options { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; background: #000; animation: mm-fade 2s ease both; }
.mm-theatre__options a, .mm-theatre__options button { font: 24px/1 var(--mm-font); color: var(--mm-orange); background: none; border: 0; cursor: pointer; text-decoration: none; letter-spacing: .05em; }
body.mm-theatre-open { overflow: hidden; }

/* ---------- Video lightbox --------------------------------------------- */
.mm-lightbox { padding: 0; border: 1px solid #720047; background: #000; width: min(768px, 94vw); max-width: none; overflow: visible; }
.mm-lightbox::backdrop { background: rgba(255, 255, 255, .5); }
.mm-lightbox__video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.mm-lightbox__close { position: absolute; top: -40px; right: 0; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #fff; color: #720047; font-size: 26px; line-height: 1; cursor: pointer; }

/* ---------- Blocks ------------------------------------------------------ */
.wp-block-video video { width: 100%; }
.mandala_message .mm-content { max-width: 768px; }
.mm-list-title a { color: var(--mm-gold); }

/* ---------- Small screens ---------------------------------------------- */
@media (max-width: 782px) {
	.mm-page-mission .mm-article,
	.mm-page-how-to-use .mm-article,
	.mm-page-membership .mm-article,
	.mm-page-terms-of-service .mm-article { margin-left: auto; width: auto; max-width: 615px; }
	.mm-page-mission .mm-article,
	.mm-page-membership .mm-article,
	.mm-page-about-us .mm-article,
	.mm-page-terms-of-service .mm-article { background: rgba(0, 0, 0, .45); padding: 16px; border-radius: 8px; color: #fff; }
	.mm-page-how-to-use .mm-article { background: rgba(255, 255, 255, .7); padding: 16px; border-radius: 8px; }
	.mm-page-about-us .mm-donate { margin-left: 0; }
	.mm-title { margin-top: 12px !important; }
}
@media (max-width: 640px) {
	html { background-attachment: scroll; }
	/* The links stay on the mandala, and are repeated as a readable list below it. */
	.mm-home__link--h3 a, .mm-home__trailer a { font-size: max(9px, calc(17 / 988 * 100cqi)); }
	.mm-home__list { display: grid !important; }
	.mm-front .mm-home { padding-top: 56px; }
}
@media (prefers-reduced-motion: reduce) {
	.mm-home__stage, .mm-portal__stage, .mm-theatre__options { animation: none; transition: none; }
}
