.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.project-grid--home {
    padding: 0 1rem 1rem;
}

.project-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.project-card__media {
    display: block;
    aspect-ratio: 4 / 3;
    background: #f3f4f6;
}

.project-card__media img,
.project-card__placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.project-card__body {
    padding: 1rem;
}

.project-card__category {
    font-size: 0.85rem;
    color: var(--text-muted, #6b7280);
    margin-bottom: 0.35rem;
}

.project-card__title {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.project-card__title a {
    color: inherit;
    text-decoration: none;
}

.project-card__meta {
    font-size: 0.85rem;
    color: var(--text-muted, #6b7280);
}

.project-filters {
    margin-bottom: 1.5rem;
    display: grid;
    gap: 1rem;
}

.project-filters__block {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 0.75rem;
}

.project-filters__label {
    flex: 0 0 auto;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted, #6b7280);
    white-space: nowrap;
}

.project-filters__pills {
    flex: 1 1 auto;
    margin-bottom: 0;
    min-width: 0;
}

.project-filters__pills--sort {
    align-items: center;
}

.project-filters__rankings {
    margin-left: auto;
}

.project-detail__category {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary, #6366f1) 10%, transparent);
    color: var(--text-muted, #6b7280);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
}

.project-detail__category:hover {
    color: var(--primary, #6366f1);
}

.project-detail__meta {
    margin: 0;
    color: var(--text-muted, #6b7280);
    font-size: 0.92rem;
    line-height: 1.5;
}

.project-detail__meta a {
    color: inherit;
    font-weight: 600;
}

.project-detail__layout {
    align-items: start;
}

.project-detail__section-title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 700;
}

.project-detail__description-body {
    color: var(--text, #1f2937);
    line-height: 1.65;
    font-size: 0.95rem;
}

.project-detail__author-card .forum-sidebar__title,
.project-detail__stats-card .forum-sidebar__title,
.project-detail__share-card .forum-sidebar__title {
    margin-bottom: 0.85rem;
}

.project-detail__author {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.85rem;
    color: inherit;
    text-decoration: none;
}

.project-detail__author img {
    border-radius: 50%;
    border: 1px solid var(--border-color, #e5e7eb);
}

.project-detail__author-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.project-detail__author-body strong {
    font-size: 0.95rem;
}

.project-detail__author-body em {
    font-style: normal;
    font-size: 0.82rem;
    color: var(--text-muted, #6b7280);
}

.project-detail__sidebar-like {
    margin-bottom: 0.85rem;
}

.project-detail__contact {
    width: 100%;
}

.project-detail__stats {
    display: grid;
    gap: 0.65rem;
    margin: 0;
}

.project-detail__stats div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 0.55rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.project-detail__stats div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.project-detail__stats dt {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted, #6b7280);
}

.project-detail__stats dd {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
}

.project-detail__share-card .project-share {
    gap: 0.4rem;
}

.project-detail__gallery-card {
    margin-bottom: 1rem;
    overflow: hidden;
}

.project-detail__description {
    margin-bottom: 1rem;
}

.project-detail__like {
    margin-top: 0.75rem;
}

.project-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 999px;
    background: var(--card-bg, #fff);
    color: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.4rem 0.85rem;
    cursor: pointer;
    text-decoration: none;
}

.project-like-btn:hover {
    border-color: #ec4899;
    color: #ec4899;
}

.project-like-btn.is-active,
.project-like-btn.is-active:hover {
    background: #fdf2f8;
    border-color: #ec4899;
    color: #db2777;
}

.project-like-btn--compact {
    font-size: 0.78rem;
    padding: 0.28rem 0.6rem;
}

.project-like-btn--guest {
    cursor: default;
    opacity: 0.85;
}

.project-gallery__actions {
    padding: 0.65rem 0.75rem 0.75rem;
    display: grid;
    gap: 0.55rem;
}

.project-gallery__like {
    display: flex;
}

.project-rank-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.project-rank-grid--home {
    padding: 0 1rem 1rem;
}

.project-rank-card {
    position: relative;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0.85rem;
    padding: 0.85rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 14px;
    background: var(--card-bg, #fff);
}

.project-rank-card--top {
    border-color: #c7d2fe;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.08);
}

.project-rank-card__rank {
    position: absolute;
    top: 0.65rem;
    left: 0.65rem;
    z-index: 1;
    min-width: 2rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.82);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
}

.project-rank-card--top .project-rank-card__rank {
    background: #6366f1;
}

.project-rank-card__media {
    display: block;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: #f3f4f6;
}

.project-rank-card__media img,
.project-rank-card__media .project-card__placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-rank-card__body {
    min-width: 0;
}

.project-rank-card__category {
    font-size: 0.78rem;
    color: var(--text-muted, #6b7280);
    margin-bottom: 0.25rem;
}

.project-rank-card__title {
    margin: 0 0 0.45rem;
    font-size: 0.95rem;
}

.project-rank-card__title a {
    color: inherit;
    text-decoration: none;
}

.project-rank-card__author {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.45rem;
    font-size: 0.82rem;
}

.project-rank-card__author img {
    border-radius: 50%;
}

.project-rank-card__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    font-size: 0.78rem;
    color: var(--text-muted, #6b7280);
}

.projects-top-page__head {
    align-items: flex-start;
}

.projects-top-page__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.projects-top-page__hero {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.projects-top-page__hero-copy h2 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.projects-top-page__hero-copy p {
    margin: 0;
    color: var(--text-muted, #6b7280);
}

.projects-top-page__rules {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--text-muted, #6b7280);
    font-size: 0.92rem;
}

.projects-top-page__latest {
    margin-top: 2rem;
}

.projects-top-page__section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.projects-top-page__section-head h2 {
    margin: 0;
}

.projects-filters__rankings,
.project-filters__rankings {
    margin-left: auto;
}

.project-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 0.75rem;
}

.project-gallery--single {
    grid-template-columns: 1fr;
}

.project-gallery__item {
    margin: 0;
    min-width: 0;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    overflow: hidden;
    background: var(--card-bg, #fff);
    display: flex;
    flex-direction: column;
}

.project-gallery__item--featured {
    grid-column: span 2;
}

.project-gallery__link {
    display: block;
    background: #f3f4f6;
}

.project-gallery__link img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.project-gallery__item--featured .project-gallery__link img {
    aspect-ratio: 16 / 10;
}

.project-gallery__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.65rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
    background: var(--card-bg, #fff);
}

.project-gallery__share-details {
    min-width: 0;
}

.project-gallery__share-toggle {
    list-style: none;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted, #6b7280);
    white-space: nowrap;
}

.project-gallery__share-toggle::-webkit-details-marker {
    display: none;
}

.project-gallery__share-details[open] .project-gallery__share-toggle {
    color: var(--primary, #6366f1);
}

.project-gallery__share-details .project-share {
    margin-top: 0.55rem;
}

.project-gallery__actions {
    padding: 0.65rem 0.75rem 0.75rem;
    display: grid;
    gap: 0.55rem;
}

.project-gallery__like {
    display: flex;
    flex-shrink: 0;
}

.project-gallery__share {
    padding: 0.65rem 0.75rem 0.75rem;
}

.project-gallery__share-label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted, #6b7280);
    margin-bottom: 0.45rem;
}

.project-detail__share {
    margin-bottom: 1.25rem;
}

.project-detail__share-title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
}

.project-share {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.project-share--compact .project-share__btn {
    font-size: 0.72rem;
    padding: 0.28rem 0.55rem;
}

.project-share__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 999px;
    background: var(--card-bg, #fff);
    color: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.35rem 0.75rem;
    text-decoration: none;
    cursor: pointer;
}

.project-share__btn:hover {
    border-color: #6366f1;
    color: #6366f1;
}

.project-share__btn.is-copied {
    border-color: #10b981;
    color: #10b981;
}

.project-share__btn--facebook { color: #1877f2; }
.project-share__btn--whatsapp { color: #25d366; }
.project-share__btn--telegram { color: #0088cc; }
.project-share__btn--viber { color: #7360f2; }
.project-share__btn--x { color: #111827; }
.project-share__btn--pinterest { color: #e60023; }

.project-gallery-edit {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.project-gallery-edit__item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
}

.project-gallery-edit__actions {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.project-detail__description {
    margin-bottom: 1.5rem;
}

.project-detail__footer {
    margin-bottom: 2rem;
}

.project-grid-actions {
    display: none;
}

@media (max-width: 900px) {
    .project-gallery {
        grid-template-columns: 1fr;
    }

    .project-gallery__item--featured {
        grid-column: span 1;
    }
}

@media (max-width: 640px) {
    .project-grid {
        grid-template-columns: 1fr 1fr;
    }

    .project-rank-card {
        grid-template-columns: 96px 1fr;
    }

    .projects-top-page__hero {
        grid-template-columns: 1fr;
    }
}
