/* ==========================================================================
   ARCHIVE GALLERY FIX - CLONE ALBUM PRODUCT
   ========================================================================== */

/* ======================
   CARD EFFECT
====================== */

.archive .entry-card,
.blog .entry-card{
    border-radius: 10px !important;
    overflow: hidden !important;
    background: #fff !important;
    box-shadow: 0 4px 14px rgba(0,0,0,.08);
    transition: transform .28s ease, box-shadow .28s ease;
    padding: 5px !important;
    margin-bottom: 18px !important;
}

.archive .entry-card:hover,
.blog .entry-card:hover{
    transform: translateY(-6px);
    box-shadow: 0 14px 32px rgba(0,0,0,.14);
}

/* bo góc ảnh theo card */
.gallery,
.gallery .template,
.gallery .template img{
    border-radius: 10px;
}

/* title mượt hơn */
.custom-entry-title a{
    transition: color .25s ease;
}

.archive .entry-card:hover .custom-entry-title a{
    color: #0073aa !important;
}

.project-price,
.project-price-archive {
    color: #0073aa;
    background-color: #f0f0f0;
    padding: 2px;
    border-left: 4px solid #005177;
    display: inline-block;
    font-size: 12px;
    white-space: nowrap;
}

.project-tags {
    display: inline-block;
    font-size: .9em;
}

/* View count badge - dùng cùng kiểu với card trang chủ */
.vc-archive-view-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(245, 158, 11, .10);
    border: 1px solid rgba(245, 158, 11, .18);
    font-size: 10px;
    line-height: 1;
    font-weight: 700;
    color: #b45309;
    white-space: nowrap;
}

.vc-archive-view-count::before {
    content: "👁";
    font-size: 10px;
}

/* Archive Layout */
.archive .entries,
.blog .entries {
    display: block !important;
}

.archive .entry-card,
.blog .entry-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 15px 0 !important;
    clear: both;
}

.archive .entry-thumbnail,
.archive .post-thumbnail,
.archive .gallery {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 auto !important;
}

[data-cards="boxed"],
[data-cards="cover"] {
    --card-inner-spacing: 2px;
}

[data-archive=default] .card-content>* {
    margin-block: 0 var(--card-element-spacing, 5px);
}

/* Meta */
.project-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.project-meta-row p {
    margin: 0;
}

.project-meta-row .meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
	font-size: 14px;
}

.project-meta-row .meta-item > span {
    display: inline-block;
    margin-right: 0;
}

.custom-entry-title {
    text-align: center;
    color: #0a0500 !important;
}

/* ======================
   GALLERY
====================== */

.archive .entry-card,
.blog .entry-card{
    height: auto !important;
    min-height: 0 !important;
    display: block !important;
}

.archive .entry-card .card-content,
.blog .entry-card .card-content{
    height: auto !important;
    min-height: 0 !important;
}

.gallery {
    box-sizing: border-box;
    width: 100%;
    max-width: 1170px;
    margin: 1rem auto 0 !important;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, .30);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 7px 20px rgba(15, 23, 42, .08);
}

.gallery .images {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
	position: relative;
	align-items: start;
	height: auto !important;
}

/* Lượt xem nổi trên góc trái ảnh đầu tiên, cách mép ảnh 5px. */
.gallery .images > .archive-gallery-view-count {
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 30;
    margin: 0;
    padding: 5px 8px;
    border: 1px solid rgba(245, 158, 11, .24);
    border-radius: 999px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 4px 12px rgba(15, 23, 42, .16);
    color: #b45309;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.gallery .images > .archive-gallery-view-count::before {
    content: "👁";
    margin-right: 4px;
    font-size: 10px;
}

.gallery .template {
    position: relative;
    padding-bottom: 100%;
    overflow: hidden;
    background: #f5f5f5;
	aspect-ratio: 1/1;
}

.gallery .template a {
    position: absolute;
    inset: 0;
    display: block;
}

.gallery .template img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Giới hạn 8 ảnh */
.gallery.limited .template.hidden-gallery-item{
	display:none !important;
}

/* Overlay */
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.58);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    z-index: 99;
    text-align: center;
}

.gallery-overlay .count-text {
    font-size: 2.2em;
    line-height: 1;
}

.gallery-overlay div:last-child {
    font-size: .85em;
    margin-top: 6px;
    text-transform: uppercase;
}

/* Tắt nút show more cũ */
.gallery-show-more {
    display: none !important;
}

/* Hide meta thừa */
.archive .entry-meta,
.archive .entry-card h2.entry-title,
.archive .entry-excerpt {
    display: none !important;
}

/* ======================
   MOBILE
====================== */

@media (max-width:768px) {

    .gallery .images {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

	.gallery.limited .template.hidden-gallery-item{
		display:none !important;
	}

    .gallery-overlay .count-text {
        font-size: 1.8em;
    }

    .gallery-overlay div:last-child {
        font-size: 1em;
    }

    .customer-photo-album-section h2 {
        font-size: 1.5em;
    }

    .customer-photo-category-title {
        font-size: 1.2em;
    }
}

/* Accessibility */
.sr-only {
    position: absolute;
    overflow: hidden;
    clip: rect(0 0 0 0);
    height: 1px;
    width: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
}


/* ==========================================================================
   ARCHIVE META V7.7 — COMPACT PILL LAYOUT
   Giữ bố cục xen kẽ như bản cũ; thêm nền, viền, bóng và padding cho gallery + meta.
   Desktop: cố gắng nằm trên một hàng. Mobile: tự xuống nhiều hàng theo độ rộng.
   ========================================================================== */

.archive-project-details {
    box-sizing: border-box;
    margin-top: 8px;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, .26);
    border-radius: 14px;
    background: #f8fafc;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .07);
}

.archive-project-meta-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin: 0;
}

.archive-project-meta-row .archive-meta-pill {
    box-sizing: border-box;
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
    min-height: 31px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid rgba(148, 163, 184, .36);
    border-radius: 999px;
    background: #ffffff;
    box-shadow:
        0 4px 10px rgba(15, 23, 42, .10),
        inset 0 1px 0 rgba(255, 255, 255, .95);
    color: #475569;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.15;
    white-space: nowrap;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.archive-project-meta-row .archive-meta-pill:hover {
    transform: translateY(-1px);
    border-color: rgba(245, 158, 11, .45);
    box-shadow:
        0 7px 15px rgba(15, 23, 42, .13),
        inset 0 1px 0 rgba(255, 255, 255, .98);
}

.archive-project-meta-row .archive-meta-pill > strong {
    margin: 0;
    color: #334155;
    font-size: inherit;
    font-weight: 750;
    line-height: inherit;
    white-space: nowrap;
}

.archive-project-meta-row .archive-meta-pill > span,
.archive-project-meta-row .archive-meta-pill > a {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: inherit;
    line-height: inherit;
}

.archive-project-meta-row .archive-meta-pill--price > span {
    color: #0073aa;
    font-weight: 800;
}

.archive-project-meta-row .archive-meta-pill--max-size > span {
    color: #0f766e;
    font-weight: 750;
}

.archive-project-meta-row .archive-meta-pill--type {
    white-space: nowrap;
}

.archive-project-meta-row .archive-meta-pill--type > a {
    color: #1268d5;
    font-weight: 600;
    text-decoration: none;
}

.archive-project-meta-row .archive-meta-pill--type > a:hover {
    color: #005a9c;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Reset các span lồng nhau của cụm sao để không bị tạo pill lần nữa. */
.archive-project-meta-row .archive-meta-pill--scratch .scratch-rating,
.archive-project-meta-row .archive-meta-pill--scratch .scratch-rating__stars,
.archive-project-meta-row .archive-meta-pill--scratch .scratch-rating__empty,
.archive-project-meta-row .archive-meta-pill--scratch .scratch-rating__fill,
.archive-project-meta-row .archive-meta-pill--scratch .scratch-rating__value {
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.archive-project-meta-row .archive-meta-pill--scratch .scratch-rating {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    white-space: nowrap;
}

.archive-project-meta-row .archive-meta-pill--scratch .scratch-rating__stars {
    font-size: 13px;
    letter-spacing: 0;
}

.archive-project-meta-row .archive-meta-pill--scratch .scratch-rating__value {
    margin-left: 1px;
    font-size: 12px;
    font-weight: 800;
}

.archive-project-detail-button {
    box-sizing: border-box;
    flex: 0 0 auto;
    width: auto;
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 0;
    padding: 5px 11px;
    border: 1px solid #0f172a;
    border-radius: 999px;
    background: #0f172a;
    box-shadow: 0 4px 10px rgba(15, 23, 42, .12);
    color: #fff !important;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.15;
    text-decoration: none !important;
    white-space: nowrap;
    transition: transform .2s ease, background-color .2s ease, border-color .2s ease;
}

.archive-project-detail-button:hover,
.archive-project-detail-button:focus-visible {
    transform: translateY(-1px);
    border-color: #0073aa;
    background: #0073aa;
    color: #fff !important;
}

.archive-project-detail-button > span {
    margin: 0;
    padding: 0;
}


    .gallery {
        padding: 6px;
        border-radius: 12px;
    }

    .gallery .images > .archive-gallery-view-count {
        top: 5px;
        left: 5px;
        padding: 5px 7px;
        font-size: 9.5px;
    }

    .archive-project-details {
        margin-top: 7px;
        padding: 7px;
        border-radius: 12px;
    }

    .archive-project-meta-row {
        flex-wrap: wrap;
        align-items: center;
        align-content: flex-start;
        gap: 5px;
    }

    .archive-project-meta-row .archive-meta-pill,
    .archive-project-detail-button {
        flex: 0 0 auto;
        width: auto;
        max-width: 100%;
    }

    .archive-project-meta-row .archive-meta-pill,
    .archive-project-detail-button {
        min-height: 29px;
        padding: 5px 8px;
        font-size: 11.5px;
    }

    .archive-project-meta-row .archive-meta-pill--scratch .scratch-rating__stars {
        font-size: 12px;
    }

    .archive-project-meta-row .archive-meta-pill--scratch .scratch-rating__value {
        font-size: 11.5px;
    }


@media (max-width: 380px) {
    .archive-project-meta-row {
        gap: 4px;
    }

    .archive-project-meta-row .archive-meta-pill,
    .archive-project-detail-button {
        padding-inline: 6px;
        font-size: 11px;
    }
}
