/* Search page — pixel match to reference mockup */

body.search-page {
    background: #080c0a;
}

.search-page main {
    padding: 0;
}

.search-page-wrap {
    --search-accent: #5ecf8a;
    --search-accent-hover: #7ddda3;
    --search-accent-soft: rgba(94, 207, 138, 0.1);
    --search-accent-border: rgba(94, 207, 138, 0.32);
    --search-accent-text: #6ec492;
    --search-panel: #101612;
    --search-panel-border: rgba(42, 61, 50, 0.72);
    --search-row-border: rgba(255, 255, 255, 0.055);
    --search-muted: #8fa396;
    --search-container: min(1120px, 100%);
}

.search-hero {
    position: relative;
    overflow: hidden;
    padding: 2.35rem 0 1.35rem;
}

.search-hero::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -4%;
    width: min(560px, 52vw);
    height: min(340px, 42vw);
    background: url('../images/geo/illustrations/cemetery/kladbishhe-repnoe.png') center / cover no-repeat;
    filter: blur(2px) saturate(0.82) brightness(0.72);
    opacity: 0.55;
    pointer-events: none;
    mask-image: radial-gradient(ellipse at 72% 28%, #000 12%, transparent 72%);
    -webkit-mask-image: radial-gradient(ellipse at 72% 28%, #000 12%, transparent 72%);
}

.search-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, #080c0a 0%, rgba(8, 12, 10, 0.92) 42%, rgba(8, 12, 10, 0.35) 100%),
        linear-gradient(180deg, rgba(8, 12, 10, 0.15) 0%, #080c0a 100%);
    pointer-events: none;
}

.search-hero__inner {
    position: relative;
    z-index: 1;
    width: var(--search-container);
    margin: 0 auto;
    padding: 0 1.25rem;
}

.search-hero__title {
    margin: 0 0 0.5rem;
    font-family: var(--font-serif, 'PT Serif', Georgia, serif);
    font-size: clamp(2.15rem, 4.8vw, 3rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: #fff;
}

.search-hero__subtitle {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.55;
    color: var(--search-muted);
}

.search-form-wrap {
    width: var(--search-container);
    margin: 0 auto;
    padding: 0 1.25rem 1.5rem;
}

.search-form {
    display: grid;
    gap: 0.85rem;
    padding: 1rem 1.05rem;
    border-radius: 18px;
    border: 1px solid var(--search-panel-border);
    background: rgba(16, 22, 18, 0.96);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

@media (min-width: 820px) {
    .search-form {
        grid-template-columns: minmax(0, 1fr) 168px auto;
        align-items: end;
        gap: 0.8rem;
        padding: 1rem 1.1rem;
    }
}

.search-form .form-group {
    margin: 0;
    min-width: 0;
}

.search-form .form-label {
    display: block;
    margin-bottom: 0.38rem;
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #b7c3bb;
}

.search-form__input-shell {
    position: relative;
}

.search-form__input-shell .form-input::-webkit-search-decoration,
.search-form__input-shell .form-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.search-form .form-input {
    width: 100%;
    min-height: 44px;
    padding: 0.72rem 0.95rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(0, 0, 0, 0.34);
    color: #eef2ef;
    font-size: 0.92rem;
}

.search-form__input-shell .form-input,
.search-form__input-shell .search-form__query-input {
    padding-left: 2.55rem;
}

.search-form .form-input:focus {
    outline: none;
    border-color: var(--search-accent-border);
    box-shadow: 0 0 0 3px rgba(94, 207, 138, 0.1);
}

.search-form__query-icon {
    position: absolute;
    left: 0.88rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: #73867a;
    pointer-events: none;
}

.search-form__submit {
    min-height: 44px;
    padding: 0 1.35rem;
    border-radius: 12px;
    border: none;
    background: var(--search-accent);
    color: #052e16;
    font-size: 0.92rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.search-form__submit:hover {
    background: var(--search-accent-hover);
}

@media (max-width: 819px) {
    .search-form__submit {
        width: 100%;
    }

    .search-form__input-shell .form-input,
    .search-form__input-shell .search-form__query-input {
        padding-left: 2.85rem !important;
        padding-right: 1rem !important;
    }

    .search-form__query-icon {
        left: 0.95rem;
        width: 1.05rem;
        height: 1.05rem;
    }
}

.search-body {
    width: var(--search-container);
    margin: 0 auto;
    padding: 0 1.25rem 3rem;
}

.search-panel {
    border-radius: 20px;
    border: 1px solid var(--search-panel-border);
    background: var(--search-panel);
    overflow: hidden;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
}

.search-panel + .search-panel {
    margin-top: 1rem;
}

.search-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.05rem 1.2rem;
    border-bottom: 1px solid var(--search-row-border);
}

.search-panel__title-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.search-panel__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--search-accent);
    flex-shrink: 0;
}

.search-panel__icon .rp-icon {
    width: 1.05rem;
    height: 1.05rem;
}

.search-panel__title {
    margin: 0;
    font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
    font-size: 0.98rem;
    font-weight: 600;
    color: #fff;
}

.search-panel__title-block {
    min-width: 0;
}

.search-panel__lead {
    margin: 0.25rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--search-muted);
}

.search-panel__add {
    flex-shrink: 0;
    white-space: nowrap;
}

.search-panel__head-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    flex-shrink: 0;
}

.search-result-section__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 0.75rem;
}

.search-result-section__head .search-result-section__title {
    margin: 0;
}

.search-result-section__head .search-panel__add {
    margin-top: 0.1rem;
}

.search-panel__more {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--search-muted);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s;
}

.search-panel__more:hover {
    color: var(--search-accent-text);
}

.search-panel__more .rp-icon {
    width: 0.85rem;
    height: 0.85rem;
}

.search-cemetery-list {
    display: flex;
    flex-direction: column;
}

.search-cemetery-row {
    display: grid;
    gap: 0.9rem;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--search-row-border);
    align-items: center;
}

.search-cemetery-row:last-child {
    border-bottom: none;
}

@media (min-width: 760px) {
    .search-cemetery-row {
        grid-template-columns: 118px minmax(0, 1fr) 92px;
        gap: 1rem 1.1rem;
        padding: 0.95rem 1.2rem;
    }
}

.search-cemetery-row__media,
.search-cemetery-row__media-link {
    display: block;
    width: 118px;
    height: 78px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.search-cemetery-row__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.search-cemetery-row__media--empty {
    background:
        linear-gradient(145deg, rgba(94, 207, 138, 0.08) 0%, rgba(12, 18, 15, 0.95) 100%),
        radial-gradient(circle at 28% 34%, rgba(94, 207, 138, 0.14), transparent 58%);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.search-cemetery-row__media--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(148, 163, 154, 0.72);
}

.search-cemetery-row__media--placeholder .rp-icon {
    width: 1.45rem;
    height: 1.45rem;
}

.search-cemetery-row__body {
    min-width: 0;
}

.search-cemetery-row__title {
    margin: 0 0 0.28rem;
    font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.25;
}

.search-cemetery-row__title a {
    color: #fff;
    text-decoration: none;
}

.search-cemetery-row__title a:hover {
    color: var(--search-accent-text);
}

.search-cemetery-row__location {
    display: flex;
    align-items: flex-start;
    gap: 0.32rem;
    margin: 0 0 0.48rem;
    font-size: 0.78rem;
    line-height: 1.42;
    color: var(--search-accent-text);
}

.search-cemetery-row__location .rp-icon {
    width: 0.82rem;
    height: 0.82rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
    opacity: 0.92;
}

.search-cemetery-row__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1.35rem;
    font-size: 0.74rem;
    color: #73867a;
}

.search-cemetery-row__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
}

.search-cemetery-row__meta-item .rp-icon {
    width: 0.82rem;
    height: 0.82rem;
    opacity: 0.85;
}

.search-cemetery-row__actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.search-cemetery-row__map {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--search-accent-border);
    background: rgba(94, 207, 138, 0.06);
    color: var(--search-accent);
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.search-cemetery-row__map:hover {
    background: rgba(94, 207, 138, 0.14);
    color: var(--search-accent);
}

.search-cemetery-row__map .rp-icon {
    width: 1rem;
    height: 1rem;
}

.search-cemetery-row__open {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}

.search-cemetery-row__open:hover {
    color: var(--search-accent-text);
}

.search-cemetery-row__open .rp-icon {
    width: 0.82rem;
    height: 0.82rem;
}

.search-pagination {
    padding: 0.95rem 1.2rem 1.05rem;
    border-top: 1px solid var(--search-row-border);
}

.search-pagination__nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.search-pagination__summary {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--search-muted);
    text-align: center;
}

.search-pagination__summary strong {
    color: #fff;
    font-weight: 600;
}

.search-pagination .pagination {
    display: flex;
    gap: 0.3rem;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.search-pagination .page-item .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 0.55rem;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--search-muted);
    font-size: 0.8125rem;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.search-pagination .page-item .page-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
}

.search-pagination .page-item.active .page-link {
    background: var(--search-accent);
    border-color: var(--search-accent);
    color: #052e16;
    font-weight: 700;
}

.search-pagination .page-item.disabled .page-link {
    opacity: 0.35;
    cursor: not-allowed;
}

.search-person-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1.2rem;
    border-bottom: 1px solid var(--search-row-border);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.search-person-row:last-child {
    border-bottom: none;
}

.search-person-row:hover {
    background: rgba(94, 207, 138, 0.035);
}

.search-person-row__name {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
}

.search-person-row__meta {
    display: block;
    margin-top: 0.12rem;
    font-size: 0.78rem;
    color: var(--search-muted);
}

.search-person-row__action {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.search-person-row:hover .search-person-row__action {
    color: var(--search-accent-text);
}

.search-result-section__title {
    margin: 0;
    padding: 1rem 1.2rem 0.85rem;
    font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
    font-size: 0.98rem;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid var(--search-row-border);
}

.search-result-section__lead {
    margin: 0;
    padding: 0 1.2rem 0.85rem;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--search-muted);
    border-bottom: 1px solid var(--search-row-border);
}

.search-person-row--inscription {
    border-left: 2px solid rgba(94, 207, 138, 0.22);
}

.search-empty {
    padding: 2rem 1.2rem;
    text-align: center;
    color: var(--search-muted);
    line-height: 1.6;
}

.search-empty a {
    font-weight: 600;
}

.search-guest-limit {
    margin: 0 0 1rem;
}

.search-section-more-wrap {
    padding: 0.85rem 1.2rem 1rem;
    border-top: 1px solid var(--search-row-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
}

.search-section-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(94, 207, 138, 0.28);
    background: rgba(94, 207, 138, 0.08);
    color: var(--search-accent-text);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.search-section-more:hover:not(:disabled) {
    background: rgba(94, 207, 138, 0.14);
    border-color: rgba(94, 207, 138, 0.42);
}

.search-section-more:disabled {
    opacity: 0.65;
    cursor: wait;
}

.search-section-more__status {
    margin: 0;
    font-size: 0.78rem;
    color: var(--search-muted);
}

.search-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem 1.15rem;
    border-radius: 18px;
    border: 1px solid var(--search-panel-border);
    background: rgba(16, 22, 18, 0.96);
}

@media (max-width: 759px) {
    .search-cta {
        flex-direction: column;
        align-items: stretch;
    }

    .search-cemetery-row__actions {
        flex-direction: row;
        justify-content: flex-start;
    }

    .search-cemetery-row__media,
    .search-cemetery-row__media-link {
        width: 100%;
        height: 150px;
    }
}

.search-cta__content {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    min-width: 0;
}

.search-cta__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 11px;
    background: var(--search-accent-soft);
    color: var(--search-accent);
    flex-shrink: 0;
}

.search-cta__icon .rp-icon {
    width: 1.1rem;
    height: 1.1rem;
}

.search-cta__title {
    margin: 0 0 0.18rem;
    font-family: var(--font-sans, 'Inter', system-ui, sans-serif);
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
}

.search-cta__text {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--search-muted);
}

.search-cta__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 42px;
    padding: 0 1rem;
    border-radius: 12px;
    border: 1px solid var(--search-accent-border);
    background: transparent;
    color: var(--search-accent);
    font-size: 0.8125rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
}

.search-cta__button:hover {
    background: var(--search-accent-soft);
    color: var(--search-accent);
}

@media (max-width: 819px) {
    .search-hero::before {
        right: -18%;
        width: min(320px, 72vw);
        opacity: 0.42;
    }
}
