/* Software page. Colours come from the site's /static/style.css tokens; each card can
   override --app-accent with the app's colour from the CMS. */

.sw-root { display: flex; flex-direction: column; gap: 48px; }
.sw-section { display: flex; flex-direction: column; }
.sw-section .section-title { margin-bottom: 16px; }

.sw-card {
    --app-accent: var(--accent);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    transition: border-color 0.3s;
}
.sw-card:hover { border-color: color-mix(in srgb, var(--app-accent) 55%, var(--border)); }

.sw-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.sw-head-text { flex: 1 1 220px; min-width: 0; }
.sw-name { font-size: 18px; font-weight: bold; color: var(--text); line-height: 1.3; }
.sw-name-tag { color: var(--app-accent); }
.sw-meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0 8px; }
.sw-meta .sw-version { color: var(--app-accent); }
.sw-text { font-size: 13px; color: #c8c8c8; line-height: 1.7; }
.sw-text p { margin: 0 0 8px; }
.sw-text p:last-child { margin-bottom: 0; }

.sw-icon {
    width: 44px; height: 44px; flex-shrink: 0;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--app-accent) 60%, transparent);
    background: color-mix(in srgb, var(--app-accent) 10%, transparent);
    color: var(--app-accent);
    display: flex; align-items: center; justify-content: center;
}
.sw-icon svg { width: 24px; height: 24px; }
.sw-icon-img { border: none; background: none; object-fit: cover; }

.sw-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 20px; min-height: 44px;
    background: var(--app-accent); color: #111111;
    border: none; border-radius: 6px;
    font-family: inherit; font-size: 13px; font-weight: bold;
    cursor: pointer; text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}
.sw-btn:hover {
    color: #111111;
    filter: brightness(1.12);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px color-mix(in srgb, var(--app-accent) 35%, transparent);
}
.sw-btn-wide { width: 100%; }
.sw-btn-big { padding: 14px 26px; font-size: 14px; border-radius: 8px; }
.sw-btn-row { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; }
.sw-link { font-size: 12px; color: var(--muted); word-break: break-all; }

.sw-steps { display: flex; flex-direction: column; gap: 10px; }
.sw-step { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; line-height: 1.5; }
.sw-step-num {
    width: 24px; height: 24px; flex-shrink: 0; border-radius: 50%;
    background: var(--app-accent); color: #111111;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: bold;
}
.sw-step code, .sw-text code, .sw-changes code {
    background: var(--log-bg); color: var(--gold);
    padding: 1px 6px; border-radius: 4px; font-size: 12px;
}
.sw-step strong { color: var(--app-accent); }

/* Highlighted (spotlight) card */
.sw-spot {
    border-radius: 12px; padding: 32px;
    flex-direction: row; flex-wrap: wrap; gap: 32px;
    border-color: color-mix(in srgb, var(--app-accent) 55%, var(--border));
    box-shadow: 0 0 40px color-mix(in srgb, var(--app-accent) 12%, transparent);
}
.sw-spot-main { flex: 1 1 380px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.sw-spot .sw-icon { width: 84px; height: 84px; border-radius: 13px; }
.sw-spot .sw-icon svg { width: 44px; height: 44px; }
.sw-spot .sw-name { font-size: 30px; }
.sw-spot .sw-text { font-size: 14px; }
.sw-news {
    flex: 1 1 260px; min-width: 0;
    background: var(--log-bg); border: 1px solid var(--border); border-radius: 10px;
    padding: 20px; display: flex; flex-direction: column; gap: 10px;
}
.sw-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.sw-changes { font-size: 13px; color: #c8c8c8; line-height: 1.6; }
.sw-changes ul, .sw-changes ol { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.sw-changes li::marker { color: var(--app-accent); }
.sw-changes p { margin: 0 0 6px; }
.sw-changes h3 { font-size: 13px; color: var(--text); margin: 8px 0 4px; }
.sw-changes blockquote { margin: 6px 0; padding-left: 10px; border-left: 2px solid var(--app-accent); }

/* Extension cards */
.sw-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.sw-grid .sw-card { height: 100%; }
.sw-grow { flex-grow: 1; }
.sw-toggle {
    display: flex; background: var(--log-bg); border: 1px solid var(--border);
    border-radius: 8px; padding: 3px;
}
.sw-toggle button {
    flex: 1; min-height: 40px; padding: 8px; border: none; border-radius: 6px;
    background: transparent; color: var(--muted);
    font-family: inherit; font-size: 13px; font-weight: bold; cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.sw-toggle button:hover { color: var(--text); }
.sw-toggle button[aria-pressed="true"] { background: var(--app-accent); color: #111111; }

/* Collapsibles */
.sw-more { font-size: 12px; }
.sw-more > summary {
    cursor: pointer; color: var(--app-accent); list-style: none;
    display: inline-flex; align-items: center; gap: 6px; min-height: 32px;
}
.sw-more > summary::-webkit-details-marker { display: none; }
.sw-more > summary::before { content: "+"; font-weight: bold; width: 10px; }
.sw-more[open] > summary::before { content: "−"; }
.sw-more-body { padding-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.sw-links { display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: flex-start; }
.sw-links .sw-more { flex: 0 1 auto; }
.sw-links .sw-more[open] { flex-basis: 100%; }
.sw-note { font-size: 12px; color: var(--muted); }

.sw-versions { display: flex; flex-direction: column; }
.sw-version-row {
    display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline;
    padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px;
}
.sw-version-row:last-child { border-bottom: none; }
.sw-version-row .sw-grow { color: var(--muted); font-size: 12px; }

/* Screenshots */
.sw-shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.sw-shot { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.sw-shot img {
    width: 100%; border-radius: 8px; border: 1px solid var(--border);
    cursor: zoom-in; transition: border-color 0.25s, transform 0.25s;
}
.sw-shot img:hover { border-color: var(--app-accent); transform: translateY(-2px); }
.sw-shot figcaption { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.5; }

#lightbox {
    display: none; position: fixed; inset: 0; z-index: 2000;
    background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(6px);
    align-items: center; justify-content: center; cursor: zoom-out;
}
#lightbox.open { display: flex; }
#lightbox-img { max-width: 92vw; max-height: 90vh; border-radius: 8px; }

@media (max-width: 600px) {
    .sw-spot { padding: 22px; gap: 22px; }
    .sw-spot .sw-name { font-size: 24px; }
    .sw-spot .sw-icon { width: 64px; height: 64px; }
    .sw-card { padding: 18px; }
    .sw-btn-row .sw-btn { width: 100%; }
}

.sw-panel { display: flex; flex-direction: column; gap: 12px; }
.sw-panel[hidden] { display: none; }


/* Cloudflare check before downloads */
#turnstile-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; padding: 16px;
    opacity: 0; transition: opacity 0.2s ease;
}
#turnstile-overlay.visible { opacity: 1; }
#turnstile-modal {
    background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
    padding: 24px; text-align: center; display: flex; flex-direction: column; gap: 16px; align-items: center;
    max-width: 100%;
}
#turnstile-title { color: var(--text); font-size: 14px; }
#turnstile-widget { min-height: 65px; }
.sw-challenge { text-align: center; }
.sw-challenge .cf-turnstile { display: flex; justify-content: center; margin: 16px 0; min-height: 65px; }

[hidden] { display: none !important; }
