/* ==========================================================================
   NACS Show 2026 - Quad Image Cards Component
   Image card with tag overlay, title, description, and angled arrow link.
   Two color variants: Default (light) and Blue.
   Tokens: NACSShow2026Tokens.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   Widget Wrapper
   -------------------------------------------------------------------------- */
.qic {
    display: flex;
    width: 100%;
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Card Wrapper
   -------------------------------------------------------------------------- */
.qic__card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    height: 100%;
    border-radius: 4px;
    overflow: hidden;
    text-decoration: none;
    box-sizing: border-box;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

a.qic__card:hover,
a.qic__card:focus {
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: -20px 20px 40px rgba(0, 0, 0, 0.16);
}

/* --------------------------------------------------------------------------
   Image Section (top of card) with #NACSShow tag overlay
   -------------------------------------------------------------------------- */
.qic__image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 22px 13px;
    box-sizing: border-box;
}

.qic__image-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    z-index: 0;
}

/* Tag pill (top-right of image) */
.qic__tag {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    padding: 8px 20px;
    border-radius: 4px;
    background: var(--nacs-tag-bg, rgba(241, 241, 241, 0.5));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.qic__tag-text {
    font-family: var(--nacs-font-gotham);
    font-weight: 325;
    font-size: 12px;
    line-height: 16px;
    letter-spacing: 0;
    color: var(--nacs-color-black, #000000);
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Bottom Container (text + arrow)
   -------------------------------------------------------------------------- */
.qic__container {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
    padding: 20px 16px;
    border-radius: 0 0 4px 4px;
    box-sizing: border-box;
}

.qic__text {
    flex: 1 0 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.qic__title {
    font-family: var(--nacs-font-gotham);
    font-weight: 700;
    font-size: 18px;
    line-height: 24px;
    letter-spacing: 0;
    margin: 0;
    width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.qic__desc {
    font-family: var(--nacs-font-gotham);
    font-weight: 325;
    font-size: 14px;
    line-height: 20px;
    letter-spacing: 0;
    margin: 0;
    width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* --------------------------------------------------------------------------
   Arrow Circle (bottom right of container)
   -------------------------------------------------------------------------- */
.qic__arrow {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.qic__arrow svg {
    display: block;
    width: 44px;
    height: 44px;
}

/* --------------------------------------------------------------------------
   Variant: Default (Light container, blue title, yellow arrow)
   -------------------------------------------------------------------------- */
.qic--default .qic__container {
    background: var(--nacs-color-white, #FBFBFB);
    background: #FBFBFB;
}

.qic--default .qic__title {
    color: var(--nacs-color-blue, #004C97);
}

.qic--default .qic__desc {
    color: var(--nacs-color-grey-dark, #425563);
}

.qic--default .qic__arrow-circle {
    fill: var(--nacs-color-yellow, #FAE100);
}

/* --------------------------------------------------------------------------
   Variant: Blue (Blue container, white title, white arrow)
   -------------------------------------------------------------------------- */
.qic--blue .qic__container {
    background: var(--nacs-color-blue, #004C97);
}

.qic--blue .qic__title {
    color: var(--nacs-color-white, #FFFFFF);
}

.qic--blue .qic__desc {
    color: var(--nacs-color-white, #FFFFFF);
}

.qic--blue .qic__arrow-circle {
    fill: var(--nacs-color-white, #FFFFFF);
}

/* --------------------------------------------------------------------------
   Optional: Cards Group (when multiple QuadImageCards are placed in a section,
   wrap them in .qic-group to enable horizontal swipe with fade-out scrollbar
   on mobile - see mobile media query)
   -------------------------------------------------------------------------- */
.qic-group {
    display: flex;
    gap: 20px;
    width: 100%;
    align-items: stretch;
}

.qic-group > .qic {
    flex: 1 1 0;
    min-width: 0;
}

/* --------------------------------------------------------------------------
   Mobile Styles (max-width: 768px)
   - Card sized for single-column view
   - When wrapped in .qic-group: horizontal swipe with auto-hiding scrollbar
   -------------------------------------------------------------------------- */
@media screen and (max-width: 768px) {
    .qic__image {
        padding: 22px 13px;
    }

    .qic__tag {
        padding: 8px 20px;
    }

    .qic__container {
        padding: 20px 16px;
        gap: 16px;
    }

    .qic__text {
        gap: 16px;
    }

    .qic__title {
        font-size: 18px;
        line-height: 24px;
    }

    .qic__desc {
        font-size: 14px;
        line-height: 20px;
    }

    .qic__arrow,
    .qic__arrow svg {
        width: 44px;
        height: 44px;
    }

    /* Horizontal swipe carousel for mobile when cards are grouped */
    .qic-group {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 16px;
        padding-bottom: 12px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-gutter: stable;
    }

    .qic-group > .qic {
        flex: 0 0 auto;
        width: 251px;
        scroll-snap-align: start;
    }

    /* --- Auto-hide ("fade out after inactivity") scrollbar --- */
    /* Default state: scrollbar fully transparent (hidden) */
    .qic-group::-webkit-scrollbar {
        height: 4px;
        background-color: transparent;
    }

    .qic-group::-webkit-scrollbar-track {
        background-color: transparent;
    }

    .qic-group::-webkit-scrollbar-thumb {
        background-color: rgba(66, 85, 99, 0);
        border-radius: 4px;
        transition: background-color 0.4s ease;
    }

    /* Firefox */
    .qic-group {
        scrollbar-width: thin;
        scrollbar-color: transparent transparent;
        transition: scrollbar-color 0.4s ease;
    }

    /* While actively scrolling/swiping, fade IN the scrollbar */
    .qic-group.is-scrolling::-webkit-scrollbar-thumb,
    .qic-group:hover::-webkit-scrollbar-thumb,
    .qic-group:focus-within::-webkit-scrollbar-thumb,
    .qic-group:active::-webkit-scrollbar-thumb {
        background-color: rgba(66, 85, 99, 0.6);
    }

    .qic-group.is-scrolling,
    .qic-group:hover,
    .qic-group:focus-within,
    .qic-group:active {
        scrollbar-color: rgba(66, 85, 99, 0.6) transparent;
    }
}
