/* --- All Tags Title Styling (Updated to Match Other Pages) --- */

.all-tags-hero h1 {
    /* ปรับขนาดให้เท่ากับหน้า Category: 2.2rem ถึง 3.5rem ตามขนาดจอ */
    font-size: clamp(2.2rem, 5vw, 3rem); 
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 15px; /* ลด margin ลงเพื่อให้กระชับ */
    letter-spacing: -0.5px;
    position: relative;
    display: inline-block;
}

/* เส้นคั้นสีแดงใต้หัวข้อ ปรับขนาดให้รับกับฟอนต์ที่เล็กลง */
.all-tags-hero h1::after {
    content: '';
    display: block;
    width: 50px; /* ลดความกว้างเส้นลงจาก 80px */
    height: 4px; /* ลดความหนาเส้นลงจาก 6px */
    background: var(--at-red);
    margin: 10px auto 0;
    border-radius: 2px;
    animation: titleLineGrow 0.8s ease-out forwards;
}

/* ปรับระยะ Padding ของ Hero ให้เล็กลงเพื่อไม่ให้หน้าว่างเกินไป */
.all-tags-hero {
    background: linear-gradient(to bottom, #fff, #f8fafc);
    text-align: center;
    padding: 60px 0 30px; /* ลดจาก 80px 40px */
}

/* ปรับแต่ง Paragraph คำอธิบายให้เล็กลงตาม */
.all-tags-hero .category-description {
    font-size: 1.1rem; /* เท่ากับหน้า Category */
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
}

/* สำหรับมือถือ */
@media (max-width: 768px) {
    .all-tags-hero h1 {
        font-size: 1.8rem; /* ขนาดมาตรฐานมือถือ */
    }
	.all-tags-hero {
        padding: 40px 20px 20px; /* เพิ่ม padding ซ้ายขวา */
    }
    .tags-cloud-container {
        padding: 20px 10px;
        gap: 8px; /* ลดช่องว่างให้ tag เรียงได้เยอะขึ้นในหน้าจอแคบ */
    }
    .tag-item-card {
        padding: 8px 15px; /* ลดขนาดปุ่ม tag ลงนิดนึงในมือถือ */
        font-size: 0.9rem;
    }
}
   /* --- Tags Cloud Container --- */
.tags-cloud-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    padding: 40px 0;
}

/* --- Tag Card Style --- */
.tag-item-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #fff;
    border: 2px solid #f1f5f9;
    border-radius: 50px;
    text-decoration: none;
    color: var(--at-dark);
    font-family: 'Prompt', sans-serif;
    transition: all 0.3s ease;
}

.tag-item-card:hover {
    border-color: var(--at-red);
    color: var(--at-red);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(237, 41, 57, 0.1);
}

.tag-count {
    font-size: 0.8rem;
    background: #f1f5f9;
    color: #64748b;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.tag-item-card:hover .tag-count {
    background: var(--at-red);
    color: #fff;
}

/* Breadcrumb */
.breadcrumb-nav {
    margin-top: 20px;
    font-size: 0.9rem;
}
.breadcrumb-nav a { color: #94a3b8; text-decoration: none; }
.breadcrumb-nav .sep { margin: 0 8px; color: #e2e8f0; }
.breadcrumb-nav .current { color: #64748b; }

.tag-item-card.match {
        background: var(--at-red) !important;
        color: white !important;
        border-color: var(--at-red) !important;
        transform: scale(1.1); /* ขยายใหญ่ขึ้นนิดนึงให้เด่น */
        box-shadow: 0 8px 20px rgba(237, 27, 47, 0.2);
    }

    .tag-item-card.match .tag-count {
        background: rgba(255, 255, 255, 0.2);
        color: white;
    }

    /* ซ่อน Tag ที่ไม่เกี่ยวข้อง (ถ้าคุณต้องการ) หรือจะแค่จางลงก็ได้ */
    .tag-item-card.no-match {
        opacity: 0.3;
        filter: grayscale(1);
        pointer-events: none; /* กดไม่ได้ถ้าไม่ตรง */
    }

    #tagSearchInput:focus {
        border-color: var(--at-red);
        box-shadow: 0 0 0 4px rgba(237, 27, 47, 0.1);
    }

    /* --- ส่วนที่เพิ่มเพื่อปรับไอคอนให้จางลง --- */

/* ปรับไอคอนใน Tag ให้จางลง (Muted Icons) */
.tag-item-card i {
    opacity: 0.4; /* ความจางของไอคอน */
    font-size: 0.85rem;
    transition: all 0.3s ease;
    color: #64748b; /* สีเทา Slate ให้ดูเบาบาง */
}

/* เมื่อ Hover ให้ไอคอนเข้มขึ้นนิดนึงตามสีตัวหนังสือ */
.tag-item-card:hover i {
    opacity: 1;
    color: var(--at-red);
}

/* กรณี Tag ที่ Match (จากการค้นหา) ให้ไอคอนเป็นสีขาวจางๆ */
.tag-item-card.match i {
    color: #fff;
    opacity: 0.7;
}

/* จัดระยะห่างภายในกลุ่มตัวเลขให้ดูเป็นระเบียบ */
.tag-stats {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
}