/* Специфика страницы просмотра конкурса. Общие стили — в public-base.css */

.public-contest {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 28px;
    padding: 24px;
    border: 1px solid #D2D2D2;
    border-radius: 6px;
    background: #FFF;
}

.public-contest__image {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 240px;
    height: 150px;
    border-radius: 6px;
    /* Заглушка без фото — тот же градиент, что в слайдере конкурсов на главной */
    background: linear-gradient(135deg, #2D3648 0%, #575C89 100%);
    color: #FFF;
    font-family: Inter, sans-serif;
    font-size: 48px;
    font-weight: 700;
    overflow: hidden;
}

.public-contest__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.public-contest__info {
    min-width: 0;
}

.public-contest__name {
    margin: 0;
    color: #101820;
    font-family: Inter, sans-serif;
    font-size: 24px;
    font-weight: 700;
}

.public-contest__dates {
    display: block;
    margin-top: 4px;
    color: #575C89;
    font-size: 14px;
}

.public-contest__description {
    margin: 12px 0 0;
    color: #101820;
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.public-contest__works-title {
    margin: 0 0 16px;
    color: #101820;
    font-family: Inter, sans-serif;
    font-size: 20px;
    font-weight: 700;
}

.public-contest__works {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.public-contest-work {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border: 1px solid #D2D2D2;
    border-radius: 6px;
    background: #FFF;
    transition: box-shadow .2s ease-in-out;
}

.public-contest-work:hover {
    box-shadow: 0 4px 16px rgba(16, 24, 32, .08);
}

/* Кликабельная карточка: ссылка-оверлей на всю площадь.
   Нельзя оборачивать карточку в <a>, т.к. внутри есть ссылка на профиль автора
   (вложенные <a> запрещены в HTML). */
.public-contest-work__link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.public-contest-work__info {
    min-width: 0;
}

.public-contest-work__title {
    margin: 0;
    color: #101820;
    font-family: Inter, sans-serif;
    font-size: 16px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.public-contest-work__description {
    margin: 4px 0 0;
    color: #101820;
    font-size: 14px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

/* Ссылка автора остаётся кликабельной поверх оверлея */
.public-contest-work__author {
    position: relative;
    z-index: 2;
    display: inline-block;
    margin-top: 4px;
    color: #575C89;
    font-size: 13px;
    text-decoration: none;
}

.public-contest-work__author:hover {
    color: #101820;
    text-decoration: underline;
}

/* Группа и направление обучения автора — под ФИО, как в карточке студента */
.public-contest-work__student-group,
.public-contest-work__student-specialization {
    display: block;
    margin-top: 2px;
    color: #575C89;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.public-contest-work__meta {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* У общего бейджа есть margin-bottom (для карточки работы) — здесь он сдвигал бы бейдж
   выше центра строки, поэтому обнуляем, чтобы бейдж был по центру вместе с лайком */
.public-contest-work__meta .public-work-card__badge {
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
}

/* Лайк остаётся кликабельным поверх оверлея */
.public-contest-work .public-like {
    position: relative;
    z-index: 2;
}

@media (max-width: 768px) {
    .public-contest {
        flex-direction: column;
    }

    .public-contest__image {
        width: 100%;
        height: 180px;
    }

    .public-contest-work {
        flex-direction: column;
        align-items: flex-start;
    }
}
