/*
Theme Name: Sunfall Systems
Theme URI: https://sunfallsystems.com
Author: Tristan Seal
Author URI: https://sunfallsystems.com
Description: Ultra-high-performance digital magazine theme with Eco-Frutiger Aero aesthetics. Optimized for ad arbitrage and 100/100 PageSpeed scores.
Version: 1.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sunfall-systems
Tags: blog, news, custom-menu, featured-images, custom-logo, one-column, two-columns, responsive-layout
*/

/* ==========================================================================
   Modern CSS Reset
   ========================================================================== */

*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	min-height: 100vh;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
	display: block;
	max-width: 100%;
	height: auto;
}

input,
button,
textarea,
select {
	font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
	overflow-wrap: break-word;
}

ul,
ol {
	list-style: none;
}

a {
	color: inherit;
	text-decoration: none;
}

/* ==========================================================================
   Design Tokens — Eco-Frutiger Aero
   ========================================================================== */

:root {
	--color-primary: #4CAF50;
	--color-primary-light: #66BB6A;
	--color-primary-dark: #2E7D32;
	--color-accent: #00B0FF;
	--color-accent-deep: #0091EA;
	--color-bg-base: #FFFFFF;
	--color-glow-emerald: #00E676;
	--color-glow-teal: #006064;
	--color-text: #1C2833;
	--color-text-muted: #455A64;

	--glass-bg: rgba(255, 255, 255, 0.45);
	--glass-border-top: rgba(255, 255, 255, 1);
	--glass-border-left: rgba(255, 255, 255, 1);
	--glass-border-rest: rgba(255, 255, 255, 0.55);
	--glass-blur: 16px;

	--shadow-soft: 0 8px 32px 0 rgba(0, 172, 193, 0.15);
	--shadow-glow-green: 0 4px 20px rgba(76, 175, 80, 0.35);
	--shadow-glow-cyan: 0 6px 24px rgba(0, 176, 255, 0.25);

	--radius-organic: 16px;
	--radius-pill: 24px;

	--font-display: "Segoe UI", Candara, "Trebuchet MS", sans-serif;
	--font-body: "Segoe UI", Candara, "Trebuchet MS", sans-serif;

	--header-height: 72px;
	--content-max: 1200px;
	--sidebar-width: 320px;
	--gap: 1.5rem;
}

/* ==========================================================================
   Global Background — Tropical Water Mesh
   ========================================================================== */

body {
	font-family: var(--font-body);
	font-size: 1.0625rem;
	color: var(--color-text);
	background-color: #00796B;
	background-image:
		radial-gradient(ellipse 80% 60% at 15% 85%, rgba(76, 175, 80, 0.55) 0%, transparent 55%),
		radial-gradient(ellipse 70% 50% at 85% 15%, rgba(0, 176, 255, 0.45) 0%, transparent 50%),
		radial-gradient(ellipse 90% 70% at 50% 100%, rgba(0, 230, 118, 0.3) 0%, transparent 60%),
		radial-gradient(ellipse 60% 40% at 70% 70%, rgba(0, 96, 100, 0.35) 0%, transparent 55%),
		linear-gradient(175deg, #00B0FF 0%, #26C6DA 18%, #4CAF50 42%, #00897B 72%, #006064 100%);
	background-attachment: fixed;
	background-size: cover;
	background-repeat: no-repeat;
}

/* ==========================================================================
   Layout Shell
   ========================================================================== */

.site-wrapper {
	width: 100%;
	max-width: var(--content-max);
	margin: 0 auto;
	padding: 0 1.25rem;
}

.site-main {
	padding: calc(var(--header-height) + 1.5rem) 0 3rem;
}

/* ==========================================================================
   Vista Glass Panels
   ========================================================================== */

.glass-panel {
	position: relative;
	background: var(--glass-bg);
	background-image: linear-gradient(
		145deg,
		rgba(255, 255, 255, 0.65) 0%,
		rgba(255, 255, 255, 0.35) 45%,
		rgba(255, 255, 255, 0.2) 100%
	);
	backdrop-filter: blur(var(--glass-blur));
	-webkit-backdrop-filter: blur(var(--glass-blur));
	border: 1px solid var(--glass-border-rest);
	border-top: 1px solid var(--glass-border-top);
	border-left: 1px solid var(--glass-border-left);
	border-radius: var(--radius-organic);
	box-shadow: var(--shadow-soft);
}

.glass-panel::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: linear-gradient(
		160deg,
		rgba(255, 255, 255, 0.35) 0%,
		transparent 40%
	);
	pointer-events: none;
}

/* ==========================================================================
   Site Header — Sticky Glass Navigation
   ========================================================================== */

.site-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	height: var(--header-height);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	height: 100%;
	max-width: var(--content-max);
	margin: 0 auto;
	padding: 0 1.25rem;
}

.site-branding {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-shrink: 0;
}

.site-branding__icon {
	position: relative;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	flex-shrink: 0;
	background: radial-gradient(circle at 35% 30%, #FFEB3B 0%, #FFC107 25%, #FF9800 60%, #F57C00 100%);
	box-shadow:
		0 0 18px rgba(255, 193, 7, 0.7),
		0 0 36px rgba(76, 175, 80, 0.4),
		inset 0 -3px 6px rgba(0, 0, 0, 0.15),
		inset 0 3px 6px rgba(255, 255, 255, 0.5);
}

.site-branding__icon::after {
	content: "";
	position: absolute;
	bottom: -2px;
	right: -2px;
	width: 18px;
	height: 18px;
	border-radius: 50% 50% 50% 0;
	background: radial-gradient(circle at 30% 30%, var(--color-glow-emerald) 0%, var(--color-primary) 60%, var(--color-primary-dark) 100%);
	box-shadow: 0 0 10px rgba(0, 230, 118, 0.6);
	transform: rotate(-20deg);
}

.site-branding__title {
	font-family: var(--font-display);
	font-size: clamp(1.15rem, 2.5vw, 1.5rem);
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.1;
	background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-glow-emerald) 40%, var(--color-accent) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	filter: drop-shadow(0 2px 4px rgba(0, 96, 100, 0.25));
}

.site-branding__link {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.site-branding__link:hover .site-branding__title {
	filter: drop-shadow(0 2px 8px rgba(0, 176, 255, 0.45));
}

/* Primary Navigation */

.primary-nav {
	flex: 1;
	display: flex;
	justify-content: flex-end;
}

.primary-nav__list {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	flex-wrap: wrap;
	justify-content: flex-end;
}

.primary-nav__list a {
	display: block;
	padding: 0.5rem 1rem;
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--color-text);
	border-radius: var(--radius-pill);
	transition: background 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.primary-nav__list a:hover,
.primary-nav__list .current-menu-item > a,
.primary-nav__list .current_page_item > a {
	background: rgba(255, 255, 255, 0.5);
	box-shadow: 0 2px 12px rgba(0, 176, 255, 0.2);
	color: var(--color-glow-teal);
}

/* ==========================================================================
   Glossy 3D Gel Pill Buttons
   ========================================================================== */

.btn-gel,
.post-page-numbers a,
.post-page-numbers span.page-numbers:not(.current),
a.page-numbers {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 1rem 2.5rem;
	min-height: 56px;
	border: none;
	border-radius: var(--radius-pill);
	font-family: var(--font-display);
	font-size: clamp(1rem, 2vw, 1.25rem);
	font-weight: 800;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--color-bg-base);
	cursor: pointer;
	overflow: hidden;
	isolation: isolate;
	background: linear-gradient(
		180deg,
		var(--color-primary-light) 0%,
		var(--color-primary) 35%,
		var(--color-primary-dark) 100%
	);
	box-shadow:
		var(--shadow-glow-green),
		0 2px 0 rgba(255, 255, 255, 0.25) inset,
		0 -3px 8px rgba(0, 0, 0, 0.15) inset;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-gel::before,
.post-page-numbers a::before,
.post-page-numbers span.page-numbers:not(.current)::before,
a.page-numbers::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: linear-gradient(
		135deg,
		rgba(255, 255, 255, 0.55) 0%,
		rgba(255, 255, 255, 0.2) 35%,
		transparent 55%
	);
	pointer-events: none;
	z-index: 1;
}

.btn-gel::after,
.post-page-numbers a::after,
.post-page-numbers span.page-numbers:not(.current)::after,
a.page-numbers::after {
	content: "";
	position: absolute;
	top: 0;
	left: 10%;
	right: 10%;
	height: 45%;
	border-radius: var(--radius-pill) var(--radius-pill) 50% 50%;
	background: linear-gradient(
		180deg,
		rgba(255, 255, 255, 0.35) 0%,
		transparent 100%
	);
	pointer-events: none;
	z-index: 1;
}

.btn-gel:hover,
.post-page-numbers a:hover,
a.page-numbers:hover {
	transform: scale(1.05);
	box-shadow:
		0 8px 32px rgba(0, 230, 118, 0.5),
		0 4px 16px rgba(76, 175, 80, 0.45),
		0 2px 0 rgba(255, 255, 255, 0.3) inset,
		0 -3px 8px rgba(0, 0, 0, 0.15) inset;
}

.btn-gel:active,
.post-page-numbers a:active,
a.page-numbers:active {
	transform: scale(1.02);
}

.btn-gel--accent {
	background: linear-gradient(
		180deg,
		#40C4FF 0%,
		var(--color-accent) 35%,
		var(--color-accent-deep) 100%
	);
	box-shadow:
		var(--shadow-glow-cyan),
		0 2px 0 rgba(255, 255, 255, 0.25) inset,
		0 -3px 8px rgba(0, 0, 0, 0.15) inset;
}

.btn-gel--accent:hover {
	box-shadow:
		0 8px 32px rgba(0, 176, 255, 0.5),
		0 4px 16px rgba(0, 176, 255, 0.4),
		0 2px 0 rgba(255, 255, 255, 0.3) inset,
		0 -3px 8px rgba(0, 0, 0, 0.15) inset;
}

/* ==========================================================================
   Single Article Layout
   ========================================================================== */

.article-layout {
	display: grid;
	grid-template-columns: 1fr var(--sidebar-width);
	gap: var(--gap);
	align-items: start;
}

.article-main {
	min-width: 0;
}

.article-content {
	position: relative;
	padding: 2rem 2.25rem;
}

.article-content > * {
	position: relative;
	z-index: 1;
}

.article-header {
	margin-bottom: 1.75rem;
}

.article-title {
	font-family: var(--font-display);
	font-size: clamp(1.75rem, 4vw, 2.5rem);
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -0.03em;
	color: var(--color-text);
	margin-bottom: 0.75rem;
}

.article-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.25rem;
	font-size: 0.875rem;
	color: var(--color-text-muted);
}

.article-meta time {
	font-weight: 600;
}

.article-featured-image {
	margin-bottom: 1.75rem;
	border-radius: calc(var(--radius-organic) - 4px);
	overflow: hidden;
	box-shadow: 0 6px 24px rgba(0, 96, 100, 0.2);
}

.article-featured-image img {
	width: 100%;
	object-fit: cover;
}

.article-body {
	font-size: 1.0625rem;
	line-height: 1.75;
	color: var(--color-text);
}

.article-body > * + * {
	margin-top: 1.25rem;
}

.article-body h2,
.article-body h3,
.article-body h4 {
	font-family: var(--font-display);
	font-weight: 700;
	line-height: 1.3;
	color: var(--color-glow-teal);
	margin-top: 2rem;
}

.article-body h2 {
	font-size: 1.625rem;
}

.article-body h3 {
	font-size: 1.375rem;
}

.article-body a {
	color: var(--color-accent-deep);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-color: rgba(0, 176, 255, 0.4);
	text-underline-offset: 3px;
}

.article-body a:hover {
	color: var(--color-primary);
	text-decoration-color: var(--color-primary);
}

.article-body blockquote {
	padding: 1.25rem 1.5rem;
	border-left: 4px solid var(--color-glow-emerald);
	background: rgba(255, 255, 255, 0.35);
	border-radius: 0 var(--radius-organic) var(--radius-organic) 0;
	font-style: italic;
}

.article-body ul,
.article-body ol {
	padding-left: 1.5rem;
}

.article-body ul {
	list-style: disc;
}

.article-body ol {
	list-style: decimal;
}

.article-body li + li {
	margin-top: 0.5rem;
}

/* ==========================================================================
   Sticky Sidebar
   ========================================================================== */

.sticky-sidebar {
	position: sticky;
	top: calc(var(--header-height) + 1.5rem);
	align-self: start;
}

.sidebar-panel {
	padding: 1.5rem;
}

.sidebar-panel__heading {
	font-family: var(--font-display);
	font-size: 1rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--color-glow-teal);
	margin-bottom: 1rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   Ad Zones
   ========================================================================== */

.ad-zone {
	position: relative;
	width: 100%;
	margin: 1.5rem 0;
	overflow: hidden;
}

.ad-zone--above-title {
	margin-top: 0;
	margin-bottom: 1.5rem;
	min-height: 90px;
}

.ad-zone--mid-content {
	min-height: 250px;
	padding: 1rem;
}

.ad-zone--below-content {
	min-height: 90px;
	margin-top: 2rem;
}

.ad-zone--sidebar {
	min-height: 600px;
	padding: 0.75rem;
}

.ad-zone:empty::after {
	content: attr(data-label);
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: inherit;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--color-text-muted);
	opacity: 0.5;
}

.ad-zone--above-title:empty::after {
	content: "AD — Above Title";
}

.ad-zone--mid-content:empty::after {
	content: "AD — Mid Content Rectangle";
}

.ad-zone--below-content:empty::after {
	content: "AD — Below Content Banner";
}

.ad-zone--sidebar:empty::after {
	content: "AD — Sticky Sidebar 300×600";
}

/* ==========================================================================
   Post Pagination — Next Slide Buttons
   ========================================================================== */

.post-pagination {
	margin-top: 2.5rem;
	padding-top: 2rem;
	border-top: 1px solid rgba(255, 255, 255, 0.45);
}

.post-page-numbers {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: center;
	justify-content: center;
}

.post-page-numbers .page-numbers.current {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 1rem 1.5rem;
	min-height: 56px;
	border-radius: var(--radius-pill);
	font-weight: 800;
	color: var(--color-bg-base);
	background: linear-gradient(180deg, #40C4FF 0%, var(--color-accent) 50%, var(--color-accent-deep) 100%);
	box-shadow: var(--shadow-glow-cyan);
}

/* ==========================================================================
   Archive Index Cards
   ========================================================================== */

.archive-card {
	margin-bottom: 2rem;
}

.archive-pagination {
	padding: 1.5rem;
}

.archive-pagination .post-page-numbers {
	justify-content: center;
}

.archive-card__cta {
	margin-top: 1.5rem;
}

.archive-empty {
	padding: 2rem;
	text-align: center;
}

.article-title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.article-title a:hover {
	color: var(--color-accent-deep);
}

.post-page-numbers .post-page-label {
	width: 100%;
	text-align: center;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--color-text-muted);
	margin-bottom: 0.5rem;
}

/* ==========================================================================
   Site Footer
   ========================================================================== */

.site-footer {
	padding: 2rem 0 2.5rem;
}

.site-footer__inner {
	padding: 1.25rem 2rem;
	text-align: center;
}

.site-footer__copy {
	font-size: 0.875rem;
	color: var(--color-text-muted);
}

.site-footer__copy strong {
	background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	font-weight: 700;
}

/* ==========================================================================
   Responsive — Mobile Single Column
   ========================================================================== */

@media (max-width: 960px) {
	.article-layout {
		grid-template-columns: 1fr;
	}

	.sticky-sidebar {
		position: static;
	}

	.article-content {
		padding: 1.5rem 1.25rem;
	}

	.ad-zone--sidebar {
		min-height: 250px;
	}
}

@media (max-width: 600px) {
	:root {
		--header-height: 64px;
	}

	.site-header__inner {
		flex-wrap: wrap;
		padding: 0.5rem 1rem;
	}

	.primary-nav {
		width: 100%;
		justify-content: center;
	}

	.primary-nav__list {
		justify-content: center;
	}

	.btn-gel,
	.post-page-numbers a {
		padding: 0.875rem 1.75rem;
		min-height: 48px;
		font-size: 0.9375rem;
	}
}

/* ==========================================================================
   Accessibility & Performance
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

:focus-visible {
	outline: 3px solid var(--color-accent);
	outline-offset: 3px;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
