/* ==========================================================================
   Antigravity News Theme Custom Core Stylesheet
   ========================================================================== */

/* Variables and Theme Overrides */
:root {
	--transition-speed: 0.25s;
	--ease-timing: cubic-bezier(0.16, 1, 0.3, 1);
	--focus-outline-color: var(--wp--preset--color--accent);
}

/* Accessibility Focus States */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex="0"]:focus-visible {
	outline: 2px solid var(--focus-outline-color);
	outline-offset: 3px;
}

/* Base Layout & Alignment Adjustments */
body {
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Article Reading optimization */
.entry-content {
	max-width: 68ch;
	margin-left: auto;
	margin-right: auto;
}

.entry-content p {
	margin-bottom: 1.75em;
	font-size: 1.05rem;
	line-height: 1.7;
}

/* Pull Quotes and Editorial Accents */
blockquote.wp-block-quote,
.wp-block-pullquote {
	border-left: 3px solid var(--wp--preset--color--primary);
	padding: 1rem 0 1rem 1.5rem;
	margin: 2.5rem 0;
	font-style: italic;
	color: var(--wp--preset--color--foreground);
}

.wp-block-pullquote blockquote p {
	font-size: 1.35rem;
	line-height: 1.5;
}

/* Table of Contents Sticky Layout */
.toc-container {
	position: sticky;
	top: 5rem;
	height: fit-content;
	max-height: calc(100vh - 8rem);
	overflow-y: auto;
	border-left: 1px solid var(--wp--preset--color--tertiary);
	padding-left: var(--wp--preset--spacing--40);
}

.toc-title {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: var(--wp--preset--spacing--30);
	color: var(--wp--preset--color--secondary);
}

.toc-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.toc-item {
	font-size: var(--wp--preset--font-size--small);
	margin-bottom: 0.5rem;
}

.toc-link {
	text-decoration: none;
	color: var(--wp--preset--color--secondary);
	transition: color var(--transition-speed) var(--ease-timing);
}

.toc-link:hover,
.toc-link.is-active {
	color: var(--wp--preset--color--foreground);
	font-weight: 500;
}

/* Breaking News Ticker */
.breaking-news-bar {
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--background);
	padding: 8px var(--wp--preset--spacing--40);
	display: flex;
	align-items: center;
	font-size: var(--wp--preset--font-size--small);
	overflow: hidden;
	position: relative;
	z-index: 1001;
	transition: transform var(--transition-speed) var(--ease-timing), opacity var(--transition-speed) var(--ease-timing);
}

.breaking-news-bar.is-dismissed {
	transform: translateY(-100%);
	opacity: 0;
	height: 0;
	padding: 0;
	overflow: hidden;
}

.breaking-news-label {
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--wp--preset--color--accent);
	margin-right: 15px;
	white-space: nowrap;
	display: flex;
	align-items: center;
}

.breaking-news-label::after {
	content: "";
	display: inline-block;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background-color: var(--wp--preset--color--accent);
	margin-left: 10px;
	animation: pulse 1.5s infinite;
}

.breaking-news-content {
	flex-grow: 1;
	overflow: hidden;
	white-space: nowrap;
}

.breaking-news-scroll {
	display: inline-block;
	padding-left: 100%;
	animation: ticker 25s linear infinite;
}

.breaking-news-scroll:hover {
	animation-play-state: paused;
}

.breaking-news-close {
	background: none;
	border: none;
	color: inherit;
	cursor: pointer;
	padding: 4px;
	margin-left: 15px;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0.7;
	transition: opacity var(--transition-speed);
}

.breaking-news-close:hover {
	opacity: 1;
}

/* Animations */
@keyframes ticker {
	0% { transform: translate3d(0, 0, 0); }
	100% { transform: translate3d(-100%, 0, 0); }
}

@keyframes pulse {
	0% { opacity: 0.4; }
	50% { opacity: 1; }
	100% { opacity: 0.4; }
}

/* Sticky Header Custom Controls */
.sticky-header {
	position: sticky;
	top: 0;
	z-index: 1000;
	background-color: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--wp--preset--color--tertiary);
	transition: background-color var(--transition-speed) var(--ease-timing);
}

/* Search Box Keyboard Shortcut Indicator */
.search-shortcut-hint {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background-color: var(--wp--preset--color--tertiary);
	color: var(--wp--preset--color--secondary);
	font-family: var(--wp--preset--font-family--monospace);
	font-size: 0.75rem;
	padding: 2px 6px;
	border-radius: 3px;
	border: 1px solid rgba(0,0,0,0.1);
	pointer-events: none;
	margin-left: 8px;
}

/* Non-intrusive Ad Containers */
.ad-slot-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin: 2.5rem 0;
	padding: 1rem 0;
	border-top: 1px solid var(--wp--preset--color--tertiary);
	border-bottom: 1px solid var(--wp--preset--color--tertiary);
	background-color: rgba(0, 0, 0, 0.02);
	position: relative;
}

.ad-slot-container::before {
	content: "ADVERTISEMENT";
	display: block;
	font-size: 0.65rem;
	font-family: var(--wp--preset--font-family--system-sans);
	font-weight: 500;
	letter-spacing: 0.1em;
	color: var(--wp--preset--color--secondary);
	margin-bottom: 0.75rem;
}

.ad-placeholder {
	width: 100%;
	max-width: 728px;
	height: 90px;
	background-color: rgba(0, 0, 0, 0.05);
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--wp--preset--font-family--monospace);
	font-size: 0.8rem;
	color: var(--wp--preset--color--secondary);
	border: 1px dashed var(--wp--preset--color--secondary);
}

.ad-slot-sidebar .ad-placeholder {
	max-width: 300px;
	height: 250px;
}

/* Newsletter & CTAs Minimal Design */
.newsletter-box {
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--background);
	padding: var(--wp--preset--spacing--60);
	border-radius: 2px;
	text-align: center;
}

.newsletter-box input[type="email"] {
	background-color: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.3);
	color: var(--wp--preset--color--background);
	padding: 12px 20px;
	font-size: 1rem;
	border-radius: 2px;
	width: 100%;
	max-width: 350px;
	margin-right: 10px;
	margin-bottom: 10px;
}

.newsletter-box input[type="email"]::placeholder {
	color: rgba(255, 255, 255, 0.5);
}

/* Paywall Preview and Metered CTAs */
.paywall-fade {
	position: relative;
	max-height: 250px;
	overflow: hidden;
	margin-bottom: 0;
}

.paywall-fade::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 180px;
	background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 90%);
	pointer-events: none;
}

.paywall-box {
	border: 1px solid var(--wp--preset--color--tertiary);
	background-color: var(--wp--preset--color--background);
	padding: var(--wp--preset--spacing--50);
	text-align: center;
	margin-top: -20px;
	position: relative;
	z-index: 10;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Micro-animations and hover effects */
.hover-subtle {
	transition: opacity var(--transition-speed) var(--ease-timing), transform var(--transition-speed) var(--ease-timing);
}

.hover-subtle:hover {
	opacity: 0.95;
	transform: translateY(-2px);
}

/* Dark Mode Prefers Color Scheme Styles */
@media (prefers-color-scheme: dark) {
	:root {
		--wp--preset--color--background: var(--wp--preset--color--dark-bg);
		--wp--preset--color--foreground: var(--wp--preset--color--dark-fg);
		--wp--preset--color--tertiary: #22252a;
		--wp--preset--color--secondary: #9ca3af;
		--wp--preset--color--primary: #f3f4f6;
	}

	.sticky-header {
		background-color: rgba(13, 14, 16, 0.95);
		border-bottom: 1px solid var(--wp--preset--color--tertiary);
	}

	.search-shortcut-hint {
		background-color: var(--wp--preset--color--tertiary);
		border-color: rgba(255,255,255,0.1);
	}

	.ad-slot-container {
		background-color: rgba(255, 255, 255, 0.02);
	}

	.paywall-fade::after {
		background: linear-gradient(to bottom, rgba(13,14,16,0) 0%, rgba(13,14,16,1) 90%);
	}

	.paywall-box {
		border-color: var(--wp--preset--color--tertiary);
	}
}

/* Sepia Mode Support class (active on manual button toggles if desired) */
body.mode-sepia {
	--wp--preset--color--background: var(--wp--preset--color--sepia-bg);
	--wp--preset--color--foreground: var(--wp--preset--color--sepia-fg);
	--wp--preset--color--tertiary: #e3d9c1;
	--wp--preset--color--secondary: #705b46;
	--wp--preset--color--primary: #433422;
}

body.mode-sepia .sticky-header {
	background-color: rgba(244, 236, 216, 0.95);
	border-bottom: 1px solid var(--wp--preset--color--tertiary);
}

body.mode-sepia .paywall-fade::after {
	background: linear-gradient(to bottom, rgba(244,236,216,0) 0%, rgba(244,236,216,1) 90%);
}

/* Respect user preferences regarding motion */
@media (prefers-reduced-motion: reduce) {
	* {
		animation-delay: 0s !important;
		animation-duration: 0s !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0s !important;
		scroll-behavior: auto !important;
	}

	.breaking-news-scroll {
		animation: none;
		white-space: normal;
		padding-left: 0;
	}

	.breaking-news-content {
		white-space: normal;
	}
}
