/* DFB Krydsreferencer - Widget v1.4 */
.dfb-krydsref-container {
    font-size: 0.95em;
}

.dfb-krydsref-loading {
    color: #888;
    font-style: italic;
    padding: 6px 0;
}

.dfb-krydsref-tom {
    color: #999;
    font-style: italic;
    font-size: 0.9em;
    padding: 4px 0;
}

.dfb-krydsref-sektion {
    margin-bottom: 14px;
}

.dfb-krydsref-sektion:last-child {
    margin-bottom: 0;
}

.dfb-sek-titel {
    font-size: 0.78em !important;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #2271b1;
    margin: 0 0 6px 0 !important;
    padding-bottom: 3px;
    border-bottom: 1px solid #2271b1;
}

.dfb-krydsref-liste {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.dfb-krydsref-item {
    padding: 6px 0;
    border-bottom: 1px dotted #ddd;
    list-style: none;
}

.dfb-krydsref-item:last-child {
    border-bottom: none;
}

.dfb-krydsref-titel-line {
    margin-bottom: 2px;
}

.dfb-krydsref-link {
    font-weight: 600;
    color: #2271b1;
    text-decoration: none;
}

.dfb-krydsref-link:hover {
    text-decoration: underline;
}

.dfb-krydsref-tekst {
    font-weight: 600;
    color: #1a1a1a;
}

.dfb-krydsref-details {
    font-size: 0.88em;
    color: #555;
}

.dfb-rel {
    font-size: 0.85em;
    font-style: italic;
    margin-left: 2px;
    font-weight: normal;
}

.dfb-rel-citat    { color: #d63638; }
.dfb-rel-allusion { color: #b8860b; }
.dfb-rel-parallel { color: #00a32a; }
.dfb-rel-baggrund { color: #888; }

/* Markering af vers når man klikker på krydsreference */
.dfb-vers-item.dfb-krydsref-highlight {
    background-color: #fff3cd !important;
    box-shadow: 0 0 0 2px #f59e0b !important;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    animation: dfbKrydsrefPulse 1.2s ease-in-out;
    border-radius: 6px;
    padding: 6px 10px;
    margin: 4px 0;
}

@keyframes dfbKrydsrefPulse {
    0%   { background-color: #fff3cd; box-shadow: 0 0 0 2px #f59e0b; }
    50%  { background-color: #ffd966; box-shadow: 0 0 0 4px #d97706; }
    100% { background-color: #fff3cd; box-shadow: 0 0 0 2px #f59e0b; }
}

/* Lokal-link styling - en tand stærkere visuel cue */
.dfb-krydsref-lokal {
    cursor: pointer;
}

.dfb-krydsref-lokal::after {
    content: ' ↗';
    font-size: 0.75em;
    opacity: 0.6;
}

/* ─── Vers-grupper (v1.4) ───────────────────────────────────── */

/* Wrapper for hver vers-gruppe */
.dfb-krydsref-gruppe {
    padding: 0;
    border-bottom: 1px solid #e5e5e5;
    list-style: none;
}

.dfb-krydsref-gruppe:last-child {
    border-bottom: none;
}

/* Header som knap, fylder hele bredden */
.dfb-krydsref-gruppe-header {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 6px 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    font: inherit;
    text-align: left;
    color: inherit;
    transition: background-color 0.15s ease;
}

.dfb-krydsref-gruppe-header:hover {
    background-color: #f4f6f9;
}

.dfb-krydsref-gruppe-header:focus {
    outline: 2px solid #2271b1;
    outline-offset: -2px;
}

/* +/− ikonet */
.dfb-krydsref-toggle {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 18px;
    height: 18px;
    font-size: 1.05em;
    line-height: 1;
    font-weight: 700;
    color: #2271b1;
    background-color: #eef3f8;
    border-radius: 3px;
    flex-shrink: 0;
    user-select: none;
}

.dfb-krydsref-gruppe.is-open .dfb-krydsref-toggle {
    color: #fff;
    background-color: #2271b1;
}

/* Vers-label, fx "v1" eller "v3-4" */
.dfb-krydsref-gruppe-label {
    font-weight: 600;
    color: #1a1a1a;
    flex-grow: 1;
}

/* Antal-badge */
.dfb-krydsref-gruppe-antal {
    font-size: 0.82em;
    color: #666;
    background-color: #eef3f8;
    padding: 1px 7px;
    border-radius: 9px;
    font-weight: 500;
    min-width: 22px;
    text-align: center;
}

.dfb-krydsref-gruppe.is-open .dfb-krydsref-gruppe-antal {
    color: #2271b1;
    background-color: #dbe7f2;
}

/* Indhold (skjult som default) */
.dfb-krydsref-gruppe-indhold {
    list-style: none !important;
    margin: 0 0 6px 0 !important;
    padding: 4px 0 4px 26px !important;
    border-left: 2px solid #dbe7f2;
    margin-left: 9px !important;
}

.dfb-krydsref-gruppe-indhold .dfb-krydsref-item {
    padding: 3px 0;
    border-bottom: 1px dotted #eee;
}

.dfb-krydsref-gruppe-indhold .dfb-krydsref-item:last-child {
    border-bottom: none;
}

/* "Fold alle ud/ind"-kontrol */
.dfb-krydsref-foldalle {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.dfb-krydsref-foldknap {
    background: transparent;
    border: 1px solid #ccd5dc;
    border-radius: 3px;
    padding: 2px 8px;
    font-size: 0.78em;
    color: #555;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.dfb-krydsref-foldknap:hover {
    background-color: #eef3f8;
    border-color: #2271b1;
    color: #2271b1;
}

/* ─── GT-citater (v1.5) ─────────────────────────────────────── */

.dfb-krydsref-container {
    --dfb-kr-oxblod: var(--bb-oxblod, #8b1a1a);
    --dfb-kr-oxblod-bg: rgba(139, 26, 26, 0.08);
    --dfb-kr-oxblod-kant: rgba(139, 26, 26, 0.25);
}

/* Etiketter: rolige smaa maerker i stedet for kursiv tekst i parentes */
.dfb-rel {
    display: inline-block;
    font-size: 0.72em;
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.6;
    padding: 0 6px;
    border-radius: 3px;
    vertical-align: 1px;
    margin-left: 0;
    background: #f1ece4;
    color: #6b5d4f;
}

.dfb-rel-citat {
    color: var(--dfb-kr-oxblod);
    background: var(--dfb-kr-oxblod-bg);
    box-shadow: inset 0 0 0 1px var(--dfb-kr-oxblod-kant);
}

.dfb-krydsref-item.is-citat .dfb-krydsref-link,
.dfb-krydsref-item.is-citat .dfb-krydsref-tekst {
    color: var(--dfb-kr-oxblod);
}

/* "1 citat" i gruppens header */
.dfb-krydsref-gruppe-citat {
    font-size: 0.78em;
    font-weight: 600;
    color: var(--dfb-kr-oxblod);
    white-space: nowrap;
}

/* Skillelinje mellem citater og oevrige referencer */
.dfb-krydsref-gruppe-indhold .dfb-krydsref-skille {
    list-style: none;
    height: 0;
    padding: 0 !important;
    margin: 4px 0 !important;
    border: 0 !important;
    border-top: 1px dashed #d9cfc4 !important;
}

/* Filter: Alle / Kun citater */
.dfb-krydsref-citatfilter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.dfb-krydsref-filterknap {
    background: transparent;
    border: 1px solid #d9cfc4;
    border-radius: 3px;
    padding: 2px 9px;
    font-size: 0.8em;
    color: #555;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dfb-krydsref-filterknap:hover {
    border-color: var(--dfb-kr-oxblod);
    color: var(--dfb-kr-oxblod);
}

.dfb-krydsref-filterknap[aria-pressed="true"] {
    color: #fff;
    background: var(--dfb-kr-oxblod);
    border-color: var(--dfb-kr-oxblod);
}

/* Kun-citater-tilstand: skjul alt andet og fold citat-grupperne ud */
.dfb-kr-kun-citat .dfb-krydsref-gruppe:not(.has-citat),
.dfb-kr-kun-citat .dfb-krydsref-gruppe-indhold .dfb-krydsref-item:not(.is-citat),
.dfb-kr-kun-citat .dfb-krydsref-skille,
.dfb-kr-kun-citat .dfb-krydsref-foldalle,
.dfb-kr-kun-citat .dfb-krydsref-gruppe-antal,
.dfb-kr-kun-citat .dfb-sek-ressourcer {
    display: none !important;
}

.dfb-kr-kun-citat .dfb-krydsref-gruppe.has-citat .dfb-krydsref-gruppe-indhold {
    display: block !important;
}

.dfb-kr-kun-citat .dfb-krydsref-toggle {
    visibility: hidden;
}

/* v1.6: »Tilbage til …«-knap under verset, man sprang til */
.dfb-kr-tilbage-wrap { margin: 2px 0 12px; }
.dfb-kr-tilbage {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 12px;
    border: 1px solid var(--bb-oxblod, #8b1a1a); border-radius: 999px;
    background: var(--bb-hvid, #fff); color: var(--bb-oxblod, #8b1a1a);
    font-family: var(--bb-sans, system-ui, sans-serif); font-size: .8rem; font-weight: 600; line-height: 1.4;
    cursor: pointer; transition: background .15s, color .15s;
}
.dfb-kr-tilbage:hover, .dfb-kr-tilbage:focus-visible { background: var(--bb-oxblod, #8b1a1a); color: #fff; outline: none; }
.dfb-kr-tilbage span { font-size: 1rem; line-height: 1; }
/* v1.6.1: I højre margen ud for verset, når der er plads (sættes af widget.js) */
.dfb-kr-tilbage-wrap.i-margen { position: absolute; margin: 0; white-space: nowrap; z-index: 2; }
.dfb-kr-tilbage-wrap.i-margen .dfb-kr-tilbage { padding: 2px 10px; font-size: .75rem; opacity: .85; }
.dfb-kr-tilbage-wrap.i-margen .dfb-kr-tilbage:hover, .dfb-kr-tilbage-wrap.i-margen .dfb-kr-tilbage:focus-visible { opacity: 1; }
