/* ===========================================================================
   home-mobile.css  —  PHONE ONLY (max-width: 768px). Desktop / laptop untouched.

   Loaded LAST (see layout/base.html) so it wins over style.css, mobile-fixes.css etc.

   Sections covered, in page order:
     1. Hero
     2. Our Compliance (cards)
     3. About MADDS
        (Idea behind MADDS is intentionally NOT touched)
     4. What we specialise in  (horizontal 3-up list under the image slider;
        the list itself is built by the mobile slider script in home.html)
     5. Solutions (background shadow removed)
     6. Footer (shared by every page)
   =========================================================================== */

@media (max-width: 768px) {

    /* =======================================================================
       1. HERO
       top    -> the right-hand visual (browser / phone / dashboard scene)
       middle -> headline + sub text (left aligned, smaller)
       bottom -> the two buttons, one at the left end, one at the right end
       The text block is "display: contents" so the buttons can be placed
       independently of the headline without touching the JS-built markup.
       ======================================================================= */
    #hl-hero .hl-layer {
        padding: calc(var(--hdr-full, 90px) + 6px) 16px 60px;
    }

    #hl-hero .hl-body {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        align-self: stretch;
        justify-content: center;   /* group the visual, text and buttons together */
        gap: 0;
        min-height: 0;
    }

    #hl-hero .hl-body > div:first-child {
        display: contents;
        animation: none;
    }

    /* visual first, on top, a bit smaller */
    #hl-hero .hl-mock {
        order: 1;
        flex: none;
        justify-self: auto;
        align-self: center;
        width: 100%;
        max-width: 420px;
        height: clamp(210px, 38vh, 340px);
        max-height: none;
        margin: 0;
    }

    /* text sits in the middle of the space between visual and buttons */
    #hl-hero .hl-h1 {
        order: 2;
        margin: 14px 0 6px;
        font-size: clamp(21px, 6.4vw, 27px);
        line-height: 1.12;
        letter-spacing: -.015em;
    }

    #hl-hero .hl-body p {
        order: 3;
        margin: 0;
        max-width: 34ch;
        font-size: 12.5px;
        line-height: 1.4;
    }

    /* buttons: bottom-left and bottom-right ends, small */
    #hl-hero .hl-btns {
        order: 4;
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 8px;
        width: 100%;
        margin-top: 16px;
    }

    #hl-hero .hl-btn {
        padding: 8px 15px;
        font-size: 12px;
        font-weight: 600;
        line-height: 1.2;
        white-space: nowrap;
    }

    #hl-hero .hl-fin .hl-btn.s {
        border-width: 1.5px;
    }

    /* the original rule hid the visual on any screen under 700px tall; the text is
       smaller now, so keep it unless the screen is really short */
    #hl-hero .hl-mock {
        display: block;
    }

    /* the text block no longer animates as one box, so the pieces fade up on their own */
    #hl-hero .hl-h1,
    #hl-hero .hl-body p,
    #hl-hero .hl-btns {
        animation: hl-up .9s cubic-bezier(.22, .61, .36, 1) both;
    }

    #hl-hero .hl-body p {
        animation-delay: .08s;
    }

    #hl-hero .hl-btns {
        animation-delay: .16s;
    }

    /* =======================================================================
       2. OUR COMPLIANCE — two columns, smaller cards
       ======================================================================= */
    .madds-trusted {
        padding: 2.25rem 0 2.5rem;
    }

    .madds-trusted__head {
        margin-bottom: 1.25rem;
    }

    .madds-trusted__head h2 {
        font-size: clamp(1.35rem, 5.4vw, 1.7rem);
        line-height: 1.2;
    }

    .madds-trusted__standards {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        width: calc(100% - 1.5rem);
    }

    .madds-trusted__standard:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        justify-self: center;
        width: calc(50% - 4px);
    }

    .madds-trusted__standard {
        min-height: 0;
        gap: .15rem;
        padding: .65rem .5rem;
        border-radius: 12px;
        box-shadow: 0 3px 10px rgba(20, 6, 45, .06);
    }

    .madds-trusted__standard strong {
        font-size: .84rem;
    }

    .madds-trusted__standard small {
        font-size: .64rem;
        line-height: 1.3;
    }

    .madds-trusted__note {
        margin-top: 1.1rem;
        font-size: .78rem;
        line-height: 1.55;
    }

    /* =======================================================================
       3. ABOUT MADDS
       order: small heading + tagline  ->  BIGGER flower  ->  cards, text, stats
       (.ag-copy is "display: contents" so its children can sit above and below
       the flower; every piece of content stays exactly as it was)
       ======================================================================= */
    .about-section .ag-panel__inner {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 1rem 1rem 1.4rem;
    }

    .about-section .ag-copy {
        display: contents;
    }

    .about-section .ag-copy h1 {
        order: 1;
        margin: 0 0 .2rem;
        font-size: 1.3rem;
        line-height: 1.15;
    }

    .about-section .ag-copy h2 {
        order: 2;
        margin: 0 0 .35rem;
        font-size: .86rem;
        line-height: 1.4;
    }

    .about-section .ag-visual {
        order: 3;
        margin: 0 -.5rem;
    }

    /* flower: much larger than before (was 74-86% of the stage) */
    .about-section .ag-stage {
        width: min(calc(100% + 1.2rem), 560px);
        --flower-w: 80%;
    }

    .about-section .ag-cards {
        order: 4;
        margin-top: .25rem;
    }

    .about-section .ag-about-text {
        order: 5;
    }

    .about-section .ag-stats {
        order: 6;
    }

    /* =======================================================================
       4. WHAT WE SPECIALISE IN
       3 capabilities in view, side by side, under the image. The centred one
       is the active one (its image shows above); swipe the row left / right
       to change it. Built by the mobile slider script in home.html.
       ======================================================================= */
    .madds-spec-m-list {
        display: none;
    }

    .madds-specialisation.is-mobile-slider .madds-spec-m-list {
        display: flex;
        align-items: stretch;
        margin: .85rem 0 .1rem;
        padding: .2rem 0;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        touch-action: pan-x pan-y;
    }

    .madds-spec-m-list::-webkit-scrollbar {
        display: none;
    }

    /* spacers let the first / last item reach the centre */
    .madds-spec-m-list::before,
    .madds-spec-m-list::after {
        content: "";
        flex: 0 0 33.3333%;
    }

    .madds-spec-m-item {
        flex: 0 0 33.3333%;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 4px;
        border: 0;
        background: none;
        font: inherit;
        cursor: pointer;
        scroll-snap-align: center;
        -webkit-tap-highlight-color: transparent;
    }

    .madds-spec-m-item span {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 42px;
        box-sizing: border-box;
        padding: .4rem .5rem;
        border-radius: 14px;
        text-align: center;
        font-size: .68rem;
        font-weight: 600;
        line-height: 1.2;
        color: #6b6477;
        background: rgba(23, 19, 31, .05);
        border: 1px solid rgba(23, 19, 31, .08);
        transform: scale(.9);
        opacity: .75;
        transition: transform .3s ease, background .3s ease, color .3s ease, opacity .3s ease;
    }

    .madds-spec-m-item.is-active span {
        color: #fff;
        background: linear-gradient(135deg, #b51bb5, #2677ff);
        border-color: transparent;
        transform: scale(1.06);
        opacity: 1;
        box-shadow: 0 8px 18px rgba(81, 40, 190, .28);
    }

    /* =======================================================================
       5. SOLUTIONS — remove the overall shadow, KEEP the background image (pinned in place)
       The image used to be painted twice (outer wrapper + section) and stretched over the whole
       tall scroll track, which showed as a shaded band and made it scroll. On phones it is now
       painted once, on the pinned screen-sized panel. Shadows around the card /
       laptop are removed; the glass card itself is kept.
       ======================================================================= */
    .customized {
        padding: 0 !important;
        background: transparent !important;
        background-image: none !important;
    }

    /* full-bleed: the image panel spans the whole screen width, no side margin or padding
       (the site's 88-90% width container is lifted for this section only; the text and the
       card keep their own side spacing) */
    .customized .container-div,
    .customized .container-div.solutions-wide {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    section.custom-tabs,
    section.custom-tabs .tabs-container {
        width: 100%;
        max-width: 100%;
        margin: 0;
        box-sizing: border-box;
    }

    section.custom-tabs {
        background: transparent !important;
        background-image: none !important;
        box-shadow: none !important;
    }

    /* FIXED background: the section is a tall scroll track whose inner panel is pinned
       (position: sticky, one screen tall). Painting the image on that pinned panel keeps it
       perfectly still, sized to the screen, while the content scrolls over it. This works on
       iOS / Android, where background-attachment: fixed is ignored or janky. */
    section.custom-tabs .tabs-container {
        background-color: transparent !important;
        background-image: url("../images/solutions-glass-bg.png") !important;
        background-size: cover !important;
        background-position: center center !important;
        background-repeat: no-repeat !important;
        background-attachment: scroll !important;
        box-shadow: none !important;
    }

    /* the frosted glass card keeps its original look (tint + blur, from solutions-glass.css);
       only shadows are removed */
    section.custom-tabs .tab-list-window {
        background: rgba(0, 0, 0, 0.05);
        -webkit-backdrop-filter: blur(5px);
        backdrop-filter: blur(5px);
        box-shadow: none !important;
    }

    section.custom-tabs .tab-list-window:hover {
        background: rgba(0, 0, 0, 0.1);
        box-shadow: none !important;
    }

    /* padding for the glass card: it sits inset from the screen edges and its content has
       breathing room on every side (the stretched <a class="sol-detail"> inside carries the
       padding, because the card itself is the link) */
    section.custom-tabs .tab-list-window {
        margin: 8px 5vw 10px !important;
        border-radius: 22px;
    }

    /* order: the laptop first, the glass card below it */
    section.custom-tabs .tabs-body {
        display: flex;
        flex-direction: column;
    }

    section.custom-tabs .laptop-stage {
        order: 1;
    }

    section.custom-tabs .tab-list-window {
        order: 2;
    }

    section.custom-tabs .tab-list-window .sol-detail {
        padding: 20px 22px 22px !important;
        gap: 10px;
    }

    section.custom-tabs .laptop-stage,
    section.custom-tabs .canvas-wrap,
    section.custom-tabs canvas {
        box-shadow: none !important;
        filter: none !important;
        background: transparent !important;
    }

    /* =======================================================================
       6. FOOTER (shared by every page)
       strip      -> 2 rows x 2 columns, small
       logo       -> centred, then a short small description
       link lists -> ONE row, THREE columns, small text
       copyright  -> smaller type / icons
       Everything is compact so the whole footer is about one screen tall.
       ======================================================================= */
    footer .contact-div {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, max-content));
        justify-content: space-between;     /* first column on the left edge, last on the right edge */
        gap: 8px 10px;
        padding: .6rem 6% !important;      /* 6% + 88% + 6% = equal gaps */
        box-sizing: border-box;
        animation: none;
    }

    footer .add-div {
        width: auto;
        min-width: 0;
        gap: .4rem;
        align-items: center;
    }

    footer .icon-add {
        flex: none;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 16px;
    }

    footer .icon-add svg {
        width: 16px;
        height: 16px;
    }

    footer .content-add {
        min-width: 0;
        font-size: .62rem;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    footer .container-div {
        width: 88%;
        max-width: 88%;
        margin: 0 auto;
        padding: 0;
    }

    footer .footer-link {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));   /* three equal columns */
        gap: 12px 10px;
        padding: 16px 0 12px;
    }

    footer .footer-link .colume-4 {
        width: auto;
        min-width: 0;
    }

    /* equal gaps: first list hugs the left edge, last list hugs the right edge, middle list
       sits in the centre (each list's text stays left aligned inside its own block) */
    footer .footer-link .colume-4:nth-child(2) {
        justify-self: start;
    }

    footer .footer-link .colume-4:nth-child(3) {
        justify-self: center;
    }

    footer .footer-link .colume-4:nth-child(4) {
        justify-self: end;
    }

    /* logo + description: full width, centred */
    footer .footer-link .colume-4:first-child {
        grid-column: 1 / -1;
        text-align: center;
    }

    footer .footer-link .top-head .logo {
        margin: 0 auto 6px;
    }

    footer .footer-link .top-head .logo img {
        height: 34px;
        width: auto;
        max-width: 100%;
        margin: 0 auto;
    }

    /* description: spans the full footer width, justified so both edges line up (logo above stays centred) */
    footer .footer-link .colume-4:first-child .link-list p {
        max-width: none;
        width: 100%;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
        text-align: justify;            /* fills the line edge to edge: equal gap left and right */
        text-align-last: left;
        hyphens: auto;
        -webkit-hyphens: auto;
        font-size: .66rem;
        line-height: 1.45;
    }

    footer .footer-link .top-head h2 {
        margin: 0 0 6px;
        font-size: .8rem;
        line-height: 1.2;
    }

    footer .footer-link .link-list ul li {
        margin-bottom: 5px;
        font-size: .64rem;
        line-height: 1.3;
    }

    footer .footer-link .link-list ul li a {
        font-size: inherit;
    }

    footer .footer-link .link-list ul li a:hover {
        padding-left: 0;
    }

    footer .copy-right {
        padding: .55rem 0;
    }

    footer .copy-right .container {
        width: 88%;
        max-width: 88%;
        margin: 0 auto;
        padding: 0;
    }

    footer .text-copy {
        font-size: .6rem;
        line-height: 1.3;
    }

    footer .social-media {
        margin-top: .45rem;
        gap: 7px;
    }

    footer .icon-social {
        width: 28px;
        height: 28px;
        padding: 6px;
        border-width: 2px;
    }

    footer .icon-social svg {
        width: 100%;
        height: 100%;
    }
}

/* ===========================================================================
   IDEA BEHIND MADDS (phone): swipe / drag carousel, order = heading -> photo -> text
   (.text-cont is "display: contents" so the heading and the paragraph can sit on either
   side of the photo; the content itself is unchanged)
   =========================================================================== */
@media (max-width: 768px) {

    .main-parallax .content {
        touch-action: pan-x pan-y;
        overscroll-behavior-x: contain;
        cursor: grab;
        -webkit-user-select: none;
        user-select: none;
    }

    .main-parallax .content.is-dragging {
        cursor: grabbing;
        scroll-snap-type: none;
    }

    .main-parallax .text {
        gap: 12px;
    }

    .main-parallax .text-cont {
        display: contents;
    }

    .main-parallax .text h2 {
        order: 1;
        margin: 0;
    }

    .main-parallax .content-img {
        order: 2;
    }

    .main-parallax .text .line {
        order: 3;
    }

    .main-parallax .content-img img {
        -webkit-user-drag: none;
        user-drag: none;
        pointer-events: none;
    }
}

/* ===========================================================================
   BUTTONS (phone): no shadow on any button
   =========================================================================== */
@media (max-width: 768px) {

    button,
    button:hover,
    button:focus,
    button:active,
    [class*="btn"],
    [class*="btn"]:hover,
    [class*="btn"]:focus,
    [class*="button"],
    [class*="cta"],
    [class*="cta"]:hover,
    [class*="ghost"],
    [class*="subscribe"],
    .hl-fin .hl-btn.p,
    .icon-btn,
    .quote-btn,
    .madds-news__btn,
    .madds-news__subscribe,
    .madds-specialisation__discover,
    .madds-specialisation__discover b,
    .madds-spec-m-item span,
    .madds-spec-m-item.is-active span,
    .madds-spec-m-dot,
    .mp-dot,
    .arc__btn,
    .arc__cta,
    section.custom-tabs .sol-detail .sol-cap-btn {
        box-shadow: none !important;
        text-shadow: none !important;
    }
}

/* really short phones: drop the hero visual so the text and buttons never collide */
@media (max-width: 768px) and (max-height: 540px) {
    #hl-hero .hl-mock {
        display: none;
    }
}