/*
 * Holub - front-end styles.
 *
 * Deliberately thin. The form's layout is the theme's job; this file only
 * handles the parts a theme cannot know about: hiding the honeypot and
 * making the response message legible on whatever background it lands on.
 */

/* The honeypot. Off screen rather than display:none, because some bots skip
   anything that is not rendered but happily fill an input they can "see". */
.holub-hp {
    position: absolute !important;
    left: -9999px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* The spam question. Kept out of the fields row on purpose, so a theme that
   styles that row as one joined control does not have to be rewritten. */
.holub-challenge {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 0 0;
}

.holub-challenge label {
    font-size: 14px;
    line-height: 1.4;
}

.holub-challenge input {
    width: 6.6em;
    flex: 0 0 auto;
    box-sizing: border-box;
}

.holub-response {
    margin: 0;
}

.holub-response:empty {
    display: none;
}

.holub-response p {
    margin: 12px 0 0;
    font-size: 15px;
    line-height: 1.5;
}

.holub-response.holub-success p {
    color: #2e7d32;
}

.holub-response.holub-error p {
    color: #c62828;
}

/* On a dark newsletter band the theme usually sets light text. Inherit rather
   than fight it, and lean on weight for the distinction instead. */
.holub-form.is-on-dark .holub-response p {
    color: inherit;
    opacity: 0.9;
}

.holub-fineprint {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.5;
    opacity: 0.75;
}

.holub-form.is-busy input[type="submit"] {
    opacity: 0.6;
    cursor: progress;
}

/* The discount code, printed by [holub_code]. A chip rather than plain text:
   it is a string somebody copies by hand, so it gets room to be read one
   glyph at a time and an edge that marks where it stops. Every colour is
   currentColor, so it takes whatever the page around it is already using
   instead of arriving with an opinion. */
.holub-code {
    display: inline-block;
    padding: 6px 18px;
    border: 1px dashed currentColor;
    border-radius: 10px;
    font-family: inherit;
    font-size: 1.15em;
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1.4;
    user-select: all;
    word-break: break-all;
}

/* Respect a visitor who asked for less motion. */
@media (prefers-reduced-motion: reduce) {
    .holub-form,
    .holub-form * {
        transition: none !important;
    }
}
