﻿
.bird-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.bird-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    transition: transform 0.3s ease;
}

    .bird-card:hover {
        transform: translateY(-4px);
    }

.bird-content {
    padding: 16px;
}

.bird-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.bird-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.bird-title-overlay {
    font-size: 1.3rem;
    font-weight: bold;
}

.bird-overlay {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    color: #fff;
    padding: 8px 12px;
    box-sizing: border-box;
}

.bird-title {
    font-size: 1.3rem;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.family-count {
    font-size: 1rem;
    opacity: 0.8;
    margin-inline-start: 6px;
}

.bird-desc {
    line-height: 1.7;
    color: #333;
    font-size: 0.95rem;
}

/* ✅ ردیف خانواده‌ها به شکل grid */
.bird-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    margin-top: 12px;
    position: relative;
}

    /* حالت expand */
    .bird-thumbs .extra-thumb {
        display: none;
    }

    .bird-thumbs.expanded .extra-thumb {
        display: block;
    }

/* دکمه نمایش بیشتر */
.thumb-more {
    display: block;
    margin: 12px auto 0 auto; /* وسط‌چینی */
    background-color: #f0f0f0;
    border: none;
    padding: 8px 16px;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 8px;
    color: #444;
    transition: background 0.2s;
    text-align: center;
    min-width: 160px;
}

    .thumb-more:hover {
        background-color: #e0e0e0;
    }

/* ✅ خانواده تکی */
.thumb {
    cursor: pointer;
    background: #fafafa;
    border-radius: 10px;
    padding: 6px;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
    font-size: 0.85rem;
}

    .thumb:hover {
        transform: scale(1.03);
    }

    .thumb img {
        width: 100%;
        aspect-ratio: 1;
        object-fit: cover;
        border-radius: 6px;
        margin-bottom: 4px;
    }

.thumb-title {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 2px;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thumb-count {
    font-size: 0.75rem;
    color: #777;
}

canvas#canv {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
}

@keyframes fadeSlideIn {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.bird-thumbs.expanded .extra-thumb {
    display: block;
    animation: fadeSlideIn 0.3s ease both;
}

.thumb-desc {
    display: none;
    font-size: 0.8rem;
    color: #555;
    margin-top: 4px;
    text-align: justify;
}

.thumb.open .thumb-desc {
    display: block;
}

.thumb-desc {
    display: none;
    font-size: 0.8rem;
    color: #555;
    margin-top: 4px;
    text-align: justify;
}

.bird-species {
    display: none;
    list-style: none;
    margin-top: 6px;
    padding-left: 0;
    font-size: 0.8rem;
    color: #444;
    max-height: 180px;
    overflow-y: auto;
    border-top: 1px solid #eee;
    padding-top: 6px;
    text-align: right; /* راست‌چین */
    direction: ltr;
}

    .bird-species li {
        line-height: 1.5;
        padding: 2px 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: right;
    }

.thumb.open .thumb-desc,
.thumb.open .bird-species {
    display: block;
}

