/* Pedigree chart block — shared by frontend (via style.css @import) and admin View Pedigree */

.usla-sales-detail-section {
    border-top: 1px solid #d8d8d8;
    padding-top: 16px;
    margin-top: 22px;
}

.usla-sales-detail-section h2,
.usla-sales-detail-cell h2 {
    font-size: 1.2rem;
    margin: 0 0 8px;
    color: #003b70;
}

.usla-pedigree-chart-grid {
    display: grid;
    grid-template-columns: 1.55fr 1.15fr 1.15fr 1fr;
    gap: 14px;
    max-width: 1280px;
    margin-top: 16px;
}

.usla-pedigree-chart-generation {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.usla-pedigree-chart-generation-title {
    text-align: center;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #7a746c;
    font-weight: 700;
    margin-bottom: 10px;
}

.usla-pedigree-chart-stack {
    display: grid;
    gap: 8px;
    height: 100%;
}

.usla-pedigree-chart-stack-2 {
    grid-template-rows: repeat(2, 1fr);
}

.usla-pedigree-chart-stack-4 {
    grid-template-rows: repeat(4, 1fr);
}

.usla-pedigree-chart-stack-8 {
    grid-template-rows: repeat(8, 1fr);
}

.usla-pedigree-chart-horse {
    background: #fbfaf8;
    border: 1px solid #e5e0d8;
    border-radius: 10px;
    padding: 7px 10px;
    min-height: 48px;
}

.usla-pedigree-chart-sire {
    border-left: 4px solid #1f7f86;
}

.usla-pedigree-chart-dam {
    border-left: 4px solid #7a3b46;
}

.usla-pedigree-chart-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    margin-bottom: 4px;
    color: #6f6a63;
}

.usla-pedigree-chart-line {
    display: flex;
    align-items: center;
    gap: 7px;
}

.usla-pedigree-chart-brand {
    width: 24px !important;
    height: 24px !important;
    object-fit: contain !important;
    flex: 0 0 24px !important;
}

.usla-pedigree-chart-brand-placeholder {
    width: 24px;
    height: 24px;
    display: block;
}

.usla-pedigree-chart-text {
    display: flex;
    flex-direction: column;
    line-height: 1.12;
}

.usla-pedigree-chart-text strong {
    font-size: 0.8rem;
    font-weight: 700;
}

.usla-pedigree-chart-nin {
    margin-top: 2px;
    font-size: 0.64rem;
    color: #6f6a63;
}

@media (max-width: 1000px) {
    .usla-pedigree-chart-grid {
        grid-template-columns: 1fr;
    }

    .usla-pedigree-chart-stack-2,
    .usla-pedigree-chart-stack-4,
    .usla-pedigree-chart-stack-8 {
        grid-template-rows: none;
    }
}

.usla-pedigree-chart-current-horse {
    padding: 18px 18px 16px;
}

.usla-pedigree-chart-current-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.usla-pedigree-chart-current-header-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}

.usla-pedigree-chart-current-name {
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.05;
    margin: 0;
    color: #173f6d;
    letter-spacing: 0.01em;
}

.usla-pedigree-chart-current-sex-badge {
    flex: 0 0 auto;
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    background: #fff3cd;
    border: 1px solid #f0e0a0;
    color: #5c4a00;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.usla-pedigree-chart-current-nin {
    font-size: 0.82rem;
    color: #6f6a63;
    letter-spacing: 0.04em;
    margin-bottom: 16px;
}

.usla-pedigree-chart-current-details {
    display: grid;
    gap: 8px;
    margin-top: 0;
    padding-top: 14px;
    border-top: 1px solid #e6dfd5;
}

.usla-pedigree-chart-current-detail {
    display: grid;
    /* Narrow label column so long breeder/owner names get more room. */
    grid-template-columns: minmax(5.5rem, 26%) 1fr;
    gap: 12px 16px;
    align-items: baseline;
}

.usla-pedigree-chart-current-detail-label {
    font-size: 0.82rem;
    text-transform: none;
    letter-spacing: normal;
    color: #7a746c;
    font-weight: 400;
    line-height: 1.3;
    text-align: right;
}

.usla-pedigree-chart-current-detail-value {
    font-size: 0.92rem;
    line-height: 1.28;
    color: #2f2a26;
}

.usla-pedigree-chart-current-detail--nin .usla-pedigree-chart-current-detail-value {
    font-weight: 700;
}

.usla-pedigree-chart-current-brand {
    display: block;
    width: 54px;
    height: 54px;
    object-fit: contain;
    margin: 0;
    flex: 0 0 54px;
}

.usla-pedigree-chart-certificate-button {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
}

.usla-pedigree-chart-stack-small .usla-pedigree-chart-horse {
    min-height: 52px;
    padding: 5px 8px;
}

.usla-pedigree-chart-stack-small .usla-pedigree-chart-brand {
    width: 18px !important;
    height: 18px !important;
    flex-basis: 18px !important;
}

.usla-pedigree-chart-stack-small .usla-pedigree-chart-text strong {
    font-size: 0.72rem;
}

.usla-pedigree-chart-stack-small .usla-pedigree-chart-nin {
    font-size: 0.58rem;
}

.usla-pedigree-chart-stack-small .usla-pedigree-chart-line {
    gap: 5px;
}

.usla-pedigree-chart-breeder-label {
    display: block;
    margin-top: 5px;
    font-size: 0.52rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8a857d;
    font-weight: 700;
}

.usla-pedigree-chart-breeder {
    display: block;
    margin-top: 1px;
    font-size: 0.62rem;
    line-height: 1.2;
    color: #4e4943;
}

@media (max-width: 1000px) {
    .usla-pedigree-chart-block .usla-pedigree-chart-grid.usla-pedigree-chart-grid-compact {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
        gap: 12px !important;
        align-items: start !important;
    }

    .usla-pedigree-chart-block .usla-pedigree-chart-identity-column {
        grid-column: 1 / -1 !important;
        min-width: 0 !important;
    }

    .usla-pedigree-chart-block .usla-pedigree-chart-parents-column {
        grid-column: 1 / 2 !important;
        min-width: 0 !important;
    }

    .usla-pedigree-chart-block .usla-pedigree-chart-grandparents-column {
        grid-column: 2 / 3 !important;
        min-width: 0 !important;
    }

    .usla-pedigree-chart-block .usla-pedigree-chart-greatgrandparents-column {
        display: none !important;
    }

    .usla-pedigree-chart-block .usla-pedigree-chart-generation,
    .usla-pedigree-chart-block .usla-pedigree-chart-stack,
    .usla-pedigree-chart-block .usla-pedigree-chart-horse,
    .usla-pedigree-chart-block .usla-pedigree-chart-text {
        min-width: 0 !important;
    }
}
