*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --page-width: 900px;
  --color-text: #1d1d1d;
  --color-muted: #666;
  --color-border: #ccc;
  --color-purple: #41002f;
  --color-dark: #333;
  --color-mid: #616161;
  --color-light: #f4f4f4;
  --font-base: Arial, Helvetica, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text);
  background: #fff;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

.container {
  width: min(var(--page-width), calc(100% - 32px));
  margin-inline: auto;
}

hr.cienka {
  border: none;
  height: 1px;
  background-color: #ccc;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1000;
  padding: 10px 14px;
  background: #fff;
  color: #000;
  transform: translateY(-120%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  border-bottom: 2px solid var(--color-border);
  background: #fff;
}

.header-inner {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #000;
}

.brand span {
  font-family: "Century Gothic", Arial, sans-serif;
  font-size: clamp(2.2rem, 7vw, 3.35rem);
  line-height: 1;
}

.top-nav ul,
.footer-inner ul {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.top-nav li {
  border-left: 1px solid #999;
}

.top-nav li:last-child {
  border-right: 1px solid #999;
}

.top-nav a {
  display: block;
  min-width: 118px;
  padding: 38px 12px;
  text-align: center;
  font-size: 1.08rem;
  color: #808080;
}

.top-nav a[aria-current="page"] {
  color: var(--color-text);
  font-weight: 600;
}

.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px;
  gap: 50px;
  padding-block: 10px 36px;
}

.breadcrumb {
  margin-top: 0;
  margin-bottom: 15px;
  color: #808080;
  font-size: .92rem;
}

.breadcrumb a {
  text-decoration: none !important;
}

.breadcrumb a:hover,
.breadcrumb a:focus-visible {
  text-decoration: underline !important;
}

.documents-content h1 {
  margin: 0 0 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid #808080;
  color: #808080;
  font-size: 1.55rem;
  font-weight: 400;
}

.onas-content {
  font-size: 0.9rem;
  line-height: 1.65;
}

.onas-content p {
  margin: 0 0 18px;
  text-align: left;
}

.onas-content a {
  text-decoration: underline;
}

.onas-image {
  float: right;
  width: 290px;
  margin: 0 0 16px 24px;
}

.onas-section {
  clear: none;
  margin-bottom: 22px;
}

.onas-section h2 {
  margin: 0 0 6px;
  color: #000;
  font-size: 1rem;
  font-weight: 700;
}

.lead {
  text-align: left;
  margin-bottom: 24px;
}

.onas-note {
  margin-top: 20px;
  text-transform: uppercase;
}

.article-list {
  margin: 10px 0 0 20px;
  padding: 0;
}

.article-list li {
  margin-bottom: 7px;
  line-height: 1.55;
}

.article-list span {
  color: #808080;
}

.shortcut-box {
  align-self: start;
  margin-top: 74px;
  padding: 14px 16px 16px;
  border-top: 3px solid var(--color-purple);
  background: #f5f5f5;
  font-size: 0.88rem;
  line-height: 1.35;
}

.shortcut-box h2 {
  margin: 0 0 10px;
  color: var(--color-purple);
  font-size: 1.05rem;
  font-weight: 700;
}

.shortcut-box ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.shortcut-box li {
  border-bottom: 1px solid #ddd;
}

.shortcut-box a {
  display: block;
  padding: 7px 0;
  color: #555;
  text-decoration: none;
}

.shortcut-box a:hover,
.shortcut-box a:focus-visible {
  color: var(--color-purple);
  text-decoration: underline;
}

.shortcut-banner {
  margin-top: 14px;
  border-bottom: none;
}

.shortcut-banner img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}

.site-footer {
  padding-block: 14px;
  background: #fff;
  font-size: .92rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-inner p {
  margin: 0;
}

.footer-inner ul {
  gap: 6px 12px;
  justify-content: flex-end;
}

.footer-inner li + li::before {
  content: "|";
  margin-right: 12px;
  color: #000;
}

@media (max-width: 920px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-block: 16px;
  }

  .brand {
    justify-content: center;
  }

  .top-nav ul {
    justify-content: center;
  }

  .top-nav li,
  .top-nav li:last-child {
    border: 0;
  }

  .top-nav a {
    min-width: auto;
    padding: 10px 12px;
  }

  .page-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .shortcut-box {
    margin-top: 0;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .container {
    width: min(100% - 22px, var(--page-width));
  }

  .top-nav ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-nav li:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .onas-image {
    float: none;
    width: 100%;
    max-width: 290px;
    margin: 0 0 16px;
  }

  .footer-inner ul {
    display: block;
  }

  .footer-inner li + li::before {
    content: none;
    margin: 0;
  }
}

/* =========================================================
   STABILIZACJA GÓRNEGO MENU — PC + MOBILE
   Cel:
   - na komputerze: logo + napis po lewej, menu zawsze w jednym rzędzie;
   - na telefonie: logo i napis w pierwszej linii, przyciski menu jeden pod drugim;
   - brak przypadkowego zawijania ostatniej pozycji, np. „kontakt”.
   ========================================================= */

.site-header .header-inner {
  min-height: 100px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(10px, 1.8vw, 24px);
}

.site-header .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  color: #000;
  text-decoration: none;
  white-space: nowrap;
}

.site-header .brand:hover,
.site-header .brand:focus-visible {
  text-decoration: none;
}

.site-header .brand img,
.site-header .brand-svg,
.site-header .brand-logo-fallback {
  flex: 0 0 auto;
  width: clamp(50px, 6vw, 59px);
  height: clamp(50px, 6vw, 59px);
  object-fit: contain;
}

.site-header .brand span {
  font-family: "Century Gothic", Arial, sans-serif;
  font-size: clamp(2.75rem, 5.4vw, 3.35rem);
  line-height: 1;
  white-space: nowrap;
}

.site-header .top-nav {
  flex: 0 0 auto;
  margin-left: auto;
}

.site-header .top-nav ul {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: stretch;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-header .top-nav li {
  flex: 0 0 auto;
  border-left: 1px solid #999;
}

.site-header .top-nav li:last-child {
  border-right: 1px solid #999;
}

.site-header .top-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(96px, 11.8vw, 118px);
  height: 100px;
  padding: 0 8px;
  text-align: center;
  font-size: clamp(0.95rem, 1.35vw, 1.08rem);
  line-height: 1.2;
  color: #808080;
  white-space: nowrap;
  text-decoration: none;
}

.site-header .top-nav a:hover,
.site-header .top-nav a:focus-visible {
  text-decoration: underline;
}

@media (max-width: 920px) {
  .site-header .header-inner {
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 12px;
    padding-block: 16px;
  }

  .site-header .brand {
    justify-content: center;
    flex: 0 0 auto;
    width: 100%;
  }

  .site-header .brand img,
  .site-header .brand-svg,
  .site-header .brand-logo-fallback {
    width: clamp(50px, 11vw, 59px);
    height: clamp(50px, 11vw, 59px);
  }

  .site-header .brand span {
    font-size: clamp(2.4rem, 10vw, 3.1rem);
  }

  .site-header .top-nav {
    width: 100%;
    margin-left: 0;
  }

  .site-header .top-nav ul {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: stretch;
    width: 100%;
  }

  .site-header .top-nav li,
  .site-header .top-nav li:last-child {
    border-left: 0;
    border-right: 0;
    border-top: 1px solid #999;
  }

  .site-header .top-nav li:last-child {
    border-bottom: 1px solid #999;
  }

  .site-header .top-nav a {
    width: 100%;
    height: auto;
    min-height: 42px;
    padding: 10px 12px;
    font-size: 1rem;
  }
}

@media (max-width: 640px) {
  .site-header .top-nav ul {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
  }

  .site-header .top-nav li:last-child:nth-child(odd) {
    grid-column: auto;
  }
}

/* =========================================================
   TABELE — WERSJA PREMIUM
   ========================================================= */

.price-table-wrap {
  overflow-x: auto;
  margin: 20px 0 28px;
  padding: 2px;
}

.price-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid #d8d8d8;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 18px rgba(0, 0, 0, .10);
  font-size: .92rem;
}

.price-table caption {
  caption-side: top;
  padding: 0 0 10px;
  color: #41002f;
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
}

.price-table thead th {
  background: linear-gradient(135deg, #41002f 0%, #5b0b45 100%);
  color: #fff;
  padding: 12px 14px;
  text-align: left;
  font-weight: 700;
  letter-spacing: .01em;
}

.price-table tbody td {
  padding: 12px 14px;
  border-top: 1px solid #e3e3e3;
  vertical-align: middle;
}

.price-table tbody tr:nth-child(even) {
  background: #f7f7f7;
}

.price-table tbody tr:hover {
  background: #f1e8ef;
}

.price-table td:first-child {
  position: relative;
  padding-left: 34px;
  font-weight: 700;
  color: #222;
}

.price-table td:first-child::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  background: #e67e22;
  transform: translateY(-50%) rotate(45deg);
}

.price-table td:last-child {
  text-align: right;
  white-space: nowrap;
  font-weight: 700;
  color: #41002f;
}

.price-table .price-featured {
  background: #f5edf3;
}

.price-table .price-featured td {
  border-top: 2px solid #41002f;
  border-bottom: 2px solid #41002f;
}

.price-table .price-featured td:first-child {
  color: #41002f;
}

.price-label {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e67e22;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.4;
  vertical-align: middle;
}

.price-note {
  margin: -10px 0 22px;
  color: #666;
  font-size: .86rem;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .price-table {
    min-width: 620px;
    font-size: .88rem;
  }

  .price-table-wrap {
    margin-right: -11px;
    margin-left: -11px;
    padding-right: 11px;
    padding-left: 11px;
  }
}

/* =========================================================
   WIERSZE OFERTOWE — CENNIK NA PODSTRONACH
   ========================================================= */

.offer-price-list {
  margin: 14px 0 18px;
  border-top: 3px solid #41002f;
  border-bottom: 1px solid #d5d5d5;
  background: #fff;
  font-size: .9rem;
}

.offer-price-head,
.offer-price-row {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(145px, .62fr) minmax(135px, .55fr);
  align-items: center;
  column-gap: 18px;
}

.offer-price-head {
  padding: 9px 14px;
  background: #f4f4f4;
  color: #41002f;
  font-weight: 700;
  border-bottom: 1px solid #d5d5d5;
}

.offer-price-row {
  min-height: 54px;
  padding: 11px 14px;
  border-bottom: 1px solid #e1e1e1;
}

.offer-price-row:last-child {
  border-bottom: none;
}

.offer-price-row:hover {
  background: #faf6f9;
}

.offer-price-name {
  position: relative;
  padding-left: 18px;
  font-weight: 700;
  color: #222;
}

.offer-price-name::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 7px;
  height: 7px;
  background: #e67e22;
  transform: rotate(45deg);
}

.offer-price-value {
  justify-self: end;
  color: #41002f;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.offer-price-min {
  justify-self: end;
  color: #666;
  text-align: right;
  white-space: nowrap;
}

.offer-price-wide {
  grid-column: 2 / 4;
}

.offer-price-featured {
  background: #fbf7fa;
  box-shadow: inset 4px 0 0 #41002f;
}

.offer-price-featured .offer-price-name {
  color: #41002f;
}

.price-label {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 0;
  background: #41002f;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.4;
  vertical-align: middle;
}

@media (max-width: 760px) {
  .offer-price-head {
    display: none;
  }

  .offer-price-row {
    display: block;
    padding: 12px 14px;
  }

  .offer-price-value,
  .offer-price-min {
    justify-self: auto;
    margin-top: 5px;
    text-align: left;
    white-space: normal;
  }

  .offer-price-min::before {
    content: "Minimalna ilość: ";
    color: #666;
    font-weight: 400;
  }

  .offer-price-wide {
    grid-column: auto;
  }
}


/* =========================================================
   USŁUGI HISTORYCZNE — LISTA OFERTY
   ========================================================= */

.services-list {
  margin-top: 12px;
}

.service-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 15px 0;
  border-top: 1px solid #ccc;
}

.service-card:first-child {
  border-top: 0;
}

.service-thumb {
  flex: 0 0 145px;
  max-width: 145px;
  height: auto;
}

.service-card h2 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
}

.service-card p {
  margin: 0 0 8px;
}

.more-link {
  margin-top: 4px;
  text-align: right;
}

.more-link a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #41002f;
  font-weight: 700;
  text-decoration: none;
}

.more-link a:hover,
.more-link a:focus-visible {
  text-decoration: underline;
}

.history-contact-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-left: 4px solid #41002f;
  background: #f5f5f5;
}

.history-contact-note p {
  margin-bottom: 8px;
}

@media (max-width: 640px) {
  .service-card {
    display: block;
  }

  .service-thumb {
    display: block;
    margin: 0 0 10px;
  }

  .more-link {
    text-align: left;
  }
}


/* =========================================================
   GENEALOGIE — PODSTRONA USŁUG HISTORYCZNYCH
   ========================================================= */

.genealogy-content .genealogy-main-image {
  float: right;
  width: 145px;
  margin: 2px 0 14px 22px;
}

.genealogy-price-table td:last-child {
  width: 190px;
}

.genealogy-list {
  margin: 8px 0 18px;
  padding: 0;
  list-style: none;
}

.genealogy-list li {
  position: relative;
  margin-bottom: 8px;
  padding-left: 18px;
  line-height: 1.55;
}

.genealogy-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .65em;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid #e67e22;
}

.genealogy-terms {
  margin: 8px 0 20px;
}

.genealogy-terms dt {
  margin-top: 12px;
  color: #41002f;
  font-weight: 700;
}

.genealogy-terms dd {
  margin: 3px 0 0;
  padding-left: 0;
  line-height: 1.6;
}

.genealogy-options {
  padding: 12px 14px 4px;
  border-left: 4px solid #41002f;
  background: #f5f5f5;
}

@media (max-width: 640px) {
  .genealogy-content .genealogy-main-image {
    float: none;
    display: block;
    margin: 0 0 14px;
  }
}


/* =========================================================
   BUTTONY — KONTAKT I PRZYKŁADOWE GENEALOGIE
   Przyczyna poprawki:
   HTML używa klas .history-action-buttons i .history-button,
   ale w arkuszu nie było ich definicji.
   ========================================================= */

.history-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: stretch;
  margin-top: 14px;
}

.history-action-buttons .history-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 11px 16px;
  border: 1px solid #41002f;
  border-radius: 8px;
  color: #41002f;
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
  background: #fff;
}

.history-action-buttons .history-button:hover,
.history-action-buttons .history-button:focus-visible {
  color: #41002f;
  text-decoration: none;
  background: #f6edf3;
}

.history-action-buttons .history-button-primary {
  color: #fff;
  background: #41002f;
}

.history-action-buttons .history-button-primary:hover,
.history-action-buttons .history-button-primary:focus-visible {
  color: #fff;
  background: #5b0b45;
}

.history-action-buttons .history-button-outline {
  color: #41002f;
  background: #fff;
}

.genealogy-sample-button {
  min-width: 285px;
}

.genealogy-tree-icon {
  flex: 0 0 38px;
  width: 38px;
  height: 30px;
  opacity: .55;
  background:
    radial-gradient(circle at 50% 35%, transparent 0 10px, #b8b8b8 11px 12px, transparent 13px),
    linear-gradient(#b8b8b8, #b8b8b8) center 15px / 2px 15px no-repeat,
    linear-gradient(35deg, transparent 0 47%, #b8b8b8 48% 52%, transparent 53%) center / 34px 23px no-repeat,
    linear-gradient(-35deg, transparent 0 47%, #b8b8b8 48% 52%, transparent 53%) center / 34px 23px no-repeat;
}

@media (max-width: 640px) {
  .history-action-buttons {
    display: block;
  }

  .history-action-buttons .history-button {
    width: 100%;
    margin-top: 10px;
  }

  .genealogy-sample-button {
    min-width: 0;
  }
}


/* =========================================================
   POSZUKIWANIA DOKUMENTÓW — PODSTRONA USŁUG HISTORYCZNYCH
   ========================================================= */

.document-search-content .document-search-main-image {
  float: right;
  width: 145px;
  margin: 2px 0 14px 22px;
}

.search-types-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.search-type-card {
  padding: 14px 16px 4px;
  border-left: 4px solid #41002f;
  background: #f5f5f5;
}

.search-type-card h2 {
  color: #41002f;
}

.document-search-price-table td:last-child {
  width: 190px;
}

@media (max-width: 760px) {
  .search-types-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .document-search-content .document-search-main-image {
    float: none;
    display: block;
    margin: 0 0 14px;
  }
}


/* =========================================================
   USTALANIE STANÓW PRAWNYCH WŁASNOŚCI — PODSTRONA
   ========================================================= */

.legal-status-content .legal-status-main-image {
  float: right;
  width: 145px;
  margin: 2px 0 14px 22px;
}

.legal-status-highlight {
  padding: 14px 16px 4px;
  border-left: 4px solid #41002f;
  background: #f5f5f5;
}

.legal-status-list {
  margin: 8px 0 18px;
  padding: 0;
  list-style: none;
}

.legal-status-list li {
  position: relative;
  margin-bottom: 8px;
  padding-left: 18px;
  line-height: 1.55;
}

.legal-status-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .65em;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid #e67e22;
}

.legal-status-price-note {
  margin-top: 20px;
  padding: 13px 16px;
  border-top: 3px solid #41002f;
  border-bottom: 1px solid #d5d5d5;
  background: #fbf7fa;
  color: #41002f;
  text-align: center;
}

.legal-status-price-note p {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .02em;
}

@media (max-width: 640px) {
  .legal-status-content .legal-status-main-image {
    float: none;
    display: block;
    margin: 0 0 14px;
  }
}
