/**
 * ═══════════════════════════════════════════════════════════════
 *  Project Card Templates — Kai House
 *  Sử dụng CSS variables từ theme-style.php (Brand Skin):
 *    Colors:  --gold, --gold2, --line, --text, --muted, --brand-primary, --brand-secondary, --brand-bg
 *    Fonts:   --font-heading, --font-body, --font-size-small, --font-size-h3
 *    Layout:  --grid-gap, --card-radius, --card-shadow, --image-radius
 *    Grid:    --cols-desktop/laptop/ipad/mobile (từ section settings)
 * ═══════════════════════════════════════════════════════════════
 */


/* ─── Base grid ───────────────────────────────────────────────── */

.project-grid {
    display: grid;
    grid-template-columns: repeat(var(--cols-desktop, 3), 1fr);
    gap: var(--grid-gap, 9px);
    transition: opacity .25s ease, transform .25s ease;
}


/* ─────────────────────────────────────────────────────────────
   Mẫu 1: Hình nổi bật, tiêu đề bên dưới (Mặc định)
   Class: .project-grid article (default)
   ───────────────────────────────────────────────────────────── */

.project-grid .img-wrap {
    position: relative;
    overflow: hidden;
    border-radius: var(--image-radius, 0);
}

.project-grid img {
    height: var(--card-min-height, 126px);
    width: 100%;
    object-fit: cover;
    transition: transform .6s ease;
}

.project-grid article:hover img {
    transform: scale(1.1);
}

.img-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 12px;
    color: #fff;
    background: linear-gradient(180deg, transparent, rgba(7, 19, 31, .82));
    font-family: var(--font-body, 'Montserrat', sans-serif);
    font-size: var(--font-size-small, 11px);
    text-transform: uppercase;
    font-weight: 700;
    transition: padding .3s ease;
}

.project-grid article:hover .img-overlay {
    padding-bottom: 16px;
}

.project-grid h3 {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    text-transform: uppercase;
    font-size: var(--font-size-small, 12px);
    margin: 10px 0 2px;
    color: var(--text, #172233);
    font-weight: 700;
}

.project-grid p {
    font-family: var(--font-body, 'Montserrat', sans-serif);
    font-size: var(--font-size-small, 11px);
    color: var(--muted, #6a727b);
    margin: 0;
}

.project-grid a {
    text-decoration: none;
    color: inherit;
}


/* ─────────────────────────────────────────────────────────────
   Mẫu 2: Khung viền thanh lịch (Giống trang Dự án)
   Class: .project-card + .project-info
   ───────────────────────────────────────────────────────────── */

.project-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--card-radius, 4px);
    min-height: var(--card-min-height, 265px);
    background: var(--brand-primary, #07131f);
}

.project-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
    transition: transform .6s ease, opacity .4s ease;
}

.project-card:hover img {
    transform: scale(1.08);
    opacity: .8;
}

.project-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 50px 20px 18px;
    background: linear-gradient(to top, rgba(7, 19, 31, .92) 0%, rgba(7, 19, 31, .4) 60%, transparent 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: padding .3s ease;
}

.project-card:hover .project-info {
    padding-bottom: 22px;
}

.project-info span {
    font-family: var(--font-body, 'Montserrat', sans-serif);
    font-size: var(--font-size-small, 10px);
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--gold, #d4a25a);
    font-weight: 700;
}

.project-info h2 {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: var(--font-size-small, 16px);
    margin: 0;
    line-height: 1.3;
    font-weight: 700;
    color: #fff;
}

.project-info p {
    font-family: var(--font-body, 'Montserrat', sans-serif);
    font-size: var(--font-size-small, 12px);
    color: rgba(255, 255, 255, .7);
    margin: 0;
}

.project-info a {
    position: absolute;
    right: 16px;
    bottom: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--gold, #d4a25a);
    color: var(--gold, #d4a25a);
    display: grid;
    place-items: center;
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    transition: background .3s, color .3s, transform .3s;
}

.project-info a:hover {
    background: var(--gold, #d4a25a);
    color: #fff;
    transform: scale(1.1);
}


/* ─────────────────────────────────────────────────────────────
   Mẫu 3: Tối giản (Hình ảnh & Tiêu đề cơ bản)
   Class: .project-style-3
   ───────────────────────────────────────────────────────────── */

.project-style-3 {
    transition: transform .3s ease;
}

.project-style-3:hover {
    transform: translateY(-3px);
}

.project-style-3 a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.project-style-3 img {
    width: 100%;
    height: var(--card-min-height, 220px);
    object-fit: cover;
    border-radius: var(--image-radius, 6px);
    margin-bottom: 12px;
    transition: opacity .3s ease, transform .4s ease;
}

.project-style-3:hover img {
    opacity: .88;
    transform: scale(1.02);
}

.project-style-3 h3 {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: var(--font-size-small, 14px);
    margin: 0 0 4px;
    font-weight: 700;
    color: var(--text, #172233);
    text-transform: uppercase;
    transition: color .2s;
}

.project-style-3:hover h3 {
    color: var(--gold2, #c9983a);
}

.project-style-3 p {
    font-family: var(--font-body, 'Montserrat', sans-serif);
    font-size: var(--font-size-small, 12px);
    color: var(--muted, #5d6670);
    margin: 0;
    line-height: 1.5;
}


/* ─────────────────────────────────────────────────────────────
   Mẫu 4: Chữ đè lên hình (Overlay Card)
   Class: .project-style-4
   ───────────────────────────────────────────────────────────── */

.project-style-4 {
    position: relative;
    border-radius: var(--card-radius, 8px);
    overflow: hidden;
    min-height: var(--card-min-height, 260px);
}

.project-style-4 a {
    display: block;
    text-decoration: none;
}

.project-style-4 img {
    width: 100%;
    height: var(--card-min-height, 280px);
    object-fit: cover;
    transition: transform .6s ease;
}

.project-style-4:hover img {
    transform: scale(1.07);
}

.project-style-4 .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 18px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, .88) 0%, rgba(0, 0, 0, .35) 55%, transparent 100%);
    color: #fff;
    transition: padding .3s ease;
}

.project-style-4:hover .overlay {
    padding-bottom: 26px;
}

.project-style-4 .overlay h3 {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: var(--font-size-small, 16px);
    margin: 0 0 6px;
    line-height: 1.3;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
}

.project-style-4 .overlay p {
    font-family: var(--font-body, 'Montserrat', sans-serif);
    font-size: var(--font-size-small, 12px);
    color: var(--gold, #d4a25a);
    margin: 0;
    font-weight: 600;
    letter-spacing: .5px;
    transition: transform .3s ease;
}

.project-style-4:hover .overlay p {
    transform: translateY(-2px);
}


/* ─────────────────────────────────────────────────────────────
   Mẫu 5: Gọn gàng, bo góc tròn lớn
   Class: .project-style-5
   ───────────────────────────────────────────────────────────── */

.project-style-5 {
    border-radius: var(--card-radius, 12px);
    overflow: hidden;
    background: var(--brand-bg, #fff);
    border: 1px solid var(--line, #e4e6ea);
    display: flex;
    flex-direction: column;
    transition: transform .3s ease, box-shadow .3s ease;
}

.project-style-5:hover {
    transform: translateY(-5px);
    box-shadow: var(--card-shadow, 0 12px 28px rgba(0, 0, 0, .1));
}

.project-style-5 img {
    width: 100%;
    height: var(--card-min-height, 200px);
    object-fit: cover;
    transition: transform .5s ease;
}

.project-style-5:hover img {
    transform: scale(1.04);
}

.project-style-5 .info {
    padding: 16px 20px;
}

.project-style-5 .info h3 {
    font-family: var(--font-heading, 'Montserrat', sans-serif);
    font-size: var(--font-size-small, 14px);
    margin: 0 0 6px;
    font-weight: 700;
    color: var(--text, #172233);
    text-transform: uppercase;
    line-height: 1.35;
}

.project-style-5 .info p {
    font-family: var(--font-body, 'Montserrat', sans-serif);
    font-size: var(--font-size-small, 12px);
    color: var(--muted, #5d6670);
    margin: 0 0 12px;
    line-height: 1.5;
}

.project-style-5 .info a {
    font-size: var(--font-size-small, 12px);
    font-weight: 700;
    color: var(--gold2, #c9983a);
    text-decoration: none;
    transition: color .2s;
}

.project-style-5 .info a:hover {
    color: var(--gold, #d4a25a);
}


/* ─────────────────────────────────────────────────────────────
   Responsive — CSS Custom Properties
   ───────────────────────────────────────────────────────────── */

@media (max-width: 1099px) {
    .project-grid {
        grid-template-columns: repeat(var(--cols-laptop, 3), 1fr);
    }
}

@media (max-width: 767px) {
    .project-grid {
        grid-template-columns: repeat(var(--cols-ipad, 2), 1fr);
    }
}

@media (max-width: 559px) {
    .project-grid {
        grid-template-columns: repeat(var(--cols-mobile, 1), 1fr);
    }
}
