/* ==========================================================================
   Make My Theme — cookie-consent.css

   The consent banner (inc/cookie-consent.php) and the footer control that
   reopens it. Reads main.css's tokens and design-base.css's `.btn` family —
   it introduces no colour pairing of its own, so every surface here is one
   the contrast test already covers: Ink and Ink Muted on Paper, Paper on
   Ink, Rule as a structural divider.

   A corner card rather than a full-width bar: the banner has to be visible
   without being the page, and a 420px card leaves the hero and the
   configurator readable behind it. It is deliberately NOT a modal — no
   scrim, no focus trap, no scroll lock. Blocking the site until a choice is
   made is the pattern the ICO reads as pressure.
   ========================================================================== */

/* ── Shell ─────────────────────────────────────────────────────────────────
   Above --z-drawer so the mobile nav cannot bury it, below nothing else —
   this is the topmost surface the theme paints. */

.mmk {
    position: fixed;
    z-index: var(--z-modal);
    left: var(--sp-4);
    right: var(--sp-4);
    bottom: var(--sp-4);
    display: flex;
    justify-content: flex-start;
    pointer-events: none; /* the card takes the clicks; the gutter does not */
}

.mmk[hidden] { display: none; }

@media (min-width: 720px) {
    .mmk {
        left: var(--sp-6);
        right: auto;
        bottom: var(--sp-6);
    }
}

/* ── Panel ─────────────────────────────────────────────────────────────── */

.mmk__panel {
    pointer-events: auto;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - (var(--sp-4) * 2));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--sp-6);
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-3);
    animation: mmk-rise var(--dur-slow) var(--ease) both;
}

@keyframes mmk-rise {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: none; }
}

/* ── Copy ──────────────────────────────────────────────────────────────── */

.mmk__eyebrow {
    display: block;
    margin-bottom: var(--sp-2);
}

.mmk__title {
    font-size: var(--fs-18);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-snug);
    letter-spacing: var(--tracking-tight);
    color: var(--ink);
}

/* Focus lands here when the banner is reopened from the footer, so it needs
   a ring — design-base's :focus-visible rule skips it, being a heading with
   a programmatic tabindex rather than a control. */
.mmk__title:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: var(--r-xs);
}

.mmk__copy {
    margin-top: var(--sp-3);
    font-size: var(--fs-14);
    line-height: var(--lh-body);
    color: var(--ink-muted);
}

.mmk__policy {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.mmk__policy:hover { text-decoration-thickness: 2px; }

/* ── Category rows ─────────────────────────────────────────────────────── */

.mmk__choices {
    margin-top: var(--sp-5);
    border-top: 1px solid var(--rule);
}

.mmk__choices[hidden] { display: none; }

.mmk__choice {
    padding: var(--sp-4) 0;
    border-bottom: 1px solid var(--rule);
}

/* The whole head is the target, not the 18px box — --h-control is the floor
   for anything a finger touches. */
.mmk__choice-head {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    min-height: var(--h-btn-sm);
    cursor: pointer;
}

.mmk__checkbox {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--ink);
}

.mmk__checkbox:disabled { cursor: default; }

.mmk__checkbox:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--r-xs);
}

.mmk__choice-name {
    font-size: var(--fs-14);
    font-weight: var(--fw-semibold);
    color: var(--ink);
}

/* Sits at the end of the row so the locked category reads as a statement of
   fact rather than a control that failed to respond. */
.mmk__always {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: var(--fs-11);
    letter-spacing: var(--tracking-mono);
    text-transform: uppercase;
    color: var(--ink-muted);
}

.mmk__choice-copy {
    margin-top: var(--sp-1);
    padding-left: calc(18px + var(--sp-3));
    font-size: var(--fs-12);
    line-height: 1.45;
    color: var(--ink-muted);
}

/* ── Actions ───────────────────────────────────────────────────────────────
   Accept and Reject share a row, share a width and share a rung. The visual
   weight differs (primary vs secondary) but the effort does not — one click
   each, neither behind a disclosure. Do not move Reject into the
   preferences panel; that asymmetry is the ICO's stated enforcement case. */

.mmk__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-top: var(--sp-5);
}

.mmk__action {
    flex: 1 1 0;
    justify-content: center;
    min-width: 0;
}

.mmk__action[hidden] { display: none; }

/* Takes its own line rather than squeezing Accept and Reject into thirds —
   three buttons across a 420px card puts every label on two lines. */
.mmk__action--save { flex: 0 0 100%; }

/* ── Preferences disclosure ────────────────────────────────────────────── */

.mmk__toggle {
    display: block;
    width: 100%;
    margin-top: var(--sp-3);
    padding: var(--sp-2) 0 0;
    font-size: var(--fs-13);
    color: var(--ink-muted);
    text-align: center;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color var(--dur-fast) var(--ease);
}

.mmk__toggle:hover { color: var(--ink); }

/* ── Footer reopen control ─────────────────────────────────────────────────
   Inherits the legal row's type from footer.css; only the affordance is set
   here, so it reads as a sibling of the links beside it. */

.mmk-reopen {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
    padding: 0;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    opacity: 0.7;
    transition: opacity var(--dur-fast) var(--ease);
}

.mmk-reopen:hover { opacity: 1; }

.mmk-reopen[hidden] { display: none; }

/* ── Motion ────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .mmk__panel { animation: none; }
}
