/*
 * assets/css/home.css  (new in v35, chat 12e)
 * Layout of the Home page (index.php). Linked from index.php, inside the page body, so it loads
 * after style.css and design-system.css and wins on equal strength.
 *
 * Prefix "hm-" is used (not "home-"). The old .home-* rules were removed from style.css in v38.
 * Container width, 17px text and link colours come from style.css / design-system.css.
 * Colours: only the fixed set (see design-system.css). Flat, no shadows, no rounded corners.
 * The step numbers 1 to 7 are drawn here with a CSS counter, so they are not page text.
 */

.hm h1,
.hm h2,
.hm h3 { margin-top: 0; }

/* Section padding (64px, phones 40px) now comes from .section in style.css, same as every page. */

.hm h2.hm-h2 { font-size: 1.65rem; font-weight: bold; color: #262626; line-height: 1.25; margin: 0 0 24px; }

/* ---------- Hero ---------- */
.hm-hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 48px; align-items: start; }
/* The Home h1 (class hm-title) uses the shared h1 rule in style.css, same as every other page. */
.hm-hero-text p { max-width: 66ch; }

.hm-facts { background: #FFFFFF; border: 1px solid #CFCFCF; border-top: 3px solid #FFDE39; padding: 24px; }
.hm-facts h2 { font-size: 1.1rem; font-weight: bold; line-height: 1.35; color: #4073AF; margin: 0 0 16px; }
.hm-facts ul { list-style: none; margin: 0; padding: 0; }
.hm-facts li { position: relative; margin: 0; padding: 12px 0 12px 22px; border-top: 1px solid #CFCFCF; font-weight: bold; line-height: 1.4; }
.hm-facts li:first-child { border-top: 0; padding-top: 0; }
.hm-facts li::before { content: ''; position: absolute; left: 0; top: 19px; width: 9px; height: 9px; background: #FFDE39; border: 1px solid #C29500; }
.hm-facts li:first-child::before { top: 7px; }
.hm-threshold { margin: 36px 0 0; }

/* ---------- Lead + process ---------- */
.hm-lead { font-size: 1.4rem; font-weight: bold; line-height: 1.4; margin: 0 0 20px; color: #262626; }
.hm-leadtext { margin: 0 0 44px; }

.hm-process { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 40px 56px; counter-reset: step; }
/* v40: row 1 = four cards, row 2 = three wider cards, so both rows run edge to edge */
.hm-step { grid-column: span 3; }
.hm-step:nth-child(n+5) { grid-column: span 4; }
.hm-step { position: relative; counter-increment: step; margin: 0; background: #FFFFFF; border: 1px solid #CFCFCF; border-top: 3px solid #FFDE39; padding: 8px; display: flex; flex-direction: column; }
.hm-step figure { margin: 0; position: relative; }
.hm-step img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.hm-step img.hm-contain { object-fit: contain; background: #F4F4F4; }

/* Number badge (decorative: the list is already numbered for screen readers) */
.hm-step figure::before { content: counter(step); content: counter(step) / ''; position: absolute; left: 0; top: 0; z-index: 1; background: #4073AF; color: #FFFFFF; font-weight: bold; font-size: 1rem; line-height: 1; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; }

.hm-label { background: #4073AF; color: #FFFFFF; font-weight: bold; text-align: center; margin: 0; padding: 0 12px; min-height: 64px; display: flex; align-items: center; justify-content: center; line-height: 1.3; font-size: .98rem; }

/* Arrow between neighbours (decorative) */
.hm-step::after { content: ''; position: absolute; right: -56px; top: 28%; width: 56px; height: 24px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='24' viewBox='0 0 40 24'%3E%3Cpath d='M1 12H35M26 3L36 12L26 21' fill='none' stroke='%234073AF' stroke-width='3' stroke-linecap='square'/%3E%3C/svg%3E") no-repeat center / 40px 24px; }
.hm-step:nth-child(4n)::after,
.hm-step:last-child::after { display: none; }

/* ---------- Why Us ---------- */
.hm-why { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; align-items: stretch; }
.hm-card { background: #FFFFFF; border: 1px solid #CFCFCF; border-top: 3px solid #FFDE39; padding: 24px; display: flex; flex-direction: column; }
.hm-card h3 { font-size: 1.1rem; font-weight: bold; color: #4073AF; margin: 0 0 8px; line-height: 1.35; }
.hm-card p { margin: 0 0 12px; }
.hm-card ul { list-style: disc; margin: 0 0 14px; padding-left: 20px; }
.hm-card li { margin: 0 0 3px; }
.hm-why .hm-card p, .hm-why .hm-card li { line-height: 1.5; }
/* v51: the short first card runs across the full width with its two paragraphs one under the other (one reading path);
   the two long cards sit side by side underneath with equal heights. DOM order is unchanged. */
.hm-why .hm-card:first-child { grid-column: 1 / -1; }
.hm-card .hm-lastp { margin-bottom: 0; }

.hm-schemes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 28px; }
.hm-card a.hm-more { margin-top: auto; padding-top: 12px; font-weight: bold; color: #255D9D; align-self: flex-start; }
.hm-card a.hm-more:hover { color: #1D497C; }
.hm-more::after { content: ' \2192'; display: inline-block; }

/* ---------- Our Vision ---------- */
.hm .section .container > p.hm-note { background: #FFF6C2; border-left: 4px solid #FFDE39; padding: 16px 20px; font-size: 1.25rem; font-weight: bold; color: #1D497C; max-width: none; margin: 0 0 32px; line-height: 1.45; }
.hm-vision { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.hm-vision .hm-card { padding: 0; }
.hm-vision img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 1px solid #CFCFCF; }
.hm-vision .hm-body { padding: 24px; }

/* ---------- Call to action ---------- */
.hm-cta { background: #F4F4F4; border-top: 4px solid #FFDE39; border-left: 4px solid #4073AF; padding: 28px; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.hm-cta h2 { font-size: 1.5rem; font-weight: bold; color: #255D9D; line-height: 1.25; margin: 0 0 14px; }
.hm-btn { box-sizing: border-box; display: inline-block; max-width: 100%; min-height: 46px; padding: 12px 24px; background: #4073AF; border: 2px solid #4073AF; color: #FFFFFF; font-size: 1rem; font-weight: bold; line-height: 1.3; text-align: center; text-decoration: none; overflow-wrap: anywhere; }
.hm-btn:hover,
.hm-btn:focus { background: #255D9D; border-color: #255D9D; color: #FFFFFF; text-decoration: none; }
.hm-cta-side p { margin: 14px 0 0; }

/* ---------- Text widths (win against ".section .container > p" in style.css) ---------- */
.hm .section .container > p.hm-threshold,
.hm .section .container > p.hm-lead,
.hm .section .container > p.hm-leadtext { max-width: 760px; }

/* ---------- 1100px and below ---------- */
@media (max-width: 1100px) {
    .hm-hero { grid-template-columns: 1fr; gap: 32px; }
    .hm-process { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hm-step, .hm-step:nth-child(n+5) { grid-column: auto; }
    .hm-step:nth-child(4n)::after { display: block; }
    .hm-step:nth-child(2n)::after,
    .hm-step:last-child::after { display: none; }
    .hm-why,
    .hm-schemes,
    .hm-vision,
    .hm-cta { grid-template-columns: 1fr; }
}

/* ---------- 640px and below ---------- */
@media (max-width: 640px) {
    .hm-process { grid-template-columns: 1fr; gap: 64px 0; }
    .hm-step::after,
    .hm-step:nth-child(4n)::after { right: auto; left: 50%; top: auto; bottom: -52px; width: 24px; height: 40px; margin-left: -12px; display: block; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='40' viewBox='0 0 24 40'%3E%3Cpath d='M12 1V35M3 26L12 36L21 26' fill='none' stroke='%234073AF' stroke-width='3' stroke-linecap='square'/%3E%3C/svg%3E") no-repeat center / 24px 40px; }
    .hm-step:nth-child(2n)::after { display: block; }
    .hm-step:last-child::after { display: none; }
    .hm-facts,
    .hm-card { padding: 20px; }
    .hm-vision .hm-card { padding: 0; }
    .hm-vision .hm-body { padding: 20px; }
    .hm-cta { padding: 24px 20px; }
}

/* The process list uses the full container width (style.css limits "ol" in a section to 760px) */
.hm .section .container > ol.hm-process { max-width: none; }
