/*
 * Tridhya Tech — header mega menu redesign (tt-mega)
 * Ported from the HTML demo (clutch.css v14 → v26). Classes are all
 * tt-* so the theme's legacy .services-menu / li.active rules cannot
 * reach them.
 */

/* ============================================================
   v14 — Services mega menu redesign (superseded bits kept safe)
   ============================================================ */
.tt-mega__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 36px;
    border-bottom: 1px solid #e3eaf1;
}
.tt-mega__label {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Inter', 'Source Sans Pro', sans-serif;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #00517c;
}
.tt-mega__label::before {
    content: "";
    width: 26px;
    height: 2px;
    background: #06b6e8;
}
.tt-mega__all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', 'Source Sans Pro', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #00517c;
    text-decoration: none;
    transition: color 0.3s ease;
}
.tt-mega__all-icon {
    width: 15px;
    height: 15px;
    transition: transform 0.3s ease;
}
.tt-mega__all:hover {
    color: #06b6e8;
}
.tt-mega__all:hover .tt-mega__all-icon {
    transform: translateX(3px);
}
.tt-mega__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 12px;
    padding: 20px 24px 26px;
}
.tt-mega__item {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 14px;
    align-items: start;
    padding: 16px 14px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}
.tt-mega__item:hover {
    background: rgba(6, 182, 232, 0.06);
}
.tt-mega__icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 81, 124, 0.08);
    color: #00517c;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.tt-mega__item:hover .tt-mega__icon {
    background: rgba(6, 182, 232, 0.14);
    color: #06b6e8;
}
.tt-mega__glyph {
    width: 22px;
    height: 22px;
}
.tt-mega__text {
    display: block;
    min-width: 0;
}
.tt-mega__name {
    display: block;
    font-family: 'Archivo', 'Source Sans Pro', sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
    color: #0d3a54;
    transition: color 0.3s ease;
}
.tt-mega__item:hover .tt-mega__name {
    color: #06b6e8;
}
.tt-mega__hint {
    display: block;
    margin-top: 5px;
    font-family: 'Inter', 'Source Sans Pro', sans-serif;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: rgba(13, 58, 84, 0.58);
}
@media (min-width: 1200px) {
    .tt-mega__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================================
   v15/v16 — mobile sidebar cert band + header spacing
   ============================================================ */
.res-main-menu ul.tt-res-services a {
    font-size: 16px;
    padding: 9px 20px;
    transition: color 0.3s ease;
}
.res-main-menu ul.tt-res-services a:hover {
    color: #06b6e8;
}
.res-main-menu ul.main-res-menu-sidebar li.tt-res-certs-item {
    margin-top: 10px;
}
.tt-res-certs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    padding: 18px 20px 20px;
    border-top: 1px solid rgba(6, 182, 232, 0.35);
    background: linear-gradient(170deg, #04283f 0%, #043453 100%);
}
.tt-res-cert {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.tt-res-cert img {
    display: block;
    width: auto;
}
.tt-res-cert span {
    font-family: 'Inter', 'Source Sans Pro', sans-serif;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.85);
}
@media (max-width: 1199px) {
    .main-menu .container.p-0 {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}
@media (max-width: 767px) {
    .main-menu .nav-bar .logo img {
        max-width: min(156px, 40vw);
        height: 25px;
    }
    .res-main-menu .close-sidemenu {
        padding: 14px 16px 12px;
        border-bottom: 1px solid rgba(13, 58, 84, 0.08);
    }
}

/* ============================================================
   v17 — mega v2: rows drive :has()-switched panes on the right
   ============================================================ */
.tt-mega__body {
    display: grid;
    grid-template-columns: 344px minmax(0, 1fr);
}
.tt-mega__items {
    display: flex;
    flex-direction: column;
    padding: 0;
}
.tt-mega__item {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
    padding: 12px 16px 12px 20px;
    border-bottom: 1px solid #eef2f7;
    cursor: pointer;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}
.tt-mega__item:last-child {
    border-bottom: 0;
}
.tt-mega__item .tt-mega__icon {
    width: 40px;
    height: 40px;
    flex: none;
}
.tt-mega__item .tt-mega__glyph {
    width: 20px;
    height: 20px;
}
.tt-mega__item .tt-mega__name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    color: #0d3a54;
    text-decoration: none;
}
.tt-mega__chev {
    flex: none;
    width: 14px;
    height: 14px;
    color: #9db4c4;
    transition: transform 0.3s ease, color 0.3s ease;
}
.tt-mega__body:has(.tt-mega__item:hover) .tt-mega__item:not(:hover) {
    opacity: 0.45;
}
.tt-mega__item:hover .tt-mega__chev {
    color: #06b6e8;
    transform: translateX(3px);
}

/* panes stack on one grid cell; the hovered one is revealed */
.tt-mega__panes {
    display: grid;
    border-left: 1px solid #e3eaf1;
    background: linear-gradient(180deg, #f7fbfe 0%, #edf6fc 100%);
}
.tt-mega__pane {
    grid-area: 1 / 1;
    display: flex;
    flex-direction: column;
    padding: 26px 32px 24px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(8px);
    transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s;
}
.tt-mega__pane-head {
    display: flex;
    align-items: center;
    gap: 12px;
}
.tt-mega__pane-dash {
    flex: none;
    width: 26px;
    height: 2px;
    background: #06b6e8;
}
.tt-mega__pane-name {
    margin: 0;
    font-family: 'Archivo', 'Source Sans Pro', sans-serif;
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #00517c;
}
.tt-mega__pane-desc {
    margin: 10px 0 0;
    max-width: 54ch;
    font-family: 'Inter', 'Source Sans Pro', sans-serif;
    font-size: 0.875rem;
    line-height: 1.65;
    color: rgba(13, 58, 84, 0.62);
}
.tt-mega__subs {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 28px;
}
.tt-mega__subs a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 2px;
    border-bottom: 1px solid rgba(0, 81, 124, 0.12);
    font-family: 'Inter', 'Source Sans Pro', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0d3a54;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.25s ease, border-color 0.25s ease;
}
.tt-mega__subs a:hover {
    color: #06b6e8;
    border-color: rgba(6, 182, 232, 0.5);
}
.tt-mega__sub-arrow {
    flex: none;
    width: 13px;
    height: 13px;
    color: #06b6e8;
    opacity: 0;
    transform: translate(-4px, 4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.tt-mega__subs a:hover .tt-mega__sub-arrow {
    opacity: 1;
    transform: translate(0, 0);
}
.tt-mega__pane-more {
    margin-top: auto;
    padding-top: 20px;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', 'Source Sans Pro', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #00517c;
    text-decoration: none;
    transition: color 0.25s ease;
}
.tt-mega__pane-more .tt-mega__more-arrow {
    width: 14px;
    height: 14px;
    transition: transform 0.25s ease;
}
.tt-mega__pane-more:hover {
    color: #06b6e8;
}
.tt-mega__pane-more:hover .tt-mega__more-arrow {
    transform: translate(2px, -2px);
}

/* pane switching: default pane 1, hovered row wins, hovering
   the pane itself keeps it open for the trip across */
.tt-mega__body:not(:has(.tt-mega__item:hover)):not(:has(.tt-mega__pane:hover)) .tt-mega__pane:nth-child(1),
.tt-mega__body:has(.tt-mega__item:nth-child(1):hover) .tt-mega__pane:nth-child(1),
.tt-mega__body:has(.tt-mega__pane:nth-child(1):hover) .tt-mega__pane:nth-child(1),
.tt-mega__body:has(.tt-mega__item:nth-child(2):hover) .tt-mega__pane:nth-child(2),
.tt-mega__body:has(.tt-mega__pane:nth-child(2):hover) .tt-mega__pane:nth-child(2),
.tt-mega__body:has(.tt-mega__item:nth-child(3):hover) .tt-mega__pane:nth-child(3),
.tt-mega__body:has(.tt-mega__pane:nth-child(3):hover) .tt-mega__pane:nth-child(3),
.tt-mega__body:has(.tt-mega__item:nth-child(4):hover) .tt-mega__pane:nth-child(4),
.tt-mega__body:has(.tt-mega__pane:nth-child(4):hover) .tt-mega__pane:nth-child(4),
.tt-mega__body:has(.tt-mega__item:nth-child(5):hover) .tt-mega__pane:nth-child(5),
.tt-mega__body:has(.tt-mega__pane:nth-child(5):hover) .tt-mega__pane:nth-child(5),
.tt-mega__body:has(.tt-mega__item:nth-child(6):hover) .tt-mega__pane:nth-child(6),
.tt-mega__body:has(.tt-mega__pane:nth-child(6):hover) .tt-mega__pane:nth-child(6) {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* while a pane is hovered, its row keeps the lit state */
.tt-mega__body:has(.tt-mega__pane:hover) .tt-mega__item {
    opacity: 0.45;
}
.tt-mega__body:has(.tt-mega__pane:nth-child(1):hover) .tt-mega__item:nth-child(1),
.tt-mega__body:has(.tt-mega__pane:nth-child(2):hover) .tt-mega__item:nth-child(2),
.tt-mega__body:has(.tt-mega__pane:nth-child(3):hover) .tt-mega__item:nth-child(3),
.tt-mega__body:has(.tt-mega__pane:nth-child(4):hover) .tt-mega__item:nth-child(4),
.tt-mega__body:has(.tt-mega__pane:nth-child(5):hover) .tt-mega__item:nth-child(5),
.tt-mega__body:has(.tt-mega__pane:nth-child(6):hover) .tt-mega__item:nth-child(6) {
    opacity: 1;
    background: rgba(6, 182, 232, 0.07);
}
.tt-mega__body:has(.tt-mega__pane:nth-child(1):hover) .tt-mega__item:nth-child(1) .tt-mega__icon,
.tt-mega__body:has(.tt-mega__pane:nth-child(2):hover) .tt-mega__item:nth-child(2) .tt-mega__icon,
.tt-mega__body:has(.tt-mega__pane:nth-child(3):hover) .tt-mega__item:nth-child(3) .tt-mega__icon,
.tt-mega__body:has(.tt-mega__pane:nth-child(4):hover) .tt-mega__item:nth-child(4) .tt-mega__icon,
.tt-mega__body:has(.tt-mega__pane:nth-child(5):hover) .tt-mega__item:nth-child(5) .tt-mega__icon,
.tt-mega__body:has(.tt-mega__pane:nth-child(6):hover) .tt-mega__item:nth-child(6) .tt-mega__icon {
    background: rgba(6, 182, 232, 0.14);
    color: #06b6e8;
}
.tt-mega__body:has(.tt-mega__pane:nth-child(1):hover) .tt-mega__item:nth-child(1) .tt-mega__name,
.tt-mega__body:has(.tt-mega__pane:nth-child(2):hover) .tt-mega__item:nth-child(2) .tt-mega__name,
.tt-mega__body:has(.tt-mega__pane:nth-child(3):hover) .tt-mega__item:nth-child(3) .tt-mega__name,
.tt-mega__body:has(.tt-mega__pane:nth-child(4):hover) .tt-mega__item:nth-child(4) .tt-mega__name,
.tt-mega__body:has(.tt-mega__pane:nth-child(5):hover) .tt-mega__item:nth-child(5) .tt-mega__name,
.tt-mega__body:has(.tt-mega__pane:nth-child(6):hover) .tt-mega__item:nth-child(6) .tt-mega__name {
    color: #06b6e8;
}
.tt-mega__body:has(.tt-mega__pane:nth-child(1):hover) .tt-mega__item:nth-child(1) .tt-mega__chev,
.tt-mega__body:has(.tt-mega__pane:nth-child(2):hover) .tt-mega__item:nth-child(2) .tt-mega__chev,
.tt-mega__body:has(.tt-mega__pane:nth-child(3):hover) .tt-mega__item:nth-child(3) .tt-mega__chev,
.tt-mega__body:has(.tt-mega__pane:nth-child(4):hover) .tt-mega__item:nth-child(4) .tt-mega__chev,
.tt-mega__body:has(.tt-mega__pane:nth-child(5):hover) .tt-mega__item:nth-child(5) .tt-mega__chev,
.tt-mega__body:has(.tt-mega__pane:nth-child(6):hover) .tt-mega__item:nth-child(6) .tt-mega__chev {
    color: #06b6e8;
    transform: translateX(3px);
}

/* ============================================================
   v18 — two-column panes: sub list left, illustration right;
   cert strip on the cyan brand highlight
   ============================================================ */
.tt-mega__pane-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 264px;
    gap: 0 32px;
    margin-top: 18px;
    flex: 1;
    min-height: 0;
}
.tt-mega__pane-cols .tt-mega__subs {
    display: flex;
    flex-direction: column;
    align-self: start;
    margin-top: 0;
}
.tt-mega__pane-media {
    border: 1px solid #d8e4ee;
    overflow: hidden;
}
.tt-mega__pane-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tt-mega__certs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 26px;
    justify-content: center;
    padding: 15px 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    background: #06b6e8;
}
.tt-mega__certs-label {
    margin: 0 8px 0 0;
    padding-right: 24px;
    border-right: 1px solid rgba(255, 255, 255, 0.22);
    font-family: 'Inter', 'Source Sans Pro', sans-serif;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
}
.tt-mega__certs-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px 30px;
}
.tt-mega__cert {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.tt-mega__cert img {
    display: block;
    width: auto;
}
.tt-mega__cert span {
    font-family: 'Inter', 'Source Sans Pro', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #ffffff;
    white-space: nowrap;
}
.tt-mega__cert {
    gap: 8px;
}
.tt-mega__cert span {
    color: #ffffff;
}
.tt-res-cert span {
    color: #ffffff;
}

/* ============================================================
   v23 — every dropdown joins the services mega pattern:
   a card exactly as wide as the body container.
   ============================================================ */
.main-menu .main-navbar ul > li > .submenu .container {
    max-width: 1320px !important;
    padding: 0 !important;
}
@media (max-width: 1399.98px) {
    .main-menu .main-navbar ul > li > .submenu .container {
        max-width: 1140px !important;
    }
}
@media (max-width: 1199.98px) {
    .main-menu .main-navbar ul > li > .submenu .container {
        max-width: 960px !important;
    }
}

/* Industries: six sectors in a hairline 3-column grid */
.tt-ind__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: #e8eef5;
    border: 0;
    margin: 0;
}
.tt-ind__grid .tt-mega__item {
    background: #fff;
    border-bottom: 0;
    padding: 20px;
    flex: initial;
}

/* Investors: disclosure links on the same hairline grid */
.tt-inv__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: #e8eef5;
    border: 0;
    margin: 0;
}
.tt-inv__grid a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 10px 16px;
    background: #fff;
    font-family: 'Inter', 'Source Sans Pro', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #0d3a54;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.tt-inv__grid a:hover {
    background: rgba(6, 182, 232, 0.06);
    color: #06b6e8;
}
.tt-inv__grid a:last-child {
    grid-column: span 2;
}

/* Who we are: services anatomy with description beside illustration */
.tt-who .tt-mega__pane-desc {
    margin: 0;
    max-width: 52ch;
    align-self: start;
}

/* Insights: each pane is a row of four compact cards */
.tt-ins__cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}
.tt-ins__card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e3eaf1;
    background: #fff;
    text-decoration: none;
    transition: border-color 0.3s ease;
}
.tt-ins__card:hover {
    border-color: #06b6e8;
}
.tt-ins__card figure {
    margin: 0;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f3f7fb;
}
.tt-ins__card figure img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tt-ins__card h5 {
    margin: 0;
    padding: 11px 12px 0;
    font-family: 'Archivo', 'Source Sans Pro', sans-serif;
    font-size: 0.78125rem;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: -0.01em;
    color: #0d3a54;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.25s ease;
}
.tt-ins__card:hover h5 {
    color: #06b6e8;
}
.tt-ins__meta {
    margin: 0;
    padding: 6px 12px 0;
    font-family: 'Inter', 'Source Sans Pro', sans-serif;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.5;
    color: rgba(13, 58, 84, 0.55);
}
.tt-ins__date {
    margin-top: auto;
    padding: 8px 12px 11px;
    font-family: 'Inter', 'Source Sans Pro', sans-serif;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(13, 58, 84, 0.45);
}

/* v24 — normalize the one-col-row submenu to the full-width band */
.main-menu .main-navbar > ul > li > .submenu.one-col-row {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
}

/* v26 — the diamond rides dead-center under the hovered label */
.main-menu .main-navbar ul > li > a .submenu-arrow::after {
    margin-left: 18.4px !important;
}

/* ============================================================
   Responsive fallback: `:has()` needs a modern engine; on very
   old browsers the first pane stays visible.
   ============================================================ */
@supports not selector(:has(*)) {
    .tt-mega__pane:nth-child(n+2) {
        display: none;
    }
    .tt-mega__pane:nth-child(1) {
        opacity: 1;
        visibility: visible;
        transform: none;
    }
}
