/* ============================================================================
   MARKETING FOOTER — 4-column grid with logo and legal links
   Colours driven by --mk-* vars from Brand Palette Editor (Marketing Slate tab)
   ============================================================================
   KNOWN LIMITATION — HARDCODED COLOURS — DO NOT UPDATE
   This file is loaded on the PUBLIC site which does NOT load palette.css.
   Palette vars (--white-text, --hover-lift etc.) are UNDEFINED here.
   All colours MUST be hardcoded. Do NOT replace with palette CSS variables.
   ============================================================================ */

.mk-footer {
    padding: 1rem 2rem 1rem;
    position: relative;
    overflow: hidden;
    background-color: var(--mkt-footer-background);
    background-image: var(--mkt-footer-background-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--mkt-footer-text);
}

/* =============================================================================
   FOOTER GRID — 4 columns
   ============================================================================= */

.mk-footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mk-footer-col h4 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--mkt-footer-heading);
    margin-bottom: 1rem;
}

.mk-footer-col p {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    line-height: 1.8;
    margin: 0;
    color: var(--mkt-footer-text);
}

.mk-footer-col a {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    line-height: 2;
    color: var(--mkt-footer-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.mk-footer-col a:hover {
    color: var(--mkt-footer-link-hover);
    text-decoration: none;
}


/* =============================================================================
   SOCIAL LINKS
   ============================================================================= */

.mk-footer-social {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
}

.mk-footer-social a {
    display: inline;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}


/* =============================================================================
   FOOTER LOGO
   ============================================================================= */

.mk-footer-logo {
    text-align: center;
    padding: 0.5rem 0 0.5rem;
}

.mk-footer-logo img {
    height: 60px;
    width: auto;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.mk-footer-logo img:hover {
    opacity: 1;
}


/* =============================================================================
   FOOTER BOTTOM — Copyright + legal links
   ============================================================================= */

.mk-footer-bottom {
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.mk-footer-bottom p {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    color: var(--mkt-footer-muted);
    margin-bottom: 0.5rem;
}

.mk-legal-links {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    font-size: 0.8rem;
}

.mk-legal-links a {
    color: var(--mkt-footer-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.mk-legal-links a:hover {
    color: var(--mkt-footer-link-hover);
}

.mk-legal-links span {
    color: var(--mkt-footer-muted);
}


/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 768px) {
    .mk-footer {
        padding: 2rem 1rem 1rem;
    }

    .mk-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .mk-footer-logo img {
        height: 48px;
    }
}

@media (max-width: 480px) {
    .mk-footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .mk-footer-social {
        justify-content: center;
    }
}

/* =============================================================================
   ACCESSIBILITY THEMES — override marketing footer colours
   ============================================================================= */

body[data-theme="highcontrast"] .mk-footer {
    background-color: #000000;
    color: #ffffff;
}

body[data-theme="highcontrast"] .mk-footer-col h4 {
    color: #ffffff;
}

body[data-theme="highcontrast"] .mk-footer-col p,
body[data-theme="highcontrast"] .mk-footer-col a {
    color: #cccccc;
}

body[data-theme="highcontrast"] .mk-footer-col a:hover {
    color: #ffffff;
}

body[data-theme="highcontrast"] .mk-footer-grid {
    border-bottom-color: #ffffff;
}

body[data-theme="highcontrast"] .mk-footer-bottom p,
body[data-theme="highcontrast"] .mk-legal-links a,
body[data-theme="highcontrast"] .mk-legal-links span {
    color: #cccccc;
}

body[data-theme="highcontrast"] .mk-legal-links a:hover {
    color: #ffffff;
}

/* Tinted from the active dyslexia scheme (101/103/104/105) — see the matching
   note in marketing-header.css. */
body[data-theme^="dyslexic"] .mk-footer {
    background-color: var(--hero-background, #e8e4dc);
    color: #333333;
}

body[data-theme^="dyslexic"] .mk-footer-col h4 {
    color: #333333;
}

body[data-theme^="dyslexic"] .mk-footer-col p,
body[data-theme^="dyslexic"] .mk-footer-col a {
    color: #444444;
}

body[data-theme^="dyslexic"] .mk-footer-col a:hover {
    color: #000000;
}

body[data-theme^="dyslexic"] .mk-footer-grid {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

body[data-theme^="dyslexic"] .mk-footer-bottom p,
body[data-theme^="dyslexic"] .mk-legal-links a,
body[data-theme^="dyslexic"] .mk-legal-links span {
    color: #555555;
}

body[data-theme^="dyslexic"] .mk-legal-links a:hover {
    color: #000000;
}

/* Same logo treatment as the header — and drop the 0.7 resting opacity, which
   is a decorative fade the accessibility themes should not inherit. */
body[data-theme^="dyslexic"] .mk-footer-logo img {
    filter: brightness(0);
    opacity: 1;
}

/* Colour-vision schemes (106/107) — var-driven for the reason given in
   marketing-header.css: the two schemes differ from each other by their
   accent, so nothing here can be a literal. */
body[data-theme^="cvd"] .mk-footer {
    background-color: var(--hero-background, #e3ebf3);
    color: var(--body-text, #1c1f23);
}

body[data-theme^="cvd"] .mk-footer-col h4 {
    color: var(--heading-text, #0f1418);
}

body[data-theme^="cvd"] .mk-footer-col p,
body[data-theme^="cvd"] .mk-footer-col a {
    color: var(--body-text, #1c1f23);
}

body[data-theme^="cvd"] .mk-footer-col a:hover {
    color: var(--link-text, #0b4f9e);
}

body[data-theme^="cvd"] .mk-footer-grid {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

body[data-theme^="cvd"] .mk-footer-bottom p,
body[data-theme^="cvd"] .mk-legal-links a,
body[data-theme^="cvd"] .mk-legal-links span {
    color: var(--secondary-text, #3d444b);
}

body[data-theme^="cvd"] .mk-legal-links a:hover {
    color: var(--link-text, #0b4f9e);
}

body[data-theme^="cvd"] .mk-footer-logo img {
    filter: brightness(0);
    opacity: 1;
}

body[data-theme="highcontrast"] .mk-footer-logo img {
    filter: brightness(0) invert(1);
    opacity: 1;
}

/* ============================================================================
   ACCESSIBILITY PANEL + SECTION SPEECH
   ----------------------------------------------------------------------------
   The panel markup lives in marketing_footer.html (it has to be on every
   marketing page, not just home), so its styling lives here — this stylesheet
   is in every bundle that renders the marketing footer. The speech button is
   injected into marketing sections by SpeechManager in utils.js and is styled
   here for the same reason: one file, guaranteed loaded wherever the panel can
   switch the feature on.
   ============================================================================ */

.a11y-panel {
    position: fixed;
    /* Clears the site-help bubble (24px + its ~56px circle) on desktop and the
       full-width call bar (72px) on mobile — both sit bottom-right/bottom. */
    bottom: 6rem;
    right: 1rem;
    /* Above the sticky marketing header (1000). It used to be 100, so dragging
       the panel over the header put it *behind* the header — invisible, and
       with nothing left to grab to get it back. A11yPanel also stops it below
       the header so it never covers the nav; this is the safety net for
       anything else on the page that outranks a two-digit z-index. */
    z-index: 1100;
    max-width: 250px;
    padding: 0.75rem;
    background: var(--card-background, #ffffff);
    color: var(--body-text, #333333);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Drag handle. touch-action: none only here, never on the panel — killing
   touch on the whole box would stop the page scrolling under a finger that
   happens to land on it. A11yPanel switches the panel to left/top on first
   move, so the bottom/right anchors above are only the starting position. */
.a11y-panel-bar {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}

.a11y-panel-handle {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    height: 1.25rem;
    border-radius: 4px;
    cursor: grab;
    touch-action: none;
}

.a11y-panel-handle:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 2px;
}

.a11y-panel-handle:active,
.a11y-panel.is-dragging .a11y-panel-handle {
    cursor: grabbing;
}

.a11y-panel.is-dragging {
    user-select: none;
}

.a11y-panel-handle svg {
    display: block;
    width: 1.5rem;
    height: 0.9rem;
    fill: currentColor;
    opacity: 0.55;
}

.a11y-panel-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.85rem;
}

.a11y-panel-select {
    width: 100%;
    padding: 0.5rem;
    font-size: 0.85rem;
}

.a11y-panel-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.a11y-panel-row label {
    margin: 0;
    font-weight: 500;
    cursor: pointer;
}

.a11y-panel-row input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    cursor: pointer;
}

/* --- Minimise ------------------------------------------------------------
   Collapsed, the panel is just the universal-access button. It stays the same
   element so A11yPanel's stored position, the above-the-header z-index and the
   header clamp carry over untouched — only its size changes, which is why
   A11yPanel re-clamps after every toggle (a panel parked hard against an edge
   would otherwise hang off it once it grows back). */

.a11y-panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: none;
    color: inherit;
    cursor: pointer;
}

.a11y-panel-close svg {
    width: 0.7rem;
    height: 0.7rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    opacity: 0.65;
}

.a11y-panel-close:hover svg {
    opacity: 1;
}

/* The icon is both the reopen button and, collapsed, the panel's only drag
   target — hence touch-action here. Safe for the same reason it is on the
   handle: this is a 3rem circle, not the open panel, so a finger meaning to
   scroll the page almost never lands on it. */
.a11y-panel-open {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: inherit;
    cursor: pointer;
    touch-action: none;
}

.a11y-panel.is-dragging .a11y-panel-open {
    cursor: grabbing;
}

.a11y-panel-open svg {
    width: 1.9rem;
    height: 1.9rem;
}

.a11y-panel-open .a11y-glyph-ring {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
}

.a11y-panel-open .a11y-glyph-head {
    fill: currentColor;
}

.a11y-panel-open .a11y-glyph-body {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
}

.a11y-panel-close:focus-visible,
.a11y-panel-open:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 2px;
}

.a11y-panel.is-collapsed {
    width: 3rem;
    height: 3rem;
    max-width: none;
    padding: 0;
    border-radius: 50%;
}

.a11y-panel.is-collapsed .a11y-panel-bar,
.a11y-panel.is-collapsed .a11y-panel-body {
    display: none;
}

.a11y-panel.is-collapsed .a11y-panel-open {
    display: flex;
}


/* ── Section speech button ──────────────────────────────────────────────── */

/* Only units that have been given a button — never blanket-position every
   .section or .card, which would change stacking on ones that do not need it. */
.has-speech-btn {
    position: relative;
}

.speech-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 20;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    background: var(--card-background, #ffffff);
    color: var(--heading-text, #333333);
    opacity: 0.75;
    cursor: pointer;
}

/* Per-part buttons (today: one card) sit inside a much smaller box and next
   to real content, so they are scaled down and tucked in tighter. */
.speech-btn-part {
    top: 0.4rem;
    right: 0.4rem;
    width: 1.6rem;
    height: 1.6rem;
    opacity: 0.55;
}

.speech-btn-part svg {
    width: 0.8rem;
    height: 0.8rem;
}

/* A disclosure row's button lives inside its <summary> (the only part still
   visible when the row is closed) but is positioned against the row itself.
   The extra padding-right is what keeps it off the +/chevron marker, which
   the summary's space-between flex puts hard against its own right edge. */
.section .cms-faq-item.has-speech-btn > summary {
    padding-right: 3.25rem;
}

.cms-faq-item > summary > .speech-btn {
    top: 0.8rem;
    right: 0.75rem;
}

.speech-btn:hover,
.speech-btn:focus-visible,
.speech-btn[aria-pressed="true"] {
    opacity: 1;
}

.speech-btn:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 2px;
}

.speech-btn svg {
    display: block;
    width: 1.1rem;
    height: 1.1rem;
}

.speech-icon-stop {
    display: none;
}

.speech-btn[aria-pressed="true"] .speech-icon-play {
    display: none;
}

.speech-btn[aria-pressed="true"] .speech-icon-stop {
    display: block;
}

@media print {
    .a11y-panel,
    .speech-btn {
        display: none !important;
    }
}
