:root {
  --emerald: #10b981;
  --emerald-bright: #34d399;
  --emerald-dim: #059669;
  --navy: #061018;
  --navy-elevated: #0c1a2e;
  --navy-border: rgba(255, 255, 255, 0.08);
  --ink: #e8eef4;
  --ink-muted: #94a3b8;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --header-h: 72px;
  /* Homepage .container is 1140. Blog/news shell grows with the viewport (capped),
     without the feed-breaking 1920 experiment. Feed cards keep their own compact grid. */
  --shell: min(1680px, calc(100vw - 3rem));
  --measure: 48rem;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-sans);
  background: var(--navy);
  color: var(--ink);
  line-height: 1.65;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
strong { color: var(--ink); font-weight: 650; }

/* ─── Header (jak landing) ─── */
.blog-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(6, 16, 24, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--navy-border);
}

.blog-header-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.blog-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  font-weight: 700;
  font-size: clamp(0.78rem, 2.6vw + 0.35rem, 0.95rem);
  line-height: 1.2;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  white-space: normal;
}

.blog-brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
}

.blog-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  justify-content: flex-end;
  margin-left: auto;
}

.blog-nav a {
  color: var(--ink-muted);
  font-size: 0.9rem;
  transition: color var(--transition);
}

.blog-nav a:hover { color: var(--emerald-bright); }

.blog-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.blog-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--navy-border);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}

.blog-search-btn:hover,
.blog-search-btn[aria-expanded="true"] {
  color: var(--emerald-bright);
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(16, 185, 129, 0.08);
}

.blog-search-btn svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: currentColor;
}

.blog-search-dialog {
  border: 0;
  padding: 0;
  /* Pin under top — grow down when results appear (no center jump) */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  margin: max(1.25rem, 6vh) auto auto !important;
  width: min(36rem, calc(100vw - 2rem));
  max-width: min(36rem, calc(100vw - 2rem));
  max-height: min(85vh, 42rem);
  height: fit-content;
  background: transparent;
  color: var(--ink);
  overflow: hidden;
}

.blog-search-dialog::backdrop {
  background: rgba(2, 8, 14, 0.72);
  backdrop-filter: blur(6px);
}

html:has(.blog-search-dialog[open]) {
  overflow: hidden;
}

.blog-search-dialog-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--navy-elevated);
  border: 1px solid var(--navy-border);
  border-radius: 16px;
  padding: 1.25rem 1.1rem 1.1rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  max-height: min(85vh, 42rem);
  overflow: hidden;
}

.blog-search-scroll-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  height: 3.35rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 0.55rem;
  background: linear-gradient(to top, #0c1a2e 55%, rgba(12, 26, 46, 0));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.blog-search-scroll-hint.is-visible {
  opacity: 1;
}

.blog-search-scroll-hint svg {
  width: 1.55rem;
  height: 1.55rem;
  color: #34d399;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.55));
  animation: blog-search-scroll-bob 1.1s ease-in-out infinite;
}

@keyframes blog-search-scroll-bob {
  0%, 100% { transform: translateY(0); opacity: 0.75; }
  50% { transform: translateY(4px); opacity: 1; }
}

/* Pagefind UI on dark blog chrome */
.blog-search-dialog .pagefind-ui,
#pagefind-search.pagefind-ui,
#pagefind-search .pagefind-ui {
  --pagefind-ui-scale: 0.92;
  --pagefind-ui-primary: #10b981;
  --pagefind-ui-text: #e8eef4;
  --pagefind-ui-background: #0c1a2e;
  --pagefind-ui-border: rgba(255, 255, 255, 0.12);
  --pagefind-ui-tag: #061018;
  --pagefind-ui-border-width: 1px;
  --pagefind-ui-border-radius: 10px;
  --pagefind-ui-font: var(--font-sans);
}

.blog-search-dialog .pagefind-ui {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(min(85vh, 42rem) - 2.35rem);
}

.blog-search-dialog .pagefind-ui__form {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  max-height: 100%;
  align-items: stretch;
}

.blog-search-dialog .pagefind-ui__drawer {
  grid-row: 2;
  grid-column: 1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 0.35rem;
  min-height: 0;
}

.blog-search-dialog .pagefind-ui__drawer::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* Hide Pagefind form lupa — use input background instead (stays with input row) */
.blog-search-dialog .pagefind-ui__form::before,
#pagefind-search .pagefind-ui__form::before {
  display: none !important;
}

.blog-search-dialog .pagefind-ui__search-input,
#pagefind-search .pagefind-ui__search-input {
  grid-row: 1;
  grid-column: 1;
  color: #e8eef4 !important;
  -webkit-text-fill-color: #e8eef4 !important;
  caret-color: #e8eef4;
  background-color: #0c1a2e !important;
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.755 11.255h-.79l-.28-.27a6.47 6.47 0 0 0 1.57-4.23 6.5 6.5 0 1 0-6.5 6.5c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L17.745 16.255l-4.99-5zM6.755 11.255a4.5 4.5 0 1 1 0-9 4.5 4.5 0 0 1 0 9z' fill='%23e8eef4'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: 1.15rem 50% !important;
  background-size: 1.15rem 1.15rem !important;
  height: calc(64px * var(--pagefind-ui-scale)) !important;
  padding: 0 calc(56px * var(--pagefind-ui-scale)) 0 calc(56px * var(--pagefind-ui-scale)) !important;
  line-height: normal !important;
}

.blog-search-dialog .pagefind-ui__search-input::-webkit-search-decoration,
.blog-search-dialog .pagefind-ui__search-input::-webkit-search-cancel-button,
.blog-search-dialog .pagefind-ui__search-input::-webkit-search-results-button,
.blog-search-dialog .pagefind-ui__search-input::-ms-clear,
#pagefind-search .pagefind-ui__search-input::-webkit-search-decoration,
#pagefind-search .pagefind-ui__search-input::-webkit-search-cancel-button,
#pagefind-search .pagefind-ui__search-input::-webkit-search-results-button,
#pagefind-search .pagefind-ui__search-input::-ms-clear {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.blog-search-dialog .pagefind-ui__search-input::placeholder,
#pagefind-search .pagefind-ui__search-input::placeholder {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
  opacity: 1;
}

.blog-search-dialog .pagefind-ui__search-clear,
#pagefind-search .pagefind-ui__search-clear {
  grid-row: 1;
  grid-column: 1;
  position: relative !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  bottom: auto !important;
  transform: none !important;
  justify-self: end;
  align-self: center;
  margin-right: calc(12px * var(--pagefind-ui-scale)) !important;
  z-index: 2;
  width: calc(40px * var(--pagefind-ui-scale)) !important;
  height: calc(40px * var(--pagefind-ui-scale)) !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.blog-search-dialog .pagefind-ui__search-clear.pagefind-ui__suppressed,
#pagefind-search .pagefind-ui__search-clear.pagefind-ui__suppressed {
  opacity: 0 !important;
  pointer-events: none !important;
}

.blog-search-dialog .pagefind-ui__search-clear::before,
#pagefind-search .pagefind-ui__search-clear::before {
  content: "\00d7";
  color: #94a3b8;
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1;
}

.blog-search-dialog .pagefind-ui__search-clear:hover::before,
#pagefind-search .pagefind-ui__search-clear:hover::before {
  color: #e8eef4;
}

.blog-search-page-main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.blog-search-page-main h1 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0.35rem 0 0.75rem;
}

.blog-search-page-main .blog-lead {
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
}

#pagefind-search {
  min-height: 4rem;
}

.blog-lang {
  display: inline-flex;
  border: 1px solid var(--navy-border);
  border-radius: 999px;
  overflow: hidden;
}

.blog-lang a,
.blog-lang .lang-btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  line-height: inherit;
}

.blog-lang a[aria-current="page"],
.blog-lang .lang-btn.active {
  background: var(--emerald);
  color: #fff;
}

.blog-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.blog-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: transform var(--transition), opacity var(--transition);
}

.blog-menu-btn.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.blog-menu-btn.active span:nth-child(2) { opacity: 0; }
.blog-menu-btn.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  .blog-brand {
    gap: 0.4rem;
    font-size: clamp(0.68rem, 3.1vw, 0.85rem);
  }

  .blog-brand img {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }

  .blog-header-inner {
    gap: 0.65rem;
    padding: 0 0.9rem;
  }

  .blog-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    margin: 0;
    background: var(--navy-elevated);
    border-bottom: 1px solid var(--navy-border);
    flex-direction: column;
    align-items: stretch;
    padding: 1.5rem;
    gap: 1rem;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 99;
  }

  .blog-nav.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .blog-menu-btn { display: flex; }
}

.blog-post-list-single {
  max-width: var(--measure);
  margin-bottom: 2rem;
}

/* ─── Blog feed hub ─── */
.blog-feed-page .blog-main::before {
  height: min(40vh, 360px);
}

.blog-feed-shell {
  position: relative;
  z-index: 1;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

.blog-feed-intro {
  margin-bottom: 1.75rem;
  max-width: 48rem;
}

.blog-feed-intro h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  line-height: 1.15;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  max-width: none;
}

.blog-feed-layout {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

@media (min-width: 900px) {
  .blog-feed-layout {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 2rem;
  }
}

.blog-feed-rail {
  position: sticky;
  top: calc(var(--header-h) + 0.75rem);
  padding: 0.85rem 1rem;
  border: 1px solid var(--navy-border);
  border-radius: 0.75rem;
  background: rgba(12, 26, 46, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 2;
}

.blog-feed-rail-label {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--emerald-bright);
}

.blog-feed-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.blog-feed-nav a {
  display: block;
  padding: 0.55rem 0.35rem;
  color: #c8d4e0;
  font-size: 0.92rem;
  line-height: 1.35;
  border-radius: 0.4rem;
  transition: color var(--transition), background var(--transition);
}

.blog-feed-nav-title {
  display: block;
}

.blog-feed-nav-date {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.blog-feed-nav a[aria-current="true"] .blog-feed-nav-date {
  color: rgba(52, 211, 153, 0.85);
}

.blog-feed-nav a:hover {
  color: var(--emerald-bright);
  background: rgba(16, 185, 129, 0.08);
}

.blog-feed-nav a[aria-current="true"] {
  color: var(--emerald-bright);
  font-weight: 650;
}

@media (max-width: 899px) {
  .blog-feed-rail {
    position: static;
    margin: 0;
    border-radius: 0.75rem;
    padding: 0.75rem 0.85rem;
  }

  .blog-feed-rail-label {
    margin-bottom: 0.45rem;
  }

  .blog-feed-nav {
    flex-direction: column;
    overflow: visible;
    gap: 0.1rem;
  }

  .blog-feed-nav a {
    white-space: normal;
    max-width: none;
    overflow: visible;
    text-overflow: unset;
    padding: 0.55rem 0.45rem;
    border: 0;
    border-radius: 0.45rem;
    font-size: 0.9rem;
  }

  .blog-feed-nav a[aria-current="true"] {
    background: rgba(16, 185, 129, 0.1);
  }

  .blog-feed-nav-date {
    margin-top: 0.15rem;
  }
}

.blog-feed-stream {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-width: 0;
}

.blog-feed-card {
  min-height: 12rem;
  padding: 1.25rem 1.1rem 1.5rem;
  border: 1px solid var(--navy-border);
  border-radius: 1rem;
  background: rgba(6, 16, 24, 0.55);
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.blog-feed-card-status {
  color: var(--ink-muted);
  font-size: 0.95rem;
  min-height: 1.5rem;
}

.blog-feed-retry {
  margin-left: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--navy-border);
  background: transparent;
  color: var(--emerald-bright);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
}

.blog-feed-permalink {
  margin: 0 0 1rem;
}

.blog-feed-permalink a {
  color: var(--emerald-bright);
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.blog-feed-card .blog-article {
  max-width: none;
  margin: 0;
  padding: 0;
}

.blog-feed-card .blog-hero {
  min-height: 0;
  margin-bottom: 1.5rem;
  gap: 1.25rem;
}

.blog-feed-card .blog-article h1 {
  max-width: none;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
}

.blog-feed-card .blog-figure,
.blog-feed-card .blog-figure-video {
  width: min(100%, 220px);
}

/* Feed: keep reading flow clean — hero Play CTA sits between lead and body and reads as a break */
.blog-feed-card .blog-hero-copy > .blog-cta-row {
  display: none;
}

/* Feed hero column widths come from the flattened article grid (≥900px) below */

/* ─── Page shell ─── */
.blog-main {
  position: relative;
  overflow: clip;
}

.blog-main::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: min(72vh, 640px);
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 78% 18%, rgba(16, 185, 129, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse 45% 40% at 8% 70%, rgba(16, 185, 129, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, #0a1520 0%, var(--navy) 100%);
  z-index: 0;
}

.blog-article {
  position: relative;
  z-index: 1;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

/* ─── Hero: copy + graphic (no forced viewport height — that left a gap before .blog-toc) ─── */
.blog-hero {
  display: grid;
  gap: 2rem;
  align-items: center;
  margin-bottom: 1.25rem;
  min-height: 0;
}

/* News shorts: copy-only by default */
.blog-hero.blog-hero--news {
  min-height: 0;
  margin-bottom: 1.75rem;
  align-items: start;
  gap: 1.25rem;
  max-width: var(--measure);
  padding: 0.5rem 0 0;
}

/* News + UI mock: text column | graphic (CSS inset only — asset file untouched) */
.blog-news-ui {
  display: grid;
  gap: 1.75rem;
  align-items: start;
  margin-bottom: 0.5rem;
}

.blog-news-ui__main {
  min-width: 0;
}

.blog-news-ui .blog-hero-copy {
  margin-bottom: 1.5rem;
}

.blog-news-ui .blog-figure-news {
  position: relative;
  margin: 0;
  width: min(100%, 420px);
  aspect-ratio: 10 / 19;
  overflow: hidden;
  border-radius: 1.35rem;
  justify-self: start;
  filter: drop-shadow(0 28px 48px rgba(0, 0, 0, 0.55));
  background: #0f1319;
}

.blog-news-ui .blog-figure-news img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  border-radius: 0;
}

.blog-figure-news {
  margin: 0;
}

.blog-figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 1.35rem;
}

.blog-kicker {
  color: var(--emerald-bright);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.blog-date {
  display: block;
  margin: -0.35rem 0 1rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  text-transform: none;
  font-weight: 500;
}

.blog-article h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 4.5vw, 3.15rem);
  line-height: 1.12;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 1.1rem;
  max-width: 16ch;
}

.blog-lead {
  font-size: 1.12rem;
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
  max-width: 42rem;
  line-height: 1.55;
}

.blog-lead em {
  color: var(--emerald-bright);
  font-style: normal;
  font-weight: 600;
}

.blog-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin: 0 0 0.5rem;
}

.blog-cta-row .blog-inline-link,
.blog-cta-row .blog-link-secondary {
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
  min-height: 2.75rem;
}

.blog-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.6rem;
  background: linear-gradient(135deg, var(--emerald) 0%, var(--emerald-dim) 100%);
  color: #fff !important;
  -webkit-text-fill-color: #fff;
  text-decoration: none !important;
  font-weight: 700;
  border-radius: 999px;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.35);
  transition: box-shadow var(--transition), filter var(--transition);
}

.blog-btn:hover {
  color: #fff !important;
  -webkit-text-fill-color: #fff;
  text-decoration: none !important;
  filter: brightness(1.05);
  box-shadow: 0 6px 28px rgba(16, 185, 129, 0.5);
}

.blog-figure {
  margin: 0;
  justify-self: center;
  width: min(100%, 300px);
  filter: drop-shadow(0 28px 48px rgba(0, 0, 0, 0.55));
}

.blog-article .news-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  display: grid;
  gap: 1rem;
}
.blog-article .news-list-item {
  margin-bottom: 0;
  list-style: none;
}
.blog-article .news-list-item::marker {
  content: none;
  color: transparent;
}
html[lang="en"] .news-list-item[data-lang="pl"],
html[lang="pl"] .news-list-item[data-lang="en"] {
  display: none;
}
.news-list-card {
  display: flex;
  gap: 1rem;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.news-list-card img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
}
.news-list-card span { display: grid; gap: 0.25rem; }
.news-list-card time,
.news-list-card em { font-size: 0.85rem; opacity: 0.7; font-style: normal; }
.news-list-card strong { font-size: 1.05rem; }

.blog-figure-video {
  width: min(100%, 280px);
}

.blog-yt-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 420px;
  margin: 0 auto;
  border-radius: 1.35rem;
  overflow: hidden;
  border: 1px solid var(--navy-border);
  background: #000;
}

.blog-yt-wrap .yt-placeholder {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 1;
}

.blog-yt-wrap .yt-placeholder img,
.blog-yt-wrap iframe {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 0;
}

.blog-yt-wrap .yt-placeholder button {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 56px;
  height: 56px;
  background: rgba(16, 185, 129, 0.92);
  border: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: none;
  transition: transform var(--transition), background var(--transition);
}

.blog-yt-wrap .yt-placeholder button svg {
  width: 24px;
  height: 24px;
  fill: #fff;
  margin-left: 3px;
}

.blog-yt-wrap .yt-placeholder:hover button {
  transform: scale(1.08);
  background: var(--emerald);
}

.blog-figure-video > a {
  display: block;
  border-radius: 1.35rem;
  overflow: hidden;
  border: 1px solid var(--navy-border);
}

.blog-figure-video img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 0;
}

.blog-figure-video figcaption {
  margin-top: 0.65rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
  text-align: center;
}

.blog-figure-video figcaption a {
  color: var(--emerald-bright);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.blog-yt-link {
  margin: 0.45rem 0 0;
  text-align: center;
  font-size: 0.85rem;
}

.blog-yt-link a {
  color: var(--emerald-bright);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.blog-inline-link {
  color: var(--emerald-bright);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.blog-article ol {
  padding-left: 1.25rem;
  margin: 0.5rem 0 1.25rem;
  list-style: decimal;
}

.blog-article ol li {
  margin-bottom: 0.55rem;
}

/* ─── Body measure ─── */
.blog-body {
  max-width: var(--measure);
}

/* Prose-only articles (no side figure / news-ui): use more of the responsive shell */
.blog-article:not(:has(> .blog-hero > .blog-figure)):not(:has(.blog-news-ui)) .blog-body,
.blog-article:not(:has(> .blog-hero > .blog-figure)):not(:has(.blog-news-ui)) .blog-toc,
.blog-article:not(:has(> .blog-hero > .blog-figure)):not(:has(.blog-news-ui)) > .blog-hero,
.blog-article:not(:has(> .blog-hero > .blog-figure)):not(:has(.blog-news-ui)) .blog-hero.blog-hero--news {
  max-width: min(56rem, 100%);
}

/* Wide blog figure columns: keep soft prose measure (do not open a dead band on news-ui) */
.blog-article:has(> .blog-hero > .blog-figure):not(:has(.blog-news-ui)) .blog-body > :is(p, ul, ol),
.blog-article:has(> .blog-hero > .blog-figure):not(:has(.blog-news-ui)) .blog-faq :is(p, ul, ol) {
  max-width: none;
}

.blog-news-ui h1,
.blog-news-ui .blog-lead {
  max-width: none;
}

.blog-article h1,
.blog-article h2 {
  text-wrap: pretty;
}

.blog-article h2 {
  font-size: clamp(1.35rem, 2.4vw, 1.65rem);
  line-height: 1.25;
  margin: 2.75rem 0 0.85rem;
  letter-spacing: -0.015em;
}

/* Keep multi-word phrases on one line (titles, parentheses) */
.nowrap {
  white-space: nowrap;
}

.blog-body > h2:first-child { margin-top: 0; }

.blog-article h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.45rem;
  color: var(--emerald-bright);
}

.blog-article p,
.blog-article li {
  margin-bottom: 1rem;
  color: #c8d4e0;
  font-size: 1.05rem;
}

.blog-article ul {
  padding-left: 1.15rem;
  margin: 0.5rem 0 1.25rem;
  list-style: disc;
}

.blog-article li::marker { color: var(--emerald); }

.blog-faq {
  margin-top: 3rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--navy-border);
}

.blog-cta-row-end {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--navy-border);
}

.blog-link-secondary {
  color: var(--ink-muted);
  transition: color var(--transition);
}

.blog-link-secondary:hover { color: var(--emerald-bright); }

/* ─── Blog index + in-article menu ─── */
.blog-hero-index { min-height: 0; margin-bottom: 2rem; }

.blog-post-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.blog-post-list a {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid var(--navy-border);
  border-radius: 0.75rem;
  background: rgba(12, 26, 46, 0.55);
  transition: border-color var(--transition), background var(--transition);
}

.blog-post-list a:hover {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.08);
}

.blog-post-list-title {
  display: block;
  color: var(--ink);
  font-weight: 650;
  font-size: 1.02rem;
  line-height: 1.35;
  margin-bottom: 0.35rem;
}

.blog-post-list-meta {
  display: block;
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.blog-toc {
  margin: 0 0 2rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--navy-border);
  border-radius: 0.75rem;
  background: rgba(12, 26, 46, 0.4);
  max-width: var(--measure);
}

.blog-toc-label {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--emerald-bright);
}

.blog-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.blog-toc li { margin: 0; }

.blog-toc a {
  display: block;
  padding: 0.4rem 0;
  color: #c8d4e0;
  font-size: 0.98rem;
  border-bottom: 1px solid transparent;
  transition: color var(--transition);
}

.blog-toc li + li a { border-top: 1px solid var(--navy-border); }

.blog-toc a:hover { color: var(--emerald-bright); }

.blog-toc a[aria-current="page"] {
  color: var(--emerald-bright);
  font-weight: 650;
}

.blog-toc-all {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--ink-muted);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.blog-toc-all:hover { color: var(--emerald-bright); }

.blog-footer {
  border-top: 1px solid var(--navy-border);
  padding: 1.5rem 1.25rem 2rem;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.9rem;
  background: #050d14;
}

.blog-footer a {
  color: var(--ink-muted);
  transition: color var(--transition);
}

.blog-footer a:hover { color: var(--emerald); }

@media (min-width: 900px) {
  /*
   * Blog posts with a side graphic: do NOT keep .blog-body under a tall hero grid
   * (that left an empty hole under the lead before "Na blogu"). Flatten with
   * display:contents so copy + body share the left column; figure sticks on the right.
   * Feed cards override below — do not use this grid inside .blog-feed-card.
   */
  .blog-article:has(> .blog-hero > .blog-figure):not(:has(.blog-news-ui)) {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 400px);
    column-gap: 2.5rem;
    align-items: start;
  }

  .blog-article:has(> .blog-hero > .blog-figure):not(:has(.blog-news-ui)) > .blog-hero {
    display: contents;
  }

  .blog-article:has(> .blog-hero > .blog-figure):not(:has(.blog-news-ui)) .blog-hero-copy {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .blog-article:has(> .blog-hero > .blog-figure):not(:has(.blog-news-ui)) > .blog-body {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    max-width: none;
  }

  .blog-article:has(> .blog-hero > .blog-figure):not(:has(.blog-news-ui)) .blog-toc {
    max-width: none;
    margin-top: 0.85rem;
  }

  .blog-article:has(> .blog-hero > .blog-figure):not(:has(.blog-news-ui)) .blog-hero-copy .blog-lead {
    margin-bottom: 1.25rem;
  }

  .blog-article:has(> .blog-hero > .blog-figure):not(:has(.blog-news-ui)) > .blog-hero > .blog-figure {
    grid-column: 2;
    grid-row: 1 / span 2;
    justify-self: end;
    align-self: start;
    width: 100%;
    max-width: 400px;
    margin: 0;
  }

  /*
   * Feed cards: same flatten as standalone. Old display:block + 2-col hero left a
   * tall empty hole under the lead whenever the side figure/Short was taller than copy.
   */
  .blog-feed-card .blog-article:has(> .blog-hero > .blog-figure),
  .blog-feed-card .blog-article:has(> .blog-hero > .blog-figure):not(:has(.blog-news-ui)) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
    column-gap: 1.25rem;
    align-items: start;
  }

  .blog-feed-card .blog-article:has(> .blog-hero > .blog-figure) > .blog-hero,
  .blog-feed-card .blog-article:has(> .blog-hero > .blog-figure):not(:has(.blog-news-ui)) > .blog-hero {
    display: contents;
  }

  .blog-feed-card .blog-article:has(> .blog-hero > .blog-figure) .blog-hero-copy,
  .blog-feed-card .blog-article:has(> .blog-hero > .blog-figure):not(:has(.blog-news-ui)) .blog-hero-copy {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .blog-feed-card .blog-article:has(> .blog-hero > .blog-figure) > .blog-body,
  .blog-feed-card .blog-article:has(> .blog-hero > .blog-figure):not(:has(.blog-news-ui)) > .blog-body {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    max-width: none;
  }

  .blog-feed-card .blog-article:has(> .blog-hero > .blog-figure) > .blog-hero > .blog-figure,
  .blog-feed-card .blog-article:has(> .blog-hero > .blog-figure):not(:has(.blog-news-ui)) > .blog-hero > .blog-figure {
    grid-column: 2;
    grid-row: 1 / span 2;
    justify-self: end;
    align-self: start;
    width: min(100%, 220px);
    max-width: 220px;
    margin: 0;
  }

  /* Hero without side figure (or news copy-only): keep simple stack */
  .blog-hero:not(:has(> .blog-figure)) {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 0.5rem 0 0;
  }

  .blog-hero.blog-hero--news {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 0.5rem 0 0;
    max-width: var(--measure);
    min-height: 0;
  }

  .blog-news-ui {
    /* Left column grows up to the phone — never leave a dead band between copy and mock */
    grid-template-columns: minmax(0, 1fr) 400px;
    column-gap: 2rem;
    row-gap: 1.75rem;
  }

  .blog-news-ui .blog-body,
  .blog-news-ui .blog-toc {
    max-width: none;
  }

  .blog-news-ui .blog-figure-news {
    width: 100%;
    max-width: none;
    aspect-ratio: 10 / 19;
    position: sticky;
    top: calc(var(--header-h) + 1rem);
    justify-self: stretch;
  }

  .blog-article:not(:has(> .blog-hero > .blog-figure)) .blog-figure {
    width: 100%;
    max-width: 400px;
    justify-self: end;
  }

  /* Was 14ch — crushed long PL titles into a tall stack and looked like a hole under the lead */
  .blog-article h1 { max-width: min(32ch, 100%); }

  /* News UI: title must span the text column up to the phone (overrides ch cap above) */
  .blog-article .blog-news-ui h1,
  .blog-article .blog-news-ui .blog-lead {
    max-width: none;
  }
}

@media (max-width: 899px) {
  .blog-hero {
    min-height: 0;
    text-align: left;
  }

  .blog-article h1 { max-width: none; }

  .blog-figure {
    order: -1;
    width: min(100%, 280px);
    justify-self: start;
  }

  .blog-news-ui .blog-figure-news {
    order: -1;
    width: min(100%, 300px);
    aspect-ratio: 10 / 19;
    justify-self: center;
    margin-inline: auto;
  }
}

/* Dedicated Google watch pages (/video/<slug>/) — iframe in HTML, not click-to-play */
.watch-page .watch-main {
  max-width: var(--shell);
  margin: 0 auto;
  padding: calc(var(--header-h, 64px) + 1.5rem) 1.25rem 3rem;
}

.watch-article h1 {
  font-size: clamp(1.45rem, 3.5vw, 2rem);
  line-height: 1.2;
  margin: 0 0 1rem;
  max-width: none;
}

.watch-player {
  position: relative;
  width: 100%;
  margin: 0 0 1.25rem;
  border-radius: 1.1rem;
  overflow: hidden;
  border: 1px solid var(--navy-border);
  background: #000;
}

.watch-player--landscape {
  aspect-ratio: 16 / 9;
}

.watch-player--short {
  aspect-ratio: 9 / 16;
  max-width: 360px;
  max-height: min(72vh, 640px);
  margin-inline: auto;
}

.watch-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.watch-player--pending {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  max-width: none;
  max-height: none;
  padding: 1.25rem;
  background: var(--navy-elevated);
}

.watch-player--pending p {
  margin: 0;
  max-width: 22rem;
  color: var(--ink-muted);
  text-align: center;
}

.watch-lead {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--ink-muted);
  margin: 0 0 0.75rem;
}

.watch-meta {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin: 0 0 1.25rem;
}

.watch-related,
.watch-back {
  margin: 1rem 0 0;
}

.watch-related a,
.watch-back a {
  color: var(--emerald);
  font-weight: 600;
}

.watch-index-head {
  margin-bottom: 1.75rem;
}

.watch-index-head h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
}

.watch-index-head p {
  margin: 0;
  color: var(--ink-muted);
  max-width: 40rem;
}

.watch-index-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.watch-index-item a {
  display: grid;
  gap: 0.45rem;
  color: inherit;
  text-decoration: none;
  height: 100%;
}

.watch-index-item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 0.75rem;
  border: 1px solid var(--navy-border);
  background: #000;
}

.watch-index-title {
  font-weight: 650;
  line-height: 1.3;
}

.watch-index-meta {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

/* Click-to-enlarge side graphics (blog-lightbox.js) */
.blog-figure--zoomable {
  cursor: zoom-in;
}
.blog-figure--zoomable > img,
.blog-figure-news.blog-figure--zoomable > img {
  cursor: zoom-in;
}
.blog-figure--zoomable:focus-within > img {
  outline: 2px solid color-mix(in srgb, var(--accent, #0b6e4f) 70%, transparent);
  outline-offset: 3px;
}

.blog-lightbox {
  border: 0;
  padding: 0;
  margin: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  background: transparent;
  color: #fff;
  overflow: auto;
}
.blog-lightbox[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}
.blog-lightbox::backdrop {
  background: rgba(8, 12, 20, 0.86);
}
.blog-lightbox__bar {
  display: flex;
  justify-content: flex-end;
  width: min(94vw, 1360px);
  margin: 0 0 0.5rem;
}
.blog-lightbox__close {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
}
.blog-lightbox__close:hover,
.blog-lightbox__close:focus-visible {
  background: rgba(0, 0, 0, 0.7);
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.blog-lightbox__img {
  display: block;
  max-width: min(94vw, 1360px);
  max-height: min(82vh, 900px);
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 0.85rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  background: #111;
}
.blog-lightbox__cap {
  margin: 0.75rem auto 0;
  max-width: 42rem;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.88);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
