/**
 * MYAN — trang Custom Designs (/custom-designs/). Spec: docs/design/custom-design.md · kế hoạch: docs/plans/custom-design-plan.md.
 * Chỉ nạp khi nội dung trang có shortcode [myan_custom_…] (+ khung UX Builder) — inc/custom-designs.php.
 * Chỉ dùng biến --myan-* (token ở myan.css). Breakpoint: ≥1100 desktop · 850–1099 trung gian (§10) · ≤849 mobile.
 * Trang dùng template page-blank.php → hero tràn mép 1440; các section sau tự bọc container 1360 + lề.
 */

/* =====================================================================================================
   Anchor đích của menu CUSTOM / tab hero (§0)
   html đã có scroll-padding-top: var(--myan-sticky-top) → cộng thêm 16px: dừng ngay dưới header dính + 16px.
   ===================================================================================================== */
#customization,
#bespoke,
#enquire {
    scroll-margin-top: 16px;
}

/* =====================================================================================================
   Custom hero — element myan_custom_hero (ux-elements/myan-custom-hero.php, spec §1, §10)
   ===================================================================================================== */
.myan-custom-hero {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    max-width: var(--myan-container-max);
    margin: 0 auto;
    background: var(--myan-bg);
    font-family: var(--myan-sans);
    color: var(--myan-text);
}

/* Cột ảnh: ảnh phủ kín cột (cover), nền placeholder khi chưa có ảnh */
.myan-custom-hero__media {
    position: relative;
    flex: 1.2 1 0;
    min-width: 0;
    min-height: 660px;
    overflow: hidden;
    background: var(--myan-tone-4);
}
.myan-custom-hero .myan-custom-hero__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    transition: none; /* Flatsome: img { transition: opacity 1s } */
}
.myan-custom-hero .myan-custom-hero__inset {
    position: absolute;
    z-index: 1;
    top: 16px;
    right: 16px;
    width: 200px;
    height: 260px;
    max-width: none;
    object-fit: cover;
    border: 6px solid var(--myan-bg);
    box-sizing: border-box;
    transition: none;
}
.myan-custom-hero__caption {
    position: absolute;
    z-index: 1;
    left: 0;
    bottom: 0;
    max-width: 300px;
    margin: 14px;
    padding: 6px 10px;
    font-size: var(--myan-fs-caption);
    line-height: 1.5;
    color: var(--myan-ink);
    background: var(--myan-card-label-bg);
}

/* Cột chữ */
.myan-custom-hero__body {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
    padding: 56px 40px 56px 64px;
    box-sizing: border-box;
}
/* Breadcrumb dùng chung (.myan-breadcrumb, myan.css) — trong hero bỏ khoảng cách riêng, cỡ 13px (§1) */
html .myan-custom-hero .myan-breadcrumb {
    margin: 0;
    padding: 0;
    font-size: var(--myan-fs-caption);
}
/* Eyebrow + H1 dùng class chung .myan-eyebrow / .myan-h1 (như hero trang chủ) — chỉ chặn margin của Flatsome */
.myan-custom-hero .myan-custom-hero__eyebrow,
.myan-custom-hero .myan-custom-hero__title {
    margin: 0;
}
.myan-custom-hero .myan-custom-hero__lead {
    max-width: 480px;
    margin: 0;
    font-size: 18px; /* lead hero cục bộ (chưa có token, Quyết định Bước 0 mục 6) */
    line-height: 1.6;
    color: var(--myan-text);
}

/* 2 tab-link: lưới 2 cột */
.myan-custom-hero .myan-custom-hero__tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
}
.myan-custom-hero .myan-custom-hero__tab-item {
    margin: 0;
    padding: 0;
}
.myan-custom-hero .myan-custom-hero__tab {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    color: var(--myan-link);
    text-decoration: none;
    border-radius: var(--myan-radius);
}
.myan-custom-hero__tab-box {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 10px 14px;
    box-sizing: border-box;
    border: 1px solid var(--myan-brand);
    border-radius: var(--myan-radius);
    font-family: var(--myan-sans); /* Service 2026: Ysabeau 500 20, lh 1.15, không quy đổi */
    font-size: 20px;
    font-weight: 500;
    line-height: 1.15;
    text-align: center;
    transition:
        background-color var(--myan-dur-ui) var(--myan-ease),
        border-color var(--myan-dur-ui) var(--myan-ease),
        color var(--myan-dur-ui) var(--myan-ease);
}
.myan-custom-hero__tab--filled .myan-custom-hero__tab-box {
    background: var(--myan-brand);
    color: var(--myan-surface);
}
.myan-custom-hero__tab--outline .myan-custom-hero__tab-box {
    background: transparent;
    color: var(--myan-link);
}
.myan-custom-hero__tab-more {
    margin-top: 4px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--myan-link);
}
.myan-custom-hero__tab-arrow {
    display: inline-block;
    transition: transform var(--myan-dur-hover) var(--myan-ease);
}
.myan-custom-hero .myan-custom-hero__tab:focus-visible {
    outline: 2px solid var(--myan-focus);
    outline-offset: 2px;
}

/* Hover chỉ máy có chuột (motion.md mục 6): filled đậm nhẹ, outline nền surface */
@media (hover: hover) and (pointer: fine) {
    .myan-custom-hero__tab--filled:hover .myan-custom-hero__tab-box {
        background: var(--myan-ink);
        border-color: var(--myan-ink);
    }
    .myan-custom-hero__tab--outline:hover .myan-custom-hero__tab-box {
        background: var(--myan-surface);
    }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .myan-custom-hero__tab:hover .myan-custom-hero__tab-arrow {
        transform: translateX(4px);
    }
}
@media (prefers-reduced-motion: reduce) {
    .myan-custom-hero__tab-box,
    .myan-custom-hero__tab-arrow {
        transition: none;
    }
}

/* 850–1099 (§10): vẫn 2 cột, cột chữ hẹp lại, H1 52px */
@media (min-width: 850px) and (max-width: 1099px) {
    .myan-custom-hero__body {
        padding: 48px 32px 48px 40px;
    }
    .myan-custom-hero .myan-custom-hero__title {
        font-size: 37px; /* cỡ cũ 52 ×0.72 */
    }
}

/* ≤849: xếp dọc (ảnh trên, chữ dưới); H1 = token mobile 38px */
@media (max-width: 849px) {
    .myan-custom-hero {
        flex-direction: column;
    }
    .myan-custom-hero__media {
        flex: 0 0 auto;
        min-height: 380px;
    }
    .myan-custom-hero .myan-custom-hero__inset {
        width: 110px;
        height: 140px;
    }
    .myan-custom-hero__body {
        flex: 0 0 auto;
        padding: 24px 20px 28px;
    }
    .myan-custom-hero .myan-custom-hero__lead {
        font-size: 16px;
    }
    .myan-custom-hero .myan-custom-hero__tabs {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* =====================================================================================================
   Custom section — element myan_custom_section (ux-elements/myan-custom-section.php, spec §0, §2–§6)
   Nền tràn hết bề ngang; nội dung tự bọc container 1360 + lề (page-blank không có .row Flatsome).
   Biến màu cục bộ --myan-custom-heading / -text / -sub: element con đọc → nền ink tự đổi sang chữ sáng.
   Cỡ chữ: chữ thân = --myan-fs-body (17), 13px = --myan-fs-caption; 18 / 15px không có token → viết cục bộ (spec §0).
   ===================================================================================================== */
.myan-custom-section {
    --myan-custom-heading: var(--myan-ink);
    --myan-custom-text: var(--myan-text);
    --myan-custom-sub: var(--myan-muted);
    background: var(--myan-bg);
    color: var(--myan-custom-text);
    font-family: var(--myan-sans);
}
.myan-custom-section--muted {
    --myan-input-border: var(--myan-muted);
    background: var(--myan-subtle);
}
.myan-custom-section--ink {
    --myan-custom-heading: var(--myan-bg);
    --myan-custom-text: var(--myan-bg);
    --myan-custom-sub: var(--myan-line);
    --myan-focus: var(--myan-bg);
    background: var(--myan-ink);
}
/* Nền burgundy (brand-2026.md §2): chữ ivory, nút ivory chữ ink (khối link + nút ở cuối phần Custom atelier) */
.myan-custom-section--accent {
    --myan-custom-heading: var(--myan-bg);
    --myan-custom-text: var(--myan-bg);
    --myan-custom-sub: var(--myan-bg);
    --myan-focus: var(--myan-bg);
    background: var(--myan-accent);
}
.myan-custom-section__inner {
    max-width: var(--myan-container-max);
    margin-inline: auto;
    padding-inline: var(--myan-gutter);
    box-sizing: border-box;
}
.myan-custom-section--pt-l { padding-top: 104px; }
.myan-custom-section--pb-l { padding-bottom: 104px; }
.myan-custom-section--pt-m { padding-top: 88px; }
.myan-custom-section--pb-m { padding-bottom: 88px; }
.myan-custom-section--pt-0 { padding-top: 0; }
.myan-custom-section--pb-0 { padding-bottom: 0; }

/* Chặn margin / list mặc định của Flatsome — chỉ trong các khối .myan-custom-* */
:is(.myan-custom-intro, .myan-custom-list, .myan-custom-steps, .myan-custom-cta) :is(h2, h3, h4, p, ul, ol, li, figure, figcaption),
:is(.myan-custom-projects, .myan-custom-atelier),
:is(.myan-custom-projects, .myan-custom-atelier) :is(p, li, figure, figcaption) {
    margin: 0;
    padding: 0;
}
:is(.myan-custom-list, .myan-custom-steps) :is(ul, ol),
ul:is(.myan-custom-projects, .myan-custom-atelier) {
    list-style: none;
}

/* =====================================================================================================
   Custom intro — element myan_custom_intro (ux-elements/myan-custom-intro.php, spec §2)
   ===================================================================================================== */
.myan-custom-intro {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 760px;
    margin-bottom: 44px;
}
.myan-custom-intro .myan-custom-intro__title {
    color: var(--myan-custom-heading);
}
.myan-custom-intro .myan-custom-intro__text {
    font-size: var(--myan-fs-body);
    line-height: var(--myan-lh-body);
    color: var(--myan-custom-text);
}
.myan-custom-intro .myan-custom-intro__note {
    font-size: var(--myan-fs-body);
    line-height: 1.6;
    font-style: italic;
    color: var(--myan-custom-heading);
}

/* Intro có ảnh (§3, Bước 3): chữ trái + 2 ảnh 3:4 phải. ≥1100 flex wrap basis 380 (spec); 850–1099 luôn 2 bên; ≤849 dọc.
   Khung ảnh không bo góc — như ảnh hero / thẻ sản phẩm (thiết kế không bo ảnh). */
.myan-custom-intro--media {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 56px;
    max-width: none;
    margin-bottom: 36px;
}
.myan-custom-intro__body {
    flex: 1 1 380px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.myan-custom-intro__media {
    flex: 1 1 380px;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: start;
}
.myan-custom-intro .myan-custom-intro__fig {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--myan-tone-4);
}
/* Ảnh 2 lệch xuống (mobile 24px — giữ tỷ lệ lệch so với bề rộng ảnh) */
.myan-custom-intro .myan-custom-intro__fig:nth-child(2) {
    margin-top: 40px;
}
.myan-custom-intro .myan-custom-intro__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    transition: none; /* Flatsome: img { transition: opacity 1s } */
}
.myan-custom-intro .myan-custom-intro__chip {
    position: absolute;
    z-index: 1;
    left: 0;
    bottom: 0;
    margin: 8px;
    padding: 3px 7px;
    font-size: var(--myan-fs-caption);
    line-height: 1.4;
    color: var(--myan-ink);
    background: var(--myan-card-label-bg);
}

/* =====================================================================================================
   Custom list — element myan_custom_list + myan_custom_list_item (ux-elements/myan-custom-list.php, spec §2)
   2 cột theo chiều dọc bằng CSS multi-column (trình duyệt tự chia: 8 → 4/4, 7 → 4/3) — không đếm mục bằng PHP.
   Bỏ viền dòng cuối mỗi cột: mỗi dòng có viền TRÊN; clip-path cắt 1px trên cùng của <ul> (viền dòng đầu của CẢ HAI cột,
   vì cột nào cũng bắt đầu cùng độ cao) + margin-top -1px để chữ giữ đúng vị trí. Không dùng margin âm trên từng dòng:
   trình duyệt bỏ margin của dòng đầu cột sau chỗ ngắt cột → viền cột 2 sẽ lộ.
   ===================================================================================================== */
.myan-custom-list .myan-custom-list__title {
    margin-bottom: 8px;
    font-family: var(--myan-sans);
    font-size: 18px; /* H3 nhỏ của trang (spec §2) — chưa có token */
    line-height: 1.4;
    font-weight: 600;
    color: var(--myan-custom-heading);
}
.myan-custom-list .myan-custom-list__text {
    margin-bottom: 18px;
    font-size: var(--myan-fs-body);
    line-height: 1.6;
    color: var(--myan-custom-text);
}
/* Thẻ nền sáng: đặt lại biến màu (đúng cả khi section nền ink) */
.myan-custom-list__card {
    --myan-custom-heading: var(--myan-ink);
    --myan-custom-text: var(--myan-text);
    padding: 8px 28px;
    background: var(--myan-surface);
    border: 1px solid var(--myan-line);
    border-radius: var(--myan-radius);
}
.myan-custom-list .myan-custom-list__items {
    columns: 2;
    column-gap: 32px;
    margin-top: -1px;
    clip-path: inset(1px 0 0 0);
}
.myan-custom-list .myan-custom-list__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--myan-subtle);
    break-inside: avoid;
    font-size: var(--myan-fs-body);
    line-height: 1.5;
    color: var(--myan-custom-heading);
}
/* Khung UX Builder: mỗi dòng nằm trong lớp bọc .uxb-wrapper → lớp bọc cũng không được tách giữa 2 cột */
.ux-builder-iframe .myan-custom-list__items > .uxb-wrapper {
    break-inside: avoid;
}
.myan-custom-list__dot {
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--myan-line-strong);
}
.myan-custom-list .myan-custom-list__note {
    margin-top: 14px;
    font-size: var(--myan-fs-body);
    line-height: 1.6;
    font-style: italic;
    color: var(--myan-custom-text);
}

/* =====================================================================================================
   Custom steps — element myan_custom_steps + myan_custom_step (ux-elements/myan-custom-steps.php)
   Kiểu card (spec §2, §10): 5 cột ≥1100 · 3 cột 850–1099 · 1 cột ≤849. Kiểu timeline (§3): ngang ≥1100 · dọc ≤1099.
   ===================================================================================================== */
.myan-custom-steps {
    margin-top: 44px;
}
/* Ngay sau intro (§3): khoảng cách = margin-bottom của intro (36), không gộp thành 44. Builder bọc riêng → lệch 8px, chấp nhận. */
.myan-custom-intro + .myan-custom-steps {
    margin-top: 0;
}
.myan-custom-steps .myan-custom-steps__title {
    margin-bottom: 16px;
    font-family: var(--myan-sans);
    font-size: 18px; /* như tiêu đề list (spec §2) */
    line-height: 1.4;
    font-weight: 600;
    color: var(--myan-custom-heading);
}
.myan-custom-steps--card .myan-custom-steps__list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}
.myan-custom-steps--card .myan-custom-step {
    --myan-custom-heading: var(--myan-ink);
    --myan-custom-text: var(--myan-text);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
    background: var(--myan-surface);
    border: 1px solid var(--myan-line);
    border-radius: var(--myan-radius);
}
/* Số bước: CSS counter (01, 02…) — không đánh số bằng PHP; ô "Số" ghi đè → --manual in chữ, tắt counter */
.myan-custom-steps__list {
    counter-reset: myan-custom-step;
}
.myan-custom-step {
    counter-increment: myan-custom-step;
}
.myan-custom-step__num:not(.myan-custom-step__num--manual)::before {
    content: counter(myan-custom-step, decimal-leading-zero);
}
.myan-custom-step__num {
    font-size: var(--myan-fs-caption);
    line-height: 1.4;
    font-weight: 600;
    color: var(--myan-link);
}
.myan-custom-steps .myan-custom-step__title {
    font-family: var(--myan-sans);
    font-size: var(--myan-fs-body);
    line-height: 1.4;
    font-weight: 600;
    color: var(--myan-ink);
}
.myan-custom-steps .myan-custom-step__text {
    font-size: 15px; /* mô tả bước (spec §2) — chưa có token */
    line-height: 1.5;
    color: var(--myan-text);
}

/* Kiểu timeline (§3, §10): ≥1100 ngang 5 cột, vạch trên; ≤1099 dọc 1 cột, vạch trái (media query cuối file).
   Vạch nằm trên <ol> → đứng yên khi các bước hiện lần lượt; chấm = li::before (số bước vẫn là counter ở span). */
.myan-custom-steps--timeline .myan-custom-steps__list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid var(--myan-ink);
}
.myan-custom-steps--timeline .myan-custom-step {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 26px 18px 0 0;
}
.myan-custom-steps--timeline .myan-custom-step::before {
    content: "";
    position: absolute;
    left: 0;
    top: -6px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--myan-brand);
}

/* =====================================================================================================
   Custom CTA — element myan_custom_cta (ux-elements/myan-custom-cta.php, spec §2, §3)
   Dùng lại .myan-btn--primary; cỡ theo spec: cao 52, ngang 24, gap 10, mũi tên 16px.
   ===================================================================================================== */
.myan-custom-cta {
    margin-top: 28px;
}
/* Sau timeline (§3): 32. Builder bọc riêng → 28, chấp nhận. */
.myan-custom-steps--timeline + .myan-custom-cta {
    margin-top: 32px;
}
.myan-custom-cta .myan-custom-cta__btn {
    height: 52px;
    min-height: 52px;
    padding: 0 24px;
    gap: 10px;
}
/* Focus bàn phím (Bước 8a): outline của .myan-btn chỉ khai báo trong .myan-button; Flatsome a:focus { outline: none } → khai báo lại */
.myan-custom-cta .myan-custom-cta__btn:focus-visible {
    outline: 2px solid var(--myan-focus);
    outline-offset: 3px;
}
.myan-custom-cta__icon {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    transition: transform var(--myan-dur-hover) var(--myan-ease);
}
@media (hover: hover) and (pointer: fine) {
    .myan-custom-cta .myan-custom-cta__btn:hover {
        background: var(--myan-ink);
        border-color: var(--myan-ink);
        color: var(--myan-surface);
    }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .myan-custom-cta__btn:hover .myan-custom-cta__icon {
        transform: translateX(4px);
    }
}
@media (prefers-reduced-motion: reduce) {
    .myan-custom-cta__icon {
        transition: none;
    }
}

/* =====================================================================================================
   Intro trước lưới Projects / Atelier (§4, §5, Bước 4) — CSS theo ngữ cảnh, không thêm tùy chọn:
   tiêu đề → đoạn 10, đoạn → lưới 28 (mọi khổ). Builder bọc riêng từng khối → rơi về 14 / 44 (chỉ lệch trong builder).
   Nền ink / accent: đoạn intro = chữ phụ (--myan-custom-sub); intro Atelier đoạn tối đa 600.
   ===================================================================================================== */
.myan-custom-intro:has(+ :is(.myan-custom-projects, .myan-custom-atelier)) {
    gap: 10px;
    margin-bottom: 28px;
}
.myan-custom-intro:has(+ .myan-custom-atelier) .myan-custom-intro__text {
    max-width: 600px;
}
:is(.myan-custom-section--ink, .myan-custom-section--accent) .myan-custom-intro .myan-custom-intro__text {
    color: var(--myan-custom-sub);
}

/* =====================================================================================================
   Custom projects — element myan_custom_projects + myan_custom_project (ux-elements/myan-custom-projects.php, §4)
   Lưới 4 / 2 / 2 cột (≥1100 / 850–1099 / ≤849), gap 16 (mobile 20 / 12). Chọn Bride story → cả thẻ là 1 <a>.
   Khung ảnh 3:4 không bo góc (như Bước 3); figure dùng grid (không flex column — lỗi aspect-ratio Bước 3).
   ===================================================================================================== */
.myan-custom-projects {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.myan-custom-projects .myan-custom-project__card {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}
.myan-custom-projects .myan-custom-project__fig {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 10px;
}
:is(.myan-custom-project__frame, .myan-custom-atelier__frame) {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--myan-tone-4);
}
:is(.myan-custom-project__frame, .myan-custom-atelier__frame) :is(.myan-custom-project__img, .myan-custom-atelier__img) {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    transition: none; /* Flatsome: img { transition: opacity 1s } */
}
.myan-custom-projects .myan-custom-project__cap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.myan-custom-project__name {
    font-size: 15px; /* spec §4 — chưa có token */
    line-height: 1.4;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--myan-ink);
}
.myan-custom-project__country {
    font-size: 14px; /* spec §4 — chưa có token */
    line-height: 1.45;
    color: var(--myan-muted);
}
.myan-custom-project__note {
    margin-top: 4px;
    font-size: 14px;
    line-height: 1.45;
    font-style: italic;
    color: var(--myan-text);
}
/* Cảnh báo chỉ in trong UX Builder (Bride story chưa đồng ý dùng ảnh / chưa đăng) */
.myan-custom-projects .myan-custom-project__warn {
    margin-top: 8px;
    padding: 6px 8px;
    border: 1px solid var(--myan-error);
    background: var(--myan-error-bg);
    font-size: var(--myan-fs-caption);
    line-height: 1.4;
    color: var(--myan-error);
}
/* Thẻ có link: focus-visible viền 2px (Flatsome a:focus { outline: none } chặn outline chung của site → khai báo lại) */
.myan-custom-projects .myan-custom-project__card--link:focus-visible {
    outline: 2px solid var(--myan-focus);
    outline-offset: 3px;
}
/* Hover ảnh phóng nhẹ (chỉ chuột, tắt khi reduced-motion) */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .myan-custom-project__card--link .myan-custom-project__img {
        transition: transform var(--myan-dur-hover) var(--myan-ease);
    }
    .myan-custom-project__card--link:hover .myan-custom-project__img {
        transform: scale(1.03);
    }
}

/* =====================================================================================================
   Custom atelier — element myan_custom_atelier + myan_custom_atelier_item (ux-elements/myan-custom-atelier.php, §5)
   Trong myan_custom_section bg="ink". Lưới 4 / 2 / 2 cột, gap 12; chú thích 14px chữ phụ (--myan-custom-sub).
   ===================================================================================================== */
.myan-custom-atelier {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.myan-custom-atelier .myan-custom-atelier__fig {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 8px;
}
.myan-custom-atelier .myan-custom-atelier__cap {
    font-size: 14px; /* spec §5 — chưa có token */
    line-height: 1.45;
    color: var(--myan-custom-sub);
}

/* Link "… →" (element myan_link) trong section trang Custom: cách khối trên 28 (§5) nếu không chọn khoảng cách riêng */
.myan-custom-section .myan-link:not([class*="myan-mt-"]) {
    margin-top: 28px;
}
/* Nền ink / accent: chữ ivory, hover --myan-line (≥ 10:1), gạch chân offset 4px (§5);
   focus-visible: --myan-focus đã đặt lại = --myan-bg theo section */
:is(.myan-custom-section--ink, .myan-custom-section--accent) .myan-link-arrow,
:is(.myan-custom-section--ink, .myan-custom-section--accent) .myan-link-arrow:hover {
    color: var(--myan-bg);
}
@media (hover: hover) and (pointer: fine) {
    :is(.myan-custom-section--ink, .myan-custom-section--accent) .myan-link-arrow:hover {
        color: var(--myan-line);
    }
}
:is(.myan-custom-section--ink, .myan-custom-section--accent) .myan-link-arrow__text {
    text-underline-offset: 4px;
}
/* Flatsome a:focus { outline: none } (0,1,1) thắng outline chung :where(a…):focus-visible (0,1,0) → khai báo lại đủ */
:is(.myan-custom-section--ink, .myan-custom-section--accent) .myan-link-arrow:focus-visible {
    outline: 2px solid var(--myan-focus);
    outline-offset: 3px;
}
/* Chữ của element con trên nền accent (bước, thẻ project, FAQ…) → ivory, trừ thẻ nền sáng; chấm timeline cũng ivory */
html .myan-custom-section--accent :is(h1, h2, h3, h4, h5, h6, p, summary, summary span, figcaption, figcaption span, .myan-eyebrow):not(.myan-custom-list__card *, .myan-custom-steps--card *) {
    color: var(--myan-bg);
}
html .myan-custom-section--accent a:not(.myan-btn):not(.myan-custom-list__card *, .myan-custom-steps--card *) {
    color: var(--myan-bg);
}
.myan-custom-section--accent .myan-custom-steps--timeline .myan-custom-step::before {
    background: var(--myan-bg);
}
/* Nút trên nền accent: nền ivory, chữ ink */
html .myan-custom-section--accent .myan-btn:not(.myan-custom-list__card *, .myan-custom-steps--card *) {
    background: var(--myan-bg);
    border-color: var(--myan-bg);
    color: var(--myan-ink);
}
@media (hover: hover) and (pointer: fine) {
    html .myan-custom-section--accent .myan-btn:not(.myan-custom-list__card *, .myan-custom-steps--card *):hover {
        background: var(--myan-line);
        border-color: var(--myan-line);
        color: var(--myan-ink);
    }
}

/* =====================================================================================================
   Custom bar — element myan_custom_bar (ux-elements/myan-custom-bar.php, spec §7) — thanh CTA dính chỉ ≤849
   position: fixed (sticky không chạy: Flatsome overflow-x: hidden trên html + body), ngay trên bottom nav.
   Cao cố định 69px = viền 1 + 10 + nút 48 + 10 (chữ tối đa 2 dòng = 38px < 48) → --myan-custom-bar-h đo bằng CSS, không JS.
   Body chừa đáy = bnav + thanh. Ẩn khi đang gõ (html.myan-typing, như bottom nav) và khi drawer / Dock / hộp thoại
   khóa cuộn (html.myan-lock — myanUI.lock). Launcher Dock ẩn khi có thanh: khối "Contact Dock" (myan.css, Bước 6a).
   --myan-custom-bar-h còn dùng đặt nút Wishlist nổi + toast ngay trên thanh (cuối khối ≤849 bên dưới).
   ===================================================================================================== */
.myan-custom-bar {
    display: none;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
    margin: 0;
    padding: 10px 16px;
    border-top: 1px solid var(--myan-line);
    background: var(--myan-surface);
    font-family: var(--myan-sans);
}
html .myan-custom-bar__text {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.35;
    color: var(--myan-ink);
    /* tối đa 2 dòng → chiều cao thanh không đổi */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}
html .myan-custom-bar .myan-custom-bar__btn {
    flex: 0 0 auto;
    height: 48px;
    min-height: 48px;
    padding: 0 18px;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}
/* Flatsome a:focus { outline: none } (0,1,1) → khai báo lại */
.myan-custom-bar .myan-custom-bar__btn:focus-visible {
    outline: 2px solid var(--myan-focus);
    outline-offset: 2px;
}
.myan-custom-bar__note {
    display: none;
}
@media (max-width: 849px) {
    body.myan-has-custom-bar {
        --myan-custom-bar-h: calc(69px + env(safe-area-inset-bottom, 0px)); /* không có bnav: thanh ở đáy, tự lo safe-area */
        padding-bottom: var(--myan-custom-bar-h);
    }
    body.myan-has-bnav.myan-has-custom-bar {
        --myan-custom-bar-h: 69px; /* safe-area do bottom nav lo */
        padding-bottom: calc(var(--myan-bnav-total) + var(--myan-custom-bar-h));
    }
    .myan-custom-bar {
        display: flex;
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: var(--myan-z-custom-bar);
        height: var(--myan-custom-bar-h, 69px);
        padding: 10px calc(16px + env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px))
            calc(16px + env(safe-area-inset-left, 0px));
    }
    body.myan-has-bnav .myan-custom-bar {
        bottom: var(--myan-bnav-total);
        padding-bottom: 10px;
    }
    html.myan-typing .myan-custom-bar {
        display: none;
    }
    html.myan-lock .myan-custom-bar {
        visibility: hidden;
    }
    /* Nút Wishlist nổi + toast (custom-design §8.4, Quyết định Bước 0 mục 11D): launcher ẩn trên trang này (khối Contact
       Dock) → nút nằm ngay trên thanh (bnav + thanh + 12); toast đáy ngang nút, bên trái (right 76 = 20 + 44 + 12). */
    html body.myan-has-custom-bar .myan-dock .myan-dock__wish,
    html body.myan-has-custom-bar .myan-toast {
        bottom: calc(var(--myan-custom-bar-h, 0px) + 12px);
    }
    html body.myan-has-bnav.myan-has-custom-bar .myan-dock .myan-dock__wish,
    html body.myan-has-bnav.myan-has-custom-bar .myan-toast {
        bottom: calc(var(--myan-bnav-total) + var(--myan-custom-bar-h, 0px) + 12px);
    }
}
/* UX Builder: hiện tĩnh ở mọi bề rộng để sửa được + dòng ghi chú cho người soạn */
.ux-builder-iframe .myan-custom-bar {
    display: flex;
    position: static;
    height: auto;
    padding: 10px 16px;
}
.ux-builder-iframe .myan-custom-bar__note {
    display: block;
    margin: 0;
    padding: 24px var(--myan-gutter) 8px;
    font-family: var(--myan-sans);
    font-size: var(--myan-fs-caption);
    line-height: 1.5;
    color: var(--myan-muted);
}

/* Lưới cha–con trong khung UX Builder (.myan-custom-grid): quy tắc nằm ở myan.css (dùng chung trang Custom + Real Brides). */

/* ---------- Trang Custom: 850–1099 (§10) ---------- */
@media (min-width: 850px) and (max-width: 1099px) {
    .myan-custom-steps--card .myan-custom-steps__list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    /* Intro có ảnh: luôn 2 bên (wrap tự nhiên chỉ xuống hàng ở ~850–895 → ảnh to, bố cục nhảy) */
    .myan-custom-intro--media {
        flex-wrap: nowrap;
        gap: 40px;
    }
    .myan-custom-intro__body,
    .myan-custom-intro__media {
        flex: 1 1 0;
    }
    /* Projects / Atelier: 2 cột (4 mục → 2 + 2, §10) */
    .myan-custom-projects,
    .myan-custom-atelier {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---------- Trang Custom: ≤1099 — timeline dọc 1 cột (§10) ---------- */
@media (max-width: 1099px) {
    .myan-custom-steps--timeline .myan-custom-steps__list {
        grid-template-columns: minmax(0, 1fr);
        max-width: 760px;
        border-top: 0;
        border-left: 1px solid var(--myan-ink);
    }
    .myan-custom-steps--timeline .myan-custom-step {
        padding: 0 0 24px 22px;
    }
    .myan-custom-steps--timeline .myan-custom-step::before {
        left: -6px;
        top: 3px;
    }
    /* Bước cuối: vạch dừng ở chữ cuối, CTA cách đúng 32. Builder: mỗi li là con duy nhất của .uxb-wrapper → xét wrapper cuối. */
    .myan-custom-steps--timeline .myan-custom-steps__list > .myan-custom-step:last-child,
    .ux-builder-iframe .myan-custom-steps--timeline .myan-custom-steps__list > .uxb-wrapper:last-child > .myan-custom-step {
        padding-bottom: 0;
    }
}

/* ---------- Trang Custom: ≤849 ---------- */
@media (max-width: 849px) {
    .myan-custom-section--pt-l,
    .myan-custom-section--pt-m { padding-top: 48px; }
    .myan-custom-section--pb-l,
    .myan-custom-section--pb-m { padding-bottom: 48px; }

    .myan-custom-intro {
        margin-bottom: 32px;
    }
    /* Grid 1 cột, không dùng flex column: Chrome tính chiều cao lưới ảnh aspect-ratio trong flex column = 0 → ảnh đè timeline */
    .myan-custom-intro--media {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }
    .myan-custom-intro .myan-custom-intro__fig:nth-child(2) {
        margin-top: 24px;
    }
    .myan-custom-list__card {
        padding: 4px 18px;
    }
    .myan-custom-list .myan-custom-list__items {
        columns: 1;
    }
    .myan-custom-steps {
        margin-top: 32px;
    }
    .myan-custom-steps--card .myan-custom-steps__list {
        grid-template-columns: minmax(0, 1fr);
    }
    /* Projects / Atelier: 2 cột; Projects gap 20 / 12 (§4) */
    .myan-custom-projects,
    .myan-custom-atelier {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .myan-custom-projects {
        gap: 20px 12px;
    }
}
