/**
 * Custom CSS
 *
 * This file is for your custom styles.
 * You can add any CSS rules here to customize the Ghost theme.
 *
 * Note: Changes made directly to this file may be overwritten during theme updates.
 * It's recommended to use the Code Injection feature in Ghost for persistent customizations.
 */

/* Your custom CSS goes below this line */

/* Masthead: prescribed-burn definition line, with a highlighter-style mark. */
.brand-masthead-definition {
	max-width: 32rem;
	margin: 0;
	font-size: 1.0625rem;
	line-height: 1.6;
	font-weight: 500;
	color: var(--color-foreground);
}

.brand-masthead-highlight {
	background: rgba(233, 160, 6, 0.5);
	padding: 0 0.3em;
	border-radius: 3px;
	display: inline-block;
	transform: rotate(-1.5deg);
}

/* Remove the rotated year pills beside post/project cards. */
.section-list-badge {
	display: none !important;
}

/* Lit drip torch: a real, clickable element (replaces the old ::before
   illustration so it can respond to a click) with a little flame burst. */
.brand-masthead::before {
	display: none !important;
}

.brand-masthead-torch {
	position: absolute;
	top: 1rem;
	right: calc(100% + 2.5rem);
	width: 7.5rem;
	height: 9.5rem;
	margin: 0;
	padding: 0;
	border: 0;
	background: url("images/brand/drip-torch-flame.svg") no-repeat center / contain;
	transform: rotate(18deg);
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

.brand-masthead-torch:focus-visible {
	outline: 2px solid var(--brand-indigo);
	outline-offset: 4px;
}

.brand-masthead-torch-flame-overlay {
	display: block;
	position: absolute;
	inset: 0;
	background: url("images/brand/drip-torch-flame-only.svg") no-repeat center / contain;
	transform-origin: 85% 18%;
	animation: torch-flicker 2.2s ease-in-out infinite;
}

@keyframes torch-flicker {
	0%, 100% {
		opacity: 0.9;
		transform: scale(1) rotate(0deg);
	}
	25% {
		opacity: 1;
		transform: scale(1.08) rotate(2.6deg);
	}
	50% {
		opacity: 0.84;
		transform: scale(0.95) rotate(-2.6deg);
	}
	75% {
		opacity: 1;
		transform: scale(1.05) rotate(1.3deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.brand-masthead-torch-flame-overlay {
		animation: none;
	}
}

/* A few small embers that occasionally pop off the flame while it idles. */
.brand-masthead-torch-spark {
	position: absolute;
	top: 4%;
	left: 78%;
	width: 0.35rem;
	height: 0.35rem;
	margin: -0.175rem 0 0 -0.175rem;
	border-radius: 50%;
	background: var(--brand-orange, #f64c14);
	opacity: 0;
	pointer-events: none;
}

.brand-masthead-torch-spark.spark-1 {
	animation: torch-spark 3.4s ease-in infinite 0.4s;
}

.brand-masthead-torch-spark.spark-2 {
	left: 70%;
	top: 10%;
	width: 0.3rem;
	height: 0.3rem;
	animation: torch-spark 4.3s ease-in infinite 1.6s;
}

.brand-masthead-torch-spark.spark-3 {
	left: 86%;
	top: 8%;
	width: 0.25rem;
	height: 0.25rem;
	animation: torch-spark 5s ease-in infinite 2.7s;
}

@keyframes torch-spark {
	0%, 68% {
		opacity: 0;
		transform: translate(0, 0) scale(0.5);
	}
	76% {
		opacity: 1;
	}
	100% {
		opacity: 0;
		transform: translate(0.4rem, -1.6rem) scale(0.2);
	}
}

@media (prefers-reduced-motion: reduce) {
	.brand-masthead-torch-spark {
		animation: none;
		display: none;
	}
}

.brand-masthead-torch-burst {
	position: absolute;
	top: 6%;
	left: 74%;
	width: 2.5rem;
	height: 2.5rem;
	margin: -1.25rem 0 0 -1.25rem;
	background: url("images/brand/fire.svg") no-repeat center / contain;
	opacity: 0;
	pointer-events: none;
	transform-origin: bottom center;
}

.brand-masthead-torch.is-lit .brand-masthead-torch-burst {
	animation: torch-burst 0.7s ease-out;
}

.brand-masthead-torch-burst.burst-2 {
	left: 68%;
	width: 1.75rem;
	height: 1.75rem;
	animation-delay: 0.08s !important;
}

.brand-masthead-torch-burst.burst-3 {
	left: 82%;
	width: 1.5rem;
	height: 1.5rem;
	animation-delay: 0.16s !important;
}

@keyframes torch-burst {
	0% {
		opacity: 0;
		transform: translateY(0) scale(0.4) rotate(0deg);
	}
	15% {
		opacity: 1;
	}
	100% {
		opacity: 0;
		transform: translateY(-3rem) scale(1.15) rotate(8deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.brand-masthead-torch.is-lit .brand-masthead-torch-burst {
		animation: none;
	}
}

/* Show the drip-torch illustration on mobile too, repositioned inline
   since there's no side margin to float it in at narrow widths. Reset
   top/right (used for the desktop absolute layout) since they would
   otherwise still apply as an offset to the relatively-positioned mobile
   element and push it off-screen. */
@media (max-width: 1100px) {
	.brand-masthead-torch {
		display: block;
		position: relative;
		top: auto;
		right: auto;
		width: 5rem;
		height: 6.5rem;
		margin: 0 auto var(--spacing-4);
		transform: rotate(18deg);
	}
}

/* Keep the torch visible in dark mode. The body's navy fill (invisible on a
   navy background) is swapped for parchment in a separate graphic — no
   invert(), so it's a real palette color rather than invert's mixed hue.
   The flame layer is unfiltered and stays its usual orange. */
[data-color-scheme="dark"] .brand-masthead-torch {
	background-image: url("images/brand/drip-torch-body-dark.svg");
}

@media (prefers-color-scheme: dark) {
	[data-color-scheme="system"] .brand-masthead-torch {
		background-image: url("images/brand/drip-torch-body-dark.svg");
	}
}

/* Boots illustration: show it in dark mode too. The indigo and yellow parts
   are already brand-palette colors with plenty of contrast on navy, so only
   the navy part (invisible on a navy background) is swapped for parchment —
   no invert(), so the illustration stays in-palette. */
[data-color-scheme="dark"] .section-posts#recent::before {
	display: block;
	background-image: url("images/brand/boots-dark.svg");
}

@media (prefers-color-scheme: dark) {
	[data-color-scheme="system"] .section-posts#recent::before {
		display: block;
		background-image: url("images/brand/boots-dark.svg");
	}
}

/* Widen the post body text column from the theme's default ~500px, without
   touching --container--width site-wide (used elsewhere for things like the
   search and signup forms) or shrinking wide/full-bleed images. */
.post-content > *:not(.kg-width-wide):not(.kg-width-full) {
	max-width: 650px;
}

/* Match the post header (headline, subtitle/excerpt, author row) to the
   same widened 650px column as the post body above. */
.post-header-container,
.post-header-info {
	width: 650px;
	max-width: 100%;
}

/* More breathing room between the title, subtitle/excerpt, and the
   author row below it. */
.post-header-container {
	gap: var(--spacing-6);
}

.post-header-info {
	margin-top: var(--spacing-7);
	padding-top: var(--spacing-6);
}

/* Hide the default placeholder X/Facebook links in the footer (never actually
   configured — they point at ghost.org's own accounts). */
.social-links a.social-link[href="https://x.com/ghost"],
.social-links a.social-link[href="https://www.facebook.com/ghost"] {
	display: none !important;
}
