/* Vintage effect generator (/vintage-effect-generator): the photo in its look on the stage, and the styles as buttons with a
   small picture of the photo in that style. Panels, sections, sliders and buttons come from the app kit (css/app-kit,
   docs/app-kit.md). Loaded only on this app's page (StylePaths). */

/* The stage shows the theme's checkerboard (--component-checkerboard in root.css), like the photo apps: around the
   picture and behind a cut-out subject on a transparent background. */
.vintage-landing-app.ak-app > .filter-landing-stage.ak-stage {
    position: relative;
    background: var(--component-checkerboard);
}

/* The picture: the script sets the photo's shape (--vintage-aspect). A photo can be dropped on the stage. */
.vintage-landing-app .vintage-canvas {
    display: block;
    width: 100%;
    max-width: min(820px, calc(70vh * var(--vintage-aspect, 1)));
    aspect-ratio: var(--vintage-aspect, 1);
}

/* While the subject is cut out (Remove background): a note over the picture. */
.vintage-landing-app .vintage-busy {
    position: absolute;
    inset-inline: 0;
    bottom: var(--ak-space-3, 0.75rem);
    width: max-content;
    max-width: calc(100% - 2rem);
    margin: 0 auto;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: var(--ak-panel);
    color: var(--ak-text);
    box-shadow: 0 2px 10px rgb(0 0 0 / 0.18);
    font-size: var(--ak-fs-sm, 0.85rem);
}

.vintage-landing-app .vintage-busy[hidden] {
    display: none;
}

/* The styles: a grid of buttons, each with the photo in that style and its name under it. */
.vintage-landing-app .vintage-styles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(5.2rem, 1fr));
    gap: var(--ak-space-1, 0.25rem);
}

.vintage-landing-app .vintage-style {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    min-width: 0;
    padding: 0.3rem 0.25rem 0.3rem;
    border: 1px solid var(--ak-border);
    border-radius: var(--ak-radius-sm, 6px);
    background: var(--ak-field);
    color: var(--ak-text);
    font: inherit;
    font-size: var(--ak-fs-xs, 0.75rem);
    line-height: 1.15;
    cursor: pointer;
}

.vintage-landing-app .vintage-style:hover {
    background: var(--ak-hover);
}

.vintage-landing-app .vintage-style[aria-checked="true"] {
    border-color: var(--ak-accent);
    box-shadow: 0 0 0 1px var(--ak-accent);
    color: var(--ak-accent);
}

.vintage-landing-app .vintage-style:focus-visible {
    outline: 2px solid var(--ak-accent);
    outline-offset: 1px;
}

/* The small picture keeps the photo's shape inside a fixed box, on a neutral solid tone (the kit's grid colour, light or
   dark with the theme) around it and where it is transparent. */
.vintage-landing-app .vintage-style-thumb {
    display: block;
    width: 100%;
    height: 3.2rem;
    object-fit: contain;
    border-radius: 4px;
    background: var(--ak-grid, #e2e8f0);
}

.vintage-landing-app .vintage-style-name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
