/*
 * Hà Tiên Website Standard 2026 — Layout v1.2 — 21/07/2026
 * 800px là reading width, không phải page/root width.
 */

:root {
    --ht-layout-container: 1200px;
    --ht-layout-reading: 800px;
    --ht-layout-form: 960px;
    --ht-layout-gap: 24px;
    --ht-layout-gutter: 32px;
    --ht-overlay-card-radius: 10px;
}

/* Root và section giữ khả năng sử dụng toàn bộ chiều rộng do theme cấp. */
.ht-web-article,
.ht-page-layout {
    width: 100%;
    max-width: none;
}

.ht-full-bleed,
.alignfull.ht-full-bleed {
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.ht-layout-container,
.ht-web-article > .ht-layout-container {
    width: min(calc(100% - (2 * var(--ht-layout-gutter))), var(--ht-layout-container));
    margin-inline: auto;
}

/* Chỉ khối đọc dài mới giới hạn 760–820px. */
.ht-reading,
.ht-web-article > .ht-reading {
    width: 100%;
    max-width: var(--ht-layout-reading);
    margin-left: 0;
    margin-right: auto;
}

.ht-form-reading {
    width: 100%;
    max-width: var(--ht-layout-form);
}

/* Grid nội dung: desktop 2–3 cột, tablet 2 cột, mobile 1 cột. */
.ht-layout-grid {
    display: grid;
    gap: var(--ht-layout-gap);
    align-items: stretch;
}

.ht-layout-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ht-layout-grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ht-layout-grid > * {
    min-width: 0;
}

/* Hero/banner cover: full-width, 16:9 desktop và 9:16 mobile. */
.ht-cover-hero {
    position: relative;
    width: 100vw;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    aspect-ratio: 16 / 9;
    overflow: hidden;
    isolation: isolate;
}

.ht-cover-hero__media,
.ht-cover-hero__media picture,
.ht-cover-hero__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.ht-cover-hero__media img {
    display: block;
    object-fit: cover;
    object-position: var(--ht-hero-object-position, 50% 50%);
}

.ht-cover-hero__content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-block: clamp(40px, 7vw, 96px);
}

/* Overlay card dự án/ngành/năng lực. */
.ht-overlay-card {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border: 1px solid rgba(215, 173, 114, 0.28);
    border-radius: var(--ht-overlay-card-radius);
    background: #071116;
    color: #fff;
    text-decoration: none;
    isolation: isolate;
}

.ht-overlay-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.08) 0%,
            rgba(0, 0, 0, 0.18) 45%,
            rgba(0, 0, 0, 0.86) 100%
        );
}

.ht-overlay-card__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: var(--ht-card-object-position, 50% 50%);
    transition: transform 240ms ease;
}

/* Query Loop của post type Dự án sinh figure/a/img; chuẩn hóa về cùng component. */
.ht-project-query .wp-block-post-template {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ht-overlay-card .wp-block-post-featured-image,
.ht-overlay-card .ht-overlay-card__media,
.ht-overlay-card .wp-block-post-featured-image a {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
}

.ht-overlay-card .wp-block-post-featured-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: var(--ht-card-object-position, 50% 50%);
    transition: transform 240ms ease;
}

.ht-overlay-card__content {
    position: absolute;
    inset: 80% 0 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 6px;
    min-height: 0;
    padding: 10px 20px 16px;
    overflow: hidden;
    color: #fff;
}

.ht-overlay-card__eyebrow {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ht-overlay-card__eyebrow a,
.ht-overlay-card__title a {
    color: inherit;
    text-decoration: none;
}

.ht-overlay-card__title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: #fff;
    font-size: clamp(17px, 1.6vw, 20px);
    font-weight: 700;
    line-height: 1.28;
}

/* Kéo vùng bấm của tiêu đề phủ toàn card mà không bọc sai semantic. */
.ht-overlay-card__title a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
}

.ht-overlay-card:hover .ht-overlay-card__image,
.ht-overlay-card:hover .wp-block-post-featured-image img,
.ht-overlay-card:focus-within .ht-overlay-card__image,
.ht-overlay-card:focus-within .wp-block-post-featured-image img {
    transform: scale(1.025);
}

.ht-overlay-card:focus-visible,
.ht-overlay-card:focus-within {
    outline: 3px solid #d7ad72;
    outline-offset: 3px;
}

@media (max-width: 1023px) {
    :root {
        --ht-layout-gap: 20px;
        --ht-layout-gutter: 24px;
    }

    .ht-layout-grid--3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    :root {
        --ht-layout-gap: 16px;
        --ht-layout-gutter: 20px;
    }

    .ht-layout-grid--2,
    .ht-layout-grid--3 {
        grid-template-columns: 1fr;
    }

    .ht-cover-hero {
        aspect-ratio: 9 / 16;
    }

    .ht-cover-hero__content {
        padding-block: 48px;
    }

    .ht-overlay-card__content {
        padding-inline: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ht-overlay-card__image,
    .ht-overlay-card .wp-block-post-featured-image img {
        transition: none;
    }
}
