/* /domains/gromadan.com/public_html/css/top/style.css
   Переменные (--surface, --radius-*, --shadow, --primary и т.д.) уже
   объявлены в /css/style.css, подключённом раньше в header.php.
   Страница /top/ использует useDefaultLayout=true (см. header.php) —
   .top-wrap лежит ВНУТРИ уже существующего .app > .main, поэтому сама
   ширину колонки не задаёт (тот же принцип, что у user/index.php),
   только внутренние отступы. */

.top-wrap { padding: 4px 0 40px; }
.top-heading { font-family: 'Unbounded', sans-serif; font-size: 1.5rem; margin-bottom: 24px; }
.top-empty { text-align: center; color: var(--text-secondary); padding: 40px 0; }

.top-list { display: flex; flex-direction: column; gap: 16px; }

.top-item {
    position: relative; /* якорь для .top-item-stretch и .top-badge */
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    color: var(--text-primary);
    transition: transform .15s ease;
}
.top-item:hover { transform: translateY(-2px); }

/* "Растянутая" ссылка на весь профиль — нижний слой (z-index:1), кликабельна
   везде, КРОМЕ мест, где поверх неё лежат настоящие ссылки города/области
   (у них z-index выше, см. .top-loc-link). */
.top-item-stretch {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

.top-photo {
    position: relative;
    z-index: 2;
    width: 150px; height: 150px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg);
    flex-shrink: 0;
    pointer-events: none; /* клик по фото проваливается на .top-item-stretch под ним */
}
.top-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.top-info {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding-top: 2px;
}
.top-name {
    position: relative;
    z-index: 3;
    font-weight: 700;
    font-size: 1.3rem;
    line-height: 1.2;
    color: inherit;
    text-decoration: none;
}

.top-row {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-secondary);
    font-size: .92rem;
    flex-wrap: wrap;
}
.top-row .icon { flex-shrink: 0; color: var(--text-secondary); pointer-events: none; }

/* Настоящая ссылка города/области — z-index ВЫШЕ растянутой ссылки,
   поэтому клик именно по слову "Київ" уводит на страницу города,
   а не в профиль (и наоборот — клик рядом уходит в профиль). */
.top-loc-link {
    position: relative;
    z-index: 3;
    color: inherit;
    text-decoration: none;
    transition: color .15s ease;
}
.top-loc-link:hover { color: var(--primary); text-decoration: none; }

.top-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    margin-top: 16px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: rgba(46, 125, 50, .1);
    color: #2E7D32;
    font-size: .82rem;
    font-weight: 600;
    pointer-events: none;
}

.top-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    pointer-events: none;
}
.top-badge-medal { font-size: 1.9rem; line-height: 1; }
.top-badge-rank {
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: .78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

@media (max-width: 560px) {
    .top-item { flex-direction: column; }
    .top-photo { width: 100%; height: 200px; }
    .top-badge { top: 12px; right: 12px; flex-direction: row; }
    .top-badge-medal { font-size: 1.5rem; }
}

/* Хлібні крихти + кнопка "Назад" зверху сторінки — контейнер і сама
   кнопка. Скрол рядка крихт (.rbs-row) уже описаний у
   css/includes/breadcrumbs_scroll.css, тут його не дублюємо. */
.top-crumbs-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 20px;
}
.top-crumbs-back-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 9px 16px;
    border-radius: var(--radius-pill);
    background: var(--primary-light);
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

.top-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}
.top-filter-select {
    padding: 9px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 600;
    min-width: 140px;
}
.top-filter-apply {
    padding: 9px 20px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--gradient);
    color: #fff;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
}
@media (max-width: 560px) {
    .top-filter-bar { flex-direction: column; }
    .top-filter-select, .top-filter-apply { width: 100%; }
}