/* ============================================
   ACCESSIBILITY WIDGET STYLES
   ============================================ */

/* CSS Variables for Widget */
:root {
	--a11y-primary: #5D3A9B;
	--a11y-primary-hover: #7B52C4;
	--a11y-bg: #ffffff;
	--a11y-text: #2D2D2D;
	--a11y-border: #e0e0e0;
	--a11y-success: #22c55e;
}

/* Floating Action Button — LEFT side to avoid Iubenda overlap */
.a11y-fab {
	position: fixed;
	bottom: 24px;
	left: 24px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--a11y-primary);
	color: white;
	border: none;
	cursor: pointer;
	box-shadow: 0 3px 12px rgba(93, 58, 155, 0.35);
	z-index: 9998;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	transition: all 0.3s ease;
}

.a11y-fab:hover {
	background: var(--a11y-primary-hover);
	transform: scale(1.1);
}

.a11y-fab:focus {
	outline: 3px solid var(--a11y-primary);
	outline-offset: 3px;
}

.a11y-fab.active {
	background: var(--a11y-primary-hover);
}

/* Accessibility Panel — opens from LEFT side */
.a11y-panel {
	position: fixed;
	bottom: 100px;
	left: 24px;
	width: 320px;
	max-height: 70vh;
	background: var(--a11y-bg);
	border-radius: 16px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
	z-index: 9999;
	opacity: 0;
	visibility: hidden;
	transform: translateY(20px) scale(0.95);
	transition: all 0.3s ease;
	overflow: hidden;
	font-size: 16px;
	/* Isolate panel from html font-size changes */
}

.a11y-panel.open {
	opacity: 1;
	visibility: visible;
	transform: translateY(0) scale(1);
}

/* Panel Header */
.a11y-header {
	background: var(--a11y-primary);
	color: white;
	padding: 16px 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.a11y-header h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: white;
	font-family: inherit;
}

.a11y-close {
	background: none;
	border: none;
	color: white;
	font-size: 24px;
	cursor: pointer;
	padding: 0;
	line-height: 1;
	opacity: 0.8;
	transition: opacity 0.2s;
}

.a11y-close:hover {
	opacity: 1;
}

/* Panel Content */
.a11y-content {
	padding: 16px;
	max-height: calc(70vh - 60px);
	overflow-y: auto;
}

/* Option Groups */
.a11y-group {
	margin-bottom: 20px;
}

.a11y-group-title {
	font-size: 12px;
	font-weight: 600;
	color: #888;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 10px;
}

/* Option Buttons */
.a11y-option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 12px 14px;
	margin-bottom: 8px;
	background: #f8f8f8;
	border: 2px solid transparent;
	border-radius: 10px;
	cursor: pointer;
	transition: all 0.2s ease;
	text-align: left;
}

.a11y-option:hover {
	background: #f0f0f0;
	border-color: var(--a11y-primary);
}

.a11y-option.active {
	background: rgba(93, 58, 155, 0.1);
	border-color: var(--a11y-primary);
}

.a11y-option-info {
	display: flex;
	align-items: center;
	gap: 10px;
}

.a11y-option-icon {
	font-size: 20px;
	width: 28px;
	text-align: center;
}

.a11y-option-label {
	font-size: 14px;
	font-weight: 500;
	color: var(--a11y-text);
}

/* Toggle Indicator */
.a11y-toggle {
	width: 40px;
	height: 22px;
	background: #ccc;
	border-radius: 11px;
	position: relative;
	transition: background 0.2s;
}

.a11y-option.active .a11y-toggle {
	background: var(--a11y-success);
}

.a11y-toggle::after {
	content: '';
	position: absolute;
	top: 2px;
	left: 2px;
	width: 18px;
	height: 18px;
	background: white;
	border-radius: 50%;
	transition: transform 0.2s;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.a11y-option.active .a11y-toggle::after {
	transform: translateX(18px);
}

/* Font Size Controls */
.a11y-font-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 10px;
	background: #f8f8f8;
	border-radius: 10px;
	margin-bottom: 8px;
}

.a11y-font-btn {
	width: 40px;
	height: 40px;
	border: 2px solid var(--a11y-border);
	background: white;
	border-radius: 8px;
	cursor: pointer;
	font-size: 18px;
	font-weight: bold;
	color: var(--a11y-text);
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
}

.a11y-font-btn:hover {
	border-color: var(--a11y-primary);
	background: rgba(93, 58, 155, 0.05);
}

.a11y-font-size {
	font-size: 16px;
	font-weight: 600;
	color: var(--a11y-text);
	min-width: 50px;
	text-align: center;
}

/* Reset Button */
.a11y-reset {
	width: 100%;
	padding: 12px;
	background: transparent;
	border: 2px solid var(--a11y-border);
	border-radius: 10px;
	color: var(--a11y-text);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s;
	margin-top: 10px;
}

.a11y-reset:hover {
	border-color: #e74c3c;
	color: #e74c3c;
	background: rgba(231, 76, 60, 0.05);
}

/* ============================================
   HIGH CONTRAST - DARK MODE
   ============================================ */

body.a11y-contrast-dark {
	background-color: #1a1a1a !important;
	color: #f0f0f0 !important;
}

/* Force dark backgrounds on all major elements */
body.a11y-contrast-dark .hero,
body.a11y-contrast-dark .hero-background,
body.a11y-contrast-dark .hero-overlay,
body.a11y-contrast-dark .about,
body.a11y-contrast-dark .services,
body.a11y-contrast-dark .catalog,
body.a11y-contrast-dark .contact,
body.a11y-contrast-dark .navbar,
body.a11y-contrast-dark .footer,
body.a11y-contrast-dark .container,
body.a11y-contrast-dark .service-card,
body.a11y-contrast-dark .catalog-card,
body.a11y-contrast-dark .hero-content,
body.a11y-contrast-dark .contact-info,
body.a11y-contrast-dark .contact-item,
body.a11y-contrast-dark .section-header,
body.a11y-contrast-dark .footer-content,
body.a11y-contrast-dark .footer-top,
body.a11y-contrast-dark .footer-bottom,
body.a11y-contrast-dark .carousel,
body.a11y-contrast-dark .carousel-container {
	background-color: #1a1a1a !important;
}

/* Force light text on ALL text elements */
body.a11y-contrast-dark h1,
body.a11y-contrast-dark h2,
body.a11y-contrast-dark h3,
body.a11y-contrast-dark h4,
body.a11y-contrast-dark h5,
body.a11y-contrast-dark h6 {
	color: #ffffff !important;
}

body.a11y-contrast-dark p,
body.a11y-contrast-dark span:not(.a11y-option-icon):not(.a11y-font-size),
body.a11y-contrast-dark li,
body.a11y-contrast-dark label,
body.a11y-contrast-dark .section-subtitle,
body.a11y-contrast-dark .service-description,
body.a11y-contrast-dark .service-tag,
body.a11y-contrast-dark .catalog-description,
body.a11y-contrast-dark .contact-text,
body.a11y-contrast-dark .footer-copyright,
body.a11y-contrast-dark .footer-tagline {
	color: #e0e0e0 !important;
}

body.a11y-contrast-dark a:not(.a11y-fab):not(.a11y-close):not(.a11y-option):not(.btn):not(.btn-primary):not(.nav-links a) {
	color: #7cb3ff !important;
}

body.a11y-contrast-dark .nav-links a,
body.a11y-contrast-dark .logo {
	color: #ffffff !important;
}

body.a11y-contrast-dark .navbar.scrolled {
	background-color: #0d0d0d !important;
}

body.a11y-contrast-dark .btn-primary,
body.a11y-contrast-dark .btn-contact {
	background: var(--a11y-primary) !important;
	color: #fff !important;
}

/* Dark mode: invert non-widget images */
body.a11y-contrast-dark img:not(.logo-icon):not(.footer-logo-icon) {
	filter: brightness(0.7);
}

/* Preserve widget styles in dark mode */
body.a11y-contrast-dark .a11y-fab {
	background: var(--a11y-primary) !important;
	color: white !important;
}

body.a11y-contrast-dark .a11y-panel {
	background: #1a1a1a !important;
	border: 1px solid #333 !important;
}

body.a11y-contrast-dark .a11y-header {
	background: var(--a11y-primary) !important;
}

body.a11y-contrast-dark .a11y-header h3 {
	color: white !important;
}

body.a11y-contrast-dark .a11y-close {
	color: white !important;
}

body.a11y-contrast-dark .a11y-content {
	background: #1a1a1a !important;
}

body.a11y-contrast-dark .a11y-group-title {
	color: #aaa !important;
}

body.a11y-contrast-dark .a11y-option {
	background: #2a2a2a !important;
	border-color: #444 !important;
}

body.a11y-contrast-dark .a11y-option.active {
	background: rgba(93, 58, 155, 0.3) !important;
	border-color: var(--a11y-primary) !important;
}

body.a11y-contrast-dark .a11y-option-label {
	color: #f0f0f0 !important;
}

body.a11y-contrast-dark .a11y-font-controls {
	background: #2a2a2a !important;
}

body.a11y-contrast-dark .a11y-font-btn {
	background: #3a3a3a !important;
	color: #f0f0f0 !important;
	border-color: #555 !important;
}

body.a11y-contrast-dark .a11y-font-size {
	color: #f0f0f0 !important;
}

body.a11y-contrast-dark .a11y-toggle {
	background: #555 !important;
}

body.a11y-contrast-dark .a11y-option.active .a11y-toggle {
	background: var(--a11y-success) !important;
}

body.a11y-contrast-dark .a11y-reset {
	color: #f0f0f0 !important;
	border-color: #555 !important;
}

/* ============================================
   HIGH CONTRAST - LIGHT MODE
   ============================================ */

body.a11y-contrast-light {
	background: #ffffff !important;
}

/* Force white backgrounds */
body.a11y-contrast-light .hero,
body.a11y-contrast-light .hero-overlay,
body.a11y-contrast-light .about,
body.a11y-contrast-light .services,
body.a11y-contrast-light .catalog,
body.a11y-contrast-light .contact,
body.a11y-contrast-light .container,
body.a11y-contrast-light .service-card,
body.a11y-contrast-light .catalog-card,
body.a11y-contrast-light .hero-content,
body.a11y-contrast-light .contact-info,
body.a11y-contrast-light .contact-item,
body.a11y-contrast-light .section-header,
body.a11y-contrast-light .footer-content,
body.a11y-contrast-light .footer-top,
body.a11y-contrast-light .footer-bottom,
body.a11y-contrast-light .carousel,
body.a11y-contrast-light .carousel-container {
	background-color: #ffffff !important;
}

body.a11y-contrast-light .navbar {
	background-color: #f5f5f5 !important;
}

body.a11y-contrast-light .footer {
	background-color: #f0f0f0 !important;
}

/* Force BLACK text for maximum contrast */
body.a11y-contrast-light h1,
body.a11y-contrast-light h2,
body.a11y-contrast-light h3,
body.a11y-contrast-light h4,
body.a11y-contrast-light h5,
body.a11y-contrast-light h6 {
	color: #000000 !important;
}

body.a11y-contrast-light p,
body.a11y-contrast-light span:not(.a11y-option-icon):not(.a11y-font-size),
body.a11y-contrast-light li,
body.a11y-contrast-light label,
body.a11y-contrast-light .section-subtitle,
body.a11y-contrast-light .service-description,
body.a11y-contrast-light .service-tag,
body.a11y-contrast-light .catalog-description,
body.a11y-contrast-light .contact-text,
body.a11y-contrast-light .footer-copyright,
body.a11y-contrast-light .footer-tagline {
	color: #000000 !important;
}

body.a11y-contrast-light a:not(.a11y-fab):not(.a11y-close):not(.a11y-option):not(.btn):not(.btn-primary) {
	color: #0055cc !important;
}

body.a11y-contrast-light .nav-links a,
body.a11y-contrast-light .logo {
	color: #000000 !important;
}

body.a11y-contrast-light .navbar.scrolled .nav-links a,
body.a11y-contrast-light .navbar.scrolled .logo {
	color: #000000 !important;
}

body.a11y-contrast-light .hero-background img {
	filter: brightness(1.3) saturate(0.3);
}

/* ============================================
   DYSLEXIA FONT
   ============================================ */

@font-face {
	font-family: 'OpenDyslexic';
	src: url('https://cdn.jsdelivr.net/npm/open-dyslexic@1.0.3/woff/OpenDyslexic-Regular.woff') format('woff');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

body.a11y-dyslexia * {
	font-family: 'OpenDyslexic', sans-serif !important;
	letter-spacing: 0.05em !important;
	word-spacing: 0.1em !important;
	line-height: 1.8 !important;
}

/* ============================================
   STOP ANIMATIONS
   ============================================ */

body.a11y-no-animations *:not(.carousel-track),
body.a11y-no-animations *:not(.carousel-track)::before,
body.a11y-no-animations *:not(.carousel-track)::after {
	animation: none !important;
}

/* Preserve carousel transitions */
body.a11y-contrast-dark .carousel-track,
body.a11y-contrast-light .carousel-track,
body.a11y-no-animations .carousel-track {
	transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* ============================================
   HIGHLIGHT LINKS
   ============================================ */

body.a11y-highlight-links a {
	outline: 3px solid #ff6600 !important;
	outline-offset: 2px !important;
	background: rgba(255, 102, 0, 0.1) !important;
}

/* ============================================
   BIG CURSOR
   ============================================ */

body.a11y-big-cursor,
body.a11y-big-cursor * {
	cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' stroke='%23fff' stroke-width='1' d='M5.5 3.21V20.8l5.71-5.71h6.29L5.5 3.21z'/%3E%3C/svg%3E") 0 0, auto !important;
}

/* ============================================
   HIDE IMAGES
   ============================================ */

body.a11y-hide-images img {
	opacity: 0.1 !important;
}

/* ============================================
   READING GUIDE
   ============================================ */

.a11y-reading-guide {
	position: fixed;
	left: 0;
	width: 100%;
	height: 40px;
	background: rgba(255, 255, 0, 0.3);
	border-top: 2px solid #ffd700;
	border-bottom: 2px solid #ffd700;
	pointer-events: none;
	z-index: 9990;
	display: none;
}

body.a11y-reading-guide-active .a11y-reading-guide {
	display: block;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 480px) {
	.a11y-fab {
		bottom: 16px;
		left: 16px;
		width: 36px;
		height: 36px;
		font-size: 16px;
	}

	.a11y-panel {
		left: 10px;
		right: 10px;
		width: auto;
		bottom: 80px;
		max-height: 60vh;
	}
}
