/**
 * MRM Ele Addon - Team section & page banner
 *
 * NOTE: this file deliberately avoids load-bearing `background-image`.
 * Elementor injects a lazy-load rule that blanks background-image on every
 * descendant of the 4th+ top-level container, so a gradient here would
 * silently flatten inside a real page. Photos are <img>, overlays are solid
 * background-color.
 */

/* ==========================================================================
   Shared tokens
   ========================================================================== */

.mrm-team,
.mrm-page-banner {
    --mrm-accent: #ff5722;
    --mrm-accent-dark: #e64a19;
    --mrm-ink: #1a1a1a;
    --mrm-muted: #666666;
    --mrm-card: #ffffff;
    --mrm-line: #e6e9ee;
    --mrm-radius: 16px;
    --mrm-cols: 3;
    --mrm-gap: 30px;
}

/* ==========================================================================
   Team section
   ========================================================================== */

.mrm-team {
    width: 100%;
}

/* --- Section header ------------------------------------------------------ */

.mrm-team-header {
    max-width: 760px;
    margin: 0 auto 46px;
    text-align: center;
}

.mrm-team-eyebrow {
    display: inline-block;
    margin: 0 0 12px;
    padding: 6px 16px;
    border-radius: 999px;
    background-color: rgba(255, 87, 34, 0.1);
    color: var(--mrm-accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1.4;
    text-transform: uppercase;
}

.mrm-team-title {
    margin: 0;
    color: var(--mrm-ink);
    font-size: 40px;
    line-height: 1.2;
    font-weight: 700;
}

.mrm-team-subtitle {
    margin: 14px 0 0;
    color: var(--mrm-muted);
    font-size: 16px;
    line-height: 1.7;
}

/* --- Grid ---------------------------------------------------------------- */

.mrm-team-grid {
    display: grid;
    grid-template-columns: repeat(var(--mrm-cols), minmax(0, 1fr));
    gap: var(--mrm-gap);
}

/* --- Group heading (used on the full team page) --------------------------- */

.mrm-team-group + .mrm-team-group {
    margin-top: 56px;
}

.mrm-team-group-title {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0 0 28px;
    color: var(--mrm-ink);
    font-size: 22px;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.mrm-team-group-title::before,
.mrm-team-group-title::after {
    content: "";
}

.mrm-team-group-title::before {
    flex: 0 0 28px;
    width: 28px;
    height: 3px;
    border-radius: 2px;
    background-color: var(--mrm-accent);
}

.mrm-team-group-title::after {
    flex: 1 1 auto;
    height: 1px;
    background-color: var(--mrm-line);
}

/* --- Hierarchy tree ------------------------------------------------------ */

/* One vertical spine runs down the centre. Each tier drops onto it, and a tier
   with several cards adds a horizontal bar with a short stub per card. All of
   it is borders and pseudo-elements - no background-image, which Elementor
   would blank out on a deep container. */

.mrm-team-tree {
    --mrm-node-w: 240px;
    --mrm-tier-gap: 44px;
    --mrm-branch: 26px;
    --mrm-connector: #d3d9e2;
}

.mrm-team-tier {
    position: relative;
    padding-top: var(--mrm-tier-gap);
}

.mrm-team-tier.is-root {
    padding-top: 0;
}

/* Spine segment from the tier above down to this tier. */
.mrm-team-tier::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: var(--mrm-tier-gap);
    margin-left: -1px;
    background-color: var(--mrm-connector);
}

.mrm-team-tier.is-root::before {
    display: none;
}

.mrm-team-tier-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--mrm-gap);
}

.mrm-team-node {
    position: relative;
    width: var(--mrm-node-w);
    max-width: 100%;
}

/* The single card at the top carries a little more weight. */
.mrm-team-tier.is-root .mrm-team-node {
    width: calc(var(--mrm-node-w) * 1.2);
}

/* Branch tier: horizontal bar across the row, stub down into each card. */
.mrm-team-tier.has-branch .mrm-team-node {
    padding-top: var(--mrm-branch);
}

.mrm-team-tier.has-branch .mrm-team-node::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: var(--mrm-branch);
    margin-left: -1px;
    background-color: var(--mrm-connector);
}

.mrm-team-tier.has-branch .mrm-team-node::after {
    content: "";
    position: absolute;
    top: 0;
    left: calc(var(--mrm-gap) / -2 - 1px);
    right: calc(var(--mrm-gap) / -2 - 1px);
    height: 2px;
    background-color: var(--mrm-connector);
}

/* The bar runs centre-of-first to centre-of-last, so the spine meets it. */
.mrm-team-tier.has-branch .mrm-team-node:first-child::after {
    left: 50%;
}

.mrm-team-tier.has-branch .mrm-team-node:last-child::after {
    right: 50%;
}

.mrm-team-tier-label {
    display: block;
    margin: 0 0 26px;
    color: var(--mrm-muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1.5;
    text-align: center;
    text-transform: uppercase;
}

/* --- Card ---------------------------------------------------------------- */

.mrm-team-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: var(--mrm-card);
    border: 1px solid var(--mrm-line);
    border-radius: var(--mrm-radius);
    overflow: hidden;
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.mrm-team-card:hover {
    transform: translateY(-6px);
    border-color: transparent;
    box-shadow: 0 18px 40px rgba(26, 26, 26, 0.14);
}

.mrm-team-photo {
    position: relative;
    overflow: hidden;
    background-color: #eef1f5;
    aspect-ratio: var(--mrm-photo-ratio, 4 / 5);
}

/* Fallback for browsers without aspect-ratio */
@supports not (aspect-ratio: 4 / 5) {
    .mrm-team-photo {
        padding-top: 125%;
    }

    .mrm-team-photo img {
        position: absolute;
        inset: 0;
    }
}

.mrm-team-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.6s ease;
}

.mrm-team-card:hover .mrm-team-photo img {
    transform: scale(1.06);
}

.mrm-team-body {
    position: relative;
    padding: 24px 22px 26px;
    text-align: center;
}

.mrm-team-body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 42px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background-color: var(--mrm-accent);
    transform: translateX(-50%);
    transition: width 0.35s ease;
}

.mrm-team-card:hover .mrm-team-body::before {
    width: 90px;
}

.mrm-team-role {
    display: block;
    margin-bottom: 8px;
    color: var(--mrm-accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    line-height: 1.5;
    text-transform: uppercase;
}

.mrm-team-name {
    margin: 0;
    color: var(--mrm-ink);
    font-size: 19px;
    line-height: 1.4;
    font-weight: 600;
    overflow-wrap: break-word;
}

.mrm-team-phone {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
    color: var(--mrm-muted);
    font-size: 14px;
    line-height: 1.5;
    text-decoration: none;
    transition: color 0.25s ease;
}

.mrm-team-phone:hover,
.mrm-team-phone:focus {
    color: var(--mrm-accent);
}

.mrm-team-phone svg {
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* --- "View more" link ----------------------------------------------------- */

.mrm-team-actions {
    margin-top: 46px;
    text-align: center;
}

/* Rendered as <a>, never <button>: hello-elementor's reset.css restyles every
   bare button on this site with a #c36 border that wins the tie on :focus. */
.mrm-team-more {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 34px;
    border: 2px solid var(--mrm-accent);
    border-radius: 999px;
    background-color: var(--mrm-accent);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.mrm-team-more:hover,
.mrm-team-more:focus {
    background-color: var(--mrm-accent-dark);
    border-color: var(--mrm-accent-dark);
    color: #ffffff;
    transform: translateY(-3px);
}

.mrm-team-more:focus-visible {
    outline: 3px solid rgba(255, 87, 34, 0.4);
    outline-offset: 3px;
}

.mrm-team-more svg {
    flex: 0 0 15px;
    width: 15px;
    height: 15px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.mrm-team-more:hover svg {
    transform: translateX(4px);
}

/* The theme underlines links inside Elementor widget containers, and that rule
   out-specifies a bare `.mrm-team-more { text-decoration: none }`. Qualify with
   the tag and state the hover/focus states explicitly rather than relying on
   the base rule to carry them. */
.mrm-team a.mrm-team-more,
.mrm-team a.mrm-team-more:hover,
.mrm-team a.mrm-team-more:focus,
.mrm-team a.mrm-team-phone,
.mrm-team a.mrm-team-phone:hover,
.mrm-team a.mrm-team-phone:focus {
    text-decoration: none;
}

/* ==========================================================================
   Page banner
   ========================================================================== */

.mrm-page-banner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 380px;
    padding: 70px 24px;
    overflow: hidden;
    background-color: var(--mrm-ink);
    text-align: center;
}

/* <img> rather than background-image, so Elementor's lazy-load rule cannot
   blank it out when the banner sits deep in the page. */
.mrm-page-banner-media {
    position: absolute;
    inset: 0;
    margin: 0;
}

.mrm-page-banner-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.mrm-page-banner-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(16, 18, 24, 0.6);
}

.mrm-page-banner-inner {
    position: relative;
    z-index: 1;
    max-width: 820px;
}

.mrm-page-banner-eyebrow {
    display: inline-block;
    margin: 0 0 14px;
    padding: 6px 16px;
    border-radius: 999px;
    background-color: var(--mrm-accent);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    line-height: 1.5;
    text-transform: uppercase;
}

.mrm-page-banner-title {
    margin: 0;
    color: #ffffff;
    font-size: 46px;
    line-height: 1.15;
    font-weight: 700;
}

.mrm-page-banner-text {
    margin: 16px auto 0;
    max-width: 640px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 17px;
    line-height: 1.7;
}

.mrm-page-banner-crumbs {
    margin-top: 22px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    line-height: 1.5;
}

.mrm-page-banner .mrm-page-banner-crumbs a,
.mrm-page-banner .mrm-page-banner-crumbs a:hover,
.mrm-page-banner .mrm-page-banner-crumbs a:focus {
    color: #ffffff;
    text-decoration: none;
}

.mrm-page-banner-crumbs a {
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

.mrm-page-banner-crumbs a:hover,
.mrm-page-banner-crumbs a:focus {
    border-bottom-color: #ffffff;
}

.mrm-page-banner-sep {
    margin: 0 8px;
    opacity: 0.6;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .mrm-team-title {
        font-size: 34px;
    }

    .mrm-page-banner {
        min-height: 320px;
    }

    .mrm-page-banner-title {
        font-size: 38px;
    }
}

@media (max-width: 767px) {
    .mrm-team-header {
        margin-bottom: 34px;
    }

    .mrm-team-title {
        font-size: 27px;
    }

    .mrm-team-subtitle {
        font-size: 15px;
    }

    .mrm-team-group + .mrm-team-group {
        margin-top: 40px;
    }

    .mrm-team-group-title {
        gap: 12px;
        margin-bottom: 22px;
        font-size: 18px;
    }

    /* Connectors assume a row that does not wrap, and nothing narrow enough to
       be a phone has room for one. Drop the lines and let the tree stack. */
    .mrm-team-tier::before,
    .mrm-team-tier.has-branch .mrm-team-node::before,
    .mrm-team-tier.has-branch .mrm-team-node::after {
        display: none;
    }

    .mrm-team-tier {
        padding-top: 28px;
    }

    .mrm-team-tier.has-branch .mrm-team-node {
        padding-top: 0;
    }

    .mrm-team-node,
    .mrm-team-tier.is-root .mrm-team-node {
        width: calc(50% - var(--mrm-gap) / 2);
    }

    .mrm-team-tier-label {
        margin-bottom: 20px;
    }

    .mrm-team-body {
        padding: 20px 16px 22px;
    }

    .mrm-team-name {
        font-size: 17px;
    }

    .mrm-team-actions {
        margin-top: 34px;
    }

    .mrm-team-more {
        padding: 14px 28px;
        font-size: 14px;
    }

    .mrm-page-banner {
        min-height: 260px;
        padding: 56px 20px;
    }

    .mrm-page-banner-title {
        font-size: 29px;
    }

    .mrm-page-banner-text {
        font-size: 15px;
    }
}

/* Two columns is the smallest that still reads as a grid; drop to one only
   below ~420px, where two cards would squeeze the longer names. */
@media (max-width: 419px) {
    .mrm-team-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .mrm-team-node,
    .mrm-team-tier.is-root .mrm-team-node {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mrm-team-card,
    .mrm-team-photo img,
    .mrm-team-body::before,
    .mrm-team-more,
    .mrm-team-more svg {
        transition: none;
    }

    .mrm-team-card:hover,
    .mrm-team-card:hover .mrm-team-photo img,
    .mrm-team-more:hover {
        transform: none;
    }
}
