/* ============================================================================
   brand.landing.css  -  the data-driven brand landing page (brand.cfm)
   ----------------------------------------------------------------------------
   Replaces twelve hand-written per-brand includes, each with its own inline
   <style> block, with one layout that takes its personality from DATA:
   Octane_Brands_Cache.primaryColour / logoBackgroundColour.

   HOW THE BRAND COLOUR WORKS
   --------------------------
   brand.cfm sets two custom properties on the hero element:

       --brand-colour     the brand's primaryColour, or --oct-ink if unset
       --brand-ink        #fff or near-black, whichever reads on that colour

   --brand-ink is computed SERVER-SIDE from the colour's relative luminance,
   not guessed here, because the palette genuinely spans both ends: Whiteline
   is #fae347 (bright yellow, needs dark text) and Blue Print is #002873 (navy,
   needs white). A single hard-coded text colour makes one of those unreadable,
   which is exactly the kind of thing that survives for years because whoever
   picked it only ever looked at one brand.

   Nine of the eighteen visible brands have no synopsis and most have no
   fulldetail, so every content block here must collapse cleanly to nothing.
   The page is built to look deliberate when it is mostly empty -- that is its
   normal state today, not an edge case.
============================================================================ */

/* ============================================================================
   HERO
============================================================================ */
.brand-hero {
    /* Fallbacks matter: a brand with no primaryColour still gets a hero rather
       than a transparent band with invisible text. */
    --brand-colour: var(--oct-ink);
    --brand-ink: #ffffff;

    background: var(--brand-colour);
    color: var(--brand-ink);
    padding: var(--oct-space-7) 0;
    margin-bottom: var(--oct-space-6);
    text-align: left;
}

.brand-hero-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--oct-space-6);
}

/* The logo plate. Brand logos are supplied on assorted backgrounds, so it sits
   on its own surface rather than directly on the brand colour -- a white-on-
   transparent logo vanishes into a light brand colour otherwise. */
.brand-hero-logo {
    flex: 0 0 auto;
    background: var(--oct-surface);
    border-radius: var(--oct-radius);
    padding: var(--oct-space-4) var(--oct-space-5);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    min-height: 96px;
}
.brand-hero-logo img {
    display: block;
    max-width: 220px;
    max-height: 80px;
    width: auto;
    height: auto;
}

.brand-hero-text { flex: 1 1 340px; min-width: 0; }

/* Breadcrumb trail, rendered by includes/breadcrumb.trail.cfm in its "hero"
   style. Same rules as .listing-crumb in css/listing.hero.css -- repeated
   here rather than pulled in, because this page does not load that sheet and
   one more render-blocking stylesheet costs more than six lines. currentColor
   at reduced opacity, not a fixed white, so it survives a light brand colour
   (Whiteline yellow) as readily as a dark one. */
.brand-hero .listing-crumb {
    margin: 0 0 var(--oct-space-2);
    font-size: var(--oct-text-sm);
    line-height: 1.5;
    text-align: left;
    opacity: .82;
}
.brand-hero .listing-crumb a {
    color: var(--brand-ink);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.brand-hero .listing-crumb a:hover { opacity: 1; }
.brand-hero .listing-crumb .sep { margin: 0 var(--oct-space-1); }
.brand-hero .listing-crumb [aria-current="page"] { font-weight: 600; }

.brand-hero h1 {
    display: block;
    width: auto;
    margin: 0 0 var(--oct-space-3);
    font-size: var(--oct-h1);
    font-weight: 700;
    line-height: 1.15;
    color: var(--brand-ink);
    text-align: left;
}

/* Secondary call to action, used by the discontinued-brand notice where the
   page offers two ways onward instead of one way to buy. */
.brand-hero-cta--quiet {
    background: transparent;
    border: 1px solid var(--brand-ink);
    color: var(--brand-ink);
}
.brand-hero-cta--quiet:hover { background: rgba(255, 255, 255, .15); }

.brand-hero-lead {
    max-width: var(--oct-measure);
    margin: 0 0 var(--oct-space-4);
    font-size: var(--oct-text-md);
    line-height: 1.6;
    /* Slightly held back from the heading without introducing a second colour
       that might fail contrast on an arbitrary brand background. */
    opacity: .92;
}

.brand-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--oct-space-3);
}

.brand-hero-count {
    display: inline-block;
    border: 1px solid currentColor;
    border-radius: var(--oct-radius-pill);
    padding: 5px 14px;
    font-size: var(--oct-text-sm);
    opacity: .9;
}

/* Hero CTA. Inverted: the brand colour is already the background, so the
   button uses the ink colour as its fill to stay legible on any brand. */
.brand-hero-cta {
    display: inline-block;
    background: var(--brand-ink);
    color: var(--brand-colour);
    font-size: var(--oct-text-base);
    font-weight: 700;
    padding: 13px 28px;
    border-radius: var(--oct-radius-sm);
    text-decoration: none;
    border: 2px solid var(--brand-ink);
}
.brand-hero-cta:hover {
    background: transparent;
    color: var(--brand-ink);
}

@media (max-width: 640px) {
    .brand-hero      { padding: var(--oct-space-6) 0; }
    .brand-hero h1   { font-size: var(--oct-h1-mobile); }
    .brand-hero-inner { gap: var(--oct-space-4); }
    .brand-hero-logo { min-width: 140px; min-height: 72px; padding: var(--oct-space-3); }
}

/* ----------------------------------------------------------------------------
   HERO SKINS
   ----------------------------------------------------------------------------
   For brands whose identity is a TREATMENT, not a colour. Applied by
   brandHeroSkins in brand.cfm; see the note there for when one is justified.

   A skin must set BOTH --brand-colour and --brand-ink, because they are read
   well beyond the hero: the platform chips, the loading spinner and the hero
   CTA all theme off them. Setting only the background gives you a black hero
   with, say, red chips underneath it.
---------------------------------------------------------------------------- */

/* ----------------------------------------------------------------------------
   THE BAND  (.brand-hero-band, --photo / --colour, the overlays, the mobile
   crop) has MOVED to css/brand.hero.band.css, which brand.cfm, range.cfm and
   brand.products.cfm all load before their own stylesheet - a range page now
   carries the same banner as its brand page. Only the hand-built Milltek
   carbon skin stays here, because brand.cfm is the only page that renders it.
---------------------------------------------------------------------------- */

/* Milltek. Carbon fibre and black is the brand -- it is what the old
   hand-written Milltek include used, and what millteksport.com looks like.

   THREE LAYERS, painted first-listed on TOP:

     1. the carbon weave, now TRANSLUCENT (it was solid #1a1a1a/#111) so it
        reads as a texture over the photo rather than instead of it;
     2. a left-to-right legibility ramp, dark under the logo plate and the
        heading, opening up towards the right where the car sits;
     3. the photograph.

   The photo is images/backgrounds/vehicles.hero.jpg -- a 911 in a tunnel from
   MILLTEK'S OWN supplier photography, which is why it belongs here and not
   just on platform.cfm, where it is the generic hero.

   The ramp is lighter than the one in css/platform.css (.86/.62/.30/.42) that
   uses the same picture, because the weave above it already contributes
   roughly a quarter of a stop. Composited they land in about the same place;
   change one and check the other still reads.

   The band is roughly half again as tall as the hero alone, so `cover` shows
   more of the frame than it used to - the road under the car now reads, which
   is what the selector sits on. */
.brand-hero-band--carbon {
    background-color: #000;
    background-image:
        repeating-linear-gradient(
            135deg,
            rgba(255, 255, 255, .05) 0px,
            rgba(255, 255, 255, .05) 2px,
            rgba(0, 0, 0, .30)       2px,
            rgba(0, 0, 0, .30)       8px
        ),
        linear-gradient(90deg,
            rgba(0, 0, 0, .90)  0%,
            rgba(0, 0, 0, .84) 40%,
            rgba(0, 0, 0, .40) 72%,
            rgba(0, 0, 0, .28) 100%),
        url("../images/backgrounds/vehicles.hero.jpg");
    background-size: auto, auto, cover;
    background-position: 0 0, 0 0, center 58%;   /* 58% keeps the tail lights in the band */
    background-repeat: repeat, no-repeat, no-repeat;
    margin-bottom: var(--oct-space-7);
}

/* The selector's own black panel would cut a hard-edged box out of the photo,
   which is exactly the seam the band exists to remove. It keeps a soft
   downward wash instead: enough to ground the white labels over whatever part
   of the frame lands behind them, not enough to read as a separate surface. */
.brand-hero-band--carbon .milltek-selector {
    background-color: transparent;
    background-image: linear-gradient(to bottom, rgba(0, 0, 0, .10), rgba(0, 0, 0, .55));
}

@media (max-width: 900px) {
    /* Smaller file (71KB vs 219KB), and a flatter wash: at this width the text
       runs the full measure, so there is no clear right-hand side to leave
       open for the car. */
    .brand-hero-band--carbon {
        background-image:
            repeating-linear-gradient(
                135deg,
                rgba(255, 255, 255, .05) 0px,
                rgba(255, 255, 255, .05) 2px,
                rgba(0, 0, 0, .30)       2px,
                rgba(0, 0, 0, .30)       8px
            ),
            linear-gradient(90deg, rgba(0, 0, 0, .82) 0%, rgba(0, 0, 0, .54) 100%),
            url("../images/backgrounds/vehicles.hero.mobile.jpg");
    }
}

.brand-hero--carbon {
    --brand-colour: #111111;
    --brand-ink: #ffffff;
}

/* Red is Milltek's one accent - it is already the Search button on the
   selector directly below this. The default CTA (ink fill, brand-colour text)
   would be a white button with near-black text on a black hero: correct, and
   completely inert. */
.brand-hero--carbon .brand-hero-cta {
    background: #e12828;
    border-color: #e12828;
    color: #ffffff;
}
.brand-hero--carbon .brand-hero-cta:hover {
    background: transparent;
    color: #ffffff;
}

/* ============================================================================
   THE BRAND'S OWN VEHICLE SELECTOR
   ----------------------------------------------------------------------------
   Sits between the hero and the platform strip. Each brand's selector brings
   its own full-bleed layout (Milltek's bar, Powerflex's photo/selector split),
   so this wrapper only owns the rhythm around it -- deliberately no padding,
   background or width of its own to fight with.

   The hero has margin-bottom, so pull the selector up against it: they are one
   idea (this is the brand, here is your car) and a gap between them reads as
   two unrelated blocks.
============================================================================ */
.brand-own-selector {
    margin: calc(var(--oct-space-6) * -1) 0 var(--oct-space-7);
}

/* ============================================================================
   PLATFORM STRIP  -  "what we do for the cars people actually have"
============================================================================ */
.brand-platforms { margin: var(--oct-space-7) 0; }

/* The hint sits WITH the heading, not opposite it. space-between threw it to
   the far right of a 1632px container, where it read as unrelated furniture
   rather than as a caption on the heading it belongs to. flex-start keeps the
   pair together and lets the hint wrap underneath on narrow screens. */
.brand-platforms-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-start;
    gap: var(--oct-space-2) var(--oct-space-4);
    margin-bottom: var(--oct-space-4);
}
/* Scoped to the head block, NOT `.brand-platforms h2`.
   The product grid renders inside .brand-platform-panel, which is inside
   .brand-platforms, so the looser selector also matched every card title --
   and because it sets text-align directly on the h2, it beat the centring the
   cards only INHERIT from .prod-item (a direct rule wins over an inherited
   value whatever the specificity). Result: left-aligned card headings.
   Keep any styling for this section's own heading inside .brand-platforms-head. */
.brand-platforms-head h2 {
    display: block;
    width: auto;
    margin: 0;
    font-size: var(--oct-h2);
    font-weight: 700;
    line-height: 1.2;
    color: var(--oct-ink);
    text-align: left;
}
.brand-platforms-hint {
    margin: 0;
    font-size: var(--oct-text-sm);
    color: var(--oct-ink-mute);
}

.brand-platform-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--oct-space-2);
    list-style: none;
    margin: 0 0 var(--oct-space-5);
    padding: 0;
}

/* Buttons, not links: choosing a platform swaps the grid below in place. The
   "see everything" link out to platform.cfm lives inside the loaded panel. */
.brand-platform-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    border: 1px solid var(--oct-line);
    background: var(--oct-surface);
    border-radius: var(--oct-radius-pill);
    padding: 9px 16px;
    font: inherit;
    font-size: var(--oct-text-base);
    color: var(--oct-ink);
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.brand-platform-chip:hover {
    border-color: var(--brand-colour, var(--oct-ink));
}
.brand-platform-chip[aria-pressed="true"] {
    background: var(--brand-colour, var(--oct-ink));
    border-color: var(--brand-colour, var(--oct-ink));
    color: var(--brand-ink, #fff);
}
.brand-platform-chip .count {
    font-size: var(--oct-text-sm);
    opacity: .7;
}

/* The swap-in target. Min-height stops the page jumping as grids of different
   sizes replace each other. */
.brand-platform-panel { min-height: 120px; }

.brand-platform-panel .bp-empty {
    padding: var(--oct-space-5);
    background: var(--oct-surface-alt);
    border: 1px solid var(--oct-line);
    border-radius: var(--oct-radius);
    color: var(--oct-ink-mute);
    font-size: var(--oct-text-base);
}
.brand-platform-panel .bp-empty p { margin: 0; }

/* ---- the loaded panel's own header ------------------------------------
   Platform name on the left, the way through to the full platform page on
   the right, then a line saying what the dozen cards below actually are. */
.brand-platform-panel .bp-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--oct-space-3);
    padding-bottom: var(--oct-space-3);
    border-bottom: 1px solid var(--oct-line);
    margin-bottom: var(--oct-space-3);
}

.brand-platform-panel .bp-title {
    /* Overrides the global h3; the legacy base sizes headings inconsistently
       and centres them inside .fixedwidth. */
    display: block;
    width: auto;
    margin: 0;
    font-size: var(--oct-h3);
    font-weight: 700;
    line-height: 1.2;
    color: var(--oct-ink);
    text-align: left;
}

/* Solid, so it reads as a button. The ghost variant was a faint outline that
   disappeared against the page next to the site's default dark buttons. */
.brand-platform-panel .bp-seeall {
    flex: 0 0 auto;
    font-size: var(--oct-text-sm);
    padding: 10px 20px;
}

.brand-platform-panel .bp-note {
    margin: 0 0 var(--oct-space-4);
    font-size: var(--oct-text-sm);
    color: var(--oct-ink-mute);
}
.brand-platform-panel .bp-note strong { color: var(--oct-ink); }

@media (max-width: 640px) {
    .brand-platform-panel .bp-head { align-items: flex-start; }
    .brand-platform-panel .bp-seeall { width: 100%; text-align: center; }
}

/* Loading state - matches the branded spinner used by the other browse panels. */
.brand-platform-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--oct-space-3);
    padding: var(--oct-space-6);
    color: var(--oct-ink-mute);
    font-size: var(--oct-text-base);
}
.brand-platform-loading::before {
    content: "";
    width: 22px;
    height: 22px;
    border: 3px solid var(--oct-line);
    border-top-color: var(--brand-colour, var(--oct-accent));
    border-radius: 50%;
    animation: brand-platform-spin .7s linear infinite;
}
@keyframes brand-platform-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .brand-platform-loading::before { animation-duration: 3s; }
}

/* ============================================================================
   EDITORIAL
============================================================================ */
.brand-detail {
    margin: var(--oct-space-7) 0;
}
.brand-detail h2 {
    display: block;
    width: auto;
    margin: 0 0 var(--oct-space-3);
    font-size: var(--oct-h2);
    font-weight: 700;
    color: var(--oct-ink);
    text-align: left;
}
/* FullDetail is admin-authored rich text, so style the tags it may contain
   rather than assuming a structure. */
.brand-detail-body {
    max-width: var(--oct-measure);
    font-size: var(--oct-text-md);
    line-height: 1.6;
    color: var(--oct-ink);
}
.brand-detail-body p  { margin: 0 0 var(--oct-space-4); }
.brand-detail-body h3 { font-size: var(--oct-h3); margin: var(--oct-space-5) 0 var(--oct-space-2); }
.brand-detail-body ul,
.brand-detail-body ol { margin: 0 0 var(--oct-space-4) var(--oct-space-5); }
.brand-detail-body li { margin-bottom: var(--oct-space-1); }
.brand-detail-body img { max-width: 100%; height: auto; border-radius: var(--oct-radius-sm); }
.brand-detail-body a  { color: var(--oct-accent); }

/* ============================================================================
   SECTION RHYTHM
   Replaces the <div style="height:64px"> spacers the old per-brand includes
   used - see rule 4 in css/foundations.css.
============================================================================ */
.brand-section { margin: var(--oct-space-7) 0; }
.brand-section:last-child { margin-bottom: var(--oct-space-8); }

/* ============================================================================
   PRODUCT RANGES  (added 2026-08-13)
   ----------------------------------------------------------------------------
   The manufacturer's own product lines -- DBA Street Series / 4000 Series /
   Xtreme Performance -- each linking to its own landing page (range.cfm).
   Data-driven from Octane_Product_Ranges, so a brand with no ranges renders
   nothing at all rather than an empty strip.

   CARDS, NOT CHIPS. The platform strip below uses chips because picking one
   swaps a panel in place; these are NAVIGATION to a separate page, and each
   carries a tagline that a chip has no room for. Making them look like the
   chips would promise the same in-place behaviour and then not deliver it.

   The heading rules are scoped to .brand-ranges-head for the same reason the
   platform ones are -- see the note above .brand-platforms-head.
============================================================================ */
.brand-ranges { margin: var(--oct-space-7) 0; }

.brand-ranges-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-start;
    gap: var(--oct-space-2) var(--oct-space-4);
    margin-bottom: var(--oct-space-4);
}
.brand-ranges-head h2 {
    display: block;
    width: auto;
    margin: 0;
    font-size: var(--oct-h2);
    font-weight: 700;
    line-height: 1.2;
    color: var(--oct-ink);
    text-align: left;
}
.brand-ranges-hint {
    margin: 0;
    font-size: var(--oct-text-sm);
    color: var(--oct-ink-mute);
}

.brand-range-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--oct-grid-min), 1fr));
    gap: var(--oct-space-4);
}

.brand-range-list a {
    display: flex;
    flex-direction: column;
    gap: 4px;
    height: 100%;
    padding: var(--oct-space-4);
    background: var(--oct-surface);
    border: 1px solid var(--oct-line);
    border-radius: var(--oct-radius);
    text-decoration: none;
    color: inherit;
    text-align: left;
}
.brand-range-list a:hover {
    border-color: var(--oct-accent);
    box-shadow: var(--oct-shadow);
}

/* Optional range image (Octane_Product_Ranges.HeroImage). A fixed 4:3 frame
   with the product photo CONTAINED in it, so a square filter shot and a
   landscape induction-kit shot sit at the same height across the row. White
   backing because the product library is shot on white; the frame edge is
   the card's own line colour so it reads as part of the card, not a sticker. */
.brand-range-img {
    display: block;
    aspect-ratio: 4 / 3;
    margin: calc(-1 * var(--oct-space-4)) calc(-1 * var(--oct-space-4)) var(--oct-space-3);
    background: #fff;
    border-bottom: 1px solid var(--oct-line);
    border-radius: var(--oct-radius) var(--oct-radius) 0 0;
    overflow: hidden;
}
.brand-range-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: var(--oct-space-3);
    box-sizing: border-box;
}

.brand-range-name {
    font-size: var(--oct-text-md);
    font-weight: 700;
    color: var(--oct-ink);
}
.brand-range-tag {
    font-size: var(--oct-text-sm);
    line-height: 1.5;
    color: var(--oct-ink-mute);
}
/* margin-top:auto pins the count to the bottom so cards with a one-line and a
   three-line tagline still line their counts up. */
.brand-range-count {
    margin-top: auto;
    padding-top: var(--oct-space-2);
    font-size: var(--oct-text-xs);
    color: var(--oct-ink-faint);
}
