/* Feature: quiet-note — private author inbox (not a public comments section).
   Loaded only when config.extra.quiet_note_enabled is true.
   Safe to delete this file when retiring the feature.

   Layout borrows from iMessage: your outgoing note sits on the right,
   with a pill composer and a send affordance that only lights up when
   there is something to send. */

.quiet-note {
    display: flex;
    justify-content: flex-end;
    max-width: 800px;
    margin: 4.5rem auto -0.75rem;
    padding: 0 1.25rem 0 2.25rem;
}

.quiet-note-form {
    width: min(100%, 22.5rem);
    text-align: right;
}

.quiet-note-label {
    display: block;
    margin: 0 0.35rem 0.65rem 0;
    color: rgba(var(--theme-color-rgb), 0.62);
    font-family: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    font-size: 1.02rem;
    font-style: italic;
    letter-spacing: 0.01em;
    line-height: 1.45;
    text-wrap: balance;
}

.quiet-note-composer {
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
    padding: 0.38rem 0.4rem 0.38rem 1.05rem;
    border: 1px solid rgba(var(--theme-color-rgb), 0.16);
    border-radius: 1.35rem;
    /* Softer on the trailing corner — like an outgoing bubble. */
    border-bottom-right-radius: 0.55rem;
    background: var(--surface-solid);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.45) inset,
        0 10px 28px -22px rgba(17, 22, 19, 0.45);
    transition:
        border-color 220ms ease,
        background 220ms ease,
        box-shadow 220ms ease,
        transform 220ms ease;
}

.quiet-note-composer:focus-within {
    border-color: rgba(var(--sky-rgb), 0.5);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.55) inset,
        0 12px 30px -20px rgba(17, 22, 19, 0.5);
    transform: translateY(-1px);
}

.quiet-note textarea {
    display: block;
    flex: 1;
    min-width: 0;
    max-height: 9rem;
    margin: 0;
    padding: 0.48rem 0;
    resize: none;
    overflow-y: auto;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--color-text);
    font: inherit;
    font-size: 0.95rem;
    line-height: 1.45;
    text-align: left;
}

.quiet-note textarea::placeholder {
    color: rgba(var(--theme-color-rgb), 0.4);
    font-style: italic;
}

.quiet-note-send {
    display: grid;
    width: 2.05rem;
    height: 2.05rem;
    flex: 0 0 auto;
    place-items: center;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(var(--theme-color-rgb), 0.1);
    color: rgba(var(--theme-color-rgb), 0.38);
    cursor: not-allowed;
    transition:
        color 180ms ease,
        background 180ms ease,
        transform 180ms ease,
        box-shadow 180ms ease;
}

.quiet-note-form.has-note .quiet-note-send {
    background: rgba(var(--sky-rgb), 0.92);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 14px -8px rgba(var(--sky-rgb), 0.9);
}

.quiet-note-form.has-note .quiet-note-send:hover,
.quiet-note-form.has-note .quiet-note-send:focus-visible {
    background: rgba(var(--sky-rgb), 1);
    transform: scale(1.04);
}

.quiet-note-form.has-note .quiet-note-send:active {
    transform: scale(0.94);
}

.quiet-note-send svg {
    width: 1.05rem;
    height: 1.05rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.1;
}

.quiet-note-hint,
.quiet-note-status {
    min-height: 1.2rem;
    margin: 0.45rem 0.35rem 0 0;
    color: rgba(var(--theme-color-rgb), 0.42);
    font-size: 0.7rem;
    letter-spacing: 0.01em;
    line-height: 1.4;
}

.quiet-note-hint {
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.quiet-note-form:focus-within .quiet-note-hint,
.quiet-note-form.has-note .quiet-note-hint {
    opacity: 1;
    transform: translateY(0);
}

.quiet-note-status {
    display: none;
    color: var(--color-sky);
}

.quiet-note-status.is-visible {
    display: block;
}

.quiet-note-status kbd,
.quiet-note-hint kbd {
    font-family: inherit;
    font-size: 0.68rem;
    letter-spacing: 0.02em;
}

@media (max-width: 768px) {
    .quiet-note {
        margin-top: 3.5rem;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .quiet-note-form {
        width: min(100%, 20.5rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .quiet-note-composer,
    .quiet-note-send,
    .quiet-note-hint {
        transition: none;
    }

    .quiet-note-composer:focus-within {
        transform: none;
    }
}
