/* ============================================================
   STEAGUS PRODUCT DOWNLOAD PAGES — shared components
   Status: SHARED. Loaded by every product's download.html.

   Deliberately ONE file for all products. The download page is the
   same page everywhere; only the accent, the product name, the file
   list and the price differ, and those come from the product's own
   stylesheet and its HTML. A fix to the drawer or the table lands on
   every product at once instead of on whichever one got remembered.

   Load order on a download page:
     1. <product>/assets/css/<product>.css   tokens + page chrome
     2. ../../../assets/css/hub.css          the Steagus hub bar
     3. ../../../assets/css/download.css     this file

   It defines NO tokens of its own. Every colour, font and radius comes
   from the product stylesheet's :root, which is what makes the same
   markup read as Abisam (purple) or SCT (green) with no other change.

   All classes are dl- prefixed. The product stylesheets already own
   .wrap, .eyebrow, .lead, .band, .btn and .price-tag; those are reused
   as-is and never redefined here.
   ============================================================ */

/* ---------- shared bits ---------- */
.dl-card {
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.dl-spec {
    font-family: var(--mono);
    font-size: .8rem;
    color: var(--ink-3);
    letter-spacing: .03em;
}

.dl-note {
    font-family: var(--mono);
    font-size: .78rem;
    color: var(--ink-3);
    letter-spacing: .04em;
}

.dl-osicon {
    width: 30px;
    height: 30px;
    flex: none;
    fill: currentColor;
}

/* ---------- hero ---------- */
.dl-hero {
    text-align: center;
    padding: 60px 0 0;
}

.dl-main {
    max-width: 600px;
    margin: 26px auto 0;
    padding: 30px 30px 26px;
    text-align: center;
    position: relative;   /* anchor for .beta-ribbon */
    overflow: hidden;      /* clips the 45deg ribbon to the card corner */
}

.dl-os {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    color: var(--accent);
    margin-bottom: .35rem;
}

.dl-os h2 {
    font-size: 1.4rem;
}

.dl-specs {
    display: flex;
    gap: 1.3rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1.2rem 0 0;
}

/* Only the detected platform's card is shown. Detection is a hint: every
   file stays one click away in the table below no matter what it picks,
   because the user-agent is a guess and Linux especially gets misread. */
.dl-pane {
    display: none;
}

[data-os="mac"] .dl-pane[data-for="mac"],
[data-os="win"] .dl-pane[data-for="win"],
[data-os="linux"] .dl-pane[data-for="linux"] {
    display: block;
}

/* ---------- signed / unsigned line ---------- */
.dl-trust {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-family: var(--mono);
    font-size: .72rem;
    letter-spacing: .04em;
    margin-top: 1.15rem;
}

.dl-trust.ok {
    color: var(--accent);
}

.dl-trust.warn {
    color: var(--amber);
}

.dl-trust svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    flex: none;
}

/* ---------- Linux package drawer ---------- */
.dl-drawerbtn {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
}

.dl-drawerbtn .dl-chev {
    width: 12px;
    height: 12px;
    fill: currentColor;
    transition: transform .22s ease;
}

.dl-main.open .dl-drawerbtn .dl-chev {
    transform: rotate(180deg);
}

/* Animates to the content's real height. A max-height number has to be
   guessed, and the guess breaks below 520px where each package row stacks
   to two lines — the last entry would clip. */
.dl-drawer {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .28s ease;
    text-align: left;
}

/* The clip wrapper is what collapses. .dl-drawer-in keeps its own margin
   and border, which would still occupy space at zero height otherwise. */
.dl-drawer > .dl-drawer-clip {
    overflow: hidden;
    min-height: 0;
}

.dl-main.open .dl-drawer {
    grid-template-rows: 1fr;
}

.dl-drawer-in {
    margin-top: 1.4rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--line);
}

.dl-drawer-in .dl-cap {
    font-family: var(--mono);
    font-size: .66rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-bottom: .5rem;
}

.dl-pkg {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem 0;
    border-bottom: 1px solid var(--line);
}

.dl-pkg:last-of-type {
    border-bottom: none;
}

.dl-pkg .dl-who {
    font-size: .95rem;
    color: var(--ink);
    font-weight: 600;
}

.dl-pkg .dl-who span {
    display: block;
    font-family: var(--mono);
    font-size: .7rem;
    color: var(--ink-3);
    font-weight: 400;
    letter-spacing: .03em;
}

@media (max-width:520px){
    .dl-pkg {
        flex-direction: column;
        align-items: flex-start;
        gap: .5rem;
    }
}

/* ---------- the full file table ---------- */
.dl-all {
    margin-top: 52px;
}

.dl-all-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--line-2);
    padding-bottom: .7rem;
}

.dl-all-head h2 {
    font-size: 1.05rem;
}

.dl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .95rem;
}

.dl-table td {
    padding: .95rem 1rem .95rem 0;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    text-align: left;
}

.dl-table tbody tr:hover {
    background: var(--paper-2);
}

.dl-plat {
    display: flex;
    align-items: center;
    gap: .65rem;
    color: var(--accent);
    font-weight: 600;
}

.dl-plat .dl-osicon {
    width: 21px;
    height: 21px;
}

.dl-plat .dl-sub {
    display: block;
    font-family: var(--mono);
    font-size: .7rem;
    color: var(--ink-3);
    font-weight: 400;
    letter-spacing: .03em;
}

/* Signed/notarized shield in the table, shown only beside the platform that
   actually carries a signature (macOS). Inherits the accent via currentColor
   from .dl-plat, matching the hero's "Signed and notarized" line. */
.dl-shield {
    width: 14px;
    height: 14px;
    fill: currentColor;
    vertical-align: -2px;
    margin-left: .4rem;
}

.dl-indent {
    padding-left: 2.35rem;
}

.dl-scroll {
    overflow-x: auto;
}

@media (max-width:820px){
    .dl-table {
        min-width: 660px;
    }
}

/* The row matching the detected platform, so the button above and the
   list below visibly agree. */
[data-os="mac"] .dl-table tr[data-os="mac"],
[data-os="win"] .dl-table tr[data-os="win"],
[data-os="linux"] .dl-table tr[data-os="linux"] {
    background: color-mix(in srgb, var(--accent) 7%, transparent);
}

/* ---------- first launch ---------- */
.dl-fl {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 22px;
    margin-top: 32px;
}

@media (max-width:900px){
    .dl-fl {
        grid-template-columns: 1fr;
    }
}

.dl-flcard {
    padding: 24px 22px;
}

.dl-flcard h3 {
    font-size: 1.05rem;
    margin-bottom: .5rem;
    display: flex;
    align-items: center;
    gap: .55rem;
}

.dl-flcard h3 .dl-osicon {
    width: 19px;
    height: 19px;
    color: var(--accent);
}

.dl-flcard p {
    font-size: .92rem;
    color: var(--ink-2);
    margin: 0 0 .7rem;
}

.dl-flcard .dl-steps {
    margin: 0;
    padding-left: 1.1rem;
    font-size: .9rem;
    color: var(--ink-2);
}

.dl-flcard .dl-steps li {
    margin-bottom: .35rem;
}

.dl-flcard code {
    font-family: var(--mono);
    font-size: .8rem;
    background: var(--paper-3);
    padding: .12rem .4rem;
    border-radius: 5px;
    word-break: break-all;
}

/* The unsigned-platform card is tinted so it reads as a heads-up rather
   than as a warning the reader has to decode. */
.dl-flcard.flag {
    border-color: #E0CFA6;
    background: var(--amber-bg);
}

.dl-flcard.flag h3 .dl-osicon {
    color: var(--amber);
}

/* ---------- buy band ---------- */
.dl-buy {
    text-align: center;
}

.dl-buy .dl-row {
    display: flex;
    gap: .8rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.8rem;
}

@media (prefers-reduced-motion:reduce){
    .dl-drawer {
        transition: none;
    }
    .dl-drawerbtn .dl-chev {
        transition: none;
    }
}
