/* Explain: Styles for the floating accessibility menu and its panel. */
/* Accessibility widget: floating trigger + preferences panel */
.a11y-widget {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 70;
    font-family: var(--font-body);
}

.a11y-toggle {
    display: grid;
    place-items: center;
    height: 3.5rem;
    width: 3.5rem;
    border-radius: 9999px;
    border: 1px solid var(--accent-color);
    background: var(--surface-color);
    color: var(--accent-color);
    font-size: 1.65rem;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(90, 66, 40, 0.22);
    transition: background 220ms ease, color 220ms ease, border-color 220ms ease, transform 220ms ease;
}

.a11y-toggle:hover,
.a11y-toggle:focus-visible,
.a11y-toggle[aria-expanded="true"] {
    background: var(--accent-color);
    color: #ffffff;
    transform: translateY(-3px);
}

.a11y-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.9rem);
    display: none;
    width: min(21rem, calc(100vw - 2rem));
    max-height: min(80vh, 34rem);
    overflow-y: auto;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    background: var(--surface-color);
    box-shadow: var(--shadow-deep);
    text-align: right;
}

.a11y-panel.is-open {
    display: block;
}

.a11y-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.a11y-panel-title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-color);
}

.a11y-close {
    display: grid;
    place-items: center;
    height: 2.4rem;
    width: 2.4rem;
    flex-shrink: 0;
    border-radius: 9999px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}

.a11y-close:hover,
.a11y-close:focus-visible {
    background: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
}

.a11y-group + .a11y-group {
    margin-top: 1.15rem;
}

.a11y-group-label {
    margin: 0 0 0.6rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.a11y-font-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.a11y-step {
    display: grid;
    place-items: center;
    height: 2.75rem;
    width: 2.75rem;
    flex-shrink: 0;
    border-radius: 0.9rem;
    border: 1px solid var(--border-color);
    background: var(--surface-soft);
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}

.a11y-step:hover,
.a11y-step:focus-visible {
    background: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
}

.a11y-font-value {
    flex: 1;
    text-align: center;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-color);
}

.a11y-toggles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.a11y-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 4.25rem;
    padding: 0.6rem 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    background: var(--surface-color);
    color: var(--text-color);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    cursor: pointer;
    transition: background 200ms ease, color 200ms ease, border-color 200ms ease, transform 200ms ease;
}

.a11y-option i {
    font-size: 1.05rem;
    color: var(--accent-color);
    transition: color 200ms ease;
}

.a11y-option:hover,
.a11y-option:focus-visible {
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.a11y-option.is-on {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #ffffff;
}

.a11y-option.is-on i {
    color: #ffffff;
}

.a11y-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 2.9rem;
    margin-top: 1.2rem;
    border: 1px solid var(--accent-color);
    border-radius: 9999px;
    background: transparent;
    color: var(--accent-color);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 200ms ease, color 200ms ease;
}

.a11y-reset:hover,
.a11y-reset:focus-visible {
    background: var(--accent-color);
    color: #ffffff;
}

.a11y-note {
    margin: 0.9rem 0 0;
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.6;
}

@media (max-width: 640px) {
    .a11y-widget {
        right: 1rem;
        bottom: 1rem;
    }

    .a11y-toggle {
        height: 3.25rem;
        width: 3.25rem;
        font-size: 1.45rem;
    }

    .a11y-panel {
        max-height: 72vh;
    }
}

/* Font size is applied inline on <html> by js/accessibility.js */

/* High contrast */
html.a11y-contrast {
    --primary-color: #000000;
    --primary-hover: #000000;
    --secondary-color: #5F3F18;
    --accent-color: #7A5220;
    --accent-hover: #5C3D17;
    --accent-light: #7A5220;
    --background-color: #FFFFFF;
    --surface-color: #FFFFFF;
    --surface-soft: #EFEFEF;
    --text-color: #000000;
    --text-muted: #1F1F1F;
    --border-color: #000000;
    --gold-soft: rgba(122, 82, 32, 0.16);
    --shadow-deep: 0 18px 40px rgba(0, 0, 0, 0.22);
    --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.16);
}

html.a11y-contrast .site-header,
html.a11y-contrast .site-header.is-scrolled {
    background: #FFFFFF;
    border-bottom: 1px solid #000000;
    box-shadow: none;
}

html.a11y-contrast .mobile-menu {
    background: #FFFFFF;
    border-bottom: 1px solid #000000;
}

html.a11y-contrast .hero h1,
html.a11y-contrast .hero h1 span,
html.a11y-contrast .hero-kicker,
html.a11y-contrast .hero-copy {
    color: #FFFFFF !important;
}

/* Highlight links */
html.a11y-links a:not(.btn):not(.social-icon):not(.whatsapp-float):not(.brand-lockup) {
    border-radius: 0.3rem;
    background-color: rgba(183, 141, 83, 0.24);
    box-shadow: 0 0 0 2px rgba(183, 141, 83, 0.24);
    text-decoration: underline !important;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

/* Readable font: swap the decorative serif for a clean sans */
html.a11y-readable {
    --font-heading: 'Heebo', 'Segoe UI', Arial, Helvetica, sans-serif;
}

/* Text spacing */
html.a11y-spacing :is(p, li, a, span, label, .body-copy) {
    letter-spacing: 0.05em !important;
    word-spacing: 0.1em !important;
}

html.a11y-spacing :is(p, li, .body-copy) {
    line-height: 2 !important;
}

/* Large high-contrast cursor */
html.a11y-cursor,
html.a11y-cursor * {
    cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'><path d='M6 2 L6 28 L13 21.5 L18 32 L23.5 29.5 L18.5 19.5 L28 19.5 Z' fill='%23ffffff' stroke='%232E2620' stroke-width='2.5' stroke-linejoin='round'/></svg>") 6 2, auto !important;
}

/* Stop animations */
html.a11y-nomotion *,
html.a11y-nomotion *::before,
html.a11y-nomotion *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
}

html.a11y-nomotion [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .a11y-toggle,
    .a11y-option {
        transition: none;
    }
}