/*
 * ISM is now Midland Industries: header banner + full-screen modal.
 *
 * Shared by the ExpressionEngine site and Magento (/shop/). Served from the EE
 * web root at /assets/rebrand/, which Magento reaches on the same host.
 * Design: Sustena "Midland Acquisitions // Webpage Violators", October 2026.
 *
 * Everything is namespaced .ism-rebrand-* and resets the properties the two
 * sites style globally (h2, p, a, button), so neither site's CSS leaks in.
 */

:root {
    --ism-rebrand-red: #fe3300;
    --ism-rebrand-deep: #411f1f;
    --ism-rebrand-font: "owners-text", "Archivo", Arial, Helvetica, sans-serif;
}

/* The new header logo carries width/height attributes; keep its aspect ratio
   whatever width each site's header CSS gives it. */
img[src*="ism-is-now-midland"] {
    height: auto;
}

/* CMS header: its styles.css caps a.logo at max-width 99px !important from
   771px up, which shrank the new lockup to 90px. Match the shop's 130px logo
   (Magento: pause.css caps the image at 130px). */
@media only screen and (min-width: 771px) {
    header#header a.logo {
        max-width: 140px !important;
    }

    header#header a.logo img[src*="ism-is-now-midland"] {
        width: 130px;
        max-width: 130px;
    }
}

/* ---------- Banner ---------- */

.ism-rebrand-banner {
    position: relative;
    z-index: 50;
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: 10px 16px;
    background: var(--ism-rebrand-deep);
    border-bottom: 5px solid var(--ism-rebrand-red);
    font-family: var(--ism-rebrand-font);
    text-align: center;
}

.ism-rebrand-banner__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 20px;
}

.ism-rebrand-banner .ism-rebrand-banner__title {
    margin: 0;
    padding: 0;
    color: #fff;
    font-family: var(--ism-rebrand-font);
    font-size: 20px;
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: none;
}

.ism-rebrand-banner .ism-rebrand-banner__title strong {
    font-weight: 500;
}

/* ---------- Button (banner + modal) ---------- */

a.ism-rebrand-btn,
a.ism-rebrand-btn:visited {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
    margin: 0;
    padding: 7px 16px;
    border: 0;
    border-radius: 6px;
    background: var(--ism-rebrand-red);
    color: #fff;
    font-family: var(--ism-rebrand-font);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0;
    text-decoration: none;
    text-transform: none;
    white-space: nowrap;
    transition: background-color .15s ease;
}

a.ism-rebrand-btn:hover,
a.ism-rebrand-btn:focus {
    background: #d92b00;
    color: #fff;
    text-decoration: none;
}

a.ism-rebrand-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Long thin arrow from the design, drawn in CSS so it follows the text color. */
.ism-rebrand-arrow {
    position: relative;
    display: inline-block;
    flex: none;
    width: 30px;
    height: 2px;
    background: currentColor;
}

.ism-rebrand-arrow::after {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    width: 8px;
    height: 8px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: translateY(-50%) rotate(45deg);
    transform-origin: center;
    box-sizing: border-box;
}

/* ---------- Modal ---------- */

html.ism-rebrand-modal-open,
html.ism-rebrand-modal-open body {
    overflow: hidden;
}

.ism-rebrand-modal {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 16px;
    background: rgba(20, 12, 12, .6);
    font-family: var(--ism-rebrand-font);
    opacity: 0;
    transition: opacity .2s ease;
}

.ism-rebrand-modal.is-visible {
    opacity: 1;
}

.ism-rebrand-modal__dialog {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 760px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 56px 60px 52px;
    background: var(--ism-rebrand-deep);
    border: 2px solid var(--ism-rebrand-red);
    border-radius: 10px;
    color: #fff;
    text-align: left;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}

.ism-rebrand-modal__dialog:focus {
    outline: none;
}

.ism-rebrand-modal .ism-rebrand-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 30px;
    font-weight: 400;
    line-height: 44px;
    text-align: center;
    cursor: pointer;
    opacity: .8;
    box-shadow: none;
}

.ism-rebrand-modal .ism-rebrand-modal__close:hover,
.ism-rebrand-modal .ism-rebrand-modal__close:focus-visible {
    opacity: 1;
    background: rgba(255, 255, 255, .12);
    outline: none;
}

.ism-rebrand-modal .ism-rebrand-modal__logo {
    display: block;
    width: 256px;
    max-width: 100%;
    height: auto;
    margin: 0 0 44px;
    border: 0;
}

/* The text column lines up with the "Midland" wordmark, as in the design. */
.ism-rebrand-modal__body {
    padding-left: 72px;
}

.ism-rebrand-modal .ism-rebrand-modal__title {
    margin: 0 0 18px;
    padding: 0;
    color: #fff;
    font-family: var(--ism-rebrand-font);
    font-size: 26px;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: 0;
    text-transform: none;
}

.ism-rebrand-modal .ism-rebrand-modal__title strong {
    font-weight: 500;
}

.ism-rebrand-modal .ism-rebrand-modal__text {
    /* Narrower than the column so the lines break as in the design
       ("...into one / partner — the right parts..."). */
    max-width: 34em;
    margin: 0 0 26px;
    padding: 0;
    color: #fff;
    font-family: var(--ism-rebrand-font);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0;
}

/* The button sits lower than the tagline, as in the design. */
.ism-rebrand-modal__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.ism-rebrand-modal__footer .ism-rebrand-modal__cta {
    margin-top: 34px;
}

.ism-rebrand-modal .ism-rebrand-modal__tagline {
    margin: 0;
    padding: 0;
    color: #fff;
    font-family: var(--ism-rebrand-font);
    font-size: 20px;
    font-weight: 500;
    line-height: 1.3;
}

/* ---------- Small screens ---------- */

@media (max-width: 767px) {
    .ism-rebrand-banner {
        padding: 8px 12px;
    }

    .ism-rebrand-banner .ism-rebrand-banner__title {
        font-size: 16px;
    }

    a.ism-rebrand-btn,
    a.ism-rebrand-btn:visited {
        font-size: 13px;
        gap: 10px;
        white-space: normal;
        text-align: left;
    }

    .ism-rebrand-arrow {
        width: 22px;
    }

    .ism-rebrand-modal__dialog {
        padding: 48px 24px 28px;
    }

    .ism-rebrand-modal .ism-rebrand-modal__logo {
        width: 190px;
        margin-bottom: 28px;
    }

    .ism-rebrand-modal__body {
        padding-left: 0;
    }

    .ism-rebrand-modal .ism-rebrand-modal__title {
        font-size: 21px;
    }

    .ism-rebrand-modal .ism-rebrand-modal__text {
        font-size: 15px;
    }

    .ism-rebrand-modal .ism-rebrand-modal__tagline {
        font-size: 17px;
    }

    .ism-rebrand-modal__footer .ism-rebrand-modal__cta {
        margin-top: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ism-rebrand-modal,
    a.ism-rebrand-btn {
        transition: none;
    }
}
