/* ==========================================================================
   Accessibility Styles
   Estilos para melhorar a acessibilidade do tema
   ========================================================================== */

/* ==========================================================================
   Skip Links
   ========================================================================== */

.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: var(--color-white);
    padding: var(--spacing-md) var(--spacing-lg);
    z-index: 10000;
    text-decoration: none;
    font-weight: 600;
    border-radius: 0 0 var(--border-radius-md) var(--border-radius-md);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 0;
    outline: none;
}

/* ==========================================================================
   Focus Styles
   ========================================================================== */

/* Focus visível para todos os elementos interativos */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* Remove outline padrão quando não é focus-visible */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
    outline: none;
}

/* Focus para cards e elementos clicáveis */
.card:focus-within,
.hotel-card:focus-within,
.post-card:focus-within {
    box-shadow: 0 0 0 3px var(--color-primary);
}

/* ==========================================================================
   Screen Reader Only
   ========================================================================== */

.sr-only,
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only-focusable:focus,
.screen-reader-text:focus {
    position: static;
    width: auto;
    height: auto;
    padding: var(--spacing-md);
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--color-white);
}

/* ==========================================================================
   High Contrast Mode
   ========================================================================== */

@media (prefers-contrast: high) {
    :root {
        --color-primary: #006400;
        --color-text: #000000;
        --color-text-light: #333333;
        --color-border: #000000;
    }
    
    a {
        text-decoration: underline;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .hero__background,
    .parallax {
        transform: none !important;
    }
}

/* ==========================================================================
   Color Scheme - Dark Mode Support
   ========================================================================== */

@media (prefers-color-scheme: dark) {
    /* Apenas se quiser suportar dark mode no futuro */
    /* Por enquanto, mantemos o tema claro */
}

/* ==========================================================================
   Text Sizing
   ========================================================================== */

/* Respeita configurações de tamanho de texto do usuário */
html {
    font-size: 100%; /* 16px base */
}

/* Garante que o texto pode ser redimensionado até 200% */
body {
    font-size: 1rem;
    line-height: 1.6;
}

/* ==========================================================================
   Links Acessíveis
   ========================================================================== */

/* Links devem ser distinguíveis do texto */
a {
    text-decoration-skip-ink: auto;
}

/* Links em parágrafos devem ter underline */
p a,
.content a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

p a:hover,
.content a:hover {
    text-decoration-thickness: 2px;
}

/* Indicador visual para links externos */
a[target="_blank"]::after {
    content: " ↗";
    font-size: 0.8em;
    vertical-align: super;
}

/* Exceção para botões e ícones */
.btn[target="_blank"]::after,
.social-links__item[target="_blank"]::after,
a[target="_blank"] svg + *::after {
    content: none;
}

/* ==========================================================================
   Forms Acessíveis
   ========================================================================== */

/* Labels sempre visíveis */
label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
}

/* Campos obrigatórios */
.required::after,
[required] + label::after {
    content: " *";
    color: var(--color-error);
}

/* Estados de erro */
.field-error input,
.field-error select,
.field-error textarea,
input:invalid,
select:invalid,
textarea:invalid {
    border-color: var(--color-error);
}

.error-message {
    color: var(--color-error);
    font-size: var(--font-size-small);
    margin-top: var(--spacing-xs);
}

/* Placeholder com contraste adequado */
::placeholder {
    color: var(--color-text-muted);
    opacity: 1;
}

/* ==========================================================================
   Buttons Acessíveis
   ========================================================================== */

button,
.btn {
    cursor: pointer;
    min-height: 44px; /* Tamanho mínimo para toque */
    min-width: 44px;
}

/* Botões desabilitados */
button:disabled,
.btn:disabled,
.btn--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ==========================================================================
   Images Acessíveis
   ========================================================================== */

/* Imagens devem ter alt text */
img:not([alt]) {
    outline: 3px solid var(--color-error);
}

/* Imagens decorativas */
img[alt=""],
img[role="presentation"] {
    outline: none;
}

/* ==========================================================================
   Tables Acessíveis
   ========================================================================== */

table {
    border-collapse: collapse;
}

th {
    text-align: left;
    font-weight: 600;
}

th,
td {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--color-border);
}

caption {
    caption-side: top;
    text-align: left;
    font-weight: 600;
    padding-bottom: var(--spacing-sm);
}

/* ==========================================================================
   Navigation Acessível
   ========================================================================== */

nav[aria-label] {
    /* Navegação com label acessível - seletor mantido para referência */
    display: block;
}

/* Indicador de página atual */
[aria-current="page"] {
    font-weight: 700;
    color: var(--color-primary);
}

/* Menu expandido/colapsado */
[aria-expanded="false"] + .submenu {
    display: none;
}

[aria-expanded="true"] + .submenu {
    display: block;
}

/* ==========================================================================
   Modals e Dialogs Acessíveis
   ========================================================================== */

[role="dialog"],
[role="alertdialog"] {
    position: fixed;
    z-index: 1000;
}

/* Trap focus dentro do modal */
.modal-open {
    overflow: hidden;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

[aria-busy="true"] {
    cursor: wait;
}

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Live Regions
   ========================================================================== */

[aria-live="polite"],
[aria-live="assertive"] {
    /* Anúncios para screen readers - seletor mantido para referência */
    position: relative;
}

.visually-hidden-alert {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}
