/* * File: assets/css/modules/public-themes.css
 * Description: 主題館導航與網格樣式 (RWD: Scroll -> Icon Wall)
 */

.se-theme-section {
    position: relative;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
    min-height: 80px; 
}

/* [Mobile Default] Horizontal Scroll */
.se-theme-scroll-area {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    padding: 5px 0;
    width: 100%;
    display: flex; 
}
.se-theme-scroll-area::-webkit-scrollbar { display: none; }

.se-theme-grid {
    display: grid;
    grid-template-rows: repeat(2, 1fr); /* 兩列 */
    grid-auto-flow: column; /* 往右排列 */
    grid-auto-columns: minmax(70px, calc((100vw - 2rem) / 5)); 
    gap: 1rem 0.75rem;
    padding-right: 1rem; 
}

.se-theme-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 100%;
    min-width: 60px; 
    scroll-snap-align: start;
    transition: transform 0.2s;
    text-decoration: none; 
}

.se-theme-btn:hover .se-theme-icon-box {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.se-theme-btn:active { transform: scale(0.95); }

.se-theme-icon-box {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.25rem;
    overflow: hidden;
    font-size: 1.25rem;
    transition: all 0.2s;
    flex-shrink: 0; 
}

.se-theme-icon-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.se-theme-text {
    font-size: 0.75rem;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
    line-height: 1.4;
}

.se-scroll-mask {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 60px;
    background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,1));
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s;
}
.se-scroll-mask.visible { opacity: 1; }


/* =========================================
   Desktop RWD Enhancements (>= 1024px)
   ========================================= */
@media (min-width: 1024px) {
    
    .se-theme-section {
        padding: 0; /* 移除內距，由外層容器控制 */
        margin-bottom: 2.5rem;
    }

    .se-theme-scroll-area {
        overflow: visible; /* 解除捲動 */
        display: block;
    }

    /* [Transformation] Scroll -> Icon Wall */
    .se-theme-grid {
        display: flex;
        flex-wrap: wrap; /* 自動換行 */
        grid-template-rows: auto; /* 重置 */
        grid-auto-flow: row;      /* 重置 */
        grid-auto-columns: auto;  /* 重置 */
        gap: 1.5rem;              /* 加大間距 */
        justify-content: flex-start; /* 靠左對齊 */
    }

    .se-theme-btn {
        width: auto;
        min-width: 80px; /* 稍微加大 */
        flex: 0 0 auto;  /* 不要伸縮 */
    }

    /* 圖示放大 */
    .se-theme-icon-box {
        width: 4rem;
        height: 4rem;
        font-size: 1.5rem;
        border-radius: 1.25rem;
        margin-bottom: 0.5rem;
        background-color: #fff; /* 確保有底色 */
        border: 1px solid #f3f4f6; /* 加個淡邊框 */
    }

    .se-theme-btn:hover .se-theme-icon-box {
        background-color: #fff;
        border-color: #e5e7eb;
        transform: translateY(-4px); /* 加強浮動感 */
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    }

    .se-theme-text {
        font-size: 0.875rem; /* 加大文字 */
        font-weight: 500;
    }

    /* 隱藏捲動遮罩 */
    .se-scroll-mask {
        display: none;
    }
}