/*
 * Submit a Resource (page with [storm_resource_submission_form]). Loaded only
 * where a "storm-submit-" class appears (front end and block editor).
 *
 * Texts, colours of text, backgrounds, padding and gaps are block settings.
 * This file only draws what core blocks have no setting for: the label badge
 * and the numbered steps with arrows (one accent colour per step).
 * Low-specificity selectors (:where) so a setting on the block wins. The form
 * itself: storm-ui.css. Made for the light grey page (Blocksy page setting).
 */

/* Label above the title as a badge with a green dot (shape only; no block
   setting covers it). :root raises it above Blocksy's layout width rule,
   which loads after this file. */

:root .storm-submit-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.5em;

    width: fit-content;
}

:where(.storm-submit-eyebrow) {
    padding: 0.3em 0.85em;

    border-radius: 999px;

    background: var(--theme-palette-color-8);
    letter-spacing: 0.06em;
}

.storm-submit-eyebrow::before {
    content: "";
    flex: 0 0 auto;
    width: 0.55em;
    height: 0.55em;
    border-radius: 50%;
    background: var(--theme-palette-color-3);
}

/* 02 · How it works: one compact strip of three steps, each a numbered
   circle with title and one line (navy → teal → green: submit, review,
   publish) */

/* The same faint edge as the form sections below (a border set on the block
   wins). */
:where(.storm-submit-steps) {
    border: 1px solid var(--storm-ui-border-faint);
}

.storm-submit-steps {
    counter-reset: storm-submit-step;
}

.storm-submit-step {
    --storm-step-colour: var(--theme-palette-color-1);
    --storm-step-text: var(--theme-palette-color-1);

    counter-increment: storm-submit-step;

    display: grid;
    grid-template-columns: auto 1fr;
    align-content: start;
    column-gap: 0.75rem;
}

.storm-submit-step:nth-child(2) {
    --storm-step-colour: var(--storm-accent-teal);
    --storm-step-text: var(--storm-text-teal);
}

.storm-submit-step:nth-child(3) {
    --storm-step-colour: var(--theme-palette-color-3);
    --storm-step-text: var(--storm-text-green);
}

/* The number: tinted circle, darker text version of the accent (≥ 4.5:1) */
.storm-submit-step::before {
    content: counter(storm-submit-step);

    grid-row: 1 / span 2;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 2.25rem;
    height: 2.25rem;

    border: 2px solid var(--storm-step-colour);
    border-radius: 50%;

    background: color-mix(in srgb, var(--storm-step-colour) 14%, var(--theme-palette-color-8));
    color: var(--storm-step-text);

    font-weight: 700;
}

.storm-submit-step > * {
    grid-column: 2;
}

/* Title and line close together (the column's flow spacing would push them
   apart; a class selector so it wins over the layout rule) */
.storm-submit-step > h3 {
    margin-block: 0.2rem 0.1rem;
}

.storm-submit-step > p {
    margin-block: 0;
}

/* While the steps sit side by side: each step as wide as its text, the two
   arrows as items between them (the Columns block's ::before and ::after,
   placed by order), and the free space shared out evenly — so each arrow
   sits midway between one step's text and the next number, whatever the
   text length. The Columns gap setting stays the minimum distance. */
@media (min-width: 782px) {
    .storm-submit-steps .wp-block-columns {
        justify-content: space-between;
    }

    .storm-submit-steps .wp-block-columns > .storm-submit-step {
        flex: 0 1 auto;
    }

    .storm-submit-steps .wp-block-columns > .storm-submit-step:nth-child(1) { order: 1; }
    .storm-submit-steps .wp-block-columns > .storm-submit-step:nth-child(2) { order: 3; }
    .storm-submit-steps .wp-block-columns > .storm-submit-step:nth-child(3) { order: 5; }

    .storm-submit-steps .wp-block-columns::before,
    .storm-submit-steps .wp-block-columns::after {
        content: "";
        flex: 0 0 auto;
        align-self: flex-start;

        width: 0.6rem;
        height: 0.6rem;
        /* level with the middle of the number circles (2.25rem) */
        margin-top: calc(1.125rem - 0.3rem);

        border-top: 2px solid var(--theme-palette-color-5);
        border-right: 2px solid var(--theme-palette-color-5);

        transform: rotate(45deg);
    }

    .storm-submit-steps .wp-block-columns::before { order: 2; }
    .storm-submit-steps .wp-block-columns::after { order: 4; }
}

/* Contact line under the steps, with an info mark */
:where(.storm-submit-note) {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.storm-submit-note::before {
    content: "i";

    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;

    width: 1.25em;
    height: 1.25em;

    border: 1px solid currentColor;
    border-radius: 50%;

    font-size: 0.85em;
    font-style: italic;
    font-weight: 700;
}
