﻿.pedigree-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 4rem;
}

.pedigree-toolbar {
    margin-bottom: 1rem;
}

    /* Настраиваем ссылку «Назад к собаке» точно под стиль новостной кнопки */
    .pedigree-toolbar .back-link {
        background: none !important;
        border: none !important; /* Насильно стираем рамку-коробку */
        padding: 0.5rem 0 !important; /* Убираем внутренние отступы рамки */
        font-family: 'Montserrat', sans-serif !important;
        font-size: 0.8rem !important;
        font-weight: 200 !important;
        letter-spacing: 0.1em !important;
        color: var(--text-light) !important;
        text-decoration: none !important; /* Убираем подчеркивание ссылки */
        cursor: pointer !important;
        margin-bottom: 2rem !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 0.3rem !important;
        transition: all 0.2s !important;
    }

        /* Эффект при наведении мышки */
        .pedigree-toolbar .back-link:hover {
            color: var(--text-soft) !important;
            background: none !important;
            transform: translateX(-3px) !important; /* Плавный сдвиг влево */
        }




.dog-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    font-weight: 200;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-rich);
}

.pedigree-container {
    border: 1px solid #e5e5e5;
    background: #fff;
    max-width: 100%;
}

.generation-headers {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #f9f9f9;
    border-bottom: 2px solid #e5e5e5;
}

.gen-header {
    padding: 1rem;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 200;
    color: var(--text-soft);
    border-right: 1px solid #e5e5e5;
}

    .gen-header:last-child {
        border-right: none;
    }

.pedigrid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid #e5e5e5;
    background: #e5e5e5;
}

.gen-col {
    display: flex;
    flex-direction: column;
    background: #e5e5e5;
    height: 1500px;

}

.gen-1 .pedigrid-cell {
    height: 50%;
}

.gen-2 .pedigrid-cell {
    height: 25%;
}

.gen-3 .pedigrid-cell {
    height: 12.5%;
}

.gen-4 .pedigrid-cell {
    height: 6.25%;
}

.pedigrid-cell {
    background: white;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    border-bottom: 1px solid #e5e5e5; /* линии между ячейками */
    border-right: 1px solid #e5e5e5; /* линии между колонками */
}
/* Убираем правую границу у последней колонки */
.gen-col:last-child .pedigrid-cell {
    border-right: none;
}

/* Убираем нижнюю границу у последней ячейки в каждой колонке */
.gen-col .pedigrid-cell:last-child {
    border-bottom: none;
}

.cell-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

    .cell-link:hover {
        opacity: 0.7;
    }

.cell-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    margin: 0 auto;
}

    .cell-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.no-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f5f5f5;
    margin: 0 auto;
}

.cell-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    font-weight: 200;
    color: var(--text-soft);
    line-height: 1.3;
    word-break: break-word;
    max-width: 100%;
}

.cell-empty {
    opacity: 0.5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

    .cell-empty .cell-name {
        font-style: italic;
        color: var(--text-light);
    }

.loading {
    text-align: center;
    padding: 4rem;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-light);
}

@media (max-width: 1000px) {
    .pedigree-page {
        padding: 1rem;
    }

    .pedigree-container {
        overflow-x: auto;
    }

    .generation-headers,
    .pedigrid {
        min-width: 800px;
    }

    .gen-col {
        height: 600px;
    }

    .cell-image {
        width: 40px;
        height: 40px;
    }

    .no-image {
        width: 40px;
        height: 40px;
    }

    .cell-name {
        font-size: 0.7rem;
    }
}
