/* MR Elements — header, dropdown nav, mobile drawer, footer.
   Tokens live in mr-pages.css; heights come from the Header settings (inline :root vars). */

:root {
    --mr-hdr-h: 110px;
    --mr-hdr-h-sticky: 80px;
    --mr-hdr-h-mobile: 76px;
    --mr-hdr-content-w: 1540px;
    --mr-logo-h: 78px;
    --mr-logo-h-sticky: 56px;
    --mr-logo-h-mobile: 48px;
}

body.mr-has-header { padding-top: var(--mr-hdr-h); }

.mr-main:focus { outline: none; }

.mr-skip-link {
    position: absolute;
    top: 8px;
    left: -9999px;
    z-index: 2000;
    padding: 12px 18px;
    font-family: var(--mr-font-body);
    color: var(--mr-river);
    background-color: var(--mr-white);
    border-radius: 3px;
}

.mr-skip-link:focus { left: 8px; }

/* ── Header ─────────────────────────────────────────────────────────── */

.mr-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1000;
    height: var(--mr-hdr-h);
    font-family: var(--mr-font-body);
    background-color: var(--mr-white);
    transition: height 0.3s ease, box-shadow 0.3s ease;
}

.mr-header.is-sticky {
    height: var(--mr-hdr-h-sticky);
    box-shadow: 0 6px 24px rgba(6, 59, 80, 0.08);
}

.mr-header__inner {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 24px;
    max-width: var(--mr-hdr-content-w);
    height: 100%;
    margin: 0 auto;
    padding: 0 var(--mr-gutter);
}

.mr-header__logo {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
}

.mr-header__logo img {
    display: block;
    width: auto;
    height: var(--mr-logo-h);
    max-width: none;
    transition: height 0.3s ease;
}

.mr-header.is-sticky .mr-header__logo img { height: var(--mr-logo-h-sticky); }

.mr-header__nav {
    margin-right: auto;
    margin-left: auto;
}

.mr-header__inner .mr-header__cta {
    flex-shrink: 0;
    padding: 13px 26px;
}

/* Desktop nav */
.mr-nav {
    display: flex;
    align-items: center;
    gap: clamp(10px, 1.8vw, 34px);
    margin: 0;
    padding: 0;
    list-style: none;
}

.mr-nav > li { position: relative; }

.mr-nav > li > a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 2px;
    font-size: 0.98rem;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    color: var(--mr-river);
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.mr-nav > li > a:hover,
.mr-nav > li > a:focus { color: var(--mr-orange-text); }

.mr-nav > .current-menu-item > a,
.mr-nav > .current-menu-parent > a,
.mr-nav > .current-menu-ancestor > a {
    border-bottom-color: var(--mr-orange);
}

.mr-nav > .menu-item-has-children > a::after {
    content: "";
    width: 6px;
    height: 6px;
    margin: -3px 0 0 2px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.mr-nav .sub-menu {
    position: absolute;
    top: 100%;
    left: -22px;
    z-index: 10;
    min-width: 250px;
    margin: 0;
    padding: 10px 0;
    list-style: none;
    background-color: var(--mr-white);
    border-top: 2px solid var(--mr-orange);
    border-radius: 0 0 6px 6px;
    box-shadow: 0 16px 40px rgba(6, 59, 80, 0.14);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.mr-nav > li:hover > .sub-menu,
.mr-nav > li:focus-within > .sub-menu,
.mr-nav > li.is-open > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.mr-nav > li:hover > a::after,
.mr-nav > li.is-open > a::after {
    transform: rotate(225deg) translate(-2px, -2px);
}

.mr-nav .sub-menu a {
    display: block;
    padding: 11px 24px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--mr-ink);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.mr-nav .sub-menu a:hover,
.mr-nav .sub-menu a:focus,
.mr-nav .sub-menu .current-menu-item > a {
    color: var(--mr-river);
    background-color: var(--mr-aqua);
}

.mr-nav a:focus-visible,
.mr-mnav a:focus-visible,
.mr-header__logo:focus-visible {
    outline: 3px solid var(--mr-water);
    outline-offset: 2px;
}

/* Burger */
.mr-header .mr-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 48px;
    height: 48px;
    margin: 0 -8px 0 auto;
    padding: 0;
    color: var(--mr-river);
    background: none;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

.mr-header .mr-burger:hover,
.mr-header .mr-burger:focus {
    color: var(--mr-river);
    background: none;
}

.mr-header .mr-burger:focus-visible { outline: 3px solid var(--mr-water); }

.mr-burger__bar {
    display: block;
    width: 26px;
    height: 2px;
    background-color: currentColor;
    border-radius: 2px;
}

/* ── Drawer ─────────────────────────────────────────────────────────── */

.mr-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1100;
    font-family: var(--mr-font-body);
}

.mr-drawer[hidden] { display: none; }

.mr-drawer__overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: var(--mr-overlay);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mr-drawer__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    width: min(400px, 100%);
    overflow-y: auto;
    background-color: var(--mr-cream);
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-overflow-scrolling: touch;
}

.mr-drawer.is-open .mr-drawer__overlay { opacity: 1; }

.mr-drawer.is-open .mr-drawer__panel { transform: none; }

.mr-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 14px 20px;
    background-color: var(--mr-white);
    border-bottom: 1px solid var(--mr-line);
}

.mr-drawer__logo img {
    display: block;
    width: auto;
    height: var(--mr-logo-h-mobile);
}

.mr-drawer .mr-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    color: var(--mr-river);
    background: none;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

.mr-drawer .mr-drawer__close:hover,
.mr-drawer .mr-drawer__close:focus {
    color: var(--mr-orange-text);
    background: none;
}

/* BUG-027 — explicit two-class size rule */
.mr-drawer__close svg {
    display: block;
    width: 24px;
    height: 24px;
}

.mr-mnav {
    margin: 0;
    padding: 6px 0;
    list-style: none;
}

.mr-mnav > li {
    position: relative;
    border-bottom: 1px solid var(--mr-line);
}

.mr-mnav a {
    display: block;
    padding: 16px 64px 16px 24px;
    font-size: 1.05rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--mr-river);
}

.mr-mnav .current-menu-item > a { color: var(--mr-orange-text); }

.mr-mnav .sub-menu {
    display: none;
    margin: 0;
    padding: 0 0 10px;
    list-style: none;
}

.mr-mnav .is-open > .sub-menu { display: block; }

.mr-mnav .sub-menu a {
    padding: 11px 24px 11px 40px;
    font-size: 1rem;
    font-weight: 400;
    color: var(--mr-ink);
}

.mr-mnav .mr-subtoggle {
    position: absolute;
    top: 5px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    color: var(--mr-river);
    background: none;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}

.mr-mnav .mr-subtoggle:hover,
.mr-mnav .mr-subtoggle:focus {
    color: var(--mr-river);
    background: none;
}

.mr-mnav .mr-subtoggle::before {
    content: "";
    width: 9px;
    height: 9px;
    margin-top: -5px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.mr-mnav .is-open > .mr-subtoggle::before {
    margin-top: 5px;
    transform: rotate(225deg);
}

/* Sticky CTA inside the scrolling drawer (BUG-028) */
.mr-drawer__footer {
    position: sticky;
    bottom: 0;
    margin-top: auto;
    padding: 20px 24px;
    background-color: var(--mr-cream);
    border-top: 1px solid var(--mr-line);
}

body.mr-drawer-open { overflow: hidden; }

/* Admin bar offsets */
.admin-bar .mr-header,
.admin-bar .mr-drawer { top: 32px; }

@media screen and (max-width: 782px) {
    .admin-bar .mr-header,
    .admin-bar .mr-drawer { top: 46px; }
}

/* ── Footer ─────────────────────────────────────────────────────────── */

.mr-footer {
    font-family: var(--mr-font-body);
    color: var(--mr-on-dark);
    background-color: var(--mr-river);
}

.mr-footer__inner {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr) minmax(0, 0.9fr) minmax(0, 1.3fr);
    gap: 40px 48px;
    max-width: 1400px;
    margin: 0 auto;
    padding: clamp(56px, 6vw, 88px) var(--mr-gutter) 48px;
}

.mr-footer a {
    color: var(--mr-on-dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

.mr-footer a:hover,
.mr-footer a:focus { color: var(--mr-white); text-decoration: underline; }

.mr-footer .mr-btn,
.mr-footer .mr-btn:hover,
.mr-footer .mr-btn:focus { color: var(--mr-white); text-decoration: none; }

.mr-footer__logo { display: inline-block; }

.mr-footer__logo img {
    display: block;
    width: auto;
    max-width: 260px;
    height: 72px;
}

.mr-footer__name {
    font-family: var(--mr-font-display);
    font-size: 2rem;
    font-weight: 500;
    line-height: 1.1;
    color: var(--mr-white);
}

.mr-footer__tagline {
    max-width: 26em;
    margin: 16px 0 20px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.mr-footer__contact,
.mr-footer__links,
.mr-footer__legal {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mr-footer__contact {
    display: grid;
    gap: 6px;
    font-size: 0.92rem;
    line-height: 1.55;
}

.mr-footer__heading {
    margin: 0 0 18px;
    font-family: var(--mr-font-body);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mr-water);
}

.mr-footer__links {
    display: grid;
    gap: 10px;
    font-size: 0.95rem;
}

.mr-footer__cta {
    align-self: start;
    padding: 28px;
    border: 1px solid var(--mr-on-dark-line);
    border-radius: 8px;
}

.mr-footer__cta-heading {
    margin: 0 0 10px;
    font-family: var(--mr-font-display);
    font-size: 1.75rem;
    font-weight: 500;
    line-height: 1.15;
    color: var(--mr-white);
}

.mr-footer__cta-text {
    margin: 0 0 20px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.mr-footer__bottom {
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px 24px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px var(--mr-gutter) 28px;
    font-size: 0.85rem;
    border-top: 1px solid var(--mr-on-dark-line);
}

.mr-footer__copy { margin: 0; }

.mr-footer__legal {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 1279px) and (min-width: 1025px) {
    :root { --mr-logo-h: 62px; }

    .mr-nav { gap: 14px; }

    .mr-nav > li > a { font-size: 0.9rem; }

    .mr-header__inner .mr-header__cta { padding: 12px 18px; }
}

@media (max-width: 1024px) {
    body.mr-has-header { padding-top: var(--mr-hdr-h-mobile); }

    .mr-header,
    .mr-header.is-sticky { height: var(--mr-hdr-h-mobile); }

    .mr-header__logo img,
    .mr-header.is-sticky .mr-header__logo img { height: var(--mr-logo-h-mobile); }

    .mr-header__nav,
    .mr-header__inner .mr-header__cta { display: none; }

    .mr-header .mr-burger { display: inline-flex; }

    .mr-footer__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .mr-footer__brand,
    .mr-footer__cta { grid-column: 1 / -1; }
}

@media (max-width: 767px) {
    .mr-footer__inner { grid-template-columns: minmax(0, 1fr); gap: 36px; }

    .mr-footer__bottom { flex-direction: column; }
}
