/*
 * Центр тумбнейлов и разбор картинки.
 * Слева загруженный кадр и предпросмотры, справа результат: балл, полосы
 * измерений и проверки (2.txt §97–§101). Цвет полос — только смысловой:
 * зелёный, оранжевый, красный, как в §100.
 */

.thumb {
    padding: 4px 0 var(--section-gap);
}

/* Шапка раздела */

.thumb__head {
    max-width: 74ch;
    margin-bottom: 28px;
}

.thumb__badge {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 12px;
    border-radius: var(--radius-pill);
    background: rgba(104, 80, 245, .12);
    color: var(--purple);
    font-size: var(--fs-xs);
    font-weight: 700;
}

.thumb__head h1 {
    margin-top: 14px;
    font-size: var(--fs-h1);
    font-weight: 800;
    line-height: var(--lh-tight);
    letter-spacing: -.02em;
}

.thumb__lead {
    margin-top: 14px;
    color: var(--text-secondary);
    font-size: var(--fs-body);
}

.thumb__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

/* Правила: восемь одинаковых карточек */

.thumb__rules {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--gap-sm);
    list-style: none;
}

.thumb__rule {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.thumb__rule-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--bg-soft);
    color: var(--brand-600);
}

.thumb__rule-title {
    font-size: var(--fs-h3);
    font-weight: 800;
    line-height: var(--lh-tight);
}

.thumb__rule-text {
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    line-height: var(--lh-body);
}

.thumb__rule-note {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: var(--fs-xs);
    line-height: var(--lh-body);
}

/* Честные оговорки и методика: один и тот же текстовый блок */

.thumb__honest-card p {
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    line-height: var(--lh-body);
    max-width: 92ch;
}

.thumb__honest-card p + p {
    margin-top: 12px;
}

.thumb__honest-card strong {
    color: var(--text-primary);
    font-weight: 700;
}

/* Переход к инструменту */

.thumb__cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--gap-sm);
}

.thumb__cta-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.thumb__cta-title {
    font-size: var(--fs-h3);
    font-weight: 800;
}

.thumb__cta-note {
    max-width: 68ch;
    color: var(--text-secondary);
    font-size: var(--fs-sm);
}

.thumb__cta-icon {
    flex: 0 0 auto;
    color: var(--primary);
}

/* Форма загрузки */

.thumb__form {
    display: flex;
    align-items: flex-end;
    gap: var(--gap-sm);
    flex-wrap: wrap;
}

/* Поле выбора файла не растягиваем на всю карточку: пустая рамка шириной
   в экран выглядит как незагрузившийся блок. */
.thumb__field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 0 1 460px;
}

.thumb__field-title {
    font-size: var(--fs-sm);
    font-weight: 700;
}

.thumb__field-note {
    color: var(--text-muted);
    font-size: var(--fs-xs);
}

.thumb__file {
    width: 100%;
    padding: 10px 12px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-page);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: var(--fs-sm);
}

.thumb__file::file-selector-button {
    margin-right: 12px;
    height: 32px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: inherit;
    font-size: var(--fs-xs);
    font-weight: 700;
    cursor: pointer;
}

.thumb__file::file-selector-button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.thumb__error {
    margin-top: var(--gap-sm);
}

/* Результат: слева картинка, справа разбор */

.thumb__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: var(--gap);
    margin-top: var(--gap);
    align-items: start;
}

.thumb__left,
.thumb__right {
    display: flex;
    flex-direction: column;
    gap: var(--gap-sm);
    min-width: 0;
}

.thumb__block-title {
    font-size: var(--fs-h3);
    font-weight: 800;
}

.thumb__block-note {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: var(--fs-sm);
}

/* Кадр и предпросмотры */

/* Сам кадр приходит фоном: правило с data-URI собирает контроллер, здесь —
   только рамка и кадрирование, как у карточки острова. */
.thumb__shot {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius-md);
    background-color: var(--bg-soft);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.thumb__shot--full {
    border-radius: var(--radius-card);
}

.thumb__shot-cap {
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: var(--fs-sm);
}

/* Центр тяжести деталей: точка на кадре, а не поверх текста */
.thumb__focus {
    position: absolute;
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border: 2px solid #FFFFFF;
    border-radius: var(--radius-pill);
    box-shadow: 0 0 0 2px rgba(59, 101, 248, .9), 0 4px 12px rgba(16, 24, 40, .35);
}

.thumb__shots {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--gap-sm);
    margin-top: var(--gap-sm);
}

.thumb__shot-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.thumb__shot--lg { width: 320px; }
.thumb__shot--md { width: 168px; }
.thumb__shot--sm { width: 120px; }

.thumb__shot-item figcaption {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.thumb__shot-title {
    font-size: var(--fs-xs);
    font-weight: 700;
}

.thumb__shot-note {
    color: var(--text-muted);
    font-size: var(--fs-xs);
}

/* Карточка файла */

.thumb__facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.thumb__facts dt {
    color: var(--text-muted);
    font-size: var(--fs-xs);
    font-weight: 600;
}

.thumb__facts dd {
    margin-top: 2px;
    font-size: var(--fs-sm);
    font-weight: 700;
    overflow-wrap: anywhere;
}

/* Общий балл */

.thumb__score {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.thumb__score-title {
    color: var(--text-muted);
    font-size: var(--fs-xs);
    font-weight: 600;
}

.thumb__score-value {
    font-size: 52px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.02em;
}

.thumb__score-max {
    color: var(--text-muted);
    font-size: 22px;
    font-weight: 700;
}

.thumb__score-level {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 12px;
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: 700;
}

.thumb__score-note {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    line-height: var(--lh-body);
}

.thumb__score--good .thumb__score-value { color: var(--success); }
.thumb__score--good .thumb__score-level { background: rgba(47, 177, 112, .12); color: var(--success); }
.thumb__score--medium .thumb__score-value { color: var(--warning); }
.thumb__score--medium .thumb__score-level { background: rgba(247, 170, 70, .16); color: #B8720E; }
.thumb__score--poor .thumb__score-value { color: var(--danger); }
.thumb__score--poor .thumb__score-level { background: rgba(249, 97, 96, .12); color: var(--danger); }

/* Полосы измерений */

.thumb__bars {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 16px;
    list-style: none;
}

.thumb__bar-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.thumb__bar-title {
    font-size: var(--fs-sm);
    font-weight: 700;
}

.thumb__bar-score {
    font-size: var(--fs-body);
    font-weight: 800;
}

.thumb__bar-track {
    position: relative;
    height: 8px;
    margin-top: 8px;
    border-radius: var(--radius-pill);
    background: var(--bg-soft);
    overflow: hidden;
}

.thumb__bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: var(--radius-pill);
    background: var(--text-muted);
}

.thumb__bar-text {
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    line-height: var(--lh-body);
}

.thumb__bar-raw {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: var(--fs-xs);
}

.thumb__bar--good .thumb__bar-fill { background: var(--success); }
.thumb__bar--good .thumb__bar-score { color: var(--success); }
.thumb__bar--medium .thumb__bar-fill { background: var(--warning); }
.thumb__bar--medium .thumb__bar-score { color: #B8720E; }
.thumb__bar--poor .thumb__bar-fill { background: var(--danger); }
.thumb__bar--poor .thumb__bar-score { color: var(--danger); }

/* Проверки */

.thumb__check-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
    list-style: none;
}

.thumb__check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.thumb__check-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: var(--radius-pill);
    background: var(--bg-soft);
    color: var(--text-muted);
}

.thumb__check--good .thumb__check-icon { background: rgba(47, 177, 112, .12); color: var(--success); }
.thumb__check--medium .thumb__check-icon { background: rgba(247, 170, 70, .16); color: #B8720E; }
.thumb__check--poor .thumb__check-icon { background: rgba(249, 97, 96, .12); color: var(--danger); }

.thumb__check-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.thumb__check-title {
    font-size: var(--fs-sm);
    font-weight: 700;
}

.thumb__check-text {
    color: var(--text-secondary);
    font-size: var(--fs-xs);
    line-height: var(--lh-body);
}

.thumb__method {
    margin-top: var(--section-gap);
}

@media (max-width: 1024px) {
    .thumb__grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .thumb__form {
        align-items: stretch;
    }

    .thumb__form .btn {
        width: 100%;
    }

    .thumb__shot--lg {
        width: 100%;
    }

    .thumb__score-value {
        font-size: 44px;
    }
}
