/*
 * Author block component
 *
 * The about-the-author block and newsletter sign-up form
 * (templates/partials/author-block.html, technical/mailing-list.md).
 * At the end of articles and the about page the block sits inside the
 * sheet under a rule, like the "If this resonated" block. On the
 * homepage the form and the about content sit inside the intro note;
 * placement there is in components/home-notes.css.
 */

.author-block {
    margin-top: var(--space-xxl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
}

/* Photo with "Written by Sonnie" beside it at the photo's bottom edge;
   the about text runs full width below. */
.author-byline {
    display: flex;
    align-items: flex-end;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

/* "Written by Sonnie": same label style as an aside's "About this
   article" (components/aside.css). */
.author-byline span {
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-primary);
}

.author-photo {
    flex: 0 0 auto;
    width: var(--author-photo-size);
    height: var(--author-photo-size);
    border-radius: var(--radius-round);
}

.author-text {
    font-size: 0.92em;    /* a step below the article text */
}

.author-text p {
    margin-bottom: var(--space-xs);
}

.author-text p:last-child {
    margin-bottom: 0;
}

/* Sign-up form: just the email box and button; the placeholder text
   carries the invitation. */
.newsletter {
    margin-top: var(--space-md);
}

.newsletter-home {
    margin-top: var(--space-sm);
}

/* One row at every width: the input takes the space, the tick button
   sits at the right edge. */
.newsletter-row {
    display: flex;
    gap: var(--space-xs);
}

.newsletter-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    font: inherit;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--color-ink);
    background: rgba(var(--panel-rgb), var(--panel-opacity));
    border: 1px solid var(--color-border);
    border-radius: var(--radius-shot);
}

.newsletter-submit {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.1rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-bg);
    background: var(--color-primary);
    border: none;
    border-radius: var(--radius-shot);
    cursor: pointer;
}

.newsletter-submit:hover {
    background: var(--color-primary-hover);
}

.newsletter-submit:disabled {
    opacity: 0.6;
    cursor: progress;
}

.newsletter-error {
    margin-top: var(--space-xs);
    font-size: 0.92rem;
    color: var(--color-primary);
}

.newsletter-thanks {
    font-family: var(--font-serif);
    margin-top: var(--space-xs);
}

/* Focus moves here by script so screen readers announce it; the reader
   did not tab to it, so no focus outline. */
.newsletter-thanks:focus {
    outline: none;
}

/* Phones: input text at 17px so iPhones do not zoom in on focus. */
/* Subscribe button: the word on tablets and wider, a tick on phones. */
.newsletter-submit-tick {
    display: none;
}

@media (max-width: 720px) {
    .newsletter-submit-text {
        display: none;
    }

    .newsletter-submit-tick {
        display: block;
    }

    .newsletter-submit {
        padding: 0.5rem 0.75rem;
    }

    .newsletter-input {
        font-size: 17px;    /* iOS Safari zooms on focus below 16px */
    }
}

/* Wide screens: the homepage form sits in the narrow right-hand column,
   so the button drops below the email box, right-aligned. */
@media (min-width: 1000px) {
    .newsletter-home .newsletter-row {
        flex-direction: column;
        align-items: flex-end;
    }

    .newsletter-home .newsletter-input {
        width: 100%;
    }
}

/* Phones: the end-of-article and about-page form stacks too, the email
   box full width with the button below, right-aligned. */
@media (max-width: 720px) {
    .author-block .newsletter-row {
        flex-direction: column;
        align-items: flex-end;
    }

    .author-block .newsletter-input {
        width: 100%;
    }

    /* The button has its own line here, so it keeps the word. */
    .author-block .newsletter-submit {
        padding: 0.5rem 1.1rem;
    }

    .author-block .newsletter-submit-text {
        display: inline;
    }

    .author-block .newsletter-submit-tick {
        display: none;
    }
}
