/* #################################################
    Website Application Layout Custom StyleSheet
#################################################### */
/* 
    CONSUMER CARE PLATFORM STYLESHEET DETAILS:
    ==========================================
    Aesthetic    : warm cream + deep navy + mint
    Display font : Fraunces (editorial serif)
    Body font    : Geist (modern sans)
    Khmer font   : Kantumruy Pro (glyph fallback, so Khmer text works in every font stack)

    This file holds everything shared by every page that extends
    `prototype_website.layouts.app`: tokens, the header, the footer and the
    small UI pieces (buttons, cards, tags...) of the uniform design.

    NAMING: every class of the uniform design starts with `cc-`. Do not rename
    them to generic names (`.nav`, `.logo`, `.foot-*`...): `pages/based.css`
    is loaded after this file on the inner pages and defines generic rules
    with those names, which would leak into the header and the footer.
*/

* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    /* legacy tokens, still used by the inner pages */
    --bg-cream: #F7F5F0;
    --bg-cream-2: #FAFAF6;
    --bg-card: #FFFFFF;
    --navy: #0A1F44;
    --navy-2: #15294F;
    --navy-3: #1A3358;
    --mint: #6FE7B7;
    --mint-deep: #00875F;
    --mint-deeper: #00543C;
    --mint-soft: #E8F7F0;
    --text: #1A1A1A;
    --muted: #6B6B6B;
    --muted-2: #9A9A9A;
    --border: #E0DCD2;
    --red: #C13030;
    --red-soft: #FCE8E8;
    --amber: #9A6B0A;
    --amber-soft: #FEF4E0;
    --light-blue: #C7DFF5;

    /* uniform design tokens */
    --cream: #F7F5F0;
    --white: #FFFFFF;
    --on-navy: #C7D3E6;      /* body text on navy */
    --on-navy-2: #8FA3C2;    /* small text on navy */
    --navy-line: #1F3560;    /* lines and rails on navy (pages/based.css redefines --navy-3, so do not use it here) */
    --serif: "Fraunces", "Kantumruy Pro", Georgia, serif;
    --sans: "Geist", "Kantumruy Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
    --khmer: "Kantumruy Pro", "Geist", sans-serif;
    --r-card: 16px;
    --r-btn: 12px;
    --r-tag: 6px;
    --section: 48px;
    --gutter: 36px;
}
body {
    line-height: 1.5;
    color: var(--text);
    background: var(--bg-cream);
    font-family: 'Geist', 'Kantumruy Pro', -apple-system, system-ui, sans-serif;
}
.display {
    font-family: 'Fraunces', Georgia, serif;
    letter-spacing: -0.01em;
}
a {
    color: inherit;
    text-decoration: none;
}
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
}
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 36px;
}

/* ======== Uniform Design: Base (header, footer and page content) ======== */
    .cc-header, .cc-footer, .cc-home {
        font: 15px/1.6 var(--sans);
        color: var(--text);
        -webkit-font-smoothing: antialiased;
    }
    .cc-header p, .cc-header li, .cc-footer p, .cc-footer li,
    .cc-home p, .cc-home li, .cc-home h3 { text-wrap: pretty; }
    .cc-header em, .cc-header i, .cc-footer em, .cc-footer i,
    .cc-home em, .cc-home i, .cc-home cite, .cc-home address { font-style: normal; }
    .cc-header button, .cc-home button, .cc-home input { font: inherit; }
    .cc-header img, .cc-home img { display: block; max-width: 100%; }
    .cc-header :focus-visible, .cc-home :focus-visible { outline: 2px solid var(--mint-deep); outline-offset: 2px; }
    .cc-footer :focus-visible, .cc-home .featured :focus-visible, .cc-home .cc-cp-main :focus-visible { outline-color: var(--mint); outline: 2px solid var(--mint); outline-offset: 2px; }
    /* tabler icon font: keep icons centred inside buttons, tags and links */
    .cc-header i.ti, .cc-footer i.ti, .cc-home i.ti {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }
    .cc-container {
        max-width: 1280px;
        margin: 0 auto;
        padding: 0 var(--gutter);
    }

/* ======== Uniform Design: Shared Pieces ======== */
    /* sections alternate cream and white */
    .cc-section { padding: var(--section) 0; }
    .cc-section.white { background: var(--white); }
    .cc-section.cream { background: var(--cream); }

    .cc-eyebrow {
        margin-bottom: 12px;
        font-size: 12px;
        font-weight: 500;
        line-height: 16px;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--mint-deep);
    }
    .cc-h2 {
        text-wrap: balance;
        font-family: var(--serif);
        font-weight: 400;
        font-size: 40px;
        line-height: 1.1;
        letter-spacing: -0.015em;
        color: var(--navy);
    }
    .cc-h2 em { color: var(--mint-deep); }
    .cc-lede {
        max-width: 440px;
        font-size: 16px;
        line-height: 1.6;
        color: var(--muted);
    }
    .cc-head {
        margin-bottom: 32px;
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        gap: 48px;
    }

    /* buttons: navy on light backgrounds, mint on navy; .small for the header */
    .cc-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        min-height: 48px;
        padding: 0 22px;
        border-radius: var(--r-btn);
        border: 1px solid transparent;
        font-size: 15px;
        font-weight: 500;
        line-height: 1.2;
        cursor: pointer;
        transition: background 0.15s, border-color 0.15s;
    }
    .cc-btn.primary { background: var(--navy); color: var(--white); }
    .cc-btn.primary:hover { background: var(--navy-2); }
    .cc-btn.mint { background: var(--mint); color: var(--navy); }
    .cc-btn.mint:hover { background: #5DDCA9; }
    .cc-btn.small { min-height: 38px; padding: 0 16px; font-size: 14px; }

    /* text link with arrow */
    .cc-link {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 14px;
        font-weight: 500;
        color: var(--navy);
        transition: gap 0.15s;
    }
    .cc-link:hover { gap: 9px; }

    /* cards and tags */
    .cc-card {
        background: var(--white);
        border: 1px solid var(--border);
        border-radius: var(--r-card);
    }
    .cream .cc-card.alt, .white .cc-card.alt { background: var(--cream); }
    .cc-tag {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 3px 9px;
        border-radius: var(--r-tag);
        font-size: 11px;
        font-weight: 500;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }
    .cc-tag.red { background: var(--red-soft); color: var(--red); }
    .cc-tag.green { background: var(--mint-soft); color: var(--mint-deep); }
    .cc-tag.navy { background: #E9EDF4; color: var(--navy); }
    .cc-tag.grey { background: #EEECE6; color: var(--muted); }
    /* tag coloured by the announcement type (--tag is set inline from its hex colour) */
    .cc-tag.dyn {
        color: var(--tag, var(--navy));
        background: #E9EDF4;
        background: color-mix(in srgb, var(--tag, var(--navy)) 12%, #fff);
    }
    .cc-meta { font-size: 12px; color: var(--muted); }
    /* company names: Khmer first, English underneath */
    .cc-name-km { display: block; font-family: var(--khmer); font-weight: 600; line-height: 1.5; color: var(--navy); }
    .cc-name-en { display: block; font-family: var(--sans); font-size: 0.875em; font-weight: 500; line-height: 1.4; color: var(--navy); }

/* ======== Header Navigation Content StyleSheet ======== */
    .cc-header {
        position: relative;
        background: var(--white);
        border-bottom: 1px solid var(--border);
    }
    .cc-header .cc-container {
        height: 84px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 40px;
    }
    .cc-logo img { height: 56px; width: auto; }
    .cc-nav { display: flex; gap: 30px; list-style: none; }
    .cc-nav a {
        position: relative;
        padding: 6px 0;
        font-size: 14px;
        white-space: nowrap;
        color: var(--text);
        transition: color 0.15s;
    }
    .cc-nav a:hover { color: var(--navy); }
    .cc-nav a.active { color: var(--navy); font-weight: 500; }
    .cc-nav a.active::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: -2px;
        height: 2px;
        border-radius: 2px;
        background: var(--mint-deep);
    }
    .cc-header-right { display: flex; align-items: center; gap: 18px; font-size: 14px; }
    .cc-lang {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        height: 38px;
        padding: 0 12px;
        border: 1px solid var(--border);
        border-radius: var(--r-btn);
        color: var(--navy);
        font-size: 14px;
        transition: border-color 0.15s;
    }
    .cc-lang:hover { border-color: var(--navy); }
    .cc-lang[lang="km"] span { font-family: var(--khmer); }
    .cc-flag {
        width: 22px;
        height: 15px;
        flex-shrink: 0;
        border-radius: 3px;
        box-shadow: 0 0 0 1px rgba(10, 31, 68, 0.12);
    }
    .cc-menu-btn {
        display: none;
        width: 38px;
        height: 38px;
        place-items: center;
        border: 1px solid var(--border);
        border-radius: var(--r-btn);
        background: var(--white);
        color: var(--navy);
        font-size: 18px;
        cursor: pointer;
    }

/* ======== Footer Content StyleSheet ======== */
    .cc-footer { padding: 48px 0 24px; background: var(--navy); color: var(--on-navy-2); }
    .cc-foot-top {
        margin-bottom: 36px;
        display: grid;
        grid-template-columns: 1.4fr 1fr 1fr 1fr;
        gap: 28px;
    }
    .cc-foot-brand {
        margin-bottom: 12px;
        font-family: var(--serif);
        font-size: 28px;
        line-height: 1.15;
        color: var(--white);
    }
    .cc-foot-brand em { color: var(--mint); }
    .cc-foot-desc { max-width: 260px; font-size: 13px; line-height: 1.6; }
    .cc-foot-title {
        margin-bottom: 14px;
        font-size: 12px;
        font-weight: 500;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--white);
    }
    .cc-foot-link {
        margin-bottom: 10px;
        display: flex;
        align-items: center;
        gap: 7px;
        font-size: 14px;
        transition: color 0.15s;
    }
    a.cc-foot-link:hover { color: var(--white); }
    .cc-foot-bottom {
        padding-top: 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 16px;
        border-top: 1px solid var(--navy-line);
        font-size: 12px;
    }
    .cc-social { display: flex; gap: 14px; font-size: 13px; }
    .cc-social a { transition: color 0.15s; }
    .cc-social a:hover { color: var(--mint); }

/* ######################
    Khmer adjustments
    (Khmer needs more line height, and negative letter spacing breaks its clusters)
######################### */
    html[lang="km"] .cc-h2,
    html[lang="km"] .cc-foot-brand { line-height: 1.4; letter-spacing: normal; }
    html[lang="km"] .cc-eyebrow,
    html[lang="km"] .cc-tag,
    html[lang="km"] .cc-foot-title { letter-spacing: normal; text-transform: none; }

/* ################
    Media Query
################### */
@media (max-width: 1024px) {
    :root { --section: 40px; --gutter: 24px; }
    .container { padding: 0 24px; }
    .cc-head { flex-direction: column; align-items: flex-start; gap: 14px; }
    .cc-header .cc-container {
        height: auto;
        padding-top: 14px;
        padding-bottom: 14px;
        flex-wrap: wrap;
        gap: 14px 24px;
    }
    .cc-nav { order: 3; width: 100%; overflow-x: auto; gap: 22px; }
    .cc-foot-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
    :root { --section: 32px; --gutter: 18px; }
    .container { padding: 0 18px; }
    .cc-h2 { font-size: 30px; }
    .cc-head { margin-bottom: 24px; gap: 12px; }
    /* header: logo, language, sign in and a menu button; the menu opens below the bar */
    .cc-header .cc-container { height: 64px; padding-top: 0; padding-bottom: 0; flex-wrap: nowrap; gap: 12px; }
    .cc-logo img { height: 40px; }
    .cc-header-right { gap: 8px; }
    .cc-lang { width: 38px; padding: 0; justify-content: center; }
    .cc-lang span { display: none; }
    .cc-menu-btn { display: grid; }
    .cc-nav {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        z-index: 30;
        order: 0;
        width: auto;
        overflow: visible;
        flex-direction: column;
        gap: 0;
        padding: 4px var(--gutter) 12px;
        border-bottom: 1px solid var(--border);
        background: var(--white);
        box-shadow: 0 16px 32px -24px rgba(10, 31, 68, 0.35);
    }
    .cc-nav.open { display: flex; }
    .cc-nav a { display: block; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
    .cc-nav li:last-child a { border-bottom: 0; }
    .cc-nav a.active { color: var(--mint-deep); }
    .cc-nav a.active::after { display: none; }
    /* bigger tap area for text links, without changing the layout */
    .cc-link { position: relative; }
    .cc-link::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; bottom: -10px; }
    /* footer */
    .cc-foot-top { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
    .cc-foot-top > :first-child, .cc-foot-top > :last-child { grid-column: 1 / -1; }
    .cc-foot-bottom { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    .cc-header *, .cc-footer *, .cc-home *, .cc-home *::before, .cc-home *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ======== Signed-in account pill (header, every website page) ========
   Append this block to the end of public/css/prototype_website/layouts/app.css */
.cc-account { height: 38px; padding: 0 12px 0 4px; display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--border); border-radius: 999px; background: var(--white); font-size: 14px; font-weight: 500; color: var(--navy); cursor: pointer; transition: border-color 0.15s; }
.cc-account:hover, .cc-account.active { border-color: var(--navy); }
.cc-account-av { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: var(--mint); font-size: 12px; font-weight: 600; letter-spacing: 0.02em; }
.cc-account i { font-size: 15px; color: var(--muted); }
@media (max-width: 640px) {
    .cc-account { width: 38px; padding: 0; justify-content: center; }
    .cc-account-name, .cc-account i { display: none; }
}

/* ======== Account dropdown (opens from the pill above) ======== */
button.cc-account { font-family: inherit; line-height: 1; }
.cc-account-menu { position: relative; }
.cc-account[aria-expanded="true"] { border-color: var(--navy); }
.cc-account[aria-expanded="true"] > i { transform: rotate(180deg); }
.cc-account-panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 40; min-width: 260px; max-width: calc(100vw - 32px); padding: 10px; background: var(--white); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 18px 40px rgba(10, 31, 68, 0.12); }
.cc-account-panel[hidden] { display: none; }
.cc-account-panel form { margin: 0; }
.cc-account-item { width: 100%; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 0; border-radius: 10px; background: none; font-family: inherit; font-size: 16px; line-height: 1.3; text-align: left; color: var(--navy); cursor: pointer; transition: background 0.15s; }
.cc-account-item:hover, .cc-account-item:focus-visible { background: var(--cream); }
.cc-account-item.out { color: var(--muted); }
.cc-account-item.out:hover { color: var(--navy); }
.cc-account-count { min-width: 32px; padding: 3px 10px; border-radius: 999px; background: var(--cream); font-size: 14px; text-align: center; color: var(--muted); }
.cc-account-item:hover .cc-account-count { background: var(--white); }
.cc-account-sep { height: 1px; margin: 8px 6px; background: var(--border); }
