/* Style rozszerzenia FERRUM Core dla nawigacji IR, kart roczników i przycisków powrotu */
.ferrum-subnav {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1.5rem;
}
.ferrum-subnav:has(+ .ferrum-subnav-back-row) {
  margin-bottom: 0.75rem;
}
.ferrum-subnav-back-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
}
.prose-content .ferrum-subnav-back-row + h2 {
  margin-top: 0;
}
.ferrum-subnav-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.65rem;
}
.ferrum-subnav-title {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #334155;
  margin: 0;
}
.prose-content a.ferrum-subnav-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-block-size: 32px;
  padding: 0.25rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a !important;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: border-color 140ms ease, background-color 140ms ease;
}
.prose-content a.ferrum-subnav-back:hover {
  border-color: #1e293b;
  background: #e2e8f0;
}
.ferrum-year-footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}
.ferrum-year-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
/* Jednokolumnowe tabele dokumentowe (Dokumenty korporacyjne, Walne Zgromadzenie) bez przewijania poziomego */
.table-wrapper--docs table:has(thead th:only-child) {
  width: 100%;
  table-layout: fixed;
}
.table-wrapper--docs table:has(thead th:only-child) td,
.table-wrapper--docs table:has(thead th:only-child) th {
  width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.prose-content .ferrum-table-doclink {
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  overflow-wrap: anywhere;
}
/* Ujednolicone szerokości kolumn w tabelach DoP, dokumentów i wyników (desktop >= 640px) */
@container (width >= 640px) {
  .table-wrapper--dop table,
  .table-wrapper--certs table,
  .table-wrapper--4col table,
  .table-wrapper--fin table {
    width: 100%;
    table-layout: fixed;
  }
  .table-wrapper--certs table:has(thead th:nth-child(4)) th:nth-child(1),
  .table-wrapper--certs table:has(thead th:nth-child(4)) td:nth-child(1) { width: 18% !important; white-space: normal !important; }
  .table-wrapper--certs table:has(thead th:nth-child(4)) th:nth-child(2),
  .table-wrapper--certs table:has(thead th:nth-child(4)) td:nth-child(2) { width: 36% !important; white-space: normal !important; font-weight: 600; }
  .table-wrapper--certs table:has(thead th:nth-child(4)) th:nth-child(3),
  .table-wrapper--certs table:has(thead th:nth-child(4)) td:nth-child(3) { width: 30% !important; white-space: normal !important; }
  .table-wrapper--certs table:has(thead th:nth-child(4)) th:nth-child(4),
  .table-wrapper--certs table:has(thead th:nth-child(4)) td:nth-child(4) { width: 16% !important; }
  .table-wrapper--certs table:not(:has(thead th:nth-child(3))) th:nth-child(1),
  .table-wrapper--certs table:not(:has(thead th:nth-child(3))) td:nth-child(1) { width: 84% !important; white-space: normal !important; }
  .table-wrapper--certs table:not(:has(thead th:nth-child(3))) th:nth-child(2),
  .table-wrapper--certs table:not(:has(thead th:nth-child(3))) td:nth-child(2) { width: 16% !important; }
  .table-wrapper--fin table:has(thead th:nth-child(6)) th:first-child,
  .table-wrapper--fin table:has(thead th:nth-child(6)) td:first-child { width: 22%; }
  .table-wrapper--fin table:has(thead th:nth-child(6)) th:not(:first-child):not(:last-child),
  .table-wrapper--fin table:has(thead th:nth-child(6)) td:not(:first-child):not(:last-child) { width: 16%; }
  .table-wrapper--fin table:has(thead th:nth-child(6)) th:last-child,
  .table-wrapper--fin table:has(thead th:nth-child(6)) td:last-child { width: 14%; }
  .table-wrapper--dop th:nth-child(1),
  .table-wrapper--dop td:nth-child(1) {
    width: 17% !important;
    white-space: nowrap;
  }
  .table-wrapper--dop th:nth-child(2),
  .table-wrapper--dop td:nth-child(2) {
    width: 26% !important;
    white-space: normal !important;
    font-weight: 600;
  }
  .table-wrapper--dop th:nth-child(3),
  .table-wrapper--dop td:nth-child(3) {
    width: 41% !important;
    white-space: normal !important;
  }
  .table-wrapper--dop th:nth-child(4),
  .table-wrapper--dop td:nth-child(4) {
    width: 16% !important;
    white-space: nowrap;
  }
  .table-wrapper--4col th:nth-child(1),
  .table-wrapper--4col td:nth-child(1) {
    width: 15% !important;
    white-space: normal !important;
  }
  .table-wrapper--4col th:nth-child(2),
  .table-wrapper--4col td:nth-child(2) {
    width: 14% !important;
  }
  .table-wrapper--4col th:nth-child(3),
  .table-wrapper--4col td:nth-child(3) {
    width: 55% !important;
    white-space: normal !important;
  }
  .table-wrapper--4col th:nth-child(4),
  .table-wrapper--4col td:nth-child(4) {
    width: 16% !important;
  }
  .table-wrapper--fin th:first-child,
  .table-wrapper--fin td:first-child {
    width: 24%;
  }
  .table-wrapper--fin th:not(:first-child),
  .table-wrapper--fin td:not(:first-child) {
    width: 19%;
  }
}
/* Dwuwierszowa prezentacja daty i godziny w raportach bieżących / okresowych bez nachodzenia na kolumnę Numer */
.table-wrapper--docs.table-wrapper--4col tbody td:first-child {
  white-space: normal !important;
}
.ferrum-doc-date-day {
  display: block;
  font-weight: 500;
  color: #1e293b;
}
.ferrum-doc-date-time {
  display: block;
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.1rem;
}
/* Rozwijane wiersze szczegółów okresów finansowych */
.ferrum-fin-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.15rem 0;
  border: 0;
  background: transparent;
  color: color-mix(in oklab, var(--skra-primary, #1d4ed8) 86%, #0f172a);
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.ferrum-fin-trigger:hover {
  color: var(--skra-primary, #1d4ed8);
}
.ferrum-fin-trigger::after {
  content: "▸";
  display: inline-block;
  font-size: 0.85em;
  transition: transform 140ms ease;
}
.ferrum-fin-trigger[aria-expanded="true"]::after {
  transform: rotate(90deg);
}
.ferrum-fin-detail-row[hidden] {
  display: none !important;
}
.ferrum-fin-detail-row > td {
  padding: 0 !important;
  background: #f8fafc !important;
  border-bottom: 2px solid #cbd5e1;
}
.ferrum-fin-detail-box {
  padding: 0.85rem 1.1rem 1rem;
}
.ferrum-fin-detail-title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #334155;
  margin-bottom: 0.5rem;
}
.ferrum-fin-detail-grid {
  margin: 0;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background: #ffffff;
  overflow: hidden;
}
.ferrum-fin-detail-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0.85rem;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.84375rem;
}
.ferrum-fin-detail-item:nth-child(even) {
  background: #f8fafc;
}
.ferrum-fin-detail-item:last-child {
  border-bottom: 0;
}
.ferrum-fin-detail-item dt {
  margin: 0;
  font-weight: 600;
  color: #1e293b;
}
.ferrum-fin-detail-item dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
}
.prose-content .ferrum-subnav ul,
.prose-content .ferrum-subnav-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.prose-content .ferrum-subnav li,
.prose-content .ferrum-subnav-list li {
  margin: 0 !important;
  list-style: none !important;
}
.prose-content a.ferrum-subnav-link {
  display: inline-flex;
  align-items: center;
  min-block-size: 36px;
  padding: 0.35rem 0.8rem;
  border-radius: 0.5rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a !important;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}
.prose-content a.ferrum-subnav-link:hover {
  border-color: #1e293b;
  background: #f1f5f9;
  color: #0f172a !important;
}
.prose-content a.ferrum-subnav-link[aria-current="page"],
.prose-content a.ferrum-subnav-link.is-active {
  background: var(--skra-primary, #c81018);
  border-color: var(--skra-primary, #c81018);
  color: var(--skra-primary-text, #ffffff) !important;
}
.ferrum-year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}
.prose-content a.ferrum-year-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.95rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a !important;
  text-decoration: none !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}
.prose-content a.ferrum-year-card:hover {
  border-color: var(--skra-primary, #c81018);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}
.ferrum-year-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.ferrum-year-badge {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.ferrum-year-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 700;
  font-size: 0.875rem;
  transition: background-color 140ms ease, color 140ms ease;
}
.prose-content a.ferrum-year-card:hover .ferrum-year-arrow {
  background: var(--skra-primary, #c81018);
  color: var(--skra-primary-text, #ffffff);
}
.ferrum-year-meta {
  font-size: 0.8125rem;
  color: #334155;
  font-weight: 500;
}

/* Aktywna gałąź nawigacji (rodzic dropdownu pozostaje wyróżniony na podstronach) */
.site-header .nav-link.is-active-branch,
.site-header .nav-item.is-active-branch > .nav-item-row > .nav-link,
.site-header .nav-item.has-children:has(.nav-submenu .nav-link[aria-current="page"]) > .nav-item-row > .nav-link,
.site-header .nav-item.has-children:has(.nav-submenu .nav-link.is-active-branch) > .nav-item-row > .nav-link,
.ferrum-header .nav-link.is-active-branch,
.ferrum-header .nav-item.is-active-branch > .nav-item-row > .nav-link,
.ferrum-header .nav-item.has-children:has(.nav-submenu .nav-link[aria-current="page"]) > .nav-item-row > .nav-link,
.ferrum-header .nav-item.has-children:has(.nav-submenu .nav-link.is-active-branch) > .nav-item-row > .nav-link {
  font-weight: 700;
  color: var(--skra-primary, var(--skra-primary-hover, #c81018));
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--skra-primary, var(--skra-primary-hover, #c81018));
}
.site-header .nav-item.has-children.is-active-branch > .nav-item-row > .nav-submenu-toggle,
.site-header .nav-item.has-children:has(.nav-submenu .nav-link[aria-current="page"]) > .nav-item-row > .nav-submenu-toggle,
.site-header .nav-item.has-children:has(.nav-submenu .nav-link.is-active-branch) > .nav-item-row > .nav-submenu-toggle {
  color: var(--skra-primary, var(--skra-primary-hover, #c81018));
}

/* Odstęp między banerem podstrony a listą aktualności na stronach z wpisami */
.ferrum-page-banner + .puck-page-content:not(:has(*)) + section.pb-14,
.ferrum-page-banner + section.ferrum-posts-list {
  padding-top: 2.5rem;
}
.ferrum-page-banner + .puck-page-content:has(*) + section.pb-14,
.ferrum-page-banner + article + section.pb-14 {
  padding-top: 1.5rem;
}

/* Konfigurowalne kolory górnego paska kontaktowego motywu Ferrum */
.ferrum-topbar {
  background-color: var(--ferrum-topbar-bg, #34495e);
  color: var(--ferrum-topbar-text, #f1f5f9);
  border-bottom: 1px solid color-mix(in srgb, var(--ferrum-topbar-text, #ffffff) 14%, transparent);
}
.ferrum-topbar > div {
  color: var(--ferrum-topbar-text, #f1f5f9);
}
.ferrum-topbar a,
.ferrum-topbar a:hover {
  color: inherit;
}
.ferrum-topbar a:hover {
  opacity: 0.85;
}

/* Mobilny nagłówek bez poziomego przepełnienia poniżej 640px */
@media (max-width: 639px) {
  .site-header .header-inner {
    gap: 0.75rem;
  }
  .site-header .site-logo {
    min-width: 0;
    flex-shrink: 1;
  }
  .site-header .site-logo img {
    max-width: min(170px, 44vw);
    height: auto;
    max-height: 2.5rem;
  }
}
