/* ==========================================================================
   Karmastic homepage
   Loaded on the front page only. Colours come from :root in style.css.
   ========================================================================== */

.k-home {
    --k-tint: #f7f3fd;
    --k-line: #e9e2f4;
    display: block;
    color: var(--text-color);
}

.k-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
}

.k-narrow {
    max-width: 820px;
}

.k-home h1,
.k-home h2,
.k-home h3 {
    color: var(--text-color);
    font-family: var(--primary-font);
    margin: 0;
    line-height: 1.2;
}

.k-home p {
    margin: 0;
}

/* The parent theme overlays the header on its slider. We have no slider,
   so put the header back in normal flow above the hero. */
.home .site-header,
.home.has-slider .site-header,
.home.blog.has-slider .site-header {
    position: relative;
}

/* Buttons */
.k-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.k-btn {
    display: inline-block;
    padding: 14px 26px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 17px;
    line-height: 1.2;
    text-decoration: none;
    border: 2px solid transparent;
    transition: background-color .2s, color .2s, border-color .2s;
}

.k-btn--primary {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #fff;
}

.k-btn--primary:hover,
.k-btn--primary:focus {
    background: var(--secondary-dark);
    border-color: var(--secondary-dark);
    color: #fff;
}

.k-btn--ghost {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.k-btn--ghost:hover,
.k-btn--ghost:focus {
    background: var(--primary-color);
    color: #fff;
}

.k-btn--light {
    background: #fff;
    color: var(--primary-dark);
}

.k-btn--light:hover,
.k-btn--light:focus {
    background: transparent;
    border-color: #fff;
    color: #fff;
}

/* Hero */
.k-hero {
    background: linear-gradient(160deg, var(--k-tint) 0%, #fff 70%);
    padding: 72px 0 80px;
}

.k-hero__inner {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
    gap: 48px;
}

/* Slogan above the headline, in the brand script (Caveat, loaded in style.css) */
.k-eyebrow {
    color: var(--secondary-color);
    font-family: "Caveat", "Segoe Print", "Bradley Hand", cursive;
    font-size: clamp(1.75rem, 2.6vw, 2.2rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 10px !important;
}

.k-home .k-hero__title {
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.k-hero__lead {
    font-size: 19px;
    color: var(--muted-text);
    margin-top: 20px !important;
    max-width: 34em;
}

.k-hero__art {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 360px;
}

.k-hero__halo {
    position: absolute;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fff 0%, #efe6fb 55%, #e3d4f7 100%);
}

.k-hero__art img {
    position: relative;
    width: 300px;
    max-width: 80%;
    height: auto;
    /* lets a white image background melt into the soft circle */
    mix-blend-mode: multiply;
}

.k-spark {
    position: absolute;
    width: 22px;
    height: 22px;
    background: var(--secondary-color);
    clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}

.k-spark--1 { top: 8%; right: 14%; }
.k-spark--2 { bottom: 12%; left: 10%; width: 16px; height: 16px; background: var(--primary-color); }
.k-spark--3 { bottom: 20%; right: 8%; width: 12px; height: 12px; background: var(--accent-color); }

/* Generic sections */
.k-section {
    padding: 88px 0;
}

.k-section--tint {
    background: var(--k-tint);
}

.k-section__head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 48px;
}

.k-home .k-section__head h2 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 800;
}

.k-section__head p {
    color: var(--muted-text);
    font-size: 18px;
    margin-top: 12px !important;
}

/* Grids */
.k-grid {
    display: grid;
    gap: 24px;
}

.k-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.k-grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Cards */
.k-card {
    background: #fff;
    border: 1px solid var(--k-line);
    border-radius: 14px;
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
}

.k-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: var(--k-tint);
    color: var(--primary-color);
    margin-bottom: 20px;
}

.k-card__icon .k-icon {
    width: 28px;
    height: 28px;
}

.k-home .k-card h3 {
    font-size: 21px;
    font-weight: 700;
}

.k-card p {
    color: var(--muted-text);
    font-size: 17px;
    margin-top: 10px !important;
}

.k-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 20px;
    font-weight: 700;
    color: var(--secondary-color);
    text-decoration: none;
}

.k-link .k-icon {
    width: 18px;
    height: 18px;
    transition: transform .2s;
}

.k-link:hover,
.k-link:focus {
    color: var(--primary-dark);
}

.k-link:hover .k-icon {
    transform: translateX(3px);
}

/* Campaign / post cards */
.k-card--post time {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 8px;
}

.k-card--post h3 a {
    color: var(--text-color);
    text-decoration: none;
}

.k-card--post h3 a:hover,
.k-card--post h3 a:focus {
    color: var(--primary-color);
}

/* Donate call to action */
.k-cta {
    background: linear-gradient(120deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    text-align: center;
    padding: 80px 0;
}

.k-home .k-cta h2 {
    color: #fff;
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    font-weight: 800;
    margin-bottom: 28px;
}

/* Proof bar */
.k-proof {
    background: var(--primary-dark);
    color: #fff;
    padding: 28px 0;
}

.k-proof__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px 32px;
    margin: 0;
}

.k-proof__item {
    display: flex;
    flex-direction: column-reverse;
    margin: 0;
}

.k-proof__item dd {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.k-proof__item dt {
    font-size: 14px;
    font-weight: 600;
    opacity: .85;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-top: 4px;
}

.k-proof__item--badge dd {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    background: rgba(255, 255, 255, .12);
    border-radius: 999px;
    padding: 10px 18px;
}

.k-proof__item--badge .k-icon {
    width: 22px;
    height: 22px;
    flex: none;
}

/* Trust points */
.k-trust__item {
    text-align: center;
}

.k-trust__item .k-card__icon {
    margin: 0 auto 16px;
}

.k-home .k-trust__item h3 {
    font-size: 20px;
    font-weight: 700;
}

.k-trust__item p {
    color: var(--muted-text);
    margin-top: 8px !important;
}

.k-center {
    text-align: center;
    margin-top: 40px !important;
}

.k-link--inline {
    padding-top: 0;
    margin-top: 0;
    font-size: 18px;
}

/* Featured help card (Donate) */
.k-card--featured {
    border: 2px solid var(--secondary-color);
}

.k-card--featured .k-card__icon {
    background: var(--secondary-color);
    color: #fff;
}

/* Our work photos */
.k-photos {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.k-photo {
    margin: 0;
}

/* Fewer photos: bigger, centred layouts */
.k-photos--1 {
    grid-template-columns: 1fr;
    max-width: 820px;
    margin: 0 auto;
}

.k-photos--1 .k-photo a {
    aspect-ratio: 16 / 9;
}

.k-photos--2,
.k-photos--4 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 960px;
    margin: 0 auto;
}

.k-photo a {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: 14px;
    overflow: hidden;
    background: #ece6f5;
}

.k-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

.k-photo a:hover img,
.k-photo a:focus img {
    transform: scale(1.04);
}

.k-photo__caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 28px 16px 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: #fff;
    background: linear-gradient(to top, rgba(29, 20, 48, .82), rgba(29, 20, 48, 0));
}

/* Responsive */
@media (max-width: 991px) {
    .k-hero__inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .k-hero__art {
        max-width: 420px;
        margin: 0 auto;
    }

    .k-grid--3 {
        grid-template-columns: 1fr 1fr;
    }

    .k-hero__art {
        min-height: 280px;
    }

    .k-hero__halo {
        width: 260px;
        height: 260px;
    }

    .k-hero__art img {
        width: 230px;
    }
}

@media (max-width: 640px) {
    .k-photos--1 {
        grid-template-columns: 1fr;
    }

    .k-photos {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .k-photo__caption {
        font-size: 12px;
        padding: 22px 10px 8px;
    }

    .k-container {
        padding: 0 16px;
    }

    .k-hero {
        padding: 48px 0 56px;
    }

    .k-hero__lead {
        font-size: 17px;
    }

    .k-hero__art {
        min-height: 210px;
        margin-top: 8px;
    }

    .k-hero__halo {
        width: 200px;
        height: 200px;
    }

    .k-hero__art img {
        width: 170px;
    }

    .k-section {
        padding: 64px 0;
    }

    .k-grid--3 {
        grid-template-columns: 1fr;
    }

    .k-proof__list {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .k-proof__item--badge {
        grid-column: 1 / -1;
    }

    .k-actions .k-btn {
        flex: 1 1 100%;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .k-photo img,
    .k-btn,
    .k-link .k-icon {
        transition: none;
    }
}
