/*
    TrakHound Site : Global Styles

    Design Tokens ........ :root variables used by every stylesheet
    Base ................. html, body, links, headings
    Buttons .............. .btn, .btn-primary, .btn-secondary (+ .on-dark variants)
    Pills ................ .pill badges
    Banner Link Cards .... .banner-link-card (link cards on dark Banners)
    Sections ............. .section page sections
    Code Blocks .......... pre.code command and code examples

    Breakpoints : 1600px (wide), 1200px (desktop), 1000px (tablet), 600px (phone)
    Component specific styles live in each component's scoped .razor.css file.
*/


/* Design Tokens */
:root {
    /* Brand */
    --accent: #2870bd;
    --accentLight: #428ad7;
    --accentVeryLight: #80d4ff;
    --accentDark: #1b4b7e;
    --accentVeryDark: #004d99;
    --accentSoft: #eaf2fb;
    --sponsorColor: rgb(255, 81, 110);

    /* Text */
    --textStrong: #222;
    --textColor: #333;
    --textMuted: #555;
    --textSubtle: #6b7785;
    --textFaint: #9aa7b5;

    /* Surfaces & Borders */
    --surface: #fff;
    --surfaceMuted: #f5f7fa;
    --surfaceMedium: #eee;
    --border: #e3e7ec;
    --borderStrong: #ccd3dc;

    /* Status */
    --success: #1fa84f;
    --danger: #d33;

    /* Shape */
    --radiusSmall: 4px;
    --radius: 8px;
    --radiusLarge: 12px;
    --radiusPill: 20px;
    --shadowCard: 0 12px 30px rgba(0, 0, 0, 0.2);
    --shadowPopup: 0 16px 40px rgba(0, 30, 70, 0.18);
    --shadowFloating: 0 30px 70px rgba(0, 0, 0, 0.35);

    /* Layout */
    --headerHeight: 75px;
    --headerLinkSize: 16px;

    /* Banners (dark backgrounds) */
    --bannerBackground: #004080;
    --bannerTextColor: #ebf1f9;
    --bannerTextAlternateColor: var(--accentVeryLight);
    --bannerBorderLight: #89addc;
    --bannerGlass: rgba(255, 255, 255, 0.07);
    --bannerGlassHover: rgba(255, 255, 255, 0.13);
    --bannerGlassBorder: rgba(255, 255, 255, 0.14);
    --bannerPill: rgba(128, 212, 255, 0.12);
    --bannerPillBorder: rgba(128, 212, 255, 0.35);

    /* Footer */
    --footerBackgroundStart: #004d99;
    --footerBackgroundEnd: #004080;
    --footerBackgroundLight: #2a528b;
    --footerTextColor: #ebf1f9;
    --footerTextHoverColor: var(--accentVeryLight);

    /* Tables */
    --tableBackground: #fff;
    --tableBorder: #eee;
    --tableHeader: #333;
    --tableText: #333;
    --tableLink: var(--accent);
}


/* Base */
html,
body {
    text-align: center;
    font-family: Roboto, Arial, Helvetica, sans-serif;
    padding: 0;
    margin: 0;
    background: var(--surface);
}

html,
body,
.app,
main {
    height: 100%;
}

a {
    color: var(--accent);
    text-decoration: none;
}

    a:hover {
        color: var(--accentDark);
        text-decoration: underline;
    }

/* Images have width and height attributes (see SiteImage) so space is kept while they load; CSS sets the displayed size and keeps the shape */
img {
    height: auto;
}

h1 {
    color: #444;
    font-weight: 400;
}

h2 {
    color: var(--textColor);
    font-weight: 400;
    padding-top: 20px;
}

h3 {
    color: #444;
    padding-top: 0;
    font-weight: 400;
}


/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: 1px solid transparent;
    border-radius: var(--radiusSmall);
    font-family: inherit;
    font-size: 15px;
    line-height: 24px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

    .btn:hover {
        text-decoration: none;
    }

    .btn .icon {
        margin-left: 10px;
    }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

    .btn-primary:hover {
        background: var(--accentLight);
        border-color: var(--accentLight);
        color: #fff;
    }

.btn-secondary {
    background: var(--surface);
    border-color: var(--borderStrong);
    color: var(--accent);
}

    .btn-secondary:hover {
        background: var(--surfaceMuted);
        color: var(--accent);
    }

/* Buttons on dark backgrounds (Banners) */
.on-dark .btn-primary {
    border-color: var(--accentLight);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.on-dark .btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

    .on-dark .btn-secondary:hover {
        background: rgba(255, 255, 255, 0.14);
        border-color: rgba(255, 255, 255, 0.45);
        color: #fff;
    }


/* Pills */
.pill {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid var(--bannerPillBorder);
    border-radius: var(--radiusPill);
    background: var(--bannerPill);
    font-size: 12px;
    font-weight: 500;
    line-height: 14px;
    white-space: nowrap;
    /* Lighter than accentVeryLight so small text stays readable on the dark Banner cards */
    color: #c4ebff;
}

    .pill .icon {
        margin-right: 8px;
    }

.pill-large {
    padding: 6px 14px;
    font-size: 14px;
    line-height: 16px;
}

/* Pill on light backgrounds : dark blue text on a soft blue background */
.pill-light {
    padding: 3px 10px;
    /* Very light border and background so the dark blue text stands out */
    border-color: rgba(40, 112, 189, 0.16);
    background: #f5f9fe;
    font-size: 12px;
    line-height: 16px;
    color: var(--accentDark);
}


/* Banner Link Cards : Link cards shown on dark Banners (ex. Home and Docs) */
.banner-link-cards {
    display: grid;
    grid-row-gap: 16px;
}

.banner-link-card {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) max-content;
    grid-column-gap: 18px;
    align-items: center;
    padding: 18px 20px;
    border: 1px solid var(--bannerGlassBorder);
    border-radius: var(--radiusLarge);
    background: var(--bannerGlass);
    box-shadow: var(--shadowCard);
    color: var(--accentVeryLight);
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

    .banner-link-card:hover {
        background: var(--bannerGlassHover);
        border-color: rgba(128, 212, 255, 0.5);
        color: var(--accentVeryLight);
        text-decoration: none;
        transform: translateX(-4px);
    }

.banner-link-card-icon {
    display: block;
    /* Line up with the Product Title instead of the middle of the card */
    align-self: start;
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--accent) 0%, var(--accentDark) 100%);
    box-shadow: 0 0 0 1px var(--bannerPillBorder);
    font-size: 24px;
    line-height: 56px;
    text-align: center;
    color: #fff;
}

.banner-link-card-name {
    font-size: 19px;
    line-height: 26px;
    color: #fff;
}

.banner-link-card-description {
    font-size: 14px;
    line-height: 20px;
    color: var(--bannerBorderLight);
}

/* Pill under the Description (ex. Open Source, Free, Pricing) */
.banner-link-card-description + .pill {
    margin-top: 8px;
}

/* Featured Link Card : the primary product */
.banner-link-card.featured {
    border-color: rgba(128, 212, 255, 0.6);
    background: var(--bannerGlassHover);
}

/* Group label between Link Cards (ex. MTConnect) */
.banner-link-group-title {
    margin: 10px 0 -4px 2px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--bannerBorderLight);
}

    .banner-link-group-title .icon {
        margin-right: 8px;
    }

/* Link Cards with a Download button (the whole card links to the Project, the button downloads the Installer) */
.banner-link-card.has-download {
    position: relative;
}

    .banner-link-card.has-download:hover {
        transform: none;
    }

.banner-link-card-link {
    display: block;
    text-decoration: none;
}

    .banner-link-card-link:hover {
        color: #fff;
        text-decoration: none;
    }

    .banner-link-card-link::after {
        content: "";
        position: absolute;
        inset: 0;
    }

.banner-link-card-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.banner-link-card-download {
    position: relative;
    z-index: 1;
    padding: 9px 14px;
    /* Light button so it stands out against the dark blue Banner */
    border: 1px solid var(--accentVeryLight);
    border-radius: var(--radiusSmall);
    background: var(--accentVeryLight);
    box-shadow: 0 0 14px rgba(128, 212, 255, 0.35);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    color: var(--accentVeryDark);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, box-shadow 0.15s;
}

    .banner-link-card-download:hover {
        background: #fff;
        box-shadow: 0 0 18px rgba(128, 212, 255, 0.55);
        color: var(--accentVeryDark);
        text-decoration: none;
    }

    .banner-link-card-download .icon {
        margin-right: 8px;
    }

/* Shown instead of the Download button until an installer is published */
.banner-link-card-coming-soon {
    padding: 9px 14px;
    border: 1px dashed var(--bannerGlassBorder);
    border-radius: var(--radiusSmall);
    font-size: 14px;
    line-height: 20px;
    white-space: nowrap;
    color: var(--bannerBorderLight);
}

    .banner-link-card-coming-soon .icon {
        margin-right: 8px;
    }

@media only screen and (max-width: 600px) {

    .banner-link-card {
        grid-template-columns: 48px minmax(0, 1fr);
        padding: 14px 16px;
    }

        .banner-link-card > .pill {
            grid-column: 2;
            justify-self: start;
            margin-top: 8px;
        }

        .banner-link-card > .banner-link-card-arrow {
            display: none;
        }

    .banner-link-card-side {
        grid-column: 2;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        margin-top: 8px;
    }

    .banner-link-card-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
        line-height: 48px;
    }
}


/* Sections */
.section {
    width: 100%;
    border-bottom: 1px solid var(--surfaceMedium);
}

.section-container {
    display: grid;
    grid-template-rows: max-content max-content max-content max-content 1fr max-content;
    grid-template-columns: minmax(0, 1fr) max-content;
    grid-column-gap: 80px;
    max-width: 1400px;
    height: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 80px 0;
    border-left: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
}

.section-subtitle {
    grid-row: 1;
    grid-column: 1;
    margin-bottom: 10px;
    padding-left: 50px;
    font-size: 18px;
    font-weight: 500;
    text-align: left;
    color: var(--accent);
}

.section-title {
    grid-row: 2;
    grid-column: 1;
    padding-left: 50px;
    text-align: left;
}

    /* Section titles are h2 (each page's only h1 is its Banner title), styled like the h1 they replaced */
    .section-title h2 {
        margin: 0;
        padding-top: 0;
        color: #444;
        font-size: 40px;
        font-weight: 500;
    }

.section-text {
    grid-row: 3;
    grid-column: 1;
    margin-top: 30px;
    padding-left: 50px;
    font-size: 16px;
    line-height: 35px;
    text-align: left;
}

    /* Bullet points : the same size as paragraphs, with tighter spacing between wrapped lines */
    .section-text li {
        margin-bottom: 6px;
        font-size: 16px;
        line-height: 28px;
    }

    /* Subheading within a Section (ex. One Framework for Every Team) */
    .section-text h3 {
        margin: 40px 0 0;
        font-size: 24px;
        font-weight: 500;
        color: var(--textColor);
    }

.section-links {
    grid-row: 4;
    grid-column: 1;
    /* Offset the bottom margin of the last row of Buttons */
    margin-bottom: -12px;
    padding-top: 30px;
    padding-left: 50px;
    text-align: left;
}

    .section-links .btn {
        margin: 0 12px 12px 0;
    }

.section-table {
    grid-row: 6;
    grid-column-start: 1;
    grid-column-end: 3;
    padding-top: 30px;
    padding-left: 50px;
    padding-right: 50px;
    /* Wide tables scroll within the section on narrow screens instead of widening the page */
    overflow-x: auto;
    color: var(--tableText);
}

    .section-table table {
        width: 100%;
        background: var(--tableBorder);
    }

    .section-table th {
        padding: 5px 10px;
        background: var(--tableBorder);
        text-align: center;
        color: var(--tableHeader);
    }

    .section-table td {
        padding: 5px 10px;
        background: var(--tableBackground);
        text-align: center;
    }

    .section-table a {
        color: var(--tableLink);
    }

.section-image {
    grid-row-start: 1;
    grid-row-end: 6;
    grid-column: 2;
    padding-top: 40px;
    padding-right: 60px;
    text-align: center;
}

    .section-image img {
        max-width: min(600px, 100%);
        height: auto;
    }

/* Centered Section */
.section.center .section-title,
.section.center .section-subtitle,
.section.center .section-text {
    padding-left: 0;
    text-align: center;
}

/* Medium (gray) Section */
.section.medium {
    background: var(--surfaceMedium);
}

    .section.medium .section-container {
        border-left: 1px solid #e0e0e0;
        border-right: 1px solid #e0e0e0;
    }

    .section.medium .section-title h2,
    .section.medium .section-text {
        color: var(--textMuted);
    }

@media only screen and (max-width: 1600px) {

    .section-container {
        max-width: 1200px;
    }
}

@media only screen and (max-width: 1200px) {

    .section-container {
        display: block;
        max-width: 1000px;
        padding-left: 50px;
        padding-right: 50px;
    }
}

@media only screen and (max-width: 1000px) {

    .section-subtitle,
    .section-title,
    .section-text,
    .section-image,
    .section-table,
    .section-links {
        padding-left: 0;
        padding-right: 0;
    }
}


/* Code Blocks : command and code examples in Sections (ex. Get Started) */
.code {
    margin: 10px 0 25px;
    padding: 14px 18px;
    border-radius: var(--radius);
    background: #1d2730;
    color: #e6edf3;
    font-family: Consolas, "Courier New", monospace;
    font-size: 14px;
    line-height: 24px;
    overflow-x: auto;
}

    /* A code example under a Section's diagram (ex. MTConnectNet/Client) */
    .section-image .code {
        box-sizing: border-box;
        width: 600px;
        max-width: 100%;
        margin: 20px auto 0;
        font-size: 13px;
        line-height: 21px;
        text-align: left;
    }


/* Section Diagrams : figures built from boxes and arrows (ex. MTConnectNet/AgentDiagram), stacked vertically when narrow */
.ndg {
    box-sizing: border-box;
    width: 600px; /* An explicit width : the Section's image column sizes to its content, and a container query box has no content width */
    max-width: 100%;
    margin: 0 auto;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radiusLarge);
    background: var(--surfaceMuted);
    font-size: 14px;
    line-height: 20px;
    text-align: left;
    container-type: inline-size;
}

    .ndg figcaption {
        margin-top: 14px;
        font-size: 13px;
        line-height: 18px;
        color: var(--textSubtle);
        text-align: center;
    }

/* Flow : columns side by side with arrows between them */
.ndg-flow {
    display: flex;
    align-items: stretch;
}

    .ndg-flow > .ndg-box,
    .ndg-flow > .ndg-stack {
        flex: 1 1 0;
        min-width: 0;
    }

    .ndg-flow > .ndg-middle {
        align-self: center;
    }

.ndg-stack {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

/* Box : a part of the system */
.ndg-box {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--textColor);
}

    .ndg-box b {
        display: block;
        color: var(--textStrong);
        font-weight: 600;
        overflow-wrap: anywhere;
    }

    .ndg-box small {
        display: block;
        margin-top: 1px;
        font-size: 12px;
        line-height: 16px;
        color: var(--textMuted);
    }

    .ndg-box .icon {
        margin-right: 6px;
        color: var(--accent);
    }

    .ndg-box.accent {
        border: 2px solid var(--accent);
        background: var(--accentSoft);
    }

    .ndg-box.ok {
        border-color: #9bd8b0;
        background: #eefaf2;
    }

    .ndg-box .ndg-title {
        font-size: 16px;
    }

/* The Agent and Adapter boxes fill the column so their parts line up with the Modules */
.ndg-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 12px;
}

/* Part : a piece inside a box (ex. the Agent's Buffers) */
.ndg-part {
    margin-top: 8px;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: var(--radiusSmall);
    background: var(--surface);
}

.ndg-center .ndg-part {
    margin-top: 0;
}

    .ndg-part b {
        font-size: 13px;
    }

.ndg-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.ndg-chip {
    padding: 1px 7px;
    border: 1px solid var(--border);
    border-radius: var(--radiusPill);
    background: var(--surfaceMuted);
    font-size: 12px;
    line-height: 18px;
    color: var(--textMuted);
}

.ndg-label {
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--textSubtle);
}

/* Arrow : points right between columns, or both ways with .both */
.ndg-arrow {
    position: relative;
    flex: 0 0 28px;
    align-self: center;
    height: 2px;
    margin: 0 4px;
    background: var(--borderStrong);
}

    .ndg-arrow::after,
    .ndg-arrow.both::before {
        content: "";
        position: absolute;
        top: -5px;
        border-top: 6px solid transparent;
        border-bottom: 6px solid transparent;
    }

    .ndg-arrow::after {
        right: -1px;
        border-left: 7px solid var(--borderStrong);
    }

    .ndg-arrow.both::before {
        left: -1px;
        border-right: 7px solid var(--borderStrong);
    }

/* Narrow Diagrams : columns stack and the arrows point down */
@container (max-width: 520px) {

    .ndg-flow {
        flex-direction: column;
    }

        .ndg-flow > .ndg-middle {
            align-self: stretch;
        }

    .ndg-arrow {
        flex: 0 0 24px;
        width: 2px;
        height: 24px;
        margin: 4px 0 4px 28px;
        align-self: flex-start;
    }

        .ndg-arrow::after,
        .ndg-arrow.both::before {
            top: auto;
            left: -5px;
            right: auto;
            border-top: 0;
            border-bottom: 0;
            border-left: 6px solid transparent;
            border-right: 6px solid transparent;
        }

        .ndg-arrow::after {
            bottom: -1px;
            border-top: 7px solid var(--borderStrong);
        }

        .ndg-arrow.both::before {
            top: -1px;
            border-bottom: 7px solid var(--borderStrong);
        }
}
