/*
 * The Rozwiązania hub and the case-study pages (inc/case-studies.php), after the owner's
 * drawings of 2026-10-21. Only the site's own tokens from site.css: the drawings were
 * redrawn in the site's type and colours, not the other way round.
 *
 * The case page's tab row is sticky under the header, so its `top` adds --topline-h like
 * every other sticky element (CLAUDE.md, Conventions).
 */

/* ------------------------------------------------------------- hub: the cases */

/* The buttons are inline-flex, which drops the space between a label and its arrow. */
.case-side .primary-action, .case-empty .primary-action { gap: 8px; }

.case-hub-intro { max-width: 430px; margin: 0; color: var(--muted); font-size: 14.5px; line-height: var(--leading-body); }
.case-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.case-filters a { padding: 9px 15px; color: var(--navy); background: #fff; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; font-weight: 750; }
.case-filters a:hover { border-color: var(--navy); }
.case-filters a.is-active { color: #fff; background: var(--navy); border-color: var(--navy); }
.case-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.case-search { width: min(440px, 100%); height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.case-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(45, 98, 220, .08); }
.case-search svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.case-search input { min-width: 0; height: 100%; flex: 1; color: var(--navy); background: transparent; border: 0; outline: 0; }
.case-count { margin: 0; color: var(--muted); font-size: 13px; }
.case-count strong { color: var(--navy); }

.case-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.case-card { display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); transition: transform .22s ease, box-shadow .22s ease, border .22s ease; }
.case-card[hidden] { display: none; }
.case-card:hover { border-color: rgba(45, 98, 220, .35); box-shadow: var(--shadow); transform: translateY(-4px); }
.case-card-media { position: relative; aspect-ratio: 16 / 8.6; overflow: hidden; background: var(--ice); }
.case-card-media a, .case-card-media img { width: 100%; height: 100%; display: block; }
.case-card-media img { object-fit: cover; }
.case-status { padding: 6px 10px; color: var(--navy); background: #fff; border-radius: 7px; font-size: 10.5px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.case-card-media .case-status { position: absolute; left: 14px; top: 14px; box-shadow: 0 6px 18px rgba(9, 24, 71, .12); }
.case-status.is-przyklad { color: #75560f; background: #fff4d6; }
.case-status.is-projekt { color: #0f6873; background: #dff7fa; }
.case-status.is-propozycja { color: #2d3f8c; background: #eaefff; }
.case-card-body { display: flex; flex: 1; flex-direction: column; padding: 20px 22px 18px; }
.case-card-sector { margin: 0 0 8px; color: var(--blue); font-size: 11px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.case-card h3 { margin: 0 0 8px; color: var(--navy); font-size: 1.12rem; line-height: 1.25; letter-spacing: -.02em; }
.case-card h3 a:hover { color: var(--blue); }
.case-card-body > p:not(.case-card-sector) { margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.case-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.case-card-foot a { color: var(--navy); font-size: 13px; font-weight: 800; }
.case-card-foot a:hover { color: var(--blue); }
.case-card-foot span { color: var(--muted); font-size: 12px; text-align: right; }
.case-empty { display: grid; justify-items: center; gap: 6px; margin-top: 6px; padding: 40px 24px; text-align: center; background: var(--soft); border: 1px dashed var(--line); border-radius: var(--radius); }
.case-empty[hidden] { display: none; }
.case-empty strong { color: var(--navy); font-size: 1.1rem; }
.case-empty p { max-width: 520px; margin: 0 0 12px; color: var(--muted); }

.case-feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 46px; overflow: hidden; color: #fff; background: radial-gradient(circle at 10% 0, rgba(40, 183, 201, .22), transparent 35%), var(--navy); border-radius: 24px; }
.case-feature-copy { align-self: center; padding: 44px; }
.case-feature h2 { margin: 0 0 16px; color: #fff; font-size: clamp(1.45rem, 2.3vw, 2.05rem); line-height: 1.15; letter-spacing: -.03em; }
.case-feature-copy > p:not(.eyebrow) { margin: 0 0 24px; color: rgba(255, 255, 255, .72); font-size: var(--text-body); line-height: var(--leading-body); }
.case-feature-link { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; color: var(--navy); background: #fff; border-radius: 11px; font-weight: 850; }
.case-feature-media { min-height: 300px; }
.case-feature-media img { width: 100%; height: 100%; object-fit: cover; }

.case-context-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.case-context-grid > div { padding: 26px; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.case-context-label { margin: 0 0 14px; color: var(--blue); font-size: 11.5px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.case-context-grid h3 { margin: 0 0 8px; color: var(--navy); font-size: 1.1rem; letter-spacing: -.02em; }
.case-context-grid p:not(.case-context-label) { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }

.case-cta { padding: 46px 0; color: #fff; background: radial-gradient(circle at 85% 0, rgba(40, 183, 201, .26), transparent 30%), linear-gradient(110deg, var(--navy), #13306f); }
.case-cta-grid { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.case-cta h2 { margin: 0 0 10px; color: #fff; font-size: clamp(1.5rem, 2.6vw, 2.2rem); line-height: 1.1; letter-spacing: -.04em; }
.case-cta-grid > div > p:not(.eyebrow) { max-width: 640px; margin: 0; color: rgba(255, 255, 255, .72); font-size: var(--text-body); line-height: var(--leading-body); }
.case-cta-actions { display: flex; flex: none; flex-direction: column; gap: 10px; }
.case-cta-primary, .case-cta-secondary { min-width: 250px; padding: 14px 22px; border-radius: 11px; font-weight: 850; text-align: center; }
.case-cta-primary { color: var(--navy); background: #fff; }
.case-cta-secondary { color: #fff; border: 1px solid rgba(255, 255, 255, .3); }
.case-cta-secondary:hover { border-color: rgba(255, 255, 255, .7); }

/* ---------------------------------------------------------------- case page */

.case-hero { padding-bottom: 40px; }
.case-hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); align-items: center; gap: 48px; }
.case-hero h1 { font-size: clamp(2rem, 3.8vw, 3.35rem); }
.case-hero .lead { margin-bottom: 0; }
.case-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.case-badges > span:not(.case-status) { padding: 6px 11px; color: var(--navy); background: #fff; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; font-weight: 750; }
.case-badges .case-status { border-radius: 999px; }
.case-stats { display: flex; flex-wrap: wrap; gap: 14px 40px; margin: 28px 0 0; padding: 22px 0 0; list-style: none; border-top: 1px solid var(--line); }
.case-stats strong { display: block; color: var(--navy); font-size: 1.55rem; letter-spacing: -.03em; line-height: 1.15; }
.case-stats span { color: var(--muted); font-size: 12px; }
.case-hero-media { margin: 0; aspect-ratio: 16 / 10; overflow: hidden; background: var(--ice); border-radius: 22px; box-shadow: var(--shadow); }
.case-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.case-hero-media { position: relative; }
.case-hero-caption { position: absolute; left: 12px; bottom: 12px; padding: 4px 10px; color: #fff; background: rgba(9, 24, 71, .62); border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .02em; }

.case-tabs { position: sticky; top: calc(77px + var(--topline-h)); z-index: 40; background: rgba(255, 255, 255, .95); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.case-tabs .wrap { display: flex; gap: 28px; overflow-x: auto; scrollbar-width: none; }
.case-tabs a { flex: none; padding: 15px 0 13px; color: var(--muted); border-bottom: 2px solid transparent; font-size: 13.5px; font-weight: 800; }
.case-tabs a:hover, .case-tabs a:focus-visible { color: var(--navy); border-bottom-color: var(--blue); }

.case-section { scroll-margin-top: 56px; }
.case-section h2 { margin: 0 0 16px; color: var(--navy); font-size: clamp(1.5rem, 2.6vw, 2.2rem); line-height: 1.1; letter-spacing: -.04em; }
.case-label { margin: 0 0 10px; color: var(--blue); font-size: 11.5px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.case-split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 48px; }
.case-text, .case-intro { max-width: 760px; margin: 0; color: var(--muted); font-size: var(--text-body); line-height: var(--leading-body); }
.case-text + .case-text { margin-top: 14px; }
.case-goal { margin: 22px 0 38px; padding: 14px 18px; color: var(--navy); background: var(--ice); border-left: 3px solid var(--blue); border-radius: 0 12px 12px 0; font-size: 14.5px; line-height: 1.55; }
.case-side { display: flex; flex-direction: column; gap: 10px; padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 38px rgba(9, 24, 71, .06); }
.case-side .case-label { margin-bottom: 2px; }
.case-side-title { color: var(--navy); font-size: 1.05rem; line-height: 1.3; }
.case-side-meta { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.case-side-note { margin: 4px 0 6px; padding-top: 12px; color: var(--muted); border-top: 1px solid var(--line); font-size: 12.5px; line-height: 1.5; }
.case-side .primary-action, .case-side .secondary-action { width: 100%; }
.case-profile { display: grid; gap: 10px; margin: 6px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.case-profile dt { color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.case-profile dd { margin: 2px 0 0; color: var(--navy); font-size: 13.5px; font-weight: 650; line-height: 1.45; }
button.primary-action { border: 0; cursor: pointer; }

/* 02 / Zasada działania, the owner's drawing of 2026-10-25: a path of the signal as three
   stages left to right, the middle one — what receives the signal — on the dark card, and the
   path's payoff under a rule. Several paths are tabs once solutions.js has run; before that
   every path is shown under its own name. The arrows sit in the 92 px gap, level with the
   icons. */
.case-flow { margin-top: 44px; }
.case-flow-tabs { display: flex; gap: 44px; margin-bottom: 48px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.case-flow-tabs[hidden] { display: none; }
.case-flow-tabs button { flex: none; margin-bottom: -1px; padding: 0 0 16px; color: var(--muted); background: none; border: 0; border-bottom: 3px solid transparent; font-size: 16px; font-weight: 650; cursor: pointer; }
.case-flow-tabs button[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--blue); }
.case-flow-tabs button:hover, .case-flow-tabs button:focus-visible { color: var(--navy); }
.case-flow-path + .case-flow-path { margin-top: 56px; }
.case-flow.is-tabbed .case-flow-path { margin-top: 0; }
.case-flow-name { margin: 0 0 8px; color: var(--navy); font-size: 1.1rem; }
.case-flow.is-tabbed .case-flow-name { display: none; }
.case-flow-stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 92px; margin: 0; padding: 0; list-style: none; }
.case-flow-stage { position: relative; padding: 32px 0; }
.case-flow-stage.is-key { padding-inline: 34px; background: var(--navy); border-radius: 14px; box-shadow: 0 18px 44px rgba(9, 24, 71, .18); }
.case-flow-role { margin: 0 0 40px; color: var(--muted); font-size: 12.5px; font-weight: 800; letter-spacing: .14em; line-height: 1.45; text-transform: uppercase; }
.case-flow-icons { display: flex; gap: 16px; margin-bottom: 44px; color: var(--blue); }
.case-flow-icons svg, .case-flow-arrow svg { width: 28px; height: 28px; stroke-width: 1.6; }
.case-flow-title { display: block; color: var(--navy); font-size: clamp(1.45rem, 2.2vw, 1.9rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; overflow-wrap: anywhere; }
.case-flow-sub { display: block; margin-top: 8px; color: var(--muted); font-size: 15px; font-weight: 600; line-height: 1.45; }
.case-flow-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 20px; color: var(--navy); font-size: 15px; font-weight: 750; }
.case-flow-chips i { color: var(--blue); font-style: normal; }
.case-flow-text { margin: 20px 0 0; color: var(--muted); font-size: var(--text-body); line-height: var(--leading-body); }
.case-flow-stage.is-key .case-flow-role, .case-flow-stage.is-key .case-flow-icons, .case-flow-stage.is-key .case-flow-chips i { color: #9fbcff; }
.case-flow-stage.is-key .case-flow-title, .case-flow-stage.is-key .case-flow-chips { color: #fff; }
.case-flow-stage.is-key .case-flow-sub { color: rgba(255, 255, 255, .86); }
.case-flow-stage.is-key .case-flow-text { color: rgba(255, 255, 255, .74); }
.case-flow-arrow { position: absolute; top: 88px; right: -64px; display: flex; color: var(--blue); }
.case-flow-note { display: flex; align-items: flex-start; gap: 18px; margin: 40px 0 0; padding-top: 32px; color: var(--muted); border-top: 1px solid var(--line); font-size: var(--text-body); line-height: var(--leading-body); }
.case-flow-note svg { width: 26px; height: 26px; flex: none; color: var(--blue); stroke-width: 1.6; }
.case-flow-note strong { color: var(--navy); }
.case-footnote { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.case-flow + .case-footnote { margin-top: 22px; }

.case-head { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.case-head > p { max-width: 380px; margin: 0; color: var(--muted); font-size: 13.5px; }
/* The catalogue's miniature cards (.catalog-grid.is-compact), four to a row as beside the
   catalogue's filters. The role is the case's own sentence, so it is never cut to three
   lines as a description is; the button sits at the card's foot, where a customer's
   card-buy block stands in the catalogue. */
.case-devices { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.case-devices.catalog-grid.is-compact .catalog-card p { display: block; min-height: 0; overflow: visible; -webkit-line-clamp: none; }
.case-devices.catalog-grid.is-compact .catalog-card .case-device-qty { margin-top: 8px; color: var(--navy); }
.case-device-badge { align-self: flex-start; margin-bottom: 8px; padding: 3px 8px; color: var(--muted); background: var(--soft); border-radius: 999px; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.case-devices .case-device-add { order: 2; width: 100%; min-height: 36px; margin: 12px 0 0; padding: 8px 13px; color: var(--navy); background: var(--ice); border: 1px solid rgba(45, 98, 220, .22); border-radius: 10px; text-align: center; }
.case-devices .case-device-add:hover, .case-devices .case-device-add:focus-visible { color: #fff; background: var(--blue); border-color: var(--blue); }
.case-device.is-generic > .device-visual { opacity: .65; }
.case-device.is-generic:hover { border-color: var(--line); box-shadow: none; transform: none; }
.case-device-empty { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px; background: var(--soft); border: 1px dashed var(--line); border-radius: 18px; }
.case-device-empty p { margin: 0; color: var(--muted); }

.case-benefits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-top: 26px; }
.case-benefits > div { padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.case-benefit-icon { width: 40px; height: 40px; display: grid; place-items: center; color: var(--blue); background: var(--ice); border-radius: 11px; }
.case-benefit-icon svg { width: 20px; height: 20px; }
.case-benefits h3 { margin: 16px 0 6px; color: var(--navy); font-size: 1.02rem; }
.case-benefits p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

.case-checks { margin: 22px 0 14px; padding: 24px; background: var(--soft); border: 1px solid var(--line); border-radius: 18px; }
.case-checks h3 { margin: 0 0 12px; color: var(--navy); font-size: 1rem; }
.case-checks ul { margin: 0; padding-left: 20px; color: var(--ink); font-size: 14.5px; line-height: 1.55; }
.case-checks li + li { margin-top: 8px; }
.case-back { margin-block: 30px 46px; }
.case-back a { color: var(--blue); font-size: 13.5px; font-weight: 800; }

/* ----------------------------------------------------------------- narrower */

@media (max-width: 1060px) {
	.case-hero-grid { grid-template-columns: 1fr; }
	.case-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.case-split { grid-template-columns: 1fr; }
	.case-feature { grid-template-columns: 1fr; }
	.case-hero-media { max-width: 620px; }
	.case-devices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.case-flow-stages { column-gap: 64px; }
	.case-flow-arrow { right: -50px; }
	.case-flow-stage.is-key { padding-inline: 24px; }
}

@media (max-width: 860px) {
	.case-context-grid, .case-benefits { grid-template-columns: 1fr; }
	.case-devices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.case-cta-grid { align-items: stretch; flex-direction: column; }
	.case-cta-primary, .case-cta-secondary { min-width: 0; }
}

@media (max-width: 760px) {
	.case-grid { grid-template-columns: 1fr; }
	.case-toolbar { align-items: stretch; flex-direction: column; }
	.case-search { width: 100%; }
	.case-feature-copy { padding: 28px; }
	.case-feature-media { min-height: 220px; }
	.case-tabs { top: calc(70px + var(--topline-h)); }
	.case-flow-tabs { gap: 28px; margin-bottom: 28px; }
	.case-flow-stages { grid-template-columns: 1fr; row-gap: 52px; }
	.case-flow-stage { padding: 0; }
	.case-flow-stage.is-key { padding: 26px 24px; }
	.case-flow-role, .case-flow-icons { margin-bottom: 18px; }
	.case-flow-arrow { top: auto; right: auto; bottom: -40px; left: 0; transform: rotate(90deg); }
	.case-head, .case-device-empty { align-items: flex-start; flex-direction: column; }
	.case-stats { gap: 14px 26px; }
}

/* In a low window the header scrolls away (wordpress.css), and the tab row goes with it. */
@media (max-height: 500px) {
	.case-tabs { position: static; }
}
