/* assets/css/knowledge.css */

/* Header de entidad — similar al header de post del blog pero con badge de tipo */
.entity-header {
    padding: 3rem 0 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
}

.entity-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.entity-type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Minimal Wireframe Badge Styles */
.entity-type-badge {
    background: transparent;
    color: #e5e7eb;
    border: 1px solid var(--evox-border, #333333);
}

.entity-schema-type {
    font-family: var(--evox-mono, "JetBrains Mono", monospace);
    font-size: 0.75rem;
    color: var(--evox-text-muted, #6b7280);
}

.entity-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 0.5rem;
}

.entity-alt-names {
    font-size: 1rem;
    color: var(--evox-text-muted, #6b7280);
    margin: 0 0 1rem;
}

.entity-description {
    font-size: 1.125rem;
    line-height: 1.6;
    color: #e5e7eb;
    max-width: 65ch;
    margin: 0 0 1.5rem;
}

.entity-same-as-title {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--evox-text-muted, #9ca3af);
    margin: 0 0 0.5rem;
}

.entity-same-as {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.entity-same-as li a {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--evox-border, #333333);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--evox-text-muted, #9ca3af);
    text-decoration: none;
    transition: all 0.15s ease;
}

.entity-same-as li a:hover {
    border-color: #ffffff;
    color: #ffffff;
}

.entity-last-updated {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 1.5rem;
    opacity: 0.8;
}

/* Cuerpo de la entidad — mismo ancho y tipografía que el blog */
.entity-content {
    max-width: 70ch;
    margin: 0 auto;
}

/* Sección de relaciones — sidebar o bloque inferior en mobile */
.entity-relations-group {
    margin: 2rem 0;
    padding: 1.5rem;
    background: transparent;
    border: 1px solid var(--evox-border, #333333);
    border-radius: 8px;
}

.relations-title {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--evox-text-muted, #9ca3af);
    margin: 0 0 0.75rem;
}

.relations-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.relations-list a {
    color: var(--evox-text-muted, #9ca3af);
    text-decoration: none;
    font-weight: 500;
}

.relations-list a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Backrefs */
.entity-backrefs {
    margin: 3rem 0;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.backrefs-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.backref-via {
    font-size: 0.75rem;
    color: var(--evox-text-muted, #6b7280);
}


/* =========================================================
   WIRE-FRAME STRUCTURAL STYLES
   ========================================================= */

/* Base container */
.knowledge-hub-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.single-entity-container {
    max-width: 800px;
}

/* Breadcrumbs */
.kh-breadcrumbs {
    margin-bottom: 2rem;
    font-size: 0.875rem;
    color: var(--evox-text-muted, #9ca3af);
}

.kh-breadcrumbs ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.kh-breadcrumbs a {
    color: var(--evox-text-muted, #9ca3af);
    text-decoration: none;
}

.kh-breadcrumbs a:hover {
    color: var(--evox-text, #ffffff);
    text-decoration: underline;
}

/* Headers */
.kh-header {
    margin-bottom: 3rem;
}

.kh-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.kh-description {
    font-size: 1.125rem;
    color: var(--evox-text-muted, #6b7280);
    max-width: 65ch;
    line-height: 1.6;
}

/* Taxonomy Sections (Accordions) */
.kh-tax-section {
    margin-bottom: 2rem;
}

.kh-tax-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.kh-accordion {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.kh-accordion-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    cursor: pointer;
    list-style: none;
    /* Hide default arrow */
}

.kh-accordion-trigger::-webkit-details-marker {
    display: none;
    /* Safari */
}

.kh-accordion-title {
    font-size: 1.125rem;
    font-weight: 500;
}

.kh-accordion-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--evox-text-muted, #6b7280);
}

.kh-entity-count {
    font-size: 0.875rem;
}

.kh-accordion-icon {
    font-size: 1.25rem;
    font-family: monospace;
}

.kh-accordion[open] .kh-accordion-icon {
    transform: rotate(45deg);
}

/* Entities List in Accordion */
.kh-accordion-content {
    padding: 1rem 0 2rem 2rem;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    margin-left: 1rem;
    margin-bottom: 1.5rem;
}

.kh-entity-list {
    list-style: disc;
    padding: 0 0 0 1rem;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.kh-entity-item {
    font-size: 1rem;
}

.kh-entity-link {
    font-weight: 500;
    color: var(--evox-text);
    text-decoration: none;
}

.kh-entity-link:hover {
    text-decoration: underline;
}

.kh-entity-inline-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

.kh-schema-badge {
    background: var(--evox-bg-soft, #f3f4f6);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: var(--evox-mono, "JetBrains Mono", monospace);
    font-size: 0.75rem;
    color: var(--evox-text-muted, #6b7280);
}

.kh-entity-desc-inline {
    color: var(--evox-text-muted, #6b7280);
}

/* Single Entity Extras */
.kh-separator {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 4rem 0;
}

.kh-related-entities {
    margin-top: 2rem;
}

.kh-related-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.kh-related-subtitle {
    color: var(--evox-text-muted, #6b7280);
    margin-bottom: 2rem;
}

.kh-related-lists {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}