/* =====================================================================
   blog.css — lista wpisów (/blog, /blog/kategoria/{slug})
   ---------------------------------------------------------------------
   Arkusz wydzielony z gotowej podstrony `blog/index.html`. Zawiera to, co
   specyficzne dla listy: nagłówek strony, wyszukiwarkę, chipy kategorii,
   przełącznik widoku, karty wpisów (wyróżniony, siatka, lista), panel boczny,
   paginację i stan pusty.

   Tokeny motywu (kolory, fonty) i style wspólne są w `site.css`, który
   ładujemy PRZED tym plikiem. Reguły powtarzające się między arkuszami
   zostały z tego pliku usunięte, żeby nie tworzyć dwóch prawd.
   ===================================================================== */

.brand-brace { color: var(--accent); font-family: var(--font-mono); font-weight: 700; }

    .nav-link {
      font-family: var(--font-display);
      font-size: 0.875rem;
      font-weight: 500;
      color: var(--text-muted) !important;
      padding: 0.4rem 0.85rem !important;
      border-radius: 6px;
      transition: color var(--transition), background var(--transition);
    }

    .btn-accent {
      background: var(--accent); color: #000;
      font-family: var(--font-display); font-weight: 600; font-size: 0.875rem;
      padding: 0.65rem 1.5rem; border-radius: 8px; border: none;
      transition: all var(--transition);
      text-decoration: none; display: inline-flex; align-items: center; gap: .4rem;
      cursor: pointer;
    }

    .btn-ghost {
      background: transparent; color: var(--text-primary);
      font-family: var(--font-display); font-weight: 500; font-size: 0.875rem;
      padding: 0.65rem 1.5rem; border-radius: 8px; border: 1px solid var(--border-color);
      transition: all var(--transition); text-decoration: none; display: inline-flex; align-items: center; gap: .4rem;
      cursor: pointer;
    }

    /* ─── Page header ───────────────────────────────────────────────────── */
    .page-header {
      padding-top: 120px;
      padding-bottom: 3.5rem;
      position: relative;
      overflow: hidden;
      border-bottom: 1px solid var(--border-color);
    }

    .page-header-grid {
      position: absolute;
      inset: 0;
      background-image:
        linear-gradient(var(--border-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
      background-size: 48px 48px;
      opacity: 0.25;
      mask-image: radial-gradient(ellipse 90% 100% at 50% 0%, black 20%, transparent);
      -webkit-mask-image: radial-gradient(ellipse 90% 100% at 50% 0%, black 20%, transparent);
    }

    .page-label {
      font-family: var(--font-mono);
      font-size: 0.75rem;
      color: var(--accent);
      letter-spacing: 0.2em;
      text-transform: uppercase;
      margin-bottom: 0.75rem;
    }

    .page-title {
      font-size: clamp(2rem, 5vw, 3.25rem);
      font-weight: 800;
      letter-spacing: -0.035em;
      line-height: 1.1;
      margin-bottom: 1rem;
    }

    .page-desc {
      font-size: 1rem;
      color: var(--text-muted);
      max-width: 520px;
      line-height: 1.75;
    }

    /* ─── Search ────────────────────────────────────────────────────────── */
    .search-wrap {
      display: flex;
      align-items: stretch;
      gap: 0.5rem;
      width: 100%;
      min-width: 0;
    }

    .search-field {
      position: relative;
      flex: 1;
      min-width: 0;
    }

    .search-field .bi-search {
      position: absolute;
      left: 0.9rem;
      top: 50%;
      transform: translateY(-50%);
      color: var(--text-muted);
      font-size: 0.9rem;
      pointer-events: none;
    }

    .search-input {
      width: 100%;
      min-height: 46px;
      background: var(--bg-card) !important;
      border: 1px solid var(--border-color) !important;
      border-radius: 8px;
      color: var(--text-primary) !important;
      font-family: var(--font-display);
      font-size: 0.875rem;
      padding: 0.65rem 0.9rem 0.65rem 2.4rem;
      outline: none;
      transition: border-color var(--transition), box-shadow var(--transition);
    }
    .search-input:focus {
      border-color: var(--accent) !important;
      box-shadow: 0 0 0 3px var(--accent-glow) !important;
    }
    .search-input::placeholder { color: var(--text-muted); }

    .search-submit {
      flex-shrink: 0;
      min-height: 46px;
      justify-content: center;
      padding: 0.65rem 1.1rem;
    }

    .search-submit:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 3px;
    }

    /* ─── Filter tabs ───────────────────────────────────────────────────── */
    .filter-bar {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      flex-wrap: wrap;
    }

    .filter-btn {
      font-family: var(--font-mono);
      font-size: 0.75rem;
      font-weight: 500;
      padding: 0.4rem 0.9rem;
      border-radius: 20px;
      border: 1px solid var(--border-color);
      background: transparent;
      color: var(--text-muted);
      cursor: pointer;
      transition: all var(--transition);
      white-space: nowrap;
    }

    .filter-btn:hover {
      border-color: var(--accent);
      color: var(--accent);
      background: var(--accent-glow);
    }

    .filter-btn.active {
      background: var(--accent);
      border-color: var(--accent);
      color: #000;
      font-weight: 700;
    }

    /* ─── Sort ──────────────────────────────────────────────────────────── */
    .sort-select {
      font-family: var(--font-mono);
      font-size: 0.75rem;
      padding: 0.4rem 0.75rem;
      border-radius: 8px;
      border: 1px solid var(--border-color);
      background: var(--bg-card);
      color: var(--text-muted);
      cursor: pointer;
      outline: none;
      transition: border-color var(--transition);
    }
    .sort-select:focus { border-color: var(--accent); }

    /* ─── Results count ─────────────────────────────────────────────────── */
    .results-meta {
      font-family: var(--font-mono);
      font-size: 0.75rem;
      color: var(--text-muted);
    }

    .results-meta strong { color: var(--accent); }

    /* ─── Featured card ─────────────────────────────────────────────────── */
    .featured-card {
      display: grid;
      grid-template-columns: 1fr 1fr;
      min-height: 300px;
      overflow: hidden;
      text-decoration: none;
      color: var(--text-primary);
      position: relative;
    }

    .featured-card:hover { color: var(--text-primary); }

    .featured-card::before {
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0;
      height: 3px;
      background: linear-gradient(90deg, var(--accent), transparent 70%);
      border-radius: var(--radius-card) var(--radius-card) 0 0;
      z-index: 1;
    }

    .featured-card:hover {
      border-color: var(--accent);
      box-shadow: 0 16px 48px rgba(0,0,0,0.2);
    }

    .featured-thumb img, .post-thumb img { width: 100%; height: 100%; object-fit: cover; }
    .featured-thumb {
      background: var(--bg-primary);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 5rem;
      position: relative;
      overflow: hidden;
    }

    .featured-thumb::after {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(135deg, var(--accent-glow), transparent 60%);
    }

    .featured-thumb--cover { background: #0c121c; }
    .featured-thumb--cover img { position: absolute; inset: 0; object-fit: contain; }
    .featured-thumb--cover::after, .post-thumb--cover::after { display: none; }

    .featured-body {
      padding: 2rem 2rem 2rem 2rem;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }

    .featured-label {
      font-family: var(--font-mono);
      font-size: 0.68rem;
      color: var(--accent);
      letter-spacing: 0.15em;
      text-transform: uppercase;
      margin-bottom: 0.75rem;
    }

    .featured-title {
      font-size: 1.35rem;
      font-weight: 800;
      letter-spacing: -0.03em;
      line-height: 1.25;
      margin-bottom: 0.75rem;
    }

    .featured-excerpt {
      font-size: 0.875rem;
      color: var(--text-muted);
      line-height: 1.7;
      margin-bottom: 1.25rem;
      flex-grow: 1;
    }

    .featured-meta {
      font-family: var(--font-mono);
      font-size: 0.72rem;
      color: var(--text-muted);
      display: flex;
      gap: 1rem;
      flex-wrap: wrap;
    }

    @media (max-width: 767px) {
      .featured-card { grid-template-columns: 1fr; }
      .featured-thumb { height: 180px; }
    }

    /* ─── Post tag ──────────────────────────────────────────────────────── */
    .post-tag {
      font-family: var(--font-mono);
      font-size: 0.68rem;
      color: var(--accent);
      background: var(--accent-glow);
      border: 1px solid rgba(0,229,160,0.2);
      padding: 0.2rem 0.6rem;
      border-radius: 20px;
      text-decoration: none;
      transition: background var(--transition);
      white-space: nowrap;
    }
    [data-bs-theme="light"] .post-tag { border-color: rgba(0,122,82,0.2); }
    .post-tag:hover { background: rgba(0,229,160,0.25); color: var(--accent); }

    /* ─── Standard post card ────────────────────────────────────────────── */
    .post-card {
      display: flex;
      flex-direction: column;
      height: 100%;
      overflow: hidden;
      text-decoration: none;
      color: var(--text-primary);
    }

    .post-card:hover { color: var(--text-primary); border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0,0,0,0.12); }

    .post-thumb {
      background: var(--bg-primary);
      height: 160px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 3rem;
      position: relative;
      overflow: hidden;
      flex-shrink: 0;
    }

    .post-thumb::after {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(135deg, var(--accent-glow), transparent 60%);
    }

    .post-thumb--cover { height: auto; aspect-ratio: 8 / 5; }

    .post-body {
      padding: 1.25rem;
      display: flex;
      flex-direction: column;
      flex-grow: 1;
    }

    .post-tags {
      display: flex;
      gap: 0.4rem;
      flex-wrap: wrap;
      margin-bottom: 0.65rem;
    }

    .post-title-card {
      font-size: 1rem;
      font-weight: 700;
      letter-spacing: -0.02em;
      line-height: 1.4;
      margin-bottom: 0.5rem;
    }

    .post-excerpt {
      font-size: 0.825rem;
      color: var(--text-muted);
      line-height: 1.65;
      margin-bottom: 1rem;
      flex-grow: 1;
    }

    .post-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding-top: 0.75rem;
      border-top: 1px solid var(--border-color);
      margin-top: auto;
    }

    .post-date {
      font-family: var(--font-mono);
      font-size: 0.7rem;
      color: var(--text-muted);
    }

    .post-read {
      font-family: var(--font-mono);
      font-size: 0.7rem;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      gap: 0.3rem;
    }

    .read-more-arrow {
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--accent);
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
      transition: gap var(--transition);
    }
    .post-card:hover .read-more-arrow { gap: 0.55rem; }

    /* ─── Compact list card ─────────────────────────────────────────────── */
    .list-card {
      display: flex;
      align-items: flex-start;
      gap: 1rem;
      padding: 1rem 1.25rem;
      text-decoration: none;
      color: var(--text-primary);
    }

    .list-card:hover { color: var(--text-primary); border-color: var(--accent); }

    .list-thumb {
      width: 72px;
      height: 72px;
      border-radius: 8px;
      background: var(--bg-primary);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.75rem;
      flex-shrink: 0;
      position: relative;
      overflow: hidden;
    }

    .list-thumb::after {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(135deg, var(--accent-glow), transparent);
    }

    .list-body { flex: 1; min-width: 0; }

    .list-title {
      font-size: 0.9rem;
      font-weight: 700;
      letter-spacing: -0.02em;
      line-height: 1.35;
      margin-bottom: 0.3rem;
    }

    .list-excerpt {
      font-size: 0.78rem;
      color: var(--text-muted);
      line-height: 1.55;
      margin-bottom: 0.4rem;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .list-meta {
      font-family: var(--font-mono);
      font-size: 0.68rem;
      color: var(--text-muted);
      display: flex;
      gap: 0.75rem;
    }

    /* ─── View toggle ───────────────────────────────────────────────────── */
    .view-toggle {
      display: flex;
      border: 1px solid var(--border-color);
      border-radius: 8px;
      overflow: hidden;
    }

    .view-btn {
      width: 34px; height: 34px;
      display: flex; align-items: center; justify-content: center;
      background: transparent;
      border: none;
      color: var(--text-muted);
      cursor: pointer;
      font-size: 0.9rem;
      transition: all var(--transition);
    }

    .view-btn.active,
    .view-btn:hover { background: var(--accent-glow); color: var(--accent); }

    /* ─── Sidebar ───────────────────────────────────────────────────────── */
    .sidebar-sticky { position: sticky; top: 90px; }

    .sidebar-widget {
      padding: 1.25rem;
      margin-bottom: 1.25rem;
    }

    .sidebar-widget-title {
      font-family: var(--font-mono);
      font-size: 0.7rem;
      letter-spacing: 0.15em;
      text-transform: uppercase;
      color: var(--text-muted);
      margin-bottom: 1rem;
      padding-bottom: 0.6rem;
      border-bottom: 1px solid var(--border-color);
    }

    /* Category list */
    .cat-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0.5rem 0.5rem;
      border-radius: 6px;
      text-decoration: none;
      color: var(--text-muted);
      font-size: 0.83rem;
      cursor: pointer;
      transition: all var(--transition);
      border: none;
      background: transparent;
      width: 100%;
      text-align: left;
    }

    .cat-item:hover,
    .cat-item.active { background: var(--accent-glow); color: var(--accent); }

    .cat-item.active { font-weight: 600; }

    .cat-count {
      font-family: var(--font-mono);
      font-size: 0.68rem;
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      padding: 0.1rem 0.45rem;
      border-radius: 20px;
      color: var(--text-muted);
    }

    .cat-item.active .cat-count {
      background: var(--accent-glow);
      border-color: rgba(0,229,160,0.3);
      color: var(--accent);
    }

    /* Tag cloud */
    .tag-cloud { display: flex; flex-wrap: wrap; gap: 0.4rem; }

    .tag-cloud-item {
      font-family: var(--font-mono);
      font-size: 0.72rem;
      padding: 0.25rem 0.65rem;
      border-radius: 20px;
      border: 1px solid var(--border-color);
      background: transparent;
      color: var(--text-muted);
      cursor: pointer;
      transition: all var(--transition);
      text-decoration: none;
    }
    .tag-cloud-item:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

    /* Popular */
    .popular-item {
      display: flex;
      align-items: flex-start;
      gap: 0.75rem;
      padding: 0.65rem 0;
      border-bottom: 1px solid var(--border-color);
      text-decoration: none;
      color: var(--text-primary);
      transition: color var(--transition);
    }
    .popular-item:last-child { border-bottom: none; padding-bottom: 0; }
    .popular-item:hover { color: var(--accent); }

    .popular-num {
      font-family: var(--font-mono);
      font-size: 0.7rem;
      color: var(--accent);
      font-weight: 700;
      width: 18px;
      flex-shrink: 0;
      margin-top: 2px;
    }

    .popular-title {
      font-size: 0.82rem;
      font-weight: 600;
      line-height: 1.4;
      margin-bottom: 0.2rem;
    }

    .popular-meta {
      font-family: var(--font-mono);
      font-size: 0.68rem;
      color: var(--text-muted);
    }

    /* Newsletter */
    .newsletter-input {
      width: 100%;
      background: var(--bg-primary) !important;
      border: 1px solid var(--border-color) !important;
      border-radius: 8px;
      color: var(--text-primary) !important;
      font-family: var(--font-display);
      font-size: 0.82rem;
      padding: 0.55rem 0.85rem;
      margin-bottom: 0.6rem;
      outline: none;
      transition: border-color var(--transition);
    }
    .newsletter-input:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-glow) !important; }

    /* ─── Pagination ────────────────────────────────────────────────────── */
    .pagination-wrap {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.4rem;
      padding: 3rem 0 1rem;
    }

    .page-btn {
      width: 38px; height: 38px;
      display: flex; align-items: center; justify-content: center;
      border-radius: 8px;
      border: 1px solid var(--border-color);
      background: transparent;
      color: var(--text-muted);
      font-family: var(--font-mono);
      font-size: 0.82rem;
      cursor: pointer;
      transition: all var(--transition);
      text-decoration: none;
    }

    .page-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

    .page-btn.active {
      background: var(--accent);
      border-color: var(--accent);
      color: #000;
      font-weight: 700;
    }

    .page-btn.disabled { opacity: 0.35; pointer-events: none; }

    /* ─── Empty state ───────────────────────────────────────────────────── */
    .empty-state {
      text-align: center;
      padding: 4rem 1rem;
      display: none;
    }

    .empty-state.visible { display: block; }

    .empty-icon {
      font-size: 3rem;
      color: var(--text-muted);
      display: block;
      margin-bottom: 1rem;
    }

    .empty-title {
      font-size: 1.1rem;
      font-weight: 700;
      margin-bottom: 0.5rem;
    }

    .empty-desc {
      font-size: 0.875rem;
      color: var(--text-muted);
    }

    /* ─── Footer ────────────────────────────────────────────────────────── */
    footer {
      padding: 2rem 0;
      border-top: 1px solid var(--border-color);
      font-size: 0.8rem;
      color: var(--text-muted);
    }

    /* ─── Layout ────────────────────────────────────────────────────────── */
    .blog-layout { padding: 3.5rem 0 5rem; }

    @keyframes fadeUp {
      from { opacity: 0; transform: translateY(16px); }
    }
    .fade-up { animation: fadeUp 0.55s cubic-bezier(0.4,0,0.2,1) both; }
    .delay-1 { animation-delay: 0.08s; }
    .delay-2 { animation-delay: 0.16s; }

    [id] { scroll-margin-top: 90px; }

    /* ─── List view toggle ──────────────────────────────────────────────── */
    #postsGrid.list-view .post-card-wrap { flex: 0 0 100%; max-width: 100%; }
    #postsGrid.list-view .post-card { flex-direction: row; }
    #postsGrid.list-view .post-thumb { width: 140px; height: auto; min-height: 120px; flex-shrink: 0; border-radius: var(--radius-card) 0 0 var(--radius-card); }
    #postsGrid.list-view .post-thumb--cover { aspect-ratio: auto; background: #0c121c; }
    #postsGrid.list-view .post-thumb--cover img { position: absolute; inset: 0; object-fit: contain; }
    #postsGrid.list-view .post-thumb::after { border-radius: var(--radius-card) 0 0 var(--radius-card); }

    @media (max-width: 768px) {
      #postsGrid.list-view .post-card { flex-direction: column; }
      #postsGrid.list-view .post-thumb { width: 100%; height: 140px; border-radius: var(--radius-card) var(--radius-card) 0 0; }
    }
