/*
Theme Name: Justin Reed — Twenty Twenty-Five Child
Description: Custom layout layer recreating the imported Makoa homepage and responsive content grids.
Author: Site owner
Template: twentytwentyfive
Version: 1.5.0
Text Domain: justin-reed-child
*/

/* Global layout */
.wp-site-blocks {
    overflow-wrap: break-word;
}

.wp-block-image img {
    display: block;
    max-width: 100%;
    height: auto;
}

/*
 * The first imported row is wrapped in a Group block, unlike the later rows.
 * Remove that wrapper's narrower constrained width so its grid matches its
 * sibling rows.
 */
.wp-block-group:has(> .wp-block-jetpack-layout-grid) {
    width: 100% !important;
    max-width: none !important;
    margin-inline: 0 !important;
}

/*
 * Simple responsive grid for imported legacy Jetpack layout-grid blocks.
 * The old column span/start/row classes are intentionally ignored: each
 * direct child is placed in normal document order in an equal-width track.
 */
.wp-block-jetpack-layout-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-flow: row;
    align-items: start;
    gap: clamp(1.25rem, 2.5vw, 2.5rem);
    width: 100%;
    max-width: 100%;
}

.wp-block-jetpack-layout-grid > .wp-block-jetpack-layout-grid-column {
    grid-column: auto !important;
    grid-row: auto !important;
    min-width: 0;
    width: auto !important;
    max-width: 100%;
}

.wp-block-jetpack-layout-grid-column figure {
    margin: 0;
}

.wp-block-jetpack-layout-grid-column .wp-block-image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.wp-block-jetpack-layout-grid-column figcaption {
    margin-top: 0.4rem;
    font-size: 0.8em;
    line-height: 1.35;
    text-align: center;
    overflow-wrap: anywhere;
}

.wp-block-jetpack-layout-grid-column p {
    margin-top: 0.65rem;
    text-align: center;
    overflow-wrap: normal;
    word-break: normal;
}

/* Keep the two legacy gutter sizes visually distinct. */
.wp-block-jetpack-layout-gutter__small {
    column-gap: 1rem;
    row-gap: 1.5rem;
}

.wp-block-jetpack-layout-gutter__medium {
    column-gap: 1.5rem;
    row-gap: 2rem;
}

/* Makoa homepage utility classes retained in the front-page template. */
.mobile--no-padding-top {
    padding-top: 0 !important;
}

.mobile-no-br br {
    display: none;
}

.mobile-align-none {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Tablet: two equal columns. */
@media (max-width: 900px) {
    .wp-block-jetpack-layout-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Phone: one column, with normal reading order. */
@media (max-width: 600px) {
    .wp-block-jetpack-layout-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .wp-block-columns {
        flex-wrap: wrap !important;
    }

    .wp-block-columns > .wp-block-column {
        flex-basis: 100% !important;
    }

    .mobile-order-1 { order: 1; }
    .mobile-order-2 { order: 2; }
    .mobile-order-3 { order: 3; }
    .mobile--no-padding-top { padding-top: 0 !important; }
}

/* Reusable contact form */
.jr-contact-wrap {
    width: 100%;
    max-width: 760px;
    margin-inline: auto;
}

.jr-contact-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
}

.jr-contact-field {
    min-width: 0;
    margin: 0;
}

.jr-contact-field-wide {
    grid-column: 1 / -1;
}

.jr-contact-field label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.jr-contact-field input,
.jr-contact-field textarea {
    box-sizing: border-box;
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 0.7rem 0.8rem;
    border: 1px solid #767676;
    border-radius: 3px;
    background: #fff;
    color: #171717;
    font: inherit;
}

.jr-contact-field textarea {
    resize: vertical;
}

.jr-contact-field small {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8em;
}

.jr-contact-required-note {
    margin: 1rem 0 0.75rem;
    font-size: 0.9em;
}

.jr-contact-submit {
    display: inline-block;
    padding: 0.75rem 1.4rem;
    border: 0;
    border-radius: 3px;
    background: #171717;
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.jr-contact-submit:hover,
.jr-contact-submit:focus-visible {
    background: #444;
}

.jr-contact-errors,
.jr-contact-success {
    margin: 0 0 1.25rem;
    padding: 1rem;
    border: 1px solid #767676;
    border-radius: 3px;
}

.jr-contact-errors {
    border-left: 4px solid #a12622;
}

.jr-contact-success {
    border-left: 4px solid #287a3d;
}

.jr-contact-errors p,
.jr-contact-errors ul {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.jr-contact-errors ul:last-child {
    margin-bottom: 0;
}

/* Honeypot stays out of the visual and keyboard flow. */
.jr-contact-honeypot {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 600px) {
    .jr-contact-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .jr-contact-field-wide {
        grid-column: auto;
    }
}
