/* =============================================================================
 * consent.css — banner + modal styling for the CTD cookie consent UI.
 * Loaded by content.php after responsive.css so it wins the cascade for its
 * own scoped selectors (everything prefixed .ctd-consent-).
 *
 * Palette tracks the existing CTD chrome (orange/red on dark surfaces).
 * Keep accessibility minimums: focus rings, ≥44px tap targets, >=4.5:1 contrast.
 * ========================================================================== */

/* ---- shared button ------------------------------------------------------- */
.ctd-consent-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: #fff;
    color: #2e2e2e;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: background 120ms ease, border-color 120ms ease;
}

.ctd-consent-btn:focus {
    outline: 2px solid #f7a82d;
    outline-offset: 2px;
}

.ctd-consent-btn--primary {
    background: #BA2000;
    color: #fff;
    border-color: #BA2000;
}
.ctd-consent-btn--primary:hover { background: #8e1700; border-color: #8e1700; }

.ctd-consent-btn--ghost {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.7);
}
.ctd-consent-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: #fff;
}

/* ---- bottom-of-page banner ---------------------------------------------- */
#ctd-consent-banner {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 9000;
    background: rgba(18, 18, 18, 0.96);
    color: #fff;
    box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.4);
    border-top: 3px solid #BA2000;
    padding: 16px 24px;
    font-family: Helvetica, Arial, sans-serif;
    line-height: 1.4;
}

.ctd-consent-banner__inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.ctd-consent-banner__copy {
    flex: 1 1 320px;
    min-width: 0;
}
.ctd-consent-banner__copy h2 {
    margin: 0 0 6px 0;
    font-size: 18px;
    border-bottom: none;
    color: #fff;
}
.ctd-consent-banner__copy p {
    margin: 0;
    font-size: 14px;
    color: #e4e4e4;
}
.ctd-consent-banner__copy a {
    color: #f7a82d;
    text-decoration: underline;
}

.ctd-consent-banner__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* Banner stacks vertically below tablet width. */
@media (max-width: 767px) {
    #ctd-consent-banner { padding: 12px 16px; }
    .ctd-consent-banner__inner { gap: 12px; }
    .ctd-consent-banner__actions { width: 100%; justify-content: stretch; }
    .ctd-consent-banner__actions .ctd-consent-btn { flex: 1 1 0; min-width: 0; }
}

/* ---- preferences modal --------------------------------------------------- */
#ctd-consent-modal {
    position: fixed;
    inset: 0;
    z-index: 9500;
    display: none;
    font-family: Helvetica, Arial, sans-serif;
}
#ctd-consent-modal.is-open { display: block; }

.ctd-consent-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.ctd-consent-modal__panel {
    position: relative;
    margin: 5vh auto;
    max-width: 640px;
    width: calc(100% - 32px);
    max-height: 90vh;
    background: #fff;
    color: #2e2e2e;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ctd-consent-modal__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #BA2000;
    color: #fff;
}
.ctd-consent-modal__head h2 {
    margin: 0;
    font-size: 18px;
    color: #fff;
    border-bottom: none;
}
.ctd-consent-modal__close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    padding: 4px 8px;
    cursor: pointer;
}
.ctd-consent-modal__close:focus { outline: 2px solid #fff; outline-offset: 2px; }

.ctd-consent-modal__body {
    padding: 20px;
    overflow-y: auto;
    flex: 1 1 auto;
}
.ctd-consent-modal__intro {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #555;
}

.ctd-consent-row {
    border-top: 1px solid #eee;
    padding: 14px 0;
}
.ctd-consent-row:first-of-type { border-top: none; }

.ctd-consent-row__label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.ctd-consent-row__toggle {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    cursor: pointer;
}
.ctd-consent-row__toggle:disabled { cursor: default; }
.ctd-consent-row__toggle:focus { outline: 2px solid #f7a82d; outline-offset: 2px; }

.ctd-consent-row__name {
    font-weight: 600;
    font-size: 15px;
}
.ctd-consent-row__lock {
    font-weight: 400;
    font-size: 12px;
    color: #888;
    margin-left: 4px;
}
.ctd-consent-row__desc {
    margin: 6px 0 0 28px;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.ctd-consent-modal__foot {
    display: flex;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid #eee;
    background: #f7f7f7;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.ctd-consent-modal__foot .ctd-consent-btn--ghost {
    background: #fff;
    color: #2e2e2e;
    border-color: #ccc;
}
.ctd-consent-modal__foot .ctd-consent-btn--ghost:hover {
    background: #f0f0f0;
    border-color: #999;
}

@media (max-width: 767px) {
    .ctd-consent-modal__panel { margin: 0; max-height: 100vh; height: 100%; border-radius: 0; width: 100%; }
    .ctd-consent-modal__foot { flex-direction: column; }
    .ctd-consent-modal__foot .ctd-consent-btn { width: 100%; }
}

/* Footer link used by mega_footer.php — no special styling, picks up the
 * legacy footer link colors. Just guarantees a visible cursor + focus. */
a.ctd-consent-settings-link {
    cursor: pointer;
}
a.ctd-consent-settings-link:focus {
    outline: 2px solid #f7a82d;
    outline-offset: 2px;
}
