/* =========================================================
   CanCham Cambodia - Home Page
   File: /assets/css/pages/home.css
   ========================================================= */

/* ---------- Page-level tokens ---------- */
.page-home {
    --home-bg: #f4f7fb;
    --home-surface: rgba(255, 255, 255, 0.92);
    --home-surface-strong: #ffffff;
    --home-surface-soft: #f8fbff;
    --home-text: #142033;
    --home-text-muted: #5c6b82;
    --home-heading: #0d1b2a;
    --home-border: rgba(20, 32, 51, 0.1);
    --home-border-strong: rgba(20, 32, 51, 0.16);
    --home-primary: #0f4c81;
    --home-primary-strong: #0a3b64;
    --home-secondary: #1d6fa3;
    --home-accent: #dbeefe;
    --home-highlight: #edf6ff;
    --home-success-soft: #eaf6ef;

    --home-shadow-sm: 0 6px 16px rgba(12, 28, 52, 0.05);
    --home-shadow-md: 0 10px 24px rgba(12, 28, 52, 0.08);
    --home-shadow-lg: 0 14px 32px rgba(12, 28, 52, 0.1);

    --home-radius-sm: 6px;
    --home-radius-md: 10px;
    --home-radius-lg: 14px;
    --home-radius-xl: 18px;

    --home-max-width: 1240px;
    --home-section-space: clamp(3.25rem, 5vw, 5rem);
    --home-card-gap: clamp(1rem, 1.6vw, 1.35rem);
    --home-grid-gap: clamp(1rem, 1.8vw, 1.5rem);
    --home-hero-top-space: clamp(0.9rem, 2vw, 1.5rem);
    --home-hero-bottom-space: clamp(2rem, 4vw, 3.25rem);

    background:
        radial-gradient(circle at top left, rgba(15, 76, 129, 0.05), transparent 32%),
        radial-gradient(circle at right 10% top 10%, rgba(29, 111, 163, 0.04), transparent 24%),
        linear-gradient(180deg, #f7faff 0%, #f4f7fb 100%);
    color: var(--home-text);
}

/* ---------- General page layout ---------- */
.page-home .page-main {
    position: relative;
    overflow: clip;
}

.page-home .site-shell {
    width: min(100% - 2rem, var(--home-max-width));
    margin-inline: auto;
}

/* ---------- Shared section styles ---------- */
.page-home .section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 0.85rem;
    color: var(--home-primary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.page-home .section-kicker::before {
    content: "";
    width: 1.1rem;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--home-primary), var(--home-secondary));
    flex: 0 0 auto;
}

.page-home .section-heading {
    max-width: 760px;
    margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.page-home .section-title {
    margin: 0;
    color: var(--home-heading);
    font-size: clamp(1.75rem, 2.8vw, 2.75rem);
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.page-home .section-intro {
    margin: 0.85rem 0 0;
    max-width: 64ch;
    color: var(--home-text-muted);
    font-size: clamp(0.98rem, 1.05vw, 1.08rem);
    line-height: 1.68;
}

/* ---------- Buttons / links fallback tuning ---------- */
.page-home .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 3.05rem;
    padding: 0.85rem 1.2rem;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        background-color 0.22s ease,
        color 0.22s ease,
        border-color 0.22s ease;
    will-change: transform;
}

.page-home .button:hover,
.page-home .button:focus-visible {
    transform: translateY(-1px);
}

.page-home .button-primary {
    background: linear-gradient(135deg, var(--home-primary), var(--home-secondary));
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(15, 76, 129, 0.18);
}

.page-home .button-primary:hover,
.page-home .button-primary:focus-visible {
    box-shadow: 0 12px 24px rgba(15, 76, 129, 0.22);
}

.page-home .button-secondary {
    background: rgba(255, 255, 255, 0.92);
    color: var(--home-primary-strong);
    border: 1px solid rgba(15, 76, 129, 0.12);
    box-shadow: var(--home-shadow-sm);
}

.page-home .button-secondary:hover,
.page-home .button-secondary:focus-visible {
    background: #ffffff;
    border-color: rgba(15, 76, 129, 0.18);
}

.page-home .text-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--home-primary);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

.page-home .text-link::after {
    content: "→";
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.page-home .text-link:hover,
.page-home .text-link:focus-visible {
    color: var(--home-primary-strong);
}

.page-home .text-link:hover::after,
.page-home .text-link:focus-visible::after {
    transform: translateX(3px);
}

/* ---------- Hero ---------- */
.home-hero {
    position: relative;
    padding: var(--home-hero-top-space) 0 var(--home-hero-bottom-space);
    isolation: isolate;
}

.home-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at left top, rgba(15, 76, 129, 0.05), transparent 34%),
        radial-gradient(circle at right center, rgba(29, 111, 163, 0.05), transparent 24%);
    pointer-events: none;
    z-index: -1;
}

.home-hero__layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
    gap: 1.25rem;
    align-items: stretch;
}

.home-hero__content,
.home-hero__panel {
    position: relative;
    min-height: 100%;
    border: 1px solid var(--home-border);
    box-shadow: var(--home-shadow-md);
}

.home-hero__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(1.4rem, 2.3vw, 2.3rem);
    border-radius: var(--home-radius-lg);
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9));
}

.home-hero__content::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    right: -50px;
    bottom: -60px;
    background: radial-gradient(circle, rgba(15, 76, 129, 0.06), transparent 70%);
    pointer-events: none;
}

.home-hero__content > * {
    position: relative;
    z-index: 1;
}

.home-hero__content > * + * {
    margin-top: 0.9rem;
}

.home-hero__title {
    margin: 0;
    max-width: 22ch;
    color: var(--home-heading);
    font-size: clamp(1.9rem, 3.6vw, 3.25rem);
    line-height: 1.04;
    letter-spacing: -0.04em;
    text-wrap: pretty;
}

.home-hero__intro {
    margin: 0;
    max-width: 60ch;
    color: var(--home-text-muted);
    font-size: clamp(0.98rem, 1.05vw, 1.08rem);
    line-height: 1.65;
}

.home-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.4rem;
}

.home-hero__panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
    padding: clamp(1.15rem, 2vw, 1.55rem);
    border-radius: var(--home-radius-md);
    background:
        linear-gradient(180deg, rgba(16, 48, 78, 0.98), rgba(24, 75, 118, 0.98)),
        linear-gradient(135deg, var(--home-primary), var(--home-secondary));
    color: #f8fbff;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: var(--home-shadow-lg);
}

.home-hero__panel > * + * {
    margin-top: 0;
}

.home-hero__panel .section-kicker {
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.82);
}

.home-hero__panel .section-kicker::before {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.45));
}

.panel-title {
    margin: 0;
    font-size: clamp(1.2rem, 1.7vw, 1.55rem);
    line-height: 1.28;
    letter-spacing: -0.03em;
    color: #ffffff;
}

.hero-point-list {
    display: grid;
    gap: 0.8rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hero-point-list__item {
    position: relative;
    padding: 0.9rem 0.95rem 0.9rem 2.7rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(248, 251, 255, 0.94);
    line-height: 1.55;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.98rem;
}

.hero-point-list__item::before {
    content: "";
    position: absolute;
    left: 0.95rem;
    top: 1rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #ffffff 0 30%, transparent 31%),
        linear-gradient(135deg, #ffffff, rgba(255, 255, 255, 0.45));
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

/* ---------- Sections spacing ---------- */
.home-trust,
.home-pillars,
.home-audience,
.home-membership,
.home-engagement {
    padding: var(--home-section-space) 0;
}

/* ---------- Generic card grid ---------- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--home-grid-gap);
}

.feature-card {
    grid-column: span 4;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1.4rem;
    border-radius: var(--home-radius-md);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9));
    border: 1px solid var(--home-border);
    box-shadow: var(--home-shadow-sm);
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease;
    min-height: 100%;
}

.feature-card:hover,
.feature-card:focus-within {
    transform: translateY(-2px);
    box-shadow: var(--home-shadow-md);
    border-color: rgba(15, 76, 129, 0.16);
}

.feature-card__title {
    margin: 0;
    color: var(--home-heading);
    font-size: 1.15rem;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

.feature-card__text {
    margin: 0.8rem 0 0;
    color: var(--home-text-muted);
    line-height: 1.75;
    font-size: 1rem;
}

.feature-card__action {
    margin-top: 1.1rem;
}

/* ---------- Trust section ---------- */
.home-trust .feature-card::before,
.home-audience .feature-card::before,
.home-engagement .feature-card::before {
    content: "";
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    background:
        linear-gradient(135deg, rgba(15, 76, 129, 0.16), rgba(29, 111, 163, 0.08));
    border: 1px solid rgba(15, 76, 129, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

/* ---------- Pillars ---------- */
.home-pillars {
    position: relative;
}

.pillar-stack {
    display: grid;
    gap: clamp(1.1rem, 2vw, 1.5rem);
}

.pillar-card {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    gap: clamp(1rem, 2.6vw, 2rem);
    align-items: start;
    padding: clamp(1.4rem, 2.7vw, 2rem);
    border-radius: var(--home-radius-lg);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 252, 255, 0.9));
    border: 1px solid var(--home-border);
    box-shadow: var(--home-shadow-sm);
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease;
}

.pillar-card:hover,
.pillar-card:focus-within {
    transform: translateY(-2px);
    box-shadow: var(--home-shadow-md);
    border-color: rgba(15, 76, 129, 0.16);
}

.pillar-card__main {
    min-width: 0;
}

.pillar-card__kicker {
    margin: 0 0 0.75rem;
    color: var(--home-primary);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.pillar-card__title {
    margin: 0;
    color: var(--home-heading);
    font-size: clamp(1.35rem, 2vw, 1.95rem);
    line-height: 1.2;
    letter-spacing: -0.03em;
    text-wrap: balance;
}

.pillar-card__text {
    margin: 0.95rem 0 0;
    color: var(--home-text-muted);
    line-height: 1.8;
    font-size: 1rem;
}

.pillar-card__audience {
    margin: 1rem 0 0;
    padding: 1rem 1.1rem;
    border-left: 4px solid rgba(15, 76, 129, 0.22);
    border-radius: 0 8px 8px 0;
    background: var(--home-highlight);
    color: #29425e;
    font-size: 0.98rem;
    line-height: 1.7;
}

.pillar-card__aside {
    padding: 1.15rem;
    border-radius: var(--home-radius-md);
    background: linear-gradient(180deg, #f8fbff, #f1f7fd);
    border: 1px solid rgba(15, 76, 129, 0.08);
}

.pillar-card__list {
    display: grid;
    gap: 0.8rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pillar-card__list-item {
    position: relative;
    padding-left: 1.8rem;
    color: var(--home-text);
    line-height: 1.65;
    font-weight: 600;
}

.pillar-card__list-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.65rem;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--home-primary), var(--home-secondary));
    box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.1);
}

/* ---------- Audience ---------- */
.home-audience .feature-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 255, 0.9));
}

/* ---------- Membership ---------- */
.membership-panel {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
    gap: clamp(1.2rem, 2.5vw, 2rem);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border-radius: var(--home-radius-lg);
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(12, 35, 58, 0.98), rgba(17, 58, 95, 0.96) 55%, rgba(25, 94, 139, 0.95));
    color: #ffffff;
    box-shadow: var(--home-shadow-lg);
}

.membership-panel::before {
    content: "";
    position: absolute;
    inset: auto -60px -100px auto;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 68%);
    pointer-events: none;
}

.membership-panel__content,
.membership-panel__aside {
    position: relative;
    z-index: 1;
}

.membership-panel .section-kicker,
.membership-panel .section-title,
.membership-panel .section-intro {
    color: #ffffff;
}

.membership-panel .section-kicker {
    opacity: 0.82;
}

.membership-panel .section-kicker::before {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.4));
}

.membership-panel .section-intro {
    color: rgba(255, 255, 255, 0.85);
}

.membership-panel__aside {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(1rem, 2vw, 1.25rem);
    border-radius: var(--home-radius-md);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.membership-list {
    display: grid;
    gap: 0.85rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.membership-list__item {
    position: relative;
    padding-left: 1.8rem;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.7;
}

.membership-list__item::before {
    content: "•";
    position: absolute;
    left: 0.1rem;
    top: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
    line-height: 1;
}

.membership-panel__actions {
    margin-top: 1.4rem;
}

.membership-panel .button-primary {
    background: #ffffff;
    color: var(--home-primary-strong);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
}

.membership-panel .button-primary:hover,
.membership-panel .button-primary:focus-visible {
    background: #f5f9ff;
}

/* ---------- Engagement ---------- */
.home-engagement .feature-card {
    justify-content: space-between;
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .page-home .button,
    .page-home .text-link,
    .feature-card,
    .pillar-card {
        transition: none;
    }

    .page-home .button:hover,
    .page-home .button:focus-visible,
    .feature-card:hover,
    .feature-card:focus-within,
    .pillar-card:hover,
    .pillar-card:focus-within {
        transform: none;
    }
}

/* ---------- Large tablet ---------- */
@media (max-width: 1100px) {
    .home-hero__layout,
    .membership-panel,
    .pillar-card {
        grid-template-columns: 1fr;
    }

    .feature-card {
        grid-column: span 6;
    }

    .home-hero__title {
        max-width: 16ch;
    }

    .home-hero__panel {
        max-width: none;
    }
}

/* ---------- Tablet ---------- */
@media (max-width: 820px) {
    .page-home .site-shell {
        width: min(100% - 1.25rem, var(--home-max-width));
    }

    .home-trust,
    .home-pillars,
    .home-audience,
    .home-membership,
    .home-engagement {
        padding: clamp(3.5rem, 8vw, 5rem) 0;
    }

    .feature-grid {
        grid-template-columns: 1fr 1fr;
    }

    .feature-card {
        grid-column: auto;
    }

    .home-hero__content,
    .home-hero__panel,
    .pillar-card,
    .membership-panel,
    .feature-card {
        border-radius: 12px;
    }

    .home-hero__actions {
        gap: 0.75rem;
    }

    .page-home .button {
        min-height: 3.1rem;
    }
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
    .page-home {
        --home-section-space: 3.5rem;
    }

    .page-home .site-shell {
        width: min(100% - 1rem, var(--home-max-width));
    }

    .page-home .section-heading {
        margin-bottom: 1.5rem;
    }

    .page-home .section-title {
        font-size: clamp(1.6rem, 7vw, 2.2rem);
        line-height: 1.14;
    }

    .page-home .section-intro,
    .feature-card__text,
    .pillar-card__text,
    .pillar-card__audience,
    .membership-panel .section-intro {
        font-size: 0.98rem;
        line-height: 1.72;
    }

    .home-hero {
        padding-top: 1rem;
        padding-bottom: 3rem;
    }

    .home-hero__content {
        padding: 1.25rem;
    }

    .home-hero__title {
        max-width: none;
        font-size: clamp(1.85rem, 9vw, 2.55rem);
        line-height: 1.04;
    }

    .home-hero__intro {
        margin-top: 0.85rem;
        font-size: 1rem;
        line-height: 1.72;
    }

    .home-hero__panel {
        padding: 1rem;
    }

    .panel-title {
        font-size: 1.1rem;
    }

    .hero-point-list__item {
        padding: 0.9rem 0.9rem 0.9rem 2.55rem;
        font-size: 0.95rem;
        border-radius: 8px;
    }

    .hero-point-list__item::before {
        left: 0.9rem;
        top: 1rem;
        width: 0.95rem;
        height: 0.95rem;
        box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
    }

    .home-hero__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .home-hero__actions .button {
        width: 100%;
    }

    .feature-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .feature-card {
        padding: 1.2rem;
    }

    .feature-card__title {
        font-size: 1.05rem;
    }

    .pillar-card {
        padding: 1.15rem;
        gap: 1rem;
    }

    .pillar-card__title {
        font-size: 1.25rem;
    }

    .pillar-card__aside {
        padding: 1rem;
        border-radius: 10px;
    }

    .pillar-card__list {
        gap: 0.7rem;
    }

    .pillar-card__list-item {
        font-size: 0.97rem;
    }

    .membership-panel {
        padding: 1.2rem;
        gap: 1rem;
    }

    .membership-panel__aside {
        padding: 1rem;
        border-radius: 10px;
    }

    .membership-list__item {
        font-size: 0.97rem;
    }

    .page-home .button {
        min-height: 3rem;
        padding: 0.9rem 1.1rem;
        border-radius: 8px;
    }
}

/* ---------- Small phones ---------- */
@media (max-width: 420px) {
    .page-home .section-kicker {
        font-size: 0.74rem;
        letter-spacing: 0.1em;
    }

    .home-hero__content,
    .home-hero__panel,
    .feature-card,
    .pillar-card,
    .membership-panel {
        border-radius: 10px;
    }

    .home-hero__title {
        font-size: 1.8rem;
    }

    .home-hero__intro,
    .feature-card__text,
    .pillar-card__text,
    .pillar-card__audience {
        font-size: 0.95rem;
    }

    .pillar-card__audience {
        padding: 0.9rem 1rem;
    }
}