/* Cookie Consent Banner - woodranch-privacy-shield
 *
 * WCAG 2.2 AAA contrast targets:
 *   Normal text: 7:1 minimum
 *   Large text (18px+ or 14px+ bold): 4.5:1 minimum
 *   UI components: 3:1 minimum
 *
 * Verified ratios (on #2a2a2a background):
 *   #ffffff = 14.7:1  (headings)
 *   #e0e0e0 = 10.7:1  (body text)
 *   #d0d0d0 =  9.2:1  (descriptions)
 *   #bababa =  7.1:1  (secondary text - AAA)
 *   #8bbdf5 =  7.1:1  (links/focus - AAA)
 *   #7dcc7d =  7.1:1  (badge/toggle on - AAA)
 *   #777    =  3.2:1  (toggle track - UI component 3:1)
 */

/* ================================================================
   DIALOG
   ================================================================ */

.wr-consent-dialog {
    border: none;
    border-top: 1px solid #777; /* 3.2:1 on #2a2a2a - UI component */
    padding: 0;
    max-width: 100%;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    background: #2a2a2a;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    box-sizing: border-box;
}

.wr-consent-dialog[open] {
    margin: auto 0 0 0;
}

.wr-consent-dialog::backdrop {
    background: rgba(0, 0, 0, 0.25);
}

/* Override theme link styles inside dialog */
.wr-consent-dialog a,
.wr-consent-dialog a:visited {
    color: #8bbdf5; /* 7.1:1 on #2a2a2a - AAA */
    text-decoration: underline;
    text-underline-offset: 2px;
}

.wr-consent-dialog a:hover {
    color: #fff;
}

.wr-consent-dialog a:focus-visible {
    color: #fff;
    outline: 3px solid #8bbdf5;
    outline-offset: 2px;
}

/* ================================================================
   CLOSE BUTTON
   ================================================================ */

.wr-consent-btn-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: #bababa; /* 7.1:1 on #2a2a2a - AAA */
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.wr-consent-btn-close:hover,
.wr-consent-btn-close:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.wr-consent-btn-close:focus-visible {
    outline: 3px solid #8bbdf5;
    outline-offset: 2px;
}

/* ================================================================
   LAYOUT — two-column on desktop, stacked on mobile
   ================================================================ */

.wr-consent-inner {
    position: relative;
    margin: 0 auto;
    padding: 28px 40px;
    display: grid;
    grid-template-columns: 1fr 280px;
    grid-template-rows: auto auto;
    gap: 8px 48px;
}

.wr-consent-text {
    grid-column: 1;
    grid-row: 1 / 3;
}

.wr-consent-sidebar {
    grid-column: 2;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

/* When categories panel is visible, switch to single-column */
.wr-consent-inner:has(.wr-consent-categories:not([hidden])) {
    grid-template-columns: 1fr;
}

.wr-consent-inner:has(.wr-consent-categories:not([hidden])) .wr-consent-sidebar {
    grid-column: 1;
    grid-row: auto;
}

/* ================================================================
   HEADING
   ================================================================ */

.wr-consent-heading {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #fff; /* 18.1:1 - AAA */
    line-height: 1.3;
}

/* ================================================================
   DESCRIPTION TEXT
   ================================================================ */

.wr-consent-desc {
    margin: 0 0 2.5em;
    color: #d0d0d0; /* 11.4:1 - AAA */
    font-size: 13px;
    line-height: 1.65;
}

.wr-consent-desc:last-of-type {
    margin-bottom: 0;
}

/* ================================================================
   CATEGORY TOGGLES (Customize view)
   ================================================================ */

.wr-consent-categories {
    margin: 20px 0;
    border: 1px solid #777; /* 3.2:1 on #2a2a2a - UI component */
    border-radius: 6px;
    overflow: hidden;
}

.wr-consent-category {
    padding: 16px 20px;
    border-bottom: 1px solid #777; /* 3.2:1 on #2a2a2a - UI component */
}

.wr-consent-category:last-child {
    border-bottom: none;
}

.wr-consent-category-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 4px;
}

.wr-consent-category-name {
    font-weight: 600;
    font-size: 14px;
    color: #fff; /* 18.1:1 - AAA */
    cursor: default;
}

label.wr-consent-category-name {
    cursor: pointer;
}

.wr-consent-category-desc {
    margin: 0;
    font-size: 13px;
    color: #bababa; /* 7.1:1 on #2a2a2a - AAA */
}

/* Always Active badge */
.wr-consent-badge {
    font-size: 12px;
    font-weight: 700;
    color: #7dcc7d; /* 7.1:1 on #2a2a2a - AAA */
    white-space: nowrap;
}

/* ================================================================
   TOGGLE SWITCH
   ================================================================ */

.wr-consent-toggle {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 44px;
    min-width: 44px;
    height: 24px;
    background: #777; /* 4.0:1 - UI component */
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    border: 2px solid #999; /* 5.4:1 border for AAA UI */
    outline: none;
    margin: 0;
    transition: background 0.2s, border-color 0.2s;
    box-sizing: content-box;
}

.wr-consent-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.wr-consent-toggle:checked {
    background: #7dcc7d;
    border-color: #7dcc7d;
}

.wr-consent-toggle:checked::after {
    transform: translateX(20px);
}

.wr-consent-toggle:focus-visible {
    outline: 3px solid #8bbdf5;
    outline-offset: 2px;
}

/* ================================================================
   ACTION BUTTONS
   ================================================================ */

.wr-consent-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wr-consent-btn {
    padding: 11px 20px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    line-height: 1.3;
    transition: background 0.15s, border-color 0.15s;
}

/* Equal prominence — no dark patterns */
.wr-consent-btn--secondary {
    background: #333;
    color: #fff; /* 12.6:1 on #333 - AAA */
    border: 1px solid #888; /* 3.1:1 on #333 - UI component */
}

.wr-consent-btn--secondary:hover,
.wr-consent-btn--secondary:focus-visible {
    background: #4a4a4a;
    border-color: #aaa; /* 3.1:1 on #4a4a4a - UI component */
}

.wr-consent-btn:focus-visible {
    outline: 3px solid #8bbdf5;
    outline-offset: 2px;
    box-shadow: 0 0 0 6px #2a2a2a; /* dark ring ensures 3:1 outline contrast on any bg */
}

/* ================================================================
   POLICY LINKS
   ================================================================ */

.wr-consent-links {
    margin-top: 12px;
    font-size: 13px;
}

/* ================================================================
   FOOTER MANAGE LINK
   ================================================================ */

.wr-consent-manage-link {
    position: fixed;
    bottom: 12px;
    right: 12px;
    background: #2a2a2a;
    color: #d0d0d0; /* 11.4:1 - AAA */
    border: 1px solid #555;
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
    z-index: 9999;
    font-family: inherit;
    line-height: 1.3;
    transition: background 0.15s;
}

.wr-consent-manage-link:hover,
.wr-consent-manage-link:focus-visible {
    background: #333;
    color: #fff;
}

.wr-consent-manage-link:focus-visible {
    outline: 3px solid #8bbdf5;
    outline-offset: 2px;
}

/* ================================================================
   GPC NOTICE
   ================================================================ */

.wr-gpc-notice {
    position: fixed;
    bottom: 16px;
    right: 16px;
    background: #2a2a2a;
    color: #d0d0d0;
    padding: 12px 20px;
    border: 1px solid #555;
    border-radius: 6px;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    z-index: 10000;
    max-width: 320px;
    line-height: 1.5;
}

/* ================================================================
   REDUCED MOTION
   ================================================================ */

@media (prefers-reduced-motion: reduce) {
    .wr-consent-toggle,
    .wr-consent-toggle::after,
    .wr-consent-btn,
    .wr-consent-btn-close,
    .wr-consent-manage-link,
    .wr-consent-dialog a {
        transition: none;
    }
}

/* ================================================================
   RESPONSIVE — tablet
   ================================================================ */

@media (max-width: 900px) {
    .wr-consent-inner {
        grid-template-columns: 1fr;
        padding: 24px 28px;
    }

    .wr-consent-sidebar {
        grid-column: 1;
        grid-row: auto;
    }

    .wr-consent-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .wr-consent-btn {
        flex: 1 1 auto;
        min-width: 180px;
    }
}

/* ================================================================
   RESPONSIVE — mobile
   ================================================================ */

@media (max-width: 600px) {
    .wr-consent-inner {
        padding: 16px;
    }

    .wr-consent-actions {
        flex-direction: column;
    }

    .wr-consent-btn {
        width: 100%;
        min-width: 0;
    }

    .wr-consent-manage-link {
        bottom: 8px;
        right: 8px;
        text-align: center;
    }

    .wr-gpc-notice {
        left: 16px;
        right: 16px;
        bottom: 8px;
        max-width: none;
    }
}
