/*
Theme Name: Fyucha FC
Theme URI: https://fyuchafc.com/
Author: Fyucha FC
Description: A dark block theme for a football blog in the Fyucha FC brand colours: navy blue, white, shamrock green and chlorine blue. The homepage leads with a featured story, then a pitch-styled panel of football tools, then the latest posts.
Version: 1.1.0
Requires at least: 6.6
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: fyucha
Tags: blog, news, block-patterns, full-site-editing, one-column, wide-blocks, featured-images, translation-ready
*/

:root {
	--fy-chalk: var(--wp--preset--color--contrast);
	--fy-hair: 1px solid var(--wp--preset--color--line);
	--fy-stripe-a: #12cc64;
	--fy-stripe-b: #10bd5c;
	--fy-chalk-faint: rgba(255, 255, 255, 0.6);
}

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

:focus-visible {
	outline: 3px solid var(--wp--preset--color--sky);
	outline-offset: 3px;
}

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

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

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

.fy-header {
	border-bottom: var(--fy-hair);
	padding-block: 0.9rem;
}

.fy-header .wp-block-site-title a {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}

.fy-header .wp-block-navigation a:hover,
.fy-header .wp-block-navigation a:focus-visible {
	color: var(--wp--preset--color--sky);
	text-decoration: underline;
	text-underline-offset: 0.3em;
}

.wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

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

.fy-main {
	padding-block: clamp(2rem, 5vw, 4rem);
}

.wp-block-group.fy-front > * + * {
	margin-block-start: clamp(3rem, 6vw, 5rem);
}

.fy-intro {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 600;
	line-height: 1.3;
	max-width: 40ch;
}

.wp-block-group.fy-front > .fy-intro + * {
	margin-block-start: 1.5rem;
}

.fy-section-title {
	border-bottom: 2px solid var(--fy-chalk);
	padding-bottom: 0.5rem;
	margin-bottom: 1.75rem;
}

/* ---------- Shared post pieces ---------- */

.wp-block-post-title a {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}

.wp-block-post-title a:hover,
.wp-block-post-title a:focus-visible {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--accent);
	text-decoration-thickness: 0.09em;
	text-underline-offset: 0.14em;
}

.wp-block-post-featured-image img {
	display: block;
	width: 100%;
	object-fit: cover;
}

/* Category links are small green labels. */
.wp-block-post-terms a {
	display: inline-block;
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
	font-size: 0.78rem;
	font-weight: 700;
	line-height: 1;
	padding: 0.32em 0.55em;
	border-radius: 2px;
	text-decoration: none;
	margin: 0 0.3rem 0.3rem 0;
}

.wp-block-post-terms a:hover,
.wp-block-post-terms a:focus-visible {
	background: var(--wp--preset--color--contrast);
}

.wp-block-post-terms .wp-block-post-terms__separator {
	display: none;
}

.wp-block-post-date,
.fy-meta {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

.wp-block-post-date a {
	color: inherit;
	text-decoration: none;
}

/* ---------- Homepage: lead story and more stories ---------- */

.fy-lead {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
	gap: clamp(1.5rem, 4vw, 3.5rem);
	align-items: start;
}

.wp-block-group.fy-lead > * {
	margin-block-start: 0;
}

.fy-lead .wp-block-post-template {
	list-style: none;
	margin: 0;
	padding: 0;
}

.fy-lead-story .wp-block-post-title {
	font-size: clamp(2.1rem, 1.1rem + 4vw, 4.25rem);
	line-height: 0.98;
	margin: 0.9rem 0 0.8rem;
	text-wrap: balance;
}

.fy-lead-story .wp-block-post-featured-image {
	margin-bottom: 1.1rem;
}

.fy-lead-story .wp-block-post-excerpt {
	max-width: 62ch;
	color: var(--wp--preset--color--muted);
}

.fy-lead-story .wp-block-post-excerpt__excerpt {
	margin: 0 0 0.6rem;
}

.fy-more {
	border-left: var(--fy-hair);
	padding-left: clamp(1.25rem, 2.5vw, 2rem);
}

.fy-more h2 {
	font-size: var(--wp--preset--font-size--large);
	margin: 0 0 1.25rem;
}

.fy-more .wp-block-post-template > li + li {
	border-top: var(--fy-hair);
	margin-block-start: 1.1rem;
	padding-top: 1.1rem;
}

.fy-more .wp-block-post-title {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.12;
	margin: 0.35rem 0 0.4rem;
}

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

	.fy-more {
		border-left: 0;
		border-top: var(--fy-hair);
		padding-left: 0;
		padding-top: 1.5rem;
	}
}

/* ---------- Homepage: the pitch (football tools) ---------- */

.fy-pitch {
	position: relative;
	overflow: hidden;
	border: 2px solid var(--fy-chalk);
	padding: clamp(1.25rem, 3vw, 2.5rem);
	background: repeating-linear-gradient(
		90deg,
		var(--fy-stripe-a) 0 9%,
		var(--fy-stripe-b) 9% 18%
	);
}

/* Halfway line and centre circle, drawn in chalk. */
.fy-pitch::before,
.fy-pitch::after {
	content: "";
	position: absolute;
	pointer-events: none;
}

.fy-pitch::before {
	top: 0;
	bottom: 0;
	left: 50%;
	border-left: 2px solid var(--fy-chalk-faint);
}

.fy-pitch::after {
	left: 50%;
	top: 50%;
	width: min(42vw, 320px);
	aspect-ratio: 1;
	transform: translate(-50%, -50%);
	border: 2px solid var(--fy-chalk-faint);
	border-radius: 50%;
}

.fy-pitch > * {
	position: relative;
	z-index: 1;
}

.fy-pitch-title {
	color: var(--wp--preset--color--base);
	margin: 0 0 1.25rem;
}

.fy-tools {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
	gap: 1rem;
}

.wp-block-group.fy-tools > * {
	margin-block-start: 0;
}

.fy-tool {
	position: relative;
	background: var(--wp--preset--color--base);
	border-top: 4px solid var(--wp--preset--color--contrast);
	padding: 1.1rem 1.2rem 1.3rem;
	transition: background-color 120ms ease, color 120ms ease;
}

.fy-tool h3 {
	font-size: var(--wp--preset--font-size--large);
	margin: 0;
}

.fy-tool h3 a {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}

/* The whole tile is the link target. */
.fy-tool h3 a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.fy-tool p {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.45;
	margin: 0.45rem 0 0;
}

.fy-tool:hover,
.fy-tool:focus-within {
	background: var(--wp--preset--color--contrast);
}

.fy-tool:hover h3 a,
.fy-tool:focus-within h3 a,
.fy-tool:hover p,
.fy-tool:focus-within p {
	color: var(--wp--preset--color--base);
}

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

.fy-grid .wp-block-post-template {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
	gap: 2.5rem 2rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.fy-grid .wp-block-post-template > li {
	border-top: var(--fy-hair);
	margin-block-start: 0;
	padding-top: 1rem;
}

.fy-grid .wp-block-post-featured-image {
	margin-bottom: 0.9rem;
}

.fy-grid .wp-block-post-title {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.12;
	margin: 0.3rem 0 0.45rem;
}

.wp-block-query-pagination {
	border-top: var(--fy-hair);
	margin-top: 2.5rem;
	padding-top: 1.25rem;
	font-weight: 600;
}

.wp-block-query-pagination a {
	color: var(--wp--preset--color--contrast);
}

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

/* ---------- Competition links ---------- */

.fy-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.fy-chips a {
	display: inline-block;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 999px;
	color: var(--wp--preset--color--contrast);
	padding: 0.4rem 0.95rem;
	text-decoration: none;
}

.fy-chips a:hover,
.fy-chips a:focus-visible {
	border-color: var(--wp--preset--color--sky);
	color: var(--wp--preset--color--sky);
}

/* ---------- Single post and pages ---------- */

.fy-article-head .wp-block-post-title {
	margin: 0.8rem 0 1rem;
	text-wrap: balance;
}

.fy-byline {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	gap: 0.4rem 1.1rem;
}

.fy-byline .wp-block-post-author-name {
	color: var(--wp--preset--color--contrast);
	font-weight: 600;
}

.wp-block-post-content a {
	text-decoration-color: var(--wp--preset--color--sky);
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.18em;
}

.wp-block-post-content h2 {
	margin-top: 2.5rem;
}

.wp-block-post-content table {
	border-collapse: collapse;
	width: 100%;
	font-size: var(--wp--preset--font-size--small);
	font-variant-numeric: tabular-nums;
}

.wp-block-post-content th,
.wp-block-post-content td {
	border: var(--fy-hair);
	padding: 0.55rem 0.7rem;
	text-align: left;
}

.wp-block-post-content th,
.wp-block-post-content thead td {
	background: var(--wp--preset--color--surface);
	font-weight: 700;
}

.wp-block-table {
	overflow-x: auto;
}

.fy-post-nav {
	border-top: var(--fy-hair);
	margin-top: 3rem;
	padding-top: 1.25rem;
	font-weight: 600;
}

.fy-post-nav a {
	color: var(--wp--preset--color--contrast);
}

/* ---------- Comments ---------- */

.fy-comments {
	border-top: 2px solid var(--fy-chalk);
	margin-top: 3rem;
	padding-top: 1.5rem;
}

.fy-comments .wp-block-comment-template {
	list-style: none;
	padding: 0;
}

.fy-comments .wp-block-comment-template li {
	border-bottom: var(--fy-hair);
	padding-block: 1rem;
}

.fy-comments .wp-block-comment-date {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

/* ---------- Forms ---------- */

input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
textarea,
.wp-block-search__input {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 2px;
	color: var(--wp--preset--color--contrast);
	font: inherit;
	padding: 0.65rem 0.8rem;
}

textarea {
	width: 100%;
	box-sizing: border-box;
}

input::placeholder,
textarea::placeholder {
	color: var(--wp--preset--color--muted);
}

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

.fy-footer {
	border-top: 2px solid var(--fy-chalk);
	margin-top: clamp(2rem, 5vw, 4rem);
	padding-block: 2rem 3rem;
}

.fy-footer .wp-block-site-title a {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}

.fy-footer-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.5rem;
	list-style: none;
	padding: 0;
}

.fy-footer-links ul {
	display: none;
}

.fy-footer-links a {
	color: var(--wp--preset--color--contrast);
}

.fy-small {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

/* ---------- Motion and print ---------- */

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
		scroll-behavior: auto !important;
	}
}

@media print {
	body {
		background: #fff;
		color: #000;
	}

	.fy-header .wp-block-navigation,
	.fy-footer,
	.fy-pitch,
	.fy-post-nav,
	.fy-comments {
		display: none;
	}

	.wp-block-post-title,
	.wp-block-post-title a,
	h1, h2, h3, h4 {
		color: #000;
	}
}
