/* ============================================================
   /services/ -- the top section (title, search, categories).
   Deliberately plain and official: white band, navy text, the site's own blue for
   focus and the pressed chip. The cards below are the shared .svc-rd-card system
   (redesign.css), unchanged apart from the hidden states here.
   Palette: navy #0f172a (15:1 on white), slate #334155 / #475569 (9:1 / 7.5:1),
   blue #1d4ed8 (6.7:1 on white) with tint #eff6ff, line #cbd5e1.
   ============================================================ */

.sx-hero {
    font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #0f172a;
    background:
        radial-gradient(900px 320px at 50% -30%, #dbeafe 0%, rgba(219, 234, 254, 0) 70%),
        #eff6ff !important;
    border-bottom: 1px solid #bfdbfe;
    padding: clamp(1.25rem, 2.5vw, 2rem) 0 clamp(1.5rem, 3vw, 2.25rem) !important;
}
/* Same left/right edge as the rest of the redesign (see .cs-body in service-pages.css). */
.sx-hero > .container {
    max-width: none;
    width: 100%;
    padding-left: clamp(1.5rem, 6vw, 7rem);
    padding-right: clamp(1.5rem, 6vw, 7rem);
}
@media (min-width: 1280px) {
    .sx-hero > .container { padding-right: max(clamp(1.5rem, 6vw, 7rem), 108px); }
}

.sx-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.8rem; font-weight: 600; color: #475569; margin-bottom: clamp(0.9rem, 2vw, 1.25rem); }
.sx-crumbs a { display: inline-flex; align-items: center; min-height: 36px; color: #475569; text-decoration: none; }
.sx-crumbs a:hover { color: #1d4ed8; text-decoration: underline; }
.sx-crumbs span[aria-current] { color: #0f172a; }
.sx-crumbs span[aria-hidden] { color: #94a3b8; }

.sx-head { max-width: 62rem; margin: 0 auto; text-align: center; }
.sx-eyebrow { display: inline-block; margin-bottom: 0.8rem; padding: 0.3rem 0.8rem; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: #1d4ed8; background: #ffffff; border: 1px solid #bfdbfe; border-radius: 999px; }
.sx-hero h1 { margin: 0 0 0.8rem; font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif; font-size: clamp(1.8rem, 3.6vw, 2.7rem); font-weight: 700; line-height: 1.12; letter-spacing: -0.015em; color: #0f172a; }
.sx-intro { max-width: 52rem; margin: 0 auto; font-size: 1.03rem; line-height: 1.7; color: #334155; }

.sx-tools { margin-top: clamp(1.25rem, 2.5vw, 1.75rem); }
.sx-tools[hidden] { display: none; }

.sx-search { position: relative; max-width: 46rem; margin: 0 auto; }
.sx-search-ico { position: absolute; left: 1.1rem; top: 50%; width: 22px; height: 22px; margin-top: -11px; color: #475569; pointer-events: none; }
.sx-search input { width: 100%; min-height: 56px; padding: 0.8rem 5.2rem 0.8rem 3.2rem; font: inherit; font-size: 1.02rem; color: #0f172a; background: #ffffff; border: 2px solid #94a3b8; border-radius: 14px; -webkit-appearance: none; appearance: none; }
.sx-search input::placeholder { color: #64748b; }
.sx-search input:focus { outline: 3px solid rgba(29, 78, 216, 0.35); outline-offset: 1px; border-color: #1d4ed8; }
.sx-search input::-webkit-search-cancel-button { display: none; }
.sx-clear { position: absolute; right: 0.55rem; top: 50%; transform: translateY(-50%); min-height: 40px; padding: 0 0.9rem; font: inherit; font-size: 0.85rem; font-weight: 700; color: #1d4ed8; background: #eff6ff; border: 0; border-radius: 10px; cursor: pointer; }
.sx-clear[hidden] { display: none; }
.sx-clear:hover { background: #dbeafe; }
.sx-clear:focus-visible, .sx-chip:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }

.sx-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin-top: 1rem; }
.sx-chip { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 42px; padding: 0.4rem 0.95rem; font: inherit; font-size: 0.88rem; font-weight: 700; color: #0f172a; background: #ffffff; border: 1.5px solid #cbd5e1; border-radius: 999px; cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease; }
.sx-chip span { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 0.4rem; font-size: 0.75rem; font-weight: 800; color: #334155; background: #e2e8f0; border-radius: 999px; }
.sx-chip[aria-pressed="true"] { color: #ffffff; background: #1d4ed8; border-color: #1d4ed8; }
.sx-chip[aria-pressed="true"] span { color: #1d4ed8; background: #ffffff; }
@media (hover: hover) and (pointer: fine) {
    .sx-chip[aria-pressed="false"]:hover { background: #eff6ff; border-color: #1d4ed8; }
}
.sx-status { margin: 0.9rem 0 0; text-align: center; font-size: 0.88rem; font-weight: 600; color: #475569; }

/* Hidden states (author display rules would otherwise beat the hidden attribute). */
.svc-rd-card[hidden], [data-sx-grid][hidden], .sx-empty[hidden] { display: none !important; }

.sx-empty { max-width: 40rem; margin: 0 auto; padding: 2rem 1.5rem; text-align: center; background: #ffffff; border: 1px solid #cbd5e1; border-radius: 18px; }
.sx-empty h2 { margin: 0 0 0.5rem; font-family: "Space Grotesk", "Plus Jakarta Sans", sans-serif; font-size: 1.4rem; color: #0f172a; }
.sx-empty p { margin: 0 0 1.1rem; font-size: 0.95rem; line-height: 1.6; color: #475569; }
.sx-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }

@media (prefers-reduced-motion: reduce) {
    .sx-chip { transition: none !important; }
}
@media (max-width: 640px) {
    .sx-search input { padding-right: 4.6rem; font-size: 0.95rem; }
    .sx-chips { gap: 0.4rem; }
    .sx-chip { font-size: 0.82rem; padding: 0.35rem 0.8rem; }
}

/* Long corner tags (for example "RRSP & TFSA Over-Contribution Tax Help") must wrap inside
   their card instead of stretching the grid column past the screen edge. */
.svcs-rd-list .svc-rd-card { min-width: 0; }
.svcs-rd-list .svc-rd-card-top { flex-wrap: wrap; gap: 0.6rem; }
.svcs-rd-list .svc-rd-tags { flex-wrap: wrap; justify-content: flex-end; min-width: 0; max-width: 100%; }
.svcs-rd-list .svc-rd-tag { white-space: normal; text-align: center; line-height: 1.3; }
