/*
 * CURADLE GLOBAL HEADING SYSTEM
 *
 * Section title:
 * .heading-line
 *
 * Post/article/card title:
 * .curadle-post-title
 */

:root {
    --curadle-font-sans: "Inter", Arial, Helvetica, sans-serif;

    --curadle-section-title-color: #171717;
    --curadle-section-title-size: clamp(28px, 2.5vw, 40px);

    /*
     * TYPOGRAPHY HIERARCHY
     * Section title = 50% Home Hero
     * Home Hero     = 100%
     * Other Hero    = 80% Home Hero
     *
     * Không gán riêng 72px / 57.6px.
     * Hero luôn được tính trực tiếp từ kích thước Section hiện tại.
     */
    --curadle-home-title-size: calc(var(--curadle-section-title-size) * 2);
    --curadle-other-hero-title-size: calc(var(--curadle-home-title-size) * .8);
    --curadle-section-title-weight: 700;
    --curadle-section-title-line-height: 1.2;

    --curadle-section-title-underline: #2e3d98;
    --curadle-section-title-gap: 14px;
    --curadle-section-heading-bottom: 36px;
    --curadle-section-subtitle-gap: 20px;

    --curadle-hero-height: 300px;

    --curadle-post-title-size: 18px;
}


/* =========================================================
   SECTION TITLE
   ========================================================= */

.heading-line {
    position: relative !important;
    display: block !important;

    width: fit-content !important;
    max-width: 100% !important;

    margin: 0 auto !important;
    padding: 0 0 var(--curadle-section-title-gap) !important;

    color: var(--curadle-section-title-color) !important;

    font-family: var(--curadle-font-sans) !important;
    font-size: var(--curadle-section-title-size) !important;
    font-weight: var(--curadle-section-title-weight) !important;
    line-height: var(--curadle-section-title-line-height) !important;

    letter-spacing: -0.02em !important;

    text-align: center !important;
    text-transform: none !important;

    white-space: normal !important;
}


.heading-line :is(a, span, strong, b) {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
}


.heading-line::after {
    content: "" !important;

    position: absolute !important;
    bottom: 0 !important;
    left: 50% !important;

    display: block !important;

    width: 42px !important;
    height: 3px !important;

    border: 0 !important;
    border-radius: 999px !important;

    background: var(--curadle-section-title-underline) !important;

    transform: translateX(-50%) !important;
}


.text-center:has(> .heading-line) {
    margin-bottom: var(--curadle-section-heading-bottom) !important;
}


.text-center:has(> .heading-line) > p {
    max-width: 720px;

    margin:
        var(--curadle-section-subtitle-gap)
        auto
        0 !important;

    color: #626262 !important;

    font-size: 15px !important;
    font-weight: 400 !important;
    line-height: 1.65 !important;

    text-align: center !important;
}


/* =========================================================
   SECTION TITLE EXCEPTIONS
   ========================================================= */

.heading-line[data-heading-role="card"]::after,
.heading-line[data-heading-role="footer"]::after,
.heading-line[data-heading-role="benefit"]::after {
    content: none !important;
    display: none !important;
}


.heading-line[data-heading-role="benefit"] {
    width: 100% !important;

    margin: 0 !important;
    padding: 0 !important;

    font-size: 30px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;

    color: #211d1a !important;

    text-align: left !important;
}


/* =========================================================
   INNER PAGE HERO
   ========================================================= */

.hero-circuit:not(.curadle-hero-slider) {
    box-sizing: border-box;

    position: relative;

    display: flex;
    align-items: center;

    width: 100%;
    min-height: var(--curadle-hero-height);

    margin: 0;
    padding: 64px 16px;

    background: #f1f3ff;

    text-align: center;
}


.hero-circuit:not(.curadle-hero-slider) > .container-page {
    width: 100%;
    max-width: 1240px;

    margin: auto;
    padding: 0;
}


.hero-circuit:not(.curadle-hero-slider) .heading-line {
    margin: 0 auto !important;
    font-size: var(--curadle-other-hero-title-size) !important;
}


.hero-circuit:not(.curadle-hero-slider) p {
    max-width: 672px;

    margin: 20px auto 0;

    font-family: var(--curadle-font-sans);

    font-size: 14px;
    font-weight: 400;
    line-height: 28px;

    color: #525252;

    text-align: center;
}


/* =========================================================
   GLOBAL POST / ARTICLE TITLE
   =========================================================
   KHÔNG phụ thuộc container.
   H2/H3 đều giống nhau.
   ========================================================= */

body:not(.wp-admin)
main
.curadle-post-title {
    display: -webkit-box !important;

    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 2 !important;

    overflow: hidden !important;
    text-overflow: ellipsis !important;

    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;

    margin: 0 !important;
    padding: 0 !important;

    font-family: var(--curadle-font-sans) !important;

    font-size: var(--curadle-post-title-size) !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;

    letter-spacing: normal !important;

    color: #171717 !important;

    text-align: left !important;
    text-transform: none !important;

    white-space: normal !important;

    /*
     * Không cho title bị bẻ giữa chữ:
     * "nghi / ệm", "chă / m"...
     */
    word-break: normal !important;
    overflow-wrap: normal !important;

    min-height: 2.8em !important;
    max-height: 2.8em !important;

    flex-shrink: 0 !important;
}


body:not(.wp-admin)
main
.curadle-post-title > a {
    font-family: inherit !important;

    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;

    letter-spacing: inherit !important;

    color: inherit !important;

    text-decoration: none !important;

    word-break: normal !important;
    overflow-wrap: normal !important;
}


/* =========================================================
   KINH NGHIỆM
   Chỉ quản lý LAYOUT.
   Typography title vẫn do .curadle-post-title quản lý.
   ========================================================= */

body:not(.wp-admin)
main
.curadle-howto-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 24px;

    width: 100%;
}


body:not(.wp-admin)
main
.curadle-howto-card {
    width: 100%;
    min-width: 0;

    overflow: hidden;

    border: 1px solid #e5e7eb;
    border-radius: 16px;

    background: #fff;
}


body:not(.wp-admin)
main
.curadle-howto-thumb {
    display: block;

    width: 100%;

    overflow: hidden;
}


body:not(.wp-admin)
main
.curadle-howto-thumb img {
    display: block;

    width: 100%;
    height: auto;

    aspect-ratio: 16 / 9;

    object-fit: cover;
}


body:not(.wp-admin)
main
.curadle-howto-body {
    min-width: 0;

    padding: 20px;
}


/*
 * Kicker vẫn xanh.
 * Đây KHÔNG phải title bài viết.
 */
body:not(.wp-admin)
main
.curadle-howto-kicker {
    margin: 0 0 12px;

    color: #2e3d98;

    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;

    text-transform: uppercase;
}


/*
 * Không khai báo:
 *
 * .curadle-howto-body h2
 * .curadle-howto-body h2 a
 *
 * để không đè .curadle-post-title.
 */


body:not(.wp-admin)
main
.curadle-howto-body > p:not(.curadle-howto-kicker) {
    margin: 14px 0 0;

    color: #626262;

    font-size: 14px;
    font-weight: 400;
    line-height: 1.65;
}


body:not(.wp-admin)
main
.curadle-howto-link {
    display: inline-flex;

    margin-top: 16px;

    color: #2e3d98;

    font-size: 13px;
    font-weight: 700;

    text-decoration: none;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    body:not(.wp-admin)
    main
    .curadle-howto-grid {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}


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

@media (max-width: 640px) {

    :root {
        --curadle-section-title-size: 24px;

        /*
         * Post title = 90% section title:
         * 24px x .9 = 21.6px
         */
        --curadle-post-title-size: 21.6px;

        --curadle-section-heading-bottom: 28px;

        --curadle-hero-height: 240px;
    }


    .heading-line[data-heading-role="benefit"] {
        font-size: clamp(14px, 3.8vw, 20px) !important;

        font-weight: 600 !important;

        line-height: 1.35 !important;
    }


    .hero-circuit:not(.curadle-hero-slider) {
        padding: 48px 16px;
    }


    /* Kinh nghiệm: mobile bắt buộc 1 cột */
    body:not(.wp-admin)
    main
    .curadle-howto-page {
        width: 100% !important;

        padding-left: 20px !important;
        padding-right: 20px !important;

        box-sizing: border-box !important;
    }


    body:not(.wp-admin)
    main
    .curadle-howto-grid {
        display: grid !important;

        grid-template-columns:
            minmax(0, 1fr) !important;

        width: 100% !important;

        gap: 24px !important;
    }


    body:not(.wp-admin)
    main
    .curadle-howto-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }


    body:not(.wp-admin)
    main
    .curadle-howto-body {
        width: 100% !important;

        min-width: 0 !important;

        box-sizing: border-box !important;
    }
}


/* =========================================================
   HOME HERO EXCEPTION
   ========================================================= */

.curadle-hero-slider
.curadle-full-banner__content h1 {
    font-family: var(--curadle-font-sans);

    color: #111;

    font-size: var(--curadle-home-title-size);
    font-weight: 700;
    line-height: 1.03;

    letter-spacing: -.045em;

    text-shadow:
        0 2px 8px rgba(255,255,255,.92);
}


.curadle-hero-slider
.curadle-hero-slide.is-product
.curadle-hero-slide-copy h1 {
    font-size: var(--curadle-other-hero-title-size);

    line-height: 1.08;

    letter-spacing: -.025em;
}


@media (max-width: 700px) {

    .curadle-hero-slider
    .curadle-full-banner__content h1 {
        font-size: var(--curadle-home-title-size);

        line-height: 1.04;
    }


    .curadle-hero-slider
    .curadle-hero-slide.is-product
    .curadle-hero-slide-copy h1 {
        font-size: var(--curadle-other-hero-title-size);

        line-height: 1.06;
    }
}