/* #################################################
    Index(Home) Page Custom StyleSheet
#################################################### */
/*
    Uniform design homepage. The tokens, buttons, cards, tags, header and
    footer live in layouts/app.css; this file only holds the sections that are
    specific to the home page. Every class starts with `cc-`.
    Breakpoints: 1024px (tablet), 640px (phone). No italics anywhere.
*/

/* the `hidden` attribute must win over the display rules below */
.cc-home [hidden] { display: none !important; }
.cc-nowrap { white-space: nowrap; }

/* ======== Hero ======== */
    .cc-hero { padding: var(--section) 0; background: var(--cream); }
    .cc-hero-inner {
        max-width: 820px;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .cc-hero-lede {
        max-width: 680px;
        margin-bottom: 28px;
        text-wrap: balance;
        font-size: 17px;
        line-height: 1.6;
        color: var(--muted);
    }
    .cc-h1 {
        text-wrap: balance;
        margin-bottom: 20px;
        font-family: var(--serif);
        font-weight: 400;
        font-size: 64px;
        line-height: 1.02;
        letter-spacing: -0.02em;
        color: var(--navy);
    }
    .cc-h1 em { color: var(--mint-deep); }

    /* latest news alert: one line above the headline */
    .cc-alert {
        max-width: 100%;
        margin-bottom: 28px;
        padding: 6px 6px 6px 14px;
        display: inline-flex;
        align-items: center;
        gap: 12px;
        border: 1px solid var(--border);
        border-radius: 999px;
        background: var(--white);
        font-size: 14px;
        color: var(--navy);
        transition: border-color 0.15s;
    }
    .cc-alert:hover { border-color: var(--navy); }
    .cc-alert-label {
        display: inline-flex;
        flex-shrink: 0;
        align-items: center;
        gap: 7px;
        font-size: 12px;
        font-weight: 500;
        color: var(--mint-deep);
    }
    .cc-alert-label::before {
        content: "";
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--mint-deep);
        animation: cc-blink 2s ease infinite;
    }
    @keyframes cc-blink { 50% { opacity: 0.3; } }
    .cc-alert-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .cc-alert-read {
        flex-shrink: 0;
        display: inline-flex;
        align-items: center;
        gap: 5px;
        height: 30px;
        padding: 0 12px;
        border-radius: 999px;
        background: var(--navy);
        color: var(--white);
        font-size: 13px;
        font-weight: 500;
    }

    /* search card */
    .cc-hero .cc-search { width: 100%; max-width: 760px; text-align: left; }
    .cc-search { max-width: 640px; padding: 24px; }
    .cc-search-tabs { margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
    .cc-search-tab {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        height: 34px;
        padding: 0 14px;
        border: 1px solid transparent;
        border-radius: 999px;
        background: var(--cream);
        color: var(--muted);
        font-size: 13px;
        cursor: pointer;
        transition: background 0.15s, color 0.15s, border-color 0.15s;
    }
    .cc-search-tab i { font-size: 15px; }
    .cc-search-tab:hover { color: var(--navy); border-color: var(--border); }
    .cc-search-tab.active { background: var(--navy); color: var(--white); }
    .cc-search-tab.auto { box-shadow: 0 0 0 3px var(--mint-soft); }
    .cc-search-row { position: relative; display: flex; gap: 10px; }
    .cc-search-field { position: relative; flex: 1 1 0%; min-width: 0; }
    .cc-field-icon {
        position: absolute;
        left: 15px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 18px;
        color: var(--muted-2);
        pointer-events: none;
    }
    .cc-search-input {
        width: 100%;
        height: 48px;
        padding: 0 42px 0 44px;
        border: 1px solid transparent;
        border-radius: var(--r-btn);
        background: var(--cream);
        font-size: 15px;
        color: var(--text);
        outline: none;
        transition: border-color 0.15s, background 0.15s;
    }
    .cc-search-input:focus { border-color: var(--navy); background: var(--white); }
    .cc-search-input::placeholder { color: var(--muted-2); }
    .cc-clear {
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        width: 30px;
        height: 30px;
        display: grid;
        place-items: center;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: var(--muted);
        font-size: 16px;
        cursor: pointer;
    }
    .cc-clear:hover { background: var(--border); color: var(--navy); }
    .cc-detect { margin-top: 10px; display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--mint-deep); }
    .cc-detect i { font-size: 15px; }

/* ======== Three habits ======== */
    .cc-head.tight { margin-bottom: 20px; }
    .cc-habits-note {
        margin-bottom: 32px;
        padding: 16px 20px;
        display: flex;
        gap: 12px;
        align-items: center;
        border-radius: var(--r-card);
        background: var(--red-soft);
        font-size: 14px;
        color: var(--navy);
    }
    .cc-habits-note i { font-size: 22px; color: var(--red); }
    .cc-habits-note strong { font-weight: 600; color: var(--red); }

    .cc-habits { display: grid; grid-template-columns: repeat(3, 1fr); }
    .cc-habit {
        position: relative;
        padding: 32px;
        display: flex;
        flex-direction: column;
        background: var(--white);
        transition: transform 0.25s ease, box-shadow 0.25s ease, border-radius 0.25s ease;
    }
    .cc-habit + .cc-habit { border-left: 1px solid var(--border); }
    .cc-habit:first-child { border-radius: var(--r-card) 0 0 var(--r-card); }
    .cc-habit:last-child { border-radius: 0 var(--r-card) var(--r-card) 0; }
    .cc-habit.featured { background: var(--navy); color: var(--white); border-left-color: var(--navy); }
    /* .cc-habit.featured + .cc-habit { border-left-color: var(--navy); } */
    @media (hover: hover) and (min-width: 1025px) {
        .cc-habit:hover {
            z-index: 2;
            transform: translateY(-10px) scale(1.03);
            border-radius: var(--r-card);
            box-shadow: 0 0 0 1px var(--border), 0 28px 48px -16px rgba(10, 31, 68, 0.35);
        }
        .cc-habit.featured:hover { box-shadow: 0 28px 48px -14px rgba(10, 31, 68, 0.55); }
    }
    .cc-habit-track { margin-bottom: 26px; display: flex; align-items: center; gap: 12px; }
    .cc-node {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
        display: grid;
        place-items: center;
        border-radius: 50%;
        font-family: var(--serif);
        font-size: 16px;
    }
    .cc-node.green { background: var(--mint-soft); color: var(--mint-deep); }
    .cc-node.mint { background: var(--mint); color: var(--navy); }
    .cc-node.red { background: var(--red-soft); color: var(--red); }
    .cc-step-label { font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
    .cc-habit.featured .cc-step-label { color: var(--on-navy-2); }
    .cc-rail { flex: 1 1 0%; height: 1px; background: var(--border); }
    .cc-habit.featured .cc-rail { background: var(--navy-line); }
    .cc-verb {
        font-family: var(--serif);
        font-weight: 400;
        font-size: 56px;
        line-height: 1;
        letter-spacing: -0.02em;
        color: var(--navy);
    }
    .cc-habit.featured .cc-verb { color: var(--white); }
    .cc-habit:nth-child(1) .cc-verb i { color: var(--mint-deep); }
    .cc-habit:nth-child(2) .cc-verb i { color: var(--mint); }
    .cc-habit:nth-child(3) .cc-verb i { color: var(--red); }
    .cc-ask { margin: 14px 0 10px; font-family: var(--serif); font-size: 18px; line-height: 1.4; color: var(--navy); }
    .cc-habit.featured .cc-ask { color: var(--mint); }
    .cc-habit-body { margin-bottom: 22px; font-size: 14px; color: var(--muted); }
    .cc-habit.featured .cc-habit-body { color: var(--on-navy); }
    .cc-habit ul { margin-bottom: 26px; display: grid; gap: 10px; list-style: none; }
    .cc-habit li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--navy); }
    .cc-habit.featured li { color: var(--white); }
    .cc-habit li i {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
        display: grid;
        place-items: center;
        border-radius: 6px;
        font-size: 14px;
    }
    .cc-habit:nth-child(1) li i { background: var(--amber-soft); color: var(--amber); }
    .cc-habit:nth-child(2) li i { background: var(--navy-2); color: var(--mint); }
    .cc-habit:nth-child(3) li i { background: var(--red-soft); color: var(--red); }
    .cc-habit .cc-link {
        margin-top: auto;
        padding-top: 18px;
        width: 100%;
        justify-content: space-between;
        border-top: 1px solid var(--border);
    }
    .cc-habit.featured .cc-link { color: var(--mint); border-top-color: var(--navy-line); }

/* ======== Entity check ======== */
    .cc-split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
    .cc-split.reverse { grid-template-columns: 1.05fr 1fr; }
    .cc-split .cc-lede { max-width: 460px; margin: 16px 0 28px; }
    .cc-entity-example { position: relative; }
    .cc-example-label {
        position: absolute;
        top: -11px;
        left: 20px;
        z-index: 1;
        padding: 3px 10px;
        border-radius: 999px;
        background: var(--navy);
        color: var(--mint);
        font-size: 11px;
        font-weight: 500;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }
    .cc-entity { overflow: hidden; box-shadow: 0 18px 40px -28px rgba(10, 31, 68, 0.35); }
    .cc-entity-head {
        padding: 24px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 16px;
        border-bottom: 1px solid var(--border);
    }
    .cc-entity-id { display: flex; gap: 14px; align-items: center; min-width: 0; }
    .cc-avatar {
        width: 48px;
        height: 48px;
        flex-shrink: 0;
        display: grid;
        place-items: center;
        border-radius: 12px;
        background: var(--navy);
        color: var(--mint);
        font-family: var(--serif);
        font-size: 16px;
    }
    .cc-entity-name { min-width: 0; font-size: 16px; color: var(--navy); overflow-wrap: anywhere; }
    .cc-entity-body { padding: 24px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 24px; }
    .cc-label { margin-bottom: 5px; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
    .cc-value { font-size: 15px; font-weight: 500; color: var(--navy); overflow-wrap: anywhere; }
    .cc-entity-foot {
        padding: 14px 24px;
        display: flex;
        align-items: center;
        gap: 8px;
        border-top: 1px solid var(--border);
        background: var(--cream);
        font-size: 13px;
        color: var(--muted);
    }
    .cc-entity-foot i { font-size: 16px; color: var(--mint-deep); }
    .cc-outcomes { margin-bottom: 30px; display: grid; gap: 14px; list-style: none; }
    .cc-outcomes li {
        display: grid;
        grid-template-columns: 120px 1fr;
        gap: 14px;
        align-items: baseline;
        font-size: 14px;
        line-height: 1.55;
        color: var(--muted);
    }
    .cc-outcomes .cc-tag { justify-self: start; }

/* ======== Stay alert (latest news) ======== */
    .cc-news { display: grid; grid-template-columns: 1.15fr 1fr; gap: 28px; }
    .cc-news-feature { padding: 32px; display: flex; flex-direction: column; transition: border-color 0.15s; }
    .cc-news-feature:hover { border-color: var(--navy); }
    .cc-news-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
    .cc-news-feature h3 {
        margin: 18px 0 12px;
        font-family: var(--serif);
        font-weight: 400;
        font-size: 28px;
        line-height: 1.2;
        letter-spacing: -0.01em;
        color: var(--navy);
    }
    .cc-news-feature p { margin-bottom: 24px; font-size: 14px; color: var(--muted); }
    .cc-news-feature .cc-link { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }
    .cc-news-list { display: flex; flex-direction: column; }
    .cc-news-item {
        padding: 20px 0;
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 16px;
        align-items: center;
        border-top: 1px solid var(--border);
    }
    .cc-news-item:first-child { padding-top: 4px; border-top: 0; }
    .cc-news-item h3 {
        margin-top: 8px;
        font-family: var(--serif);
        font-weight: 400;
        font-size: 20px;
        line-height: 1.3;
        color: var(--navy);
        transition: color 0.15s;
    }
    .cc-news-item > i { font-size: 18px; color: var(--muted-2); transition: transform 0.15s, color 0.15s; }
    .cc-news-item:hover h3 { color: var(--mint-deep); }
    .cc-news-item:hover > i { color: var(--navy); transform: translateX(3px); }

/* ======== Signed documents ======== */
    .cc-row { display: flex; flex-wrap: wrap; gap: 22px; align-items: center; }
    .cc-benefits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; list-style: none; }
    .cc-benefits li { padding: 24px; display: flex; flex-direction: column; gap: 4px; background: var(--white); }
    .cc-benefit-icon {
        width: 44px;
        height: 44px;
        margin-bottom: 16px;
        display: grid;
        place-items: center;
        border-radius: 12px;
        background: var(--mint-soft);
        color: var(--mint-deep);
        font-size: 20px;
    }
    .cc-benefits li, .cc-benefits li * { transition: background-color .2s ease, border-color .2s ease, color .2s ease; }
    .cc-benefits li:hover { border-color: var(--navy); background: var(--navy); }
    .cc-benefits li:hover .cc-benefit-icon { background: var(--navy-2); color: var(--mint); }
    .cc-benefits li:hover b { color: var(--white); }
    .cc-benefits li:hover span:not(.cc-benefit-icon) { color: var(--on-navy); }
    .cc-benefits b { font-family: var(--serif); font-weight: 400; font-size: 20px; line-height: 1.25; color: var(--navy); }
    .cc-benefits span:not(.cc-benefit-icon) { font-size: 14px; line-height: 1.5; color: var(--muted); }

/* ======== Complaints: split panel (navy column + steps), same pattern as "Three habits" ======== */
    .cc-cp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); overflow: hidden; }
    .cc-cp-main { padding: 40px; display: flex; flex-direction: column; background: var(--navy); color: var(--white); }
    .cc-cp-main .cc-eyebrow { color: var(--mint); }
    .cc-cp-main .cc-h2 { color: var(--white); }
    .cc-cp-main .cc-h2 em { color: var(--mint); }
    .cc-cp-text { max-width: 420px; margin: 16px 0 32px; font-size: 16px; line-height: 1.6; color: var(--on-navy); }
    .cc-cp-actions {
        margin-top: auto;
        padding-top: 24px;
        display: flex;
        flex-wrap: wrap;
        gap: 24px;
        align-items: center;
        border-top: 1px solid var(--navy-line);
    }
    .cc-cp-main .cc-link { color: var(--mint); }
    .cc-cp-side { padding: 32px 40px; }
    .cc-cp-steps { list-style: none; }
    .cc-cp-steps li {
        padding: 18px 0;
        display: grid;
        grid-template-columns: 36px minmax(0, 1fr) auto;
        gap: 16px;
        align-items: start;
        border-top: 1px solid var(--border);
    }
    .cc-cp-steps li:first-child { border-top: 0; }
    .cc-cp-steps h3 { margin-bottom: 2px; font-family: var(--serif); font-weight: 400; font-size: 20px; line-height: 1.3; color: var(--navy); }
    .cc-cp-steps p { font-size: 14px; line-height: 1.55; color: var(--muted); }
    .cc-cp-steps .cc-tag { margin-top: 4px; }

/* ======== Regulators behind Consumer Care ======== */
    .cc-regs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); gap: 16px; }
    .cc-reg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
    .cc-reg { padding: 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
    .cc-reg-logo {
        width: 64px;
        height: 64px;
        margin-bottom: 6px;
        padding: 3px;
        flex-shrink: 0;
        display: block;
        overflow: hidden;
        border-radius: 50%;
        border: 1px solid var(--border);
        background: var(--white);
    }
    .cc-reg-logo img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
    .cc-reg-name { font-family: var(--serif); font-size: 20px; line-height: 1.25; color: var(--navy); }
    .cc-reg-short { display: none; }
    .cc-reg-what { font-size: 14px; line-height: 1.5; color: var(--muted); }
    .cc-reg.lead { padding: 32px; justify-content: center; gap: 12px; }
    .cc-reg.lead .cc-reg-logo { width: 96px; height: 96px; padding: 4px; }
    .cc-reg.lead .cc-reg-name { font-size: 28px; }

/* ######################
    Khmer adjustments
######################### */
    html[lang="km"] .cc-h1 { line-height: 1.35; letter-spacing: normal; }
    /* Khmer has no spaces between words: the phrase must be allowed to wrap */
    html[lang="km"] .cc-nowrap { white-space: normal; }
    html[lang="km"] .cc-verb { line-height: 1.4; letter-spacing: normal; }
    html[lang="km"] .cc-news-feature h3,
    html[lang="km"] .cc-news-item h3,
    html[lang="km"] .cc-cp-steps h3,
    html[lang="km"] .cc-benefits b,
    html[lang="km"] .cc-reg-name { line-height: 1.5; letter-spacing: normal; }
    html[lang="km"] .cc-ask { line-height: 1.6; }
    html[lang="km"] .cc-label,
    html[lang="km"] .cc-step-label,
    html[lang="km"] .cc-example-label { letter-spacing: normal; text-transform: none; }

/* ################
    Media Query
################### */
@media (max-width: 1024px) {
    .cc-h1 { font-size: 52px; }
    .cc-habits { grid-template-columns: minmax(0, 1fr); overflow: hidden; }
    .cc-habit + .cc-habit { border-left: 0; border-top: 1px solid var(--border); }
    .cc-habit:first-child, .cc-habit:last-child { border-radius: 0; }
    .cc-news, .cc-split, .cc-split.reverse { grid-template-columns: minmax(0, 1fr); }
    .cc-split.reverse > :first-child { order: 2; }
    .cc-split { gap: 36px; }
    .cc-regs { grid-template-columns: minmax(0, 1fr); }
    .cc-cp { grid-template-columns: minmax(0, 1fr); }
    .cc-cp-main { padding: 32px; }
    .cc-cp-side { padding: 24px 32px; }
}

@media (max-width: 640px) {
    /* type scale on phones */
    .cc-h1 { font-size: 38px; line-height: 1.08; }
    .cc-hero-lede { margin-bottom: 24px; font-size: 16px; }
    .cc-verb { font-size: 44px; }
    .cc-news-feature h3 { font-size: 22px; }
    .cc-news-item h3, .cc-cp-steps h3, .cc-reg-name, .cc-benefits b { font-size: 18px; }
    html[lang="km"] .cc-h1 { font-size: 34px; line-height: 1.35; }
    /* hero */
    .cc-search { padding: 20px; }
    .cc-search-tabs { display: grid; grid-template-columns: 1fr 1fr; }
    .cc-search-tab { height: 40px; justify-content: center; }
    .cc-clear { width: 36px; height: 36px; right: 6px; }
    .cc-search-row { flex-direction: column; }
    .cc-alert { margin-bottom: 20px; font-size: 13px; gap: 10px; }
    .cc-alert-read { padding: 0 10px; }
    /* one card padding on phones: 20px */
    .cc-habit { padding: 20px; }
    .cc-head.tight { margin-bottom: 16px; }
    .cc-habits-note { margin-bottom: 24px; padding: 16px; align-items: flex-start; }
    .cc-entity-head { padding: 20px; flex-direction: column; align-items: flex-start; gap: 12px; }
    .cc-entity-body { padding: 20px; gap: 16px 20px; }
    .cc-entity-foot { padding: 12px 20px; }
    .cc-news-feature { padding: 20px; }
    .cc-outcomes li { grid-template-columns: 1fr; gap: 6px; }
    /* complaints: short panel, steps as one-line rows (title + status) */
    .cc-cp-main { padding: 24px 20px; }
    .cc-cp-text { margin: 12px 0 20px; font-size: 15px; }
    .cc-cp-actions { padding-top: 20px; }
    .cc-cp-side { padding: 16px 20px 8px; }
    .cc-cp-steps li { padding: 12px 0; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
    .cc-cp-steps .cc-node { width: 32px; height: 32px; font-size: 14px; }
    .cc-cp-steps h3 { margin: 0; font-size: 16px; }
    .cc-cp-steps p { display: none; }
    .cc-cp-steps .cc-tag { margin-top: 0; }
    /* main buttons full width, text links centred under them */
    .cc-row, .cc-cp-actions { width: 100%; flex-direction: column; align-items: stretch; gap: 16px; }
    .cc-row .cc-link, .cc-cp-actions .cc-link { justify-content: center; }
    .cc-split .cc-btn.primary { width: 100%; }
    /* benefits and regulators become compact lists */
    .cc-benefits { grid-template-columns: 1fr; gap: 12px; }
    .cc-benefits li { padding: 20px; display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; row-gap: 2px; align-items: start; }
    .cc-benefit-icon { grid-row: span 2; margin-bottom: 0; }
    /* regulators: FSA as one compact row, the six regulators as a 3 x 2 grid of logo tiles */
    .cc-regs { gap: 12px; }
    .cc-reg.lead { padding: 20px; display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 14px; row-gap: 4px; align-items: center; }
    .cc-reg.lead .cc-reg-logo { grid-row: span 2; width: 64px; height: 64px; margin: 0; padding: 3px; }
    .cc-reg.lead .cc-tag { justify-self: start; }
    .cc-reg.lead .cc-reg-name { font-size: 20px; }
    .cc-reg.lead .cc-reg-what { display: none; }
    .cc-reg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
    .cc-reg:not(.lead) { padding: 16px 8px; align-items: center; gap: 8px; text-align: center; }
    .cc-reg:not(.lead) .cc-reg-logo { width: 56px; height: 56px; margin: 0; padding: 2px; }
    .cc-reg:not(.lead) .cc-reg-name, .cc-reg:not(.lead) .cc-reg-what { display: none; }
    .cc-reg-short { display: block; font-size: 12px; line-height: 1.35; color: var(--navy); }
}
