﻿:root {
    --tg-blue: #0088cc;
    --tg-blue-2: #0b93d5;
    --bg: #ffffff;
    --text: #0b2330;
    --muted: #6b7b86;
    --container: 1100px;
    --radius: 8px;
    --gap: 16px;
    --base-font-size: 17px; /* legacy fallback */
    --card-min-height: 480px; /* minimum height for the main three blocks */
    /* header/footer sizes (will be overridden by JS if you use the helper) */
    --header-height: 64px;
    --footer-height: 72px;
}

/* base box-sizing */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

/* responsive base font sizing (clamp for better scaling across screens) */
html {
    /* clamp(min, preferred, max) — adjust values if you want larger/smaller baseline */
    font-size: clamp(16px, 0.9vw + 14px, 20px);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    color: var(--text);
    background: linear-gradient(180deg, #f7fbfc 0%, #ffffff 100%);
    line-height: 1.55; /* improved readability */
    /* reserve space so content isn't hidden behind fixed header/footer */
    padding-top: var(--header-height);
    padding-bottom: var(--footer-height);
}

/* header / nav (now fixed) */
.header {
    background: linear-gradient(90deg,var(--tg-blue),var(--tg-blue-2));
    color: #fff;
    padding: 12px 20px; /* allow natural vertical size */
    box-shadow: 0 2px 8px rgba(11,34,48,0.08);
    position: fixed; /* fixed to viewport */
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100; /* above page content */
    overflow: visible; /* allow dropdowns to overflow */
}

    /* inner wrap: don't force 100% height, allow wrap if language dropdown needs lines. */
    .header .wrap {
        max-width: var(--container);
        margin: 0 auto;
        display: flex;
        gap: var(--gap);
        align-items: center;
        justify-content: space-between;
        /* keep padding inside .header, not height */
    }

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

    .brand .logo {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        background: rgba(255,255,255,0.14);
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 18px;
        box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset;
    }

    .brand .title {
        font-weight: 600;
        font-size: 18px;
    }

.nav {
    display: flex;
    gap: 14px;
    align-items: center;
}

    .nav a {
        color: rgba(255,255,255,0.95);
        text-decoration: none;
        padding: 8px 10px;
        border-radius: 6px;
        font-weight: 500;
    }

        .nav a:hover {
            background: rgba(255,255,255,0.08)
        }

        .nav a.active {
            background: rgba(255,255,255,0.16)
        }

/* layout container */
.container {
    max-width: var(--container);
    margin: 28px auto;
    padding: 0 20px;
}

/* footer pinned to bottom
   Support both .footer element (if present) and #siteFooter container used in your markup.
*/
.footer,
#siteFooter {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    background: var(--bg);
    border-top: 1px solid rgba(11,34,48,0.06);
    box-shadow: 0 -6px 18px rgba(11,34,48,0.04);
    display: flex;
    align-items: center;
    padding: 10px 20px; /* let footer determine its height */
    overflow: visible;
}

    /* center footer content; keep previous wrap layout but allow auto height */
    .footer .wrap,
    #siteFooter .wrap {
        width: 100%;
        max-width: var(--container);
        margin: 0 auto;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

/* cards */
.card {
    background: var(--bg);
    border-radius: var(--radius);
    box-shadow: 0 6px 18px rgba(11,34,48,0.06);
    padding: 26px; /* slightly larger */
}

/* headings / text */
/* scale headings using rem so they follow html font-size */
h1 {
    margin: 0 0 8px;
    font-size: clamp(1.8rem, 2.6vw, 2.2rem); /* ~32-36px */
}

h2 {
    margin-top: 0;
    color: var(--tg-blue);
    font-size: clamp(1.15rem, 1.4vw, 1.5rem); /* ~20-24px */
}

h3 {
    font-size: clamp(1.0rem, 1.1vw, 1.15rem);
}

/* body text, kv and lists a bit larger for readability */
p, .kv, li {
    color: var(--muted);
    font-size: 1.02rem;
}

/* lists */
ul {
    margin: 0 0 12px 20px;
    color: var(--muted);
}

/* monospace badge */
.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Courier New", monospace;
    font-size: 1rem;
    background: #fbfdff;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #eef7fb;
    color: #0b2330;
}

/* form controls */
.form-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

label {
    font-weight: 600;
    margin-bottom: 6px;
}

input[type="text"], input[type="password"], select, textarea {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e6eef3;
    font-size: 14px;
    background: #fbfdff;
}

/* buttons */
.btn {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--tg-blue);
    color: #fff;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

    .btn.ghost {
        background: transparent;
        border: 1px solid rgba(11,34,48,0.06);
        color: var(--text);
    }

/* image grid (thumbnails) */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 12px;
    align-items: start;
}

    .image-grid .thumb-wrap {
        height: clamp(420px, 35vw, 760px); /* larger thumbnails */
        padding: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #fbfdff;
        border-radius: 10px;
        overflow: hidden;
        box-shadow: 0 6px 14px rgba(11,34,48,0.04);
    }

    .image-grid img.thumb {
        width: 100%;
        height: auto;
        object-fit: contain;
        display: block;
    }

    .image-grid figcaption {
        margin-top: 6px;
        font-size: 14px;
        color: var(--muted);
    }

/* default grid for page — stacked */
.grid {
    display: grid;
    gap: 20px;
    align-items: start;
    grid-template-columns: 1fr;
}

/* ---------- STACKED vertical layout (force one card per row) ---------- */
/* keep blocks stacked on all viewports (your requested behavior) */
@media (min-width: 1100px) {
    .grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

        .grid > article.card {
            display: flex;
            flex-direction: column;
            height: auto;
            min-height: auto;
        }

            .grid > article.card .card-body {
                display: flex;
                flex-direction: column;
                gap: 12px;
                flex: 1 1 auto;
            }

            .grid > article.card .card-footer {
                margin-top: auto;
            }
}

/* medium screens: continue stacked */
@media (min-width:760px) and (max-width:1099px) {
    .grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

        .grid > article.card {
            min-height: auto;
        }
}

/* small screens: single column */
@media (max-width:759px) {
    .grid {
        grid-template-columns: 1fr;
    }

        .grid > article.card {
            min-height: auto;
        }
}

/* ensure any inline style on .grid won't force multi-column layout */
.grid[style] {
    grid-template-columns: 1fr !important;
}

/* ---------- Clients inner 2x2 grid (new) ---------- */
#clientsBlock .clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 22px;
    align-items: start;
    margin-top: 12px;
}

#clientsBlock .clients-section {
    background: transparent;
    padding: 0;
    margin: 0;
}

/* subtle boxed look for pricing area */
#clientsBlock .clients-pricing .pricing-wrap {
    background: #fbfdff;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #eef7fb;
    box-shadow: 0 6px 14px rgba(11,34,48,0.03);
}

/* ensure table is full width and neat */
#clientsBlock table {
    width: 100%;
    border-collapse: collapse;
}

/* explicit two-column layout and ordering on wider screens */
@media (min-width: 960px) {
    #clientsBlock .clients-grid {
        grid-template-columns: 1fr 1fr;
    }

        #clientsBlock .clients-grid > .clients-section:nth-of-type(1) {
            order: 1;
        }
        /* Key features */
        #clientsBlock .clients-grid > .clients-section:nth-of-type(2) {
            order: 2;
        }
        /* Custom & enterprise */
        #clientsBlock .clients-grid > .clients-section:nth-of-type(3) {
            order: 3;
        }
        /* Planned & upcoming */
        #clientsBlock .clients-grid > .clients-section:nth-of-type(4) {
            order: 4;
        }
    /* Pricing */
}

/* sparkline styling: taller fixed min-height so it doesn't jump */
.sparkline {
    min-height: 64px;
    height: 64px;
    display: block;
    align-self: flex-start;
}

    .sparkline svg {
        width: 100%;
        height: 100%;
        display: block;
    }

    .sparkline .line {
        fill: none;
        stroke: #0b93d5;
        stroke-width: 2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .sparkline .area {
        fill: rgba(11,147,213,0.08);
    }

/* command list sizing tweaks */
.cmd-list .cmd-item {
    font-size: 1.03rem;
}

/* accessibility focus outline */
a:focus, button:focus, input:focus {
    outline: 3px solid rgba(11,147,213,0.16);
    outline-offset: 2px;
}

/* small responsive tweaks */
@media (max-width: 900px) {
    .image-grid .thumb-wrap {
        height: clamp(180px, 38vw, 320px);
        padding: 8px;
    }

    .sparkline {
        min-height: 48px;
        height: 48px;
    }

    /* reduce reserved header/footer on very small screens to avoid too much padding */
    :root {
        --header-height: 56px;
        --footer-height: 64px;
    }
}

/* mid-size laptop boost (e.g. 1366x768) */
@media (min-width: 1200px) and (max-width: 1440px) {
    html {
        font-size: 17px;
    }

    :root {
        --card-min-height: 500px;
    }

    .image-grid .thumb-wrap {
        height: clamp(360px, 34vw, 600px);
    }
}

/* Monitoring block: 2x2 layout for detail sections (mirrors clients-grid) */
#monitoringBlock .monitor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 12px;
    align-items: start;
}

#monitoringBlock .monitor-section {
    padding: 0;
    margin: 0;
}

    /* subtle emphasis for the runbook/explainers */
    #monitoringBlock .monitor-section h3 {
        margin-bottom: 8px;
        color: var(--tg-blue);
    }

/* on larger screens, force 2 columns */
@media (min-width: 960px) {
    #monitoringBlock .monitor-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* if you want the images to be visually separated */
#monitoringBlock .image-grid {
    margin-top: 14px;
}
