/* styles for the /gene/<sku> detail page */

.gene-detail-page {
    padding-bottom: 4rem;
}

.gd-back {
    margin-top: 2rem;
    margin-bottom: 1.5rem;
}

.gd-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    transition: color var(--transition);
}
.gd-back-link:hover {
    color: var(--color-primary);
}

.gd-hero {
    margin-bottom: 3rem;
}

.gd-hero-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.gd-sku-badge {
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.8125rem;
    color: var(--color-text-subtle);
}

.gd-category-text {
    font-size: 0.875rem;
    color: var(--color-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gd-hero-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--color-text);
    margin: 0 0 0.5rem 0;
    line-height: 1.1;
}

.gd-hero-author {
    font-size: 1.125rem;
    color: var(--color-text-muted);
}

.gd-layout {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

@media (min-width: 1024px) {
    .gd-layout {
        flex-direction: row;
        align-items: flex-start;
        gap: 3rem;
    }
    
    .gd-main-column {
        flex: 1;
        min-width: 0;
        /* Constrain the maximum width of the main column so it doesn't spread out too much on ultra-wide screens */
        max-width: 800px; 
    }

    .gd-main-column--centered {
        margin: 0 auto;
    }

    .gd-sidebar {
        width: 320px;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        gap: 2rem;
        position: sticky;
        top: calc(var(--header-height) + 2rem);
    }
}

/* Sections */
.gd-section {
    margin-bottom: 3rem;
}

.gd-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--color-text);
    margin-bottom: 1.5rem;
}

.gd-section-title--sm {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Action Card */
.gd-action-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.gd-action-card--active {
    border-color: #16a34a;
    background: color-mix(in srgb, #16a34a 3%, white);
    box-shadow: 0 4px 14px -2px color-mix(in srgb, #16a34a 15%, transparent);
}

.gd-action-status {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.gd-status-indicator {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
}

.gd-status-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.gd-status-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.gd-status-desc {
    font-size: 0.875rem;
    color: var(--color-text-subtle);
    line-height: 1.4;
}

.gd-status-indicator--active .gd-status-icon {
    color: #16a34a;
}

.gd-status-indicator--active .gd-status-title {
    color: #15803d;
}

.gd-status-indicator--inactive .gd-status-icon {
    color: #64748b;
}

.gd-users-badge {
    font-size: 0.875rem;
    color: var(--color-text-subtle);
}

.genes-btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    text-align: center;
    text-decoration: none;
}

.genes-btn--primary {
    background-color: var(--color-primary);
    color: #ffffff;
}
.genes-btn--primary:hover {
    background-color: var(--color-primary-hover);
    box-shadow: var(--shadow-sm);
}

.genes-btn--danger {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.genes-btn--danger:hover {
    background-color: #fee2e2;
}

.genes-btn--outline {
    background-color: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border-hover);
}
.genes-btn--outline:hover {
    background-color: var(--color-bg-subtle);
    color: var(--color-text);
}

/* Sidebar API Integrations */
.gd-sidebar-api-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.gd-sidebar-api-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.gd-sidebar-api-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: contain;
    flex-shrink: 0;
    background: var(--color-bg-subtle);
}

.gd-sidebar-api-placeholder {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: var(--color-bg-subtle);
    color: var(--color-text-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.gd-sidebar-api-placeholder svg {
    width: 14px;
    height: 14px;
}

.gd-sidebar-api-content {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.gd-sidebar-api-name {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text);
}

.gd-sidebar-api-links {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8125rem;
}
.gd-sidebar-api-link {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.gd-sidebar-api-link:hover {
    color: var(--color-primary-hover);
}

/* Taxonomy Tags */
.gd-taxonomy {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.gd-tag-badge, .gd-category-badge {
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* Version Table */
.gd-table-wrap {
    overflow-x: auto;
}
.gd-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.gd-table th {
    text-align: left;
    padding: 0.5rem 0;
    color: var(--color-text-subtle);
    font-weight: 500;
    border-bottom: 1px solid var(--color-border);
}
.gd-table td {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    vertical-align: top;
}
.gd-table tr:last-child td {
    border-bottom: none;
}
.gd-code {
    font-family: ui-monospace, SFMono-Regular, monospace;
    background: var(--color-bg-subtle);
    padding: 0.125rem 0.25rem;
    border-radius: 4px;
    font-size: 0.8125rem;
}
.gd-latest-badge {
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-size: 0.7rem;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    margin-left: 0.25rem;
    text-transform: uppercase;
    font-weight: 600;
}
.gd-version-date {
    color: var(--color-text-subtle);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

/* Resources */
.gd-resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}
.gd-resource-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-bg);
    transition: all var(--transition);
}
.gd-resource-card:hover {
    border-color: var(--color-border-hover);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}
.gd-resource-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    background: var(--color-bg-subtle);
}
.gd-resource-card-title {
    padding: 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text);
}

/* FAQ */
.gd-faq-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.gd-faq-item dt {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}
.gd-faq-item dd {
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* Prose formatting */
.prose {
    max-width: 100%; /* Changed from 70ch to allow it to fill the column gracefully */
    color: var(--color-text-muted);
    font-size: 1.0625rem;
    line-height: 1.7;
}
.prose h1, .prose h2, .prose h3, .prose h4 {
    color: var(--color-text);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.prose p {
    margin-bottom: 1.25rem;
}
.prose ul, .prose ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}
.prose li {
    margin-bottom: 0.5rem;
}
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9375rem;
}
.prose th, .prose td {
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    text-align: left;
}
.prose th {
    background: var(--color-bg-subtle);
    font-weight: 600;
    color: var(--color-text);
}
