/*
 * Valve Sales - Umbraco Block Grid wrapper neutralisation.
 *
 * The framework's Block Grid renders layout wrappers around every block:
 *   gridBlock.cshtml   -> <div class="columns has-12-columns actual-cols-N">
 *   gridColumn.cshtml  -> <div class="grid-col-content">
 * plus Umbraco's own .umb-block-grid* containers.
 *
 * ".columns" is a Bulma flex row in the framework bundle. Valve Sales page sections are
 * full-width blocks that expect to be ordinary block-level children, so the flex context
 * would change their widths and spacing.
 *
 * Everything here is scoped under .vsa, so it only affects Valve Sales pages and cannot
 * alter the existing framework pages. This file is loaded after vsa-home.css.
 */

.vsa .columns,
.vsa .grid-col-content,
.vsa .umb-block-grid,
.vsa .umb-block-grid__layout-container,
.vsa .umb-block-grid__layout-item,
.vsa .umb-block-grid__area-container,
.vsa .umb-block-grid__area {
    display: block;
    margin: 0;
    padding: 0;
    width: auto;
    max-width: none;
    gap: 0;
}

/* The per-block wrapper emitted by the component partials. */
.vsa .grid-component {
    margin: 0;
    padding: 0;
}

/* Grid areas are laid out with CSS grid by Umbraco's default stylesheet; collapse that
   to a single full-width column so sections stack exactly as they do in the source. */
.vsa .umb-block-grid__area-container,
.vsa .umb-block-grid__layout-container {
    grid-template-columns: 1fr !important;
    grid-auto-flow: row;
}

/*
 * Heading top margins.
 *
 * Umbraco renders the Grid Column's area as <div class="umb-column content">, and the
 * framework bundle (/dev/style.css) styles ".content" as prose:
 *     .content h1:not(:first-child){margin-top:1em}
 *     .content h2:not(:first-child){margin-top:1.1428em}
 * At (0,2,1) those beat the Valve Sales reset ".vsa h1,.vsa h2,.vsa h3,.vsa h4{margin:0}"
 * at (0,1,1), so every heading on every page sat about 48-51px lower than designed and
 * each page ran 6-10% taller than the approved build. Measured against
 * https://prettyagency.github.io/valvesales/ : h1 51.2px vs 0, h2 47.54px vs 0.
 *
 * Only margin-top is affected. The framework's ".content h1{margin-bottom:.5em}" is
 * (0,1,1), the same as the Valve Sales reset, and vsa-home.css loads later, so the bottom
 * margins already match.
 *
 * Scoped to .vsa and to the column area, so framework pages are untouched.
 */
.vsa .umb-column.content h1:not(:first-child),
.vsa .umb-column.content h2:not(:first-child),
.vsa .umb-column.content h3:not(:first-child),
.vsa .umb-column.content h4:not(:first-child),
.vsa .umb-column.content h5:not(:first-child),
.vsa .umb-column.content h6:not(:first-child) {
    margin-top: 0;
}

/* The one heading the Valve Sales design does give a top margin: the values grid on the
   History page (".vsa .values h3{margin:16px 0 8px}"). Same specificity as the rule above,
   so it has to come after it. */
.vsa .umb-column.content .values h3 {
    margin-top: 16px;
}

/*
 * Horizontal insets from the framework's Block Grid layout wrappers.
 *
 * gridBlock.cshtml wraps every block in <div class="container"> and a Bulma
 * <div class="column is-12">:
 *     .container{padding-left:var(--pf-container-padding);padding-right:…;max-width:1152px}
 *     .column{padding:var(--bulma-column-gap)}
 * That took 16px + 12px off each side, so at 390px the Valve Sales sections were laid out
 * in 334px instead of 390px. Nothing looked broken - the text simply wrapped onto more
 * lines, which made every page 7-13% taller than the approved build at mobile and shifted
 * every line break. Measured against https://prettyagency.github.io/valvesales/ .
 *
 * Valve Sales sections are full-bleed: each one manages its own gutter through .wrap.
 */
.vsa .container,
.vsa .column {
    padding-left: 0;
    padding-right: 0;
    /*
     * Bulma caps the container with
     *     .container:not(.is-max-tablet):not(.is-max-desktop){max-width:1152px}
     * and raises it per breakpoint - 1344px at 1408px wide. That selector is (0,3,0) and
     * outranks ".vsa .container" at (0,2,0), so without !important the cap survived and
     * the sections were 1344px inside a 1440px viewport: every full-width band, including
     * the soft-background ones, stopped 48px short of each edge.
     *
     * Zeroing the cap also removes the centring margins, which only existed because the
     * container was narrower than its parent.
     */
    max-width: none !important;
}

/*
 * Bulma's prose rules on .content - the class Umbraco puts on the Grid Column's area
 * wrapper (<div class="umb-column content">). They indent lists by 2em and add block
 * margins the Valve Sales design does not use; the approved build has none of them,
 * because it never loads the framework bundle.
 *
 * Only spacing is reset. List markers are left alone: a list in rich text should still
 * show its default marker, exactly as it does in the approved build.
 */
.vsa .umb-column.content ul,
.vsa .umb-column.content ol,
.vsa .umb-column.content dd {
    margin-inline-start: 0;
}

.vsa .umb-column.content ul:not(:first-child),
.vsa .umb-column.content ol:not(:first-child) {
    margin-top: 0;
}

.vsa .umb-column.content ul:not(:last-child),
.vsa .umb-column.content ol:not(:last-child),
.vsa .umb-column.content table:not(:last-child) {
    margin-bottom: 0;
}

.vsa .umb-column.content li + li {
    margin-top: 0;
}

/*
 * Typeface of body copy and links.
 *
 * The Valve Sales design sets its typeface once, on .vsa, and lets everything inherit it.
 * The framework bundle instead sets font-family directly on the elements:
 *     p { font-family: <Work Sans> }
 *     a { font-family: <Manrope> }
 * A declaration on the element always beats an inherited value, however specific the
 * ancestor's rule is, so every paragraph on every page rendered in Work Sans and every
 * link in Manrope instead of the design's Inter stack.
 *
 * It also moved the text: the ledes are measure-limited in ch units, and ch is the width of
 * the "0" glyph in the font actually used - 10.94px in Work Sans against 9.48px in the
 * Inter stack - so the lede ran 679px wide where the approved build gives it 588px, and
 * every line broke in a different place.
 *
 * "inherit" hands these back to .vsa. Valve Sales' own rules for headings and buttons are
 * more specific than this, so they are unaffected.
 *
 * Measured against https://prettyagency.github.io/valvesales/ .
 */
.vsa p,
.vsa a {
    font-family: inherit;
}

/*
 * Class-name collision: ".tag".
 *
 * Valve Sales uses .tag for the footer tagline. The framework bundle also ships Bulma,
 * whose .tag is a small chip component, so the tagline rendered as a light grey rounded
 * pill (#f3f4f6, 6px radius, inline-flex, 2em tall, nowrap, horizontal padding) on the
 * dark footer, at 12px instead of the inherited 14.88px.
 *
 * The Valve Sales rule (".vsa-footer .tag") sets colour, family and weight but nothing
 * that contradicts the chip, so every chip property survived. This returns the element to
 * the plain block paragraph the approved build renders.
 */
.vsa-footer .tag {
    display: block;
    height: auto;
    min-height: 0;
    padding: 0;
    background-color: transparent;
    border-radius: 0;
    white-space: normal;
    font-size: inherit;
    line-height: inherit;
}
