.template-homepage .header,
.template-homepage .hero--home {
    margin-bottom: 0;
    padding-left: var(--home-gutter);
}

.template-homepage .hero--home .hero__inner {
    padding-bottom: 3.25rem;
}

.template-homepage .hero--home .hero__heading {
    width: auto;
    max-width: none;
    margin-bottom: 0.75rem;
    font-family: var(--inscribe-font);
    font-size: clamp(2.4rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: normal;
    line-height: 1.8;
}

.template-homepage .hero--home .hero__intro {
    max-width: 40rem;
    margin-top: 1.25rem;
    margin-right: 0;
    color: #243838;
}

.template-homepage .hero__intro > :last-child {
    margin-bottom: 0;
}

.template-homepage .hero__intro > p {
    margin: 0 0 0.85rem;
    font-family: inherit;
    font-size: 1.0625rem;
    line-height: 1.8;
    color: #243838;
}

.template-homepage .hero__intro-lead,
.template-homepage .hero__intro h2,
.template-homepage .hero__intro > h2:first-child {
    margin: 0 0 0.85rem;
    font-family: inherit;
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.8;
    color: var(--learnpali-ink);
}

.template-homepage .hero__intro > p:first-child {
    font-weight: 700;
    color: var(--learnpali-ink);
}

/* Streamfield body under the hero. Same size as the intro paragraph above.
   The heading in that block keeps the h2 size. */
.template-homepage .rich-text p {
    font-size: 1.0625rem;
}

.template-homepage .hero__intro-skills {
    margin: 0 0 1rem;
    padding-left: 20px;
    list-style: none;
    font-size: 1.0625rem;
    line-height: 1.8;
}

.template-homepage .hero__intro-skills li {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin-bottom: 0.7rem;
}

/* Wagtail sprite: tilted teal shape behind a stroked glyph. The hero rule thins that stroke for large icons, so this size sets its own. */
.template-homepage .hero__skill-icon {
    position: relative;
    flex: 0 0 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
    margin-top: 0.15rem;
}

.template-homepage .hero__skill-icon .icon__svg {
    width: 2.5rem;
    height: 2.5rem;
}

.template-homepage .hero__skill-icon .icon__svg-bg {
    fill: #80d7d8;
    opacity: 0.6;
    transform: scale(1.3) rotate(-8deg);
    transform-origin: center;
}

.template-homepage .hero__skill-icon .icon__svg-fg {
    fill: transparent;
    stroke: var(--learnpali-ink);
    stroke-width: 8px;
}

.template-homepage .hero__skill-text {
    padding-top: 0.4rem;
}

.template-homepage .hero__intro-skills li:last-child {
    margin-bottom: 0;
}

.template-homepage .hero__intro-skills strong,
.template-homepage .hero__intro strong,
.template-homepage .hero__intro b {
    color: var(--learnpali-teal);
    font-weight: 600;
}

.template-homepage .hero__intro-note,
.template-homepage .hero__intro em {
    font-size: 0.875rem;
    color: #4a6363;
    line-height: 1.8;
}

.landing-kicker {
    margin: 0 0 1rem;
    color: var(--learnpali-teal);
    font-family: var(--inscribe-font);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: normal;
    text-transform: uppercase;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

.template-homepage .hero__actions {
    flex-direction: column;
    align-items: flex-start;
}

.template-homepage .hero__cta-description {
    margin: 0.85rem 0 0;
    max-width: 28rem;
    color: #3d5555;
    font-size: 1.0625rem;
    line-height: 1.8;
}

.template-homepage .icon-bullets {
    list-style: none;
}

.hero__actions .hero-search {
    width: 100%;
    max-width: 24rem;
}

@media (min-width: 599px) {
    .hero__actions .hero-search {
        width: auto;
        flex: 1 1 18rem;
    }
}

/* --- Home sections: Series, CEFR band, sample player --- */

.home-body {
    padding-bottom: 3rem;
    background: #fff;
    color: var(--learnpali-ink-soft);
}

/* The theme icon sits at z-index -1. main clips overflow, so that icon paints behind this white box. A stacking context keeps it inside the hero, behind the words and above the white. */
.home-body .hero {
    z-index: 0;
}

.template-homepage .home-corpus-snapshot {
    grid-column: 2 / span 2;
    padding: 0 0 1.5rem;
}

@media (min-width: 599px) {
    .template-homepage .home-corpus-snapshot {
        grid-column: 2 / span 3;
        padding-bottom: 2rem;
    }
}

@media (min-width: 1023px) {
    .template-homepage .home-corpus-snapshot {
        grid-column: 2 / span 5;
        justify-self: center;
        width: min(100%, 44rem);
        padding-bottom: 2rem;
    }
}

.template-homepage .home-corpus-snapshot__inner {
    padding-top: 0.5rem;
}

.template-homepage .home-corpus-snapshot--align-center .home-corpus-snapshot__inner {
    text-align: center;
}

.template-homepage .home-corpus-snapshot--align-left .home-corpus-snapshot__inner {
    text-align: left;
}

.template-homepage .home-corpus-snapshot__meta {
    /* Same icon–label rhythm as .card .card__meta on principle cards. */
    display: inline-flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    width: auto;
    text-align: left;
}

.template-homepage .home-corpus-snapshot--align-center .home-corpus-snapshot__meta {
    margin-inline: auto;
}

.template-homepage .home-corpus-snapshot__meta .icon__svg-fg {
    stroke-width: 3px;
}

.template-homepage .home-corpus-snapshot__meta .meta__text {
    margin: 0;
}

.template-homepage .home-corpus-snapshot__heading {
    margin: 0 0 15px;
}

/* Match the homepage body copy at 1.0625rem (21.25px when the root is 20px). */
.template-homepage .home-corpus-snapshot__stat {
    margin: 0 0 20px;
    font-size: 1.0625rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.8;
}

.template-homepage .home-corpus-snapshot--align-center .home-corpus-snapshot__copy {
    margin-left: auto;
    margin-right: auto;
}

.template-homepage .home-corpus-snapshot__copy p {
    margin: 0 0 20px;
    font-size: 1.0625rem;
    line-height: 1.8;
}

.template-homepage .home-corpus-snapshot__copy p:last-child {
    margin-bottom: 0;
}

@media (min-width: 1400px) {
    .template-homepage .home-corpus-snapshot__stat {
        margin: 0 0 40px;
    }

    .template-homepage .home-corpus-snapshot__copy p {
        margin: 0 0 40px;
    }

    .template-homepage .home-corpus-snapshot__copy p:last-child {
        margin-bottom: 0;
    }
}

.template-homepage .home-corpus-snapshot .home-corpus-snapshot__cta.card__cta {
    margin-top: 1.25rem;
}

.template-homepage .home-corpus-snapshot--align-center .home-corpus-snapshot__cta.card__cta {
    margin-left: auto;
    margin-right: auto;
}

/* Learn Now, principle cards, corpus snapshot — one outline CTA on the homepage. */
.template-homepage .button.home-landing-cta {
    background-color: #fff;
    color: var(--learnpali-ink-soft);
    border-color: var(--color--highlight);
}

.template-homepage .button.home-landing-cta > svg.arrow {
    fill: #007d7e;
}

.template-homepage .button.home-landing-cta .icon.button__icon {
    width: 1.15rem;
    height: 1.15rem;
    margin: 0 0 0 15px;
    flex: 0 0 1.15rem;
    color: #007d7e;
    transition: color 0.3s, transform 0.3s;
}

.template-homepage .button.home-landing-cta:hover,
.template-homepage .button.home-landing-cta:focus {
    background-color: var(--color--highlight);
    border-color: var(--color--highlight);
    color: #fff;
}

.template-homepage .button.home-landing-cta:hover > svg.arrow,
.template-homepage .button.home-landing-cta:focus > svg.arrow {
    fill: currentColor;
}

.template-homepage .button.home-landing-cta:hover .icon.button__icon,
.template-homepage .button.home-landing-cta:focus .icon.button__icon {
    color: currentColor;
    transform: translateX(6px) scale(1.05);
}

/* Closing content hero: keep the decorative icon out of the corpus section above. */
.template-homepage .home-body .hero:not(.hero--home) {
    margin-top: 2.5rem;
    isolation: isolate;
}

.template-homepage .home-body .hero:not(.hero--home) .hero__inner {
    position: relative;
    z-index: 1;
}

@media (min-width: 1023px) {
    .template-homepage .home-body .card-grid__item:nth-child(3),
    .template-homepage .home-body .card-grid__item:nth-child(4) {
        padding-bottom: 2.5rem;
    }
}

.home-body > .headline:first-child {
    padding-top: 2.5rem;
}

/* Same mixed stack as Wagtail admin (inscribe-fonts.css): inscribe Pali, Thai → Sarabun, Roman → Gentium. */
.template-homepage {
    --home-gutter: 1.5rem;
    background: #fff;
    color: var(--learnpali-ink-soft);
    font-family: var(--inscribe-font);
}

.template-homepage .hero__heading,
.template-homepage .hero__subheading,
.template-homepage .hero__intro,
.template-homepage .hero__button,
.template-homepage .landing-kicker {
    font-family: var(--inscribe-font);
}

.template-homepage :lang(pi-Latn) {
    font-family: var(--inscribe-font-roman);
}

/* The name Pāḷi in the heading is upright Gentium Bold, larger than the line, with a teal marker.
   Thai ปาฬิ and บาลี use the same size, weight, color, and marker, and keep the Thai face. */
.template-homepage .hero__pali {
    font-family: var(--inscribe-font-roman);
    font-style: normal;
    font-weight: 700;
    font-size: 1.45em;
    font-synthesis: none;
    letter-spacing: normal;
    line-height: 1;
    color: var(--learnpali-teal);
    background-image: linear-gradient(#c5e8e6, #c5e8e6);
    background-repeat: no-repeat;
    background-size: 100% 0.22em;
    background-position: 0 82%;
}

.template-homepage .hero__pali:lang(th) {
    font-family: var(--inscribe-font);
}

/* The home hero keeps the streamfield grid. A ContentPage hero elsewhere on this page keeps the theme's own widths. */
.template-homepage .hero--home {
    width: auto;
}

.template-homepage .hero--home .hero__inner {
    max-width: none;
    padding-top: 3.75rem;
    padding-bottom: 2.5rem;
}

/* Card items use 100px of bottom padding from 599px. The phone sets this block's height, so the same inset sits under it. */
@media (min-width: 599px) {
    .template-homepage .hero--home .hero__inner {
        padding-bottom: 5rem;
    }
}

.template-homepage .hero--home .hero__subheading {
    max-width: 38rem;
    color: #243838;
    font-size: 1.125rem;
    line-height: 1.8;
}

.template-homepage .hero__heading,
.template-homepage .hero__intro {
    color: var(--learnpali-ink);
}

.template-homepage .hero--home .hero__button {
    border-color: var(--learnpali-teal);
    border-radius: 999px;
    background: var(--learnpali-teal);
    color: #fff;
    font-weight: 600;
}

.template-homepage .hero--home .hero__button:hover,
.template-homepage .hero--home .hero__button:focus {
    border-color: var(--learnpali-teal-pressed);
    background: var(--learnpali-teal-pressed);
    color: #fff;
}

.template-homepage .hero--home .hero__button > svg,
.template-homepage .hero--home .hero__button .button__icon {
    width: 1.15rem;
    height: 1.15rem;
    margin-left: 0.65rem;
    fill: currentColor;
}

/* Shared phone frame: core/phone-demo.css. This page only sets the hero margin. */
.template-homepage .home-phone {
    margin: 1.5rem auto 0;
}

/* Rings sit in .home-phone so their centre follows the phone when the hero stacks. */
.template-homepage .grid:has(> .hero--home) {
    overflow: clip;
}

/* Theme sets overflow-x: hidden on main. That value turns overflow-y into auto, so the Headline's wide heading opens a second vertical scrollbar beside the page scrollbar. clip keeps the sideways overflow inside the page and leaves one scrollbar. */
.template-homepage .app__content {
    overflow-x: clip;
}

.template-homepage .home-hero {
    isolation: isolate;
}

/* One scene canvas (80rem); bars use the inner 150% phone orb. */
.home-phone__orb {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: -1;
    width: 80rem;
    height: 80rem;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.home-phone__orb-bars {
    display: block;
    width: 100%;
    height: 100%;
}

@media (min-width: 1023px) {
    .template-homepage .home-hero {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 400px;
        column-gap: 2.5rem;
        align-items: start;
    }

    .template-homepage .home-hero > .landing-kicker {
        grid-column: 1;
        grid-row: 1;
    }

    .template-homepage .home-hero > .hero__heading {
        grid-column: 1;
        grid-row: 2;
    }

    .template-homepage .home-hero > .hero__subheading {
        grid-column: 1;
        grid-row: 3;
    }

    .template-homepage .home-hero > .hero__intro {
        grid-column: 1;
        grid-row: 4;
    }

    .template-homepage .home-hero > .hero__actions {
        grid-column: 1;
        grid-row: 5;
    }

    .template-homepage .home-hero > .home-phone {
        grid-column: 2;
        grid-row: 2 / span 4;
        align-self: start;
        justify-self: end;
        margin-top: 0;
    }
}

