/*
 * Home page sections added in 3.46.0 (hero credentials, structure fit,
 * network band, case studies, testimonials). Loaded on the front page only.
 * Colours follow the live brand: green #83c045 / #6fa339, ink #1A1A1A.
 * Shared buttons and labels live in custom-sections.css.
 */

.home-fit-rail [role="tab"]:focus-visible,
.home-fit-panel:focus-visible {
    outline: 2px solid #6fa339;
    outline-offset: 2px;
}

/* Hero credentials -------------------------------------------------- */
.home-hero-credentials {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 2rem 0 0;
    padding: 0;
}

.home-hero-credentials li {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #e5e7eb;
    border-radius: 0.125rem;
    color: #1A1A1A;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.375rem 0.875rem;
    text-transform: uppercase;
}

/* Structure fit ----------------------------------------------------- */
.home-fit-layout {
    border-top: 1px solid #e5e7eb;
    display: grid;
    grid-template-columns: 18rem minmax(0, 1fr);
    margin-top: 3rem;
}

.home-fit-select-label {
    display: none;
}

.home-fit-rail {
    border-right: 1px solid #e5e7eb;
}

.home-fit-rail [role="tab"] {
    background: none;
    border: 0;
    border-bottom: 1px solid #e5e7eb;
    color: #1A1A1A;
    cursor: pointer;
    display: block;
    font: inherit;
    padding: 1.25rem 1.75rem 1.25rem 1rem;
    position: relative;
    text-align: left;
    transition: background-color 0.2s;
    width: 100%;
}

.home-fit-rail [role="tab"]:last-child {
    border-bottom: 0;
}

.home-fit-rail [role="tab"]::after {
    background: #83c045;
    bottom: -1px;
    content: "";
    opacity: 0;
    position: absolute;
    right: -2px;
    top: -1px;
    transition: opacity 0.2s;
    width: 3px;
}

.home-fit-rail [role="tab"]:hover,
.home-fit-rail [role="tab"][aria-selected="true"] {
    background: #F9FAFB;
}

.home-fit-rail [role="tab"][aria-selected="true"]::after {
    opacity: 1;
}

.home-fit-tab-label {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.home-fit-tab-summary {
    color: #6b7280;
    display: block;
    font-size: 0.875rem;
    line-height: 1.45;
}

.home-fit-panel {
    padding: 2.25rem 0 2.25rem 3.5rem;
}

.home-fit-panel[hidden] {
    display: none;
}

.home-fit-panel.is-entering {
    animation: home-fit-in 0.25s ease both;
}

@keyframes home-fit-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .home-fit-panel.is-entering { animation: none; }
}

.home-fit-situation {
    color: #1A1A1A;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.5;
    margin: 0 0 2rem;
}

.home-fit-questions {
    list-style: none;
    margin: 0 0 2.5rem;
    padding: 0;
}

.home-fit-questions li {
    border-bottom: 1px solid #f3f4f6;
    color: #333333;
    font-size: 1rem;
    line-height: 1.55;
    padding: 0.7rem 0 0.7rem 1.5rem;
    position: relative;
}

.home-fit-questions li:last-child {
    border-bottom: 0;
}

.home-fit-questions li::before {
    background: #83c045;
    border-radius: 50%;
    content: "";
    height: 7px;
    left: 2px;
    position: absolute;
    top: 1.25rem;
    width: 7px;
}

.home-fit-diagram {
    background: #F9FAFB;
    border: 1px solid #f3f4f6;
    display: grid;
    gap: 2.5rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    list-style: none;
    margin: 0 0 2.25rem;
    padding: 1.75rem;
}

.home-fit-diagram li {
    position: relative;
}

/* Arrow between layers. */
.home-fit-diagram li + li::before {
    border-bottom: 4px solid transparent;
    border-left: 6px solid #83c045;
    border-top: 4px solid transparent;
    content: "";
    left: -1.6rem;
    position: absolute;
    top: 0.3rem;
}

.home-fit-layer-role {
    color: #83c045;
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
}

.home-fit-layer-name {
    color: #1A1A1A;
    display: block;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.5rem;
}

.home-fit-layer-detail {
    color: #6b7280;
    display: block;
    font-size: 0.875rem;
    line-height: 1.5;
}

.home-fit-points {
    list-style: none;
    margin: 0 0 2.25rem;
    padding: 0;
}

.home-fit-points li {
    border-left: 3px solid #83c045;
    margin-bottom: 1.25rem;
    padding-left: 1.125rem;
}

.home-fit-points li:last-child {
    margin-bottom: 0;
}

.home-fit-point-lead {
    color: #1A1A1A;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
    margin: 0 0 0.25rem;
}

.home-fit-point-text {
    color: #6b7280;
    font-size: 1rem;
    line-height: 1.625;
    margin: 0;
}

.home-fit-disclaimer {
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 0.75rem;
    line-height: 1.6;
    margin: 3rem 0 0;
    padding-top: 1.5rem;
}

/* Network band ------------------------------------------------------ */
/* Title across the top; text + button left, figures right; jurisdictions below. */
.home-network-grid {
    align-items: start;
    column-gap: 4rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.home-network-title {
    grid-column: 1 / -1;
    margin: 0 0 2rem;
}

.home-network-text {
    color: #d1d5db;
    line-height: 1.7;
    margin: 0 0 2rem;
}

/* One shared figure column (as wide as the widest figure) so every
   description starts at the same x, whatever figures editors enter. */
.home-network-facts {
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    column-gap: 1.5rem;
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    margin: 0;
}

.home-network-facts > div {
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    padding: 1.25rem 0;
}

.home-network-facts dt {
    color: #83c045;
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
}

.home-network-facts dd {
    color: #e5e7eb;
    font-size: 1rem;
    line-height: 1.5;
    margin: 0;
}

.home-network-note {
    color: #9ca3af;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 1rem 0 0;
}

.home-network-places {
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    grid-column: 1 / -1;
    margin-top: 3rem;
    padding-top: 2rem;
}

/* Tight enough that all twelve tags fit one row on a laptop screen. */
.home-network-jurisdictions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.home-network-jurisdictions li {
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 0.125rem;
    color: #f3f4f6;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.375rem 0.625rem;
    text-transform: uppercase;
}

/* Case studies + testimonials ------------------------------------- */
.home-cases {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 3rem 0 4rem;
}

.home-case {
    background: #fff;
    border: 1px solid #f3f4f6;
    border-radius: 0.125rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 2rem 1.75rem;
}

.home-case .jenga-eyebrow {
    letter-spacing: 0.06em;
}

.home-case-structure {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
}

.home-case-structure li {
    border-left: 2px solid #83c045;
    color: #1A1A1A;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    padding: 0.5rem 0 0.5rem 1rem;
}

.home-case-structure li + li {
    margin-top: 2px;
}

.home-case-details {
    font-size: 0.875rem;
    line-height: 1.6;
    margin: 0;
}

.home-case-details dt {
    color: #1A1A1A;
    font-weight: 700;
    margin-top: 0.625rem;
}

.home-case-details dt:first-child {
    margin-top: 0;
}

.home-case-details dd {
    color: #6b7280;
    margin: 0;
}

.home-testimonials {
    border-top: 1px solid #e5e7eb;
    display: grid;
    gap: 2.5rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-top: 3rem;
}

.home-testimonials figure {
    margin: 0;
}

.home-testimonials blockquote {
    color: #1A1A1A;
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.55;
    margin: 0 0 1.25rem;
}

.home-testimonials figcaption {
    color: #1A1A1A;
    font-size: 0.875rem;
    font-weight: 700;
}

.home-testimonial-scope {
    border-top: 1px solid #f3f4f6;
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0.75rem 0 0;
    padding-top: 0.75rem;
}

/* Tablet and mobile ------------------------------------------------- */
@media (max-width: 1023px) {
    .home-network-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-network-figures {
        margin-top: 2.5rem;
    }

    .home-cases,
    .home-testimonials {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 899px) {
    .home-fit-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Tabs become a horizontal, swipeable strip. */
    .home-fit-rail {
        border-bottom: 1px solid #e5e7eb;
        border-right: 0;
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .home-fit-rail [role="tab"] {
        border-bottom: 0;
        border-right: 1px solid #e5e7eb;
        flex: none;
        padding: 0.9rem 1.25rem;
        white-space: nowrap;
        width: auto;
    }

    .home-fit-rail [role="tab"]::after {
        bottom: 0;
        height: 3px;
        left: 0;
        right: 0;
        top: auto;
        width: auto;
    }

    .home-fit-tab-summary {
        display: none;
    }

    .home-fit-panel {
        padding: 1.75rem 0 0;
    }

    .home-fit-situation {
        font-size: 1.125rem;
    }

    .home-fit-diagram {
        gap: 0;
        grid-template-columns: minmax(0, 1fr);
        padding: 0.5rem 1.25rem;
    }

    .home-fit-diagram li {
        border-bottom: 1px solid #e5e7eb;
        padding: 1rem 0;
    }

    .home-fit-diagram li:last-child {
        border-bottom: 0;
    }

    .home-fit-diagram li + li::before {
        display: none;
    }
}

/* Compact phones: readable scenario cards replace the swipe-only tab strip. */
@media (max-width: 767px) {
    .home-fit-select-label {
        color: #6fa339;
        display: block;
        font-size: 0.875rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        margin: 1.75rem 0 0.75rem;
        text-transform: uppercase;
    }

    .home-fit-layout {
        border-top: 0;
        margin-top: 0;
    }

    .home-fit-rail {
        border: 0;
        display: grid;
        gap: 0.625rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: visible;
    }

    .home-fit-rail [role="tab"] {
        background: #fff;
        border: 1px solid #d9dee5;
        border-radius: 0.375rem;
        min-height: 5.5rem;
        padding: 2rem 0.75rem 0.75rem;
        white-space: normal;
        width: 100%;
        overflow-wrap: anywhere;
    }

    .home-fit-rail [role="tab"]:last-child {
        border: 1px solid #d9dee5;
    }

    .home-fit-rail [role="tab"]:hover,
    .home-fit-rail [role="tab"][aria-selected="true"] {
        background: #f5faef;
    }

    .home-fit-rail [role="tab"][aria-selected="true"] {
        border-color: #83c045;
    }

    .home-fit-rail [role="tab"]::after {
        align-items: center;
        background: #83c045;
        border-radius: 50%;
        bottom: auto;
        color: #fff;
        content: "✓";
        display: flex;
        font-size: 0.75rem;
        font-weight: 700;
        height: 1.25rem;
        justify-content: center;
        left: auto;
        opacity: 0;
        right: 0.625rem;
        top: 0.625rem;
        width: 1.25rem;
    }

    .home-fit-rail [role="tab"][aria-selected="true"]::after {
        opacity: 1;
    }

    .home-fit-tab-label {
        font-size: 0.9375rem;
        line-height: 1.4;
        margin: 0;
    }
}
