/*
Theme Name: GCB Brutalist
Theme URI: https://gaycarboys.com
Author: Gay Car Boys Editorial Team
Author URI: https://gaycarboys.com
Description: Editorial Brutalism meets automotive culture. A bold FSE block theme featuring the "Neon Noir" design system with intentional disruption and hard edges.
Version: 1.0.0
Requires at least: 6.9
Tested up to: 6.9
Requires PHP: 8.3
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gcb-brutalist
Tags: full-site-editing, block-theme, brutalism, editorial, magazine
*/

/**
 * Screen Reader Text - WCAG Accessibility
 * Hides content visually while keeping it accessible to screen readers
 */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: var(--wp--preset--color--highlight);
	clip: auto !important;
	clip-path: none;
	color: var(--wp--preset--color--void-black);
	display: block;
	font-size: 1rem;
	font-weight: bold;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

/**
 * Editorial Brutalism: Global No-Transition Rule
 * Instant state changes - no smooth transitions (per north star design)
 */
*,
*::before,
*::after {
	transition: none !important;
}

/* Exception: Mobile menu slide animation */
.mobile-menu,
.menu-overlay {
	transition: transform 0.3s ease !important;
}

/* Respect user's motion preferences (WCAG 2.2 AAA) */
@media (prefers-reduced-motion: reduce) {
	.mobile-menu,
	.menu-overlay {
		transition: none !important;
	}
}

/**
 * Archive Broken Grid Layout
 * Creates intentional visual disruption with offset rhythm
 */

/* Post cards - base styling */
.gcb-post-card {
	transition: none !important; /* Brutalist = no smooth transitions */
}

/* Broken grid effect: every 2nd card offset vertically */
.wp-block-post:nth-child(2n) {
	margin-top: 50px !important;
}

/* Post title hover effect - Hyper Blue */
.gcb-post-title a {
	color: var(--wp--preset--color--hyper-white) !important;
	text-decoration: none !important;
	transition: none !important; /* Instant color snap */
}

.gcb-post-title a:hover {
	color: var(--wp--preset--color--hyper-blue) !important;
}

/* Hard borders on post cards */
.gcb-post-card {
	border: 2px solid var(--wp--preset--color--void-black) !important;
	border-radius: 0 !important; /* No rounded corners */
}

/* Responsive: 2 columns on tablet */
@media (max-width: 782px) {
	.wp-block-post-template {
		grid-template-columns: repeat(2, 1fr) !important;
	}

	.wp-block-post:nth-child(2n) {
		margin-top: 30px !important;
	}
}

/* Responsive: 1 column on mobile */
@media (max-width: 600px) {
	.wp-block-post-template {
		grid-template-columns: 1fr !important;
	}

	.wp-block-post:nth-child(2n) {
		margin-top: 0 !important;
	}
}

/* Focus states for accessibility */
.gcb-post-title a:focus {
	outline: 2px solid var(--wp--preset--color--highlight) !important;
	outline-offset: 2px;
}

/**
 * Search Results Grid Layout - Uniform 3x3 Grid
 * Ensures all cards are exactly the same size for neat alignment
 */

/* Grid Container - Fixed Row Heights - Override Flow Layout */
.search-results-grid .wp-block-post-template.gcb-bento-grid__container {
	display: grid !important;
	grid-template-columns: repeat(3, 1fr) !important;
	gap: 2rem !important;
	grid-auto-rows: 400px !important; /* Fixed row height for uniform grid */
	align-items: stretch !important; /* Force items to fill vertical space */
	list-style: none !important;
	padding: 0 !important;
	margin: 0 !important;
}

/* Override WordPress Flow Layout margins on li items */
ul.gcb-bento-grid__container.wp-block-post-template.is-layout-flow > li.wp-block-post,
.search-results-grid .wp-block-post-template.gcb-bento-grid__container.is-layout-flow > * {
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}

/* List Item (grid child) - Must fill grid cell */
ul.gcb-bento-grid__container.wp-block-post-template > li.wp-block-post {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	display: block !important; /* Override list-item display */
	height: 100% !important; /* Fill the 400px grid row */
	min-height: 400px !important;
}

/* Card Styling - Force 400px height to fill grid cell */
.search-results-grid div.wp-block-group.bento-item.gcb-bento-card,
.search-results-grid .bento-item.gcb-bento-card {
	min-height: 400px !important;
	height: 400px !important;
	max-height: 400px !important;
	overflow: hidden !important;
	display: flex !important;
	flex-direction: column !important;
	transition: none !important;
	box-sizing: border-box !important;
}

/* Featured Image - Fixed Height */
.search-results-grid .wp-block-post-featured-image {
	flex-shrink: 0 !important; /* Prevent image from shrinking */
}

.search-results-grid .wp-block-post-featured-image img,
.search-result-thumbnail img {
	filter: grayscale(100%) contrast(1.3) !important;
	width: 100% !important;
	height: 200px !important;
	object-fit: cover !important;
	display: block !important;
}

/* Content Area - Fill Remaining Space */
.search-results-page .bento-item.gcb-bento-card > .wp-block-group {
	flex: 1 !important; /* Fill remaining space after image */
	display: flex !important;
	flex-direction: column !important;
	overflow: hidden !important; /* Prevent content overflow */
}

/* Text Content Overflow Handling */
.search-results-page .wp-block-post-excerpt {
	overflow: hidden !important;
	text-overflow: ellipsis !important;
}

.search-results-page .wp-block-post-excerpt p {
	display: -webkit-box !important;
	-webkit-line-clamp: 3 !important; /* Limit to 3 lines */
	-webkit-box-orient: vertical !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
}

/* Hover Effect: Acid Lime Border */
.search-results-page .bento-item.gcb-bento-card:hover {
	border-color: var(--wp--preset--color--highlight, #0084FF) !important;
}

/* Responsive Grid */
@media (max-width: 768px) {
	.search-results-grid .wp-block-post-template.gcb-bento-grid__container {
		grid-template-columns: 1fr !important;
		grid-auto-rows: 380px !important;
	}
}

@media (min-width: 769px) and (max-width: 1024px) {
	.search-results-grid .wp-block-post-template.gcb-bento-grid__container {
		grid-template-columns: repeat(2, 1fr) !important;
		grid-auto-rows: 400px !important;
	}
}

@media (min-width: 1025px) {
	.search-results-grid .wp-block-post-template.gcb-bento-grid__container {
		grid-template-columns: repeat(3, 1fr) !important;
		grid-auto-rows: 400px !important;
	}
}

/**
 * Single Post Content Styling
 * Images and videos within post content
 */

/* Single post content images - brutalist grayscale */
.wp-block-post-content img,
.wp-block-post-content .wp-block-image img {
	filter: grayscale(100%) contrast(1.3);
	max-width: 100%;
	height: auto;
}

/* Single post content videos - responsive */
.wp-block-post-content .wp-block-embed,
.wp-block-post-content .wp-block-video,
.wp-block-post-content iframe {
	max-width: 100%;
	height: auto;
}

.wp-block-post-content .wp-block-embed__wrapper {
	position: relative;
	padding-bottom: 56.25%; /* 16:9 aspect ratio */
	height: 0;
	overflow: hidden;
}

.wp-block-post-content .wp-block-embed__wrapper iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

/**
 * Brutalist Table Styling
 * Override inline styles with Editorial Brutalism design system
 */

/* Base table styling */
.wp-block-post-content table {
	font-family: var(--wp--preset--font-family--mono) !important;
	border-collapse: collapse !important;
	width: 100% !important;
	border: 2px solid var(--wp--preset--color--brutal-border) !important;
	background-color: var(--wp--preset--color--void-black) !important;
	margin: 2rem 0 !important;
}

/* Table headers */
.wp-block-post-content table th {
	background-color: var(--wp--preset--color--void-black) !important;
	color: var(--wp--preset--color--highlight) !important;
	padding: 12px !important;
	text-align: left !important;
	border: 1px solid var(--wp--preset--color--brutal-border) !important;
	font-weight: bold !important;
	text-transform: uppercase !important;
	font-size: 0.875rem !important;
	letter-spacing: 0.05em !important;
}

/* Table rows */
.wp-block-post-content table tr {
	background-color: var(--wp--preset--color--void-black) !important;
	border: 1px solid var(--wp--preset--color--brutal-border) !important;
}

/* Remove alternating row colors (no striping in brutalist design) */
.wp-block-post-content table tr:nth-child(even),
.wp-block-post-content table tbody tr:nth-child(even) {
	background-color: var(--wp--preset--color--void-black) !important;
}

/* Table data cells */
.wp-block-post-content table td {
	padding: 12px !important;
	border: 1px solid var(--wp--preset--color--brutal-border) !important;
	color: var(--wp--preset--color--off-white) !important;
	background-color: var(--wp--preset--color--void-black) !important;
	font-size: 0.875rem !important;
	line-height: 1.6 !important;
}

/* Table header row styling */
.wp-block-post-content table thead tr {
	background-color: var(--wp--preset--color--void-black) !important;
	border-bottom: 2px solid var(--wp--preset--color--brutal-border) !important;
}

/* Table body styling */
.wp-block-post-content table tbody {
	background-color: var(--wp--preset--color--void-black) !important;
}

/* Hover effect on table rows (highlight accent) */
.wp-block-post-content table tr:hover {
	border-color: var(--wp--preset--color--highlight) !important;
}

/* Focus states for accessibility */
.wp-block-post-content table th:focus,
.wp-block-post-content table td:focus {
	outline: 2px solid var(--wp--preset--color--highlight) !important;
	outline-offset: 2px;
}

/* Responsive table styling */
@media (max-width: 768px) {
	.wp-block-post-content table {
		font-size: 0.75rem !important;
	}

	.wp-block-post-content table th,
	.wp-block-post-content table td {
		padding: 8px !important;
		font-size: 0.75rem !important;
	}
}
/* CRITICAL FIX: Force all search result cards to exact 400px height */
.search-results-grid .wp-block-post-template[class*="gcb-bento-grid"] > li[class*="wp-block-post"] > div[class*="bento-item"][class*="gcb-bento-card"] {
	height: 400px !important;
	min-height: 400px !important;
	max-height: 400px !important;
}

/**
 * Global Pagination Styling
 * Consistent brutalist pagination across all archive pages
 * Uses !important to override WordPress default styles
 */

/* Pagination container - centered with gap */
.wp-block-query-pagination {
	margin-top: var(--wp--preset--spacing--50) !important;
	gap: 0.5rem !important;
	justify-content: center !important;
}

/* WordPress page-numbers class - the actual pagination links */
.wp-block-query-pagination .page-numbers,
.wp-block-query-pagination-numbers .page-numbers,
.wp-block-query-pagination-previous,
.wp-block-query-pagination-next {
	min-width: 44px !important;
	min-height: 44px !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 0.5rem 1rem !important;
	border: 1px solid var(--wp--preset--color--brutal-border) !important;
	background: var(--wp--preset--color--void-black) !important;
	color: var(--wp--preset--color--off-white) !important;
	font-family: var(--wp--preset--font-family--mono) !important;
	font-size: 0.875rem !important;
	text-decoration: none !important;
	transition: none !important;
}

/* Dots/ellipsis - same styling */
.wp-block-query-pagination .page-numbers.dots {
	border-color: transparent !important;
	background: transparent !important;
}

/* Hover states */
.wp-block-query-pagination .page-numbers:hover,
.wp-block-query-pagination-previous:hover,
.wp-block-query-pagination-next:hover {
	border-color: var(--wp--preset--color--highlight) !important;
	color: var(--wp--preset--color--highlight) !important;
}

/* Focus states */
.wp-block-query-pagination .page-numbers:focus,
.wp-block-query-pagination-previous:focus,
.wp-block-query-pagination-next:focus {
	border-color: var(--wp--preset--color--highlight) !important;
	outline: 2px solid var(--wp--preset--color--highlight) !important;
	outline-offset: 2px !important;
}

/* Current page - highlight background */
.wp-block-query-pagination .page-numbers.current,
.wp-block-query-pagination-numbers .current,
.wp-block-query-pagination .page-numbers[aria-current="page"] {
	background: var(--wp--preset--color--highlight) !important;
	color: var(--wp--preset--color--void-black) !important;
	border-color: var(--wp--preset--color--highlight) !important;
	font-weight: 700 !important;
}

/* Search results pagination - same styling */
.search-pagination {
	display: flex !important;
	justify-content: center !important;
	gap: 0.5rem !important;
	margin-top: var(--wp--preset--spacing--50) !important;
	flex-wrap: wrap !important;
}

.search-pagination a,
.search-pagination span {
	min-width: 44px !important;
	min-height: 44px !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 0.5rem 1rem !important;
	border: 1px solid var(--wp--preset--color--brutal-border) !important;
	background: var(--wp--preset--color--void-black) !important;
	color: var(--wp--preset--color--off-white) !important;
	font-family: var(--wp--preset--font-family--mono) !important;
	font-size: 0.875rem !important;
	text-decoration: none !important;
	transition: none !important;
}

/* Search pagination dots */
.search-pagination .dots {
	border-color: transparent !important;
	background: transparent !important;
}

.search-pagination a:hover,
.search-pagination a:focus {
	border-color: var(--wp--preset--color--highlight) !important;
	color: var(--wp--preset--color--highlight) !important;
}

.search-pagination a:focus-visible {
	outline: 2px solid var(--wp--preset--color--highlight) !important;
	outline-offset: 2px !important;
}

.search-pagination .current {
	background: var(--wp--preset--color--highlight) !important;
	color: var(--wp--preset--color--void-black) !important;
	border-color: var(--wp--preset--color--highlight) !important;
	font-weight: 700 !important;
}

/**
 * Lite YouTube Embed - Performance Optimization
 *
 * Lightweight facade that loads only YouTube thumbnail until user clicks play.
 * Reduces initial page load by ~800KB+ per video.
 * Expected LCP impact: 500-1500ms reduction.
 */

lite-youtube {
	background-color: #000;
	position: relative;
	display: block;
	contain: content;
	background-position: center center;
	background-size: cover;
	cursor: pointer;
	width: 100%;
	aspect-ratio: 16 / 9;
	max-width: 720px;
}

/* gradient overlay for better play button visibility */
lite-youtube::before {
	content: '';
	display: block;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: linear-gradient(
		180deg,
		rgba(0, 0, 0, 0) 0%,
		rgba(0, 0, 0, 0.3) 100%
	);
	pointer-events: none;
	z-index: 1;
}

/* Play button styling - brutalist aesthetic */
lite-youtube .lyt-playbtn {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 68px;
	height: 48px;
	background-color: var(--wp--preset--color--highlight);
	border: none;
	border-radius: 0;
	cursor: pointer;
	z-index: 2;
	transition: none !important;
	opacity: 0.9;
}

/* Play button triangle */
lite-youtube .lyt-playbtn::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-40%, -50%);
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 12px 0 12px 20px;
	border-color: transparent transparent transparent var(--wp--preset--color--void-black);
}

/* Hover state */
lite-youtube:hover .lyt-playbtn {
	opacity: 1;
	background-color: var(--wp--preset--color--off-white);
}

/* Focus state for accessibility */
lite-youtube:focus {
	outline: 2px solid var(--wp--preset--color--highlight);
	outline-offset: 2px;
}

lite-youtube:focus .lyt-playbtn {
	opacity: 1;
}

/* After iframe loads, hide everything else */
lite-youtube.lyt-activated {
	cursor: default;
}

lite-youtube.lyt-activated::before,
lite-youtube.lyt-activated .lyt-playbtn {
	opacity: 0;
	pointer-events: none;
}

/* Responsive iframe */
lite-youtube > iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Fix for WordPress responsive embed wrapper conflict */
.wp-embed-responsive .wp-has-aspect-ratio lite-youtube {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	max-width: none; /* Override the 720px max-width when inside embed wrapper */
}

/* ==========================================================================
   Comments Section — Editorial Brutalism
   ========================================================================== */

/* Comments heading */
.gcb-comments-section .wp-block-comments-title {
	font-family: var(--wp--preset--font-family--playfair);
	color: var(--wp--preset--color--off-white);
	border-bottom: 2px solid var(--wp--preset--color--highlight);
	padding-bottom: 1rem;
}

/* Comment avatars — square, brutalist */
.gcb-comments-section .avatar {
	border-radius: 0 !important;
	border: 2px solid var(--wp--preset--color--brutal-border) !important;
}

/* Comment content paragraphs */
.gcb-comments-section .wp-block-comment-content p {
	color: var(--wp--preset--color--off-white);
	font-family: var(--wp--preset--font-family--system-sans);
	line-height: 1.6;
}

/* Reply link styling */
.gcb-comments-section .wp-block-comment-reply-link a {
	color: var(--wp--preset--color--highlight);
	text-decoration: none;
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.gcb-comments-section .wp-block-comment-reply-link a:hover {
	color: var(--wp--preset--color--off-white);
}

/* Comment form styling */
.gcb-comments-section .comment-respond {
	margin-top: 2rem;
	padding-top: 2rem;
	border-top: 2px solid var(--wp--preset--color--brutal-border);
}

.gcb-comments-section .comment-respond .comment-reply-title {
	font-family: var(--wp--preset--font-family--playfair);
	font-size: 1.5rem;
	color: var(--wp--preset--color--off-white);
	margin-bottom: 1.5rem;
}

.gcb-comments-section .comment-respond label {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--wp--preset--color--brutal-grey);
}

.gcb-comments-section .comment-respond input[type="text"],
.gcb-comments-section .comment-respond input[type="email"],
.gcb-comments-section .comment-respond input[type="url"],
.gcb-comments-section .comment-respond textarea {
	background: var(--wp--preset--color--void-black);
	border: 2px solid var(--wp--preset--color--brutal-border);
	color: var(--wp--preset--color--off-white);
	font-family: var(--wp--preset--font-family--system-sans);
	padding: 0.75rem 1rem;
	width: 100%;
	box-sizing: border-box;
}

.gcb-comments-section .comment-respond input:focus,
.gcb-comments-section .comment-respond textarea:focus {
	border-color: var(--wp--preset--color--highlight);
	outline: 2px solid var(--wp--preset--color--highlight);
	outline-offset: 2px;
}

.gcb-comments-section .comment-respond .submit {
	background: var(--wp--preset--color--void-black);
	color: var(--wp--preset--color--off-white);
	border: 2px solid var(--wp--preset--color--brutal-border);
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.875rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	padding: 0.75rem 2rem;
	cursor: pointer;
	min-height: 44px;
}

.gcb-comments-section .comment-respond .submit:hover,
.gcb-comments-section .comment-respond .submit:focus {
	border-color: var(--wp--preset--color--highlight);
	outline: 2px solid var(--wp--preset--color--highlight);
	outline-offset: 2px;
}

/* Pagination styling */
.gcb-comments-section .wp-block-comments-pagination {
	margin-top: 1.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--wp--preset--color--brutal-border);
}

.gcb-comments-section .wp-block-comments-pagination a {
	color: var(--wp--preset--color--highlight);
	text-decoration: none;
	font-family: var(--wp--preset--font-family--mono);
}

.gcb-comments-section .wp-block-comments-pagination a:hover {
	color: var(--wp--preset--color--off-white);
}

/* ==========================================================================
   Author Box — Single Post
   ========================================================================== */

.gcb-author-box {
	gap: 1.5rem !important;
}

.gcb-author-box .avatar {
	flex-shrink: 0;
	border-radius: 0 !important;
}

.gcb-author-box .wp-block-post-author-name a {
	color: var(--wp--preset--color--off-white);
	text-decoration: none;
}

.gcb-author-box .wp-block-post-author-name a:hover {
	color: var(--wp--preset--color--highlight);
}

/* Responsive: stack on mobile */
@media (max-width: 600px) {
	.gcb-author-box {
		flex-direction: column !important;
		align-items: center !important;
		text-align: center;
	}
}
