/**
 * NEws Theme - Accessibility & WCAG 2.2 Stylesheet
 *
 * Provides focus management, high-contrast & forced colors mode,
 * reduced motion overrides, touch target minimums, and clean print styles.
 *
 * @package NewsCore
 * @since 1.0.0
 */

/* ==========================================================================
   1. Focus Indicators & Skip Link
   ========================================================================== */

/* Skip link positioning */
.skip-link {
	position: absolute;
	top: -9999px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 99999;
	padding: 12px 24px;
	background-color: #0b132b;
	color: #ffffff;
	text-decoration: none;
	font-weight: 700;
	font-size: 1rem;
	border-radius: 0 0 4px 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
	outline: 2px solid #3a86ff;
	outline-offset: 2px;
	transition: top 0.2s ease-in-out;
}

.skip-link:focus {
	top: 0;
}

/* Enhanced Focus Visible Ring */
:focus-visible {
	outline: 2px solid #1a73e8;
	outline-offset: 3px;
}

/* Remove default focus outline if focus is not visible */
:focus:not(:focus-visible) {
	outline: none;
}

/* Form controls visible focus */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
	outline: 2px solid #1a73e8;
	outline-offset: 1px;
	border-color: #1a73e8;
}

/* Interactive elements touch targets (min 44x44px for accessibility) */
.header-search-toggle,
.mobile-menu-toggle,
.search-modal-close,
.mobile-drawer-close,
.live-blog-refresh-btn,
.pagination .page-numbers,
.comment-navigation a,
.post-navigation a {
	min-width: 44px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Screen reader text standard */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: #ffffff;
	border-radius: 3px;
	box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
	clip: auto !important;
	clip-path: none;
	color: #212529;
	display: block;
	font-size: 0.875rem;
	font-weight: 700;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

/* ==========================================================================
   2. Forced Colors Mode (Windows High Contrast)
   ========================================================================== */

@media (forced-colors: active) {
	:focus-visible {
		outline: 3px solid Highlight !important;
		outline-offset: 3px !important;
	}

	button,
	.btn,
	.button,
	input[type="submit"],
	input[type="button"],
	input[type="reset"],
	.mobile-menu-toggle,
	.header-search-toggle,
	.search-modal-close,
	.mobile-drawer-close {
		border: 1px solid ButtonText !important;
	}

	.badge,
	.live-badge,
	.breaking-news-label,
	.category-badge {
		border: 1px solid CanvasText !important;
	}

	/* Ensure SVG icons inherit text color */
	svg {
		fill: currentColor !important;
		stroke: currentColor !important;
	}
}

/* ==========================================================================
   3. Prefers-Reduced-Motion Override
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}

	/* Stop ticker animation */
	.breaking-news-ticker-inner,
	.ticker-content {
		animation: none !important;
		transform: none !important;
	}
}

/* ==========================================================================
   4. High-Contrast Utilities & Text Contrast Safeguards
   ========================================================================== */

/* Ensure metadata and muted texts maintain minimum 4.5:1 ratio */
.entry-meta,
.post-meta,
.comment-metadata,
.breadcrumb,
.widget-title-meta {
	color: #595959;
}

/* ==========================================================================
   5. Clean Print Stylesheet
   ========================================================================== */

@media print {
	/* Hide non-content and clutter */
	.site-header-actions,
	.mobile-menu-drawer,
	.mobile-menu-backdrop,
	.search-modal,
	.search-modal-backdrop,
	.breaking-news-ticker-wrapper,
	.ad-placement,
	.reading-progress-bar,
	.reading-progress,
	.comments-area .comment-respond,
	.share-buttons,
	.site-footer-widgets,
	.skip-link,
	.back-to-top,
	.sidebar,
	#secondary,
	.live-blog-controls,
	.video-player-container .video-player-wrapper {
		display: none !important;
	}

	/* Optimize document for printing */
	body {
		background: #ffffff !important;
		color: #000000 !important;
		font-size: 12pt;
		line-height: 1.5;
	}

	.site-header {
		border-bottom: 2pt solid #000000;
		margin-bottom: 20pt;
		padding-bottom: 10pt;
	}

	.site-title a {
		color: #000000 !important;
		text-decoration: none;
	}

	.site-content,
	.site-main,
	.content-area {
		width: 100% !important;
		margin: 0 !important;
		padding: 0 !important;
		float: none !important;
	}

	.entry-title {
		font-size: 22pt;
		color: #000000 !important;
		page-break-after: avoid;
	}

	h1, h2, h3, h4, h5, h6 {
		page-break-after: avoid;
		page-break-inside: avoid;
		color: #000000 !important;
	}

	img, figure {
		page-break-inside: avoid;
		max-width: 100% !important;
	}

	blockquote {
		border-left: 3pt solid #cccccc;
		padding-left: 10pt;
		margin-left: 0;
		font-style: italic;
	}

	/* Show links in articles */
	.entry-content a[href^="http"]:not([href*="wp-content"])::after {
		content: " (" attr(href) ")";
		font-size: 0.85em;
		font-weight: normal;
		color: #555555;
	}

	/* Footer copyright */
	.site-footer {
		border-top: 1pt solid #cccccc;
		margin-top: 20pt;
		padding-top: 10pt;
		font-size: 9pt;
		text-align: center;
	}
}
