/* ---------------------------------------------------------------
   SPES Finanse — podstrony, wpisy, listingi, 404
   Ładowany warunkowo (patrz inc/functions/enqueue.php)
   --------------------------------------------------------------- */

.page-main {
  display: block;
  background: var(--paper);
}

/* Nagłówek podstrony ------------------------------------------ */
.page-hero {
  position: relative;
  width: 100vw;
  margin-left: calc((100vw - 100%) / -2);
  padding: 88px max(var(--gutter), calc((100vw - var(--shell)) / 2 + var(--gutter))) 72px;
  overflow: hidden;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.page-hero-inner {
  position: relative;
  z-index: 2;
}

.page-hero-title {
  margin: 0;
  font-size: clamp(42px, 3.8vw, 64px);
  line-height: 1;
  letter-spacing: -0.035em;
}

.page-hero-lead {
  max-width: 640px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

/* Ornament jak w stopce, ale odbity w poziomie i w wersji na jasne tło:
   stopka trzyma go po lewej, nagłówek podstrony po prawej. */
.page-hero::before {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  background-image: radial-gradient(rgba(29, 27, 24, 0.16) 1px, transparent 1.4px);
  background-size: 16px 16px;
  -webkit-mask-image: linear-gradient(245deg, #000 0%, rgba(0, 0, 0, 0.45) 42%, transparent 72%);
  mask-image: linear-gradient(245deg, #000 0%, rgba(0, 0, 0, 0.45) 42%, transparent 72%);
  opacity: 0.7;
  pointer-events: none;
}

.page-hero::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  background-image:
    linear-gradient(90deg, var(--gold) 0 100%),
    linear-gradient(90deg, var(--gold) 0 100%),
    linear-gradient(90deg, rgba(29, 27, 24, 0.22) 0 100%);
  background-repeat: no-repeat;
  background-size:
    clamp(160px, 18vw, 280px) 1px,
    clamp(110px, 12vw, 180px) 1px,
    clamp(120px, 14vw, 220px) 1px;
  background-position:
    100% 46px,
    54% 54%,
    0 96px;
  opacity: 0.55;
  pointer-events: none;
}

.breadcrumbs {
  margin-top: 20px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumbs a:hover {
  color: var(--gold);
}

/* Układ podstrony: treść + kolumna boczna --------------------- */

/* Ten sam padding poziomy co .page-hero — dzięki temu tekst trzyma
   jedną linię z nagłówkiem podstrony zamiast być wycentrowany. */
.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(40px, 4.5vw, 84px);
  width: 100vw;
  margin-left: calc((100vw - 100%) / -2);
  padding: 72px max(var(--gutter), calc((100vw - var(--shell)) / 2 + var(--gutter))) 96px;
}

.page-layout > .entry {
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
}

.page-aside {
  position: sticky;
  top: 32px;
  align-self: start;
  width: 330px;
}

.aside-title {
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.aside-cards {
  display: grid;
  gap: 18px;
}

.aside-card {
  background: var(--white);
  border: 1px solid var(--line);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.aside-card:hover {
  border-color: rgba(191, 121, 27, 0.45);
  box-shadow: 0 14px 34px rgba(76, 61, 42, 0.08);
}

.aside-card-media {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #f1ece4;
}

.aside-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.78) contrast(0.95);
  transition: transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.aside-card:hover .aside-card-media img {
  transform: scale(1.04);
}

.aside-card-body {
  padding: 18px 20px 20px;
}

.aside-card-body small {
  display: block;
  margin-bottom: 8px;
  color: var(--gold-dark);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.aside-card-body h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.aside-card-body h3 a:hover {
  color: var(--gold-dark);
}

.aside-card-body p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.aside-card-link,
.aside-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-dark);
  font-size: 13px;
  font-weight: 700;
}

.aside-card-link:hover .ico,
.aside-more:hover .ico {
  transform: translateX(3px);
}

.aside-card-link .ico,
.aside-more .ico {
  transition: transform 180ms ease;
}

.aside-more {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  width: 100%;
}

/* Treść wpisu / strony ---------------------------------------- */
.entry {
  width: min(100%, 820px);
  margin: 0 auto;
  padding: 72px 24px 90px;
}

.entry--page {
  width: min(100%, 960px);
}

.entry-thumbnail {
  margin: 0 0 42px;
}

.entry-thumbnail img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.entry-content {
  color: #3a3630;
  font-size: 17px;
  line-height: 1.75;
}

.entry-content > * + * {
  margin-top: 22px;
}

/* wpautop potrafi zostawić pusty akapit po wstawionym bloku HTML */
.entry-content p:empty {
  display: none;
}

.entry-content h2 {
  margin-top: 46px;
  font-size: clamp(30px, 2.6vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.entry-content h3 {
  margin-top: 34px;
  font-size: clamp(24px, 2vw, 30px);
  line-height: 1.15;
  color: var(--ink);
}

.entry-content h4 {
  margin-top: 28px;
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
}

.entry-content a {
  border-bottom: 1px solid var(--gold);
  color: var(--gold-dark);
}

.entry-content a:hover {
  color: var(--ink);
}

.entry-content ol {
  padding-left: 0px;
}

.entry-content li + li {
  margin-top: 0px;
}

.entry-content ul {
  list-style: none;
  margin-block: 18px;
  padding-left: 0;
}

.entry-content ul li {
  position: relative;
  padding-left: 28px;
  font-size: inherit;
  line-height: inherit;
}

.entry-content ul li::before {
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 16px;
  height: 1px;
  content: "";
  background: var(--gold);
}

.entry-content blockquote {
  margin: 40px 0;
  padding: 26px 0 0;
  border-top: 1px solid var(--gold);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.35;
}

.entry-content img,
.entry-content figure {
  max-width: 100%;
  height: auto;
}

.entry-content figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.entry-content th,
.entry-content td {
  padding: 12px 14px;
  border: 1px solid var(--line);
  text-align: left;
}

.entry-content th {
  background: var(--gold-pale);
  font-weight: 700;
}

.entry-footer {
  margin-top: 48px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.entry-meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.entry-meta a:hover {
  color: var(--gold);
}

.page-links {
  display: flex;
  gap: 10px;
  margin-top: 32px;
  font-weight: 600;
}

/* Komponenty treści (wstawiane w edytorze jako HTML) ----------- */

/* Media + tekst. Bez zdjęcia figure pokazuje ramkę z ornamentem,
   więc układ nie rozjeżdża się przed uzupełnieniem grafik. */
.content-media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(32px, 4vw, 64px);
  margin: 54px 0;
}

.content-media--reverse .content-media-figure {
  order: 2;
}

.content-media-figure {
  margin: 0;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #f1ece4 url("../img/hero-slices-ornament.png") center / cover no-repeat;
}

.content-media-figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.8) contrast(0.96);
}

.content-media-body > *:first-child {
  margin-top: 0;
}

.content-media-body h3 {
  margin-top: 0;
}

/* Wyróżniony akapit / cytat sekcji */
.content-highlight {
  position: relative;
  margin: 46px 0;
  padding: 34px 36px;
  background: var(--gold-pale);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.6;
}

.content-highlight::before {
  position: absolute;
  top: 0;
  left: 36px;
  width: 52px;
  height: 2px;
  content: "";
  background: var(--gold);
}

.content-highlight p {
  margin: 0;
}

/* Kroki procesu — numerowane karty */
.content-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 46px 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

/* margin: 0 kasuje regułę `li + li` z treści — w siatce przesuwała
   każdą kolejną komórkę w dół i rząd wychodził schodkami. */
.content-steps li {
  position: relative;
  margin: 0;
  padding: 28px 30px;
  background: var(--white);
  border: 1px solid var(--line);
  counter-increment: step;
}

.content-steps li::before {
  display: block;
  margin-bottom: 12px;
  content: "0" counter(step);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.content-steps li:nth-child(even) {
  border-left: 0;
}

.content-steps li:nth-child(n + 3) {
  border-top: 0;
}

.content-steps li strong {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
}

.content-steps li span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.content-steps li::marker {
  content: "";
}

/* Lista korzyści z kreską zamiast punktora */
.content-benefits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 32px;
  margin: 28px 0;
  padding: 0;
  list-style: none;
}

.content-benefits li {
  position: relative;
  margin: 0;
  padding-left: 28px;
  color: #3a3630;
  font-size: 17px;
  line-height: 1.6;
}

.content-benefits li::before {
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 16px;
  height: 1px;
  content: "";
  background: var(--gold);
}

/* Dwie kolumny tekstu */
.content-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  margin: 34px 0;
}

.content-columns > * {
  margin: 0;
}

/* Blok kontaktowy na podstronie Kontakt */
.content-contact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 46px 0;
}

.content-contact div {
  padding: 28px 30px;
  background: var(--white);
  border: 1px solid var(--line);
}

.content-contact div + div {
  border-left: 0;
}

.content-contact strong {
  display: block;
  margin-bottom: 8px;
  color: var(--gold-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.content-contact a {
  border: 0;
  color: var(--ink);
  font-size: 17px;
}

.content-contact a:hover {
  color: var(--gold-dark);
}

/* Wezwanie na końcu treści */
.content-cta {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 22px;
  margin: 52px 0 0;
  padding: 34px 36px;
  background: var(--gold-pale);
}

.content-cta p {
  width: 100%;
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
}

.content-cta a {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  width: auto;
  min-height: 56px;
  padding: 0 28px;
  background: var(--gold);
  border: 0;
  color: var(--white);
  font-weight: 600;
  transition: background-color 180ms ease;
}

.content-cta a:hover {
  background: var(--gold-dark);
  color: var(--white);
}

/* Strona Oferta ----------------------------------------------- */
.entry--offer {
  width: 100vw;
  max-width: none;
  margin-left: calc((100vw - 100%) / -2);
  padding: 64px max(var(--gutter), calc((100vw - var(--shell)) / 2 + var(--gutter))) 8px;
}

.entry--offer .entry-content {
  max-width: 860px;
}

/* Listingi ----------------------------------------------------- */
.listing {
  width: min(100%, var(--shell));
  margin: 0 auto;
  padding: 72px max(24px, var(--gutter)) 96px;
}

.listing-search {
  margin-bottom: 42px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.post-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  transition:
    border-color 200ms ease,
    transform 200ms ease,
    box-shadow 200ms ease;
}

.post-card:hover {
  border-color: rgba(191, 121, 27, 0.45);
  box-shadow: 0 18px 44px rgba(76, 61, 42, 0.1);
  transform: translateY(-3px);
}

.post-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.post-card-media {
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: #eee9e2;
}

.post-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.78) contrast(0.95);
  transition: transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.post-card:hover .post-card-image {
  transform: scale(1.04);
}

.post-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 26px 28px 30px;
}

.post-card-body small {
  color: var(--gold-dark);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.post-card-body strong {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.post-card-excerpt {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.post-card-more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  color: var(--gold-dark);
  font-size: 13px;
  font-weight: 700;
}

/* Powiązane wpisy --------------------------------------------- */
.related-posts {
  width: 100vw;
  margin-left: calc((100vw - 100%) / -2);
  padding: 76px 0 88px;
  background: var(--white);
  border-top: 1px solid var(--line);
}

.related-posts-inner {
  width: min(100%, var(--shell));
  margin: 0 auto;
  padding-inline: max(24px, var(--gutter));
}

.related-posts h2 {
  margin: 0 0 32px;
  font-size: clamp(30px, 2.6vw, 42px);
  letter-spacing: -0.03em;
}

/* Paginacja ---------------------------------------------------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 52px;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 46px;
  height: 46px;
  padding: 0 14px;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  justify-content: center;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--white);
}

/* Formularz wyszukiwania -------------------------------------- */
.search-form {
  display: flex;
  max-width: 520px;
}

.search-form input[type="search"] {
  flex: 1;
  height: 54px;
  padding: 0 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-right: 0;
  color: var(--ink);
  outline: 0;
}

.search-form input[type="search"]:focus {
  border-color: var(--gold);
}

.search-form button {
  display: grid;
  place-items: center;
  width: 58px;
  height: 54px;
  background: var(--gold);
  border: 1px solid var(--gold);
  color: var(--white);
  cursor: pointer;
  transition: background-color 180ms ease;
}

.search-form button:hover {
  background: var(--gold-dark);
}

/* Brak wyników / 404 ------------------------------------------ */
.no-results {
  max-width: 640px;
  padding: 20px 0 10px;
}

.no-results h2 {
  margin: 0 0 14px;
  font-size: clamp(30px, 2.6vw, 42px);
  letter-spacing: -0.03em;
}

.no-results p {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.no-results .primary-button,
.error-actions .primary-button {
  margin-top: 26px;
}

.error-actions {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-top: 34px;
}

.error-actions .text-button {
  margin-top: 0;
}

