/**
 * EW Footnotes — Cited Authors panel + inline citation tooltip.
 * Brand tokens match ew-commentary-crosslinks (navy #014161, link #029CE9,
 * Lato headings / Karla body) so the panel reads as one continuous footnote
 * block below Related Commentary / Referenced By.
 */

.ew-foot {
    --ewf-navy: #014161;
    --ewf-link: #029CE9;
    display: block;
    /* Continues the crosslinks block below it — light separation, no heavy rule. */
    margin: 1.6em 0 0.5em;
    padding-top: 1.2em;
    border-top: 1px solid #e6e9ec;
}

.ew-foot-sec { margin: 0; }

.ew-foot-title {
    font-family: "Lato", "Helvetica Neue", Arial, sans-serif;
    font-weight: 900;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    color: var(--ewf-navy);
    margin: 0 0 0.15em;
    text-transform: uppercase;
}

.ew-foot-count {
    display: inline-block;
    font-size: 0.72em;
    font-weight: 700;
    color: #fff;
    background: var(--ewf-link);
    border-radius: 10px;
    padding: 0.05em 0.55em;
    vertical-align: middle;
    margin-left: 0.35em;
}

.ew-foot-sub {
    font-family: "Karla", "Helvetica Neue", Arial, sans-serif;
    font-size: 0.84rem;
    color: #6a747a;
    margin: 0 0 0.85em;
}

.ew-foot-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
}

.ew-foot-chip {
    font-family: "Karla", "Helvetica Neue", Arial, sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--ewf-navy) !important;
    text-decoration: none !important;
    background: #fff;
    border: 1px solid #d8dde1;
    border-radius: 18px;
    padding: 0.34em 0.85em;
    transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.ew-foot-chip:hover,
.ew-foot-chip:focus {
    background: var(--ewf-link);
    border-color: var(--ewf-link);
    color: #fff !important;
}

/* ---- inline (Surname) citation reference ---- */
.ew-cite-ref {
    cursor: help;
    border-bottom: 1px dotted #9fb3c2;
}
.ew-cite-ref:hover {
    border-bottom-color: #029CE9;
}

/* ---- hover tooltip ---- */
.ew-cite-tip {
    position: absolute;
    z-index: 99999;
    max-width: 360px;
    background: #fff;
    border: 1px solid #d8dde1;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(1, 65, 97, 0.18);
    padding: 0.7em 0.85em;
    font-family: "Karla", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.4;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.12s ease;
    pointer-events: none;
}
.ew-cite-tip.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.ew-cite-tip-name {
    font-family: "Lato", "Helvetica Neue", Arial, sans-serif;
    font-weight: 900;
    color: #014161;
    font-size: 0.95rem;
    margin-bottom: 0.25em;
}
.ew-cite-tip-work {
    font-size: 0.86rem;
    color: #333;
    margin-bottom: 0.3em;
}
.ew-cite-tip-link {
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 700;
    color: #029CE9 !important;
    text-decoration: none !important;
    margin-top: 0.15em;
}
.ew-cite-tip-link:hover { text-decoration: underline !important; }

/* ---- Phase 3: bibliography "Cited in" chips + index page ---- */
.ew-foot-cited {
    margin: 0.2em 0 1.1em 0;
    font-family: "Karla", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.9;
}
.ew-foot-cited-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #6a747a;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-right: 0.4em;
}
.ew-foot-cited-chips { display: inline; }

.ew-foot-chip-sm {
    display: inline-block;
    font-size: 0.82rem;
    padding: 0.18em 0.6em;
    margin: 0 0.25em 0.25em 0;
}

/* CSS-only "+N more" — every chip is in the HTML for crawlers. */
.ew-foot-more-cb { position: absolute; opacity: 0; pointer-events: none; }
.ew-foot-more-chips { display: none; }
.ew-foot-more-cb:checked ~ .ew-foot-more-chips { display: inline; }
.ew-foot-more {
    display: inline-block;
    margin-left: 0.3em;
    font-size: 0.8rem;
    font-weight: 700;
    color: #029CE9;
    cursor: pointer;
    user-select: none;
}
.ew-foot-more:hover { text-decoration: underline; }
.ew-foot-more .ew-foot-more-hide { display: none; }
.ew-foot-more-cb:checked ~ .ew-foot-more .ew-foot-more-show { display: none; }
.ew-foot-more-cb:checked ~ .ew-foot-more .ew-foot-more-hide { display: inline; }

/* Brief highlight when you deep-link to an author's entry. */
.ew-bib-entry:target {
    background: #fff6d6;
    box-shadow: 0 0 0 6px #fff6d6;
    border-radius: 2px;
    animation: ew-foot-flash 2.4s ease-out 1;
}
@keyframes ew-foot-flash {
    0%, 55% { background: #fff6d6; box-shadow: 0 0 0 6px #fff6d6; }
    100% { background: transparent; box-shadow: 0 0 0 6px transparent; }
}

/* By-author index page ([ew_cited_authors_index]) */
.ew-foot-index { --ewf-navy: #014161; }
.ew-foot-author { margin: 0 0 1.6em; padding-bottom: 1.1em; border-bottom: 1px solid #e6e9ec; }
.ew-foot-author-name {
    font-family: "Lato", "Helvetica Neue", Arial, sans-serif;
    font-weight: 900;
    font-size: 1.1rem;
    color: var(--ewf-navy);
    margin: 0 0 0.5em;
}
.ew-foot-author-name a { color: var(--ewf-navy) !important; text-decoration: none !important; }
.ew-foot-author-name a:hover { text-decoration: underline !important; }
.ew-foot-index .ew-foot-cited { margin-bottom: 0.5em; }
.ew-foot-index .ew-foot-cited-label {
    text-transform: none;
    letter-spacing: 0;
    color: var(--ewf-navy);
    font-size: 0.86rem;
}

@media (max-width: 600px) {
    .ew-foot-chip { font-size: 0.88rem; padding: 0.3em 0.75em; }
    .ew-cite-tip { max-width: 86vw; }
}
