/* ============================================================
   WP Accessibility Suite — Frontend Styles v1.0.0
   ============================================================ */

/* ---------- Skip link ---------- */
.wpas-skip-link {
    position: absolute;
    top: -100px;
    left: 12px;
    z-index: 999999;
    padding: 10px 20px;
    background: #000;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border-radius: 0 0 6px 6px;
    text-decoration: none;
    transition: top .2s;
}
.wpas-skip-link:focus { top: 0; }

/* ---------- Screen-reader only ---------- */
.wpas-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;
}

/* ---------- Widget shell ---------- */
#wpas-widget {
    position: fixed;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    font-family: system-ui, sans-serif;
}
#wpas-widget.wpas-bottom-right { bottom: 24px; right: 24px; align-items: flex-end; }
#wpas-widget.wpas-bottom-left  { bottom: 24px; left: 24px;  align-items: flex-start; }
#wpas-widget.wpas-top-right    { top: 24px;    right: 24px; align-items: flex-end;   flex-direction: column-reverse; }
#wpas-widget.wpas-top-left     { top: 24px;    left: 24px;  align-items: flex-start; flex-direction: column-reverse; }

/* ---------- FAB button ---------- */
#wpas-toggle-btn {
    width: 52px; height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--wpas-primary, #1a73e8);
    color: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
    transition: transform .18s, box-shadow .18s;
    flex-shrink: 0;
}
#wpas-toggle-btn:hover  { transform: scale(1.08); box-shadow: 0 6px 20px rgba(0,0,0,.3); }
#wpas-toggle-btn:focus  { outline: 3px solid #fff; outline-offset: 3px; }

/* ---------- Panel ---------- */
#wpas-panel {
    width: 290px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    overflow: hidden;
    animation: wpas-pop .22s cubic-bezier(.34,1.56,.64,1);
}
#wpas-panel[hidden] { display: none; }

@keyframes wpas-pop {
    from { opacity: 0; transform: scale(.92) translateY(8px); }
    to   { opacity: 1; transform: scale(1)   translateY(0);   }
}

.wpas-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    background: var(--wpas-primary, #1a73e8);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
}
#wpas-close-btn {
    background: none; border: none; color: #fff;
    font-size: 22px; line-height: 1; cursor: pointer;
    padding: 0 4px; border-radius: 4px;
}
#wpas-close-btn:hover  { background: rgba(255,255,255,.2); }
#wpas-close-btn:focus  { outline: 2px solid #fff; }

.wpas-panel-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- Control groups ---------- */
.wpas-control-group { display: flex; flex-direction: column; gap: 8px; }
.wpas-group-label   { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #888; }

.wpas-btn-row { display: flex; gap: 6px; }
.wpas-btn {
    flex: 1;
    padding: 7px 4px;
    border: 2px solid #ddd;
    border-radius: 7px;
    background: #f8f8f8;
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}
.wpas-btn:hover  { border-color: var(--wpas-primary, #1a73e8); background: #f0f6ff; }
.wpas-btn:focus  { outline: 3px solid var(--wpas-primary, #1a73e8); outline-offset: 1px; }
.wpas-btn[aria-pressed="true"] {
    border-color: var(--wpas-primary, #1a73e8);
    background: var(--wpas-primary, #1a73e8);
    color: #fff;
}

.wpas-font-row .wpas-btn { font-family: Georgia, serif; }

/* ---------- Toggle switch ---------- */
.wpas-toggle-label {
    display: flex; align-items: center; gap: 10px;
    cursor: pointer; font-size: 14px;
}
.wpas-toggle-label input[type="checkbox"] {
    position: absolute; opacity: 0; width: 0; height: 0;
}
.wpas-toggle-track {
    position: relative; width: 42px; height: 24px;
    background: #ccc; border-radius: 24px;
    transition: background .2s;
    flex-shrink: 0;
}
.wpas-toggle-label input:checked ~ .wpas-toggle-track { background: var(--wpas-primary, #1a73e8); }
.wpas-toggle-thumb {
    position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px;
    background: #fff; border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
    transition: transform .2s;
}
.wpas-toggle-label input:checked ~ .wpas-toggle-track .wpas-toggle-thumb { transform: translateX(18px); }
.wpas-toggle-label input:focus ~ .wpas-toggle-track { outline: 3px solid var(--wpas-primary, #1a73e8); }

/* ---------- Reset button ---------- */
.wpas-reset-all {
    width: 100%; padding: 8px;
    border: 1px solid #e0e0e0; border-radius: 7px;
    background: #fafafa; font-size: 12px; color: #777;
    cursor: pointer; transition: background .15s, color .15s;
}
.wpas-reset-all:hover { background: #fee; color: #c00; border-color: #f99; }
.wpas-reset-all:focus { outline: 3px solid var(--wpas-primary, #1a73e8); }

/* ============================================================
   Global contrast / theme overrides
   ============================================================ */
body.wpas-contrast-high { filter: contrast(1.45) !important; }

body.wpas-contrast-dark {
    background: #000 !important;
    color: #fff !important;
}
body.wpas-contrast-dark a   { color: #6cf !important; }
body.wpas-contrast-dark *   { border-color: #555 !important; }
body.wpas-contrast-dark img { filter: brightness(.85); }

/* ============================================================
   Keyboard navigation — enhanced focus ring
   ============================================================ */
body.wpas-keyboard-focus *:focus {
    outline: 3px solid #f50 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 6px rgba(255,85,0,.2) !important;
}

/* ============================================================
   Reading / screen-reader mode
   ============================================================ */
body.wpas-reading-mode {
    background: #fffff8 !important;
    color: #1a1a1a !important;
}
body.wpas-reading-mode * {
    font-family: Georgia, "Times New Roman", serif !important;
    line-height: 1.8 !important;
    letter-spacing: .01em !important;
}
body.wpas-reading-mode img:not([role="presentation"]) {
    display: block; max-width: 100%; margin: 1em auto;
}
