/**
 * Accessibility Styles (a11y.css)
 * Focus indicators, skip links, and WCAG 2.1 AA contrast fixes
 * Budget: < 5KB
 */

/* ==========================================================================
   Skip Link
   ========================================================================== */

.fz-skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 10000;
}

.fz-skip-link:focus {
    position: fixed;
    top: 0;
    left: 0;
    width: auto;
    height: auto;
    padding: 1rem 2rem;
    background: var(--color-bg-dark, #1a1a1a);
    color: #fff;
    font-size: 1rem;
    z-index: 10000;
    text-decoration: underline;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* ==========================================================================
   Focus Indicators — :focus-visible (3:1 contrast ratio)
   ========================================================================== */

:focus-visible {
    outline: 2px solid var(--fz-gold, #C9A961);
    outline-offset: 2px;
}

/* Buttons and interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--fz-gold, #C9A961);
    outline-offset: 2px;
}

/* Remove default focus for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* ==========================================================================
   WCAG 2.1 AA Contrast Fixes
   Normal text: 4.5:1 ratio | Large text (18px+ or 14px+ bold): 3:1 ratio
   ========================================================================== */

/* Body text contrast — ensure minimum 4.5:1 on light backgrounds */
body {
    color: var(--color-text, #333333);
}

/* Secondary/muted text — raised from typical #999 to meet 4.5:1 */
.text-muted,
.fz-text-muted,
.meta,
.post-meta,
.comment-meta {
    color: var(--color-text-muted, #595959);
}

/* Placeholder text contrast fix */
::placeholder {
    color: #595959;
    opacity: 1;
}

/* Link contrast — ensure 3:1 against surrounding text */
/* Links inherit color from parent context (dark footer = white, light header = black) */

/* Headings */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-heading, #1a1a1a);
}

/* Form labels */
label,
.form-label {
    color: var(--color-text, #333333);
}

/* Disabled state — meets 3:1 for non-text contrast */
[disabled],
.disabled {
    opacity: 1;
    color: #767676;
}

/* Error messages — red with 4.5:1 contrast */
.error,
.fz-error,
.form-error {
    color: #c41e1e;
}

/* Success messages */
.success,
.fz-success {
    color: #1a7a1a;
}
