/*
 * ACCESSIBILITY
 * ------------------------------------------------------------------
 * Pairs with assets/scripts/ca-a11y.js. Three separate things live here:
 *
 *   1. The button in the menu and the panel it opens.
 *   2. The preferences themselves — text size, contrast, link underlines,
 *      reduced motion — which are driven by classes on <html>, so they
 *      apply to every page and survive navigation.
 *   3. Baseline fixes that are always on for everybody: a skip link and a
 *      visible keyboard focus ring. The site sets outline:0 in a few
 *      places, which leaves keyboard users with no idea where they are.
 *
 * Nothing here touches main.css.
 */

/* ==================================================================
   1a. The button in the menu (where the social icons used to be)
   ================================================================== */

.c-nav_a11y {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 4;
    width: 100%;
    padding-bottom: 3.4375rem;
    text-align: center;
}

@media (min-width: 700px) { .c-nav_a11y { width: 50rem; } }

/* The menu's entrance, unchanged. The social icons that used to sit here rose
   from translateY(10rem) on a .6s curve, .4s after the menu opened and .15s
   on the way out (main.css, .c-nav_social .c-social_item). The button copies
   that exactly — without it, it sat still while the rest of the menu moved,
   which is what made the open and close look wrong. */
.c-nav_a11y {
    -webkit-transform: translateY(10rem);
    -ms-transform: translateY(10rem);
    transform: translateY(10rem);
    -webkit-transition: -webkit-transform .6s cubic-bezier(.4, 0, 0, 1);
    transition: transform .6s cubic-bezier(.4, 0, 0, 1);
    -webkit-transition-delay: .15s;
    transition-delay: .15s;
}

body.has-nav-open .c-nav_a11y {
    -webkit-transform: translateY(0);
    -ms-transform: translateY(0);
    transform: translateY(0);
    -webkit-transition-delay: .4s;
    transition-delay: .4s;
}

.ca-a11y-open {
    display: -ms-inline-flexbox;
    display: inline-flex;
    -ms-flex-align: center;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 12px 22px;
    border: 1px solid rgba(35, 31, 32, .18);
    border-radius: 999px;
    background: transparent;
    color: #231f20;
    font-family: Montserrat, "Helvetica Neue", Arial, sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color .3s cubic-bezier(.4, 0, 0, 1),
                color .3s cubic-bezier(.4, 0, 0, 1),
                border-color .3s cubic-bezier(.4, 0, 0, 1);
}

.ca-a11y-open:hover,
.ca-a11y-open:focus-visible { background-color: #231f20; border-color: #231f20; color: #fff; }
.ca-a11y-open:hover .ca-a11y-open_icon, .ca-a11y-open:focus-visible .ca-a11y-open_icon { fill: #fff; }

.ca-a11y-open_icon { width: 18px; height: 18px; display: block; fill: #231f20; transition: fill .3s cubic-bezier(.4, 0, 0, 1); }

/* ==================================================================
   1b. The panel
   ================================================================== */

.ca-a11y { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 9500; }
.ca-a11y[hidden] { display: none; }

.ca-a11y_backdrop {
    position: absolute; top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(35, 31, 32, .35);
    opacity: 0;
    transition: opacity .3s ease;
}
.ca-a11y.is-in .ca-a11y_backdrop { opacity: 1; }

.ca-a11y_panel {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 100%;
    max-width: 400px;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-direction: column;
    flex-direction: column;
    background: #fff;
    color: #231f20;
    font-family: Montserrat, "Helvetica Neue", Arial, sans-serif;
    box-shadow: -1px 0 0 rgba(35, 31, 32, .16);
    -webkit-transform: translateX(100%);
    transform: translateX(100%);
    transition: transform .4s cubic-bezier(.4, 0, 0, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.ca-a11y.is-in .ca-a11y_panel { -webkit-transform: translateX(0); transform: translateX(0); }

.ca-a11y_head {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
    -ms-flex-pack: justify;
    justify-content: space-between;
    gap: 16px;
    padding: 28px 28px 20px;
    border-bottom: 1px solid rgba(35, 31, 32, .12);
}

.ca-a11y_title {
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.ca-a11y_close {
    width: 34px; height: 34px;
    margin: -4px -6px -4px 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #231f20;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background-color .3s ease;
}
.ca-a11y_close:hover, .ca-a11y_close:focus-visible { background-color: rgba(35, 31, 32, .08); }

.ca-a11y_body { padding: 8px 28px 28px; }

.ca-a11y_group { padding: 20px 0; border-bottom: 1px solid rgba(35, 31, 32, .1); }
.ca-a11y_group:last-of-type { border-bottom: 0; }

.ca-a11y_grouptitle {
    margin: 0 0 12px;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #6f6760;
}

/* text-size segmented control */
.ca-a11y_seg { display: -ms-flexbox; display: flex; gap: 8px; }
.ca-a11y_seg button {
    -ms-flex: 1 1 0; flex: 1 1 0;
    padding: 11px 6px;
    border: 1px solid rgba(35, 31, 32, .2);
    border-radius: 8px;
    background: transparent;
    color: #231f20;
    font-family: inherit;
    font-size: 11px;
    letter-spacing: .06em;
    cursor: pointer;
    transition: background-color .25s ease, border-color .25s ease, color .25s ease;
}
.ca-a11y_seg button:hover { border-color: rgba(35, 31, 32, .45); }
.ca-a11y_seg button[aria-pressed="true"] { background: #231f20; border-color: #231f20; color: #fff; }
.ca-a11y_seg button:nth-child(1) { font-size: 11px; }
.ca-a11y_seg button:nth-child(2) { font-size: 13px; }
.ca-a11y_seg button:nth-child(3) { font-size: 15px; }

/* on/off rows */
.ca-a11y_switch {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-align: center;
    align-items: center;
    -ms-flex-pack: justify;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    margin: 0 0 10px;
    padding: 13px 14px;
    border: 1px solid rgba(35, 31, 32, .16);
    border-radius: 10px;
    background: transparent;
    color: #231f20;
    font-family: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: border-color .25s ease, background-color .25s ease;
}
.ca-a11y_switch:last-child { margin-bottom: 0; }
.ca-a11y_switch:hover { border-color: rgba(35, 31, 32, .4); }

.ca-a11y_switch_text { display: block; }
.ca-a11y_switch_hint { display: block; margin-top: 3px; font-size: 11px; color: #6f6760; }

/* the little track + knob, drawn in CSS so there is no image to load */
.ca-a11y_track {
    -ms-flex: 0 0 auto; flex: 0 0 auto;
    position: relative;
    width: 40px; height: 22px;
    border-radius: 999px;
    background: rgba(35, 31, 32, .2);
    transition: background-color .25s ease;
}
.ca-a11y_track::after {
    content: "";
    position: absolute;
    top: 3px; left: 3px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform .25s cubic-bezier(.4, 0, 0, 1);
}
.ca-a11y_switch[aria-pressed="true"] .ca-a11y_track { background: #231f20; }
.ca-a11y_switch[aria-pressed="true"] .ca-a11y_track::after { -webkit-transform: translateX(18px); transform: translateX(18px); }

.ca-a11y_reset {
    width: 100%;
    margin-top: 22px;
    padding: 13px;
    border: 1px solid rgba(35, 31, 32, .2);
    border-radius: 999px;
    background: transparent;
    color: #231f20;
    font-family: inherit;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .18em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color .25s ease, color .25s ease;
}
.ca-a11y_reset:hover, .ca-a11y_reset:focus-visible { background: #231f20; color: #fff; }

.ca-a11y_note { margin: 18px 0 0; font-size: 11px; line-height: 1.5; color: #6f6760; }

/* ==================================================================
   2. The preferences themselves
   ================================================================== */

/* --- text size. The site is built in rem off a root size that changes per
   breakpoint (12 / 13 / 14 / 16px), so the whole type scale moves with it. --- */
@media (max-width: 699px) {
    html.ca-text-1 { font-size: 13.8px !important; }
    html.ca-text-2 { font-size: 15.6px !important; }
}
@media (min-width: 700px) and (max-width: 1199px) {
    html.ca-text-1 { font-size: 14.95px !important; }
    html.ca-text-2 { font-size: 16.9px !important; }
}
@media (min-width: 1200px) and (max-width: 1599px) {
    html.ca-text-1 { font-size: 16.1px !important; }
    html.ca-text-2 { font-size: 18.2px !important; }
}
@media (min-width: 1600px) {
    html.ca-text-1 { font-size: 1.15em !important; }
    html.ca-text-2 { font-size: 1.3em !important; }
}

/* Components written in px rather than rem are scaled here by hand, so text
   size means the same thing everywhere on the page. */
html.ca-text-1 .ca-footer_link, html.ca-text-1 .ca-footer_tagline { font-size: 13px; }
html.ca-text-2 .ca-footer_link, html.ca-text-2 .ca-footer_tagline { font-size: 15px; }
html.ca-text-1 .ca-footer_col-title, html.ca-text-1 .ca-footer_copy,
html.ca-text-1 .ca-footer_signup-label { font-size: 12px; }
html.ca-text-2 .ca-footer_col-title, html.ca-text-2 .ca-footer_copy,
html.ca-text-2 .ca-footer_signup-label { font-size: 14px; }
html.ca-text-1 .ca-footer_consent { font-size: 11px; }
html.ca-text-2 .ca-footer_consent { font-size: 12px; }
html.ca-text-1 .ca-footer_input, html.ca-text-2 .ca-footer_input { font-size: 16px; }
html.ca-text-1 .c-home_subheadline { font-size: 18px; }
html.ca-text-2 .c-home_subheadline { font-size: 21px; }
html.ca-text-1 .ca-audio-toggle, html.ca-text-1 .ca-a11y-open { font-size: 13px; }
html.ca-text-2 .ca-audio-toggle, html.ca-text-2 .ca-a11y-open { font-size: 15px; }

/* --- higher contrast. The site leans on soft greys; these are the ones that
   fall below the WCAG AA contrast ratio on white. --- */
html.ca-contrast body { color: #000; }
html.ca-contrast .c-home_subheadline,
html.ca-contrast .ca-rail_label,
html.ca-contrast .ca-a11y_grouptitle,
html.ca-contrast .ca-a11y_switch_hint,
html.ca-contrast .ca-a11y_note,
html.ca-contrast .ca-back-collection { color: #231f20 !important; }

html.ca-contrast .ca-footer_tagline,
html.ca-contrast .ca-footer_col-title,
html.ca-contrast .ca-footer_copy,
html.ca-contrast .ca-footer_signup-label,
html.ca-contrast .ca-footer_consent,
html.ca-contrast .ca-footer_note { color: #000 !important; }
html.ca-contrast .ca-footer_input { border-bottom-color: #000 !important; }
html.ca-contrast .ca-footer_input::placeholder { color: #3a3632 !important; }
html.ca-contrast .ca-footer_cols { border-color: rgba(0, 0, 0, .45) !important; }
html.ca-contrast .ca-footer_inner > .ca-footer_base { border-color: rgba(0, 0, 0, .45) !important; }

html.ca-contrast .ca-a11y_switch,
html.ca-contrast .ca-a11y_seg button,
html.ca-contrast .ca-a11y_reset,
html.ca-contrast .ca-a11y-open { border-color: #231f20; }

/* --- underline links, so they are not signalled by colour or position alone --- */
html.ca-underline a:not(.o-button_link):not(.c-logo_link),
html.ca-underline .ca-footer_link,
html.ca-underline .c-nav_link { text-decoration: underline; text-underline-offset: .22em; }

/* --- reduced motion --- */
html.ca-motion *,
html.ca-motion *::before,
html.ca-motion *::after {
    -webkit-transition-duration: .001ms !important;
    transition-duration: .001ms !important;
    -webkit-animation-duration: .001ms !important;
    animation-duration: .001ms !important;
    -webkit-animation-iteration-count: 1 !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
}

/* ==================================================================
   3. Always on, for everybody
   ================================================================== */

/* Skip link: the first thing a keyboard or screen-reader user meets. */
/* Parked out of sight until it is tabbed to. It used to sit at
   position:absolute, top:8px, pushed up out of view with translateY(-150%) —
   which Safari happily reveals when you rubber-band past the top of the page,
   so the black pill flashed on screen for mouse users. Now it takes up no
   space and paints nothing at all until focus, and it is fixed rather than
   absolute, so overscroll cannot drag it into view. */
.ca-skip {
    position: fixed;
    top: 8px; left: 8px;
    z-index: 100000;
    width: 1px; height: 1px;
    margin: 0; padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    white-space: nowrap;
    opacity: 0;
    border-radius: 999px;
    background: #231f20;
    color: #fff;
    font-family: Montserrat, "Helvetica Neue", Arial, sans-serif;
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
    text-decoration: none;
}

.ca-skip:focus {
    width: auto; height: auto;
    padding: 12px 20px;
    overflow: visible;
    clip: auto;
    -webkit-clip-path: none;
    clip-path: none;
    opacity: 1;
    color: #fff;
}

/* A focus ring that is actually visible. Only ever shows for keyboard use. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid #231f20 !important;
    outline-offset: 3px !important;
}

/* …and a light ring on the dark surfaces, where a dark one would vanish.
   The footer used to be one of those surfaces; it is white now, so its
   controls keep the normal dark ring and only the pressed a11y switch
   (ink-filled) still needs the light one. */
.ca-a11y_panel .ca-a11y_switch[aria-pressed="true"]:focus-visible {
    outline-color: #f4efe7 !important;
}

/* main gets focus when the skip link is used; never show a ring for that */
main:focus { outline: none; }
