/* Кабинет автора: профиль-hero, статистика, панель прав, список работ. */

section {
    padding: 80px 0;
}

.section-head {
    margin-bottom: 36px;
}

.section-head h2 {
    font-size: clamp(26px, 3.2vw, 34px);
    line-height: 1.15;
    margin-bottom: 14px;
}

.section-head p {
    font-size: 16px;
}

/* ---------- Профиль ---------- */
.profile-hero {
    position: relative;
    background: var(--brand-gradient), var(--brand-dark);
    color: var(--text-on-brand);
    overflow: hidden;
    padding: 56px 0 80px;
}

.profile-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 56px;
    align-items: center;
}

/* Аватар — инициалы на цветном круге, файлов не грузим (бриф, ответ №9).
   Цвет приходит инлайном из User.avatar_color и детерминирован по id. */
.avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    /* Цвет приходит инлайном из User.avatar_color; фон здесь — запасной,
       на случай если аватар отрисуется до появления пользователя. */
    background: rgba(255, 255, 255, 0.14);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--serif);
    font-weight: 700;
    font-size: 26px;
    margin-bottom: 22px;
}

.profile-name {
    font-family: var(--serif);
    font-weight: 700;
    font-size: clamp(28px, 3.6vw, 40px);
    line-height: 1.08;
    margin-bottom: 12px;
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    font-size: 14px;
    color: var(--text-muted-on-brand);
    margin-bottom: 20px;
}

.profile-meta span {
    display: flex;
    align-items: center;
    gap: 7px;
}

.profile-meta svg {
    width: 15px;
    height: 15px;
}

.profile-bio {
    font-size: 16.5px;
    color: var(--text-muted-on-brand);
    max-width: 460px;
    /* Био — свободный текст автора: абзацы в нём значимы, как и в стихах. */
    white-space: pre-wrap;
}

/* Подсказка вместо пустого био — видно, что это приглашение, а не текст. */
.profile-bio-empty {
    font-style: italic;
    opacity: 0.8;
}

.profile-link {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.profile-link:hover {
    color: var(--brand);
}

.profile-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 26px;
}

/* Кнопка «Выйти» — submit внутри формы (выход только POST-ом), поэтому
   рядом с обычной ссылкой-кнопкой оказывается лишний блочный контейнер. */
.profile-actions form {
    display: contents;
}

/* Публичная страница автора: правой колонки-«рукописи» на ней нет. */
.profile-grid-single {
    grid-template-columns: 1fr;
}

/* Карточка-«рукопись» в кабинете — компактнее, чем на лендинге. */
.profile-hero .manuscript {
    padding: 28px 30px 24px;
    transform: rotate(1.5deg);
}

.profile-hero .manuscript-tag {
    letter-spacing: 0.08em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.profile-hero .manuscript-text {
    font-size: 19px;
    margin: 14px 0;
}

.manuscript-status {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: rgba(var(--rule-rgb), 0.07);
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

/* ---------- Статистика ---------- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card {
    background: var(--surface-raised);
    border-radius: var(--radius);
    padding: 24px 22px;
}

.stat-card b {
    font-family: var(--serif);
    font-size: 32px;
    display: block;
    margin-bottom: 6px;
}

.stat-card span {
    font-size: 13.5px;
    color: var(--text-muted);
}

/* ---------- Права и согласие ---------- */
.section-tight {
    padding-top: 0;
}

.rights-panel {
    background: var(--brand-dark);
    color: var(--text-on-brand);
    border-radius: 24px;
    padding: 48px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
    align-items: center;
}

.rights-panel .eyebrow {
    color: var(--brand);
    margin-bottom: 12px;
    display: block;
}

.rights-panel h2 {
    font-family: var(--serif);
    font-size: clamp(22px, 2.8vw, 28px);
    line-height: 1.22;
    margin-bottom: 14px;
}

.rights-panel p {
    color: var(--text-muted-on-brand);
    font-size: 15px;
}

.consent-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    padding: 22px 24px;
}

.consent-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
}

.consent-row:last-of-type {
    border-bottom: none;
}

.consent-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--brand);
    color: var(--brand-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
}

.consent-actions {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.consent-actions a {
    font-size: 13px;
    text-decoration: underline;
    color: var(--text-muted-on-brand);
    text-underline-offset: 3px;
}

.consent-actions a:hover {
    color: var(--text-on-brand);
}

/* ---------- Список произведений ---------- */
.works-list {
    margin-top: 20px;
}

.work-row {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
    border-top: 1px solid rgba(var(--rule-rgb), 0.1);
}

.work-icon {
    width: 22px;
    height: 22px;
    color: var(--accent);
    flex-shrink: 0;
}

.work-main h3 {
    font-family: var(--serif);
    font-size: 17.5px;
    margin-bottom: 4px;
}

.work-main .work-meta {
    font-size: 12.5px;
    color: var(--text-muted);
    font-family: var(--mono);
}

.status-badge {
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 999px;
    white-space: nowrap;
}

.status-published {
    background: var(--brand-dark);
    color: var(--text-on-brand);
}

.status-review {
    background: transparent;
    border: 1.3px solid rgba(var(--rule-rgb), 0.3);
    color: var(--text-muted);
}

.status-draft {
    background: transparent;
    border: 1.3px dashed rgba(var(--rule-rgb), 0.28);
    color: rgba(61, 74, 73, 0.65);
}

/* Отклонено модератором — статус появляется на этапе 2.5. */
.status-rejected {
    background: transparent;
    border: 1.3px solid var(--accent);
    color: var(--accent);
}

.work-views {
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--text-muted);
    white-space: nowrap;
    text-align: right;
}

/* ---------- Пусто ----------
   Список работ пуст до этапа 2. Пунктирная рамка вместо карточки: так видно,
   что это место под будущий контент, а не сломанный блок. */
.empty-state {
    text-align: center;
    padding: 52px 24px;
    border: 1.5px dashed rgba(var(--rule-rgb), 0.2);
    border-radius: var(--radius);
}

.empty-state h3 {
    font-family: var(--serif);
    font-size: 21px;
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 15px;
    max-width: 460px;
    margin: 0 auto 20px;
}

@media (max-width:920px) {
    .profile-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .stats-row {
        grid-template-columns: 1fr 1fr;
    }

    .rights-panel {
        grid-template-columns: 1fr;
        padding: 36px 28px;
    }

    .work-row {
        grid-template-columns: auto 1fr auto;
    }

    .work-views {
        display: none;
    }
}

@media (max-width:560px) {
    section {
        padding: 56px 0;
    }

    .work-row {
        grid-template-columns: auto 1fr;
        row-gap: 10px;
    }

    .status-badge {
        grid-column: 2;
        justify-self: start;
    }
}
