/* xORF — Light theme, clean & modern */

/* ── Entity inline highlights ── */

.entity {
    border-radius: 0.2rem;
    padding: 0.05em 0.15em;
    font-weight: inherit;
    cursor: help;
    border-bottom: 2px solid transparent;
    transition: background-color 0.15s, border-color 0.15s;
}

.entity:hover {
    filter: brightness(0.95);
}

.entity-per {
    background: rgba(236, 72, 153, 0.08);
    border-bottom-color: rgba(236, 72, 153, 0.45);
    color: inherit;
}

.entity-loc {
    background: rgba(16, 185, 129, 0.08);
    border-bottom-color: rgba(16, 185, 129, 0.45);
    color: inherit;
}

.entity-org {
    background: rgba(59, 130, 246, 0.08);
    border-bottom-color: rgba(59, 130, 246, 0.45);
    color: inherit;
}

.entity-misc {
    background: rgba(245, 158, 11, 0.08);
    border-bottom-color: rgba(245, 158, 11, 0.45);
    color: inherit;
}

.entity-event {
    background: rgba(139, 92, 246, 0.08);
    border-bottom-color: rgba(139, 92, 246, 0.45);
    color: inherit;
}

.entity-date {
    background: rgba(20, 184, 166, 0.08);
    border-bottom-color: rgba(20, 184, 166, 0.45);
    color: inherit;
}

/* ── Entity badge pills (legend + table) ── */

.entity-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    border: 1px solid;
}

.entity-badge-per {
    background: rgba(236, 72, 153, 0.07);
    color: #be185d;
    border-color: rgba(236, 72, 153, 0.25);
}

.entity-badge-loc {
    background: rgba(16, 185, 129, 0.07);
    color: #047857;
    border-color: rgba(16, 185, 129, 0.25);
}

.entity-badge-org {
    background: rgba(59, 130, 246, 0.07);
    color: #1d4ed8;
    border-color: rgba(59, 130, 246, 0.25);
}

.entity-badge-misc {
    background: rgba(245, 158, 11, 0.07);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.25);
}

.entity-badge-event {
    background: rgba(139, 92, 246, 0.07);
    color: #6d28d9;
    border-color: rgba(139, 92, 246, 0.25);
}

.entity-badge-date {
    background: rgba(20, 184, 166, 0.07);
    color: #0f766e;
    border-color: rgba(20, 184, 166, 0.25);
}

/* ── Source (outlet) badges ── */

.source-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.source-orf {
    background: #e11d2f;   /* ORF red */
    color: #ffffff;
}

.source-krone {
    background: #003a70;   /* Krone blue */
    color: #ffffff;
}

/* ── Entity type dots (co-occurring entity chips) ── */

.entity-dot-per   { background: #ec4899; }
.entity-dot-loc   { background: #10b981; }
.entity-dot-org   { background: #3b82f6; }
.entity-dot-misc  { background: #f59e0b; }
.entity-dot-event { background: #8b5cf6; }
.entity-dot-date  { background: #14b8a6; }

/* ── Entity hover card: one shared floating element (see article.html's
   scripts block), populated + repositioned on hover/focus of any .entity
   span that carries data-img/data-desc. Kept out of normal flow (position:
   fixed via inline top/left set in JS) so it never disturbs text wrapping. ── */

.entity-hover-card {
    display: none;
    position: absolute;
    z-index: 60;
    width: 240px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.75rem;
    box-shadow: 0 16px 40px -12px rgba(15, 23, 42, 0.28), 0 2px 8px rgba(15, 23, 42, 0.06);
    padding: 0.65rem;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #334155;
}

.entity-hover-card img {
    display: block;
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    background: #f1f5f9;
}

.entity-hover-card p {
    margin: 0;
}

/* ── Clickable entity links ── */

a.entity {
    text-decoration: none;
    cursor: pointer;
}

a.entity:hover {
    opacity: 0.75;
    text-decoration: underline;
}

/* ── Article text ── */

.article-text p {
    margin-bottom: 1.25em;
    line-height: 1.85;
}

.article-text mark {
    background: none;
}

/* ── Line clamp utility ── */

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Refresh button: spinner + label swap (driven by htmx's hx-indicator,
   which toggles the .htmx-request class on the indicator's target) ── */

#refresh-spinner.htmx-request {
    animation: xorf-spin 0.7s linear infinite;
}

@keyframes xorf-spin {
    to { transform: rotate(360deg); }
}

#refresh-label .refresh-label-loading {
    display: none;
}

#refresh-label.htmx-request .refresh-label-idle {
    display: none;
}

#refresh-label.htmx-request .refresh-label-loading {
    display: inline;
}

/* ── NEU badge: articles that arrived since the viewer's last refresh ── */

.badge-new {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.45rem;
    border-radius: 9999px;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    background: rgba(45, 90, 133, 0.12);
    color: #254a6c;
}

/* ── Category-list disclosure rows: smooth expand/collapse.
   Native <details> hides non-summary content via `display:none` with no
   transition hook, so the panel opts out of that default (kept always in
   the box model) and animates its own max-height/opacity instead. ── */

.disclosure-panel {
    display: block;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease;
}

details[open] > .disclosure-panel {
    max-height: 600px;
    opacity: 1;
}

/* ── 404 page ── */

.not-found-icon {
    width: 4rem;
    height: 4rem;
    background: #f1f5f9;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1rem;
}