/* dfb-laesning.css */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;1,400&family=Source+Sans+3:wght@400;600&display=swap');

/* ── Wrap ────────────────────────────────────────────────── */
.dfb-laesning-wrap {
    max-width: 720px;
    margin: 0 auto;
    font-family: 'Source Sans 3', sans-serif;
    color: #1a1a1a;
}

/* ── Navigation ──────────────────────────────────────────── */
.dfb-nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 0 1.5rem;
    border-bottom: 2px solid #1a1a1a;
    margin-bottom: 2rem;
}

.dfb-nav-selects {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.dfb-select-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.dfb-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #888;
}

.dfb-select {
    padding: 0.5rem 0.75rem;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.95rem;
    color: #1a1a1a;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
    min-width: 80px;
}

.dfb-select:focus {
    outline: 2px solid #8b1a1a;
    outline-offset: 2px;
}

#dfb-bog-select { min-width: 220px; }

.dfb-btn-vis {
    padding: 0.5rem 1.5rem;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    background: #1a1a1a;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.15s;
    align-self: flex-end;
}

.dfb-btn-vis:hover { background: #333; }

/* ── Pager ───────────────────────────────────────────────── */
.dfb-nav-pager {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dfb-pager-btn {
    padding: 0.35rem 0.85rem;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #8b1a1a;
    background: #fff;
    border: 1px solid #8b1a1a;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.dfb-pager-btn:hover:not(:disabled) {
    background: #8b1a1a;
    color: #fff;
}

.dfb-pager-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.dfb-pager-label {
    font-family: 'Lora', Georgia, serif;
    font-size: 0.95rem;
    font-style: italic;
    color: #555;
}

/* ── Kapitel-titel ───────────────────────────────────────── */
.dfb-kapitel-titel {
    font-family: 'Lora', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1.5rem;
    color: #1a1a1a;
    letter-spacing: -0.01em;
}

/* ── Vers-liste ──────────────────────────────────────────── */
.dfb-vers-liste {
    display: flex;
    flex-direction: column;
}

/* ── Vers-item ───────────────────────────────────────────── */
.dfb-vers-item {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 0.5rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid #eee;
    position: relative;
    transition: background 0.15s;
}

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

.dfb-vers-item:hover { background: #fafafa; }

/* Vers med note: subtil indikator i venstre kant */
.dfb-vers--har-note {
    border-left: 3px solid #8b1a1a;
    padding-left: 0.75rem;
    margin-left: -0.75rem;
}

/* ── Verstekst ───────────────────────────────────────────── */
.dfb-vers-tekst-wrap {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    gap: 0.6rem;
    align-items: baseline;
}

.dfb-vers-num {
    flex: 0 0 auto;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #8b1a1a;
    min-width: 1.5rem;
    padding-top: 0.15rem;
}

.dfb-vers-tekst {
    font-family: 'Lora', Georgia, serif;
    font-size: 1rem;
    line-height: 1.7;
    color: #1a1a1a;
}

/* ── + knap ──────────────────────────────────────────────── */
.dfb-note-toggle {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    margin-top: 0.3rem;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid #ddd;
    border-radius: 50%;
    color: #aaa;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.dfb-note-toggle:hover,
.dfb-vers--open .dfb-note-toggle {
    border-color: #8b1a1a;
    color: #8b1a1a;
    background: #fff5f5;
}

.dfb-vers--har-note .dfb-note-toggle {
    border-color: #8b1a1a;
    color: #8b1a1a;
}

.dfb-note-toggle[data-tooltip] {
    position: relative;
}
.dfb-note-toggle[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: #1a1a1a;
    color: #fff;
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: 0.8rem;
    line-height: 1.55;
    padding: 0.45rem 0.65rem;
    border-radius: 3px;
    max-width: 260px;
    width: max-content;
    white-space: normal;
    word-break: break-word;
    box-shadow: 0 2px 10px rgba(0,0,0,0.22);
    pointer-events: none;
    z-index: 50;
}
.dfb-vers--open .dfb-note-toggle[data-tooltip]:hover::after {
    display: none;
}

/* ── Note-panel ──────────────────────────────────────────── */
.dfb-note-panel {
    grid-column: 1 / -1;
    grid-row: 2;
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem 0 0.5rem 2.1rem;
}

.dfb-vers--open .dfb-note-panel {
    display: flex;
}

.dfb-note-textarea {
    width: 100%;
    padding: 0.5rem 0.65rem;
    font-family: 'Lora', Georgia, serif;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #1a1a1a;
    background: #fffdf9;
    border: 1px solid #ddd;
    border-radius: 3px;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.dfb-note-textarea:focus {
    outline: none;
    border-color: #8b1a1a;
    background: #fff;
}

.dfb-note-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.dfb-note-gem {
    padding: 0.3rem 0.9rem;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    background: #8b1a1a;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.15s;
}

.dfb-note-gem:hover { background: #6e1414; }

.dfb-note-slet {
    padding: 0.3rem 0.9rem;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #888;
    background: none;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.dfb-note-slet:hover {
    color: #8b1a1a;
    border-color: #8b1a1a;
}

.dfb-note-status {
    font-size: 0.8rem;
    color: #4a7c4a;
    margin-left: auto;
}

/* ── Loading / fejl ──────────────────────────────────────── */
.dfb-loading {
    display: flex;
    gap: 0.4rem;
    padding: 2rem 0;
    justify-content: center;
}

.dfb-loading span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #8b1a1a;
    animation: dfb-bounce 1s infinite ease-in-out;
}
.dfb-loading span:nth-child(2) { animation-delay: 0.15s; }
.dfb-loading span:nth-child(3) { animation-delay: 0.3s; }

@keyframes dfb-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40%            { transform: scale(1);   opacity: 1;   }
}

.dfb-intro, .dfb-error {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    color: #888;
    padding: 1rem 0;
}

.dfb-error { color: #8b1a1a; }

/* ── Tag-widget (i note-panel) ───────────────────────────── */
.dfb-tag-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0 0.2rem 2.1rem;
    min-height: 2rem;
}

.dfb-tag-list {
    display: contents;
}

.dfb-tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    background: #f5eaea;
    border: 1px solid #d4a0a0;
    color: #8b1a1a;
    border-radius: 20px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.4;
}

.dfb-tag-rm {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: #b06060;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
}
.dfb-tag-rm:hover { color: #8b1a1a; }

.dfb-tag-input {
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.8rem;
    color: #555;
    min-width: 90px;
    padding: 0.1rem 0;
}
.dfb-tag-input::placeholder { color: #bbb; }

.dfb-tag-locked {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.78rem;
    color: #bbb;
    font-style: italic;
    padding: 0.1rem 0;
}


    font-size: 0.75rem;
    color: #4a7c4a;
    margin-left: 0.25rem;
}

/* Vers-indikator: har tags */
.dfb-vers--har-tags .dfb-note-toggle {
    border-color: #8b1a1a;
}

/* ── Tag-badges i modal ──────────────────────────────────── */
.dfb-modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.3rem;
}

.dfb-modal-tag-badge {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    background: #f5eaea;
    border: 1px solid #d4a0a0;
    color: #8b1a1a;
    border-radius: 20px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    line-height: 1.5;
}


@media (max-width: 500px) {
    #dfb-bog-select { min-width: 160px; }

    .dfb-vers-item {
        grid-template-columns: 1fr 28px;
    }
}

/* ── Mine Tags Widget ────────────────────────────────────────── */
.dfb-mine-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.dfb-mine-tag-pill {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: #f5eaea;
    border: 1px solid #d4a0a0;
    color: #8b1a1a;
    border-radius: 20px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.dfb-mine-tag-pill:hover,
.dfb-mine-tag-pill--active {
    background: #8b1a1a;
    color: #fff;
    border-color: #8b1a1a;
}

.dfb-mine-tags-reset {
    display: block;
    margin-top: 0.75rem;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.75rem;
    color: #888;
    text-decoration: none;
    transition: color 0.15s;
}

.dfb-mine-tags-reset:hover { color: #8b1a1a; }

/* ── Tag-filterbanner ────────────────────────────────────────── */
.dfb-tag-filter-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 0.9rem;
    background: #f5eaea;
    border: 1px solid #d4a0a0;
    border-radius: 3px;
    margin-bottom: 1.25rem;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.85rem;
    color: #4a1a1a;
    flex-wrap: wrap;
}

.dfb-tag-filter-banner strong { color: #8b1a1a; }

.dfb-tag-filter-reset {
    font-size: 0.78rem;
    font-weight: 600;
    color: #8b1a1a;
    text-decoration: none;
    white-space: nowrap;
}

.dfb-tag-filter-reset:hover { opacity: 0.7; }

/* ── Vers-dimming ved tag-filter ─────────────────────────────── */
.dfb-vers--dimmed {
    opacity: 0.25;
    transition: opacity 0.2s;
}

.dfb-vers--tagged {
    background: #fffdf9;
}

/* ── Tag-oversigt ────────────────────────────────────────────── */
.dfb-tag-oversigt-header {
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #1a1a1a;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.dfb-tag-oversigt-header .dfb-kapitel-titel {
    margin: 0;
    flex: 1;
}

.dfb-tag-oversigt-antal {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.82rem;
    color: #8a7d72;
    margin: 0;
}

.dfb-tag-oversigt-liste {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.dfb-tag-oversigt-item {
    padding: 1.1rem 0;
    border-bottom: 1px solid #eee;
}

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

.dfb-tag-oversigt-ref {
    display: inline-block;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8b1a1a;
    text-decoration: none;
    margin-bottom: 0.4rem;
    transition: opacity 0.15s;
}

.dfb-tag-oversigt-ref:hover { opacity: 0.7; }

.dfb-tag-oversigt-tekst {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: 1rem;
    line-height: 1.7;
    color: #1a1a1a;
    margin: 0 0 0.5rem;
}

.dfb-tag-oversigt-note {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #4a3f36;
    background: #fffdf9;
    border-left: 3px solid #8b1a1a;
    padding: 0.35rem 0.65rem;
    border-radius: 0 2px 2px 0;
    margin-top: 0.4rem;
}
