/*
 * RobotThoughtss — secondary front-end & editor CSS.
 * Uses theme.json CSS custom properties (--wp--preset--color--*) so any
 * style variation automatically flows through.
 */

/* =========================================================================
   Utility helpers for classes used inside pattern block markup.
   Prefix everything with .rt- to avoid colliding with core or other themes.
   ========================================================================= */

/* Hero band — hex pattern overlay */
.rt-hero {
	position: relative;
	overflow: hidden;
	border: 2px solid var(--wp--preset--color--border);
	border-radius: 4px;
}
.rt-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: url(../images/pattern-hex.png);
	background-repeat: repeat;
	background-size: 72px 84px;
	image-rendering: pixelated;
	opacity: 0.08;
	pointer-events: none;
}
.rt-hero > * { position: relative; z-index: 1; }

/* Footer pattern band */
.rt-footer-band {
	position: relative;
	overflow: hidden;
}
.rt-footer-band::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: url(../images/pattern-circuit.png);
	background-repeat: repeat;
	background-size: 64px 64px;
	image-rendering: pixelated;
	opacity: 0.1;
	pointer-events: none;
}
.rt-footer-band > * { position: relative; z-index: 1; }

/* Project / thought cards */
.rt-card {
	background: var(--wp--preset--color--bg-raised);
	border: 2px solid var(--wp--preset--color--border);
	border-radius: 4px;
	padding: 16px;
}
.rt-card.is-featured {
	border-left: 3px solid var(--wp--preset--color--accent);
}
.rt-card-thumb {
	height: 110px;
	background:
		radial-gradient(circle at 30% 30%, rgba(255, 194, 75, 0.12), transparent 60%),
		linear-gradient(135deg, var(--wp--preset--color--bg-inset) 0%, var(--wp--preset--color--bg-raised) 100%);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 2px;
	display: grid;
	place-items: center;
	margin-bottom: 12px;
}

/* Overline */
.rt-overline {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--overline);
	letter-spacing: 0.18em;
	color: var(--wp--preset--color--accent);
	text-transform: uppercase;
}

/* Callout */
.rt-callout {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 12px;
	padding: 14px 16px;
	background: var(--wp--preset--color--bg-raised);
	border: 1px solid var(--wp--preset--color--border);
	border-left: 3px solid var(--wp--preset--color--accent);
	border-radius: 2px;
}
.rt-callout.is-warn { border-left-color: var(--wp--preset--color--accent-warm); }
.rt-callout.is-info { border-left-color: var(--wp--preset--color--accent-cool); }
.rt-callout-title {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--overline);
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
	margin: 0 0 6px;
}
.rt-callout.is-warn .rt-callout-title { color: var(--wp--preset--color--accent-warm); }
.rt-callout.is-info .rt-callout-title { color: var(--wp--preset--color--accent-cool); }
.rt-callout-body {
	font-size: var(--wp--preset--font-size--caption);
	color: var(--wp--preset--color--fg-muted);
}

/* Spec panel */
.rt-spec {
	background: var(--wp--preset--color--bg-raised);
	border: 2px solid var(--wp--preset--color--border);
	border-radius: 4px;
	padding: 18px;
}
.rt-spec h4, .rt-spec-title {
	font-family: var(--wp--preset--font-family--display);
	font-size: var(--wp--preset--font-size--overline);
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
	margin: 0 0 14px;
}
.rt-spec-row {
	display: flex;
	justify-content: space-between;
	padding: 6px 0;
	border-bottom: 1px dashed var(--wp--preset--color--border);
	font-size: var(--wp--preset--font-size--caption);
}
.rt-spec-row:last-child { border-bottom: 0; }
.rt-spec-row-label { color: var(--wp--preset--color--fg-subtle); }
.rt-spec-row-value {
	color: var(--wp--preset--color--fg);
	font-weight: 600;
}

/* Newsletter band */
.rt-newsletter {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--bg);
	padding: 28px 32px;
	border-radius: 4px;
}
.rt-newsletter h3, .rt-newsletter h2 {
	color: var(--wp--preset--color--bg) !important;
	margin-top: 0;
}
.rt-newsletter p { color: var(--wp--preset--color--bg); opacity: 0.85; margin: 0; }
.rt-newsletter input[type="email"] {
	padding: 10px 14px;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--body);
	border: 2px solid var(--wp--preset--color--bg);
	background: transparent;
	color: var(--wp--preset--color--bg);
	outline: none;
}
.rt-newsletter input[type="email"]::placeholder {
	color: var(--wp--preset--color--bg);
	opacity: 0.55;
}
.rt-newsletter .wp-block-button__link {
	background: var(--wp--preset--color--bg) !important;
	color: var(--wp--preset--color--accent) !important;
	border-color: var(--wp--preset--color--bg) !important;
}

/* Code block filename strip — applied via .wp-block-code[data-filename] */
.wp-block-code[data-filename] {
	position: relative;
	padding-top: 28px !important;
}
.wp-block-code[data-filename]::before {
	content: attr(data-filename);
	position: absolute;
	top: 0;
	right: 0;
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--bg);
	padding: 2px 10px;
	font-family: var(--wp--preset--font-family--display);
	font-size: 9px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

/* Block style: ghost button (registered in functions.php) */
.wp-block-button.is-style-ghost .wp-block-button__link {
	background: transparent !important;
	color: var(--wp--preset--color--fg) !important;
	border: 2px solid var(--wp--preset--color--border-strong) !important;
}
.wp-block-button.is-style-ghost .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--accent) !important;
	color: var(--wp--preset--color--accent) !important;
}

/* Block style: pixelated image */
.wp-block-image.is-style-pixelated img {
	image-rendering: pixelated;
}

/* Block style: pixel-square list bullets */
.wp-block-list.is-style-pixel-squares {
	list-style: none;
	padding-left: 0;
}
.wp-block-list.is-style-pixel-squares li {
	position: relative;
	padding-left: 20px;
	margin-bottom: 8px;
	color: var(--wp--preset--color--fg-muted);
}
.wp-block-list.is-style-pixel-squares li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 10px;
	width: 6px;
	height: 6px;
	background: var(--wp--preset--color--accent);
}

/* Block style: dashed pixel separator */
.wp-block-separator.is-style-dashed-pixel {
	border: 0;
	border-top: 1px dashed var(--wp--preset--color--border-strong);
	background: transparent;
}

/* Pull-quote — tighter treatment when used inline */
.wp-block-pullquote {
	text-align: left;
	border-left: 0;
}

/* Site header — spacing + sticky */
.rt-site-header {
	padding: 14px 32px;
	border-bottom: 1px solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--bg);
}

/* Archive / search headers */
.rt-archive-head {
	padding: 32px 0;
	border-bottom: 1px dashed var(--wp--preset--color--border-strong);
	margin-bottom: 24px;
}

/* 404 block */
.rt-404-code {
	font-family: var(--wp--preset--font-family--display);
	font-size: 96px;
	color: var(--wp--preset--color--accent);
	line-height: 1;
	text-shadow: 4px 4px 0 var(--wp--preset--color--accent-warm);
	margin: 0 0 20px;
}

/* ===== Editor-only tweaks so authoring looks like front-end ===== */
.editor-styles-wrapper .rt-hero::before,
.editor-styles-wrapper .rt-footer-band::before {
	opacity: 0.14; /* slightly stronger in the editor so designers see it */
}

/* =========================================================================
   Block-theme overrides — ensure FSE templates look like the classic ones.
   When WordPress renders front-page.html / index.html / etc., headings and
   post-excerpt blocks need the same display font + sizing the PHP fallbacks
   get. These rules lock that in.
   ========================================================================= */

/* Section / archive titles — high-specificity selectors so theme.json
   typography defaults don't override us. */
body .wp-site-blocks h2.rt-section-title,
body .wp-site-blocks .wp-block-heading.rt-section-title,
body .rt-section-title {
	font-family: "Press Start 2P", var(--wp--preset--font-family--display), monospace !important;
	font-size: 20px !important;
	line-height: 1.25 !important;
	letter-spacing: 0.02em !important;
	color: var(--wp--preset--color--accent) !important;
	margin: 0 0 24px !important;
	text-transform: none;
}
body .wp-site-blocks h1.rt-archive-title,
body .wp-site-blocks .wp-block-heading.rt-archive-title,
body .rt-archive-title {
	font-family: "Press Start 2P", var(--wp--preset--font-family--display), monospace !important;
	font-size: 28px !important;
	line-height: 1.25 !important;
	letter-spacing: 0.02em !important;
	color: var(--wp--preset--color--accent) !important;
	margin: 0 0 12px !important;
}
body .rt-overline,
body p.rt-overline,
body .wp-site-blocks .rt-overline {
	font-family: "Press Start 2P", var(--wp--preset--font-family--display), monospace !important;
	font-size: 11px !important;
	letter-spacing: 0.18em !important;
	text-transform: uppercase !important;
	color: var(--wp--preset--color--accent) !important;
	margin: 0 0 12px !important;
}

/* Card grid — force a clean 2-col layout with equal-height rows no matter
   what wp-block-post-template's auto CSS emits. */
.wp-block-post-template.rt-card-grid,
.wp-block-post-template.rt-card-grid--2 {
	display: grid !important;
	grid-template-columns: 1fr 1fr !important;
	gap: 24px !important;
	list-style: none !important;
	padding: 0 !important;
	margin: 0 !important;
	align-items: stretch;
}
.wp-block-post-template.rt-card-grid > li,
.wp-block-post-template.rt-card-grid--2 > li {
	display: flex;
	height: 100%;
}
.wp-block-post-template.rt-card-grid > li > .rt-card,
.wp-block-post-template.rt-card-grid--2 > li > .rt-card {
	width: 100%;
}
@media (max-width: 720px) {
	.wp-block-post-template.rt-card-grid,
	.wp-block-post-template.rt-card-grid--2 {
		grid-template-columns: 1fr !important;
	}
}

/* Card interior rhythm — each inner block emits its own wrapper so we style
   the card as a flex column and tighten spacing. */
.rt-card {
	display: flex !important;
	flex-direction: column !important;
	gap: 10px;
	padding: 20px;
	height: 100%;
	background: var(--wp--preset--color--bg-raised);
	border: 2px solid var(--wp--preset--color--border);
	border-radius: 4px;
	overflow: hidden;
}
.rt-card .rt-card-thumb-img,
.rt-card .wp-block-post-featured-image {
	margin: -20px -20px 4px;
	overflow: hidden;
	max-height: 180px;
}
.rt-card .rt-card-thumb-img img,
.rt-card .wp-block-post-featured-image img {
	display: block;
	width: 100% !important;
	height: 180px !important;
	object-fit: cover;
	aspect-ratio: auto !important;
}
.rt-card .rt-card-title,
.rt-card h2.rt-card-title,
.rt-card h3.rt-card-title,
.rt-card .wp-block-post-title {
	font-family: var(--wp--preset--font-family--body) !important;
	font-size: 18px !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
	margin: 0 !important;
	letter-spacing: 0 !important;
	color: var(--wp--preset--color--fg) !important;
	text-transform: none !important;
}
.rt-card .rt-card-title a,
.rt-card .wp-block-post-title a {
	color: var(--wp--preset--color--fg);
	text-decoration: none;
}
.rt-card .rt-card-title a:hover,
.rt-card .wp-block-post-title a:hover {
	color: var(--wp--preset--color--accent);
}
.rt-card .rt-card-excerpt,
.rt-card .wp-block-post-excerpt,
.rt-card .wp-block-post-excerpt__excerpt {
	font-size: 14px !important;
	line-height: 1.55 !important;
	color: var(--wp--preset--color--fg-muted) !important;
	margin: 0 !important;
}
.rt-card .wp-block-post-excerpt__more-text,
.rt-card .wp-block-post-excerpt__more-link,
.rt-card .wp-block-post-excerpt p.wp-block-post-excerpt__more-text {
	display: none !important;
}
.rt-card .rt-overline,
.rt-card .wp-block-post-terms {
	font-family: "Press Start 2P", var(--wp--preset--font-family--display), monospace !important;
	font-size: 10px !important;
	letter-spacing: 0.18em !important;
	text-transform: uppercase !important;
	color: var(--wp--preset--color--accent) !important;
	margin: 0 !important;
}
.rt-card .wp-block-post-terms a {
	color: var(--wp--preset--color--accent);
	text-decoration: none;
}
.rt-card .rt-meta-date,
.rt-card .wp-block-post-date {
	color: var(--wp--preset--color--fg-subtle) !important;
	font-size: 12px !important;
	margin-top: auto !important;
}

/* Post-meta part */
.wp-block-template-part .wp-block-post-date,
.wp-block-template-part .wp-block-post-author-name,
.wp-block-template-part .wp-block-post-terms {
	color: var(--wp--preset--color--fg-subtle);
}
.wp-block-template-part .wp-block-post-author-name a,
.wp-block-template-part .wp-block-post-terms a {
	color: var(--wp--preset--color--fg-subtle);
	text-decoration: none;
}
.wp-block-template-part .wp-block-post-author-name a:hover,
.wp-block-template-part .wp-block-post-terms a:hover {
	color: var(--wp--preset--color--accent);
}

/* Site header — match classic-template styling for block-theme header */
.wp-site-blocks > header.rt-site-header,
.wp-site-blocks .rt-site-header {
	padding: 0;
	border-bottom: 1px solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--bg);
}
.rt-site-header-inner {
	padding: 14px 24px !important;
}
.rt-site-header .wp-block-site-logo img {
	image-rendering: pixelated;
	width: 28px;
	height: 28px;
	border-radius: 50%;
}
.rt-site-header .wp-block-site-title a {
	font-family: var(--wp--preset--font-family--display);
	font-size: 13px;
	color: var(--wp--preset--color--accent);
	text-decoration: none;
	letter-spacing: 0.04em;
}
.rt-site-nav.wp-block-navigation .wp-block-navigation-item__label,
.rt-site-nav .wp-block-navigation-item a {
	font-family: var(--wp--preset--font-family--body);
	color: var(--wp--preset--color--fg-muted);
	text-transform: uppercase;
	font-size: 12px;
	letter-spacing: 0.08em;
	text-decoration: none;
}
.rt-site-nav .wp-block-navigation-item a:hover,
.rt-site-nav .wp-block-navigation-item.current-menu-item a {
	color: var(--wp--preset--color--accent);
}

/* Heading utility font-family class emitted by WP */
.has-display-font-family {
	font-family: var(--wp--preset--font-family--display) !important;
}
.has-body-font-family {
	font-family: var(--wp--preset--font-family--body) !important;
}

/* Pagination — give block-theme query-pagination the same button treatment */
.wp-block-query-pagination {
	justify-content: center;
	margin-top: 32px;
}
.wp-block-query-pagination a,
.wp-block-query-pagination .page-numbers {
	display: inline-block;
	padding: 8px 12px;
	margin: 0 4px;
	color: var(--wp--preset--color--fg-muted);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 2px;
	text-decoration: none;
	font-size: 12px;
}
.wp-block-query-pagination .page-numbers.current {
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--bg);
	border-color: var(--wp--preset--color--accent);
}
.wp-block-query-pagination a:hover {
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent);
}

/* Featured image utility — full-bleed on cards, soft rounded on articles */
.wp-block-post-featured-image {
	margin: 0;
}
.wp-block-post-featured-image img {
	display: block;
	width: 100%;
	height: auto;
}
