/**
 * HMD Gallery 1.11.0 — danh sách dự án + bộ lọc
 * Tiền tố .hmdl — không đụng CSS của theme hay của trang dự án (.hmdp).
 */
.hmdl { --hmdl-c: #f36f21; --hmdl-ink: #222; --hmdl-mute: #666; margin: 0 0 8px; }
.hmdl [hidden] { display: none !important; }
.hmdl-anchor { position: relative; top: -90px; height: 0; }

/* ── Bộ lọc ── */
.hmdl-filters { margin: 0 0 22px; }
.hmdl-fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 14px; }
.hmdl-f { display: flex; flex-direction: column; gap: 4px; margin: 0; font-weight: 400; }
.hmdl-f-lbl { font-size: 12.5px; font-weight: 700; color: var(--hmdl-mute); text-transform: uppercase; letter-spacing: .3px; }
.hmdl .hmdl-f select {
    width: 100%; height: 42px; margin: 0; padding: 0 34px 0 12px;
    font-size: 15px; color: var(--hmdl-ink); background-color: #fff;
    border: 1px solid #d9d9d9; border-radius: 6px; box-shadow: none;
    transition: border-color .15s;
}
.hmdl .hmdl-f select:focus { border-color: var(--hmdl-c); outline: none; box-shadow: 0 0 0 3px rgba(243,111,33,.15); }
.hmdl .hmdl-f select.is-on { border-color: var(--hmdl-c); background-color: #fff7f2; font-weight: 600; }
.hmdl-fbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; font-size: 14.5px; color: var(--hmdl-mute); }
.hmdl-count b { color: var(--hmdl-ink); }
.hmdl .hmdl-reset { color: var(--hmdl-c); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.hmdl .hmdl-submit { margin: 0; min-height: 36px; padding: 0 18px; border-radius: 6px; background: var(--hmdl-c); color: #fff; font-weight: 700; border: 0; }
.hmdl-filters.is-js .hmdl-submit { display: none; }

/* ── Lưới thẻ: 4 / 3 / 2 cột như khối cũ ── */
.hmdl-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px 20px; }
.hmdl .hmdl-card { display: flex; flex-direction: column; gap: 6px; color: inherit; text-decoration: none; min-width: 0; }
/* Phải NẰM SAU và cùng độ đặc hiệu với dòng trên. Bản đầu viết
   ".hmdl-card.is-out" đứng trước → bị ".hmdl .hmdl-card{display:flex}" đè,
   cả 89 thẻ vẫn hiện dù bộ đếm báo 12 (bắt được khi đo trên trang thử). */
.hmdl .hmdl-card.is-out, .hmdl .hmdl-card.is-more { display: none; }
/* 3:2 = đúng tỉ lệ ảnh công trình → không cắt mất logo chìm như ô vuông cũ. */
.hmdl-img { display: block; aspect-ratio: 3 / 2; border-radius: 6px; overflow: hidden; background: #e9e9e9; }
.hmdl-img img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0; transition: transform .35s ease; }
.hmdl .hmdl-card:hover .hmdl-img img { transform: scale(1.04); }
.hmdl .hmdl-title {
    margin: 6px 0 0; font-size: 15.5px; font-weight: 700; line-height: 1.4; color: var(--hmdl-ink);
    text-transform: none; letter-spacing: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hmdl .hmdl-card:hover .hmdl-title { color: var(--hmdl-c); }
.hmdl-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: #777; line-height: 1.4; }
.hmdl-meta-i { display: inline-flex; align-items: center; gap: 4px; }
.hmdl-meta-i svg { flex: 0 0 auto; color: #aaa; }

.hmdl-empty { margin: 8px 0 0; padding: 18px; text-align: center; background: #f6f6f6; border-radius: 6px; color: var(--hmdl-mute); }
.hmdl-empty a { color: var(--hmdl-c); font-weight: 600; }

.hmdl-more { margin: 26px 0 0; text-align: center; }
.hmdl .hmdl-more-btn {
    display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 26px;
    border: 1.5px solid var(--hmdl-c); border-radius: 22px; color: var(--hmdl-c); font-weight: 700; font-size: 15px;
    text-decoration: none; background: #fff; transition: background .15s, color .15s;
}
.hmdl .hmdl-more-btn:hover { background: var(--hmdl-c); color: #fff; }

@media (max-width: 849px) {
    .hmdl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 549px) {
    .hmdl-fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .hmdl .hmdl-f select { height: 40px; font-size: 14px; padding-left: 10px; }
    .hmdl-f-lbl { font-size: 11.5px; }
    .hmdl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
    .hmdl .hmdl-title { font-size: 14px; }
    .hmdl-meta { font-size: 12px; gap: 2px 8px; }
}
@media (prefers-reduced-motion: reduce) {
    .hmdl-img img { transition: none; }
}
