/*
 * Open Cluster Scheduler download portal.
 *
 * Colour carries meaning, nothing else. Teal marks an action; the three
 * release-state badges are the only other colour on the page. Cards use
 * hairline borders rather than shadows, because a shadow implies a depth
 * that is not there.
 *
 * The palette is deliberately distinct from the commercial Gridware Cluster
 * Scheduler portal, which uses an indigo-to-violet gradient. Someone landing
 * on either site should know within a second which product they are looking
 * at.
 */

:root {
    --ocs-primary: #0f9b8e;
    --ocs-primary-dark: #0b7d72;
    --ocs-accent: #14b8a6;
    --ocs-ink: #0f2027;
    --ocs-surface: #f7faf9;

    --ocs-text: #17232a;
    --ocs-text-muted: #5b6b73;
    --ocs-border: #dbe4e2;
    --ocs-card: #ffffff;

    --ocs-latest: #10b981;
    --ocs-nightly: #f59e0b;
    --ocs-archive: #6b7280;

    --ocs-radius: 6px;
}

body {
    background-color: var(--ocs-surface);
    color: var(--ocs-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
}

/* ---------------------------------------------------------------- header */

.ocs-navbar {
    background-color: var(--ocs-ink);
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

.ocs-navbar .navbar-brand {
    color: #ffffff;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.ocs-navbar .nav-link {
    color: rgba(255, 255, 255, 0.78);
}

.ocs-navbar .nav-link:hover,
.ocs-navbar .nav-link:focus,
.ocs-navbar .nav-link.active {
    color: #ffffff;
}

/* The navbar wraps rather than collapsing behind a hamburger. Three links do
   not need a disclosure control, and a hamburger needs JavaScript -- which
   this site otherwise does not require to work. */
.ocs-navbar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem 1rem;
}

.ocs-navbar .navbar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
}

.ocs-navbar .nav-link {
    padding-left: 0;
    padding-right: 0;
}

/* Inlined SVG in place of an icon font. Nudged up a touch so it sits on the
   text baseline the way a glyph would. */
.ocs-icon {
    vertical-align: -0.125em;
}

/* These were inline style attributes. Moving them here is what lets the
   content security policy drop 'unsafe-inline' from style-src: with it, a
   stored-XSS payload that reaches the admin dashboard can style the page
   into something that reads as legitimate. */
.ocs-prose {
    max-width: 44rem;
}

.ocs-prose-wide {
    max-width: 52rem;
}

.ocs-prose-narrow {
    max-width: 34rem;
}

.ocs-fill-viewport {
    min-height: 100vh;
}

.ocs-on-dark {
    color: rgba(255, 255, 255, 0.8);
}

.ocs-btn-on-dark {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.35);
}

.ocs-hero {
    background: linear-gradient(135deg, var(--ocs-primary) 0%, var(--ocs-ink) 100%);
    color: #ffffff;
    padding: 3.5rem 0;
}

.ocs-hero h1 {
    font-weight: 650;
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

.ocs-hero .lead {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0;
}

.ocs-hero-meta {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.925rem;
    margin-top: 1.25rem;
}

.ocs-hero-meta code {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 4px;
    color: #ffffff;
    padding: 0.15rem 0.4rem;
}

/* The company mark is sized here rather than with a style attribute because
   the content security policy forbids inline style. The intrinsic width and
   height on the img keep the hero from reflowing once the SVG arrives. */
.ocs-hero-logo {
    height: auto;
    max-width: 280px;
    opacity: 0.9;
    width: 100%;
}

@media (max-width: 991.98px) {
    .ocs-hero-logo {
        max-width: 200px;
    }
}

/* ----------------------------------------------------------------- cards */

.ocs-card {
    background: var(--ocs-card);
    border: 1px solid var(--ocs-border);
    border-radius: var(--ocs-radius);
    height: 100%;
    transition: border-color 0.15s ease-in-out;
}

.ocs-card:hover {
    border-color: var(--ocs-primary);
}

.ocs-card .card-title {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.ocs-card-meta {
    color: var(--ocs-text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

/* ---------------------------------------------------------------- badges */

.ocs-badge {
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.25em 0.6em;
    text-transform: uppercase;
    vertical-align: middle;
}

.ocs-badge-latest {
    background-color: var(--ocs-latest);
    color: #ffffff;
}

.ocs-badge-nightly {
    background-color: var(--ocs-nightly);
    color: #1f1300;
}

.ocs-badge-archive {
    background-color: transparent;
    border: 1px solid var(--ocs-archive);
    color: var(--ocs-archive);
}

.ocs-platform {
    color: var(--ocs-text-muted);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------- actions */

.btn-ocs {
    background-color: var(--ocs-primary);
    border: 1px solid var(--ocs-primary);
    color: #ffffff;
    font-weight: 500;
}

.btn-ocs:hover,
.btn-ocs:focus {
    background-color: var(--ocs-primary-dark);
    border-color: var(--ocs-primary-dark);
    color: #ffffff;
}

.btn-ocs-outline {
    background-color: transparent;
    border: 1px solid var(--ocs-border);
    color: var(--ocs-primary);
    font-weight: 500;
}

.btn-ocs-outline:hover,
.btn-ocs-outline:focus {
    border-color: var(--ocs-primary);
    color: var(--ocs-primary-dark);
}

a {
    color: var(--ocs-primary);
}

a:hover {
    color: var(--ocs-primary-dark);
}

/* A visible focus ring is not decoration: it is how a keyboard user knows
   where they are. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--ocs-accent);
    outline-offset: 2px;
}

/* -------------------------------------------------------------- sections */

.ocs-section {
    margin-bottom: 3rem;
}

.ocs-section-title {
    align-items: center;
    display: flex;
    font-size: 1.35rem;
    font-weight: 600;
    gap: 0.65rem;
    margin-bottom: 0.5rem;
}

.ocs-section-note {
    color: var(--ocs-text-muted);
    margin-bottom: 1.5rem;
    max-width: 62ch;
}

/* ------------------------------------------------------------ file table */

.ocs-table {
    background: var(--ocs-card);
    border: 1px solid var(--ocs-border);
    border-radius: var(--ocs-radius);
    overflow: hidden;
    width: 100%;
}

.ocs-table th {
    background: #f0f5f4;
    color: var(--ocs-text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 0.7rem 1rem;
    text-transform: uppercase;
}

.ocs-table td {
    border-top: 1px solid var(--ocs-border);
    padding: 0.7rem 1rem;
    vertical-align: middle;
}

.ocs-table .ocs-size {
    color: var(--ocs-text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ocs-filename {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    font-size: 0.85rem;
    word-break: break-all;
}

/* ----------------------------------------------------------- automation */

.ocs-snippet {
    background: var(--ocs-ink);
    border-radius: var(--ocs-radius);
    color: #e6f2f0;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    font-size: 0.82rem;
    line-height: 1.65;
    overflow-x: auto;
    padding: 1rem 1.15rem;
}

.ocs-snippet .c {
    color: #7fa8a2;
}

/* ---------------------------------------------------------- contact form */

.ocs-optional {
    background: var(--ocs-card);
    border: 1px solid var(--ocs-border);
    border-radius: var(--ocs-radius);
    margin-top: 2.5rem;
    padding: 1.25rem 1.5rem;
}

.ocs-optional summary {
    cursor: pointer;
    font-weight: 550;
}

.ocs-optional summary::marker {
    color: var(--ocs-text-muted);
}

.ocs-optional-note {
    color: var(--ocs-text-muted);
    font-size: 0.9rem;
    margin: 0.75rem 0 1.25rem;
    max-width: 68ch;
}

.ocs-consent {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* The honeypot must be unreachable for a person and invisible to a screen
   reader, while remaining present in the DOM for a bot to fill in. */
.ocs-hp {
    height: 0;
    left: -9999px;
    overflow: hidden;
    position: absolute;
    width: 0;
}

/* ---------------------------------------------------------------- footer */

.ocs-footer {
    background-color: var(--ocs-ink);
    color: rgba(255, 255, 255, 0.72);
    flex-shrink: 0;
    margin-top: 3rem;
    padding: 2.25rem 0;
}

.ocs-footer h2 {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
}

.ocs-footer a {
    color: rgba(255, 255, 255, 0.86);
    text-decoration: none;
}

.ocs-footer-logo {
    display: inline-block;
    margin-bottom: 0.75rem;
}

.ocs-footer-logo img {
    height: 64px;
    width: auto;
}

/* The legal links sit on one wrapping row. Four stacked lines would give them
   more weight in the footer than the downloads they sit beneath. */
.ocs-footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.55);
}

.ocs-footer.ocs-footer .ocs-footer-legal a {
    color: rgba(255, 255, 255, 0.62);
}

.ocs-footer .ocs-footer-legal a:hover,
.ocs-footer .ocs-footer-legal a:focus {
    color: #ffffff;
}

@media (min-width: 768px) {
    .ocs-footer-legal {
        justify-content: flex-end;
    }
}

.ocs-footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.ocs-footer-meta {
    font-size: 0.85rem;
}

/* ----------------------------------------------------------------- admin */

.ocs-stat {
    background: var(--ocs-card);
    border: 1px solid var(--ocs-border);
    border-radius: var(--ocs-radius);
    padding: 1.1rem 1.25rem;
}

.ocs-stat-value {
    font-size: 1.75rem;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    line-height: 1.1;
}

.ocs-stat-label {
    color: var(--ocs-text-muted);
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.ocs-login {
    max-width: 380px;
    width: 100%;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 768px) {
    .ocs-hero {
        padding: 2.5rem 0;
    }

    .ocs-hero h1 {
        font-size: 1.9rem;
    }

    .ocs-table thead {
        display: none;
    }

    .ocs-table td {
        display: block;
        padding: 0.4rem 1rem;
    }

    .ocs-table tr {
        border-top: 1px solid var(--ocs-border);
        display: block;
        padding: 0.6rem 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
