/**
 * blog.css — style DODATKOWE wobec screen.css (portu statyki).
 * Obejmuje: blog (listy, karty, wpis, paginacja, archiwa), alternatywny
 * blok tekstowy hero, sekcję wpisów na stronie głównej oraz stronę błędu.
 * Reużywa tokenów układu i klas ze screen.css (.container, .btn, .full-section,
 * .section-title, .padding-top/.padding-bottom). Kolory marki zdefiniowane lokalnie.
 */

:root {
  --brand-blue: #2667ff;
  --brand-yellow: #ffce26;
  --ink: #030303;
  --ink-soft: #525f6b;
  --line: #e4eaed;
  --surface: #f0f4f7;
}

/*=== Alternatywny blok tekstowy w hero (gdy zdjęcie wyłączone) ===*/
.hero-text-block {
  display: flex;
  flex-direction: column;
  justify-content: center;   /* wyśrodkowanie w pionie; p rozciąga się na pełną szerokość kolumny (jak karty wpisów) */
}
.hero-text-block p { width: 100%; }
/* Te same proporcje co wariant E: blok tekstowy rozciąga się na prawą część hero.
   Cap 40% dla .desc obsługuje wspólna reguła :has(.hero-posts, .hero-text-block). */
.landing-home-header .hero-text-block {
  flex: 1 1 auto;
  min-width: 0;
  align-self: center;
  padding-bottom: 40px;
}
@media (max-width: 1024px) {
  .landing-home-header .hero-text-block {
    flex: 1 1 100%;
    width: 100%;
    align-self: stretch;
    padding-bottom: 0;
  }
}
.hero-text-block p {
  font-family: "Space Grotesk", Arial, Helvetica, sans-serif;
  font-weight: 600;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.3;
  color: #fff;
}

/*=== Siatka kart wpisów ===*/
.post-feed {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
@media (max-width: 1024px) {
  .post-feed { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}
@media (max-width: 680px) {
  .post-feed { grid-template-columns: 1fr; }
}

.post-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.post-card__image-link {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--surface);
  overflow: hidden;
}
.post-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.post-card__image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.post-card__image--placeholder .svg-icon {
  width: 40px;
  height: 40px;
  fill: #c2d0e0;
}
.post-card__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  flex: 1;
}
.post-card__tag {
  align-self: flex-start;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-blue);
}
.post-card__title {
  font-size: 20px;
  line-height: 1.25;
}
.post-card__title a { color: var(--ink); transition: color 0.2s ease; }
.post-card__title a:hover { color: var(--brand-blue); }
.post-card__excerpt {
  font-size: 15px;
  color: var(--ink-soft);
  flex: 1;
}
.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: auto;
  font-size: 13px;
  color: var(--ink-soft);
}
.post-card__author { font-weight: 600; color: var(--ink); }

/*=== Nagłówki archiwów / list ===*/
.archive-desc {
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 17px;
}
.empty-feed {
  padding: 48px 0;
  color: var(--ink-soft);
}
.blog-index .section-title,
.home-posts .section-title { margin-bottom: 48px; }

/*=== Sekcja wpisów na stronie głównej (jasna, kontrast do ciemnego cennika) ===*/
.home-posts { background: #fff; }

/*=== Pojedynczy wpis / strona ===*/
.container-narrow {
  max-width: 760px;
  margin: 0 auto;
  padding-left: var(--padding-left);
  padding-right: var(--padding-right);
}
.post-page { padding-top: calc(var(--top-height) + 48px); padding-bottom: var(--margin-bottom); }
.post-full__header { text-align: center; margin-bottom: 32px; }
.post-full__tag {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-blue);
}
.post-full__excerpt {
  margin-top: 16px;
  font-size: 19px;
  color: var(--ink-soft);
}
.post-full__meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 20px;
  font-size: 14px;
  color: var(--ink-soft);
}
.post-full__author { font-weight: 600; color: var(--ink); }
.post-full__image {
  max-width: 1100px;
  margin: 0 auto 48px;
  padding: 0 var(--padding-left);
}
.post-full__image img { width: 100%; border-radius: 10px; display: block; }
.post-full__image figcaption {
  margin-top: 12px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-soft);
}

/*=== Treść wpisu (Koenig / gh-content) ===*/
.gh-content { font-size: 18px; line-height: 1.7; color: var(--ink); }
.gh-content > * { margin-bottom: 1.5em; }
.gh-content h2 { font-size: 30px; margin-top: 1.6em; }
.gh-content h3 { font-size: 23px; margin-top: 1.4em; }
.gh-content a { color: var(--brand-blue); text-decoration: underline; }
.gh-content img { max-width: 100%; height: auto; border-radius: 8px; }
.gh-content ul, .gh-content ol { padding-left: 1.4em; }
.gh-content ul li { list-style: disc; margin-bottom: 0.5em; }
.gh-content ol li { list-style: decimal; margin-bottom: 0.5em; }
.gh-content blockquote {
  border-left: 3px solid var(--brand-blue);
  padding-left: 20px;
  color: var(--ink-soft);
  font-style: italic;
}
.gh-content pre {
  background: #05021e;
  color: #fff;
  padding: 20px;
  border-radius: 8px;
  overflow: auto;
}
.gh-content code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.9em; }

/* Koenig — szerokości kart/obrazów wychodzące poza kolumnę tekstu (wymagane przez GScan) */
.gh-content .kg-width-wide,
.gh-content .kg-width-full {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
.gh-content .kg-width-wide { width: min(1100px, 92vw); }
.gh-content .kg-width-full { width: 100vw; max-width: 100vw; border-radius: 0; }
.gh-content .kg-width-full img { border-radius: 0; }

/*=== Paginacja ===*/
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
}
.pagination__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--brand-blue);
  transition: color 0.2s ease;
}
.pagination__link:hover { color: var(--ink); }
.pagination__link .svg-icon { width: 18px; height: 18px; fill: currentColor; }
.pagination__link--disabled { visibility: hidden; }
.pagination__page { font-size: 14px; color: var(--ink-soft); }

/*=== Strona błędu ===*/
.error-page { padding-top: calc(var(--top-height) + 64px); }
.error-code {
  font-family: "Space Grotesk", Arial, Helvetica, sans-serif;
  font-weight: 700;
  font-size: clamp(72px, 12vw, 140px);
  line-height: 1;
  color: var(--brand-blue);
}
.error-title { margin-top: 8px; }
.error-desc { margin: 16px 0 32px; color: var(--ink-soft); }

/*===================================================================
=  Układ B — wyróżniony wpis + lista (home_blog_layout)             =
===================================================================*/
.home-posts--tint { background: var(--surface); }
.posts-featured {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 900px) { .posts-featured { grid-template-columns: 1fr; } }

.feature-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feature-card__image { display: block; aspect-ratio: 16 / 10; background: var(--surface); }
.feature-card__image img { width: 100%; height: 100%; object-fit: cover; }
.feature-card__ph { display: flex; align-items: center; justify-content: center; height: 100%; }
.feature-card__ph .svg-icon { width: 44px; height: 44px; fill: #c2d0e0; }
.feature-card__body { padding: 26px; display: flex; flex-direction: column; gap: 12px; }
.feature-card__body h3 { font-size: clamp(20px, 2.2vw, 26px); line-height: 1.2; }
.feature-card__body h3 a { color: var(--ink); transition: color 0.2s ease; }
.feature-card__body h3 a:hover { color: var(--brand-blue); }
.feature-card__body p { color: var(--ink-soft); font-size: 15px; }

.mini-list { display: flex; flex-direction: column; }
.mini-post { display: flex; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.mini-post:first-child { padding-top: 0; }
.mini-post:last-child { border-bottom: 0; }
.mini-post__thumb { width: 84px; height: 60px; border-radius: 8px; overflow: hidden; flex: none; background: var(--surface); }
.mini-post__thumb img { width: 100%; height: 100%; object-fit: cover; }
.mini-post__thumb--ph { background: linear-gradient(135deg, #05021e, #2667ff); }
.mini-post__text { display: flex; flex-direction: column; gap: 4px; }
.mini-post__title { font-family: "Space Grotesk", Arial, sans-serif; font-weight: 700; font-size: 15px; line-height: 1.25; color: var(--ink); transition: color 0.2s ease; }
.mini-post:hover .mini-post__title { color: var(--brand-blue); }
.mini-post__meta { font-size: 12.5px; color: var(--ink-soft); }

/*===================================================================
=  Układ C — ciemny pas z kartami (home_blog_layout)               =
===================================================================*/
.home-posts--dark { background: #05021e; position: relative; overflow: hidden; }
.home-posts--dark::before {
  content: "";
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 130%;
  background: radial-gradient(closest-side, rgba(38, 103, 255, 0.22), rgba(5, 2, 30, 0) 70%);
  pointer-events: none;
}
.home-posts--dark .container { position: relative; z-index: 1; }
.home-posts--dark .section-title h2 { color: #fff; }
.home-posts--dark .post-card { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.1); }
.home-posts--dark .post-card:hover { border-color: rgba(38, 103, 255, 0.6); box-shadow: 0 22px 50px -24px rgba(38, 103, 255, 0.5); }
.home-posts--dark .post-card__title a { color: #fff; }
.home-posts--dark .post-card__title a:hover { color: #7fa8ff; }
.home-posts--dark .post-card__tag { color: #7fa8ff; }
.home-posts--dark .post-card__excerpt { color: #aebbc5; }
.home-posts--dark .post-card__meta { color: #8a97a6; }
.home-posts--dark .post-card__author { color: #dfe6ee; }
.home-posts--dark .post-card__image--placeholder { background: rgba(255, 255, 255, 0.04); }

/*===================================================================
=  Układ E — najnowsze wpisy w hero (hero_media)                   =
=  Zastępuje zdjęcie zespołu w prawej kolumnie sekcji hero.         =
===================================================================*/
.hero-posts {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
/* Zajmuje slot prawej kolumny hero jak .photos (screen.css): stała, NIEŚCIŚLIWA
   szerokość, żeby .desc (flex-shrink:1) skurczył się do lewej i nie zapadał wpisów. */
.landing-home-header .hero-posts {
  flex: 1 1 auto;   /* rozciąga się na prawą część hero (desc ma cap 40%) */
  min-width: 0;
  align-self: center;
  padding-bottom: 40px;
}
@media (max-width: 1024px) {
  /* hero układa się w kolumnę (screen.css) — wpisy pełną szerokością, wyśrodkowane */
  .landing-home-header .hero-posts {
    flex: 1 1 100%;
    width: 100%;
    max-width: 520px;
    align-self: stretch;
    padding-bottom: 0;
  }
}
/* Proporcje wariantu E: blok tekstu ≤ ~2/5 szerokości, wpisy dosunięte do prawej.
   Zawężone do wariantu E przez :has(.hero-posts, .hero-text-block) — wariant ze zdjęciem bez zmian. */
.landing-home-header .container-flex:has(.hero-posts, .hero-text-block) {
  justify-content: space-between;
}
.landing-home-header .container-flex:has(.hero-posts, .hero-text-block) .desc {
  flex: 0 1 40%;
  max-width: 40%;
}
@media (max-width: 1024px) {
  .landing-home-header .container-flex:has(.hero-posts, .hero-text-block) {
    justify-content: center;
  }
  .landing-home-header .container-flex:has(.hero-posts, .hero-text-block) .desc {
    flex: 1 1 100%;
    max-width: 100%;
  }
}
.hero-posts__label { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: #7fa8ff; }
.hero-post {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.hero-post__thumb {
  flex: 0 0 92px;
  width: 92px;
  height: 66px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
}
.hero-post__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-post__text { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.hero-post:hover { transform: translateY(-2px); border-color: rgba(38, 103, 255, 0.6); background: rgba(255, 255, 255, 0.08); }
.hero-post__tag { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: #7fa8ff; }
.hero-post__title { font-family: "Space Grotesk", Arial, sans-serif; font-weight: 700; font-size: 17px; line-height: 1.3; color: #fff; }
.hero-post__meta { font-size: 12.5px; color: #aebbc5; }
.hero-posts__all { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; font-weight: 600; font-size: 14px; color: #7fa8ff; transition: color 0.2s ease; }
.hero-posts__all:hover { color: var(--brand-yellow); }
.hero-posts__all .svg-icon { width: 14px; height: 14px; fill: currentColor; }

/*===================================================================
=  Newsletter (Ghost Portal — data-members-form)                    =
===================================================================*/
.newsletter {
  position: relative;
  overflow: hidden;
  background: #05021e;
  padding: clamp(48px, 6vw, 80px) 0;
}
.newsletter::before {
  content: "";
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  height: 150%;
  background: radial-gradient(closest-side, rgba(38, 103, 255, 0.28), rgba(5, 2, 30, 0) 70%);
  pointer-events: none;
}
.newsletter .container { position: relative; z-index: 1; }
.newsletter__inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 36px;
  align-items: center;
}
.newsletter__copy h2 { color: #fff; font-size: clamp(24px, 3vw, 32px); }
.newsletter__copy p { color: #c2d0e0; margin-top: 12px; max-width: 46ch; font-size: 15px; }
.newsletter__form { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.newsletter__email {
  flex: 1;
  min-width: 220px;
  height: 56px;
  padding: 0 18px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 15px;
}
.newsletter__email::placeholder { color: #8a97a6; }
.newsletter__email:focus { border-color: var(--brand-blue); outline: none; }
.newsletter__form .btn { flex: none; }
.newsletter__msg { flex-basis: 100%; margin-top: 4px; font-size: 14px; display: none; }
.newsletter__msg--success { color: #7fe0a0; }
.newsletter__msg--error { color: #ff9b9b; }
/* Ghost dodaje do formularza klasę success/error po wysłaniu */
.newsletter__form.success .newsletter__msg--success { display: block; }
.newsletter__form.error .newsletter__msg--error { display: block; }

.newsletter--compact { padding: clamp(36px, 4vw, 56px) 0; }
.newsletter--compact .newsletter__inner { grid-template-columns: 1fr; text-align: center; }
.newsletter--compact .newsletter__copy p { margin-left: auto; margin-right: auto; }
.newsletter--compact .newsletter__form { justify-content: center; }

@media (max-width: 820px) { .newsletter__inner { grid-template-columns: 1fr; } }
