/*
Theme Name: The Flash Hub
Theme URI: https://theflash-uk.gg
Author: TheFlash
Description: Dark glass community hub for The Flash UK network (The Flash, LSC-RP, Crown Island, Flash Layer Studio).
Version: 1.2.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: theflash-hub
*/

:root {
	--tf-bg: #0A0B0D;
	--tf-panel: rgba(23, 26, 31, 0.78);
	--tf-panel-solid: #171A1F;
	--tf-glass: #1F2329;
	--tf-line: rgba(255, 255, 255, 0.07);
	--tf-text: #F4F6F8;
	--tf-muted: #AEB4BC;
	--tf-faint: #8B929B;
	--tf-accent: #E6ECF2;
	--tf-flash: #E6ECF2;
	--tf-lsc: #9D7AB8;
	--tf-crown: #7FA35B;
	--tf-studio: #FA6703;
	--tf-uk: #C492FA;
	--tf-live: #EF4444;
	--tf-radius: 16px;
	--tf-wrap: 1280px;
	--tf-head: "Montserrat", system-ui, sans-serif;
	--tf-body: "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--tf-bg);
	color: var(--tf-text);
	font-family: var(--tf-body);
	font-size: 16px;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--tf-text); }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--tf-accent); outline-offset: 3px; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
	position: fixed; top: 8px; left: 8px; z-index: 100; width: auto; height: auto; clip: auto;
	padding: 10px 16px; background: var(--tf-accent); color: var(--tf-bg); border-radius: 8px;
}
.tf-wrap { max-width: var(--tf-wrap); margin: 0 auto; padding: 0 32px; }
.tf-panel {
	background: var(--tf-panel);
	border: 1px solid var(--tf-line);
	border-radius: var(--tf-radius);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
}
.tf-heading {
	font-family: var(--tf-head); font-weight: 800; text-transform: uppercase;
	letter-spacing: 0.03em; line-height: 1.1;
}

/* ---------- Header ---------- */
.tf-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(10, 11, 13, 0.85);
	backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
	border-bottom: 1px solid var(--tf-line);
}
.admin-bar .tf-header { top: 32px; }
.tf-header__inner { display: flex; align-items: center; gap: 28px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.tf-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--tf-text); }
.tf-brand img { width: 52px; height: 52px; object-fit: contain; }
.tf-brand span { font-family: var(--tf-head); font-weight: 800; font-size: 18px; letter-spacing: 0.04em; }
.tf-brand em { font-style: normal; color: var(--tf-uk); }
.tf-nav { flex-grow: 1; }
.tf-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 24px; flex-wrap: wrap; }
.tf-nav a { color: #C9CED4; text-decoration: none; font-weight: 500; font-size: 15px; padding-bottom: 4px; border-bottom: 2px solid transparent; }
.tf-nav a:hover { color: var(--tf-text); }
.tf-nav .current-menu-item > a, .tf-nav .current_page_item > a { color: var(--tf-text); font-weight: 600; border-bottom-color: var(--tf-accent); }
.tf-header__actions { display: flex; gap: 12px; align-items: center; }
.tf-live {
	display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
	background: rgba(239, 68, 68, 0.14); border: 1px solid rgba(239, 68, 68, 0.5);
	color: #FCA5A5; font-weight: 700; font-size: 13px; letter-spacing: 0.05em; text-decoration: none;
}
.tf-live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tf-live); animation: tf-pulse 1.6s infinite; }
@keyframes tf-pulse { 50% { opacity: 0.35; } }
.tf-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 12px 24px; border-radius: 12px;
	font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; border: 0;
	transition: transform .15s ease, filter .15s ease;
}
.tf-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.tf-btn--accent { background: var(--tf-accent); color: var(--tf-bg); }
.tf-btn--accent:hover { color: var(--tf-bg); }
.tf-btn--ghost { border: 1px solid var(--tf-accent); color: var(--tf-text); background: rgba(10, 11, 13, 0.4); }
.tf-btn--discord { background: #5865F2; color: #fff; padding: 10px 16px; font-size: 14px; font-weight: 600; }
.tf-btn--discord:hover { color: #fff; }
.tf-menu-toggle { display: none; background: none; border: 1px solid var(--tf-line); color: var(--tf-text); border-radius: 10px; min-width: 44px; min-height: 44px; }

/* ---------- Hero ---------- */
.tf-hero {
	background-size: cover; background-position: center right;
	padding: 150px 0 160px;
}
.tf-hero__eyebrow { font-size: 14px; font-weight: 600; letter-spacing: 0.25em; color: #C9CED4; margin: 0 0 22px; }
.tf-hero h1 { margin: 0; font-family: var(--tf-head); font-weight: 900; font-size: clamp(48px, 7vw, 84px); line-height: 0.95; letter-spacing: 0.01em; }
.tf-hero h1 em { font-style: normal; color: var(--tf-uk); }
.tf-hero__lead { max-width: 520px; font-size: 19px; color: #C9CED4; margin: 22px 0 30px; }
.tf-hero__buttons { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Sections ---------- */
.tf-main { padding-bottom: 80px; }
.tf-section { margin-top: 72px; }
.tf-section__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.tf-section__head h2 { margin: 0; font-size: 30px; }
.tf-section__head h2::after { content: ""; display: block; width: 56px; height: 3px; border-radius: 2px; background: var(--tf-accent); margin-top: 10px; }
.tf-section__head p { margin: 12px 0 0; color: var(--tf-muted); }
.tf-more { color: var(--tf-accent); font-weight: 600; text-decoration: none; }
.tf-more:hover { color: var(--tf-accent); text-decoration: underline; }

/* Network cards */
.tf-network { margin-top: -60px; position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.tf-site { overflow: hidden; display: flex; flex-direction: column; --c: var(--tf-accent); }
.tf-site img { width: 100%; height: 150px; object-fit: cover; }
.tf-site__bar { height: 3px; background: var(--c); }
.tf-site__body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex-grow: 1; }
.tf-site h3 { margin: 0; font-size: 18px; }
.tf-site p { margin: 0; color: var(--tf-muted); font-size: 14px; flex-grow: 1; }
.tf-site__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.tf-site__status { color: var(--c); font-size: 13px; }
.tf-site__foot a { color: var(--c); text-decoration: none; }
.tf-site__foot a:hover { text-decoration: underline; }
.tf-c-flash { --c: var(--tf-accent); } .tf-c-lsc { --c: var(--tf-lsc); } .tf-c-crown { --c: var(--tf-crown); } .tf-c-studio { --c: var(--tf-studio); }

/* Chips */
.tf-chip {
	display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
	letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none;
	color: var(--c, var(--tf-text)); background: rgba(255,255,255,0.06);
	border: 1px solid color-mix(in srgb, var(--c, #fff) 40%, transparent);
}
.tf-chips { display: flex; gap: 8px; flex-wrap: wrap; }

/* Posts */
.tf-news { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.tf-news__side { display: flex; flex-direction: column; gap: 20px; }
.tf-post { overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: border-color .15s ease; }
.tf-post:hover { border-color: rgba(255,255,255,0.18); color: inherit; }
.tf-post__img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--tf-glass); }
.tf-post__body { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.tf-post h3 { margin: 0; font-family: var(--tf-head); font-weight: 700; font-size: 17px; line-height: 1.3; text-transform: none; letter-spacing: 0; }
.tf-post--big .tf-post__body { padding: 24px; gap: 12px; }
.tf-post--big h3 { font-size: 26px; font-weight: 800; }
.tf-post p { margin: 0; color: var(--tf-muted); font-size: 15px; }
.tf-date { font-size: 13px; color: var(--tf-faint); }
.tf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.tf-video .tf-post__media { position: relative; }
.tf-video .tf-post__media::after {
	content: ""; position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%;
	background: rgba(10,11,13,0.75) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6v12l10-6z' fill='%23F4F6F8'/%3E%3C/svg%3E") center / 24px no-repeat;
	border: 1px solid rgba(255,255,255,0.25);
}
.tf-empty { color: var(--tf-faint); padding: 28px; text-align: center; }

/* Forum list */
.tf-threads { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.tf-threads li { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--tf-line); }
.tf-threads li:first-child { border-top: 0; }
.tf-threads a { flex-grow: 1; font-weight: 600; text-decoration: none; }
.tf-threads .tf-date { white-space: nowrap; }

/* ---------- Single post ---------- */
.tf-article { max-width: 860px; margin: 48px auto 0; }
.tf-article__head { margin-bottom: 28px; }
.tf-article__head h1 { font-size: clamp(32px, 4.5vw, 48px); margin: 16px 0 12px; text-transform: none; letter-spacing: 0; }
.tf-article__hero { border-radius: var(--tf-radius); overflow: hidden; margin-bottom: 32px; }
.tf-article__hero img { width: 100%; }
.tf-content { font-size: 17px; line-height: 1.75; color: #DADDE1; }
.tf-content h2, .tf-content h3 { font-family: var(--tf-head); color: var(--tf-text); line-height: 1.2; margin: 2em 0 0.6em; }
.tf-content a { color: var(--tf-accent); }
.tf-content img, .tf-content iframe { border-radius: 12px; }
.tf-content figure { margin: 2em 0; }
.tf-content .wp-block-embed__wrapper iframe { width: 100%; }
.tf-content blockquote { border-left: 3px solid var(--tf-accent); margin: 2em 0; padding: 4px 0 4px 20px; color: var(--tf-muted); }
.tf-content code { background: var(--tf-glass); padding: 2px 6px; border-radius: 6px; }

/* Template blocks (used by post templates) */
.tf-box { background: var(--tf-panel-solid); border: 1px solid var(--tf-line); border-radius: var(--tf-radius); padding: 24px 28px; margin: 2em 0; }
.tf-box > :first-child { margin-top: 0; }
.tf-box > :last-child { margin-bottom: 0; }
.tf-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.tf-facts p { margin: 0; }
.tf-facts strong { display: block; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tf-faint); font-weight: 600; }
.tf-version { display: inline-block; font-family: var(--tf-head); font-weight: 800; color: var(--tf-bg); background: var(--tf-accent); border-radius: 8px; padding: 4px 12px; }
.tf-list-new li::marker { color: #22C55E; }
.tf-list-fixed li::marker { color: #F59E0B; }
.tf-list-removed li::marker { color: #EF4444; }
.tf-announce { border-color: var(--tf-accent); }
.tf-announce p:first-child { font-size: 22px; font-weight: 700; color: var(--tf-text); }
.wp-block-button__link { border-radius: 12px !important; font-weight: 700; }
.tf-content .wp-block-button__link { background: var(--tf-accent); color: var(--tf-bg); text-decoration: none; }

/* Comments */
.tf-comments { max-width: 860px; margin: 56px auto 0; }
.tf-comments textarea, .tf-comments input[type=text], .tf-comments input[type=email], .tf-comments input[type=url] {
	width: 100%; background: var(--tf-glass); border: 1px solid var(--tf-line); color: var(--tf-text); border-radius: 10px; padding: 12px; font: inherit;
}
.tf-comments .submit { background: var(--tf-accent); color: var(--tf-bg); border: 0; border-radius: 12px; padding: 12px 24px; font-weight: 700; cursor: pointer; }

/* Archive */
.tf-page-head { padding: 64px 0 8px; }
.tf-page-head h1 { margin: 0; font-size: 40px; }
.tf-page-head p { color: var(--tf-muted); margin: 10px 0 0; }
.tf-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 24px 0 0; }
.tf-pagination { margin-top: 40px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.tf-pagination .page-numbers { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; border: 1px solid var(--tf-line); text-decoration: none; padding: 0 12px; }
.tf-pagination .current { background: var(--tf-accent); color: var(--tf-bg); border-color: var(--tf-accent); }

/* ---------- Footer ---------- */
.tf-footer { border-top: 1px solid var(--tf-line); background: #08090B; margin-top: 40px; }
.tf-footer__inner { display: flex; gap: 48px; flex-wrap: wrap; justify-content: space-between; padding-top: 48px; padding-bottom: 48px; }
.tf-footer__brand { display: flex; align-items: center; gap: 14px; }
.tf-footer__brand img { width: 64px; height: 64px; object-fit: contain; }
.tf-footer__brand p { margin: 0; }
.tf-footer__brand p + p { color: var(--tf-faint); font-size: 14px; margin-top: 4px; }
.tf-footer nav { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.tf-footer nav span { color: var(--tf-faint); font-weight: 600; letter-spacing: 0.08em; font-size: 12px; text-transform: uppercase; }
.tf-footer nav a { text-decoration: none; }
.tf-footer nav a:hover { text-decoration: underline; }
.tf-footer__base { border-top: 1px solid var(--tf-line); padding: 18px 0; color: var(--tf-faint); font-size: 13px; }

/* ---------- Phones ---------- */
@media (max-width: 860px) {
	.tf-menu-toggle { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; }
	.tf-nav { display: none; flex-basis: 100%; }
	.tf-nav.is-open { display: block; }
	.tf-nav ul { flex-direction: column; gap: 4px; }
	.tf-nav a { display: block; padding: 10px 0; }
	.tf-header__actions { flex-basis: 100%; }
	.tf-hero { padding: 90px 0 120px; background-position: 70% center; }
	.tf-wrap { padding: 0 20px; }
	.tf-threads li { flex-wrap: wrap; gap: 8px; }
}

/* Template markers: invisible, they only tell the site which ticks to pre-set. */
[class*="tf-tpl-"] { display: none !important; }

/* Footer legal links */
.tf-footer__legal { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
.tf-footer__legal a { color: var(--tf-faint); text-decoration: none; }
.tf-footer__legal a:hover { color: var(--tf-text); text-decoration: underline; }

/* Phones: compact header, readable hero */
@media (max-width: 860px) {
	.tf-brand { order: 0; }
	.tf-header__actions { order: 2; flex-basis: auto; margin-left: auto; }
	.tf-menu-toggle { order: 3; margin-left: 0; }
	.tf-nav { order: 4; }
	.tf-header__inner { gap: 12px; }
	.tf-header__actions .tf-btn--discord { display: none; }
	.tf-nav.is-open ~ .tf-header__actions { order: 5; flex-basis: 100%; padding-bottom: 8px; }
	.tf-nav.is-open ~ .tf-header__actions .tf-btn--discord { display: inline-flex; }
	.tf-brand img { width: 44px; height: 44px; }
	.tf-hero { position: relative; }
	.tf-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,11,13,0.55) 0%, rgba(10,11,13,0.7) 60%, rgba(10,11,13,0.9) 100%); }
	.tf-hero > .tf-wrap { position: relative; }
	.tf-nav .current-menu-item > a { border-bottom: 0; color: var(--tf-accent); }
}

/* =====================================================================
   v1.1 Fluid layout: fills any screen, tuned for phone / tablet /
   laptop / big monitor. Long reading (posts) stays at a readable width.
   ===================================================================== */
.tf-wrap { max-width: none; width: 92%; padding: 0; margin: 0 auto; }
@media (min-width: 2200px) { .tf-wrap { width: 88%; } }
.tf-header__inner { padding-top: 10px; padding-bottom: 10px; }

/* Banner: shorter, centred, right-sized image per screen */
.tf-hero {
	position: relative; display: flex; align-items: center; text-align: center;
	background: #0A0B0D url("assets/img/hero-1600.webp") center / cover no-repeat;
	min-height: clamp(340px, 46vh, 560px);
	padding: clamp(48px, 7vh, 96px) 0 clamp(72px, 10vh, 120px);
}
.tf-hero::before {
	content: ""; position: absolute; inset: 0;
	background:
		radial-gradient(ellipse 70% 80% at 50% 50%, rgba(10,11,13,0.62), rgba(10,11,13,0.18) 70%),
		linear-gradient(180deg, rgba(10,11,13,0) 62%, #0A0B0D 100%);
}
.tf-hero > .tf-wrap { position: relative; width: min(92%, 1000px); }
.tf-hero__eyebrow { font-size: clamp(12px, 0.75vw, 17px); margin-bottom: clamp(12px, 1.4vw, 22px); }
.tf-hero h1 { font-size: clamp(40px, 4.6vw, 104px); }
.tf-hero__lead { font-size: clamp(16px, 1.05vw, 22px); max-width: 42ch; margin: clamp(14px, 1.4vw, 24px) auto clamp(18px, 1.8vw, 30px); }
.tf-hero__buttons { justify-content: center; }

/* Network cards: compact, so the page clearly carries on below */
.tf-network { margin-top: clamp(-56px, -3vw, -28px); grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.2vw, 28px); }
.tf-site img { height: clamp(96px, 7.5vw, 170px); }
.tf-site__body { padding: clamp(12px, 1vw, 20px); gap: 6px; }
.tf-site h3 { font-size: clamp(14px, 0.95vw, 19px); }
.tf-site p { font-size: clamp(13px, 0.8vw, 15px); }
.tf-section { margin-top: clamp(40px, 4vw, 80px); }
.tf-section__head h2 { font-size: clamp(24px, 1.7vw, 40px); }

/* Big monitors */
@media (min-width: 1800px) {
	.tf-hero { background-image: url("assets/img/hero-2560.webp"); min-height: clamp(420px, 44vh, 640px); }
	.tf-post--big h3 { font-size: 30px; }
	.tf-post h3 { font-size: 19px; }
	body { font-size: 17px; }
}

/* Tablets */
@media (min-width: 700px) and (max-width: 1099px) {
	.tf-network { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.tf-news { grid-template-columns: 1fr; }
}

/* Phones */
@media (max-width: 699px) {
	.tf-hero { background-image: url("assets/img/hero-900.webp"); min-height: 0; padding: 56px 0 72px; background-position: 60% center; }
	.tf-hero::before {
		background:
			linear-gradient(180deg, rgba(10,11,13,0.55) 0%, rgba(10,11,13,0.72) 70%, #0A0B0D 100%);
	}
	.tf-network { grid-template-columns: 1fr; margin-top: -24px; gap: 10px; }
	.tf-site { display: grid; grid-template-columns: 104px 1fr; }
	.tf-site img { height: 100%; min-height: 96px; }
	.tf-site__bar { display: none; }
	.tf-site { border-left: 3px solid var(--c); }
	.tf-site p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
	.tf-news { grid-template-columns: 1fr; }
}
