/* ==========================================================================
   Blok „Zakładki” (.tabs): na komputerze lista + otwarty panel, na telefonie akordeon.
   Źródło: assets/css/podstrona.css (Tabs…), podstrony/outsourcing.css (.os-scope = wygląd „karta”).
   ========================================================================== */

.zakladki--brak { border-top: 0; }
.zakladki--separator { border-top: 0; padding-top: 0; }
/* a hairline fading out at both ends, an orange dot in a white gap (B separator) */
.zakladki--separator > .container::before {
  content: ""; display: block; height: 26px; margin-bottom: clamp(2.5rem, 5vw, 4rem);
  background:
    radial-gradient(circle, var(--orange) 0 4px, var(--orange-50) 4.5px 7px, #fff 7.5px 12px, transparent 12.5px) center / 26px 26px no-repeat,
    linear-gradient(90deg, rgba(203, 213, 224, 0), var(--line-strong) 28%, var(--line-strong) 72%, rgba(203, 213, 224, 0)) center / 100% 1px no-repeat;
}
.zakladki .shead { align-items: start; row-gap: 1.25rem; }
.zakladki .shead h2 { max-width: 17ch; }

/* --------------------------------------------------------------------------
   Lista w liniach (podstawowy wygląd z prototypu)
   -------------------------------------------------------------------------- */

.tabs__h { margin: 0; border-bottom: 1px solid var(--line); }
.tabs__item:first-child .tabs__h { border-top: 1px solid var(--line-strong); }
.tabs__tab {
  display: flex; align-items: center; gap: 1rem; width: 100%; padding: .95rem 0; margin: 0;
  background: none; border: 0; text-align: left; cursor: pointer;
  font-family: var(--font-display); font-weight: 500; font-size: 1.125rem; line-height: 1.3; letter-spacing: -.005em; color: var(--navy);
}
.tabs__icon {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy-50); color: var(--navy); transition: background-color .3s, color .3s;
}
.tabs__icon .icon { width: 1.15rem; height: 1.15rem; }
.tabs__label { flex: 1; transition: transform .45s var(--ease), color .2s; }
.tabs__ring {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--line-strong); color: var(--navy);
  transition: background-color .3s, border-color .3s, color .3s, transform .45s var(--ease);
}
.tabs__ring .icon { width: 1rem; height: 1rem; transition: transform .45s var(--ease); }
.tabs__tab:hover .tabs__label { color: var(--navy-900); }
.tabs__tab:hover .tabs__ring { border-color: var(--navy); }
.tabs__item.is-open .tabs__label { color: var(--navy-900); transform: translateX(.5rem); }
.tabs__item.is-open .tabs__icon { background: var(--navy-900); color: var(--orange-400); }
.tabs__item.is-open .tabs__ring { background: var(--orange); border-color: var(--orange); color: var(--navy-900); transform: translateX(-4px); }
.tabs__inner > * + * { margin-top: 1.25rem; }
.tabs__copy p { font-size: 1.0625rem; max-width: 60ch; }
.tabs__copy p:last-child { margin-bottom: 0; }
.tabs__copy h3 { margin-bottom: .5rem; }
.tabs .finding { margin: 1rem 0 0; padding-top: .9rem; border-top: 1px solid var(--line); max-width: 64ch; color: var(--text); }
.tabs .finding b { font-weight: 500; color: var(--navy-900); }

@media (min-width: 901px) {
  .tabs {
    display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(2rem, 6vw, 6rem);
    grid-template-rows: repeat(var(--n, 4), auto) 1fr; align-items: start;
  }
  .tabs__item { display: contents; }
  .tabs__h { grid-column: 1; }
  .tabs__panel {
    grid-column: 2; grid-row: 1 / -1; align-self: start;
    opacity: 0; visibility: hidden; transform: translateY(12px);
    transition: opacity .3s var(--ease), transform .45s var(--ease), visibility 0s linear .45s;
  }
  .tabs__item.is-open .tabs__panel {
    opacity: 1; visibility: visible; transform: none;
    transition: opacity .45s var(--ease) .06s, transform .6s var(--ease) .06s, visibility 0s linear 0s;
  }
}
@media (max-width: 900px) {
  .tabs__ring .icon { transform: rotate(90deg); }
  .tabs__item.is-open .tabs__ring .icon { transform: rotate(-90deg); }
  .tabs__item.is-open .tabs__ring { transform: none; }
  .tabs__item.is-open .tabs__label { transform: none; }
  .tabs__panel {
    display: grid; grid-template-rows: 0fr; visibility: hidden;
    transition: grid-template-rows .45s var(--ease), visibility 0s linear .45s;
  }
  .tabs__item.is-open .tabs__panel { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows .5s var(--ease), visibility 0s linear 0s; }
  .tabs__inner { overflow: hidden; min-height: 0; }
  .tabs__inner > :first-child { margin-top: .5rem; }
  .tabs__inner > :last-child { margin-bottom: 1.75rem; }
  .tabs__item.is-open .tabs__h { border-bottom-color: transparent; }
  .tabs__item.is-open { border-bottom: 1px solid var(--line); }
}
.no-js .tabs { display: block; }
.no-js .tabs__item { display: block; }
.no-js .tabs__panel { opacity: 1; visibility: visible; transform: none; grid-template-rows: 1fr; padding-bottom: 2rem; }

/* --------------------------------------------------------------------------
   Wygląd „karta” (Outsourcing): lista wierszy z nicią (pomarańczową do otwartego),
   obok karta otwartego obszaru: zdjęcie na całą szerokość, licznik, opis, „W praktyce”
   -------------------------------------------------------------------------- */

.os-scope .tabs__h,
.os-scope .tabs__item:first-child .tabs__h { position: relative; border: 0; }
.os-scope .tabs__h::before {
  content: ""; position: absolute; z-index: 0; left: 33px; top: 50%; width: 2px; height: calc(100% + 6px);
  border-radius: 2px; background: var(--line); transition: background-color .4s var(--ease);
}
.os-scope .tabs__item:last-child .tabs__h::before { display: none; }
.os-scope .tabs__item:has(~ .tabs__item.is-open) .tabs__h::before { background: var(--orange); }
.os-scope .tabs__tab {
  position: relative; z-index: 1; gap: .95rem; padding: .7rem .9rem .7rem 12px; border-radius: 18px;
  font-weight: 600; font-size: 1.0625rem; letter-spacing: -.01em; color: var(--navy-900);
  transition: background-color .25s, box-shadow .4s var(--ease);
}
.os-scope .tabs__tab:hover { background: var(--paper-2); }
.os-scope .tabs__icon { width: 44px; height: 44px; border-radius: 14px; box-shadow: 0 0 0 4px #fff; }
.os-scope .tabs__icon .icon { width: 1.25rem; height: 1.25rem; }
.os-scope .tabs__tab:hover .tabs__icon { box-shadow: 0 0 0 4px var(--paper-2); }
.os-scope .tabs__item:has(~ .tabs__item.is-open) .tabs__icon { color: var(--orange-ink); }
.os-scope .tabs__ring { width: 32px; height: 32px; border: 0; color: var(--navy); }
.os-scope .tabs__item.is-open .tabs__tab { background: #fff; box-shadow: inset 0 0 0 1px var(--line), var(--shadow-float); }
.os-scope .tabs__item.is-open .tabs__icon { background: var(--orange); color: #fff; box-shadow: 0 0 0 4px #fff, 0 8px 18px -8px rgba(236, 110, 40, .9); }
.os-scope .tabs__item.is-open .tabs__label { transform: none; }
.os-scope .tabs__item.is-open .tabs__ring { background: var(--navy-900); color: #fff; transform: none; }
.os-scope.sect--tint .tabs__icon { box-shadow: 0 0 0 4px var(--paper-2); }

/* the open area's card */
.os-scope .tabs__inner {
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--radius-xl);
  background: radial-gradient(55% 50% at 100% 100%, rgba(248, 120, 49, .07), rgba(248, 120, 49, 0) 70%), #fff;
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.os-scope .tabs__inner > * + * { margin-top: 0; }
.os-scope .fig { flex: none; aspect-ratio: 16 / 7; border-radius: 0; box-shadow: none; }
.os-scope .fig img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.os-scope .tabs__copy { padding: clamp(1.25rem, 2.4vw, 1.75rem) clamp(1.25rem, 3vw, 2.25rem) clamp(1.4rem, 2.8vw, 2rem); }
.os-scope .tabs__copy p { margin: 0 0 .9rem; }
.os-scope .tabs__copy p:last-child { margin-bottom: 0; }
.os-count {
  font-family: var(--font-ui); font-size: .8125rem !important; font-weight: 500; letter-spacing: .06em;
  color: var(--muted); font-variant-numeric: tabular-nums;
}
.os-count b { font-weight: 600; color: var(--orange-ink); }
.os-count[hidden] { display: none; }
.os-scope .finding {
  max-width: none; padding: .9rem 1.1rem; border: 0; border-radius: 14px;
  background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 1rem !important; line-height: 1.55;
}
.os-scope .finding b { font-weight: 600; }

@media (min-width: 901px) {
  .os-scope .tabs { column-gap: clamp(1.25rem, 3vw, 2.5rem); row-gap: 6px; }
}
@media (max-width: 900px) {
  .os-scope .tabs { display: grid; gap: 6px; }
  .os-scope .tabs__h::before { display: none; }
  .os-scope .tabs__ring .icon { transform: rotate(90deg); }
  .os-scope .tabs__item.is-open .tabs__ring .icon { transform: rotate(-90deg); }
  .os-scope .tabs__item.is-open { border-bottom: 0; }
  .os-scope .tabs__inner > :first-child, .os-scope .tabs__inner > :last-child { margin: 0; }
  .os-scope .tabs__h { transition: margin .45s var(--ease); }
  .os-scope .tabs__item.is-open .tabs__h { margin-bottom: 8px; }
  .os-scope .tabs__item.is-open .tabs__panel { margin-bottom: 14px; }
  .os-scope .tabs__inner { border-radius: 22px; }
  .os-scope .fig { aspect-ratio: 16 / 9; }
}

@media (prefers-reduced-motion: reduce) {
  .tabs__item.is-open .tabs__label { transform: none; }
  .tabs__panel, .tabs__item.is-open .tabs__panel { transition: none; transform: none; }
  .os-scope .tabs__h::before, .os-scope .tabs__h { transition: none; }
}

/* --------------------------------------------------------------------------
   Edytor: zakładki jedna pod drugą, wszystkie panele widoczne (łatwiej pisać)
   -------------------------------------------------------------------------- */

.tabs--edytor { display: block !important; }
.tabs--edytor .tabs__item { display: block; margin-bottom: 1rem; }
.tabs--edytor .tabs__panel { opacity: 1; visibility: visible; transform: none; display: block; padding-top: .5rem; }
.tabs--edytor .tabs__h::before { display: none; }
.tabs--edytor .fig { max-height: 260px; }
