/*
Theme Name:  RainbowMiner
Description: Twenty Twenty-Five child theme for rbminer.net with built-in day/night mode (no plugin needed), RainbowMiner palette and styles for the monitoring plugin.
Template:    twentytwentyfive
Version:     1.7.3
Requires at least: 6.7
Requires PHP: 7.4
Author:      RainbowMiner
Text Domain: rainbowminer
License:     GNU General Public License v2 or later
*/

/* ============================================================
   1. Day/Night mechanics
   Light values come from theme.json presets. Dark mode remaps
   the same preset variables under html.theme-dark, so every
   core block and the parent theme follow automatically.
   ============================================================ */

:root { color-scheme: light; }
html.theme-dark { color-scheme: dark; }

html.theme-dark body {
	--wp--preset--color--base:     var(--wp--custom--color--base-dark, #10161d);
	--wp--preset--color--contrast: var(--wp--custom--color--contrast-dark, #e8edf3);
	--wp--preset--color--accent-3: var(--wp--custom--color--accent-3-dark, #161e28);
	--wp--preset--color--accent-4: var(--wp--custom--color--accent-4-dark, #2c3642);
	--wp--preset--color--accent-5: var(--wp--custom--color--accent-5-dark, #1a222c);
	--wp--preset--color--accent-6: var(--wp--custom--color--accent-6-dark, #93a0ad);
}

body,
.wp-block-group,
.wp-block-cover,
.wp-block-button__link {
	transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

/* dim large photos slightly in dark mode; keep badges/logos crisp */
html.theme-dark .wp-block-image img,
html.theme-dark .wp-block-media-text__media img {
	filter: brightness(.88);
}

::selection { background: var(--wp--preset--color--accent-1); color: #10161d; }

/* ============================================================
   2. Day/Night toggle button (injected via functions.php)
   ============================================================ */

.rbm-mode-toggle,
.rbm-scroll-top {
	position: fixed;
	right: 1rem;
	z-index: 9999;
	width: 2.75rem;
	height: 2.75rem;
	display: grid;
	place-items: center;
	padding: 0;
	cursor: pointer;
	border: 1px solid var(--wp--preset--color--accent-4);
	border-radius: 50%;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}
.rbm-mode-toggle { bottom: 1rem; }
.rbm-scroll-top  { bottom: 4.25rem; }
.rbm-scroll-top[hidden] { display: none; }
.rbm-mode-toggle:hover,
.rbm-scroll-top:hover { border-color: var(--wp--preset--color--accent-1); color: var(--wp--preset--color--accent-1); }
.rbm-mode-toggle svg,
.rbm-scroll-top svg { width: 1.35rem; height: 1.35rem; }
.rbm-mode-toggle .rbm-icon-sun  { display: none; }
html.theme-dark .rbm-mode-toggle .rbm-icon-sun  { display: block; }
html.theme-dark .rbm-mode-toggle .rbm-icon-moon { display: none; }

/* ============================================================
   3. Hero with rotating background images
   functions.php scans assets/hero/ (alphabetical) and hands the
   list to assets/hero.js, which crossfades through the images.
   Just drop additional images into assets/hero/ to extend the
   rotation. Add the class "rbm-hero" to the cover block.
   ============================================================ */

.rbm-hero {
	position: relative;
	overflow: hidden;
	display: grid;
	align-content: center;
	min-height: 70vh;
	padding: 3rem 1rem;
	background: #10161d;
	color: #fff;
}
.rbm-hero > * { position: relative; z-index: 2; }
.rbm-hero a:not(.wp-element-button) { color: #ffb14d; }

/* dark overlay above the rotating images, below the content */
.rbm-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: rgba(0, 0, 0, .6);
}

.rbm-hero-layer {
	position: absolute;
	inset: 0;
	z-index: 0;
	margin: 0 !important;           /* layout block-gap would push absolute layers down */
	width: 100% !important;
	max-width: none !important;     /* constrained layout caps children at content-size */
	background-size: cover;
	background-position: center;
	opacity: 0;
	transition: opacity 1.6s ease-in-out;
}
.rbm-hero-layer.is-visible { opacity: 1; }

/* ============================================================
   4. Site polish (feature cards, badges)
   ============================================================ */

.wp-block-cover h1 {
	font-weight: 800;
	letter-spacing: -0.02em;
	text-wrap: balance;
}

/* feature columns as cards (front page) */
.home .wp-block-columns .wp-block-column {
	background: var(--wp--preset--color--accent-5);
	border: 1px solid var(--wp--preset--color--accent-4);
	border-radius: 12px;
	padding: 1.5rem;
}
.home .wp-block-columns .wp-block-column h3 {
	margin-top: 0;
	color: var(--wp--preset--color--accent-1);
}
.home .wp-block-columns .wp-block-column ul {
	margin: 0;
	padding-left: 1.1em;
}
.home .wp-block-columns .wp-block-column li { margin-bottom: .35em; }

/* screenshots as circles (like the original vc_box_shadow_circle), max 440px */
.rbm-circle .wp-block-media-text__media {
	display: flex;
	justify-content: center;
	align-items: center;
}
.rbm-circle .wp-block-media-text__media img {
	width: min(440px, 100%);
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 50%;
	border: 1px solid var(--wp--preset--color--accent-4);
	box-shadow: 0 20px 50px rgba(0, 0, 0, .22);
}

/* shields.io badges */
p img[src*="img.shields.io"] {
	vertical-align: middle;
	margin: 0 .15em;
}

/* ============================================================
   4b. Header: big site title next to the unicorn logo
   ============================================================ */

.wp-block-site-title,
.wp-block-site-title a {
	font-size: clamp(2.25rem, 1.7rem + 2.2vw, 3.5rem);
	font-weight: 800;
	letter-spacing: -0.01em;
	line-height: 1.1;
	text-decoration: none;
}

/* rainbow gradient on the site title */
.wp-block-site-title a {
	background: linear-gradient(to right, #e40303, #ff8c00, #e6c700, #1a9850, #00a2c7, #4053d3, #8f5fd7);
	background-clip: text;
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
}
.wp-block-site-title a:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-1);
	outline-offset: 4px;
}

/* "sticker" logo: white plate with rounded corners, both color modes */
.wp-block-site-logo img,
.wp-block-site-logo.is-style-rounded img {
	border-radius: 14px !important;
	background: #fff;
	width: auto !important;
	height: clamp(64px, 8vw, 110px) !important;
	max-width: none;
	box-shadow: 0 1px 5px rgba(0, 0, 0, .25);
}

/* on phones: title only, no sticker */
@media (max-width: 781px) {
	.wp-block-site-logo { display: none; }
}

/* ============================================================
   5. RBM monitoring plugin integration
   ============================================================ */

.rbm {
	--rbm-accent: var(--wp--preset--color--accent-1);
	--rbm-border: var(--wp--preset--color--accent-4);
}
.rbm button,
.rbm .rbm-btn { color: #10161d; }
.rbm .rbm-expand { color: inherit; }
.rbm-card > header { background: var(--wp--preset--color--accent-5); }
.rbm-card.rbm-card-accent > header { background: var(--rbm-accent); color: #10161d; }
html.theme-dark .rbm-console { background: rgba(0, 0, 0, .35); }

/* status colors: slightly muted in dark mode, text stays dark for contrast */
html.theme-dark .rbm-status-Running > td,
html.theme-dark .rbm-status-Benchmarking > td { background: rgb(106, 165, 122); }
html.theme-dark .rbm-status-Offline > td { background: rgb(186, 118, 152); }
html.theme-dark .rbm-status-Paused > td,
html.theme-dark .rbm-status-Waiting > td { background: rgb(214, 219, 138); }
html.theme-dark .rbm-status-TempAlert > td,
html.theme-dark .rbm-status-Crashing > td { background: rgb(224, 136, 58); }

/* ============================================================
   7. Mobile navigation: 3-line burger + right-side drawer
   (selectors follow the core navigation block markup, WP 6.8)
   ============================================================ */

/* three-line hamburger instead of the default icon */
button.wp-block-navigation__responsive-container-open svg { display: none; }
button.wp-block-navigation__responsive-container-open {
	position: relative;
	width: 2.5rem;
	height: 2.5rem;
}
button.wp-block-navigation__responsive-container-open::before {
	content: "";
	position: absolute;
	left: 7px;
	right: 7px;
	top: 50%;
	height: 2px;
	border-radius: 1px;
	background: currentColor;
	transform: translateY(-50%);
	box-shadow: 0 -8px 0 currentColor, 0 8px 0 currentColor;
}

/* open state: dimmed backdrop + drawer panel on the right.
   Deliberately NO motion: the panel appears instantly. All core
   block animations are disabled so nothing can run or double-run. */
.wp-block-navigation__responsive-container.is-menu-open,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-close,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-dialog {
	animation: none !important;
}

.wp-block-navigation__responsive-container.is-menu-open {
	background: rgba(8, 12, 17, .6) !important;
	padding: 0 !important;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-close {
	display: flex !important;
	justify-content: flex-end;
	width: 100% !important;
	max-width: none !important;
	height: 100%;
	margin: 0 !important;
	padding: 0 !important;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-dialog {
	width: min(260px, 78vw) !important;
	height: 100% !important;
	overflow: auto;
	padding: 4rem 1.25rem 2rem !important;
	background: var(--wp--preset--color--base) !important;
	color: var(--wp--preset--color--contrast) !important;
	box-shadow: -12px 0 32px rgba(0, 0, 0, .35);
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	padding: 0;
}


/* ============================================================
   8. Page header band (subpages): dark banner with the page
   title and a subtle drifting glow - the modern successor of
   the old animated Cryptonite page header.
   ============================================================ */

.rbm-pagehead {
	position: relative;
	overflow: hidden;
	background: #10161d;
	padding: 4rem 1rem 3.25rem;
}
.rbm-pagehead .wp-block-post-title {
	position: relative;
	z-index: 1;
	margin: 0;
	color: #fff;
}
/* RAINBOW shimmer (active): static glows whose colors slowly cycle
   through the full hue circle - no drift, no rainbow line. */
.rbm-pagehead::before {
	content: "";
	position: absolute;
	inset: -20%;
	z-index: 0;
	background: radial-gradient(circle at 30% 40%, rgba(255, 140, 0, .18), transparent 45%),
	            radial-gradient(circle at 75% 60%, rgba(79, 132, 196, .18), transparent 40%),
	            radial-gradient(circle at 55% 20%, rgba(143, 95, 215, .12), transparent 40%);
	animation: rbm-hue-cycle 18s linear infinite;
}
@keyframes rbm-hue-cycle { to { filter: hue-rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
	.rbm-pagehead::before { animation: none; }
}

/* Previous variant (two static-hue glows, no rainbow line) - to switch
   back, delete the block above and un-comment this one:
.rbm-pagehead::before,
.rbm-pagehead::after {
	content: ""; position: absolute; inset: -40%; z-index: 0;
	background: radial-gradient(circle at 30% 40%, rgba(255, 140, 0, .16), transparent 45%),
	            radial-gradient(circle at 75% 60%, rgba(79, 132, 196, .18), transparent 40%);
	animation: rbm-glow-drift 26s linear infinite;
}
.rbm-pagehead::after {
	background: radial-gradient(circle at 60% 30%, rgba(143, 95, 215, .12), transparent 40%);
	animation-duration: 34s; animation-direction: reverse;
}
*/

/* breathing room between the band and the page content */
.rbm-pagehead + .wp-block-post-content {
	padding-top: 2.5rem;
	padding-bottom: 3rem;
}
