/*
Theme Name: Blackthorn Dragon
Theme URI: https://blackthorndragon.com
Author: Blackthorn Dragon
Author URI: https://blackthorndragon.com
Description: Midnight-blue and gold block theme for the Blackthorn Dragon channel. A one-page home base with a link hub, latest videos, about, newsletter and merch sections, all editable in the Site Editor.
Version: 1.0.0
Requires at least: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: blackthorn-dragon
Tags: block-patterns, full-site-editing, one-column, custom-colors, editor-style
*/

/* ---------------------------------------------------------------
   Tokens
   Colors come from theme.json presets; fallbacks keep things safe.
---------------------------------------------------------------- */
:root {
	--bd-midnight: var(--wp--preset--color--midnight, #05070f);
	--bd-navy: var(--wp--preset--color--navy, #0b1430);
	--bd-blue: var(--wp--preset--color--blue, #1e6bff);
	--bd-blue-light: var(--wp--preset--color--blue-light, #7fb0ff);
	--bd-gold: var(--wp--preset--color--gold, #f2b63a);
	--bd-gold-light: var(--wp--preset--color--gold-light, #ffd977);
	--bd-silver: var(--wp--preset--color--silver, #d9dde6);
	--bd-muted: var(--wp--preset--color--muted, #8d96ab);
	--bd-display: var(--wp--preset--font-family--display, Cinzel, Georgia, serif);
	--bd-gold-text: linear-gradient(180deg, #fff4c9 0%, #ffd977 35%, #f2b63a 60%, #b8801b 100%);
	--bd-line: rgba(242, 182, 58, 0.32);
	--bd-gutter: clamp(16px, 4vw, 40px);
	--bd-radius: 18px;
	--bd-header-h: 68px;
}

/* ---------------------------------------------------------------
   Base
---------------------------------------------------------------- */
html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--bd-header-h) + 12px);
}

body {
	margin: 0;
	background-color: var(--bd-midnight);
	background-image:
		radial-gradient(1100px 600px at 10% -5%, rgba(30, 107, 255, 0.16), transparent 60%),
		radial-gradient(900px 520px at 100% 30%, rgba(242, 182, 58, 0.07), transparent 60%),
		radial-gradient(1100px 700px at 40% 105%, rgba(30, 107, 255, 0.14), transparent 60%);
	background-attachment: fixed;
	overflow-x: clip;
	-webkit-font-smoothing: antialiased;
}

::selection {
	background: var(--bd-gold);
	color: var(--bd-midnight);
}

:where(.wp-site-blocks) > *,
.bd-main > * {
	margin-block: 0;
}

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

:focus-visible {
	outline: 2px solid var(--bd-gold);
	outline-offset: 3px;
}

/* Gold metallic headline treatment, matching the logo lettering. */
.bd-gold-text,
.bd-section h2,
.bd-hero h1 {
	background: var(--bd-gold-text);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	filter: drop-shadow(0 2px 14px rgba(242, 182, 58, 0.22));
}

.bd-kicker {
	margin: 0 0 0.6rem;
	font-family: var(--bd-display);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.32em;
	text-transform: uppercase;
	color: var(--bd-blue-light);
}

.bd-kicker::before,
.bd-kicker::after {
	content: "✦";
	margin: 0 0.7em;
	color: var(--bd-gold);
	font-size: 0.8em;
}

/* Left-aligned kickers keep a single leading star. */
.bd-about__text .bd-kicker::after,
.bd-merch .bd-kicker::after {
	content: none;
}

.bd-about__text .bd-kicker::before,
.bd-merch .bd-kicker::before {
	margin-left: 0;
}

.bd-lede {
	color: var(--bd-silver);
	opacity: 0.88;
}

/* ---------------------------------------------------------------
   Buttons (base look lives in theme.json, polish here)
---------------------------------------------------------------- */
.wp-block-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
}

.bd-center,
.wp-block-buttons.bd-center {
	justify-content: center;
	text-align: center;
}

.wp-block-button__link {
	box-shadow: 0 0 0 1px rgba(255, 228, 150, 0.5) inset, 0 8px 28px rgba(242, 182, 58, 0.28);
	transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.wp-block-button__link:hover,
.wp-block-button__link:focus-visible {
	transform: translateY(-2px);
	filter: brightness(1.08);
	box-shadow: 0 0 0 1px rgba(255, 238, 190, 0.8) inset, 0 12px 36px rgba(242, 182, 58, 0.45);
}

.wp-block-button.is-style-outline > .wp-block-button__link,
.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-text-color) {
	background: rgba(11, 20, 48, 0.55);
	color: var(--bd-gold-light);
	border: 1.5px solid var(--bd-line);
	box-shadow: none;
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	border-color: var(--bd-gold);
	color: #fff;
	box-shadow: 0 0 24px rgba(242, 182, 58, 0.25);
}

/* ---------------------------------------------------------------
   Thorn separator (block style registered in functions.php)
---------------------------------------------------------------- */
.wp-block-separator.is-style-thorn {
	position: relative;
	width: 100%;
	max-width: 260px;
	height: 14px;
	margin: 1.6rem auto;
	border: 0;
	opacity: 1;
	background: linear-gradient(90deg, transparent, var(--bd-gold) 30%, var(--bd-gold) 70%, transparent) center / 100% 1px no-repeat;
}

.wp-block-separator.is-style-thorn::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 9px;
	height: 9px;
	background: var(--bd-gold);
	transform: translate(-50%, -50%) rotate(45deg);
	box-shadow: 0 0 12px var(--bd-gold);
}

/* ---------------------------------------------------------------
   Header
---------------------------------------------------------------- */
.bd-site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	border-bottom: 1px solid rgba(242, 182, 58, 0.16);
}

/* The frosted glass lives on a pseudo-element: a backdrop-filter on the
   header itself would trap the full-screen mobile menu inside the bar. */
.bd-site-header::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: rgba(5, 7, 15, 0.78);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
}

@media (min-width: 783px) {
	.admin-bar .bd-site-header {
		top: 32px;
	}
}

.bd-header {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	max-width: 1240px;
	min-height: var(--bd-header-h);
	margin: 0 auto;
	padding: 8px var(--bd-gutter);
}

.bd-brand {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.bd-brand > * {
	margin: 0;
}

.bd-brand__mark,
.bd-brand__mark.wp-block-image {
	flex: none;
	margin: 0;
}

.bd-brand__mark img {
	border-radius: 50%;
	display: block;
	width: 46px;
	height: 46px;
	filter: drop-shadow(0 0 8px rgba(242, 182, 58, 0.4));
	transition: transform 0.3s ease;
}

.bd-brand__mark a:hover img {
	transform: rotate(-6deg) scale(1.06);
}

.bd-brand .wp-block-site-title {
	margin: 0;
	font-family: var(--bd-display);
	font-size: clamp(0.95rem, 2.4vw, 1.15rem);
	font-weight: 700;
	letter-spacing: 0.12em;
	line-height: 1.1;
	text-transform: uppercase;
	white-space: nowrap;
}

.bd-brand .wp-block-site-title a {
	background: var(--bd-gold-text);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	text-decoration: none;
}

.bd-nav .wp-block-navigation-item__content {
	font-family: var(--bd-display);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--bd-silver);
	text-decoration: none;
	transition: color 0.15s ease;
}

.bd-nav .wp-block-navigation-item__content:hover,
.bd-nav .wp-block-navigation-item__content:focus-visible {
	color: var(--bd-gold-light);
}

.bd-nav .wp-block-navigation__container {
	gap: clamp(16px, 2.4vw, 32px);
}

.bd-nav .wp-block-navigation__responsive-container-open,
.bd-nav .wp-block-navigation__responsive-container-close {
	color: var(--bd-gold);
}

.bd-nav .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--bd-midnight) !important;
	color: var(--bd-silver) !important;
	padding: 24px var(--bd-gutter);
}

.bd-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-size: 1.25rem;
	padding: 10px 0;
}

/* ---------------------------------------------------------------
   Sections
---------------------------------------------------------------- */
.bd-section {
	padding: clamp(56px, 9vw, 112px) var(--bd-gutter);
}

.bd-section__head {
	max-width: 660px;
	margin: 0 auto clamp(28px, 4vw, 48px);
	text-align: center;
}

.bd-section__head > * {
	margin-block: 0;
}

.bd-section__head > * + * {
	margin-top: 0.75rem;
}

/* Hero ------------------------------------------------------------ */
.bd-hero {
	position: relative;
	padding: 0 0 clamp(48px, 7vw, 88px);
	text-align: center;
}

.bd-hero__art,
.bd-hero__art.wp-block-image {
	margin: 0;
}

.bd-hero__art img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1893 / 831;
	max-height: 76vh;
	object-fit: cover;
	object-position: center;
	-webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
	mask-image: linear-gradient(to bottom, #000 78%, transparent 100%);
}

/* On phones, crop the wide banner to 4:3 so the emblem stays big and legible. */
@media (max-width: 640px) {
	.bd-hero__art img {
		aspect-ratio: 4 / 3;
	}
}

.bd-hero__content {
	position: relative;
	max-width: 760px;
	margin: clamp(-36px, -3vw, -12px) auto 0;
	padding: 0 var(--bd-gutter);
}

.bd-hero__content > * {
	margin-block: 0;
}

.bd-hero__content > * + * {
	margin-top: 1rem;
}

.bd-hero__content .wp-block-buttons {
	margin-top: 1.75rem;
}

/* Link hub -------------------------------------------------------- */
.bd-linkhub .bd-linkhub__list.wp-block-social-links {
	display: flex;
	flex-direction: column;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 12px;
	max-width: 540px;
	margin: 0 auto;
	padding: 0;
	font-size: 1rem;
}

.bd-linkhub .wp-block-social-links:not(.is-style-logos-only) .wp-social-link {
	display: block;
	width: 100%;
	margin: 0;
	border-radius: 14px;
	background: linear-gradient(180deg, rgba(22, 38, 82, 0.9), rgba(10, 18, 44, 0.9));
	color: var(--bd-silver);
	border: 1px solid var(--bd-line);
	box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
	transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.bd-linkhub .wp-block-social-links .wp-social-link a,
.bd-linkhub .wp-block-social-links .wp-block-social-link-anchor {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: 16px;
	width: 100%;
	padding: 16px 20px;
	color: inherit;
	text-decoration: none;
	font-family: var(--bd-display);
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.2;
}

.bd-linkhub .wp-block-social-links .wp-social-link svg {
	flex: none;
	width: 26px;
	height: 26px;
	color: var(--bd-gold);
	fill: currentColor;
	filter: drop-shadow(0 0 6px rgba(242, 182, 58, 0.35));
}

.bd-linkhub .wp-block-social-links .wp-social-link span.wp-block-social-link-label {
	flex: 1;
	margin: 0;
	padding: 0;
	font-size: 1em;
	color: inherit;
	text-align: left;
}

.bd-linkhub .wp-block-social-links:not(.has-icon-color):not(.has-icon-background-color) .wp-social-link .wp-block-social-link-label {
	color: inherit;
}

/* Core gives Snapchat a black outline and label; keep it on-brand. */
.bd-linkhub .wp-block-social-links .wp-social-link-snapchat,
.bd-footer .wp-block-social-links .wp-social-link-snapchat {
	stroke: none;
}

.bd-linkhub .wp-block-social-links .wp-social-link a::after {
	content: "→";
	color: var(--bd-gold);
	transition: transform 0.18s ease;
}

.bd-linkhub .wp-block-social-links:not(.is-style-logos-only) .wp-social-link:hover {
	transform: translateY(-2px);
	border-color: var(--bd-gold);
	box-shadow: 0 0 0 1px rgba(242, 182, 58, 0.25), 0 10px 30px rgba(242, 182, 58, 0.18);
}

.bd-linkhub .wp-block-social-links .wp-social-link:hover a::after {
	transform: translateX(4px);
}

/* Latest videos --------------------------------------------------- */
.bd-video {
	position: relative;
	max-width: 980px;
	margin: 0 auto;
	aspect-ratio: 16 / 9;
	border-radius: var(--bd-radius);
	overflow: hidden;
	background: radial-gradient(circle at 50% 40%, #13224d, #060a18);
	border: 1px solid var(--bd-line);
	box-shadow: 0 0 0 6px rgba(242, 182, 58, 0.04), 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 70px rgba(30, 107, 255, 0.18);
}

.bd-video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.bd-watch .wp-block-buttons {
	margin-top: clamp(24px, 4vw, 36px);
}

/* About ----------------------------------------------------------- */
.bd-about__cols {
	max-width: 1080px;
	margin: 0 auto;
	gap: clamp(28px, 5vw, 64px);
}

.bd-about__art,
.bd-about__art.wp-block-image {
	margin: 0;
}

.bd-about__art img {
	display: block;
	width: 100%;
	border-radius: var(--bd-radius);
	border: 1px solid var(--bd-line);
	box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), 0 0 60px rgba(30, 107, 255, 0.2);
}

.bd-about__text {
	text-align: left;
}

.bd-about__text > * {
	margin-block: 0;
}

.bd-about__text > * + * {
	margin-top: 1.1rem;
}

.bd-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0;
	list-style: none;
}

.bd-chips li {
	margin: 0;
	padding: 6px 14px;
	border-radius: 999px;
	border: 1px solid rgba(127, 176, 255, 0.35);
	background: rgba(30, 107, 255, 0.12);
	color: var(--bd-blue-light);
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.03em;
}

.bd-signoff {
	font-family: var(--bd-display);
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--bd-gold);
}

@media (max-width: 781px) {
	.bd-about__art img {
		max-width: 240px;
		margin: 0 auto;
	}

	.bd-about__text {
		text-align: center;
	}

	.bd-about__text .bd-chips {
		justify-content: center;
	}
}

/* Join the Den ---------------------------------------------------- */
.bd-den__card {
	position: relative;
	max-width: 780px;
	margin: 0 auto;
	padding: clamp(36px, 6vw, 64px) clamp(20px, 5vw, 56px);
	text-align: center;
	border-radius: 26px;
	background:
		radial-gradient(circle at 50% 0%, rgba(30, 107, 255, 0.28), transparent 62%),
		linear-gradient(180deg, #101e46 0%, #070c1f 100%);
	border: 1px solid var(--bd-line);
	box-shadow: 0 0 0 6px rgba(242, 182, 58, 0.05), 0 30px 80px rgba(0, 0, 0, 0.5);
}

.bd-den__card > * {
	margin-block: 0;
}

.bd-den__card > * + * {
	margin-top: 1rem;
}

.bd-den__mark,
.bd-den__mark.wp-block-image {
	margin: 0 auto;
}

.bd-den__mark img {
	border-radius: 50%;
	display: block;
	width: 92px;
	height: 92px;
	margin: 0 auto;
	filter: drop-shadow(0 0 18px rgba(242, 182, 58, 0.45));
}

.bd-perks {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 22px;
	padding: 0;
	list-style: none;
	color: var(--bd-silver);
	font-size: 0.92rem;
}

.bd-perks li {
	margin: 0;
}

.bd-perks li::before {
	content: "✦ ";
	color: var(--bd-gold);
}

.bd-form-slot {
	margin-top: 1.6rem;
}

.bd-form-slot iframe {
	width: 100%;
	border: 0;
}

.bd-soon {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 12px 22px;
	border-radius: 999px;
	border: 1px dashed var(--bd-line);
	background: rgba(5, 7, 15, 0.45);
	color: var(--bd-gold-light);
	font-family: var(--bd-display);
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.bd-soon::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--bd-gold);
	box-shadow: 0 0 10px var(--bd-gold);
	animation: bd-pulse 1.8s ease-in-out infinite;
}

@keyframes bd-pulse {
	50% {
		opacity: 0.35;
	}
}

/* Merch teaser ----------------------------------------------------
   The banner art is pinned to the right at a fixed 3:1 ratio so the
   emblem never slides under the text; its left edge fades into the page.
---------------------------------------------------------------- */
.bd-merch {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: flex;
	align-items: center;
	min-height: 460px;
	background: var(--bd-midnight);
	border-block: 1px solid rgba(242, 182, 58, 0.18);
}

.bd-merch::before {
	content: "";
	position: absolute;
	z-index: -1;
	top: 0;
	right: 0;
	bottom: 0;
	aspect-ratio: 3 / 1;
	background: url("assets/images/banner-logo-right.webp") right center / cover no-repeat;
	-webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 34%);
	mask-image: linear-gradient(90deg, transparent 0%, #000 34%);
}

.bd-merch__content {
	width: 100%;
}

.bd-merch__content > * {
	max-width: 440px;
	margin-block: 0;
}

.bd-merch__content > * + * {
	margin-top: 1rem;
}

.bd-merch__content .wp-block-buttons {
	margin-top: 1.6rem;
}

/* Narrower screens: art becomes a dimmed backdrop behind centered text. */
@media (max-width: 1199px) {
	.bd-merch {
		min-height: 400px;
		text-align: center;
	}

	.bd-merch::before {
		left: 0;
		aspect-ratio: auto;
		background:
			linear-gradient(180deg, rgba(5, 7, 15, 0.5) 0%, rgba(5, 7, 15, 0.9) 75%),
			url("assets/images/banner-logo-right.webp") left center / cover no-repeat;
		-webkit-mask-image: none;
		mask-image: none;
	}

	.bd-merch__content > * {
		margin-inline: auto;
	}

	.bd-merch .bd-kicker::before {
		margin-left: 0.7em;
	}

	.bd-merch .bd-kicker::after {
		content: "✦";
	}

	.bd-merch__content .wp-block-buttons {
		justify-content: center;
	}
}

/* ---------------------------------------------------------------
   Footer
---------------------------------------------------------------- */
.bd-footer {
	padding: clamp(40px, 6vw, 64px) var(--bd-gutter) 32px;
	text-align: center;
	border-top: 1px solid rgba(242, 182, 58, 0.14);
	background: linear-gradient(180deg, transparent, rgba(11, 20, 48, 0.6));
}

.bd-footer > * {
	margin-block: 0;
}

.bd-footer > * + * {
	margin-top: 0.9rem;
}

.bd-footer__mark,
.bd-footer__mark.wp-block-image {
	margin: 0 auto;
}

.bd-footer__mark img {
	border-radius: 50%;
	display: block;
	width: 64px;
	height: 64px;
	margin: 0 auto;
	opacity: 0.9;
}

.bd-footer .wp-block-social-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 18px;
	padding: 0;
}

.bd-footer .wp-block-social-links .wp-social-link {
	margin: 0;
	color: var(--bd-gold);
	transition: transform 0.18s ease, color 0.18s ease;
}

.bd-footer .wp-block-social-links .wp-social-link:hover {
	transform: translateY(-2px);
	color: #fff;
}

.bd-footer .wp-block-social-links .wp-social-link svg {
	width: 24px;
	height: 24px;
}

.bd-footer__tagline {
	font-family: var(--bd-display);
	font-weight: 700;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--bd-gold);
	font-size: 0.85rem;
}

.bd-footer__legal {
	max-width: 680px;
	margin-inline: auto;
	color: var(--bd-muted);
	font-size: 0.78rem;
	line-height: 1.6;
}

/* ---------------------------------------------------------------
   Inner pages (blog posts, pages, 404)
---------------------------------------------------------------- */
.bd-page {
	max-width: 760px;
	margin: 0 auto;
	padding: clamp(48px, 8vw, 96px) var(--bd-gutter);
}

.bd-page > * {
	margin-block: 0;
}

.bd-page > * + * {
	margin-top: 1.5rem;
}

.bd-page .wp-block-post-template {
	display: grid;
	gap: 20px;
	padding: 0;
	list-style: none;
}

.bd-page .wp-block-post {
	padding: 24px;
	border-radius: var(--bd-radius);
	border: 1px solid var(--bd-line);
	background: rgba(11, 20, 48, 0.6);
}

.bd-page .wp-block-post-title a {
	color: var(--bd-gold);
	text-decoration: none;
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}
}
