﻿/* ===============================
   Investment Profiles Tabs 
   =============================== */

/* --- Tokens (provide sensible defaults) --- */
:root {
    --radius: 6px;
    --brand: #0070C4;
    --accent-blue: #0070C4;
    --brand10: rgba(0,112,196,0.08);
    --muted: #6b7280;
    --line: #e5e7eb;
    --tab-ease: cubic-bezier(.22,.61,.36,1);
    --tab-fast: 160ms;
    --tab-brand: #0070C4;
    --tab-muted: #6b7280;
}

/* Smooth transitions for common properties 
*,
*::before,
*::after {
    transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}*/


html {
    scroll-behavior: smooth;
}

.tabs-wrapper {
    width: 100%;
}

.tab-navigation-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: start;
}

/* -------- Desktop & Wide: exactly 8 across --------  grid-template-columns: repeat(8, minmax(104px, 1fr)); */
.tab-navigation.tab-grid {
    display: grid !important;
    width: 100%;
    height: 175px;
    gap: .75rem;
    align-items: stretch;
    justify-items: stretch;
    overflow: visible;
}

/* --- Tab button (single, de-duped) --- */
.tab-buttonIP {
    position: relative;
    width: 100%;
    min-width: 104px;
    width: 100%;
    max-width: 150px;
    height: 150px;
    padding: .5rem .25rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 1;
    overflow: visible; /* arrow outside bottom */
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    cursor: pointer;
    will-change: transform, box-shadow, background-color, border-color;
    transition: transform .18s ease, background-color .25s ease, border-color .25s ease, box-shadow .25s ease;
}

    .tab-buttonIP:hover {
        box-shadow: 0 4px 12px rgba(0,0,0,.08);
    }

    .tab-buttonIP.active {
        background: var(--brand);
        border-color: var(--brand);
        box-shadow: 0 8px 18px rgba(13,112,192,.18);
        transition: transform .18s ease, background-color .22s ease, border-color .22s ease, box-shadow .22s ease;
    }

    .tab-buttonIP:focus-visible {
        outline: none;
        border-color: var(--brand);
        box-shadow: 0 0 0 3px rgba(13,112,192,.18), 0 2px 10px rgba(0,0,0,.06);
    }

    /* --- Arrow (single, de-duped) --- */
    .tab-buttonIP::after {
        content: "";
        position: absolute;
        bottom: -10px;
        left: 50%;
       
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-top: 10px solid var(--brand);
        opacity: 0;
        transform: translate(-50%, 4px);
        transition: opacity .22s ease, transform .22s ease;
    }

    .tab-buttonIP.active::after {
        opacity: 1;
        transform: translate(-50%, 0);
    }

/* --- Icon wrappers & swap --- */
.tab-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .25s ease, opacity .25s ease;
}

.tab-navigation img.tab-icon-portrait {
    width: 40px;
    height: auto;
}

.tab-buttonIP .tab-icon-wrapper.active {
    display: none;
    opacity: 0;
}

.tab-buttonIP .tab-icon-wrapper.non-active {
    display: flex;
    opacity: 1;
}

/* --- Icon: quick pop when state changes (works even with display swap) --- */
@keyframes ip-pop {
    0% {
        transform: scale(.94);
        opacity: .6;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.tab-buttonIP.active .tab-icon-wrapper.active {
    display: flex;
    opacity: 1;
    background: transparent;
    animation: ip-pop .16s ease both;
}

.tab-buttonIP.active .tab-icon-wrapper.non-active {
    display: none;
    opacity: 0;
}


/* --- Labels --- */
.tab-label-profiles {
    margin-top: .5rem;
    color: var(--muted);
    font-size: .86rem;
    line-height: 1.4em;
    text-align: center;
    font-weight: 700;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2; /* show only 2 lines */
    overflow: hidden;
    white-space: normal;
    max-width: 150px;
    text-wrap: balance;
    min-height: 55px;
    transition: color .18s ease;
}

.tab-buttonIP.active .tab-label-profiles {
    color: #fff;
    font-weight: 700;
}




/* --- Hover polish --- */
@media (hover:hover) {
    .tab-buttonIP:not(.active):hover {
        background: var(--brand10);
        border-color: var(--line);
        transform: translateY(-1px);
        box-shadow: 0 6px 18px rgba(0,0,0,.06);
    }

    .tab-buttonIP:hover .tab-icon-wrapper {
        transform: scale(1.05);
    }
}

/* ===============================
   OUTER PANELS (display: block/none)
   =============================== */
.tab-navigation-wrapper {
    scroll-margin-top: 72px;
}
/* sticky offset */

.container.section > .tab-content {
    display: none;
}

    .container.section > .tab-content.active {
        display: block;
    }

    /* Optional subtle enter animation (visibility unaffected) */
    .container.section > .tab-content.pre-animate {
        display: block;
        opacity: 0;
        transform: translateY(6px);
    }

    .container.section > .tab-content.animate-in {
        opacity: 1;
        transform: translateY(0);
        transition: opacity .22s ease, transform .22s ease;
    }

@media (prefers-reduced-motion: reduce) {
    .tab-buttonIP, .tab-buttonIP::after, .tab-icon-wrapper,
    .container.section > .tab-content.animate-in {
        transition: none !important;
    }
}

/* ===============================
   Responsive sizing
   =============================== */
@media (max-width:1366px) {
    .tab-navigation.tab-grid {
        grid-template-columns: repeat(8, minmax(150px,1fr));
        gap: .65rem;
    }

    .tab-buttonIP {
        min-width: 150px;

        height: 150px;
    }

    .tab-icon-wrapper {
        width: 60px;
        height: 60px;
    }

    .tab-navigation img.tab-icon-portrait {
        width: 36px;
    }

    .tab-label-profiles {
        font-size: .84rem;
        max-width: 96px;
    }
}

@media (max-width:1200px) {
    .tab-navigation.tab-grid {
        grid-template-columns: repeat(8, minmax(150px,1fr));
        gap: .6rem;
    }

    .tab-buttonIP {
        min-width:150px;

        height: 150px;
    }

    .tab-icon-wrapper {
        width: 56px;
        height: 56px;
    }

    .tab-navigation img.tab-icon-portrait {
        width: 34px;
    }

    .tab-label-profiles {
        font-size: .82rem;
        max-width: 90px;
    }
}

@media (max-width:1024px) {
    .tab-navigation.tab-grid {
        grid-template-columns: repeat(4, minmax(150px,1fr));
        gap: .875rem;
        grid-template-columns: 1fr;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(150px, 1fr);
        gap: .75rem;
        align-items: stretch;
        justify-items: stretch;
    }

    .tab-buttonIP {
        min-width: 150px;
        max-width:150px;
        height: 150px;
    }

    .tab-icon-wrapper {
        width: 56px;
        height: 56px;
    }

    .tab-navigation img.tab-icon-portrait {
        width: 32px;
    }
}

@media (max-width:680px) {
    .tab-navigation.tab-grid {
        grid-template-columns: repeat(2, minmax(150px,1fr));
        gap: .75rem;
    }

    .tab-buttonIP {
        height: 150px;
        min-width: 150px;
        width: 100%;
        max-width: 150px;
        border: 1px solid rgba(0, 112, 196,0.06);
        background: linear-gradient(45deg, #f7f7f7, #fafafa);
        box-shadow: 0 1px 1px rgba(0,0,0,.08);
    }

    .tab-icon-wrapper {
        width: 48px;
        height: 48px;
    }

    .tab-navigation img.tab-icon-portrait {
        width: 28px;
    }

    .tab-label-profiles {
        font-size: .8rem;
        max-width: 88px;
    }

    .tab-buttonIP.active::after {
        bottom: -8px;
        border-left-width: 8px;
        border-right-width: 8px;
        border-top-width: 8px;
    }
}



@media (max-width:380px) {
    .tab-navigation.tab-grid {
  
    grid-template-columns: 1fr;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(150px, 1fr);
    gap: .75rem;
    align-items: stretch;
    justify-items: stretch;

    }

    .tab-buttonIP {
        height: 150px;
        min-width:150px;
        width:100%;
        max-width:150px;
    }

    .tab-icon-wrapper {
        width: 44px;
        height: 44px;
    }

    .tab-navigation img.tab-icon-portrait {
        width: 26px;
    }

    .tab-label-profiles {
        max-width: 100%;
    }
}

/* ===============================
   Inner (Bootstrap) block styles
   =============================== */
.idh-wrap {
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,.06),0 8px 20px rgba(0,0,0,.05);
    padding: 1rem 1.25rem;
}

.idh-tabs.nav-tabs {
    border-bottom: 1px solid rgba(0,0,0,.1);
    margin-bottom: 1rem;
    gap: .25rem;
}

.idh-tabs .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    color: #495057;
    padding: .5rem .75rem;
    font-weight: 600;
    background: transparent !important;
}

    .idh-tabs .nav-link.active {
        color: #0d6efd;
        border-color: #0d6efd;
    }

/* CTA */
.btn-idh-profile {
    --idh-blue: #0077CD;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: var(--idh-blue);
    color: #fff;
    border: 0;
    padding: .9rem 1.25rem;
    border-radius: 6px;
    font-weight: 700;
   
     box-shadow: 0 4px 8px rgba(0,0,0,.15);
}

    .btn-idh-profile:hover, .btn-idh-profile:focus {
        background: #007aCD;
        transform: translateX(0px);
        box-shadow: 0 4px 8px rgba(0,0,0,.15);
        color: #fff;
    }

/* KPI stats */
.idh-stats {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: stretch;
    gap: .75rem;
}

@media (min-width:768px) {
    .idh-stats {
        flex-wrap: nowrap;
    }
}

.stat-block {
    flex: 1 1 140px;
    min-width: 120px;
    background: rgba(0,0,0,.03);
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,.03);
    padding: .75rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all .25s ease;
}

    .stat-block:hover {
        border-color: rgba(0,0,0,.18);
        box-shadow: 0 3px 8px rgba(0,0,0,.12);
    }

    .stat-block .icon {
        margin-bottom: .4rem;
    }

.tab-icon-stat {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.stat-value {
    font-weight: 700;
    font-size: clamp(.9rem,1.5vw,1.25rem);
    color: #1b1f23;
    margin-bottom: .15rem;
}

.stat-label {
    font-size: clamp(.7rem,1.1vw,.9rem);
    color: #6b7280;
    margin-bottom: .15rem;
}

.stat-year {
    font-size: clamp(.65rem,1vw,.8rem);
    color: #9ca3af;
}


/* Default for all tab icons */
.tab-navigation img.tab-icon-portrait {
    height: 40px; /* uniform baseline for landscape icons */
    width: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Special case: first tab's portrait-style icon */
.tab-navigation .tab-buttonIP:first-child img.tab-icon-portrait {
    height: 52px; /* taller proportion */
    margin-top: -2px; /* gentle vertical nudge */
}


.tab-navigation .tab-buttonIP:first-child .tab-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 4px; /* adjust as needed */
}












/* Shell: arrows outside, rail centered */
.ip-tabs {
    display: grid;
    grid-template-columns: auto 1fr auto; /* [←] [rail] [→] */
    align-items: center;
    gap: 0;
    position:relative;
    width:91%;
}

/* Viewport is the scroll window */
.ip-viewport {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    outline: none;
}

    .ip-viewport::-webkit-scrollbar {
        display: none;
    }

/* Rail: horizontal grid that shows 8/4/2 per “page” */
.ip-rail {
    --gap: .75rem;
    display: grid;
    gap: var(--gap);
    grid-auto-flow: column;
    grid-template-columns: none;
    /* Desktop: 8 visible */
    grid-auto-columns: calc((100% - (7 * var(--gap))) / 8);
    padding: .25rem 0; /* tiny breathing room so shadows aren’t clipped */
}

/* Tablet: 4 visible */
@media (max-width:1024px) {
    .ip-rail {
        grid-auto-columns: calc((100% - (3 * var(--gap))) / 4);
    }
}

/* Mobile: 2 visible */
@media (max-width:680px) {
    .ip-rail {
        grid-auto-columns: calc((100% - (1 * var(--gap))) / 2);
    }
}

/* Very small: 1 per row */
@media (max-width:380px) {
    .ip-rail {
        grid-auto-columns: 100%;
    }
}

/* Cards (keep super simple) */
.ip-card {
    min-width: 0; /* don’t fight rail math */
    height: 120px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .5rem;
    text-align: center;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
}

    .ip-card:focus {
        outline: 2px solid #0070C4;
        outline-offset: 2px;
    }

/* Arrows: JS toggles .ip-visible and [disabled] */
.ip-arrowOlder {
    width: 20px;
    height: calc(100% - 20px);
    border: 0;
    border-radius: 2px;
    background: #eee;
    color: #0070C4;
    box-shadow: 0;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .15s ease, visibility .15s ease;
    user-select: none;
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE10+ */
}


.ip-arrow:first-child:hover {
    background: rgba(0, 112, 196,0.75);
    color: #fff;
    box-shadow: 0 0 1px 1px inset rgba(0,0,0,0.85);
}

.ip-arrow:last-child:hover {
    background: rgba(0, 112, 196,0.75);
    color: #fff;
    box-shadow: 0 0 1px 1px inset rgba(0,0,0,0.85);
}


.ip-arrow:first-child {
    position: absolute;
    left: -44px;
    top: 60px;
    border: 1px solid transparent;
}


.ip-arrow:last-child {
    position: absolute;
    right: -44px;
    top: 60px;
    border: 1px solid transparent;
}

@media (max-width: 433px) {
    .ip-arrow:first-child {
        left: 4px; /* keep small safe padding from screen edge */
        top: -40px; /* lower placement for shorter viewports */
        transform: scale(0.9); /* slightly smaller arrow for tight layouts */
        touch-action: manipulation;
        z-index: 1234; /* preserve stacking */
    }

    .ip-arrow:last-child {
        right: 4px; /* keep inside viewport edge */
        top: -40px; /* aligns visually with left arrow */
        transform: scale(0.9); /* slightly smaller on small screens */
        touch-action: manipulation;
        z-index: 1234;
    }
}

.ip-arrow {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(107, 114, 128,0.8);
    color: #fff;
    font-size: 2em;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .15s ease, visibility .15s ease;
    user-select: none;
    -webkit-user-select: none;
}

.ip-arrow.ip-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

    .ip-arrow[disabled] {
        opacity: .35;
        cursor: default;
        pointer-events: none;
        visibility: hidden;
    }

/* Drag cursor feedback */
.ip-viewport.ip-dragging {
    cursor: grabbing;
}

/* --- Hover polish already good; add tiny damped scale --- */
@media (hover:hover) {
    .tab-buttonIP:hover .tab-icon-wrapper {
        transition: transform .18s ease, opacity .18s ease;
        transform: scale(1.04);
    }
}


/* --- Panels: fade & slide in (reuses your existing classes) --- */
.container.section > .tab-content {
    transition: opacity .22s ease, transform .22s ease; /* added */
    will-change: opacity, transform;
}

    .container.section > .tab-content.pre-animate { /* already there */
        opacity: 0;
        transform: translateY(6px);
    }

    .container.section > .tab-content.animate-in { /* already there */
        opacity: 1;
        transform: translateY(0);
    }

/* --- Reduce motion respect (keep it) --- */
@media (prefers-reduced-motion: reduce) {
    .tab-buttonIP,
    .tab-buttonIP::after,
    .tab-icon-wrapper,
    .container.section > .tab-content {
        transition: none !important;
        animation: none !important;
    }
}

/* Panels: enter/exit polish */
.container.section > .tab-content {
    transition: opacity .24s ease-out, transform .26s ease-out;
    will-change: opacity, transform;
}

    .container.section > .tab-content.pre-animate { /* already used by your JS */
        opacity: 0;
        transform: translateY(6px);
    }

    .container.section > .tab-content.animate-in { /* already used by your JS */
        opacity: 1;
        transform: translateY(0);
    }
    /* exit animation before hiding */
    .container.section > .tab-content.is-leaving {
        opacity: 0;
        transform: translateY(8px);
    }

@media (prefers-reduced-motion: reduce) {
    .container.section > .tab-content {
        transition: none !important;
    }
}




.ip-arrow {
    width: 40px;
    height: 40px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0;
    line-height: 1; /* kill font baseline influence */
}

    .ip-arrow svg {
        width: 22px;
        height: 22px;
        display: block;
        flex-shrink: 0;
    }


@media (max-width: 433px) {
    .ip-arrow {
        display: none;
    }
}



    @media (max-width: 768px) {
        .ip-arrow, .ip-arrow.ip-visible {
            display: none;
            visibility:hidden;
        }

    }






