/**
 * Industry cards
 *
 * One card component for the three places that list industries: the homepage
 * section, the industries hub, and the services hub. The markup comes from
 * ServicePageKit::industryCards() and the words come from
 * includes/service-page-kit/industries.php.
 *
 * The file stands alone. It carries its own color tokens, so it works on the
 * homepage, which does not load the Service Page Kit stylesheet.
 *
 * Contrast, computed against WCAG 2.1 by tests/test-industry-alignment.php:
 * every text color on every surface it sits on is at least 4.5 to 1, and the
 * control border and the focus ring are at least 3 to 1.
 *
 * The brand palette has no purple, and this file adds none.
 *
 * @see docs/industry-pages-alignment.html
 */

.spk-indcards,
.spk-indfilter,
.home-industries {
    --ic-teal: #003737;
    --ic-teal-hover: #004d4d;
    --ic-green: #036d4a;
    --ic-ink: #0f172a;
    --ic-text: #1e293b;
    --ic-line: #d5e3df;
    --ic-control: #3e534f;
    --ic-tint: #e8f3ef;
    --ic-surface: #ffffff;
    --ic-section: #f8fafc;
    --ic-focus: #7a5c00;
    --ic-font-head: 'Space Grotesk', 'Space Grotesk Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --ic-font-body: 'Noto Sans', 'Noto Sans Fallback', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ------------------------------------------------------------------------
   Card grid
   ------------------------------------------------------------------------ */
.spk-indcards {
    display: grid;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-family: var(--ic-font-body);
}
@media (min-width: 640px) {
    .spk-indcards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}
@media (min-width: 1040px) {
    .spk-indcards--hub,
    .spk-indcards--compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .spk-indcards--home { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.spk-indcard {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 28px 26px 26px;
    border: 1px solid var(--ic-line);
    border-radius: 18px;
    background: var(--ic-surface);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.spk-indcard[hidden] { display: none; }
.spk-indcard:hover,
.spk-indcard:focus-within {
    border-color: var(--ic-teal);
    box-shadow: 0 18px 36px -24px rgba(0, 55, 55, 0.5);
}
.spk-indcard:hover { transform: translateY(-3px); }

.spk-indcard__icon {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 13px;
    background: var(--ic-tint);
    color: var(--ic-teal);
    font-size: 1.3rem;
    line-height: 1;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.spk-indcard:hover .spk-indcard__icon,
.spk-indcard:focus-within .spk-indcard__icon {
    background: var(--ic-teal);
    color: #ffffff;
}

.spk-indcard__title {
    margin: 4px 0 0;
    color: var(--ic-ink);
    font-family: var(--ic-font-head);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
}
.spk-indcard__text {
    flex: 1 1 auto;
    margin: 0;
    color: var(--ic-text);
    font-size: 0.975rem;
    line-height: 1.65;
}

/* The link text stays short and names the industry. Its ::after covers the
   whole card, so the card is one large tap target with one accessible name. */
.spk-indcard__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    margin-top: 6px;
    color: var(--ic-teal);
    font-family: var(--ic-font-head);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}
.spk-indcard__link:hover { color: var(--ic-green); }
.spk-indcard__link::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
}
.spk-indcard__link i { transition: transform 0.2s ease; }
.spk-indcard:hover .spk-indcard__link i { transform: translateX(4px); }
.spk-indcard__link:focus { outline: none; }
.spk-indcard__link:focus-visible::after {
    outline: 3px solid var(--ic-focus);
    outline-offset: 3px;
    box-shadow: 0 0 0 3px #ffffff;
}

/* The last card on a hub: for a visitor whose industry is not listed. */
.spk-indcard--ask { border-color: var(--ic-teal); background: var(--ic-teal); }
.spk-indcard--ask .spk-indcard__title,
.spk-indcard--ask .spk-indcard__text,
.spk-indcard--ask .spk-indcard__link,
.spk-indcard--ask .spk-indcard__link:hover { color: #ffffff; }
.spk-indcard--ask .spk-indcard__icon,
.spk-indcard--ask:hover .spk-indcard__icon,
.spk-indcard--ask:focus-within .spk-indcard__icon { background: #ffffff; color: var(--ic-teal); }
.spk-indcard--ask:hover,
.spk-indcard--ask:focus-within { border-color: var(--ic-teal-hover); background: var(--ic-teal-hover); }

.spk-indcards--compact .spk-indcard { padding: 24px 22px; gap: 10px; }
.spk-indcards--compact .spk-indcard__title { font-size: 1.1rem; }

/* ------------------------------------------------------------------------
   Hub filter. It is rendered hidden and shown by assets/js/industry-cards.js,
   so a visitor without JavaScript sees every card and no dead control.
   ------------------------------------------------------------------------ */
.spk-indfilter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 0 32px;
    font-family: var(--ic-font-body);
}
.spk-indfilter[hidden] { display: none; }
.spk-indfilter__label {
    flex: 0 0 100%;
    margin: 0 0 6px;
    color: var(--ic-ink);
    font-family: var(--ic-font-head);
    font-size: 1.02rem;
    font-weight: 700;
    text-align: center;
}
.spk-indfilter__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 20px;
    border: 2px solid var(--ic-control);
    border-radius: 999px;
    background: var(--ic-surface);
    color: var(--ic-teal);
    font-family: var(--ic-font-head);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.spk-indfilter__btn:hover { border-color: var(--ic-teal); background: var(--ic-tint); }
.spk-indfilter__btn[aria-pressed="true"] {
    border-color: var(--ic-teal);
    background: var(--ic-teal);
    color: #ffffff;
}
.spk-indfilter__btn:focus-visible {
    outline: 3px solid var(--ic-focus);
    outline-offset: 3px;
    box-shadow: 0 0 0 3px #ffffff;
}
.spk-indfilter__status {
    flex: 0 0 100%;
    min-height: 1.6em;
    margin: 8px 0 0;
    color: var(--ic-text);
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: center;
}

/* ------------------------------------------------------------------------
   Homepage section
   ------------------------------------------------------------------------ */
.home-industries {
    padding: 80px 0;
    background: var(--ic-section);
    font-family: var(--ic-font-body);
}
.home-industries__wrap {
    width: min(100% - 40px, 1290px);
    margin-inline: auto;
}
.home-industries__head {
    max-width: 800px;
    margin: 0 auto 48px;
    text-align: center;
}
.home-industries__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    padding: 8px 16px;
    border: 1px solid var(--ic-line);
    border-radius: 999px;
    background: var(--ic-surface);
    color: var(--ic-teal);
    font-family: var(--ic-font-head);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.home-industries__title {
    margin: 0;
    color: var(--ic-ink);
    font-family: var(--ic-font-head);
    font-size: clamp(1.875rem, 3.2vw, 2.75rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-wrap: balance;
}
.home-industries__lead {
    max-width: 680px;
    margin: 18px auto 0;
    color: var(--ic-text);
    font-size: 1.1rem;
    line-height: 1.7;
}
.home-industries__more {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 18px;
    margin: 44px 0 0;
    color: var(--ic-text);
    font-size: 1.05rem;
    line-height: 1.6;
    text-align: center;
}
.home-industries__more-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 22px;
    border: 2px solid var(--ic-teal);
    border-radius: 12px;
    background: var(--ic-surface);
    color: var(--ic-teal);
    font-family: var(--ic-font-head);
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.home-industries__more-link:hover {
    background: var(--ic-teal);
    color: #ffffff;
}
.home-industries__more-link:focus-visible {
    outline: 3px solid var(--ic-focus);
    outline-offset: 3px;
    box-shadow: 0 0 0 3px #ffffff;
}

@media (max-width: 639.98px) {
    .home-industries { padding: 64px 0; }
    .home-industries__head { margin-bottom: 36px; }
    .spk-indcard { padding: 24px 22px; }
}

/* ------------------------------------------------------------------------
   Preferences
   ------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .spk-indcard,
    .spk-indcard__icon,
    .spk-indcard__link i,
    .spk-indfilter__btn,
    .home-industries__more-link { transition: none; }
    .spk-indcard:hover { transform: none; }
    .spk-indcard:hover .spk-indcard__link i { transform: none; }
}
@media (forced-colors: active) {
    .spk-indcard { border-color: CanvasText; }
    .spk-indcard__link:focus-visible::after,
    .spk-indfilter__btn:focus-visible,
    .home-industries__more-link:focus-visible { outline-color: Highlight; box-shadow: none; }
    .spk-indfilter__btn[aria-pressed="true"] { background: Highlight; color: HighlightText; border-color: Highlight; }
}
