/* Related-parts cross-sell rail for blog-details.php (issue #584).
   Lives in the right sidebar below the "Join The Fleet" card. Compact,
   sleek card carousel + a secondary "same manufacturer" list. v3 brand
   tokens: royal navy #2843A7, Plus Jakarta Sans. Scoped under .f411-rp so
   it never bleeds into the surrounding article styles. */

/* The blog sidebar is a grid track (.article-container is `grid 8fr 3.5fr`).
   A grid item defaults to min-width:auto = its content's min-content, so a wide
   sidebar child (the carousel) would inflate the track and starve the article
   column. min-width:0 lets the track honour its 3.5fr share; the carousel then
   sizes to the track and clips internally. Scoped here because this stylesheet
   only loads on blog-details.php. */
.article-container > aside {
    min-width: 0;
}

.f411-rp {
    --rp-navy: #2843a7;
    --rp-ink: #1a1a2e;
    --rp-muted: #6b7280;
    --rp-line: #e6e8f0;
    /* No font-family override here: the heading inherits the page's serif so it
       matches "About The Author" / "Join The Fleet"; the cards opt into the
       sans face below. */
    background: #fff;
    border: 1px solid var(--rp-line);
    border-radius: 14px;
    padding: 20px 18px;
    margin-bottom: 30px;
    box-shadow: 0 6px 24px rgba(40, 67, 167, 0.06);
    /* Never let the rail's content widen its sidebar grid track. */
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

/* Match the sibling sidebar headings exactly: .sidebar-box h4 already gives the
   #000 colour, gold/navy underline, inline-block and margin; About/Join only
   add font-size:1.3rem inline, so we mirror that and inherit font + weight.
   Two-class selector (0,2,0) so it beats `.sidebar-box h4` (0,1,1). */
.f411-rp .f411-rp__title {
    font-size: 1.3rem;
}

/* Small, gray aircraft links under the heading line. Hover -> navy, no
   underline (overrides the global a:hover underline). Separated by a middot. */
.f411-rp__aircraft {
    margin: -8px 0 16px;
    /* flex drops the whitespace-only text nodes between the <a> tags, so the
       separator dot ends up evenly spaced on both sides. */
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    line-height: 1.6;
}
.f411-rp__aircraft a,
.f411-rp__aircraft span {
    font-size: 0.78rem;
    text-decoration: none;
}
/* Plain text (aircraft we don't stock) = gray, not clickable. */
.f411-rp__aircraft span {
    color: #6b7280;
}
/* Clickable (we stock it) = blue + arrow icon so it's an obvious link. */
.f411-rp__aircraft a {
    display: inline-block;
    color: var(--rp-navy);
    font-weight: 600;
    transition: color 0.15s ease, transform 0.18s ease;
    will-change: transform;
}
.f411-rp__aircraft a:hover,
.f411-rp__aircraft a:focus {
    color: #1b2f7a;            /* darker navy */
    text-decoration: none;
    transform: translateY(-2px); /* gentle levitate */
}
.f411-rp__ac-ico {
    font-size: 0.58em;          /* smaller */
    margin-left: 3px;
    vertical-align: middle;     /* sit level with the text, not raised */
}
.f411-rp__aircraft > :not(:last-child)::after {
    content: "•";
    color: #9aa0b3;
    margin: 0 8px;        /* symmetric on both sides of the dot */
    font-size: 0.6em;
    vertical-align: middle;
}

/* ---- Carousel ---- */
.f411-rp-carousel {
    position: relative;
}

.f411-rp-carousel__viewport {
    overflow: hidden;
    border-radius: 10px;
    /* min-width:0 keeps this scroll container from contributing its track's
       full min-content to the sidebar grid track (which would starve the
       article column). Paired with min-width:0 on the slides below. */
    min-width: 0;
}

.f411-rp-carousel__track {
    display: flex;
    min-width: 0;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.f411-rp-slide {
    /* flex-basis 100% gives one card per view; min-width:0 (NOT 100%) lets the
       flex track's min-content stay small so it can't blow out the layout. */
    flex: 0 0 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 2px;
}

/* ---- Compact product card ---- */
.f411-rp-card {
    font-family: "Plus Jakarta Sans", "Source Sans Pro", system-ui, -apple-system, sans-serif;
    display: block;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--rp-line);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.f411-rp-card:hover {
    border-color: var(--rp-navy);
    box-shadow: 0 8px 20px rgba(40, 67, 167, 0.12);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.f411-rp-card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #f4f5fa;
    overflow: hidden;
}

.f411-rp-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Small, sleek, non-intrusive corner badge. Reusable slot — variants below
   cover Featured / Catalog / Suggested today; add Sale/Discount the same way. */
.f411-rp-card__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1;
    padding: 3px 7px;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.f411-rp-card__badge.is-featured  { background: #b8860b; color: #fff; }                 /* gold, matches #560 */
.f411-rp-card__badge.is-catalog   { background: rgba(255, 255, 255, 0.92); color: #2843a7; border: 1px solid rgba(40, 67, 167, 0.3); } /* subtle "quote-able catalog" */
.f411-rp-card__badge.is-suggested { background: rgba(26, 26, 46, 0.6); color: #fff; }    /* muted */
.f411-rp-card__badge.is-sale      { background: #d63838; color: #fff; }                  /* future */
.f411-rp-card__badge.is-discount  { background: #d97706; color: #fff; }                  /* future */

.f411-rp-card__body {
    padding: 12px 14px 14px;
}

.f411-rp-card__cat {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--rp-muted);
    margin-bottom: 3px;
}

.f411-rp-card__name {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--rp-ink);
    margin: 0 0 8px;
    /* Always reserve exactly two lines so every card's footer (price + CTA)
       sits at the same height; names longer than two lines get an ellipsis. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em; /* 2 lines x 1.3 line-height */
}

.f411-rp-card__meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.f411-rp-card__price {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--rp-navy);
}

.f411-rp-card__cta {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--rp-navy);
    white-space: nowrap;
}

/* ---- Carousel controls ---- */
.f411-rp-carousel__btn {
    position: absolute;
    top: 36%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #fff;
    color: var(--rp-navy);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: background 0.15s ease, color 0.15s ease;
}

.f411-rp-carousel__btn:hover {
    background: var(--rp-navy);
    color: #fff;
}

.f411-rp-carousel__btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.f411-rp-carousel__btn--prev { left: 6px; }
.f411-rp-carousel__btn--next { right: 6px; }

.f411-rp-carousel__dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 12px;
}

.f411-rp-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: var(--rp-line);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.f411-rp-dot.is-active {
    background: var(--rp-navy);
    transform: scale(1.3);
}

/* ---- Secondary "same manufacturer" list ---- */
.f411-rp-more {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--rp-line);
}

.f411-rp-more__title {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--rp-ink);
    margin: 0 0 10px;
}

.f411-rp-mini {
    font-family: "Plus Jakarta Sans", "Source Sans Pro", system-ui, -apple-system, sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    padding: 7px;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.f411-rp-mini:hover {
    background: rgba(40, 67, 167, 0.05);
    text-decoration: none;
    color: inherit;
}

.f411-rp-mini__thumb {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 7px;
    object-fit: cover;
    background: #f4f5fa;
}

.f411-rp-mini__info {
    min-width: 0;
}

.f411-rp-mini__name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--rp-ink);
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.f411-rp-mini__price {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--rp-navy);
    margin-top: 2px;
}

/* On mobile the sidebar drops below the article (position: static); keep the
   rail full-width and tidy. */
@media (max-width: 900px) {
    .f411-rp {
        margin-top: 24px;
    }
}

/* ---- Mobile sticky banner (issue #584) ----
   The stacked layout pushes the rail to the page bottom, so a compact fixed
   banner keeps a product in view while reading and hands off to the full card
   on scroll. Shown only on the stacked breakpoint (<=992px, where
   .article-container collapses to one column). JS drives transform + opacity
   from scroll position (no CSS transition, so it tracks scroll without lag). */
.f411-rp-banner { display: none; }

@media (max-width: 992px) {
    .f411-rp-banner {
        display: flex;
        align-items: center;
        gap: 10px;
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 12px;
        z-index: 1200;
        background: #fff;
        border: 1px solid #e6e8f0;
        border-radius: 12px;
        box-shadow: 0 8px 28px rgba(40, 67, 167, 0.18);
        padding: 8px 10px;
        font-family: "Plus Jakarta Sans", "Source Sans Pro", system-ui, -apple-system, sans-serif;
        transform: translateY(160%);   /* hidden by default; JS reveals on scroll */
        opacity: 0;
        will-change: transform, opacity;
        pointer-events: none;
    }
    .f411-rp-banner.is-visible { pointer-events: auto; }

    .f411-rp-banner__link,
    .f411-rp-banner__link:hover,
    .f411-rp-banner__link:focus {
        display: flex;
        align-items: center;
        gap: 10px;
        flex: 1;
        min-width: 0;
        /* :hover/:focus included so the global `a:hover{text-decoration:underline}`
           (style.css) can't underline the banner. */
        text-decoration: none;
        color: inherit;
        transition: opacity 0.2s ease; /* crossfade between rotating products */
    }
    .f411-rp-banner__thumb {
        flex: 0 0 46px;
        width: 46px;
        height: 46px;
        border-radius: 8px;
        object-fit: cover;
        background: #f4f5fa;
    }
    .f411-rp-banner__info {
        min-width: 0;
        display: flex;
        flex-direction: column;
    }
    .f411-rp-banner__label {
        font-size: 0.62rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: #2843a7;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .f411-rp-banner__name {
        font-size: 0.85rem;
        font-weight: 700;
        color: #1a1a2e;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .f411-rp-banner__price {
        font-size: 0.82rem;
        font-weight: 800;
        color: #2843a7;
        white-space: nowrap;
        margin-left: auto;
    }
    .f411-rp-banner__cta {
        font-size: 1rem;
        font-weight: 800;
        color: #2843a7;
        padding: 0 2px;
    }
    .f411-rp-banner__close {
        flex: 0 0 auto;
        border: none;
        background: #f0f1f6;
        color: #6b7280;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        font-size: 15px;
        line-height: 1;
        cursor: pointer;
    }
}
