/* ===========================================================
   MODULE: PARTNER SECTION
   File: partner-section.css

   RESPONSIBILITY
   - Full-width horizontal partner "band"
   - Cards with background images + text overlay
   - Auto-scrolling is handled in JS, but layout/hover/typography is here

   NEW / UPDATED:
   - Images live in /modules/partner-section/images/
   - .partner-card__bg--fallback is shown if no specific image AND no default.jpg
     -> big ÅreTaxi-red block so it's very obvious something's missing
   - Still responsive, still using CSS vars injected by PHP

   2025-10-31 UPDATE:
   - Subtle left/right nav buttons (.atx-partner-nav)
     - absolutely positioned inside viewport
     - default: semi-transparent dark
     - hover: ÅreTaxi red
     - chevrons are white
   =========================================================== */


/* Wrapper section:
   - full bleed
   - no vertical overflow
*/
.atx-partner-section {
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    overflow: hidden;

    /* dark base tone aligned with global palette */
    background: var(--are-dark-gray);
    color: #fff;

    /* The height is controlled by CSS vars from PHP */
    height: var(--ps-height-mobile, 160px);
    min-height: var(--ps-height-mobile, 160px);

    display: flex;
    align-items: stretch;
}

/* matches --bp-lg (1024px) from global tokens */
@media (min-width: 1024px) {
    .atx-partner-section {
        height: var(--ps-height-desktop, 200px);
        min-height: var(--ps-height-desktop, 200px);
    }
}


/* Viewport:
   - masks overflow
   - flex container for the track
   - also acts as positioning context for nav buttons
*/
.atx-partner-section__viewport {
    flex: 1 1 auto;
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 100%;
}


/* NAV BUTTONS
   - absolutely positioned in the middle left/right
   - size, bg, color, offsets come from PHP-injected CSS vars
   - hover turns button ÅreTaxi red (via global --are-color)
*/
.atx-partner-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;

    width: var(--ps-nav-size, 44px);
    height: var(--ps-nav-size, 44px);
    min-width: var(--ps-nav-size, 44px);
    min-height: var(--ps-nav-size, 44px);

    border: 0;
    border-radius: var(--ps-nav-radius, 50%);
    background: var(--ps-nav-bg, rgba(0,0,0,0.6));
    color: var(--ps-nav-color, #fff);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: calc(var(--ps-nav-size, 44px) * 0.5);
    line-height: 1;
    font-weight: 500;
    cursor: pointer;

    transition: background 0.18s ease, transform 0.18s ease;
    /* subtle scale on hover will be applied */
}

.atx-partner-nav--prev {
    left: var(--ps-nav-offset-mobile, 4px);
}
.atx-partner-nav--next {
    right: var(--ps-nav-offset-mobile, 4px);
}

/* matches --bp-lg (1024px) from global tokens */
@media (min-width: 1024px) {
    .atx-partner-nav--prev {
        left: var(--ps-nav-offset-desktop, 8px);
    }
    .atx-partner-nav--next {
        right: var(--ps-nav-offset-desktop, 8px);
    }
}

/* hover / focus state:
   - button background goes ÅreTaxi red via global token
   - tiny nudge scale for tactile feel
*/
.atx-partner-nav:hover,
.atx-partner-nav:focus {
    background: var(--ps-nav-bg-hover, var(--are-color));
    outline: none;
    transform: translateY(-50%) scale(1.05);
}

.atx-partner-nav__chevron {
    pointer-events: none;
    user-select: none;
    line-height: 1;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", "Roboto", sans-serif;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}


/* The moving track:
   - horizontal list of partner cards
   - JS will translateX() this element per "step"
*/
.atx-partner-track {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;

    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    list-style: none;
    margin: 0;
    padding: 0;

    will-change: transform;
    transition: transform var(--ps-transition-ms, 600ms) ease;
}


/* Each card:
   - fixed width depending on viewport
   - full height of the band
   - clickable block fills the li
*/
.partner-card {
    position: relative;
    flex: 0 0 auto;
    height: 100%;
    width: 100vw; /* default mobile: 1 card per view */
    max-width: 100vw;
    overflow: hidden;
    display: flex;
}

/* matches --bp-lg (1024px) from global tokens */
@media (min-width: 1024px) {
    .partner-card {
        /* On desktop, we show N cards at once.
           N = --ps-cards-desktop (e.g. 4)
           So width = 100% / N
        */
        width: calc(100vw / var(--ps-cards-desktop, 4));
        max-width: calc(100vw / var(--ps-cards-desktop, 4));
    }
}


/* Anchor fills card */
.partner-card__link {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;

    /* make hover scaling smooth */
    overflow: hidden;
}


/* Background image layer */
.partner-card__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;

    /* smooth upscale on hover */
    transform-origin: center center;
    transition: transform 0.3s ease;
}

/* HARD FAIL FALLBACK:
   - used if no partner-specific image AND no default.jpg
   - shows a strong ÅreTaxi red box so missing asset is obvious
   - color now uses global --are-color token
*/
.partner-card__bg--fallback {
    background: var(--are-color);
    background-image: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    text-align: center;
    line-height: 1.2;
    padding: 0.5rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* We inject a pseudo label so it's crystal clear in staging */
.partner-card__bg--fallback::after {
    content: 'IMAGE MISSING';
    letter-spacing: -0.03em;
    font-family: inherit;
    text-transform: uppercase;
}


/* Dark overlay gradient to make text readable on any photo
   - text is intentionally kept #fff by default
*/
.partner-card__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem 1rem 1.25rem;
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.65) 0%,
        rgba(0,0,0,0.35) 40%,
        rgba(0,0,0,0.0) 100%
    );

    /* text defaults */
    color: #fff;
    font-family: inherit;
    line-height: 1.25;
    text-shadow: 0 2px 4px rgba(0,0,0,0.75);
}


/* Caption (partner/company name)
   - uses body typography but slightly heavier
*/
.partner-card__caption {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    letter-spacing: -0.02em;
    color: #fff;
}

/* matches --bp-md (768px) from global tokens */
@media (min-width: 768px) {
    .partner-card__caption {
        font-size: 1rem;
    }
}

/* matches --bp-xl (1280px) from global tokens */
@media (min-width: 1280px) {
    .partner-card__caption {
        font-size: 1.05rem;
    }
}


/* Payoff / short description */
.partner-card__payoff {
    font-size: 0.8rem;
    font-weight: 400;
    color: #fff;
    opacity: 0.9;
    max-width: 90%;
}

/* matches --bp-md (768px) from global tokens */
@media (min-width: 768px) {
    .partner-card__payoff {
        font-size: 0.85rem;
    }
}

/* matches --bp-xl (1280px) from global tokens */
@media (min-width: 1280px) {
    .partner-card__payoff {
        font-size: 0.9rem;
    }
}


/* ====== HOVER STATES ======
   - scale bg a bit
   - shift text color to global hover color (from config, fallback to --link-hover-color)
*/
.partner-card__link:hover .partner-card__bg,
.partner-card__link:focus .partner-card__bg {
    transform: scale(var(--ps-hover-scale, 1.05));
}

.partner-card__link:hover .partner-card__caption,
.partner-card__link:focus .partner-card__caption,
.partner-card__link:hover .partner-card__payoff,
.partner-card__link:focus .partner-card__payoff {
    color: var(--ps-hover-text-color, var(--link-hover-color));
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}


/* ====== REDUCED MOTION ======
   Respect users who prefer less motion.
*/
@media (prefers-reduced-motion: reduce) {
    .atx-partner-track {
        transition: none;
    }
    .partner-card__bg {
        transition: none;
    }
    .atx-partner-nav {
        transition: none;
    }
}
