/*
Theme Name: Electric Ant
Theme URI: https://www.electricant.space/
Author: electric ant / CMPRSSN RTFCT
Author URI: https://www.electricant.space/
Description: A stark 1-bit, xerox-punk zine theme for electric ant — electronic music and weird shit from the unceded Pocumtuc / Nonotuck land. Left-justified Monaco bitmap logotype, rectangular knocked-out section labels, DIP-8 chips marching end-to-end as filler, glitch textures and film-sprocket cut lines. Pure black & white, high contrast, built to look like a photocopied show flyer that gained sentience.
Version: 1.0.15
Requires at least: 6.5
Tested up to: 7.0
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: electric-ant
Tags: black-and-white, one-column, two-columns, custom-menu, custom-logo, featured-images, blog, editor-style, threaded-comments, translation-ready
Version note: 1.0.14 — chiprail (electric_ant_chiprail_data_uri() in inc/icons.php) is now an 8-chip repeating squad instead of a single tile; two chips per squad break formation with a ±3° tilt about their own center, so the march doesn't read as perfectly mechanical. Also: .ea-tags a and .ea-pagination set to a flat 1rem. single.php lead art (.ea-article__thumb) renders above the headline/meta header, no longer glitch-shakes on hover (masthead logo keeps its glitch). .ea-nav a 1.5rem flat; .ea-tagline clamp max raised to 1.5rem. Native View Transitions for card-to-article navigation (electric_ant_vt_name() in functions.php, used by content-card.php/single.php; prefers-reduced-motion disables it). Fixed empty-thumb chip hover (notch + pin-1 dot track the tile backdrop via --ea-glyph-cut instead of a hardcoded black fill). Monaco never oblique, Avenir body, landscape DIP-8 chips marching end-to-end in the rail + a single chip in empty thumbs, left-justified logotype w/ ~1px leading, strict B&W, rectangular elements.
*/

/* ============================================================
   ELECTRIC ANT — 1-bit xerox-punk zine theme
   ------------------------------------------------------------
   design tokens
   ============================================================ */

@font-face {
	font-family: 'Monaco9px';
	src: url('assets/fonts/Monaco9pxBitmap.otf') format('opentype');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

:root {
	--ea-black: #000;
	--ea-white: #fff;
	/* the whole site is a photocopy: paper is black, ink is white */
	--ea-bg: var(--ea-black);
	--ea-fg: var(--ea-white);

	--ea-pixel: 'Monaco9px', 'Courier New', ui-monospace, monospace;
	--ea-body: 'Avenir Next', 'Avenir', 'Nunito Sans', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
	--ea-mono: ui-monospace, 'SFMono-Regular', 'Menlo', 'Consolas', monospace;

	--ea-measure: 68ch;
	--ea-gap: clamp(1rem, 3vw, 2.25rem);
	--ea-rule: 3px;          /* hard xerox rule weight */
	--ea-maxw: 1180px;

	/* pixel-stepped notch size for labels/cards */
	--ea-notch: 6px;
}

/* ============================================================
   reset-ish base
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html {
	background: var(--ea-bg);
	-webkit-text-size-adjust: 100%;
	scrollbar-color: var(--ea-white) var(--ea-black);
}

body {
	margin: 0;
	background: var(--ea-bg);
	color: var(--ea-fg);
	font-family: var(--ea-body);
	font-size: clamp(15px, 1rem + 0.15vw, 18px);
	line-height: 1.5;
	font-kerning: normal;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

img, svg, video, canvas { max-width: 100%; height: auto; display: block; }

/* photos read like 1-bit photocopies: grayscale + brutal contrast + pixelated scaling */
.wp-post-image,
.ea-figure img,
article img:not(.ea-icon) {
	filter: grayscale(1) contrast(1.35) brightness(1.02);
	image-rendering: -webkit-optimize-contrast;
}

/* ============================================================
   view transitions — card grid morphs into the article
   ------------------------------------------------------------
   opts in to native cross-document view transitions for MPA
   navigation (Chrome/Edge 126+; other browsers just navigate
   normally, no fallback needed). the thumb + headline share a
   view-transition-name across the listing and single templates
   (assigned per-post in PHP — see electric_ant_vt_name() in
   functions.php, used by content-card.php and single.php), so
   the browser glides each one from its card position/size into
   its article position/size instead of a flat cross-fade.
   ============================================================ */

@view-transition {
	navigation: auto;
}

::view-transition-group(*) {
	animation-duration: 0.32s;
	animation-timing-function: cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-reduced-motion: reduce) {
	::view-transition-group(*),
	::view-transition-old(*),
	::view-transition-new(*) {
		animation: none !important;
	}
}

a {
	color: var(--ea-fg);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}
a:hover, a:focus {
	background: var(--ea-white);
	color: var(--ea-black);
	text-decoration: none;
}

::selection { background: var(--ea-white); color: var(--ea-black); }

:focus-visible {
	outline: var(--ea-rule) solid var(--ea-white);
	outline-offset: 2px;
}

hr {
	border: 0;
	height: var(--ea-rule);
	background: var(--ea-white);
	margin: var(--ea-gap) 0;
}

/* ============================================================
   typography
   ============================================================ */

h1, h2, h3, h4, h5, h6 {
	font-family: var(--ea-pixel);
	font-weight: normal;
	font-style: normal; /* Monaco 9px is never oblique or italic */
	line-height: 1.05;
	letter-spacing: 0.02em;
	margin: 1.4em 0 0.5em;
	/* the Monaco 9px bitmap font has a very narrow space glyph — open it up
	   so multi-word headings stay legible */
	word-spacing: 0.18em;
}

h1 { font-size: clamp(2.2rem, 7vw, 4.5rem); }
h2 { font-size: clamp(1.7rem, 4.5vw, 2.8rem); }
h3 { font-size: clamp(1.35rem, 3vw, 1.9rem); }
h4 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

.entry-content p,
.ea-prose p { hyphens: auto; }

blockquote {
	margin: 1.5em 0;
	padding: 0.75em 1.25em;
	border-left: var(--ea-notch) solid var(--ea-white);
	font-style: italic; /* body font (Avenir) may be italic; Monaco never is */
}

code, pre, kbd, samp { font-family: var(--ea-mono); }
pre {
	border: 2px solid var(--ea-white);
	padding: 1rem;
	overflow-x: auto;
	font-size: 0.85em;
}
:not(pre) > code {
	background: var(--ea-white);
	color: var(--ea-black);
	padding: 0.05em 0.35em;
}

/* blinking terminal cursor accent */
.ea-caret::after {
	content: "\2588";
	margin-left: 0.12em;
	animation: ea-blink 1s steps(1) infinite;
}
@keyframes ea-blink { 50% { opacity: 0; } }

/* ============================================================
   layout scaffolding
   ============================================================ */

.ea-wrap {
	width: min(100% - 2rem, var(--ea-maxw));
	margin-inline: auto;
}
.ea-wrap--narrow { --ea-maxw: 820px; }

.ea-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--ea-white);
	color: var(--ea-black);
	padding: 0.5rem 1rem;
	font-family: var(--ea-pixel);
	z-index: 999;
}
.ea-skip-link:focus { left: 0; }

.site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}
.site-main { flex: 1 0 auto; padding-block: var(--ea-gap); }

/* ============================================================
   the inverted pixel section label — the signature element
   white pixel text knocked out of a black bar with stepped
   pixel-notch corners, sitting on a thin white keyline
   ============================================================ */

.ea-label {
	display: inline-block;
	font-family: var(--ea-pixel);
	font-style: normal;
	font-size: clamp(1rem, 2.2vw, 1.35rem);
	line-height: 1;
	letter-spacing: 0.06em;
	color: var(--ea-black);
	background: var(--ea-white);
	padding: 0.5em 0.85em 0.42em;
	margin: 0 0 0.6em;
	word-spacing: 0.18em;
	/* clean rectangle — no frilly notched corners */
	text-transform: lowercase;
}
/* the "knocked out" variant: white text in a black bar (as on the cover pages) */
.ea-label--ko {
	color: var(--ea-white);
	background: var(--ea-black);
	box-shadow: 0 0 0 2px var(--ea-white);
}

/* section heading wrapper puts a label above a hairline rule */
.ea-section-head {
	margin-bottom: var(--ea-gap);
}
.ea-section-head::after {
	content: "";
	display: block;
	height: 2px;
	background: var(--ea-white);
	margin-top: 0.35em;
}

/* ============================================================
   masthead — left-justified upright pixel logotype on solid black
   ============================================================ */

.ea-masthead {
	position: relative;
	background: var(--ea-black);
	overflow: hidden;
	border-bottom: var(--ea-rule) solid var(--ea-white);
	isolation: isolate;
}

.ea-masthead__inner {
	position: relative;
	padding: clamp(1.5rem, 5vw, 3.5rem) 0 clamp(1.25rem, 3vw, 2rem);
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem;
}

.ea-logo {
	margin: 0;
	/* left-justified, ~1 imaginary pixel of leading between the two lines.
	   Monaco 9px has a tall em box, so the visual lines only touch near 0.5. */
	line-height: 0.5;
	text-align: left;
}
.ea-logo a {
	text-decoration: none;
	color: var(--ea-white);
	display: inline-block;
}
.ea-logo a:hover, .ea-logo a:focus { background: none; color: var(--ea-white); }
.ea-logo__line {
	display: block;
	font-family: var(--ea-pixel);
	font-style: normal;
	font-size: clamp(3rem, 14vw, 8.5rem);
	letter-spacing: -0.01em;
}
.ea-logo__line--2 { margin-left: 0; } /* left-justified with line 1 */
.ea-logo img { /* custom logo support */
	filter: none;
	image-rendering: pixelated;
	max-height: 140px;
	width: auto;
}

.ea-tagline {
	position: relative;
	font-family: var(--ea-pixel);
	font-style: normal;
	font-size: clamp(0.85rem, 1.8vw, 1.5rem);
	letter-spacing: 0.05em;
	word-spacing: 0.18em;
	padding: 0.55rem 1rem;
	color: var(--ea-black);
	background: var(--ea-white);
	text-align: center;
	overflow-wrap: anywhere;
}

/* ============================================================
   primary navigation — pixel labels, invert on hover
   ============================================================ */

.ea-nav {
	background: var(--ea-black);
	border-bottom: 2px solid var(--ea-white);
}
.ea-nav__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem 0.5rem;
	padding: 0.5rem 0;
}
.ea-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.5rem;
}
.ea-nav a {
	font-family: var(--ea-pixel);
	font-size: 1.5rem;
	text-decoration: none;
	display: inline-block;
	padding: 0.3em 0.7em;
	border: 2px solid transparent;
}
.ea-nav a:hover,
.ea-nav .current-menu-item > a {
	background: var(--ea-white);
	color: var(--ea-black);
}
.ea-nav .menu-item-has-children > a::after { content: " \25be"; }
.ea-nav .sub-menu {
	position: absolute;
	background: var(--ea-black);
	border: 2px solid var(--ea-white);
	padding: 0.35rem;
	z-index: 40;
	display: none;
	min-width: 180px;
}
.ea-nav li { position: relative; }
.ea-nav li:hover > .sub-menu,
.ea-nav li:focus-within > .sub-menu { display: block; }

.ea-nav__toggle {
	display: none;
	font-family: var(--ea-pixel);
	background: var(--ea-white);
	color: var(--ea-black);
	border: 0;
	padding: 0.4em 0.8em;
	font-size: 1rem;
	cursor: pointer;
}

@media (max-width: 720px) {
	.ea-nav__toggle { display: inline-block; }
	.ea-nav ul { display: none; width: 100%; flex-direction: column; }
	.ea-nav.is-open ul { display: flex; }
}

/* ============================================================
   integrated-circuit rail — the DIP-chip divider that marches
   across the zine pages
   ============================================================ */

.ea-chiprail {
	--chip: 30px;
	height: var(--chip);
	margin: var(--ea-gap) 0;
	background-image: var(--ea-chip);
	background-repeat: repeat-x;
	background-position: center;
	background-size: auto var(--chip);
}

/* dashed film-sprocket cut line */
.ea-cut {
	border: 0;
	height: 0;
	border-top: 3px dashed var(--ea-white);
	margin: var(--ea-gap) 0;
	opacity: 0.85;
}

/* ============================================================
   post grid / archive — brutalist bordered cards
   ============================================================ */

.ea-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: var(--ea-gap);
}

.ea-card {
	border: var(--ea-rule) solid var(--ea-white);
	background: var(--ea-black);
	display: flex;
	flex-direction: column;
	position: relative;
	transition: transform 0.08s steps(2);
}
.ea-card:hover { transform: translate(-2px, -2px); }
.ea-card:hover { box-shadow: 6px 6px 0 var(--ea-white); }

.ea-card__thumb {
	border-bottom: var(--ea-rule) solid var(--ea-white);
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: #111;
}
.ea-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
/* empty thumb = a single DIP-8 chip (filler graphic, same 180° orientation).
   the notch + pin-1 dot are "holes" cut through the chip that show the
   backdrop, so they're painted with --ea-glyph-cut, not a fixed color —
   that's what lets the hover invert flip the whole glyph as one unit. */
.ea-card__thumb--empty {
	display: grid;
	place-items: center;
	background: var(--ea-black);
	--ea-glyph-cut: var(--ea-black);
}
.ea-card__thumb--empty .ea-icon {
	width: 55%;
	color: var(--ea-white);
}
.ea-card__thumb--empty .ea-icon .ea-icon__cut { fill: var(--ea-glyph-cut); }
/* hover = photo-negative invert of the whole glyph tile */
.ea-card:hover .ea-card__thumb--empty {
	background: var(--ea-white);
	--ea-glyph-cut: var(--ea-white);
}
.ea-card:hover .ea-card__thumb--empty .ea-icon {
	color: var(--ea-black);
}
.ea-nav a { word-spacing: 0.14em; }
.ea-card__body { padding: 1rem 1.15rem 1.35rem; }
.ea-card__title { margin: 0.2em 0 0.35em; font-size: 1.5rem; line-height: 1.05; }
.ea-card__title a { text-decoration: none; }
.ea-card__title a:hover { background: var(--ea-white); color: var(--ea-black); }
.ea-card__meta {
	font-family: var(--ea-mono);
	font-size: 0.72rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	opacity: 0.75;
}
.ea-card__excerpt { font-size: 0.95rem; margin-top: 0.5rem; }

/* ============================================================
   single / page article
   ============================================================ */

.ea-article { }
.ea-article__header { margin-bottom: var(--ea-gap); }
.ea-article__title { margin: 0.1em 0 0.2em; }
.ea-article__meta {
	font-family: var(--ea-mono);
	font-size: 0.78rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	opacity: 0.8;
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1rem;
}
.ea-article__thumb {
	margin: var(--ea-gap) 0;
	border: var(--ea-rule) solid var(--ea-white);
}

.entry-content {
	max-width: var(--ea-measure);
	text-align: justify;
	text-justify: inter-word;
}
.entry-content > * { margin-inline: auto; }
.entry-content img, .entry-content figure { text-align: initial; }
.entry-content figure { margin: 1.5em auto; }
.entry-content figcaption {
	font-family: var(--ea-mono);
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	background: var(--ea-white);
	color: var(--ea-black);
	display: inline-block;
	padding: 0.2em 0.5em;
	margin-top: 0.35em;
}
.entry-content a { text-underline-offset: 2px; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li { margin-bottom: 0.35em; }
.entry-content li::marker { content: "\25AA  "; } /* the zine's black-square bullets */
.entry-content ol > li::marker { content: counter(list-item) ". "; }

.ea-tags {
	margin-top: var(--ea-gap);
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}
.ea-tags a {
	font-family: var(--ea-pixel);
	font-size: 1rem;
	text-decoration: none;
	border: 2px solid var(--ea-white);
	padding: 0.2em 0.6em;
}

/* ============================================================
   glitch — for the masthead logo & featured images on hover
   ============================================================ */

.ea-glitch { position: relative; display: inline-block; }
.ea-glitch:hover,
.ea-glitch.is-glitching { animation: ea-shake 0.28s steps(2) 2; }
@keyframes ea-shake {
	/* pure translate + horizontal slice — no skew (Monaco stays upright) */
	0% { transform: translate(0,0); }
	25% { transform: translate(-3px,1px); }
	50% { transform: translate(2px,-2px); clip-path: inset(20% 0 30% 0); }
	75% { transform: translate(-2px,0); clip-path: inset(60% 0 5% 0); }
	100% { transform: translate(0,0); clip-path: inset(0 0 0 0); }
}

/* ============================================================
   footer / colophon
   ============================================================ */

.site-footer {
	background: var(--ea-white);
	color: var(--ea-black);
	border-top: var(--ea-rule) solid var(--ea-white);
	padding: var(--ea-gap) 0 calc(var(--ea-gap) * 1.5);
	margin-top: var(--ea-gap);
	position: relative;
}
.site-footer a { color: var(--ea-black); }
.site-footer a:hover { background: var(--ea-black); color: var(--ea-white); }
.site-footer .ea-label { color: var(--ea-white); background: var(--ea-black); }
.site-footer__cols {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: var(--ea-gap);
}
.ea-colophon {
	font-family: var(--ea-mono);
	font-size: 0.78rem;
	letter-spacing: 0.03em;
	margin-top: var(--ea-gap);
	border-top: 3px solid var(--ea-black);
	padding-top: 1rem;
	line-height: 1.6;
}
.ea-colophon .ea-land { text-transform: uppercase; }

.footer-widgets .widget { margin-bottom: 1.25rem; }
.footer-widgets .widget-title {
	font-family: var(--ea-pixel);
	font-size: 1.1rem;
	margin: 0 0 0.5rem;
}
.footer-widgets ul { list-style: none; margin: 0; padding: 0; }
.footer-widgets li { margin-bottom: 0.35em; font-family: var(--ea-mono); font-size: 0.82rem; }

/* ============================================================
   comments
   ============================================================ */

.comments-area { margin-top: calc(var(--ea-gap) * 1.5); max-width: var(--ea-measure); }
.comment-list { list-style: none; padding: 0; }
.comment-body {
	border: 2px solid var(--ea-white);
	padding: 1rem;
	margin-bottom: 1rem;
}
.comment-author { font-family: var(--ea-pixel); }
.comment-metadata { font-family: var(--ea-mono); font-size: 0.72rem; opacity: 0.7; }
.comment-list .children { list-style: none; margin-left: 1.25rem; padding-left: 1rem; border-left: 2px solid var(--ea-white); }

/* forms */
input, textarea, select {
	font-family: var(--ea-mono);
	background: var(--ea-black);
	color: var(--ea-white);
	border: 2px solid var(--ea-white);
	padding: 0.55em 0.7em;
	font-size: 1rem;
	max-width: 100%;
}
input:focus, textarea:focus { outline: none; box-shadow: 0 0 0 2px var(--ea-white); }
label { font-family: var(--ea-pixel); display: block; margin-bottom: 0.3em; }

button, .ea-btn, input[type="submit"] {
	font-family: var(--ea-pixel);
	font-size: 1rem;
	background: var(--ea-white);
	color: var(--ea-black);
	border: 2px solid var(--ea-white);
	padding: 0.5em 1.1em;
	cursor: pointer;
	text-decoration: none;
	display: inline-block;
	transition: none;
}
button:hover, .ea-btn:hover, input[type="submit"]:hover {
	background: var(--ea-black);
	color: var(--ea-white);
}

/* search form */
.ea-search {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}
.ea-search input[type="search"] { flex: 1 1 200px; }

/* ============================================================
   pagination
   ============================================================ */

.ea-pagination {
	margin: calc(var(--ea-gap) * 1.5) 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	font-family: var(--ea-pixel);
	font-size: 1rem;
}
.ea-pagination .page-numbers {
	border: 2px solid var(--ea-white);
	padding: 0.35em 0.8em;
	text-decoration: none;
}
.ea-pagination .current {
	background: var(--ea-white);
	color: var(--ea-black);
}

/* ============================================================
   hero / front page intro
   ============================================================ */

.ea-hero {
	padding: calc(var(--ea-gap) * 1.25) 0;
	border-bottom: 2px solid var(--ea-white);
}
.ea-hero__lede {
	font-family: var(--ea-body);
	font-size: clamp(1.1rem, 2.5vw, 1.5rem);
	max-width: 40ch;
	line-height: 1.35;
}
.ea-hero__lede strong { background: var(--ea-white); color: var(--ea-black); padding: 0 0.15em; }

/* two-column zine layout on wide screens for front page */
.ea-columns {
	display: grid;
	gap: var(--ea-gap);
}
@media (min-width: 900px) {
	.ea-columns--sidebar { grid-template-columns: 1fr minmax(240px, 320px); }
}

.ea-aside .widget,
.ea-aside .ea-box { margin-bottom: var(--ea-gap); }
.ea-box {
	border: var(--ea-rule) solid var(--ea-white);
	padding: 1rem 1.15rem 1.25rem;
}

/* utility */
.screen-reader-text {
	position: absolute !important;
	clip-path: inset(50%);
	width: 1px; height: 1px;
	overflow: hidden;
	white-space: nowrap;
}
.ea-invert { background: var(--ea-white); color: var(--ea-black); }
.alignwide { width: min(100%, calc(var(--ea-maxw) - 2rem)); }
.alignfull { width: 100vw; margin-left: calc(50% - 50vw); }
.aligncenter { margin-inline: auto; }
.alignleft { float: left; margin: 0 1.25rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.25rem; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
	.ea-caret::after { opacity: 1; }
}
