/*
Theme Name: Blockfive
Theme URI: https://blockfive.one/
Author: Florian Koller
Author URI: https://blockfive.one/about/
Description: Block theme for BLOCKFIVE.ONE – blockchain and DLT training from Munich. Full Site Editing, self-hosted fonts (no Google Fonts requests), page patterns for Home, Academy, About and Contact.
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: blockfive
*/

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

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

:where(a, button, input, textarea, select, .wp-element-button):focus-visible {
	outline: 2px solid var(--wp--preset--color--brand-deep);
	outline-offset: 3px;
	border-radius: 2px;
}

.skip-link.screen-reader-text:focus { background: var(--wp--preset--color--paper); color: var(--wp--preset--color--ink); }

/* Readable measure for running text */
.b5-measure { max-width: 64ch; }

/* ---------- Header ---------- */
.b5-header { border-top: 4px solid var(--wp--preset--color--brand); border-bottom: 1px solid var(--wp--preset--color--line); }
.b5-header .b5-logo { margin: 0; }
.b5-header .b5-logo img { display: block; height: auto; }
.b5-header .wp-block-navigation a:hover { color: var(--wp--preset--color--brand-deep); }
.b5-header .wp-block-navigation .current-menu-item > a,
.b5-header .wp-block-navigation a[aria-current="page"] {
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 6px;
	text-decoration-color: var(--wp--preset--color--brand-deep);
}

/* ---------- The chain (signature element) ---------- */
.b5-chain {
	display: grid !important;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 0 2.25rem !important;
	position: relative;
}
.b5-chain > .b5-block {
	position: relative;
	margin: 0 !important;
	background: var(--wp--preset--color--paper);
	border: 1.5px solid var(--wp--preset--color--ink);
	padding: 1.25rem 1.1rem 1.4rem !important;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	min-height: 15rem;
}
/* the link between blocks */
.b5-chain > .b5-block + .b5-block::before {
	content: "";
	position: absolute;
	left: calc(-2.25rem - 1.5px);
	top: 50%;
	width: 2.25rem;
	border-top: 1.5px solid var(--wp--preset--color--ink);
}
.b5-chain > .b5-block + .b5-block::after {
	content: "";
	position: absolute;
	left: -6px;
	top: calc(50% - 4.5px);
	width: 9px; height: 9px;
	background: var(--wp--preset--color--brand);
	border-radius: 50%;
}
.b5-chain .b5-hash {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.72rem;
	line-height: 1.5;
	color: var(--wp--preset--color--stone);
	margin: 0 !important;
	word-break: break-all;
}
.b5-chain .b5-hash strong { color: var(--wp--preset--color--brand-deep); font-weight: 500; }
.b5-chain .b5-block h3 { margin: 0.25rem 0 0 !important; }
.b5-chain .b5-block h3 a { text-decoration: none; color: inherit; }
.b5-chain .b5-block h3 a:hover { color: var(--wp--preset--color--brand-deep); }
.b5-chain .b5-block .b5-meta { margin-top: auto !important; font-size: 0.85rem; color: var(--wp--preset--color--stone); }
.b5-chain .b5-block:hover { border-color: var(--wp--preset--color--brand); box-shadow: inset 0 -4px 0 var(--wp--preset--color--brand); }

/* One deliberate moment: the chain links up on load */
@media (prefers-reduced-motion: no-preference) {
	.b5-chain > .b5-block { animation: b5-mine 0.5s cubic-bezier(.2,.7,.2,1) both; }
	.b5-chain > .b5-block:nth-child(2) { animation-delay: 0.12s; }
	.b5-chain > .b5-block:nth-child(3) { animation-delay: 0.24s; }
	.b5-chain > .b5-block:nth-child(4) { animation-delay: 0.36s; }
	.b5-chain > .b5-block:nth-child(5) { animation-delay: 0.48s; }
	@keyframes b5-mine {
		from { opacity: 0; transform: translateY(10px); }
		to   { opacity: 1; transform: none; }
	}
}

@media (max-width: 1080px) {
	.b5-chain { grid-template-columns: 1fr; gap: 1.75rem 0 !important; }
	.b5-chain > .b5-block { min-height: 0; }
	.b5-chain > .b5-block + .b5-block::before {
		left: 2rem; top: calc(-1.75rem - 1.5px);
		width: 0; height: 1.75rem;
		border-top: 0; border-left: 1.5px solid var(--wp--preset--color--ink);
	}
	.b5-chain > .b5-block + .b5-block::after { left: calc(2rem - 4px); top: -6px; }
}

/* ---------- Course entries on the Academy page ---------- */
.b5-course { border-top: 1.5px solid var(--wp--preset--color--ink); }
.b5-course .b5-hash { font-family: var(--wp--preset--font-family--mono); font-size: 0.78rem; color: var(--wp--preset--color--stone); }
.b5-course ul { padding-left: 1.1em; }
.b5-course li { margin-bottom: 0.35em; }
.b5-facts { border-left: 3px solid var(--wp--preset--color--brand); padding-left: 1rem !important; }
.b5-facts p { margin: 0 0 0.35rem !important; }

/* ---------- Dark band ---------- */
.b5-dark a:not(.wp-element-button) { color: var(--wp--preset--color--paper); text-decoration: underline; text-decoration-color: var(--wp--preset--color--brand); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.b5-dark a:not(.wp-element-button):hover { text-decoration-color: var(--wp--preset--color--paper); }
.b5-dark .wp-block-button.is-style-outline .wp-element-button { color: var(--wp--preset--color--paper); border-color: var(--wp--preset--color--paper); }

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

/* ---------- Forms (Contact Form 7 / WPForms / Fluent Forms) ---------- */
.b5-form input[type="text"], .b5-form input[type="email"], .b5-form input[type="tel"], .b5-form textarea, .b5-form select {
	width: 100%;
	padding: 0.7rem 0.8rem;
	border: 1.5px solid var(--wp--preset--color--ink);
	background: var(--wp--preset--color--paper);
	font: inherit;
	color: inherit;
	border-radius: 0;
}
.b5-form input[type="submit"], .b5-form button[type="submit"] {
	background: var(--wp--preset--color--brand-deep);
	color: var(--wp--preset--color--paper);
	border: 0;
	padding: 0.8rem 1.5rem;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.b5-form input[type="submit"]:hover, .b5-form button[type="submit"]:hover { background: var(--wp--preset--color--ink); }

/* Footer logo */
.b5-footer .b5-logo { margin: 0 0 1rem; }
.b5-footer .b5-logo img { display: block; height: auto; }
