/* ===== ACCESSIBILITY ENHANCEMENTS ===== */

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --text-color: #000000;
        --background-color: #FFFFFF;
        --accent-color: #0000FF;
        --accent-color-2: #FF0000;
        --border-color: #000000;
    }
    
    .card, .earth-card, .rv-card {
        border: 2px solid #000000;
        background: #FFFFFF;
    }
    
    .btn-camper, .btn-camper-outline {
        border: 2px solid #000000;
        background: #FFFFFF;
        color: #000000;
    }
}

/* Enhanced focus indicators */
*:focus {
    outline: 3px solid var(--accent-color-2);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Custom focus styles for interactive elements */
.btn:focus,
.nav-link:focus,
.menu__item-link:focus,
.social-item:focus,
.social-item-2:focus {
    outline: 3px solid var(--sunset-orange);
    outline-offset: 3px;
    box-shadow: 0 0 0 1px white, 0 0 0 4px var(--sunset-orange);
}

/* Form element focus improvements */
input:focus,
textarea:focus,
select:focus {
    outline: 3px solid var(--river-blue);
    outline-offset: 2px;
    border-color: var(--river-blue);
    box-shadow: 0 0 0 1px white, 0 0 0 4px var(--river-blue);
}

/* Skip navigation link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--accent-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 6px;
    outline: 3px solid var(--sunset-orange);
    outline-offset: 2px;
}

/* Improved heading hierarchy */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-color);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

/* Better text spacing for readability */
p, li {
    line-height: 1.6;
    margin-bottom: 1rem;
    max-width: 65ch; /* Optimal reading length */
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Show screen reader content on focus */
.sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 4px 8px;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--accent-color);
    color: white;
    border-radius: 4px;
}

/* Improve button accessibility */
.btn, .btn-camper, .btn-camper-outline {
    position: relative;
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
}

/* Loading state accessibility */
.loading[aria-busy="true"] {
    pointer-events: none;
    position: relative;
}

.loading[aria-busy="true"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Improved form labels */
.form-label {
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
    display: block;
}

.form-label.required::after {
    content: ' *';
    color: var(--sunset-orange);
    font-weight: bold;
}

/* Better error messaging */
.form-error {
    color: var(--campfire-orange);
    font-size: 0.9rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-error::before {
    content: '⚠️';
    font-size: 1rem;
}

/* Success messaging */
.form-success {
    color: var(--forest-green);
    font-size: 0.9rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-success::before {
    content: '✅';
    font-size: 1rem;
}

/* Keyboard navigation improvements */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link:focus {
    background: rgba(245, 241, 232, 0.1);
    border-radius: 8px;
}

/* Menu accessibility */
.menu__item-link {
    display: block;
    padding: 1rem;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.menu__item-link:focus {
    background: rgba(27, 67, 50, 0.1);
    transform: none; /* Disable transforms on focus for stability */
}

/* Improved modal accessibility */
.modal[aria-hidden="true"] {
    display: none;
}

.modal[aria-hidden="false"] {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1050;
    align-items: center;
    justify-content: center;
}

/* Focus trap for modals */
.modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-content:focus {
    outline: none;
}

/* Close button accessibility */
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.modal-close:focus {
    background: var(--accent-color-2);
    color: white;
}

/* Animation preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .marquee-inner {
        animation: none;
    }
}

/* Color vision accessibility */
.error-state {
    border-left: 4px solid var(--campfire-orange);
    background: rgba(255, 75, 53, 0.1);
    padding: 1rem;
}

.success-state {
    border-left: 4px solid var(--forest-green);
    background: rgba(27, 67, 50, 0.1);
    padding: 1rem;
}

.warning-state {
    border-left: 4px solid var(--sunset-orange);
    background: rgba(247, 147, 30, 0.1);
    padding: 1rem;
}

/* Improved link accessibility */
a {
    color: var(--river-blue);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--forest-green);
    text-decoration-thickness: 3px;
}

a:focus {
    outline: 3px solid var(--sunset-orange);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Heading link styling */
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
    text-decoration: none;
    color: inherit;
}

h1 a:hover, h2 a:hover, h3 a:hover, 
h4 a:hover, h5 a:hover, h6 a:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

/* Table accessibility */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--accent-color-6);
    font-weight: 600;
    color: var(--text-color);
}

/* Card accessibility improvements */
.card {
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.card:focus-within {
    border-color: var(--river-blue);
    box-shadow: 0 0 0 2px rgba(74, 144, 164, 0.3);
}

/* Status indicators */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.status-available {
    background: rgba(27, 67, 50, 0.1);
    color: var(--forest-green);
}

.status-unavailable {
    background: rgba(255, 75, 53, 0.1);
    color: var(--campfire-orange);
}

/* Breadcrumb accessibility */
.breadcrumb {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: '›';
    margin: 0 8px;
    color: var(--text-color-2);
}

.breadcrumb a {
    text-decoration: none;
    color: var(--river-blue);
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Live region for dynamic content */
.live-region {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Better contrast for placeholders */
::placeholder {
    color: var(--stone-gray);
    opacity: 1;
}

/* Improved selection styling */
::selection {
    background: var(--sunset-orange);
    color: white;
    text-shadow: none;
}

::-moz-selection {
    background: var(--sunset-orange);
    color: white;
    text-shadow: none;
} 