/* =========================================================================
   ARTICLE ENTITIES — "Nevnt i saken"
   Rendered by class-article-entities.php, injected above the Google News CTA.

   All colours come from the theme's tokens, which the theme itself flips
   under [data-theme="dark"] (see 433-tema/style.css). Do not add
   body.dark-mode rules — that selector never matches in this theme.
   ========================================================================= */

.f433-entities {
    box-sizing: border-box;
    margin: 2.5rem 0 0;
    padding-top: 22px;
    border-top: 1px solid var(--border-light, #e9e9e9);
}

.f433-entities *,
.f433-entities *::before,
.f433-entities *::after {
    box-sizing: border-box;
}

.f433-entities__title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin: 0;
    color: var(--text-main, #0a0a0a);
}

.f433-entities__hint {
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--text-muted, #6c757d);
    margin: 3px 0 0;
}

.f433-entities__list {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
}

/* --- Row --- */

.f433-entity {
    display: grid;
    grid-template-columns: 38px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-top: 1px solid var(--border-light, #e9e9e9);
}

.f433-entity:first-child {
    border-top: none;
}

.f433-entity__avatar {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    overflow: hidden;
    background-color: var(--bg-surface, #f8f9fa);
    display: flex;
    align-items: center;
    justify-content: center;
}

.f433-entity__avatar--circle {
    border-radius: 50%;
}

.f433-entity__avatar--square {
    border-radius: 7px;
}

.f433-entity__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.f433-entity__monogram {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-muted, #6c757d);
}

.f433-entity__text {
    min-width: 0;
}

.f433-entity__name {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-main, #0a0a0a);
    text-decoration: none;
    overflow-wrap: break-word;
}

a.f433-entity__name:hover {
    text-decoration: underline;
}

.f433-entity__kind {
    display: block;
    font-size: 0.74rem;
    line-height: 1.3;
    letter-spacing: 0.02em;
    color: var(--text-muted, #6c757d);
    margin-top: 1px;
}

/* --- Follow button ---
   There is no base .follow-button style in this codebase; every call site
   styles its own modifier class. This is the one for the article section. */

.follow-button.entity-follow-btn {
    box-sizing: border-box;
    position: relative; /* anchors the visually-hidden label on mobile */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 13px 6px 10px;
    border: 1px solid var(--border-medium, #ddd);
    border-radius: 999px;
    background-color: transparent;
    color: var(--text-main, #0a0a0a);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.follow-button.entity-follow-btn:hover {
    border-color: var(--text-muted, #6c757d);
    background-color: var(--bg-surface, #f8f9fa);
}

.follow-button.entity-follow-btn:focus-visible {
    outline: 2px solid var(--text-main, #0a0a0a);
    outline-offset: 2px;
}

/* render_follow_button() emits a 24x24 SVG. Historically it carried no
   viewBox, which means setting a smaller width/height CROPS it instead of
   scaling it. The viewBox is now present in 433-core, but cached page HTML
   may still serve the old markup — so scale via transform instead, which
   renders identically with or without a viewBox.

   The svg keeps its natural 24x24 layout box; the wrapper is sized to the
   visual result and clips the empty remainder. */
.follow-button.entity-follow-btn .follow-icon {
    display: block;
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    overflow: hidden;
    line-height: 0;
}

.follow-button.entity-follow-btn .follow-icon svg {
    width: 24px;
    height: 24px;
    display: block;
    fill: currentColor;
    transform: scale(0.625); /* 24 * 0.625 = 15 */
    transform-origin: top left;
}

.follow-button.entity-follow-btn.is-following {
    background-color: var(--bg-surface, #f8f9fa);
    border-color: transparent;
    color: var(--text-muted, #6c757d);
}

.follow-button.entity-follow-btn.is-following .follow-icon svg {
    fill: #1a7a4c;
}

[data-theme="dark"] .follow-button.entity-follow-btn.is-following .follow-icon svg {
    fill: #4fbf83;
}

/* --- "Vis N til" disclosure --- */

.f433-entities__more {
    margin-top: 4px;
}

.f433-entities__more-toggle {
    display: inline-block;
    padding: 8px 0;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-main, #0a0a0a);
    cursor: pointer;
    list-style: none;
}

.f433-entities__more-toggle::-webkit-details-marker {
    display: none;
}

.f433-entities__more-toggle::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 7px;
    vertical-align: 2px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
}

.f433-entities__more[open] .f433-entities__more-toggle::after {
    transform: rotate(-135deg);
    vertical-align: 4px;
}

.f433-entities__more-toggle:hover {
    text-decoration: underline;
}

.f433-entities__list--extra {
    margin-top: 0;
}

/* The extra list continues the same run of rows, so its first row keeps
   the divider that .f433-entity:first-child would otherwise remove. */
.f433-entities__list--extra .f433-entity:first-child {
    border-top: 1px solid var(--border-light, #e9e9e9);
}

/* --- Mobile --- */

@media (max-width: 600px) {
    .f433-entity {
        grid-template-columns: 34px 1fr auto;
        gap: 10px;
    }

    .f433-entity__avatar {
        width: 34px;
        height: 34px;
    }

    /* Icon-only button with a 44px touch target */
    .follow-button.entity-follow-btn {
        gap: 0;
        width: 44px;
        height: 44px;
        padding: 0;
    }

    .follow-button.entity-follow-btn .follow-text {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .follow-button.entity-follow-btn .follow-icon {
        width: 18px;
        height: 18px;
    }

    .follow-button.entity-follow-btn .follow-icon svg {
        transform: scale(0.75); /* 24 * 0.75 = 18 */
    }
}

@media (prefers-reduced-motion: reduce) {
    .follow-button.entity-follow-btn,
    .f433-entities__more-toggle::after {
        transition: none;
    }
}
