/* Shared button appearance for TP and its hosting themes. Layout and floats stay in page styles. */
:is(#tlumoceni-cz, #tlumoceni-hosting-cz) {
    --button-top: #4c742b;
    --button-bottom: #36571d;
    --button-hover: #2e4c18;
}

#tlumoceni-hosting-cz.theme-blue {
    --button-top: #1768ab;
    --button-bottom: #084d8c;
    --button-hover: #063b6d;
}

#tlumoceni-hosting-cz.theme-brown {
    --button-top: #866037;
    --button-bottom: #684624;
    --button-hover: #52361c;
}

#tlumoceni-hosting-cz.theme-petrol {
    --button-top: #236e78;
    --button-bottom: #19545d;
    --button-hover: #123f46;
}

#tlumoceni-hosting-cz.theme-red,
#tlumoceni-hosting-cz.theme-wine {
    --button-top: #8b3c53;
    --button-bottom: #6b293d;
    --button-hover: #542031;
}

#tlumoceni-hosting-cz.theme-indigo {
    --button-top: #535aa0;
    --button-bottom: #3c427c;
    --button-hover: #2d325f;
}

#tlumoceni-hosting-cz.theme-green {
    --button-top: #4c742b;
    --button-bottom: #36571d;
    --button-hover: #2e4c18;
}

#tlumoceni-hosting-cz.theme-terracotta {
    --button-top: #9b523d;
    --button-bottom: #803a28;
    --button-hover: #642c1e;
}

#tlumoceni-hosting-cz.theme-graphite {
    --button-top: #566371;
    --button-bottom: #3d4752;
    --button-hover: #2d353e;
}

#tlumoceni-hosting-cz.theme-plum {
    --button-top: #765080;
    --button-bottom: #593961;
    --button-hover: #432a49;
}

:is(#tlumoceni-cz, #tlumoceni-hosting-cz) :is(
    #more-photos.dalsi-obrazky, .button-green, .common-button, .feedback-button, .button-more, .cc_btn,
    input[type="submit"], input[type="button"], input[type="reset"],
    button:not(.hidden-text):not(.hosting-menu-toggle)
),
:is(#tlumoceni-cz, #tlumoceni-hosting-cz) input[type="file"]::file-selector-button {
    box-sizing: border-box;
    display: inline-block;
    width: auto !important;
    height: auto !important;
    min-height: 48px;
    max-width: 100%;
    padding: 12px 20px !important;
    margin-bottom: 40px;
    border: 1px solid var(--button-bottom) !important;
    border-radius: 0 !important;
    background: linear-gradient(var(--button-top), var(--button-bottom)) !important;
    box-shadow: inset 0 0 0 100vmax rgb(0 0 0 / 0%), 0 2px 4px rgb(0 0 0 / 18%);
    filter: none !important;
    color: #fff !important;
    font: bold 16px/1.4 Arial, sans-serif !important;
    letter-spacing: normal;
    text-align: center;
    text-decoration: none !important;
    text-indent: 0 !important;
    white-space: normal;
    cursor: pointer;
    overflow: visible;
    vertical-align: middle;
    transition: box-shadow 150ms;
}

:is(#tlumoceni-cz, #tlumoceni-hosting-cz) :is(
    #more-photos.dalsi-obrazky, .button-green, .common-button, .feedback-button, .button-more, .cc_btn,
    input[type="submit"], input[type="button"], input[type="reset"], button:not(.hidden-text):not(.hosting-menu-toggle)
):hover,
:is(#tlumoceni-cz, #tlumoceni-hosting-cz) input[type="file"]::file-selector-button:hover {
    color: #fff !important;
    box-shadow: inset 0 0 0 100vmax rgb(0 0 0 / 15%), 0 3px 7px rgb(0 0 0 / 24%);
}

:is(#tlumoceni-cz, #tlumoceni-hosting-cz) :is(
    #more-photos.dalsi-obrazky, .button-green, .common-button, .feedback-button, .button-more, .cc_btn,
    input[type="submit"], input[type="button"], input[type="reset"], button:not(.hidden-text):not(.hosting-menu-toggle)
):focus-visible,
:is(#tlumoceni-cz, #tlumoceni-hosting-cz) input[type="file"]:focus-visible {
    outline: 3px solid var(--button-hover);
    outline-offset: 4px;
}

:is(#tlumoceni-cz, #tlumoceni-hosting-cz) :is(
    #more-photos.dalsi-obrazky, .button-green, .common-button, .feedback-button, .button-more, .cc_btn,
    input[type="submit"], input[type="button"], input[type="reset"], button:not(.hidden-text):not(.hosting-menu-toggle)
):disabled {
    cursor: not-allowed;
    opacity: .55;
    filter: none;
}

/* The old photo button overlay is replaced by the same transition used on form controls. */
:is(#tlumoceni-cz, #tlumoceni-hosting-cz) #more-photos.dalsi-obrazky {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

:is(#tlumoceni-cz, #tlumoceni-hosting-cz) #more-photos.dalsi-obrazky::before {
    content: none;
}

/* Do not render two buttons when a legacy decorative wrapper contains a submit input. */
:is(#tlumoceni-cz #page-content, #tlumoceni-hosting-cz #page-content) span.common-button:has(input[type="submit"]) {
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    box-shadow: none;
    margin-bottom: 0;
    filter: none;
}

:is(#tlumoceni-cz, #tlumoceni-hosting-cz) input[type="file"]::file-selector-button {
    margin-right: 12px;
}

/* Keep the original right/left alignment while allowing the larger labels to fit. */
#tlumoceni-cz.poptavka #submit-button,
#tlumoceni-cz.poptavka #submit-button.rozeslat {
    width: auto !important;
    height: auto !important;
}

/* Registration keeps the same spacing as other form actions. */
#tlumoceni-cz #registrace-form input[type="submit"] {
    margin-bottom: 40px !important;
}

/* Native file inputs otherwise retain the old 21px height and clip their button. */
:is(#tlumoceni-cz, #tlumoceni-hosting-cz) #contact-form input.attch_files,
#tlumoceni-cz .order-form input.attch_files {
    height: auto !important;
    min-height: 38px;
    line-height: normal;
    margin-top: 0;
    padding: 0;
    vertical-align: middle;
}

:is(#tlumoceni-cz, #tlumoceni-hosting-cz) #contact-form .attachment-row > :is(th, td) {
    vertical-align: middle;
    padding-top: 12px;
    padding-bottom: 40px;
}

:is(#tlumoceni-cz, #tlumoceni-hosting-cz) #contact-form input.attch_files::file-selector-button,
#tlumoceni-cz .order-form input.attch_files::file-selector-button {
    margin-bottom: 0;
    min-height: 36px;
    padding: 8px 12px !important;
    font-size: 13px !important;
}

/* Keep the search field and action on one row, centred against each other. */
#tlumoceni-cz #search-agency label {
    display: flex;
    align-items: center;
    gap: 8px;
}

#tlumoceni-cz #search-agency input#feedback {
    float: none;
    flex: 1;
    min-width: 0;
    width: auto;
}

#tlumoceni-cz #search-agency #submit-button {
    position: static;
    height: auto;
    flex: 0 0 auto;
}

#tlumoceni-cz #search-agency input.button-green {
    float: none;
    margin-top: 0 !important;
    margin-bottom: 0;
}

/* The fixed cookie bar keeps its own spacing. */
:is(#tlumoceni-cz, #tlumoceni-hosting-cz) .cc_btn {
    margin-bottom: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
    :is(#tlumoceni-cz, #tlumoceni-hosting-cz) :is(a, input, button),
    :is(#tlumoceni-cz, #tlumoceni-hosting-cz) input[type="file"]::file-selector-button {
        transition: none !important;
    }
}
