/* TRM Forms 0.4 — restrained gallery presentation */
.trm-form,
.trm-thank-you {
    --trm-ink: currentColor;
    --trm-muted: color-mix(in srgb, currentColor 58%, transparent);
    --trm-line: color-mix(in srgb, currentColor 24%, transparent);
}

.trm-form {
    width: min(100%, 760px);
    margin: clamp(2rem, 5vw, 5rem) auto;
    font-size: 0.96rem;
    line-height: 1.6;
}

.trm-field-group {
    margin: 0 0 2rem;
    padding: 0;
    border: 0;
}

.trm-field-group > label,
.trm-field-group > legend,
.trm-name-group legend {
    display: block;
    margin: 0 0 .7rem;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.trm-form input[type="text"],
.trm-form input[type="email"],
.trm-form input[type="tel"],
.trm-form textarea {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    padding: .72rem 0 .62rem;
    border: 0;
    border-bottom: 1px solid var(--trm-line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
    font: inherit;
    line-height: 1.5;
    transition: border-color .18s ease, opacity .18s ease;
}

.trm-form textarea {
    min-height: 10rem;
    padding: .9rem;
    border: 1px solid var(--trm-line);
    resize: vertical;
}

.trm-form input:focus,
.trm-form textarea:focus,
.trm-form button:focus,
.trm-thank-you a:focus {
    outline: 1px solid currentColor;
    outline-offset: 4px;
}

.trm-form input:focus,
.trm-form textarea:focus {
    border-color: currentColor;
}

.trm-name-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
}

.trm-name-grid label {
    display: flex;
    flex-direction: column-reverse;
    gap: .45rem;
    color: var(--trm-muted);
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.trm-choice {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin: .55rem 0;
    font-weight: 400;
    line-height: 1.45;
}

.trm-choice input {
    margin: 0;
}

.trm-required {
    font-weight: 700;
}

.trm-submit {
    cursor: pointer;
    min-width: 9rem;
    margin-top: .4rem;
    padding: .8rem 1.15rem;
    border: 1px solid currentColor;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    transition: opacity .18s ease;
}

.trm-submit:hover,
.trm-thank-you a:hover {
    opacity: .58;
}

.trm-form-errors,
.trm-form-confirmation {
    box-sizing: border-box;
    width: min(100%, 760px);
    margin: 0 auto 2rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--trm-line);
}

.trm-form-errors p,
.trm-form-errors ul {
    margin-top: 0;
}

.trm-form-errors ul {
    margin-bottom: 0;
}

.trm-turnstile {
    min-height: 65px;
    padding-top: .25rem;
}

.trm-hp {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

/* Thank You composition */
.trm-thank-you {
    width: min(100%, 880px);
    margin: clamp(6rem, 15vh, 11rem) auto;
    padding: 0 2rem;
    text-align: center;
}

.trm-thank-you-kicker {
    margin: 0 0 1.35rem;
    color: var(--trm-muted);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .28em;
}

.trm-thank-you h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 600;
    line-height: 1;
    letter-spacing: .28em;
    text-indent: .28em;
}

.trm-thank-you-rule {
    width: 2.5rem;
    margin: 2.2rem auto;
    border-top: 1px solid currentColor;
    opacity: .4;
}

.trm-thank-you-message {
    max-width: 34rem;
    margin: 0 auto;
    font-size: clamp(1rem, 1.7vw, 1.2rem);
    line-height: 1.8;
}

.trm-thank-you-return {
    margin: 2.5rem 0 0;
}

.trm-thank-you-return a {
    color: inherit;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .16em;
    text-decoration: none;
    text-transform: uppercase;
    transition: opacity .18s ease;
}

/* Scoped page cleanup. This deliberately targets widget sidebars, not primary navigation. */
body.trm-gallery-page .widget-area,
body.trm-gallery-page #secondary,
body.trm-gallery-page .secondary,
body.trm-gallery-page .sidebar-widget-area {
    display: none !important;
}

body.trm-gallery-page .content-area,
body.trm-gallery-page .site-main,
body.trm-gallery-page main {
    width: 100%;
    max-width: none;
}

@media (max-width: 700px) {
    .trm-form {
        margin: 2.5rem auto;
    }

    .trm-name-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .trm-thank-you {
        margin: 5rem auto;
        padding: 0 1.25rem;
    }
}
