/* YouTube Thumbnail Downloader */
.yt-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.yt-form input[type="text"] {
    flex: 1 1 320px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font: inherit;
}

.yt-form input[type="text"]:focus {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

.yt-form .tool-toolbar {
    margin: 0;
}

.yt-result {
    margin-top: 20px;
}

.yt-video__title {
    margin: 6px 0 2px;
    font-weight: 700;
    font-size: 1.05rem;
}

.yt-video__channel {
    margin: 0 0 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

.yt-card {
    margin: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}

/* Every preview sits in the same 16:9 frame; 4:3 sizes lose only their
   black bars in the preview, never in the downloaded file. */
.yt-card__frame {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}

.yt-card__frame img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.yt-card--vertical .yt-card__frame img {
    object-fit: contain;
}

.yt-card__caption {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px 0;
    font-size: 0.9rem;
}

.yt-card__caption span {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.yt-card__actions {
    display: flex;
    gap: 8px;
    padding: 12px 14px 14px;
    margin-top: auto;
}

.yt-card__actions button {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid var(--primary);
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}

.yt-card__actions button:hover {
    background: var(--primary-hover);
}

.yt-card__actions button.secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.yt-card__actions button.secondary:hover {
    border-color: var(--primary);
}

.yt-card__actions button:disabled {
    opacity: 0.6;
    cursor: default;
}
