/*
Fallout FX for Blocksy - plugin stylesheet.
Light = Vault-Tec (blue/yellow/white). Dark = Pip-Boy terminal via body.fallout-terminal.
*/

/* ==========================================================================
   FALLOUT CHILD THEME FOR BLOCKSY
   --------------------------------------------------------------------------
   Light mode  = Vault-Tec (blue / yellow / white)
   Dark mode   = Pip-Boy terminal (green on near-black)
   Dark mode is triggered by the body.fallout-terminal class, toggled by the
   Pip-Boy button injected from functions.php (remembered in localStorage,
   respects prefers-color-scheme on first visit).
   We drive the whole look through Blocksy's own CSS variables
   (--theme-palette-color-1..8), so headers, cards, buttons and blog layout
   all pick the theme up automatically.
   ========================================================================== */

/* ---------- Light mode: Vault-Tec palette ----------
   NOTE: tokens are set on `body`, not `:root`. Blocksy prints its own
   palette on :root via dynamic styles, and body-level custom properties
   win for the whole page because they resolve from the closer ancestor. */
body {
	/* Blocksy global palette tokens (light) */
	--theme-palette-color-1: #0058a8; /* vault blue (primary brand) */
	--theme-palette-color-2: #003d75; /* deep vault blue (hover/alt) */
	--theme-palette-color-3: #fde22a; /* vault yellow (accents, badges) */
	--theme-palette-color-4: #0b2545; /* dark ink (headings) */
	--theme-palette-color-5: #2c3e50; /* body text */
	--theme-palette-color-6: #5d6d7e; /* muted text */
	--theme-palette-color-7: #ffffff; /* white */
	--theme-palette-color-8: #f2f5f9; /* card / section background */

	--fallout-font-mono: "Share Tech Mono", "Courier New", monospace;
	--fallout-border-thick: 3px solid var(--theme-palette-color-1);

	background: var(--theme-palette-color-7);
}

h1, h2, h3, h4, h5, h6,
.entry-title,
.hero-title {
	font-family: var(--fallout-font-mono);
	letter-spacing: 0.02em;
}

/* chunky vault-tech frame on post cards */
.entry-card,
.entries .entry-card {
	border: var(--fallout-border-thick);
	border-radius: 0;
	box-shadow: 6px 6px 0 rgba(0, 88, 168, 0.18);
}

/* retro terminal buttons in light mode */
.wp-block-button__link,
.button,
input[type="submit"],
.ct-button {
	font-family: var(--fallout-font-mono);
	text-transform: uppercase;
	letter-spacing: 0.12em;
	border: 3px solid var(--theme-palette-color-2);
	border-radius: 0;
}

/* vault yellow highlight strip under section headings */
.widget-title,
.ct-widget .widget-title {
	border-bottom: 4px solid var(--theme-palette-color-3);
	display: inline-block;
	padding-bottom: 4px;
}

/* ==========================================================================
   VAULT-TEC BOOST (light mode only) — more blue and yellow
   Scoped with body:not(.fallout-terminal) so none of this leaks into
   Pip-Boy dark mode. Placed BEFORE the dark-mode section so the
   body.fallout-terminal rules keep winning there on equal specificity.
   ========================================================================== */
body:not(.fallout-terminal) .site-header {
	border-bottom: 5px solid var(--theme-palette-color-3);
}

body:not(.fallout-terminal) .site-title a {
	color: var(--theme-palette-color-1);
}

/* category badges go full vault yellow */
body:not(.fallout-terminal) .entry-card .meta-categories a,
body:not(.fallout-terminal) .entry-card .cat-links a,
body:not(.fallout-terminal) .entry-card .posted-in a,
body:not(.fallout-terminal) .entry-meta .meta-categories a {
	background: var(--theme-palette-color-3);
	color: var(--theme-palette-color-4);
	font-family: var(--fallout-font-mono);
	font-weight: bold;
	padding: 3px 10px;
	border-radius: 0;
	text-decoration: none;
}

/* chunkier blue card frames with a yellow crown */
body:not(.fallout-terminal) .entry-card,
body:not(.fallout-terminal) .entries .entry-card {
	border: 3px solid var(--theme-palette-color-1);
	border-top: 8px solid var(--theme-palette-color-3);
}

/* post titles and content links go vault blue */
body:not(.fallout-terminal) .entry-title a,
body:not(.fallout-terminal) .entry-content a {
	color: var(--theme-palette-color-1);
}

/* buttons: blue fill, yellow type */
body:not(.fallout-terminal) .wp-block-button__link,
body:not(.fallout-terminal) .button,
body:not(.fallout-terminal) input[type="submit"],
body:not(.fallout-terminal) .ct-button,
body:not(.fallout-terminal) .entry-card .entry-button a {
	background: var(--theme-palette-color-1);
	color: var(--theme-palette-color-3);
	border: 3px solid var(--theme-palette-color-2);
}

/* footer goes full vault blue */
body:not(.fallout-terminal) footer,
body:not(.fallout-terminal) .site-footer,
body:not(.fallout-terminal) .ct-footer {
	background: var(--theme-palette-color-1);
	color: #ffffff;
}

body:not(.fallout-terminal) footer a,
body:not(.fallout-terminal) .site-footer a {
	color: var(--theme-palette-color-3);
}

body:not(.fallout-terminal) footer .widget-title {
	color: var(--theme-palette-color-3);
	border-bottom-color: var(--theme-palette-color-3);
}

/* pagination picks up the colors too */
body:not(.fallout-terminal) .page-numbers {
	border: 2px solid var(--theme-palette-color-1);
	color: var(--theme-palette-color-1);
	font-family: var(--fallout-font-mono);
}

body:not(.fallout-terminal) .page-numbers.current {
	background: var(--theme-palette-color-1);
	color: var(--theme-palette-color-3);
}

/* ==========================================================================
   DARK MODE: Pip-Boy terminal
   ========================================================================== */
body.fallout-terminal {
	--theme-palette-color-1: #33ff66; /* pip-boy green (primary) */
	--theme-palette-color-2: #1fd655; /* green hover */
	--theme-palette-color-3: #ffb000; /* amber (warnings, badges) */
	--theme-palette-color-4: #d7ffe0; /* bright green-white (headings) */
	--theme-palette-color-5: #9fe8b4; /* body text */
	--theme-palette-color-6: #4d7c5c; /* muted text */
	--theme-palette-color-7: #0a0f0a; /* near-black green (background) */
	--theme-palette-color-8: #101a10; /* card / section background */

	--fallout-border-thick: 2px solid var(--theme-palette-color-1);

	background: #050805;
	color: var(--theme-palette-color-5);
}

/* CRT scanline overlay */
body.fallout-terminal::after {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 99999;
	background: repeating-linear-gradient(
		to bottom,
		rgba(0, 0, 0, 0) 0px,
		rgba(0, 0, 0, 0) 2px,
		rgba(0, 0, 0, 0.22) 3px,
		rgba(0, 0, 0, 0.22) 4px
	);
	mix-blend-mode: multiply;
}

/* soft CRT vignette */
body.fallout-terminal::before {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 99998;
	background: radial-gradient(
		ellipse at center,
		rgba(0, 0, 0, 0) 55%,
		rgba(0, 0, 0, 0.45) 100%
	);
}

/* green phosphor glow on text */
body.fallout-terminal,
body.fallout-terminal p,
body.fallout-terminal h1, body.fallout-terminal h2,
body.fallout-terminal h3, body.fallout-terminal h4,
body.fallout-terminal h5, body.fallout-terminal h6,
body.fallout-terminal a {
	text-shadow: 0 0 6px rgba(51, 255, 102, 0.45);
}

body.fallout-terminal h1, body.fallout-terminal h2,
body.fallout-terminal h3, body.fallout-terminal h4,
body.fallout-terminal h5, body.fallout-terminal h6,
body.fallout-terminal .entry-title,
body.fallout-terminal .hero-title {
	color: var(--theme-palette-color-4);
	font-family: var(--fallout-font-mono);
}

body.fallout-terminal p,
body.fallout-terminal li,
body.fallout-terminal .entry-content {
	font-family: var(--fallout-font-mono);
	color: var(--theme-palette-color-5);
}

body.fallout-terminal a {
	color: var(--theme-palette-color-1);
}

body.fallout-terminal a:hover {
	color: var(--theme-palette-color-3);
}

/* terminal-framed cards in dark mode */
body.fallout-terminal .entry-card,
body.fallout-terminal .entries .entry-card {
	border: 2px solid var(--theme-palette-color-1);
	box-shadow: 0 0 18px rgba(51, 255, 102, 0.22), inset 0 0 24px rgba(51, 255, 102, 0.05);
	background: var(--theme-palette-color-8);
}

/* terminal buttons */
body.fallout-terminal .wp-block-button__link,
body.fallout-terminal .button,
body.fallout-terminal input[type="submit"],
body.fallout-terminal .ct-button {
	background: transparent;
	color: var(--theme-palette-color-1);
	border: 2px solid var(--theme-palette-color-1);
	text-shadow: 0 0 6px rgba(51, 255, 102, 0.6);
}

body.fallout-terminal .wp-block-button__link:hover,
body.fallout-terminal .button:hover,
body.fallout-terminal input[type="submit"]:hover,
body.fallout-terminal .ct-button:hover {
	background: var(--theme-palette-color-1);
	color: #050805;
	text-shadow: none;
}

/* header / footer go terminal dark */
body.fallout-terminal header,
body.fallout-terminal .site-header,
body.fallout-terminal footer,
body.fallout-terminal .site-footer {
	background: #050805;
	border-color: var(--theme-palette-color-1);
}

/* ---------- Pip-Boy toggle button ---------- */
#fallout-mode-toggle {
	position: fixed;
	bottom: 22px;
	right: 22px;
	z-index: 100000;
	font-family: "Share Tech Mono", "Courier New", monospace;
	font-size: 13px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	padding: 10px 16px;
	cursor: pointer;
	background: #fde22a;
	color: #0b2545;
	border: 3px solid #0b2545;
	border-radius: 0;
	box-shadow: 4px 4px 0 rgba(11, 37, 69, 0.35);
	transition: transform 0.12s ease;
}

#fallout-mode-toggle:hover {
	transform: translate(-1px, -1px);
}

body.fallout-terminal #fallout-mode-toggle {
	background: transparent;
	color: #33ff66;
	border: 2px solid #33ff66;
	box-shadow: 0 0 14px rgba(51, 255, 102, 0.35);
	text-shadow: 0 0 6px rgba(51, 255, 102, 0.6);
}
