/*
 * softplot-downloads.css
 * Styles for softplot_downloads.php (SoftPlot downloads page).
 *
 * Flow: loaded by the <link> in softplot_downloads.php -> styles the markup
 * produced by that file's render functions. Colours and sizes live in the
 * variables below so the look can be changed in one place. The dark colours
 * match softplot.css / softplot-v2.css so both pages feel like one site.
 */

:root {
    --color-page-background: #222222;
    --color-surface: #2b2b2b;
    --color-surface-raised: #333333;
    --color-border: #3d3d3d;
    --color-text: #d6d6d6;
    --color-text-muted: #9a9a9a;
    --color-heading: #ffffff;
    --color-accent: #f1ba63;
    --color-brand: hsl(276, 51%, 39%);
    --radius-card: 14px;
    --content-max-width: 1160px;
    --font-body: "Lato", system-ui, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.55;
    color: var(--color-text);
    background: var(--color-page-background);
}

main {
    flex: 1;
}

h1, h2 {
    margin: 0;
    color: var(--color-heading);
    line-height: 1.15;
}

a {
    color: var(--color-accent);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 90%;
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.icon {
    flex: none;
}

/* ---------- Site header ---------- */
.site-header {
    border-bottom: 1px solid var(--color-border);
    background: var(--color-page-background);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 84px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    color: var(--color-heading);
    text-decoration: none;
}

/*
 * The SoftPlot logo has black lettering that disappears on #222222, so it
 * sits on a light plate (same treatment as the main SoftPlot page).
 */
.brand img {
    height: 48px;
    width: auto;
    padding: 4px 10px;
    border-radius: 6px;
}

.brand-text {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--color-accent);
}

.header-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.95rem;
    color: var(--color-text-muted);
    text-decoration: none;
}

.header-link:hover {
    color: var(--color-heading);
}

/* ---------- Buttons (hero) ---------- */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.85rem 1.4rem;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: transform 120ms ease, background 120ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    color: #222222;
    background: var(--color-accent);
}

.button-primary:hover {
    background: #f6cd8a;
}

.button-secondary {
    color: var(--color-heading);
    background: transparent;
    border-color: rgba(255, 255, 255, 0.35);
}

.button-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* ---------- Hero ---------- */
.hero {
    padding: 56px 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(176, 90, 220, 0.35), transparent 55%),
        linear-gradient(135deg, hsl(276, 51%, 30%), hsl(276, 45%, 17%));
    border-bottom: 1px solid var(--color-border);
}

.hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.eyebrow {
    margin: 0 0 0.6rem;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-accent);
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 900;
}

.hero-details {
    margin: 0.8rem 0 0;
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.75);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

/* ---------- Three download columns ---------- */
.columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: start;
    padding: 48px 0 64px;
}

.download-column {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    overflow: hidden;
}

.column-header {
    padding: 22px 22px 16px;
    border-bottom: 1px solid var(--color-border);
    border-top: 3px solid var(--color-accent);
}

.column-header h2 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.5rem;
    font-weight: 900;
}

.column-count {
    padding: 0.1rem 0.55rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-text-muted);
    background: var(--color-surface-raised);
    border-radius: 999px;
}

.column-header p {
    margin: 0.35rem 0 0;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.download-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 16px 22px;
    border-bottom: 1px solid var(--color-border);
    transition: background 120ms ease;
}

.download-item:last-child {
    border-bottom: 0;
}

.download-item:hover {
    background: var(--color-surface-raised);
}

.item-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    min-width: 0;
}

.item-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-heading);
}

.item-note {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.badge {
    padding: 0.1rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 999px;
    color: var(--color-text-muted);
    background: var(--color-surface-raised);
    border: 1px solid var(--color-border);
}

.badge-direct {
    color: var(--color-accent);
    border-color: rgba(241, 186, 99, 0.4);
}

.badge-frozen {
    color: #8fc7ff;
    border-color: rgba(143, 199, 255, 0.4);
}

.item-action {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex: none;
    padding: 0.5rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: background 120ms ease;
}

.item-action-direct,
.item-action-frozen {
    color: #222222;
    background: var(--color-accent);
}

.item-action-direct:hover,
.item-action-frozen:hover {
    background: #f6cd8a;
}

.item-action-external {
    color: var(--color-text);
    border-color: var(--color-border);
}

.item-action-external:hover {
    color: var(--color-heading);
    background: rgba(255, 255, 255, 0.07);
}

/* ---------- Footer ---------- */
.site-footer {
    padding: 28px 0;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
}

.site-footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
}

.site-footer p {
    margin: 0;
}

/* ---------- Responsive ---------- */

/* Tablet: two columns would leave Firmware alone, so go straight to one column. */
@media (max-width: 960px) {
    .columns {
        grid-template-columns: 1fr;
        padding-top: 32px;
    }

    .hero-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Phone: full-width buttons; each item's action drops under its text. */
@media (max-width: 520px) {
    .hero {
        padding: 40px 0;
    }

    .hero-actions,
    .hero-actions .button {
        width: 100%;
    }

    .download-item {
        flex-wrap: wrap;
        padding: 14px 18px;
    }

    .item-action {
        width: 100%;
        justify-content: center;
    }

    .column-header {
        padding: 18px;
    }

    .brand-text {
        display: none;
    }
}
