/* ============================================================
   Sekcja 13 — „Blog" (pattern: blog.php, klasa .tech-blog)
   Nagłówek + link + 3 karty (własna pętla [collibre_blog]): obraz 16:10 → kategoria → tytuł → data.
   ============================================================ */

.tech-blog { padding-block: var(--tech-section-y-lg); }

/* Nagłówek: tytuł lewo, link prawo (pełna szerokość, by justify-between zadziałało) */
.tech-blog__head {
  display: flex !important;
  width: 100% !important;
  align-self: stretch !important;   /* nie kurcz się w kolumnie align-items:center */
  align-items: flex-end !important;
  justify-content: space-between !important;
  column-gap: 1rem !important;
  padding: 0 !important;
  margin-bottom: 3rem;
}
.tech-blog__title h2.uagb-heading-text {
  margin: 0;
  font-size: clamp(1.875rem, 3.5vw, 2.25rem);
  font-weight: var(--tech-fw-bold);
  letter-spacing: var(--tech-tracking-tight);
  color: var(--tech-ink);
}
.tech-blog .tech-blog__all { margin: 0 0 0 auto !important; }   /* link do prawej, bez margin-bottom (Astra .entry-content p) */
.tech-blog .tech-blog__all a {
  font-size: var(--tech-fs-sm); font-weight: var(--tech-fw-semibold);
  color: var(--tech-slate); text-decoration: none;
}
.tech-blog .tech-blog__all a:hover { color: var(--tech-ink); }

/* Siatka 3 kart */
.tech-blog__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
@media (max-width: 767px) { .tech-blog__grid { grid-template-columns: 1fr; } }

/* Karta = link (bez podkreśleń w całej karcie — Astra podkreśla linki) */
.tech-blog__card {
  display: flex; flex-direction: column;
  background: var(--tech-mist);
  border-radius: var(--tech-radius-lg);
  overflow: hidden;
  transition: box-shadow .2s ease;
}
.tech-blog a.tech-blog__card,
.tech-blog a.tech-blog__card:hover { text-decoration: none !important; }
.tech-blog__card:hover { box-shadow: var(--tech-shadow-lg); }

/* Obraz 16:10 */
.tech-blog__media { aspect-ratio: 16 / 10; overflow: hidden; background: #e5e7eb; }
.tech-blog__img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Treść */
.tech-blog__body { padding: 1.5rem; }
.tech-blog__cat {
  font-size: var(--tech-fs-xs); font-weight: var(--tech-fw-semibold);
  letter-spacing: .08em; text-transform: uppercase; color: var(--tech-slate);
}
.tech-blog__cardtitle {
  margin: .5rem 0 0;
  font-size: var(--tech-fs-lg); font-weight: var(--tech-fw-bold);
  line-height: var(--tech-lh-snug); color: var(--tech-ink);
  transition: opacity .2s ease;
}
.tech-blog__card:hover .tech-blog__cardtitle { opacity: .7; }
.tech-blog__meta { margin: 1rem 0 0; font-size: var(--tech-fs-sm); color: var(--tech-slate); }

/* ============================================================
   FIX Astra „page-builder": .site-content .ast-container ma display:flex (na desktopie flex-row),
   przez co nasze sekcje układają się OBOK siebie (artykuł/newsletter/related) albo kurczą się po lewej
   (pojedyncze dziecko). Homepage działa, bo ma jedno pełnoszerokościowe dziecko Spectry — nasze szablony
   mają wiele bloków. Wymuszamy zwykły blokowy przepływ TYLKO dla blog/kategoria/artykuł (zakres po body).
   ============================================================ */
body.blog .site-content > .ast-container,
body.category .site-content > .ast-container,
body.single-post .site-content > .ast-container {
	display: block;
}

/* ============================================================
   ARCHIWUM BLOGA (home.php / category.php) — mockup „Collibre Blog standalone".
   .tech-blogarch = hero + sticky chipy + siatka kart (bogatsza) + paginacja + newsletter.
   ============================================================ */
.tech-blogarch { --tech-blogarch-max: 80rem; }
.tech-blogarch__top,
.tech-blogarch__filters-inner,
.tech-blogarch__list-inner,
.tech-blogarch__nl-inner { max-width: var(--tech-blogarch-max, 80rem); margin-inline: auto; padding-inline: 1.5rem; }
/* newsletter jest współdzielony (blog + artykuł) — poza .tech-blogarch zmienna nie istnieje, stąd fallback */
.tech-blogarch__nl-inner { --tech-blogarch-max: 80rem; }

/* Okruszki: wygląd = components/breadcrumbs.css (jedno źródło). Tu tylko adapter offsetu:
   nav dziedziczy szerokość z .tech-blogarch__top (80rem + padding-inline), a odstęp od
   navbara to STANDARD 2rem / 3rem@1024. */
.tech-blogarch__top { padding-top: 2rem; }
@media (min-width: 1024px) { .tech-blogarch__top { padding-top: 3rem; } }

/* Hero */
.tech-blogarch__hero { padding-block: 2rem 2rem; }
@media (min-width: 640px) { .tech-blogarch__hero { padding-block: 2.5rem 2rem; } }
.tech-blogarch__hero-inner { max-width: 48rem; margin-inline: auto; text-align: center; }
.tech-blogarch__title {
	margin: 0;
	font-size: clamp(2.25rem, 5vw, 3.75rem);
	font-weight: var(--tech-fw-extrabold);
	letter-spacing: var(--tech-tracking-tight);
	line-height: 1.05;
	color: var(--tech-ink);
}
.tech-blogarch__lead {
	margin: 1.25rem auto 0;
	max-width: 42rem;
	color: var(--tech-slate);
	font-size: var(--tech-fs-lg);
	line-height: var(--tech-lh-normal, 1.7);
}

/* Sticky pasek chipów */
.tech-blogarch__filters {
	position: sticky; top: 80px; z-index: 30;
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(8px);
	border-block: 1px solid var(--tech-border);
	margin-top: 2rem;
}
.tech-blogarch__filters-inner { padding-block: 1rem; }
.tech-blogarch__chips { display: flex; align-items: center; gap: 0.5rem; overflow-x: auto; scrollbar-width: none; }
.tech-blogarch__chips::-webkit-scrollbar { display: none; }
.tech-blogarch__chip {
	flex: 0 0 auto;
	padding: 0.5rem 1rem;
	border-radius: var(--tech-radius-pill);
	border: 1px solid var(--tech-border);
	background: var(--tech-mist);
	color: var(--tech-ink);
	font-size: var(--tech-fs-sm);
	font-weight: var(--tech-fw-semibold);
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.tech-blogarch__chip:hover { border-color: var(--tech-ink); }
.tech-blogarch__chip.is-active { background: var(--tech-ink); border-color: var(--tech-ink); color: var(--tech-white); }

/* Lista */
.tech-blogarch__list { padding-block: 2.5rem 3rem; }
.tech-blogarch__list-inner { position: relative; }
.tech-blogarch__count { margin: 0 0 1.5rem; font-size: var(--tech-fs-sm); color: var(--tech-slate); }
.tech-blogarch__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
@media (max-width: 1023px) { .tech-blogarch__grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; } }
@media (max-width: 639px)  { .tech-blogarch__grid { grid-template-columns: 1fr; } }
.tech-blogarch__empty { text-align: center; color: var(--tech-slate); padding-block: 5rem; }

/* Karta wpisu (bogatsza: media → meta → tytuł → excerpt → autor) */
.tech-blogarch__card { display: flex; flex-direction: column; }
.tech-blogarch a.tech-blogarch__media,
.tech-blogarch .tech-blogarch__cardtitle a,
.tech-blogarch .tech-blogarch__authorname { text-decoration: none; }
.tech-blogarch__media {
	display: block; position: relative;
	aspect-ratio: 16 / 11;
	border-radius: var(--tech-radius-lg);
	overflow: hidden;
	background: var(--tech-mist);
}
.tech-blogarch__img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.tech-blogarch__card:hover .tech-blogarch__img { transform: scale(1.03); }
.tech-blogarch__ph {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
	color: var(--tech-slate); font-size: var(--tech-fs-sm); letter-spacing: 0.02em;
	background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0,0,0,0.02) 10px, rgba(0,0,0,0.02) 20px);
}
.tech-blogarch__meta { margin-top: 1rem; display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; font-size: var(--tech-fs-xs); }
.tech-blogarch__cat {
	display: inline-block; padding: 0.25rem 0.75rem;
	border-radius: var(--tech-radius-pill); border: 1px solid var(--tech-border);
	background: var(--tech-mist); color: var(--tech-ink); font-weight: var(--tech-fw-semibold);
}
.tech-blogarch__date, .tech-blogarch__read { color: var(--tech-slate); }
.tech-blogarch__cardtitle { margin: 0.75rem 0 0; font-size: var(--tech-fs-xl); font-weight: var(--tech-fw-bold); letter-spacing: var(--tech-tracking-tight); line-height: var(--tech-lh-snug); }
.tech-blogarch__cardtitle a { color: var(--tech-ink); transition: opacity 0.2s ease; }
.tech-blogarch__card:hover .tech-blogarch__cardtitle a { opacity: 0.7; }
.tech-blogarch__excerpt { margin: 0.5rem 0 0; color: var(--tech-slate); line-height: var(--tech-lh-normal, 1.7); flex: 1; }
.tech-blogarch__author { margin-top: 1rem; display: flex; align-items: center; gap: 0.625rem; }
.tech-blogarch__avatar {
	width: 1.75rem; height: 1.75rem; border-radius: 50%;
	background: var(--tech-mist); border: 1px solid var(--tech-border);
	display: flex; align-items: center; justify-content: center;
	font-size: 0.6875rem; font-weight: var(--tech-fw-bold); color: var(--tech-ink);
}
.tech-blogarch__authorname { font-size: var(--tech-fs-sm); color: var(--tech-slate); }

/* Stan ładowania AJAX */
.tech-blogarch__list-inner.is-loading { pointer-events: none; }
.tech-blogarch__list-inner.is-loading .tech-blogarch__grid { opacity: 0.45; transition: opacity 0.15s ease; }
.tech-blogarch__list-inner.is-loading::after {
	content: ""; position: absolute; top: 4rem; left: 50%; width: 2.5rem; height: 2.5rem; margin-left: -1.25rem;
	border: 3px solid var(--tech-border); border-top-color: var(--tech-ink); border-radius: 50%;
	animation: tech-blogarch-spin 0.7s linear infinite; z-index: 2;
}
@keyframes tech-blogarch-spin { to { transform: rotate(360deg); } }

/* Paginacja */
.tech-blogarch__pagination { margin-top: 3rem; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.5rem; font-size: var(--tech-fs-sm); font-weight: var(--tech-fw-semibold); }
.tech-blogarch__pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center; min-width: 2.5rem; height: 2.5rem; padding: 0 0.75rem;
	border-radius: var(--tech-radius-lg); border: 1px solid var(--tech-border); background: var(--tech-white);
	color: var(--tech-ink); text-decoration: none; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.tech-blogarch__pagination a.page-numbers:hover { border-color: var(--tech-ink); }
.tech-blogarch__pagination .page-numbers.current { background: var(--tech-ink); border-color: var(--tech-ink); color: var(--tech-white); }
.tech-blogarch__pagination .page-numbers.dots { border: 0; background: transparent; min-width: auto; }

/* Newsletter (bg-ink). UWAGA: Astra narzuca globalne style h2 (kolor ink) + input[type=email]
   (białe tło, mały radius, width:100%) z wysoką specyficznością → kontrujemy `!important`. */
.tech-blogarch__nl { background: var(--tech-ink); color: var(--tech-white); }
.tech-blogarch__nl-inner { display: grid; gap: 2rem; padding-block: 3.5rem; align-items: center; }
@media (min-width: 1024px) { .tech-blogarch__nl-inner { grid-template-columns: 1fr 1fr; } .tech-blogarch__nl-row { justify-content: flex-end; } }
.tech-blogarch__nl-title { margin: 0; font-size: clamp(1.5rem, 3vw, 1.875rem); font-weight: var(--tech-fw-bold); letter-spacing: var(--tech-tracking-tight); color: #fff !important; }
.tech-blogarch__nl-lead { margin: 0.75rem 0 0; max-width: 28rem; color: rgba(255,255,255,0.7); line-height: var(--tech-lh-normal, 1.7); }
.tech-blogarch__nl-form { display: flex; flex-direction: column; gap: 0.75rem; }
.tech-blogarch__nl-row { display: flex; flex-direction: column; gap: 0.75rem; }
@media (min-width: 640px) { .tech-blogarch__nl-row { flex-direction: row; } }
.tech-blogarch__nl-input {
	flex: 1; min-width: 0;
	padding: 0.875rem 1.25rem !important;
	border-radius: var(--tech-radius-pill) !important;
	border: 1px solid rgba(255,255,255,0.15) !important;
	background: rgba(255,255,255,0.1) !important;
	color: #fff !important;
	font-size: var(--tech-fs-sm);
	box-shadow: none !important;
}
@media (min-width: 640px) { .tech-blogarch__nl-input { width: 18rem !important; flex: 0 0 auto; } }
.tech-blogarch__nl-input::placeholder { color: rgba(255,255,255,0.4) !important; opacity: 1; }
.tech-blogarch__nl-input:focus { outline: none; border-color: rgba(255,255,255,0.4) !important; background: rgba(255,255,255,0.14) !important; }
.tech-blogarch__nl-btn {
	padding: 0.875rem 1.75rem !important; border: 0 !important; border-radius: var(--tech-radius-pill) !important;
	background: var(--tech-white) !important; color: var(--tech-ink) !important; font-size: var(--tech-fs-sm); font-weight: var(--tech-fw-semibold);
	cursor: pointer; transition: background 0.15s ease; white-space: nowrap; flex: 0 0 auto; min-width: 0 !important; width: auto !important;
}
.tech-blogarch__nl-btn:hover { background: var(--tech-mist) !important; }
