/*
 * DiMardes brand layer.
 * Load after all legacy and page-specific styles, including mainblue.css.
 */

:root {
    --color-brand-primary: #285D50;
    --color-ink-strong: #202725;
    --color-brand-strong: var(--color-ink-strong);
    --color-brand-hover: #347565;
    --color-brand-mist: #DCE6E1;
    --color-brand-soft: var(--color-brand-mist);
    --color-accent-warm: #B28B60;
    --color-border-warm: #D6CFC3;
    --color-border-subtle: var(--color-border-warm);
    --color-text: #17211E;
    --color-text-muted: #586560;
    --color-surface: #FFFFFF;
    --color-surface-primary: var(--color-surface);
    --color-surface-warm: #F7F3EB;
    --color-surface-stone: #EEE8DE;
    --color-surface-muted: var(--color-surface-stone);
    --color-text-primary: var(--color-text);
    --color-border-emphasis: var(--color-brand-primary);
    --color-focus-ring: var(--color-brand-primary);
    --color-focus-on-dark: var(--color-brand-mist);
    --color-danger: #A00202;
    --shadow-brand-soft: 0 8px 24px rgba(32, 39, 37, 0.12);
    --shadow-header: 0 4px 16px rgba(32, 39, 37, 0.08);
    --shadow-focus: 0 0 0 3px rgba(40, 93, 80, 0.24);
    --space-unit: 8px;
    --page-gutter: 24px;
    --header-link-weight: 500;
    --icon-contact-size: 16px;
    --layer-header: 4;
    --type-body-size: 1rem;
    --type-body-line-height: 1.6;
    --type-meta-size: 0.8125rem;
    --type-meta-line-height: 1.45;
    --radius-small: 2px;
    --border-frame: 2px;
    --border-registration: 3px;
    --registration-shell: clamp(96px, 12vw, 180px);
    --motion-fast: 180ms;
    --motion-base: 240ms;
    --ease-standard: cubic-bezier(0.2, 0.7, 0.2, 1);
}

html {
    accent-color: var(--color-brand-primary);
}

body {
    color: var(--color-text);
    background: var(--color-surface);
}

::selection {
    color: var(--color-surface);
    background: var(--color-brand-primary);
}

input,
textarea,
select {
    caret-color: var(--color-brand-primary);
}

input::placeholder,
textarea::placeholder {
    color: var(--color-text-muted);
    opacity: 1;
}

a,
button,
input,
textarea,
select,
.select2-selection,
.small-box {
    transition:
        color 180ms ease,
        background-color 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease,
        transform 180ms ease;
}

:where(a, button, input, textarea, select, [tabindex]):focus-visible {
    outline: 3px solid var(--color-surface) !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 5px var(--color-brand-primary) !important;
}

/* Header and navigation */
.phone-language-box {
    background: var(--color-text) !important;
    border-bottom: var(--border-frame) solid var(--color-accent-warm);
}

.navigation-wrap {
    background: var(--color-surface-warm) !important;
    border-bottom: var(--border-frame) solid var(--color-border-warm);
    box-shadow: var(--shadow-header);
}

.navigation-wrap::after {
    position: absolute;
    bottom: calc(-1 * var(--border-registration));
    left: 0;
    width: var(--registration-shell);
    height: var(--border-registration);
    background: var(--color-accent-warm);
    content: "";
}

.dropdown-menu,
.nav-wrap.active {
    background: var(--color-ink-strong) !important;
}

.dropdown-menu {
    border-top: var(--border-registration) solid var(--color-accent-warm);
    box-shadow: var(--shadow-brand-soft);
}

.navigation-wrap > .site-wrap .nav-link {
    color: var(--color-text-primary) !important;
}

.navigation-wrap .nav-wrap > ul {
    display: flex;
    align-items: center;
    margin: 0;
}

.navigation-wrap .nav-wrap > ul > .nav-item > .nav-link {
    padding-bottom: var(--space-unit);
    border-bottom: var(--border-frame) solid transparent;
    font-weight: var(--header-link-weight);
}

.navigation-wrap .nav-wrap > ul > .nav-item > .nav-link:hover,
.navigation-wrap .nav-wrap > ul > .nav-item > .nav-link:focus-visible,
.navigation-wrap .nav-wrap > ul > .nav-item > .nav-link.active {
    border-bottom-color: var(--color-brand-primary);
}

.navigation-wrap > .site-wrap,
.phone-language-box > .site-wrap {
    box-sizing: border-box;
    padding-right: var(--page-gutter);
    padding-left: var(--page-gutter);
}

.dropdown-menu a,
.navigation-wrap .dropdown-menu .nav-link,
.nav-wrap.active .nav-link,
.phone-language-box a {
    color: var(--color-surface-warm) !important;
}

.navigation-wrap > .site-wrap .nav-link:hover,
.navigation-wrap > .site-wrap .nav-link:focus-visible {
    color: var(--color-brand-primary) !important;
}

.dropdown-menu a:hover,
.dropdown-menu a:focus-visible,
.navigation-wrap .dropdown-menu .nav-link:hover,
.navigation-wrap .dropdown-menu .nav-link:focus-visible,
.nav-wrap.active .nav-link:hover,
.nav-wrap.active .nav-link:focus-visible {
    color: var(--color-brand-mist) !important;
}

.nav-link.dropdown-link::after {
    top: 2px;
    width: 8px;
    height: 8px;
    background: none !important;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(45deg);
    transform-origin: center;
}

.nav-link.dropdown-link.active::after {
    top: 6px;
    transform: rotate(225deg);
}

/*
 * The supplied logo has a 420x200 transparent canvas while its visible mark is
 * approximately 3:1. The shallow shell crops only transparent canvas; no
 * background plate, border, or shadow is applied to the mark.
 */
.logo-wrap-small {
    width: 260px;
    height: 74px;
    overflow: hidden;
    background: transparent;
    border: 0;
    box-sizing: border-box;
    box-shadow: none;
    margin-top: 0;
}

.logo-wrap-small > a {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.logo-wrap-small img,
.footer .logo img,
.centered-info .logo img,
.print-brand-logo > img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none !important;
    object-fit: cover;
    object-position: center;
}

.menu-btn {
    width: 44px;
    height: 44px;
    padding: 8px;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    margin: 5px auto;
    background: var(--color-text-primary);
    transform-origin: center;
    transition:
        transform var(--motion-fast) var(--ease-standard),
        opacity var(--motion-fast) var(--ease-standard);
}

.menu-btn.animate span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-btn.animate span:nth-child(2) {
    opacity: 0;
}

.menu-btn.animate span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Footer and alternate logo placements */
.footer {
    background: var(--color-surface-stone) !important;
    border-top: 4px solid var(--color-brand-primary) !important;
    margin-top: 0 !important;
    padding-top: calc(var(--space-unit) * 5) !important;
}

.footer .column {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: start;
    gap: calc(var(--space-unit) * 2);
}

.footer .colum {
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 0 calc(var(--space-unit) * 2);
}

.footer .bottom-footer {
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-unit) calc(var(--space-unit) * 3);
    height: auto;
    min-height: calc(var(--space-unit) * 7.5);
    padding: calc(var(--space-unit) * 2);
    box-sizing: border-box;
    line-height: var(--type-body-line-height);
}

.footer .footer-legal {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-unit);
}

.footer .footer-legal .left {
    float: none;
}

.footer .logo {
    display: block;
    width: 200px;
    max-width: 200px !important;
    height: 68px;
    overflow: hidden;
    background: transparent;
    border: 0;
    box-sizing: border-box;
    box-shadow: none;
}

.centered-info .logo img {
    width: 230px;
    height: 78px;
    margin: 0 auto;
    background: transparent;
    border: 0;
    box-sizing: border-box;
    box-shadow: none;
}

.print-brand-logo {
    width: 230px;
    height: 78px;
    padding: 0 !important;
    overflow: hidden;
    background: transparent !important;
    border: 0;
    box-sizing: border-box;
}

.footer .colum .title:before {
    background-color: var(--color-accent-warm) !important;
}

.inp-f button {
    background-color: var(--color-brand-primary) !important;
}

.footer .colum .title,
.footer .colum span,
.footer .email,
.footer .phone-f,
.footer .phone-mobile,
.footer .phone-mobile-icon,
.footer .bottom-footer span,
.footer .bottom-footer a {
    color: var(--color-text-primary) !important;
}

.footer .bottom-footer {
    border-top-color: var(--color-border-warm);
}

.footer .first-email.email::before {
    background: var(--color-text-primary) !important;
    -webkit-mask: url("../img/email.svg") no-repeat center;
    mask: url("../img/email.svg") no-repeat center;
    -webkit-mask-size: var(--icon-contact-size);
    mask-size: var(--icon-contact-size);
}

.footer .phone-mobile,
.footer .phone-mobile-icon {
    border-color: var(--color-brand-primary);
}

.footer .phone-mobile-icon::before,
.footer .phone-mobile-icon:hover::before {
    background-image: url("../img/phone-new-hover.svg") !important;
}

.footer .inp-f input {
    background: var(--color-surface-primary);
    border: 1px solid var(--color-border-warm);
}

.brand-promise {
    margin-top: 24px;
}

.brand-promise span {
    color: var(--color-text-muted) !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.footer-separator {
    color: var(--color-accent-warm);
    margin: 0 15px;
}

.inp-f button:hover,
.inp-f button:focus-visible {
    background-color: var(--color-brand-hover) !important;
}

.colum .phone-f:hover,
.colum .phone-mobile:hover,
.footer .email:hover {
    color: var(--color-brand-primary) !important;
}

.colum .phone-mobile:hover,
.colum .phone-mobile-icon:hover {
    border-color: var(--color-brand-hover) !important;
}

.mobile-phone-icon {
    background: var(--color-brand-primary) !important;
    animation-name: dimardes-pulse !important;
}

.mobile-phone-icon:hover,
.mobile-phone-icon:focus-within {
    background: var(--color-brand-strong) !important;
}

@keyframes dimardes-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 93, 80, 0.58);
    }
    55% {
        box-shadow: 0 0 0 15px rgba(40, 93, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 93, 80, 0);
    }
}

/* Responsive transparent logo thresholds. */
@media screen and (max-width: 900px) {
    .logo-wrap-small {
        width: 205px;
        height: 58px;
    }

    .footer .logo {
        width: 180px;
        height: 58px;
    }

    .centered-info .logo img {
        width: 220px;
        height: 64px;
    }
}

@media screen and (max-width: 1024px) {
    .footer .column {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: calc(var(--space-unit) * 4);
    }
}

@media screen and (max-width: 560px) {
    .footer {
        padding-top: calc(var(--space-unit) * 4) !important;
    }

    .footer .column {
        grid-template-columns: 1fr;
        gap: calc(var(--space-unit) * 3);
    }

    .footer .bottom-footer {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
    }

    .footer .footer-legal {
        align-items: flex-start;
    }
}

@media screen and (max-width: 680px) {
    .nav-wrap.active {
        top: 58px;
        width: 100%;
        padding: 16px 20px;
        box-sizing: border-box;
        box-shadow: var(--shadow-brand-soft);
    }

    .nav-wrap.active .nav-link.dropdown-link::after {
        top: 14px;
    }

    .nav-wrap.active .nav-link.dropdown-link.active::after {
        top: 17px;
    }

    .navigation-wrap .nav-wrap.active > ul {
        display: block;
    }

    .navigation-wrap .nav-wrap.active > ul > .nav-item > .nav-link:hover,
    .navigation-wrap .nav-wrap.active > ul > .nav-item > .nav-link:focus-visible,
    .navigation-wrap .nav-wrap.active > ul > .nav-item > .nav-link.active {
        border-bottom-color: var(--color-accent-warm);
    }
}

@media screen and (max-width: 500px) {
    .logo-wrap-small {
        width: 168px;
        height: 48px;
    }

    .centered-info .logo img {
        width: 168px;
        height: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html:focus-within {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .mobile-phone-icon {
        animation: none !important;
    }

    .small-box:hover img,
    .small-box:focus-within img {
        transform: none !important;
    }
}

@media (forced-colors: active) {
    .logo-wrap-small,
    .footer .logo,
    .centered-info .logo img {
        border: 1px solid CanvasText;
        box-shadow: none;
    }

    :where(a, button, input, textarea, select, [tabindex]):focus-visible {
        outline-color: Highlight !important;
        box-shadow: none !important;
    }
}
