/*
Theme Name: Tacobout Social
Theme URI: https://tacobout.online
Author: schwegler
Author URI: https://tacobout.online
Description: A personal magazine theme for schwegler — ultra-modern tumblog with deep Bluesky/ATProto & ActivityPub integration. Format-aware feeds, dark mode, and 2026 design language.
Version: 3.2.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tacobout
Tags: full-site-editing, block-theme, blog, dark-mode, post-formats, one-column, wide-blocks
*/

/* ============================
   DESIGN TOKENS — DARK MODE
   ============================ */
:root {
	--taco-bg: #fafafa;
	--taco-fg: #0f0f0f;
	--taco-accent: #0066ff;
	--taco-accent-2: #ff3366;
	--taco-muted: #71717a;
	--taco-surface: #f4f4f5;
	--taco-surface-2: #e4e4e7;
	--taco-border: #d4d4d8;
	--taco-radius: 12px;
	--taco-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
	--taco-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
	--taco-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
	:root {
		--taco-bg: #09090b;
		--taco-fg: #fafafa;
		--taco-accent: #3b82f6;
		--taco-accent-2: #f472b6;
		--taco-muted: #a1a1aa;
		--taco-surface: #18181b;
		--taco-surface-2: #27272a;
		--taco-border: #3f3f46;
		--taco-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
		--taco-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.4);
	}

	/* Override WP theme.json colors for dark mode */
	body {
		background-color: var(--taco-bg) !important;
		color: var(--taco-fg) !important;
	}

	/* Fix all surfaces */
	.has-base-background-color {
		background-color: var(--taco-bg) !important;
	}

	.has-contrast-color {
		color: var(--taco-fg) !important;
	}

	.has-contrast-background-color {
		background-color: var(--taco-fg) !important;
		color: var(--taco-bg) !important;
	}

	.has-surface-background-color {
		background-color: var(--taco-surface) !important;
	}

	.has-surface-2-background-color {
		background-color: var(--taco-surface-2) !important;
	}

	.has-muted-color {
		color: var(--taco-muted) !important;
	}

	.has-accent-color {
		color: var(--taco-accent) !important;
	}

	a {
		color: var(--taco-accent);
	}

	a:hover {
		color: var(--taco-accent-2);
	}
}

/* ============================
   BASE
   ============================ */
/* Global Focus Styles */
*:focus-visible {
	outline: 2px solid var(--taco-accent);
	outline-offset: 2px;
	border-radius: 2px;
}

body {
	background-color: var(--taco-bg);
	color: var(--taco-fg);
	transition: background-color var(--taco-transition), color var(--taco-transition);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

body::before {
	content: "";
	position: fixed;
	top: 0;
	left: 0;
	width: 200vw;
	height: 200vh;
	z-index: -2;
	background-image:
		radial-gradient(at 0% 0%, rgba(139, 92, 246, 0.08) 0px, transparent 50%),
		radial-gradient(at 100% 0%, rgba(217, 70, 239, 0.08) 0px, transparent 50%),
		radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.08) 0px, transparent 50%),
		radial-gradient(at 0% 100%, rgba(217, 70, 239, 0.08) 0px, transparent 50%);

	/* ⚡ Bolt Optimization: Using transform instead of background-position offloads animation to the GPU to reduce CPU repaints */
	animation: meshMovement 20s ease-in-out infinite alternate;
	will-change: transform;
}

::selection {
	background: var(--taco-accent);
	color: white;
}

::-webkit-scrollbar {
	width: 12px;
	height: 12px;
}

::-webkit-scrollbar-track {
	background: var(--taco-bg);
}

::-webkit-scrollbar-thumb {
	background: var(--taco-border);
	border-radius: 10px;
	border: 3px solid var(--taco-bg);
}

::-webkit-scrollbar-thumb:hover {
	background: var(--taco-muted);
}

@keyframes meshMovement {
	0% {
		transform: translate(0%, 0%);
	}

	50% {
		transform: translate(-50%, -50%);
	}

	100% {
		transform: translate(0%, -50%);
	}
}

@media (prefers-color-scheme: dark) {
	body::before {
		background-image:
			radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.12) 0px, transparent 50%),
			radial-gradient(at 100% 0%, rgba(244, 114, 182, 0.12) 0px, transparent 50%),
			radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.12) 0px, transparent 50%),
			radial-gradient(at 0% 100%, rgba(244, 114, 182, 0.12) 0px, transparent 50%);
	}
}

/* ============================
   HEADER
   ============================ */
.tacobout-header {
	border-bottom: 1px solid var(--taco-border);
	position: sticky;
	top: 0;
	z-index: 100;
}

/* Move the blur effect to a pseudo-element so it doesn't trap the fixed mobile menu */
.tacobout-header::before {
	content: "";
	position: absolute;
	inset: 0;
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	background: rgba(250, 250, 250, 0.85);
	z-index: -1;
}

@media (prefers-color-scheme: dark) {
	.tacobout-header {
		border-bottom-color: var(--taco-border);
	}

	.tacobout-header::before {
		background: rgba(9, 9, 11, 0.85);
	}
}

/* When WP admin bar is showing */
.admin-bar .tacobout-header {
	top: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar .tacobout-header {
		top: 46px;
	}
}

/* ============================
   MAGAZINE GRID — THE FEED
   ============================ */
/* ============================
   MAGAZINE GRID — MASONRY
   ============================ */
.tacobout-magazine-grid {
	column-count: 2;
	column-gap: 2rem;
	display: block;
	list-style: none;
	padding: 0;
}

@media (max-width: 900px) {
	.tacobout-magazine-grid {
		column-count: 1;
	}
}

/* Each post in the grid */
.tacobout-magazine-grid .wp-block-post {
	break-inside: avoid-column;
	margin-bottom: 2rem;
	overflow: hidden;
	min-width: 0;
	/* Glassmorphism */
	background: rgba(255, 255, 255, 0.5);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: var(--taco-radius);
	padding: 1.5rem;
	box-shadow: var(--taco-shadow);
	transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
	display: flex;
	flex-direction: column;
}

.tacobout-magazine-grid .wp-block-post:hover,
.tacobout-magazine-grid .wp-block-post:focus-within {
	box-shadow: 0 15px 35px rgba(0, 102, 255, 0.1), 0 5px 15px rgba(0, 0, 0, 0.05);
	border-color: rgba(255, 255, 255, 0.8);
}

@media (prefers-color-scheme: dark) {
	.tacobout-magazine-grid .wp-block-post {
		background: rgba(24, 24, 27, 0.6);
		border-color: rgba(255, 255, 255, 0.08);
	}

	.tacobout-magazine-grid .wp-block-post:hover,
	.tacobout-magazine-grid .wp-block-post:focus-within {
		box-shadow: 0 15px 35px rgba(139, 92, 246, 0.15), 0 5px 15px rgba(0, 0, 0, 0.2);
		border-color: rgba(255, 255, 255, 0.15);
	}
}

.embed-youtube iframe {
	max-width: 100% !important;
	width: 100% !important;
}

/* Fix inner group spacing since card now has padding */
.tacobout-magazine-grid .tacobout-card-inner {
	height: 100%;
	display: flex;
	flex-direction: column;
}

/* ============================
   HERO: ADAPTIVE FIRST POST
   ============================ */
body.home:not(.paged) .tacobout-magazine-grid .wp-block-post:first-child {
	column-span: all;
	padding: 3rem 2rem 0rem 2rem;
	position: relative;
	border: 1px solid var(--taco-accent);
	box-shadow: 0 0 40px rgba(139, 92, 246, 0.15);
}

/* Latest Badge */
body.home:not(.paged) .tacobout-magazine-grid .wp-block-post:first-child::before {
	content: "LATEST";
	position: absolute;
	top: 1rem;
	left: 1.5rem;
	background: var(--taco-accent);
	color: white;
	padding: 4px 12px;
	border-radius: 100px;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	box-shadow: 0 0 10px var(--taco-accent);
	animation: pulse 2s infinite;
	z-index: 10;
}

@keyframes pulse {
	0% {
		box-shadow: 0 0 0 0 rgba(0, 102, 255, 0.7);
	}

	70% {
		box-shadow: 0 0 0 10px rgba(0, 102, 255, 0);
	}

	100% {
		box-shadow: 0 0 0 0 rgba(0, 102, 255, 0);
	}
}

body.home:not(.paged) .tacobout-magazine-grid .wp-block-post:first-child .wp-block-post-title {
	font-size: clamp(2.5rem, 6vw, 4.5rem) !important;
	line-height: 1.05 !important;
	letter-spacing: -0.04em !important;
	background: linear-gradient(135deg, var(--taco-accent), var(--taco-accent-2));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	margin-bottom: 1.5rem !important;
}

body.home:not(.paged) .tacobout-magazine-grid .wp-block-post:first-child .wp-block-post-excerpt {
	font-size: 1.25rem;
	max-width: 800px;
}

/* ============================
   POST FORMAT CARDS
   The tacobout_post_class filter in functions.php
   adds .tacobout-format-{type} to each post.

   STRATEGY: All formats render ALL blocks (featured-image,
   post-meta, post-title, post-excerpt, post-content).
   We use display:none to hide what we don't want per format.
   For STANDARD: hide post-content.
   For VIDEO/AUDIO/STATUS/QUOTE/LINK: hide excerpt and/or image,
   show post-content instead.
   ============================ */

/* --- STANDARD FORMAT — hide full content, show excerpt --- */
.tacobout-format-standard {}

.tacobout-format-standard .wp-block-post-content {
	display: none !important;
}

/* --- VIDEO FORMAT --- */
.tacobout-format-video {}

.tacobout-format-video .wp-block-post-featured-image,
.tacobout-format-video .wp-block-post-excerpt {
	display: none !important;
}

.tacobout-format-video .wp-block-post-content {
	margin-bottom: 1rem;
	order: -1;
	/* Place above title */
}

.tacobout-format-video .wp-block-post-title {
	font-size: 1.5rem !important;
	/* Smaller title */
}

.tacobout-format-video .wp-block-post-content .wp-block-embed {
	margin: 0;
}

.tacobout-format-video .wp-block-post-content .wp-block-embed__wrapper {
	border-radius: var(--taco-radius);
	overflow: hidden;
}

/* --- AUDIO FORMAT --- */
.tacobout-format-audio {}

.tacobout-format-audio .wp-block-post-featured-image,
.tacobout-format-audio .wp-block-post-excerpt {
	display: none !important;
}

.tacobout-format-audio .wp-block-post-content {
	background: var(--taco-surface);
	border-radius: var(--taco-radius);
	padding: 1.5rem;
	margin-bottom: 1rem;
	order: -1;
	/* Place above title */
}

.tacobout-format-audio .wp-block-post-title {
	font-size: 1.5rem !important;
	/* Smaller title */
}

/* --- STATUS & ASIDE FORMATS (microblog) --- */
.tacobout-format-status,
.tacobout-format-aside {}

.tacobout-format-status .wp-block-post-featured-image,
.tacobout-format-status .wp-block-post-excerpt,
.tacobout-format-aside .wp-block-post-featured-image,
.tacobout-format-aside .wp-block-post-excerpt {
	display: none !important;
}

.tacobout-format-status .wp-block-post-content,
.tacobout-format-aside .wp-block-post-content {
	font-size: 1.15rem;
	line-height: 1.6;
	order: -1;
}

.tacobout-format-status .wp-block-post-title,
.tacobout-format-aside .wp-block-post-title {
	font-size: 1.25rem !important;
	opacity: 0.7;
	margin-top: 0.5rem !important;
}

.tacobout-format-status,
.tacobout-format-aside {
	background: var(--taco-surface);
	border-radius: var(--taco-radius);
	padding: 1.5rem !important;
	border: 1px solid var(--taco-border);
}

/* --- IMAGE FORMAT --- */
.tacobout-format-image {}

.tacobout-format-image .wp-block-post-featured-image,
.tacobout-format-image .wp-block-post-excerpt {
	display: none !important;
}

.tacobout-format-image .wp-block-post-content {
	margin-bottom: 1rem;
	order: -1;
}

.tacobout-format-image .wp-block-post-title {
	font-size: 1.5rem !important;
}

.tacobout-format-image .wp-block-post-content img {
	border-radius: var(--taco-radius);
}

/* --- QUOTE FORMAT --- */
.tacobout-format-quote {}

.tacobout-format-quote .wp-block-post-featured-image,
.tacobout-format-quote .wp-block-post-excerpt {
	display: none !important;
}

.tacobout-format-quote .wp-block-post-content {
	order: -1;
}

.tacobout-format-quote .wp-block-post-title {
	font-size: 1.25rem !important;
	margin-top: 1rem !important;
}

.tacobout-format-quote {
	background: var(--taco-surface);
	border-left: 4px solid var(--taco-accent);
	border-radius: 0 var(--taco-radius) var(--taco-radius) 0;
	padding: 1.5rem 2rem !important;
}

/* --- LINK FORMAT --- */
.tacobout-format-link .wp-block-post-featured-image {
	display: none !important;
}

.tacobout-format-link .wp-block-post-excerpt {
	display: none !important;
}

.tacobout-format-link .wp-block-post-content {
	order: -1;
}

.tacobout-format-link .wp-block-post-title {
	font-size: 1.5rem !important;
}

.tacobout-format-link {
	background: var(--taco-surface);
	border-radius: var(--taco-radius);
	padding: 1.5rem !important;
	border: 1px solid var(--taco-border);
}

/* --- HIDE ACTIVITYPUB / FEDIVERSE REACTIONS ON HOMEPAGE FEED --- */
body.home .tacobout-magazine-grid .wp-block-activitypub-reactions,
body.home .tacobout-magazine-grid .activitypub-reactions,
body.home .tacobout-magazine-grid .fediverse-reactions,
body.home .tacobout-magazine-grid #activitypub-reactions {
	display: none !important;
}

/* ============================
   FEATURED IMAGE
   ============================ */
.wp-block-post-featured-image img {
	border-radius: var(--taco-radius);
	transition: transform var(--taco-transition), box-shadow var(--taco-transition);
}

.wp-block-post-featured-image:hover img {
	transform: scale(1.02);
	box-shadow: var(--taco-shadow-lg);
}

/* ============================
   POST META — CATEGORY PILLS
   ============================ */
.tacobout-post-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
}

.wp-block-post-terms a {
	background: var(--taco-surface);
	padding: 0.2rem 0.6rem;
	border-radius: 100px;
	border: 1px solid var(--taco-border);
	transition: all var(--taco-transition);
	text-decoration: none !important;
	color: var(--taco-muted) !important;
}

.wp-block-post-terms a:hover,
.wp-block-post-terms a:focus-visible {
	background: var(--taco-accent);
	color: white !important;
	border-color: var(--taco-accent);
}

/* ============================
   READ MORE LINK
   ============================ */
.wp-block-post-excerpt__more-link {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-family: 'Space Grotesk', system-ui, sans-serif;
	font-weight: 600;
	font-size: 0.875rem;
	color: var(--taco-accent) !important;
	text-decoration: none !important;
	transition: gap var(--taco-transition);
}

.wp-block-post-excerpt__more-link:hover,
.wp-block-post-excerpt__more-link:focus-visible {
	gap: 0.6rem;
	color: var(--taco-accent-2) !important;
}

/* ============================
   COMMENTS — Fediverse-aware
   ============================ */
.wp-block-comments {
	border-top: 1px solid var(--taco-border);
	padding-top: 2rem;
}

.comment-body {
	background: var(--taco-surface);
	border: 1px solid var(--taco-border);
	border-radius: var(--taco-radius);
	padding: 1.25rem;
	margin-bottom: 1rem;
	transition: box-shadow var(--taco-transition);
}

.comment-body:hover,
.comment-body:focus-within {
	box-shadow: var(--taco-shadow);
}

/* ============================
   AUTHOR BIO CARD
   ============================ */
.tacobout-author-card {
	background: var(--taco-surface);
	border: 1px solid var(--taco-border);
	border-radius: var(--taco-radius);
	padding: 2rem;
	transition: box-shadow var(--taco-transition);
}

.tacobout-author-card:hover,
.tacobout-author-card:focus-within {
	box-shadow: var(--taco-shadow);
}

/* ============================
   FOOTER
   ============================ */
.tacobout-footer {
	border-top: 1px solid var(--taco-border);
}

/* ============================
   PAGINATION
   ============================ */
.wp-block-query-pagination {
	gap: 0.5rem;
}

.wp-block-query-pagination-numbers .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	height: 2.25rem;
	padding: 0.25rem 0.75rem;
	border-radius: 100px;
	border: 1px solid var(--taco-border);
	background: transparent;
	text-decoration: none;
	font-weight: 500;
	font-size: 0.875rem;
	color: var(--taco-fg);
	transition: all var(--taco-transition);
}

.wp-block-query-pagination-numbers .page-numbers:hover,
.wp-block-query-pagination-numbers .page-numbers.current {
	background: var(--taco-accent);
	border-color: var(--taco-accent);
	color: white;
}

/* ============================
   MICRO ANIMATIONS
   ============================ */
@media (prefers-reduced-motion: no-preference) {
	.tacobout-magazine-grid .wp-block-post {
		animation: fadeIn 0.4s ease both;
	}

	.tacobout-magazine-grid .wp-block-post:nth-child(1) {
		animation-delay: 0s;
	}

	.tacobout-magazine-grid .wp-block-post:nth-child(2) {
		animation-delay: 0.05s;
	}

	.tacobout-magazine-grid .wp-block-post:nth-child(3) {
		animation-delay: 0.1s;
	}

	.tacobout-magazine-grid .wp-block-post:nth-child(4) {
		animation-delay: 0.15s;
	}

	.tacobout-magazine-grid .wp-block-post:nth-child(5) {
		animation-delay: 0.2s;
	}

	.tacobout-magazine-grid .wp-block-post:nth-child(6) {
		animation-delay: 0.25s;
	}

	@keyframes fadeIn {
		from {
			opacity: 0;
		}

		to {
			opacity: 1;
		}
	}
}

/* ============================
   EMBEDS (YOUTUBE ETC)
   ============================ */
.wp-block-embed,
.wp-block-embed__wrapper {
	max-width: 100%;
	width: 100%;
}

.wp-block-embed iframe,
.wp-block-embed object,
.wp-block-embed embed {
	max-width: 100% !important;
	width: 100% !important;
}