.hero {
    padding: 60px 0 !important;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Wyszukiwarka ---------- */

.search-form {
    max-width: 760px;
    margin-top: 1.75rem;
    scroll-margin-top: 140px;
}

.search-field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--white);
    border: 1.5px solid var(--border-light);
    border-radius: 14px;
    padding: 0.375rem 0.375rem 0.375rem 1rem;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-field:hover {
    border-color: #cfcfcf;
}

.search-field:focus-within {
    border-color: var(--accent-red);
    box-shadow: 0 0 0 4px rgba(223, 63, 63, 0.12), 0 4px 16px rgba(16, 24, 40, 0.06);
}

.search-field-icon {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.search-field input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font: inherit;
    font-size: 1.0625rem;
    color: var(--text-main);
    padding: 0.625rem 0;
}

.search-field input::placeholder {
    color: #9a9a9a;
}

.search-field input::-webkit-search-cancel-button,
.search-field input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

.search-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.search-clear[hidden] {
    display: none;
}

.search-clear:hover,
.search-clear:focus-visible {
    background: var(--gray-light);
    color: var(--text-main);
}

.search-clear svg {
    width: 18px;
    height: 18px;
}

.search-kbd {
    font-family: 'Inter', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    color: var(--text-secondary);
    background: var(--gray-light);
    border: 1px solid var(--border-light);
    border-bottom-width: 2px;
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
}

.search-form.has-value .search-kbd,
.search-field:focus-within .search-kbd {
    display: none;
}

.search-submit {
    border: 0;
    border-radius: 10px;
    background: var(--accent-red);
    color: var(--white);
    font: inherit;
    font-weight: 600;
    padding: 0.7rem 1.4rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-submit:hover,
.search-submit:focus-visible {
    background: var(--accent-red-hover);
}

.search-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-light);
    border-top-color: var(--accent-red);
    border-radius: 50%;
    animation: search-spin 0.7s linear infinite;
}

.search-form.is-loading .search-spinner {
    display: inline-block;
}

@keyframes search-spin {
    to {
        transform: rotate(360deg);
    }
}

.search-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.search-chips--center {
    justify-content: center;
    margin: 1.5rem 0;
}

.search-chips-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-right: 0.25rem;
}

.search-chip {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    background: var(--gray-light);
    border: 1px solid var(--border-light);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.search-chip:hover,
.search-chip:focus-visible {
    border-color: var(--accent-red);
    color: var(--accent-red);
    background: var(--white);
}

/* ---------- Pasek wyników ---------- */

.artykuly-container {
    padding: 2.5rem 1rem 3rem;
}

.artykuly-wyniki {
    transition: opacity 0.2s ease;
}

.artykuly-wyniki.is-loading {
    opacity: 0.55;
}

.wyniki-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.wyniki-count {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.wyniki-count strong {
    color: var(--text-main);
}

.wyniki-query {
    color: var(--text-main);
    font-weight: 600;
    word-break: break-word;
}

.wyniki-sort {
    display: inline-flex;
    background: #ebebeb;
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}

.wyniki-sort-btn {
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.wyniki-sort-btn:hover {
    color: var(--text-main);
}

.wyniki-sort-btn.is-active {
    background: var(--white);
    color: var(--text-main);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* ---------- Karty ---------- */

.artykuly-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.artykul-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #ececec;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    display: flex;
    flex-direction: column;
    animation: card-in 0.3s ease both;
}

@keyframes card-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
}

.artykul-card:hover,
.artykul-card:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: #e2e2e2;
}

.artykul-card-inner {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
}

.artykul-card-inner:focus-visible {
    outline: 3px solid rgba(223, 63, 63, 0.4);
    outline-offset: -3px;
    border-radius: 12px;
}

.artykul-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.artykul-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.artykul-title {
    color: #1a2332;
    font-size: 1.3rem;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.artykul-lead {
    color: #555;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    flex: 1;
}

.artykul-fragment {
    display: flex;
    gap: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.55;
    color: #555;
    background: #fafafa;
    border-left: 3px solid var(--accent-red);
    border-radius: 0 8px 8px 0;
    padding: 0.625rem 0.75rem;
    margin: -0.25rem 0 1.25rem;
}

.artykul-fragment > svg {
    flex-shrink: 0;
    margin-top: 0.2rem;
    color: var(--text-secondary);
}

.artykul-card mark {
    background: rgba(223, 63, 63, 0.14);
    color: inherit;
    border-radius: 3px;
    padding: 0 2px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.artykul-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--accent-red);
    font-weight: 600;
    align-self: flex-start;
    transition: gap 0.2s ease, color 0.2s ease;
}

.artykul-card:hover .artykul-link {
    gap: 0.5rem;
    color: var(--accent-red-hover);
}

/* ---------- Pusty stan ---------- */

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    max-width: 560px;
    margin: 0 auto;
    color: var(--text-secondary);
}

.no-results-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(223, 63, 63, 0.1);
    color: var(--accent-red);
    margin-bottom: 1rem;
}

.no-results h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.375rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.no-results p {
    line-height: 1.6;
}

.no-results-reset {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--accent-red);
    font-weight: 600;
    text-decoration: none;
}

.no-results-reset:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .artykuly-grid {
        grid-template-columns: 1fr !important;
    }

    .search-kbd {
        display: none;
    }

    .search-submit {
        padding: 0.7rem 1rem;
    }

    .wyniki-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 420px) {
    .search-submit {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .artykul-card,
    .search-spinner {
        animation: none;
    }

    .artykul-card:hover,
    .artykul-card:focus-within {
        transform: none;
    }
}
