/* --- 全局基礎重置與導覽列安全距離 --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background-color: #1a1a1a;
    background-image: 
        radial-gradient(circle, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.8) 100%),
        url('/bg.png'); 
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #f0f0f0;
    line-height: 1.6;
    padding-top: 100px; /* 防止固定在頂部的 nav 擋住內容 */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.featured-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 60px 20px;
    flex: 1;
    width: 100%;
}

/* --- 頁面標題區 (Hero) --- */
.featured-hero {
    text-align: center;
    margin-bottom: 35px;
}

.featured-title {
    font-family: 'Press Start 2P', 'Noto Sans TC', monospace;
    font-size: 2rem;
    color: #ffaa00;
    text-shadow: 4px 4px 0px #3E2723;
    margin-bottom: 12px;
}

.featured-subtitle {
    color: #aaaaaa;
    font-size: 1.05rem;
}

/* --- 分類篩選按鈕列 --- */
.filter-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 35px;
}

.filter-btn {
    font-family: 'Noto Sans TC', sans-serif;
    font-weight: bold;
    font-size: 0.95rem;
    color: #ffffff;
    background-color: #333333;
    border: 3px solid #000000;
    box-shadow: 
        inset -3px -3px 0px #1a1a1a, 
        inset 3px 3px 0px #555555;
    padding: 8px 18px;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
}

.filter-btn:hover {
    background-color: #444444;
    color: #ffff55;
}

.filter-btn.active {
    background-color: #ffaa00;
    color: #000000;
    box-shadow: 
        inset -3px -3px 0px #9f6f00, 
        inset 3px 3px 0px #ffcf40;
}

/* --- 精選卡片網格與樣式 --- */
.featured-grid {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.featured-card {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    background-color: #2e2e2e;
    border: 4px solid #000000;
    box-shadow: 
        inset -4px -4px 0px #1a1a1a, 
        inset 4px 4px 0px #5c5c5c,
        0px 8px 16px rgba(0,0,0,0.6);
    padding: 25px;
    gap: 20px;
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.4rem;
    color: #ffffff;
    margin-bottom: 10px;
    line-height: 1.3;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.88rem;
    color: #aaaaaa;
    margin-bottom: 12px;
}

.meta-item {
    display: inline-flex;
    align-items: center;
}

.card-desc {
    color: #dddddd;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 15px;
    flex: 1;
}

.card-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.coords-box {
    background-color: #151515;
    border: 2px solid #000;
    padding: 6px 12px;
    font-family: monospace;
    color: #55ff55;
    font-size: 0.9rem;
}

.copy-btn {
    background-color: #4a4a4a;
    border: 2px solid #000;
    color: #fff;
    padding: 6px 14px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: inset -2px -2px 0px #222, inset 2px 2px 0px #777;
}

.copy-btn:hover {
    background-color: #5a5a5a;
}

.copy-btn.copied {
    background-color: #55ff55;
    color: #000;
}

.share-btn {
    background-color: #3b5998;
    border: 2px solid #000;
    color: #fff;
    padding: 6px 14px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: inset -2px -2px 0px #1a2a4a, inset 2px 2px 0px #5b79b8;
    transition: background-color 0.15s ease;
}

.share-btn:hover {
    background-color: #4c70ba;
}

.share-btn.copied {
    background-color: #55ff55;
    color: #000;
}

/* --- 圖片區域與 Badge --- */
.card-image-wrapper {
    position: relative;
    width: 220px;
    min-width: 220px;
    height: 160px;
    border: 3px solid #000;
    overflow: hidden;
    cursor: pointer;
    background-color: #151515;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card-image-wrapper:hover .card-image {
    transform: scale(1.08);
}

.card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: #ffaa00;
    color: #000000;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 8px;
    border: 2px solid #000000;
    box-shadow: 2px 2px 0px #000000;
}

/* --- Lightbox 彈窗層 --- */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000; /* 高於導覽列 */
    padding: 20px;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-modal {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    background-color: #2e2e2e;
    border: 4px solid #000;
    box-shadow: 0px 0px 20px rgba(0,0,0,0.8);
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-close {
    position: absolute;
    top: -15px;
    right: -15px;
    background-color: #ff5555;
    color: #ffffff;
    border: 3px solid #000000;
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 2px 2px 0px #000;
}

.lightbox-modal img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border: 2px solid #000;
}

.lightbox-caption {
    margin-top: 12px;
    color: #ffaa00;
    font-size: 1.1rem;
    font-weight: bold;
}

/* --- RWD 響應式佈局 --- */
@media (max-width: 768px) {
    body {
        padding-top: 120px;
    }

    .featured-title {
        font-size: 1.5rem;
    }

    .featured-card {
        flex-direction: column-reverse;
    }

    .card-image-wrapper {
        width: 100%;
        min-width: 100%;
        height: 200px;
    }
}