/* ============================================================
   Wanyu 物種展示系統 — wsd-style.css
   配色參考網站現有折疊元件（淺藍綠色系、圓角）
   ============================================================ */

.wsd-wrap {
    margin: 0 0 2em;
}

/* ---- 地理分組 ---- */
.wsd-geo-group {
    margin-bottom: 10px;
}

.wsd-geo-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background: #e8f4ee;
    border: 1px solid #c5ddd0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.05em;
    font-weight: 600;
    color: #2a4a38;
    text-align: left;
    transition: background 0.2s, border-color 0.2s;
    box-sizing: border-box;
}

.wsd-geo-toggle:hover {
    background: #d8eee2;
    border-color: #a8ccb8;
}

.wsd-geo-toggle.is-open {
    background: #d0e8da;
    border-color: #9ac4ad;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.wsd-geo-content {
    border: 1px solid #c5ddd0;
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    padding: 16px;
    background: #eaf4ef;
    box-sizing: border-box;
}

/* 內層島嶼 */
.wsd-geo-group--inner {
    margin: 0 0 8px;
}

.wsd-geo-group--inner .wsd-geo-toggle {
    padding: 10px 16px;
    font-size: 0.96em;
    background: #f2f9f5;
    border-color: #d5e8dc;
    border-radius: 6px;
}

.wsd-geo-group--inner .wsd-geo-toggle:hover {
    background: #e6f5ec;
}

.wsd-geo-group--inner .wsd-geo-toggle.is-open {
    background: #e0f0e8;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.wsd-geo-group--inner .wsd-geo-content {
    border-color: #d5e8dc;
    border-radius: 0 0 6px 6px;
    padding: 12px;
}

.wsd-toggle-arrow {
    font-size: 0.8em;
    flex-shrink: 0;
    color: #5a8a6e;
}

/* ---- 類群標題 ---- */
.wsd-cat-section {
    margin-bottom: 20px;
}

.wsd-cat-title {
    font-size: 0.92em;
    font-weight: 700;
    color: #3a6e52;
    border-left: 4px solid #7ab898;
    padding: 2px 0 2px 10px;
    margin: 0 0 12px;
}

/* ---- 子分類折疊 ---- */
.wsd-subcat-group {
    margin-bottom: 8px;
}

.wsd-subcat-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 16px;
    background: #f5fbf7;
    border: 1px solid #d5e8dc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.97em;
    font-weight: 600;
    color: #2a4a38;
    text-align: left;
    transition: background 0.2s;
    box-sizing: border-box;
}

.wsd-subcat-toggle:hover {
    background: #eaf5ef;
}

.wsd-subcat-toggle.is-open {
    background: #e0f0e8;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.wsd-subcat-thumb {
    width: 64px;
    height: 44px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.wsd-subcat-name {
    flex: 1;
}

.wsd-subcat-count {
    font-size: 0.84em;
    color: #888;
    font-weight: 400;
}

.wsd-subcat-content {
    border: 1px solid #d5e8dc;
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 12px;
    background: #eaf4ef;
}

/* ---- 物種卡片 ---- */
/* PC：6 欄 */
.wsd-cards {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    padding: 4px 0;
}

.wsd-card {
    border-radius: 6px;
    overflow: hidden;
    background: #c8ddd2;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s, transform 0.2s;
}

.wsd-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.14);
    transform: translateY(-2px);
}

.wsd-card a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.wsd-card__img {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #e8ede9;
}

.wsd-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.wsd-card:hover .wsd-card__img img {
    transform: scale(1.04);
}

.wsd-card__img--no-photo {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 0.8em;
}

.wsd-card__title {
    padding: 7px 9px;
    font-size: 0.85em;
    font-weight: 600;
    line-height: 1.3;
    color: #2a3a2e;
}

/* ---- 響應式 ---- */
@media (max-width: 1024px) {
    .wsd-cards { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 640px) {
    .wsd-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .wsd-geo-toggle { font-size: 0.95em; padding: 12px 14px; }
    .wsd-subcat-thumb { width: 48px; height: 34px; }
    .wsd-card__title { font-size: 0.8em; padding: 5px 7px; }
}

@media (max-width: 400px) {
    .wsd-cards { grid-template-columns: repeat(2, 1fr); }
}
