/* =========================================
   หน้า Archive Factory (B2B Grid Layout)
   ========================================= */
.archive-factory-container { max-width: 1200px; margin: 60px auto 100px; padding: 0 20px; }

/* Hero Header */
.archive-header { margin-bottom: 50px; }
.archive-title { font-size: 2.8em; font-weight: 800; color: #111; margin-bottom: 10px; }
.archive-description { font-size: 1.2em; color: #555; max-width: 600px; margin: 0 auto; }

/* Category Filter */
.factory-category-filter {
    display: flex; gap: 10px; justify-content: center; margin-bottom: 40px; flex-wrap: wrap;
}
.factory-category-filter .filter-btn {
    padding: 8px 22px; border-radius: 6px; /* ใช้ขอบมนน้อยลง ดูเป็นอุตสาหกรรม */
    background: #f1f5f9; color: #475569; text-decoration: none; font-weight: 600; font-size: 0.95em;
    transition: all 0.3s ease; border: 1px solid #e2e8f0;
}
.factory-category-filter .filter-btn:hover, 
.factory-category-filter .filter-btn.active { 
    background: #0073aa; color: #fff; border-color: #0073aa; box-shadow: 0 4px 10px rgba(0, 115, 170, 0.2); 
}

/* Factory Grid */
.factory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); /* การ์ดใหญ่กว่ากิจกรรมนิดนึง */
    gap: 30px;
    margin-bottom: 50px;
}

/* The Card */
.factory-card {
    background: #fff; border-radius: 8px; overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f1f5f9; display: flex; flex-direction: column;
}
.factory-card:hover { transform: translateY(-5px); box-shadow: 0 15px 35px rgba(0,0,0,0.1); }

.factory-card-img-link { position: relative; display: block; aspect-ratio: 16/10; overflow: hidden; background: #e2e8f0; }
.factory-card-thumbnail { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.factory-card:hover .factory-card-thumbnail { transform: scale(1.05); }
.factory-card-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3em; color: #94a3b8; }

.factory-card-badge {
    position: absolute; top: 15px; left: 15px; background: #0073aa; color: #fff;
    padding: 5px 12px; border-radius: 4px; font-size: 0.8em; font-weight: 700; z-index: 2; letter-spacing: 0.5px;
}

/* Card Content */
.factory-card-content { padding: 25px; display: flex; flex-direction: column; flex-grow: 1; }
.factory-card-title { font-size: 1.3em; font-weight: 700; margin-top: 0; margin-bottom: 15px; line-height: 1.4; }
.factory-card-title a { color: #0f172a; text-decoration: none; transition: color 0.2s; }
.factory-card-title a:hover { color: #0073aa; }

.factory-card-location { font-size: 0.95em; color: #64748b; margin-bottom: 15px; display: flex; align-items: flex-start; gap: 8px; line-height: 1.5; }
.factory-card-location i { color: #ef4444; font-size: 1.2em; margin-top: 2px; flex-shrink: 0; }

.factory-card-certs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.factory-card-certs .mini-badge { background: #f1f5f9; color: #475569; font-size: 0.75em; font-weight: 600; padding: 4px 8px; border-radius: 4px; border: 1px solid #e2e8f0; }

.factory-card-footer { margin-top: auto; padding-top: 15px; border-top: 1px solid #f1f5f9; }
.factory-card-readmore { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: #0073aa; text-decoration: none; font-size: 0.95em; }
.factory-card-readmore i { transition: transform 0.2s; }
.factory-card-readmore:hover i { transform: translateX(5px); }

/* Pagination */
.factory-pagination .nav-links { display: flex; justify-content: center; gap: 8px; }
.factory-pagination .page-numbers { padding: 10px 16px; border-radius: 6px; background: #f1f5f9; color: #333; text-decoration: none; font-weight: bold; transition: 0.3s; }
.factory-pagination .page-numbers.current, .factory-pagination .page-numbers:hover { background: #0073aa; color: #fff; }

/* Mobile Adjustments */
@media (max-width: 768px) {
    .factory-category-filter { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 10px; -webkit-overflow-scrolling: touch; }
    .factory-category-filter::-webkit-scrollbar { display: none; }
    .factory-category-filter .filter-btn { white-space: nowrap; }
}