/* ACC Ask modal — clean site-idiom dialog. */

.acc-ask {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    /* Top-aligned and scrolled at the shell, not centered: a centered dialog
       taller than the visible viewport spills past both ends with no way to
       reach either, and `vh` does not shrink when the keyboard opens. */
    align-items: flex-start;
    justify-content: center;
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
}
.acc-ask[hidden] { display: none; }
/* `overflow: hidden` on <body> alone does nothing while the theme sets
   `html, body { overflow-x: clip }` — <html> has to be pinned too. */
body.acc-ask-open { overflow: hidden; }
html:has(body.acc-ask-open) { overflow: hidden; }

.acc-ask__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 43, 18, 0.55);
    backdrop-filter: blur(2px);
}
.acc-ask__dialog {
    position: relative;
    width: min(560px, 100%);
    margin: auto; /* still centers when it fits */
    overflow: visible;
    background: var(--wp--preset--color--background, #faf7f0);
    border: 1.5px solid #2c5e34;
    border-radius: 12px;
    padding: 2rem 2rem 1.75rem;
    box-shadow: 0 30px 70px -30px rgba(13, 43, 18, 0.6);
}
.acc-ask__close {
    position: absolute;
    top: 0.4rem;
    right: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    background: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--wp--preset--color--muted, #6b7280);
    cursor: pointer;
    padding: 0;
}
.acc-ask__close:hover { color: var(--wp--preset--color--primary, #1a3a1f); }
    /* Reserve the close button's corner. It is 44px wide, absolutely
       positioned at the top right, and the title had no space set aside for
       it -- so any title that wrapped ran underneath the x. */
.acc-ask__title {
    padding-right: 3rem;
    font-family: var(--wp--preset--font-family--serif, Georgia, serif);
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--wp--preset--color--primary, #1a3a1f);
    margin: 0 0 0.25rem;
}
.acc-ask__lede {
    font-size: 0.95rem;
    color: var(--wp--preset--color--muted, #5b5847);
    margin: 0 0 1.25rem;
}
.acc-ask__form { display: flex; flex-direction: column; gap: 1rem; }
.acc-ask__hp {
    position: absolute !important;
    left: -9999px !important;
    height: 1px;
    overflow: hidden;
    margin: 0;
}
.acc-ask__row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 480px) {
    .acc-ask__row { grid-template-columns: 1fr 1fr; }
}
.acc-ask__field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--wp--preset--color--primary, #1a3a1f);
}
.acc-ask__field input,
.acc-ask__field textarea {
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--wp--preset--color--border, #c9c2ad);
    border-radius: 8px;
    background: #fff;
    font: inherit;
    font-weight: 400;
    /* The label sets 0.85rem and these inherit it. Anything under 16px makes
       iOS zoom the page on focus, which pushes Send off the screen. */
    font-size: 1rem;
}
.acc-ask__field input:focus,
.acc-ask__field textarea:focus {
    outline: 2px solid var(--wp--preset--color--primary-light, #2c5e34);
    outline-offset: 1px;
}
.acc-ask__status { margin: 0; font-size: 0.9rem; font-weight: 600; min-height: 1.2em; }
.acc-ask__status--ok  { color: #1e7b34; }
.acc-ask__status--err { color: #b32d2e; }

.acc-ask__send {
    align-self: flex-start;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.8rem;
    border: none;
    border-radius: 999px;
    background: var(--wp--preset--color--primary, #1a3a1f);
    color: var(--wp--preset--color--background, #faf7f0);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.82rem;
    cursor: pointer;
}
.acc-ask__send:hover:not(:disabled) { background: var(--wp--preset--color--primary-light, #2c5e34); }
.acc-ask__send:disabled { opacity: 0.7; cursor: default; }
.acc-ask__spinner {
    width: 0.9em;
    height: 0.9em;
    border: 2px solid rgba(246, 248, 246, 0.35);
    border-top-color: #f6f8f6;
    border-radius: 50%;
    display: none;
}
.acc-ask__send--sending .acc-ask__spinner {
    display: inline-block;
    animation: acc-ask-spin 0.7s linear infinite;
}
@keyframes acc-ask-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .acc-ask__spinner { animation: none; }
}

/* On a phone the primary action gets the full width rather than a narrow
   left-aligned pill. */
@media (max-width: 33rem) {
    .acc-ask__send {
        align-self: stretch;
        justify-content: center;
    }
}
