/* Citation UI owns its typography and controls; the site theme owns placement. */
.caa-cite-trigger.caa-cite-trigger {
    display: inline;
    width: auto;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    appearance: none;
    background: transparent;
    background-image: none;
    color: inherit;
    box-shadow: none;
    font: inherit;
    letter-spacing: inherit;
    line-height: inherit;
    text-align: inherit;
    text-transform: none;
    cursor: pointer;
}

.caa-cite-trigger.caa-cite-trigger:hover {
    text-decoration: underline;
}

.caa-cite-trigger.caa-cite-trigger:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

/* Match the Archive theme's footer-navigation links while retaining a button. */
.footer-navigation .caa-cite-trigger.caa-cite-trigger {
    color: #f2ede4;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-decoration: none;
    text-transform: uppercase;
}

.footer-navigation .caa-cite-trigger.caa-cite-trigger:hover {
    color: #d7aa91;
    text-decoration: none;
}

.footer-navigation .caa-cite-trigger.caa-cite-trigger:focus-visible {
    outline: 3px solid var(--caa-focus, currentColor);
    outline-offset: 3px;
}

/* Keep the existing information and navigation markup. On wide screens the
   title, citation and menu share the first grid row. Only the title sets the
   left column width, so the citation is centred in the gap before the menu. */
.caa-citations-footer-row {
    display: block;
    width: 100%;
    margin-top: 1.5rem;
    text-align: center;
}

.site-footer__inner:has(> .footer-navigation > .caa-citations-footer-row:not([hidden])) {
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    row-gap: 0;
}

.site-footer__inner:has(> .footer-navigation > .caa-citations-footer-row:not([hidden])) > div:first-child,
.site-footer__inner > .footer-navigation:has(> .caa-citations-footer-row:not([hidden])) {
    display: contents;
}

.site-footer__inner:has(> .footer-navigation > .caa-citations-footer-row:not([hidden])) .site-footer__title {
    grid-column: 1;
    grid-row: 1;
}

.site-footer__inner:has(> .footer-navigation > .caa-citations-footer-row:not([hidden])) .site-footer__description {
    grid-column: 1 / -1;
    grid-row: 2;
}

.site-footer__inner:has(> .footer-navigation > .caa-citations-footer-row:not([hidden])) .site-footer__meta {
    grid-column: 1 / -1;
    grid-row: 3;
}

.site-footer__inner > .footer-navigation:has(> .caa-citations-footer-row:not([hidden])) > ul {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
}

.site-footer__inner > .footer-navigation > .caa-citations-footer-row {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    margin-top: 0;
    min-width: 0;
}

@media (max-width: 64rem) {
    .site-footer__inner:has(> .footer-navigation > .caa-citations-footer-row:not([hidden])) {
        grid-template-columns: minmax(0, 1fr);
    }

    .site-footer__inner > .footer-navigation:has(> .caa-citations-footer-row:not([hidden])) > ul {
        grid-column: 1;
        grid-row: 5;
        justify-content: center;
        margin-top: 1.5rem;
    }

    .site-footer__inner > .footer-navigation > .caa-citations-footer-row {
        grid-column: 1;
        grid-row: 4;
        margin-top: 1.5rem;
    }
}

.caa-cite-trigger[hidden],
[data-caa-cite-container][hidden],
#caa-citations-root[hidden],
#caa-citations-root [hidden] {
    display: none !important;
}

#caa-citations-root {
    position: relative;
    z-index: 2147483000;
    color: #202124;
    font: 13px/1.55 Arial, Helvetica, sans-serif;
    letter-spacing: normal;
    text-align: left;
    text-transform: none;
    direction: ltr;
}

#caa-citations-root *,
#caa-citations-root *::before,
#caa-citations-root *::after {
    box-sizing: border-box;
}

#caa-citations-root .caa-citations-layer {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 24px;
    border: 0;
    background: rgb(255 255 255 / 67%);
    overscroll-behavior: contain;
}

#caa-citations-root .caa-citations-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 700px;
    max-width: 100%;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid #c7c7c7;
    border-radius: 0;
    background: #fff;
    color: #202124;
    box-shadow: 0 4px 18px rgb(0 0 0 / 22%);
    font: inherit;
    text-align: left;
    outline: 0;
}

#caa-citations-root .caa-citations-header {
    position: relative;
    display: flex;
    flex: 0 0 52px;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    width: 100%;
    margin: 0;
    padding: 8px 58px;
    border: 0;
    border-bottom: 1px solid #e3e3e3;
    background: #f7f7f7;
    box-shadow: none;
}

#caa-citations-root .caa-citations-title {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    color: #222;
    font: 400 19px/1.3 Arial, Helvetica, sans-serif;
    letter-spacing: normal;
    text-align: center;
    text-transform: none;
}

#caa-citations-root button.caa-citations-close {
    position: absolute;
    inset: 4px auto auto 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    background-image: none;
    color: #555;
    box-shadow: none;
    appearance: none;
    font: 400 29px/1 Arial, Helvetica, sans-serif;
    letter-spacing: normal;
    text-indent: 0;
    text-transform: none;
    cursor: pointer;
    transform: none;
    transition: none;
}

#caa-citations-root button.caa-citations-close::before,
#caa-citations-root button.caa-citations-close::after {
    content: none;
}

#caa-citations-root button.caa-citations-close:hover {
    background: #e9e9e9;
    color: #111;
}

#caa-citations-root .caa-citations-close-mark {
    display: block;
    margin: 0;
    padding: 0;
    font: inherit;
}

#caa-citations-root .caa-citations-content {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 19px 24px 21px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

#caa-citations-root .caa-citations-list {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
}

#caa-citations-root .caa-citations-row {
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    margin: 0;
    padding: 0 0 13px;
    border: 0;
    background: transparent;
    font: inherit;
}

#caa-citations-root .caa-citations-row:last-child {
    padding-bottom: 0;
}

#caa-citations-root .caa-citations-label {
    display: block;
    margin: 0;
    padding: 2px 0;
    color: #707070;
    font: 400 13px/1.55 Arial, Helvetica, sans-serif;
    letter-spacing: normal;
    text-transform: none;
}

#caa-citations-root .caa-citations-reference {
    display: block;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 2px 0;
    border: 0;
    background: transparent;
    color: #202124;
    font: 400 13px/1.55 Arial, Helvetica, sans-serif;
    letter-spacing: normal;
    text-align: left;
    text-indent: 0;
    text-transform: none;
    overflow-wrap: anywhere;
    word-break: normal;
    white-space: normal;
    cursor: text;
    -webkit-user-select: text;
    user-select: text;
}

#caa-citations-root .caa-citations-reference div,
#caa-citations-root .caa-citations-reference span {
    display: inline;
    position: static;
    float: none;
    margin: 0;
    padding: 0;
    border: 0;
    font-size: inherit;
    line-height: inherit;
    letter-spacing: normal;
    text-indent: 0;
    text-transform: none;
}

#caa-citations-root .caa-citations-reference i,
#caa-citations-root .caa-citations-reference em {
    font-style: italic;
}

#caa-citations-root .caa-citations-reference b,
#caa-citations-root .caa-citations-reference strong {
    font-weight: 700;
}

#caa-citations-root .caa-citations-reference::selection,
#caa-citations-root .caa-citations-reference *::selection {
    background: #c1d9ff;
    color: #111;
}

#caa-citations-root .caa-citations-reference:focus-visible,
#caa-citations-root button.caa-citations-close:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 3px;
}

#caa-citations-root .caa-citations-error {
    margin: 0;
    padding: 0;
    font: inherit;
}

#caa-citations-root .caa-citations-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 540px) {
    #caa-citations-root .caa-citations-layer {
        padding: 12px 8px;
    }

    #caa-citations-root .caa-citations-dialog {
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
    }

    #caa-citations-root .caa-citations-content {
        padding: 16px 14px 18px;
    }

    #caa-citations-root .caa-citations-row {
        grid-template-columns: 55px minmax(0, 1fr);
        gap: 8px;
        padding-bottom: 14px;
    }
}

@media (forced-colors: active) {
    #caa-citations-root .caa-citations-layer {
        background: Canvas;
    }

    #caa-citations-root .caa-citations-dialog,
    #caa-citations-root .caa-citations-header {
        border-color: CanvasText;
    }
}
