/* Shared action styles load last so page-specific layouts keep one button rhythm. */
:is(#main, .editor-styles-wrapper) {
    --gf-action-bg: #26382C;
    --gf-action-text: #F4EBDD;
    --gf-action-hover-bg: #D29A45;
    --gf-action-hover-text: #26382C;
    --gf-action-focus: #C75A38;
}

:is(#main, .editor-styles-wrapper) :is(.da-band, .da-green, .da-feature, #foresporsel) {
    --gf-action-bg: #D29A45;
    --gf-action-text: #26382C;
    --gf-action-hover-bg: #F4EBDD;
    --gf-action-hover-text: #26382C;
    --gf-action-focus: #F4EBDD;
}

/* Cream cards inside green bands need the same contrast as other cream surfaces. */
:is(#main, .editor-styles-wrapper) :is(.da-package, .gf-price-card, .da-card, .gf-blog-card) {
    --gf-action-bg: #26382C;
    --gf-action-text: #F4EBDD;
    --gf-action-hover-bg: #D29A45;
    --gf-action-hover-text: #26382C;
    --gf-action-focus: #C75A38;
}

:is(#main, .editor-styles-wrapper) :is(
    .wp-block-button__link,
    .gf-submit,
    .gf-contact-form button[type="submit"],
    .post-password-form input[type="submit"],
    .gf-frame-choice,
    [data-gf-module-choice],
    .gf-frame-request-link,
    .gf-gallery-controls button,
    .gf-carousel-control
) {
    appearance: none;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    max-width: 100%;
    margin: 0;
    padding: 15px 26px;
    border: 1px solid var(--gf-action-border, var(--gf-action-bg));
    border-radius: 100px;
    background: var(--gf-action-bg);
    color: var(--gf-action-text) !important;
    box-shadow: none;
    font: 400 14px/20px 'Segoe UI', Arial, sans-serif;
    letter-spacing: .025em;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    white-space: normal;
    cursor: pointer;
    transform: none;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

:is(#main, .editor-styles-wrapper) :is(
    .wp-block-button__link,
    .gf-submit,
    .gf-contact-form button[type="submit"],
    .post-password-form input[type="submit"],
    .gf-frame-choice,
    [data-gf-module-choice],
    .gf-frame-request-link,
    .gf-gallery-controls button,
    .gf-carousel-control
):hover:not(:disabled) {
    background: var(--gf-action-hover-bg);
    border-color: var(--gf-action-hover-bg);
    color: var(--gf-action-hover-text) !important;
    transform: none;
}

:is(#main, .editor-styles-wrapper) :is(
    .wp-block-button__link,
    .gf-submit,
    .gf-contact-form button[type="submit"],
    .post-password-form input[type="submit"],
    .gf-frame-choice,
    [data-gf-module-choice],
    .gf-frame-request-link,
    .gf-gallery-controls button,
    .gf-carousel-control
):focus-visible {
    outline: 2px solid var(--gf-action-focus);
    outline-offset: 4px;
}

:is(#main, .editor-styles-wrapper) .wp-block-buttons {
    gap: 14px;
}

/* The theme's paragraph rhythm must not add a bottom margin to individual grid cards. */
:is(#main, .editor-styles-wrapper) .gf-price-grid > .gf-price-card,
:is(#main, .editor-styles-wrapper) .da-package-grid > .da-package {
    margin: 0;
    align-self: stretch;
}

:is(#main, .editor-styles-wrapper) .wp-block-button {
    width: min(100%, 300px);
    max-width: 100%;
    margin: 0;
}

:is(#main, .editor-styles-wrapper) .wp-block-button__link {
    width: 100%;
    min-width: 0;
}

:is(#main, .editor-styles-wrapper) :is(.gf-submit, .gf-contact-form button[type="submit"], .post-password-form input[type="submit"]) {
    width: min(100%, 300px);
}

:is(#main, .editor-styles-wrapper) .post-password-form input[type="password"] {
    box-sizing: border-box;
    display: block;
    width: min(100%, 300px);
    max-width: 100%;
    height: 54px;
    margin: 12px 0;
    padding: 0 15px;
    border: 1px solid #26382C;
    border-radius: 3px;
    background: #F4EBDD;
    color: #26382C;
    font: 400 15px/20px 'Segoe UI', Arial, sans-serif;
}

:is(#main, .editor-styles-wrapper) .post-password-form input[type="password"]:focus-visible {
    outline: 2px solid #C75A38;
    outline-offset: 4px;
}

:is(#main, .editor-styles-wrapper) .gf-carousel-control {
    width: min(100%, 210px);
}

:is(#main, .editor-styles-wrapper) .gf-home-actions > .wp-block-button {
    flex: 0 1 300px;
    width: min(100%, 300px);
}

:is(#main, .editor-styles-wrapper) .gf-action-photos {
    --gf-action-bg: #F4EBDD;
    --gf-action-text: #26382C;
    --gf-action-hover-bg: #D29A45;
    --gf-action-hover-text: #26382C;
}

:is(#main, .editor-styles-wrapper) .gf-action-contact {
    --gf-action-bg: #D29A45;
    --gf-action-text: #26382C;
    --gf-action-hover-bg: #F4EBDD;
    --gf-action-hover-text: #26382C;
}

:is(#main, .editor-styles-wrapper) .gf-action-prices {
    --gf-action-bg: #F4EBDD;
    --gf-action-border: #C75A38;
    --gf-action-text: #26382C;
    --gf-action-hover-bg: #D29A45;
    --gf-action-hover-text: #26382C;
}

/* Product choices use the same ochre action as the accompanying frame enquiry. */
:is(#main, .editor-styles-wrapper) :is(.gf-frame-choice, .gf-frame-request-link) {
    --gf-action-bg: #D29A45;
    --gf-action-text: #26382C;
    --gf-action-hover-bg: #F4EBDD;
    --gf-action-hover-text: #26382C;
    width: 100%;
    padding-inline: 18px;
}

:is(#main, .editor-styles-wrapper) :is(.gf-frame-choice, [data-gf-module-choice], .gf-gallery-controls button)[aria-pressed="true"] {
    border-color: #26382C;
    box-shadow: inset 0 0 0 1px #26382C;
    font-weight: 600;
}

:is(#main, .editor-styles-wrapper) .gf-frame-choice[aria-busy="true"] {
    border-color: #C75A38;
}

:is(#main, .editor-styles-wrapper) :is(.gf-submit, .gf-contact-form button[type="submit"]):disabled {
    opacity: .6;
    cursor: wait;
}

:is(#main, .editor-styles-wrapper) .gf-carousel-control:disabled {
    opacity: .6;
    cursor: default;
}

@media (max-width: 690px) {
    :is(#main, .editor-styles-wrapper) .wp-block-button,
    :is(#main, .editor-styles-wrapper) .gf-price-action,
    :is(#main, .editor-styles-wrapper) .gf-home-actions > .wp-block-button {
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
    }

    :is(#main, .editor-styles-wrapper) :is(.gf-submit, .gf-contact-form button[type="submit"], .post-password-form input[type="submit"]) {
        width: 100%;
    }

    :is(#main, .editor-styles-wrapper) .gf-frame-choice-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    :is(#main, .editor-styles-wrapper) .gf-frame-choice {
        width: 100%;
        padding-inline: 12px;
        letter-spacing: 0;
    }

    /* Center an unpaired frame choice without changing the desktop layout. */
    :is(#main, .editor-styles-wrapper) .gf-frame-selector[data-gf-frame-options] .gf-frame-choice-grid > .gf-frame-choice:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        width: calc((100% - 10px) / 2);
        justify-self: center;
    }

    :is(#main, .editor-styles-wrapper) .gf-carousel-control {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        padding-inline: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    :is(#main, .editor-styles-wrapper) :is(
        .wp-block-button__link,
        .gf-submit,
        .gf-contact-form button[type="submit"],
        .post-password-form input[type="submit"],
        .gf-frame-choice,
        [data-gf-module-choice],
        .gf-frame-request-link,
        .gf-gallery-controls button,
        .gf-carousel-control
    ) {
        transition: none;
    }
}
