/* Social network buttons in the profile header (profile_includes/social_links.html)
   and the social links / privacy fields of the profile settings. */

.profile-social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}
.profile-social-links__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 6px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    color: #1f2937;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.profile-social-links__item img { flex: none; width: 24px; height: 24px; border-radius: 999px; }
.profile-social-links__item:hover { border-color: #fdba74; box-shadow: 0 4px 14px rgba(249, 115, 22, .14); transform: translateY(-1px); }
.profile-social-links__item:focus-visible { outline: 2px solid #f97316; outline-offset: 2px; }

.profile-social-links__add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    padding: 8px 14px;
    border: 1px dashed #fdba74;
    border-radius: 999px;
    background: #fff7ed;
    color: #ea580c;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}
.profile-social-links__add svg { width: 14px; height: 14px; }
.profile-social-links__add:hover { background: #ffedd5; }

/* mobile hero: one scrollable row under the bio */
.profile-social-links--app { flex-wrap: nowrap; overflow-x: auto; margin: 12px -16px 0; padding: 0 16px 2px; scrollbar-width: none; }
.profile-social-links--app::-webkit-scrollbar { display: none; }
.profile-social-links--app li { flex: none; }
.profile-social-links__add--app { margin-top: 12px; }

/* settings: social links */
.profile-settings-social { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.profile-settings-social__field { position: relative; }
.profile-settings-social__field img { position: absolute; top: 50%; left: 12px; width: 22px; height: 22px; border-radius: 999px; transform: translateY(-50%); pointer-events: none; }
.profile-settings-social__field input { padding-left: 44px !important; }
@media (max-width: 639px) { .profile-settings-social { grid-template-columns: 1fr; } }

/* settings: the «hide profile» switch */
.profile-privacy-switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; border: 1px solid #f3f4f6; border-radius: 20px; background: #f9fafb; cursor: pointer; }
.profile-privacy-switch input { position: absolute; opacity: 0; pointer-events: none; }
.profile-privacy-switch__track { position: relative; flex: none; width: 46px; height: 28px; border-radius: 999px; background: #d1d5db; transition: background-color .18s ease; }
.profile-privacy-switch__track::after { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .25); content: ''; transition: transform .18s ease; }
.profile-privacy-switch input:checked + .profile-privacy-switch__track { background: #f97316; }
.profile-privacy-switch input:checked + .profile-privacy-switch__track::after { transform: translateX(18px); }
.profile-privacy-switch input:focus-visible + .profile-privacy-switch__track { outline: 2px solid #f97316; outline-offset: 2px; }

html[data-theme="dark"] .profile-social-links__item { background: #111a16; border-color: #24332c; color: #e6f1ea; }
html[data-theme="dark"] .profile-social-links__add { background: rgba(249, 115, 22, .12); border-color: rgba(249, 115, 22, .45); color: #fb923c; }
html[data-theme="dark"] .profile-privacy-switch { background: #111a16; border-color: #24332c; }
html[data-theme="dark"] .profile-privacy-switch__track { background: #334155; }

/* the owner's reminder that the profile is hidden (templates/profile.html) */
.profile-private-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; border: 1px solid #fed7aa; border-radius: 18px; background: #fff7ed; color: #9a3412; font-size: 13px; font-weight: 700; }
.profile-private-notice svg { flex: none; width: 18px; height: 18px; }
.profile-private-notice span { flex: 1 1 220px; }
.profile-private-notice a,
.profile-private-notice button { padding: 0; border: 0; background: none; color: #ea580c; font: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (max-width: 767px) { .profile-private-notice { margin: 12px 16px 0; } }
html[data-theme="dark"] .profile-private-notice { background: rgba(249, 115, 22, .12); border-color: rgba(249, 115, 22, .4); color: #fdba74; }

/* hero: the owner's «Мои маршруты» and «Мои походы» in one row with dark text;
   the visitor's «Подписаться / Вы подписаны» and «Сообщение» in one font size */
.profile-page .profile-header-actions--owner { flex-direction: row !important; align-items: center !important; }
/* «Мои маршруты» и «Мои походы» look like the social network buttons */
.profile-page .profile-header-routes-button {
    min-height: 0;
    gap: 8px;
    padding: 6px 14px 6px 6px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    color: #1f2937;
    font-family: inherit;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1;
    box-shadow: none;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.profile-page .profile-header-routes-button:hover { border-color: #fdba74; background: #fff; color: #1f2937; box-shadow: 0 4px 14px rgba(249, 115, 22, .14); transform: translateY(-1px); }
.profile-page .profile-header-routes-button img { width: 24px; height: 24px; padding: 4px; border-radius: 999px; background: #fff1e8; box-sizing: border-box; }
.profile-page .profile-desktop-hero .profile-header-action-row > a,
.profile-page .profile-desktop-hero .profile-header-action-row > button,
.profile-page .profile-desktop-hero .profile-header-action-row > .relative > button {
    font-size: 14px !important;
    font-weight: 720 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}
html[data-theme="dark"] .profile-page .profile-header-routes-button { background: #111a16; border-color: #24332c; color: #e6f1ea; }

/* Публикации filtered by a region of the travel map */
#profile-panel-posts { position: relative; }
.profile-posts-anchor { position: absolute; top: 0; left: 0; width: 1px; height: 1px; pointer-events: none; }
.profile-posts-region { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 16px; border: 1px solid #fed7aa; border-radius: 18px; background: #fff7ed; color: #9a3412; font-size: 14px; font-weight: 700; }
.profile-posts-region a { color: #ea580c; font-weight: 800; }

/* sidebar: followers (a grid of photos) and clubs (a list) */
.profile-people-card__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.profile-people-card__head button { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.profile-people-card .profile-people-card__head h3 { margin: 0 !important; font-size: 15px !important; font-weight: 750 !important; }
.profile-people-card__head h3 span { margin-left: 4px; color: #9ca3af; font-weight: 650; }
.profile-people-card__head button:hover h3 { color: #ea580c !important; }
.profile-people-card__head .profile-people-card__more { color: #6b7280; font-size: 13px; font-weight: 650; white-space: nowrap; }
.profile-people-card__head .profile-people-card__more b { color: #111827; font-weight: 750; }
.profile-people-card__head .profile-people-card__more:hover { color: #ea580c; }

.profile-followers-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 6px; margin: 0; padding: 0; list-style: none; }
.profile-followers-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; color: #111827; text-decoration: none; }
.profile-followers-grid__avatar { display: grid; place-items: center; width: 56px; height: 56px; overflow: hidden; border-radius: 999px; background: #f1f5f9; color: #64748b; font-size: 20px; font-weight: 800; transition: box-shadow .18s ease; }
.profile-followers-grid__avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-followers-grid a:hover .profile-followers-grid__avatar { box-shadow: 0 0 0 3px #fdba74; }
.profile-followers-grid__name { max-width: 100%; overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }

.profile-clubs-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.profile-clubs-list a { display: flex; align-items: center; gap: 12px; min-width: 0; color: #111827; text-decoration: none; }
.profile-clubs-list__avatar { display: grid; flex: none; place-items: center; width: 46px; height: 46px; overflow: hidden; border-radius: 999px; background: #fff1e8; color: #ea580c; font-size: 18px; font-weight: 800; }
.profile-clubs-list__avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-clubs-list__text { display: grid; gap: 2px; min-width: 0; }
.profile-clubs-list__text strong,
.profile-clubs-list__text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-clubs-list__text strong { font-size: 14px; font-weight: 700; }
.profile-clubs-list__text small { color: #6b7280; font-size: 12px; }
.profile-clubs-list a:hover strong { color: #ea580c; }

html[data-theme="dark"] .profile-followers-grid a,
html[data-theme="dark"] .profile-clubs-list a { color: #e6f1ea; }
html[data-theme="dark"] .profile-followers-grid__avatar { background: #1a2620; color: #9fb2a8; }
html[data-theme="dark"] .profile-clubs-list__text small { color: #9fb2a8; }
html[data-theme="dark"] .profile-posts-region { background: rgba(249, 115, 22, .12); border-color: rgba(249, 115, 22, .4); color: #fdba74; }

/* wider sidebar, narrower content column (profile.css: 292px / 276px) */
@media (min-width: 1024px) {
    .profile-content-layout { grid-template-columns: minmax(0, 1fr) 340px !important; }
    .profile-content-layout > aside { width: 340px !important; max-width: 340px !important; }
}
@media (min-width: 1024px) and (max-width: 1180px) {
    .profile-content-layout { grid-template-columns: minmax(0, 1fr) 300px !important; }
    .profile-content-layout > aside { width: 300px !important; max-width: 300px !important; }
}
html[data-theme="dark"] .profile-people-card__head .profile-people-card__more b { color: #e6f1ea; }
/* without the stats card under the cover the sidebar starts level with the tabs (profile.css pulled it up by 112px) */
@media (min-width: 1024px) {
    .profile-page .profile-content-layout > aside { margin-top: 0 !important; }
}

/* desktop hero: the cover fills the whole hero, the content keeps one bottom margin,
   and the buttons on the right sit on the bottom line of the avatar column */
@media (min-width: 1024px) {
    .profile-page .profile-desktop-hero > .profile-header-cover { position: absolute !important; inset: 0 !important; height: auto !important; }
    .profile-page .profile-desktop-hero > .profile-header-info { margin-top: 0 !important; padding-top: 168px !important; padding-bottom: 34px !important; }
    /* the info block now spans the whole cover (z-index 80): its empty top lets clicks through to the
       cover's own buttons (guide tour, settings, QR), its content stays clickable */
    .profile-page .profile-desktop-hero > .profile-header-info { pointer-events: none; }
    .profile-page .profile-desktop-hero > .profile-header-info > * { pointer-events: auto; }
    .profile-page .profile-desktop-hero .profile-header-main { align-self: stretch !important; display: flex !important; flex-direction: column; }
    .profile-page .profile-desktop-hero .profile-header-main-row { flex: 1 1 auto; }
    .profile-page .profile-desktop-hero .profile-header-main-row > .profile-header-actions { align-self: end !important; }
}
@media (min-width: 1024px) and (max-width: 1180px) {
    .profile-page .profile-desktop-hero > .profile-header-info { padding-top: 150px !important; padding-bottom: 28px !important; }
}

/* desktop hero, bottom line: the social chips, «Мои маршруты / Мои походы» and the visitor's buttons
   all end level with the avatar's badge */
@media (min-width: 1024px) {
    .profile-page .profile-desktop-hero .profile-header-main-row { align-items: end !important; }
}

/* the visitor's «Подписаться / Вы подписаны», «Сообщение» and «…» are pills like «Мои маршруты» */
.profile-page .profile-desktop-hero .profile-header-action-row { gap: 8px !important; }
.profile-page .profile-desktop-hero .profile-header-action-row > a,
.profile-page .profile-desktop-hero .profile-header-action-row > button,
.profile-page .profile-desktop-hero .profile-header-action-row > .relative > button {
    min-height: 0 !important;
    height: 38px !important;
    gap: 8px;
    padding: 0 16px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 999px !important;
    background: #fff !important;
    color: #1f2937 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.profile-page .profile-desktop-hero .profile-header-action-row > a:hover,
.profile-page .profile-desktop-hero .profile-header-action-row > button:hover,
.profile-page .profile-desktop-hero .profile-header-action-row > .relative > button:hover {
    border-color: #fdba74 !important;
    box-shadow: 0 4px 14px rgba(249, 115, 22, .14) !important;
    transform: translateY(-1px);
}
.profile-page .profile-desktop-hero .profile-header-action-row > .relative > .follow-btn-ui[data-follow-state="not"] {
    border-color: #f97316 !important;
    background: #f97316 !important;
    color: #fff !important;
}
.profile-page .profile-desktop-hero .profile-header-action-row summary {
    width: 38px !important;
    height: 38px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 999px !important;
    background: #fff !important;
    box-shadow: none !important;
}
html[data-theme="dark"] .profile-page .profile-desktop-hero .profile-header-action-row > a,
html[data-theme="dark"] .profile-page .profile-desktop-hero .profile-header-action-row > button,
html[data-theme="dark"] .profile-page .profile-desktop-hero .profile-header-action-row > .relative > button:not([data-follow-state="not"]),
html[data-theme="dark"] .profile-page .profile-desktop-hero .profile-header-action-row summary {
    border-color: #24332c !important;
    background: #111a16 !important;
    color: #e6f1ea !important;
}

/* the follow and «…» menus open below the hero: it no longer clips them and stays above the page */
.profile-page .profile-desktop-hero { overflow: visible !important; position: relative; z-index: 40; }
.profile-page .profile-desktop-hero > .profile-header-cover { border-radius: inherit !important; }

/* the verified badge: the icon as it is, with a light edge on dark covers */
.profile-page .profile-verified-badge {
    width: 24px !important;
    height: 24px !important;
    background: none !important;
    -webkit-mask: none !important;
    mask: none !important;
    filter: drop-shadow(0 0 1px rgba(255, 255, 255, .9)) drop-shadow(0 2px 6px rgba(15, 23, 42, .25)) !important;
}

/* the sidebar scrolled away: the posts move to the middle of the page */
@media (min-width: 1024px) {
    .profile-page .profile-content-layout > .flex-1 { transition: transform .4s cubic-bezier(.22, 1, .36, 1); }
    .profile-page .profile-content-layout.is-sidebar-away > .flex-1 { transform: translateX(calc((340px + 26px) / 2)); }
}
@media (min-width: 1024px) and (max-width: 1180px) {
    .profile-page .profile-content-layout.is-sidebar-away > .flex-1 { transform: translateX(calc((300px + 22px) / 2)); }
}
@media (prefers-reduced-motion: reduce) {
    .profile-page .profile-content-layout > .flex-1 { transition: none; }
}

/* phone hero, a visitor: «Сообщение» and «Подписаться» on one line, «Пожаловаться / Заблокировать» below
   (the row did not wrap and squeezed the buttons under each other) */
.profile-page .profile-app-actions { flex-wrap: wrap; }
