/* Yarn Explorer — Home page (Figma 3-column feed hub) */

main#main:has(.ye-home-page) {
    background: var(--primary-light);
}

.ye-home-page {
    background: var(--primary-light);
    padding: 28px 0 56px;
}

.ye-home-page #main {
    padding: 0 !important;
}

.ye-home-page__shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

.ye-home-page__layout {
    display: grid;
    grid-template-columns: 284px minmax(0, 1fr) 320px;
    gap: 16px;
    align-items: start;
}

/* ---- Shared home cards ---- */
.ye-home-profile-card,
.ye-home-nav-card,
.ye-home-guest-card,
.ye-home-install-app,
.ye-home-panel,
.ye-home-feed-card,
.ye-home-page__sidebar .ye-bookmarks-sidebar-card {
    background: var(--white-color);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

/* ---- Left profile card ---- */
.ye-home-page__left {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.ye-home-profile-card {
    padding: 18px 20px;
}

.ye-home-profile-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.ye-home-profile-card__identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ye-home-profile-card__avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.ye-home-profile-card__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.ye-home-profile-card__titlewrap {
    min-width: 0;
}

.ye-home-profile-card__name {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
    color: var(--gray-color);
}

.ye-home-profile-card__username {
    margin: 2px 0 0;
    font-size: 13px;
    line-height: 20px;
    color: #8a94a6;
}

.ye-home-profile-card__edit {
    position: absolute;
    right: -4px;
    bottom: -2px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 1;
}

.ye-home-profile-card__edit img {
    width: 24px;
    height: 24px;
    display: block;
}

.ye-home-profile-card__location {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 0;
    font-size: 13px;
    line-height: 20px;
    color: var(--lable-color);
}

.ye-home-profile-card__location img {
    flex-shrink: 0;
}

.ye-home-profile-card__location-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
}

.ye-home-profile-card__location-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.ye-home-profile-card__about {
    margin: 12px 0 0;
    font-size: 13px;
    line-height: 1.55;
    color: #4b5563;
}

.ye-home-profile-card__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e6eaf0;
}

.ye-home-profile-card__stat {
    text-align: center;
    text-decoration: none;
    color: inherit;
}

.ye-home-profile-card__stat strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
    line-height: 24px;
    color: var(--gray-color);
}

.ye-home-profile-card__stat span {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    line-height: 18px;
    color: #718096;
}

.ye-home-profile-card__stat--link span {
    color: var(--lable-color);
}

/* ---- Left nav ---- */
.ye-home-nav-card,
.ye-home-guest-card,
.ye-home-install-app {
    padding: 16px 18px;
}

.ye-home-guest-card__title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-color);
}

.ye-home-guest-card__text {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 22px;
    color: #6b7280;
}

.ye-home-guest-card__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 20px;
    border-radius: 999px;
    background: var(--primary-color);
    color: var(--white-color);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.ye-home-nav-card__nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ye-home-nav-card__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--gray-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
}

.ye-home-nav-card__link:hover {
    background: rgba(8, 27, 51, 0.04);
    color: var(--primary-color);
}

.ye-home-nav-card__link.is-active {
    background: rgba(0, 86, 167, 0.1);
    color: var(--lable-color);
    font-weight: 600;
}

.ye-home-nav-card__icon {
    display: inline-flex;
    flex-shrink: 0;
    color: currentColor;
}

/* ---- Install app ---- */
.ye-home-install-app__title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-color);
}

.ye-home-install-app__subtitle {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 20px;
    color: #6b7280;
}

.ye-home-install-app__badges {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.ye-home-install-app__badges a {
    display: block;
    line-height: 0;
}

.ye-home-install-app__badges img {
    display: block;
    width: 115px;
    height: 34px;
    max-width: 100%;
    object-fit: contain;
}

/* ---- Center column ---- */
.ye-home-page__main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.ye-home-panel {
    padding: 16px 18px;
}

.ye-home-composer__row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ye-home-composer__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ye-home-composer__trigger {
    flex: 1;
    min-width: 0;
    height: 44px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0 18px;
    background: var(--white-color);
    color: #8a94a6;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.ye-home-composer__trigger:hover {
    border-color: #9ca3af;
}

.ye-home-composer__create-btn {
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
}

.ye-home-composer__create-btn img {
    width: 48px;
    height: 48px;
    display: block;
}

.ye-home-filters__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ye-home-filters__chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 18px;
    border-radius: 999px;
    background: #eef2f7;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.ye-home-filters__chip.is-active,
.ye-home-filters__chip:hover {
    background: var(--primary-color);
    color: var(--white-color);
}

/* ---- Feed cards (Figma: stacked posts, no gap between items) ---- */
.ye-home-page__main .ye-home-feed-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--white-color);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.ye-home-page__main .ye-home-feed-card {
    padding: 18px 20px 14px;
    overflow: hidden;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.ye-home-page__main .ye-home-feed-card + .ye-home-feed-card {
    border-top: 1px solid var(--border-color);
}

.ye-home-page__main .ye-home-feed-empty {
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.ye-home-feed-card__head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.ye-home-feed-card__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.ye-home-feed-card__head-main {
    min-width: 0;
    flex: 1;
}

.ye-home-feed-card__name {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 22px;
    color: var(--gray-color);
}

.ye-home-feed-card__name a {
    color: inherit;
    text-decoration: none;
}

.ye-home-feed-card__meta {
    margin: 4px 0 0;
    font-size: 12px;
    line-height: 18px;
    color: #8a94a6;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.ye-home-feed-card__badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(0, 86, 167, 0.1);
    color: var(--lable-color);
    font-size: 11px;
    font-weight: 600;
}

.ye-home-feed-card__location {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0 0;
    font-size: 13px;
    line-height: 20px;
    color: var(--lable-color);
}

.ye-home-feed-card__location img {
    flex-shrink: 0;
}

.ye-home-feed-card__location-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
}

.ye-home-feed-card__location-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.ye-home-feed-card__text {
    margin: 12px 0 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-color);
    word-break: break-word;
}

.ye-home-feed-card__hashtags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.ye-home-feed-card__hashtags span {
    font-size: 13px;
    font-weight: 500;
    color: var(--lable-color);
}

.ye-home-feed-card__gallery {
    margin-top: 14px;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

.ye-home-feed-card__grid {
    display: grid;
    gap: 2px;
    width: 100%;
    overflow: hidden;
    background: #eef2f7;
}

.ye-home-feed-card__grid--1 {
    grid-template-columns: 1fr;
}

.ye-home-feed-card__grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ye-home-feed-card__grid--3,
.ye-home-feed-card__grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* 3 images: large left tile + two stacked on the right (no empty cell) */
.ye-home-feed-card__grid--3 .ye-home-feed-card__image:first-child {
    grid-row: span 2;
    height: auto;
}

.ye-home-feed-card__image {
    position: relative;
    overflow: hidden;
    background: #eef2f7;
    min-height: 0;
}

.ye-home-feed-card__grid--1 .ye-home-feed-card__image,
.ye-home-feed-card__image--wide {
    height: 305px;
}

.ye-home-feed-card__grid--2 .ye-home-feed-card__image {
    height: 220px;
}

.ye-home-feed-card__grid--3 .ye-home-feed-card__image,
.ye-home-feed-card__grid--4 .ye-home-feed-card__image {
    height: 152px;
}

.ye-home-feed-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ye-home-feed-card__more {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 27, 51, 0.45);
    color: var(--white-color);
    font-size: 24px;
    font-weight: 700;
}

.ye-home-feed-card__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.ye-home-feed-card__action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.ye-home-feed-card__action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-color);
}

.ye-home-feed-card__action--btn {
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.ye-home-feed-card__action--btn.is-inspired {
    color: var(--gray-color);
}

.ye-home-feed-card__action--btn.is-loading {
    opacity: 0.6;
    cursor: wait;
}

.ye-home-feed-card__action img {
    width: 18px;
    height: 18px;
    display: block;
}

.ye-home-feed-empty {
    background: var(--white-color);
    border: 1px dashed var(--border-color);
    border-radius: 18px;
    padding: 48px 20px;
    text-align: center;
}

.ye-home-feed-empty p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.ye-home-pagination {
    display: flex;
    justify-content: center;
}

.ye-home-page__main .ye-home-feed-scroll {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 56px;
    padding: 12px 0 16px;
    border-top: 1px solid var(--border-color);
    background: var(--white-color);
}

.ye-home-feed-scroll__sentinel {
    width: 100%;
    height: 1px;
    pointer-events: none;
    flex: 0 0 auto;
    align-self: stretch;
}

.ye-home-feed-scroll__loader {
    width: 28px;
    height: 28px;
    margin: 0 auto;
    flex: 0 0 auto;
    border: 2px solid #e5e7eb;
    border-top-color: #1e3a5f;
    border-radius: 50%;
    animation: ye-home-feed-spin 0.8s linear infinite;
}

@keyframes ye-home-feed-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---- Right sidebar ---- */
.ye-home-page__sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.ye-home-page__sidebar .ye-bookmarks-sidebar-card {
    margin: 0;
    padding: 18px 20px;
}

.ye-home-page__sidebar .ye-bookmarks-sidebar-card + .ye-bookmarks-sidebar-card {
    margin-top: 0;
}

.ye-home-page__sidebar .ye-bookmarks-explorers__item {
    align-items: center;
}

.ye-home-page__sidebar .ye-bookmarks-explorers__name {
    font-size: 14px;
}

.ye-home-page__sidebar .ye-bookmarks-explorers__follow-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    min-height: 30px;
    padding: 0 12px;
    border: none;
    border-radius: 999px;
    background: var(--primary-color);
    color: var(--white-color);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.ye-home-page__sidebar .ye-bookmarks-explorers__follow-btn:hover {
    background: #0a3470;
    color: var(--white-color);
}

.ye-home-page__sidebar .ye-bookmarks-explorers__follow-btn.is-following,
.ye-home-page__sidebar .ye-bookmarks-explorers__follow-btn.is-requested {
    background: #e8edf3;
    color: #0d2540;
    border: 1px solid #cbd5e1;
}

.ye-home-page__sidebar .ye-bookmarks-explorers__follow-btn.is-requested {
    background: #f3f4f6;
    color: #64748b;
    cursor: default;
}

.ye-home-page__sidebar .ye-bookmarks-explorers__follow-btn.is-following:hover,
.ye-home-page__sidebar .ye-bookmarks-explorers__follow-btn.is-requested:hover {
    background: #e8edf3;
    color: #0d2540;
}

.ye-home-page__sidebar .ye-bookmarks-inspired__thumb {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
}

.ye-home-page__sidebar .ye-bookmarks-inspired__title {
    font-size: 14px;
    font-weight: 600;
}

.ye-home-page__sidebar .ye-bookmarks-inspired__excerpt {
    font-size: 12px;
    color: #6b7280;
}

.ye-home-page__sidebar .ye-bookmarks-events__item {
    border-radius: 12px;
    padding: 14px 16px;
}

@media (max-width: 1100px) {
    .ye-home-page__layout {
        grid-template-columns: 260px minmax(0, 1fr);
    }

    .ye-home-page__sidebar {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (max-width: 900px) {
    .ye-home-page__layout {
        grid-template-columns: 1fr;
    }

    .ye-home-page__sidebar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .ye-home-page {
        padding: 16px 0 40px;
    }

    .ye-home-page__shell {
        padding: 0 12px;
    }
}
