/*
Theme Name: Frontier
Theme URI: https://www.frontiermmo.net
Author: Frontier
Author URI: https://www.frontiermmo.net
Description: The website for Frontier, an Anglo-Saxon fantasy MMO built inside Minecraft. Dark halls, gold runes, a live server status, and a news page for patch notes and announcements. Pair it with the Frontier Discord plugin to post each new article to Discord and show who is online there.
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.2.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: frontier
Tags: dark, block-patterns, block-styles, full-site-editing, editor-style, one-column, wide-blocks, news
*/

/*
 * Colours, fonts, sizes and buttons live in theme.json, so they show up in the Site Editor
 * and can be changed there. This file is only what theme.json cannot say: the block styles
 * registered in functions.php, and the handful of pieces built from classes.
 *
 * Class names starting fr- are set under Advanced > Additional CSS class(es) in the editor.
 */

/* ---------- Page ---------- */

html {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

/* Sections sit flush; the spacing lives inside each one. */
body .wp-site-blocks > * + * {
	margin-block-start: 0;
}

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid var(--wp--preset--color--contrast);
	outline-offset: 3px;
}

::selection {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--on-accent);
}

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

/* The rune before the site name. The empty alt text keeps screen readers from reading it out. */
.wp-block-site-title.fr-brand a {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
}

.wp-block-site-title.fr-brand a::before {
	content: "\16A0";
	content: "\16A0" / "";
	font-family: var(--wp--preset--font-family--runic);
	color: var(--wp--preset--color--accent);
}

.wp-block-navigation .wp-block-navigation-item__content {
	padding-block: 13px;
}

.wp-block-navigation .fr-nav-accent > .wp-block-navigation-item__content {
	color: var(--wp--preset--color--accent);
}

.wp-block-navigation .wp-block-navigation-item__content:hover,
.wp-block-navigation .fr-nav-accent > .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--accent-2);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-size: 18px;
	padding-block: 10px;
}

/* ---------- Sections ---------- */

/* A section with a rule above and below, for the darker bands between lighter ones. */
.fr-ruled {
	border-top: 2px solid var(--wp--preset--color--line);
	border-bottom: 2px solid var(--wp--preset--color--line);
}

.fr-ruled-top {
	border-top: 2px solid var(--wp--preset--color--line);
}

/* The hero's dark wash is a gradient on the left; on a phone the text covers the whole picture. */
@media (max-width: 800px) {
	.fr-hero > .wp-block-cover__background {
		background: rgba(14, 19, 24, 0.72) !important;
		opacity: 1;
	}
}

.fr-hero .wp-block-cover__image-background {
	object-position: 70% 60%;
}

/*
 * Italic text in the hero's title is the line under the name, in the body face: what Frontier
 * is. Both stay in the one H1, so a search engine reads the page's main heading as the name and
 * what it names, not one word, and changing it is Ctrl+I in the Site Editor, not a code edit.
 */
.fr-hero h1 em {
	display: block;
	margin-top: 0.5em;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--title);
	font-style: normal;
	font-weight: 500;
	line-height: 1.25;
	color: var(--wp--preset--color--accent);
}

/* ---------- Block style: Card (Group) ---------- */

.wp-block-group.is-style-card {
	background-color: var(--wp--preset--color--surface);
	border: 2px solid var(--wp--preset--color--line);
	box-shadow: var(--wp--preset--shadow--hard);
	padding: 26px 24px;
}

/* A card that opens with a picture runs the picture to its edges. */
.wp-block-group.is-style-card.fr-card-media {
	padding: 0;
	overflow: hidden;
}

.wp-block-group.is-style-card.fr-card-media > .wp-block-image {
	margin: 0;
}

.wp-block-group.is-style-card.fr-card-media > .wp-block-image img {
	display: block;
	width: 100%;
}

/* ---------- Block style: Kicker (Paragraph) ---------- */

.is-style-kicker {
	font-family: var(--wp--preset--font-family--pixel);
	font-size: var(--wp--preset--font-size--label);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
	line-height: 1.5;
}

/* ---------- Block style: Rune (Paragraph) ---------- */

.is-style-rune {
	font-family: var(--wp--preset--font-family--runic);
	font-size: var(--wp--preset--font-size--rune);
	line-height: 1;
	color: var(--wp--preset--color--accent);
}

/* ---------- Block style: Ledger (List) ---------- */

/* Numbered 01, 02, 03 in the pixel face, one rule per line. */
.wp-block-list.is-style-ledger {
	list-style: none;
	padding-left: 0;
	counter-reset: ledger;
}

.wp-block-list.is-style-ledger > li {
	counter-increment: ledger;
	margin: 0;
	padding: 16px 0 16px 46px;
	border-top: 2px solid var(--wp--preset--color--line);
}

.wp-block-list.is-style-ledger > li:last-child {
	border-bottom: 2px solid var(--wp--preset--color--line);
}

.wp-block-list.is-style-ledger > li::before {
	content: counter(ledger, decimal-leading-zero);
	display: inline-block;
	width: 28px;
	margin-left: -46px;
	margin-right: 18px;
	font-family: var(--wp--preset--font-family--pixel);
	font-size: 14px;
	letter-spacing: 0;
	color: var(--wp--preset--color--accent);
}

/* ---------- Block style: Stripe (Separator) ---------- */

/* The gold and blood chequer between the big sections. */
.wp-block-separator.is-style-stripe {
	height: 12px;
	max-width: none;
	width: 100%;
	margin: 0;
	border: 0;
	opacity: 1;
	background-color: var(--wp--preset--color--base-2);
	background-image:
		linear-gradient(90deg, var(--wp--preset--color--accent) 50%, transparent 50%),
		linear-gradient(90deg, transparent 50%, var(--wp--preset--color--accent-3) 50%);
	background-size: 12px 6px, 12px 6px;
	background-position: 0 0, 0 6px;
	background-repeat: repeat-x;
}

/* ---------- Block styles: Blood and Dark (Button) ---------- */

.wp-block-button.is-style-blood .wp-block-button__link {
	background-color: var(--wp--preset--color--accent-3);
	border-color: var(--wp--preset--color--accent-4);
	color: var(--wp--preset--color--on-accent-3);
}

.wp-block-button.is-style-dark .wp-block-button__link {
	background-color: var(--wp--preset--color--base);
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--contrast);
}

/* On the red band its shadow is wine rather than pitch. */
.has-accent-3-background-color .wp-block-button.is-style-dark .wp-block-button__link {
	box-shadow: 6px 6px 0 var(--wp--preset--color--accent-5);
}

.wp-block-button.is-style-blood .wp-block-button__link:hover,
.wp-block-button.is-style-dark .wp-block-button__link:hover {
	filter: brightness(1.15);
}

.wp-block-button.is-style-blood .wp-block-button__link::after,
.wp-block-button.is-style-dark .wp-block-button__link::after {
	content: "";
	display: inline-block;
	width: 18px;
	height: 18px;
	margin-left: 12px;
	vertical-align: -4px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='square'%3E%3Cpath d='M5 12h14M13 6l6 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='black' stroke-width='2.5' stroke-linecap='square'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- Block styles: Framed and Gilded (Image) ---------- */

.wp-block-image.is-style-framed img,
.wp-block-image.is-style-gilded img {
	display: block;
	box-sizing: border-box;
	border: 2px solid var(--wp--preset--color--line);
	box-shadow: var(--wp--preset--shadow--hard-large);
}

.wp-block-image.is-style-gilded img {
	border-color: var(--wp--preset--color--accent);
}

.wp-block-image.is-style-gilded a:hover img {
	border-color: var(--wp--preset--color--accent-2);
}

/* ---------- Server address and copy button ---------- */

.fr-address-bar {
	box-shadow: var(--wp--preset--shadow--hard);
}

.fr-address-bar > .fr-address {
	flex: 1 1 260px;
	min-width: 0;
	margin: 0;
	box-sizing: border-box;
	padding: 16px 18px;
	background: var(--wp--preset--color--base-3);
	border: 2px solid var(--wp--preset--color--accent);
	font-family: var(--wp--preset--font-family--pixel);
	font-size: 18px;
	line-height: 1.4;
	color: var(--wp--preset--color--contrast);
	overflow-wrap: anywhere;
}

.fr-address-bar > .wp-block-buttons {
	flex: 1 0 132px;
	margin: 0;
}

.fr-address-bar .fr-copy,
.fr-address-bar .fr-copy .wp-block-button__link {
	width: 100%;
	height: 100%;
}

.fr-address-bar .fr-copy .wp-block-button__link {
	min-height: 60px;
	box-shadow: none;
	font-size: 15px;
	cursor: pointer;
}

/* ---------- Live status ---------- */

/* live.js adds fr-has-status to whatever holds {status}, and sets data-fr-server on <html>. */
.fr-has-status::before {
	content: "";
	display: inline-block;
	width: 10px;
	height: 10px;
	margin-right: 8px;
	vertical-align: 0.02em;
	background: #5b6b78;
}

html[data-fr-server="online"] .fr-has-status::before {
	background: #6fbf73;
}

html[data-fr-server="offline"] .fr-has-status::before {
	background: #e08a98;
}

.fr-discord-count::before {
	content: "";
	display: inline-block;
	width: 10px;
	height: 10px;
	margin-right: 8px;
	vertical-align: 0.02em;
	background: #6fbf73;
}

.wp-block-table.fr-status-table {
	margin: 0;
}

.wp-block-table.fr-status-table table {
	border-collapse: collapse;
	width: 100%;
}

.wp-block-table.fr-status-table td {
	border: 0;
	border-bottom: 2px solid var(--wp--preset--color--line);
	padding: 14px 0;
	vertical-align: top;
}

.wp-block-table.fr-status-table tr:last-child td {
	border-bottom: 0;
}

.wp-block-table.fr-status-table td:first-child {
	color: var(--wp--preset--color--contrast-3);
	padding-right: 16px;
}

.wp-block-table.fr-status-table td:last-child {
	text-align: right;
	overflow-wrap: anywhere;
}

/* ---------- Staff ---------- */

.wp-block-image.fr-avatar {
	flex: 0 0 72px;
	margin: 0;
}

.wp-block-image.fr-avatar img {
	display: block;
	box-sizing: border-box;
	background: var(--wp--preset--color--line);
	border: 2px solid var(--wp--preset--color--accent);
	image-rendering: pixelated;
}

/* ---------- News ---------- */

.wp-block-categories.fr-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0;
	margin: 0;
	list-style: none;
	font-family: var(--wp--preset--font-family--pixel);
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.wp-block-categories.fr-chips li {
	margin: 0;
}

.wp-block-categories.fr-chips a {
	display: inline-block;
	padding: 8px 12px;
	border: 2px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--surface);
	text-decoration: none;
}

.wp-block-categories.fr-chips a:hover,
.wp-block-categories.fr-chips .current-cat a {
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent-2);
}

.wp-block-post-featured-image img {
	display: block;
}

.wp-block-query-pagination a {
	text-decoration: none;
}

.wp-block-query-pagination .page-numbers.current {
	color: var(--wp--preset--color--accent);
}

/* ---------- Articles ---------- */

/* Inside a post the headings step down, so patch notes read as a list rather than a poster. */
.wp-block-post-content h2 {
	font-size: clamp(28px, 4vw, 36px);
	margin-top: 1.4em;
}

.wp-block-post-content h3 {
	font-size: 24px;
	margin-top: 1.3em;
}

.wp-block-post-content a {
	text-decoration-color: var(--wp--preset--color--accent);
	text-underline-offset: 0.15em;
}

.wp-block-post-content :where(ul, ol) li + li {
	margin-top: 6px;
}

.wp-block-post-content :where(table) {
	border-collapse: collapse;
}

.wp-block-post-content :where(th, td) {
	border: 2px solid var(--wp--preset--color--line);
	padding: 10px 12px;
}

:where(code, kbd) {
	font-size: 0.9em;
}

/* ---------- Forms: search and comments ---------- */

:where(input[type="text"], input[type="email"], input[type="url"], input[type="search"], input[type="password"], textarea, select) {
	box-sizing: border-box;
	max-width: 100%;
	padding: 12px 14px;
	background: var(--wp--preset--color--base-3);
	color: var(--wp--preset--color--contrast);
	border: 2px solid var(--wp--preset--color--line);
	border-radius: 0;
	font: inherit;
}

:where(input[type="text"], input[type="email"], input[type="url"], input[type="search"], input[type="password"], textarea, select):focus {
	border-color: var(--wp--preset--color--accent);
}

.wp-block-search__input {
	border: 2px solid var(--wp--preset--color--line);
}

.wp-block-search .wp-block-search__button {
	margin-left: 0;
}

.wp-block-post-comments-form .comment-reply-title {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
}

.wp-block-post-comments-form :where(label) {
	color: var(--wp--preset--color--contrast-2);
	font-size: var(--wp--preset--font-size--small);
}

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

.fr-footer-brand {
	flex: 1 1 280px;
	max-width: 460px;
	min-width: 0;
}
