/* =============================================================
   THE FULCRUM REAL ESTATE - YOUR NEXT MOVE
   Production location: css/next_move.css

   Client-approved five pathways: Buy, Sell, Invest, Manage,
   Lifestyle. Content and destinations remain in next_move.php.

   Visual treatment follows the approved homepage reference:
   warm-white section, ivory cards, gold icon medallions, navy
   typography and gold navigation arrows.

   The icons overlap each card's top edge by half their height.
   Manage and Lifestyle options remain accessible without
   permanently expanding the cards. This stylesheet affects
   only the Your Next Move section.
   ============================================================= */

/* Keep section dimensions stable even without global box-sizing rules. */
.homepage-next-move,
.homepage-next-move *,
.homepage-next-move *::before,
.homepage-next-move *::after {
    box-sizing: border-box;
}

.homepage-next-move {
    --next-move-navy: #10233a;
    --next-move-gold: #b78637;
    --next-move-gold-dark: #94651f;
    --next-move-ink: #212b39;
    --next-move-muted: #536071;
    --next-move-card-border: #e7dfd4;

    position: relative;
    width: 100%;
    margin: 0;
    padding: clamp(64px, 6vw, 88px) 0 clamp(76px, 7vw, 104px);
    overflow: visible;
    background: #fdfcfb;
}

.homepage-next-move .container {
    width: 100%;
    max-width: 1390px;
    margin-right: auto;
    margin-left: auto;
    padding-right: clamp(22px, 4vw, 68px);
    padding-left: clamp(22px, 4vw, 68px);
}

/* The client-approved heading is preserved. */
.homepage-next-move-heading {
    margin: 0 0 clamp(78px, 6vw, 96px);
}

.homepage-next-move-heading h2 {
    margin: 0;
    color: #141b27;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(35px, 3.3vw, 49px);
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: -0.035em;
}

.homepage-next-move-heading h2::after {
    content: "";
    display: block;
    width: 64px;
    height: 2px;
    margin-top: 18px;
    background: var(--next-move-gold);
}

/* Card spacing leaves room for the icons above subsequent rows. */
.homepage-next-move-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    column-gap: clamp(13px, 1.35vw, 20px);
    row-gap: 76px;
    align-items: stretch;
    overflow: visible;
}

.homepage-next-move-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 260px;
    margin: 0;
    padding: 64px 20px 24px;
    overflow: visible;
    border: 1px solid var(--next-move-card-border);
    border-radius: 13px;
    background: linear-gradient(145deg, #fffdfa 0%, #f8f5f0 100%);
    box-shadow:
        0 16px 36px rgba(18, 31, 47, 0.095),
        0 3px 12px rgba(18, 31, 47, 0.04);
    overflow-wrap: break-word;
    transition:
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.homepage-next-move-card:hover,
.homepage-next-move-card:focus-within {
    z-index: 2;
    transform: translateY(-3px);
    border-color: #d4bb91;
    box-shadow:
        0 22px 44px rgba(18, 31, 47, 0.15),
        0 5px 15px rgba(18, 31, 47, 0.06);
}

/* Keep an opened options menu above neighbouring cards. */
.homepage-next-move-card:has(.homepage-next-move-disclosure[open]) {
    z-index: 10;
}

.homepage-next-move-card-link,
.homepage-next-move-card-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-width: 0;
    min-height: 0;
    color: var(--next-move-ink);
    text-align: center;
    text-decoration: none;
}

.homepage-next-move-card-link:hover,
.homepage-next-move-card-link:focus-visible {
    color: var(--next-move-ink);
    text-decoration: none;
}

.homepage-next-move-card-link:focus-visible {
    outline: 2px solid var(--next-move-gold-dark);
    outline-offset: 7px;
    border-radius: 3px;
}

/* Half of the larger medallion is above the card, half inside. */
.homepage-next-move-icon {
    position: absolute;
    z-index: 3;
    top: -42px;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    box-sizing: border-box;
    border: 4px solid #fdfcfb;
    border-radius: 50%;
    background: linear-gradient(145deg, #f8eddd, #ead6b6);
    color: var(--next-move-gold-dark);
    box-shadow:
        0 10px 24px rgba(53, 39, 20, 0.23),
        0 3px 9px rgba(53, 39, 20, 0.10);
    transform: translateX(-50%);
    pointer-events: none;
}

.homepage-next-move-icon svg {
    display: block;
    width: 39px;
    height: 39px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.homepage-next-move-icon i {
    color: inherit;
    font-size: 34px;
    line-height: 1;
}

.homepage-next-move-card h3 {
    margin: 0 0 12px;
    color: #1a2737;
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(15px, 1.07vw, 18px);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.02em;
    text-align: center;
}

.homepage-next-move-card p {
    margin: 0 0 23px;
    color: var(--next-move-muted);
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(12px, 0.91vw, 14px);
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
}

/* All five pathways retain their current call-to-action labels. */
.homepage-next-move-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: fit-content;
    max-width: 100%;
    min-height: 28px;
    margin: auto 0 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--next-move-gold-dark);
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(12px, 0.87vw, 13px);
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
}

.homepage-next-move-card-link .homepage-next-move-action span[aria-hidden="true"] {
    flex: 0 0 auto;
    font-size: 19px;
    font-weight: 400;
    line-height: 1;
    transition: transform 180ms ease;
}

.homepage-next-move-card-link:hover .homepage-next-move-action,
.homepage-next-move-card-link:focus-visible .homepage-next-move-action {
    color: var(--next-move-gold-dark);
}

.homepage-next-move-card-link:hover .homepage-next-move-action span[aria-hidden="true"] {
    transform: translateX(4px);
}

/*
   Manage and Lifestyle keep their client-requested options.
   On desktop these open as an overlay instead of elongating the card.
   Native details/summary keeps keyboard and touch interaction intact.
*/
.homepage-next-move-disclosure {
    position: relative;
    width: 100%;
    min-width: 0;
    margin: auto 0 0;
}

.homepage-next-move-disclosure summary.homepage-next-move-action {
    display: flex;
    width: 100%;
    min-height: 28px;
    margin: 0;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.homepage-next-move-disclosure summary::-webkit-details-marker {
    display: none;
}

.homepage-next-move-disclosure summary::marker {
    content: "";
}

.homepage-next-move-disclosure summary::after {
    content: "\2192";
    display: inline-block;
    flex: 0 0 auto;
    font-size: 19px;
    font-weight: 400;
    line-height: 1;
    transition: transform 180ms ease;
}

.homepage-next-move-disclosure summary:hover::after,
.homepage-next-move-disclosure[open] summary::after {
    transform: translateX(3px);
}

.homepage-next-move-disclosure summary:focus-visible {
    outline: 2px solid var(--next-move-gold-dark);
    outline-offset: 4px;
    border-radius: 3px;
}

.homepage-next-move-options {
    position: absolute;
    z-index: 10;
    top: calc(100% + 14px);
    left: 50%;
    width: min(282px, calc(100vw - 48px));
    margin: 0;
    padding: 17px 19px;
    border: 1px solid #e1d3bf;
    border-radius: 11px;
    background: #fffdfa;
    box-shadow: 0 18px 35px rgba(18, 31, 47, 0.16);
    list-style: none;
    text-align: left;
    transform: translateX(-50%);
}

.homepage-next-move-options li {
    margin: 0;
    color: #3c4a5a;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    line-height: 1.5;
}

.homepage-next-move-options li + li {
    margin-top: 11px;
}

.homepage-next-move-options a {
    color: var(--next-move-gold-dark);
    font-weight: 600;
    text-decoration: none;
    text-underline-offset: 3px;
}

.homepage-next-move-options a:hover,
.homepage-next-move-options a:focus-visible {
    color: var(--next-move-navy);
    text-decoration: underline;
}

.homepage-next-move-option-pending {
    color: #626e7a;
}

/* Hover previews are progressive; click and touch always work. */
@media (hover: hover) and (pointer: fine) {
    .homepage-next-move-card-manage:hover .homepage-next-move-disclosure:not([open])::details-content,
    .homepage-next-move-card-lifestyle:hover .homepage-next-move-disclosure:not([open])::details-content {
        content-visibility: visible;
    }
}

/* Medium desktop: three cards followed by two centered cards. */
@media (min-width: 992px) and (max-width: 1399.98px) {
    .homepage-next-move-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .homepage-next-move-card {
        grid-column: span 2;
        min-height: 230px;
    }

    .homepage-next-move-card:nth-child(4) {
        grid-column: 2 / span 2;
    }

    .homepage-next-move-card:nth-child(5) {
        grid-column: 4 / span 2;
    }

    .homepage-next-move-card h3 {
        font-size: 17px;
    }

    .homepage-next-move-card p {
        font-size: 13px;
    }
}

/* Tablet: two cards per row, with the fifth centered. */
@media (min-width: 576px) and (max-width: 991.98px) {
    .homepage-next-move-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 18px;
        row-gap: 75px;
    }

    .homepage-next-move-card {
        min-height: 220px;
    }

    .homepage-next-move-card:nth-child(5) {
        grid-column: 1 / -1;
        justify-self: center;
        width: min(100%, 410px);
    }

    .homepage-next-move-card h3 {
        font-size: 17px;
    }

    .homepage-next-move-card p {
        font-size: 14px;
    }
}

/*
   On mobile and tablet, expanded menus become in-flow panels so
   they push the next card down instead of covering touch targets.
*/
@media (max-width: 991.98px) {
    .homepage-next-move-options {
        position: static;
        width: 100%;
        margin: 15px 0 0;
        padding: 15px;
        box-shadow: 0 5px 17px rgba(18, 31, 47, 0.07);
        transform: none;
    }
}

/* Mobile: full-width cards with centered, half-overlapping icons. */
@media (max-width: 575.98px) {
    .homepage-next-move {
        padding: 54px 0 76px;
    }

    .homepage-next-move .container {
        padding-right: 20px;
        padding-left: 20px;
    }

    .homepage-next-move-heading {
        margin-bottom: 78px;
    }

    .homepage-next-move-heading h2 {
        font-size: clamp(34px, 9vw, 43px);
    }

    .homepage-next-move-grid {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 66px;
    }

    .homepage-next-move-card {
        min-height: 214px;
        padding: 57px 23px 24px;
    }

    .homepage-next-move-icon {
        top: -38px;
        width: 76px;
        height: 76px;
    }

    .homepage-next-move-icon svg {
        width: 35px;
        height: 35px;
    }

    .homepage-next-move-icon i {
        font-size: 30px;
    }

    .homepage-next-move-card h3 {
        font-size: 17px;
    }

    .homepage-next-move-card p {
        margin-bottom: 20px;
        font-size: 14px;
    }

    .homepage-next-move-action {
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .homepage-next-move-card,
    .homepage-next-move-card-link .homepage-next-move-action span[aria-hidden="true"],
    .homepage-next-move-disclosure summary::after {
        transition: none;
    }

    .homepage-next-move-card:hover,
    .homepage-next-move-card:focus-within {
        transform: none;
    }
}
