/* ==========================================================================
   [pw_close], closing call to action

   Copy on the left, the real contact form on the right. The form is the
   site's existing CF7 form rendered through do_shortcode(), not a copy,
   so there's only ever one form definition to maintain.

   Palette comes from global.css, declared as a dependency of this
   stylesheet in penumbra-products.php.
   ========================================================================== */

.pw-close {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 3rem;
    padding: 7rem 0;
}


/* --------------------------------------------------------------------------
   Copy
   -------------------------------------------------------------------------- */

.pw-close-eyebrow {
    margin: 0 0 1.25rem;
    font-size: .8125rem;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--pw-accent);
}

.pw-close-title {
    margin: 0;
    max-width: 14ch;
    font-size: clamp(2rem, 3.6vw, 3.25rem);
    font-weight: 800;
    line-height: 1.04;
    letter-spacing: -.02em;
    color: var(--pw-text);
}

.pw-close-lede {
    margin: 1.75rem 0 0;
    max-width: 38ch;
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--pw-text-dim);
}

.pw-close-note {
    margin: 1.25rem 0 0;
    max-width: 38ch;
    font-size: 1.0625rem;
    line-height: 1.6;
    font-weight: 600;
    color: var(--pw-accent);
}


/* --------------------------------------------------------------------------
   Meta list
   -------------------------------------------------------------------------- */

.pw-close-meta {
    margin: 2.5rem 0 0;
    padding: 1.5rem 0 0;
    border-top: .0625rem solid var(--pw-line);
    display: grid;
    gap: .625rem;
}

.pw-close-meta p {
    margin: 0;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--pw-text-dim);
}

.pw-close-meta a {
    color: var(--pw-text-dim);
    text-decoration: none;
    border-bottom: .0625rem solid var(--pw-line);
    transition: color .2s, border-color .2s;
}

.pw-close-meta a:hover,
.pw-close-meta a:focus-visible {
    color: var(--pw-accent);
    border-color: var(--pw-accent);
}


/* --------------------------------------------------------------------------
   Form panel

   Fields are underlines rather than filled wells: transparent background,
   a single hairline along the bottom, no radius, no horizontal padding so
   the text sits flush with the label above it.

   These override Betheme's input styling on specificity alone, no
   !important needed, since .pw-close-form .wpcf7 input[type="..."] already
   beats what the theme applies.
   -------------------------------------------------------------------------- */

.pw-close-form {
    padding: 2rem;
    border: .0625rem solid var(--pw-line);
    border-radius: .5rem;
    background-color: var(--pw-surface);
}

.pw-close-form .wpcf7 label {
    display: block;
    margin-bottom: .375rem;
    font-weight: 700;
    color: var(--pw-text);
}

.pw-close-form .wpcf7 input[type="text"],
.pw-close-form .wpcf7 input[type="email"],
.pw-close-form .wpcf7 input[type="tel"],
.pw-close-form .wpcf7 input[type="url"],
.pw-close-form .wpcf7 select,
.pw-close-form .wpcf7 textarea {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 1.5rem;
    padding: .625rem 0;
    background-color: transparent;
    border: 0;
    border-bottom: .0625rem solid var(--pw-line);
    border-radius: 0;
    box-shadow: none;
    color: var(--pw-text);
    transition: border-color .2s;
}

.pw-close-form .wpcf7 textarea {
    min-height: 8rem;
    resize: vertical;
}

.pw-close-form .wpcf7 input[type="text"]:focus,
.pw-close-form .wpcf7 input[type="email"]:focus,
.pw-close-form .wpcf7 input[type="tel"]:focus,
.pw-close-form .wpcf7 input[type="url"]:focus,
.pw-close-form .wpcf7 select:focus,
.pw-close-form .wpcf7 textarea:focus {
    border-bottom-color: var(--pw-accent);
    outline: none;
    box-shadow: none;
}

.pw-close-form .wpcf7 ::placeholder {
    color: var(--pw-text-dim);
    opacity: .75;
}

/* The consent row's own label is set by global.css and shouldn't inherit
   the block treatment above, it sits inline beside its checkbox. */
.pw-close-form .wpcf7 .pw-consent label,
.pw-close-form .wpcf7 label:has(.wpcf7-acceptance) {
    display: flex;
    margin-bottom: 0;
    font-weight: 400;
}


/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

/* The split only exists once there is room for two readable columns.
   Below that the form drops under the copy, which is also the order it
   should be read in. */
@media (min-width: 64rem) {

    .pw-close {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
        column-gap: 5rem;
        align-items: start;
    }

    .pw-close-form {
        padding: 2.5rem;
    }
}

@media (max-width: 64rem) {

    .pw-close {
        padding: 4.5rem 0;
        gap: 2.5rem;
    }

    .pw-close-title,
    .pw-close-lede,
    .pw-close-note {
        max-width: none;
    }

    .pw-close-form {
        padding: 1.5rem;
    }
}

/* 768px, tablet portrait. The form is full width here, so its fields
   are wide enough that a fixed inline label pairing would look
   stranded. Padding comes in and the copy tightens. */
@media (max-width: 48rem) {

    .pw-close {
        padding: 3.5rem 0;
    }

    .pw-close-lede,
    .pw-close-note {
        font-size: 1rem;
    }
}

@media (max-width: 37.5rem) {

    .pw-close {
        padding: 2.75rem 0;
        gap: 2rem;
    }

    .pw-close-form {
        padding: 1.125rem;
    }
}

/* CF7 renders its own markup, so the fields need catching generically
   rather than by a class this plugin controls. Without this an input
   with a themed width can push the whole card past the viewport. */
.pw-close-form input,
.pw-close-form select,
.pw-close-form textarea {
    max-width: 100%;
    box-sizing: border-box;
}
