/* Climate Works — Cookie consent & accessibility */

.footer-link-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.footer-link-btn:hover {
    opacity: 0.85;
}

/* Cookie banner */
.cw-cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    background: #fff;
    border-top: 1px solid #e8edf2;
    box-shadow: 0 -8px 32px rgba(15, 57, 82, 0.12);
    transform: translateY(110%);
    transition: transform 0.35s ease;
}

.cw-cookie-banner.is-visible {
    transform: translateY(0);
}

.cw-cookie-banner__inner {
    width: min(100% - 32px, var(--cw-max, 1280px));
    margin: 0 auto;
    padding: 20px 0 24px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px 28px;
    align-items: center;
}

.cw-cookie-banner__text {
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #3d4449;
    margin: 0;
}

.cw-cookie-banner__text a {
    color: var(--cw-navy, #0f3952);
    text-decoration: underline;
}

.cw-cookie-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.cw-cookie-btn {
    border: none;
    border-radius: 999px;
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 11px 20px;
    cursor: pointer;
    white-space: nowrap;
}

.cw-cookie-btn--primary {
    background: var(--cw-yellow, #e69140);
    color: #fff;
}

.cw-cookie-btn--secondary {
    background: var(--cw-navy, #0f3952);
    color: #fff;
}

.cw-cookie-btn--ghost {
    background: #f0f4f8;
    color: var(--cw-navy, #0f3952);
}

.cw-cookie-panel {
    grid-column: 1 / -1;
    padding-top: 8px;
    border-top: 1px solid #e8edf2;
}

.cw-cookie-panel[hidden] {
    display: none !important;
}

.cw-cookie-option {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f4f8;
}

.cw-cookie-option:last-child {
    border-bottom: none;
}

.cw-cookie-option__title {
    font-family: 'Lato', sans-serif;
    font-weight: 700;
    color: #3d4449;
    margin: 0 0 4px;
    font-size: 0.92rem;
}

.cw-cookie-option__desc {
    margin: 0;
    font-family: 'Lato', sans-serif;
    font-size: 0.82rem;
    color: #5f6b76;
    line-height: 1.45;
}

.cw-cookie-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.cw-cookie-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cw-cookie-toggle__track {
    position: absolute;
    inset: 0;
    background: #c5cdd6;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s;
}

.cw-cookie-toggle input:checked + .cw-cookie-toggle__track {
    background: var(--cw-navy, #0f3952);
}

.cw-cookie-toggle input:disabled + .cw-cookie-toggle__track {
    opacity: 0.55;
    cursor: not-allowed;
}

.cw-cookie-toggle__track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.cw-cookie-toggle input:checked + .cw-cookie-toggle__track::after {
    transform: translateX(20px);
}

/* Accessibility widget */
.cw-a11y-trigger {
    position: fixed;
    left: 20px;
    bottom: 24px;
    z-index: 99998;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: var(--cw-navy, #0f3952);
    color: #fff;
    box-shadow: 0 8px 24px rgba(15, 57, 82, 0.28);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.cw-a11y-trigger:hover {
    transform: scale(1.05);
}

.cw-a11y-trigger svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

.cw-a11y-panel {
    position: fixed;
    left: 20px;
    bottom: 88px;
    z-index: 99998;
    width: min(360px, calc(100vw - 40px));
    max-height: min(70vh, 560px);
    background: #f4f6f8;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.cw-a11y-panel.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.cw-a11y-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #3b77ac 0%, #0f3952 100%);
    color: #fff;
}

.cw-a11y-panel__title {
    font-family: 'Questrial', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.cw-a11y-panel__close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.9;
}

.cw-a11y-panel__body {
    padding: 14px;
    overflow-y: auto;
}

.cw-a11y-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.cw-a11y-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 96px;
    padding: 12px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #1a1a1a;
    font-family: 'Lato', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.cw-a11y-option:hover {
    border-color: #3b77ac;
}

.cw-a11y-option.is-active {
    border-color: #0f3952;
    box-shadow: inset 0 0 0 2px #0f3952;
    background: #f7fbff;
}

.cw-a11y-option__icon {
    font-size: 1.35rem;
    line-height: 1;
}

.cw-a11y-reset {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: #fff;
    color: var(--cw-navy, #0f3952);
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid #d0d8e0;
}

/* Accessibility modes */
html[data-a11y-contrast='on'] body {
    background: #000 !important;
    color: #fff !important;
}

html[data-a11y-contrast='on'] .site-header,
html[data-a11y-contrast='on'] .top-bar,
html[data-a11y-contrast='on'] .site-footer,
html[data-a11y-contrast='on'] section {
    background: #000 !important;
    color: #fff !important;
}

html[data-a11y-contrast='on'] a {
    color: #ffeb3b !important;
}

html[data-a11y-links='on'] a {
    text-decoration: underline !important;
    outline: 2px solid #e69140 !important;
    outline-offset: 2px;
    background: rgba(230, 145, 64, 0.12) !important;
}

html[data-a11y-text='1'] { font-size: 106.25%; }
html[data-a11y-text='2'] { font-size: 118.75%; }
html[data-a11y-text='3'] { font-size: 131.25%; }

html[data-a11y-spacing='on'] body {
    letter-spacing: 0.06em;
    word-spacing: 0.1em;
}

html[data-a11y-line-height='on'] body {
    line-height: 1.9 !important;
}

html[data-a11y-align='on'] body,
html[data-a11y-align='on'] p,
html[data-a11y-align='on'] li {
    text-align: left !important;
}

html[data-a11y-motion='off'] *,
html[data-a11y-motion='off'] *::before,
html[data-a11y-motion='off'] *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
}

html[data-a11y-hide-images='on'] img:not(.cw-a11y-keep) {
    opacity: 0 !important;
}

html[data-a11y-dyslexia='on'] body,
html[data-a11y-dyslexia='on'] button,
html[data-a11y-dyslexia='on'] input,
html[data-a11y-dyslexia='on'] textarea {
    font-family: Verdana, Tahoma, 'Segoe UI', sans-serif !important;
}

html[data-a11y-cursor='on'],
html[data-a11y-cursor='on'] * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath fill='%23000' stroke='%23fff' stroke-width='1.5' d='M4 4l7 20 4-8 8-4z'/%3E%3C/svg%3E") 2 2, auto !important;
}

html[data-a11y-saturation='on'] body {
    filter: saturate(1.35);
}

@media (max-width: 768px) {
    .cw-cookie-banner__inner {
        grid-template-columns: 1fr;
    }

    .cw-cookie-banner__actions {
        justify-content: stretch;
    }

    .cw-cookie-btn {
        flex: 1 1 auto;
        text-align: center;
    }

    .cw-a11y-trigger {
        left: 16px;
        bottom: 16px;
        width: 48px;
        height: 48px;
    }

    .cw-a11y-panel {
        left: 16px;
        right: 16px;
        width: auto;
        bottom: 76px;
    }
}
