/*
 * Software section: its own look, apart from the rest of the site
 * (templates/software-shell-header.php). Uses the whole width of the screen.
 */
:root {
    --store-purple: #6a14e0;
    --store-purple-dark: #4b0aa6;
    --store-purple-soft: #f4eeff;
    --store-ink: #15131f;
    --store-text: #3d3a4a;
    --store-muted: #5f5a70;
    --store-line: #e6e2f0;
    --store-bg: #f4f2fa;
    --store-card: #ffffff;
    --store-dark: #15131f;
    --store-dark-2: #2a2638;
    --store-gutter: clamp(16px, 3vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.store-body { margin: 0; background: var(--store-bg); color: var(--store-ink); font: 16px/1.5 Inter, "Segoe UI", system-ui, -apple-system, sans-serif; }
.store-body a { color: var(--store-purple); }
.store-body a:hover { color: var(--store-purple-dark); }
.store-body img { max-width: 100%; }
.store-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.store-muted { margin: 0; color: var(--store-muted); font-size: 14px; }

/* Admin-only bar */
.store-adminbar { display: block; padding: 8px var(--store-gutter); background: #fff3df; color: #7a4b00 !important; font-size: 13px; font-weight: 600; text-decoration: none; }

/* Top bar */
.store-header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 14px var(--store-gutter); background: var(--store-dark); color: #fff; }
.store-back { padding: 8px 12px; border: 1px solid #3b3550; border-radius: 8px; color: #d9d2f3 !important; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.store-back:hover { border-color: #6f63a0; color: #fff !important; }
.store-brand { color: #fff !important; font-size: 20px; font-weight: 800; letter-spacing: .02em; text-decoration: none; white-space: nowrap; }
.store-brand span { color: #b9a6ff; }
.store-cats { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.store-cats::-webkit-scrollbar { display: none; }
.store-cats a { padding: 8px 12px; border-radius: 8px; color: #d9d2f3 !important; font-size: 15px; text-decoration: none; white-space: nowrap; }
.store-cats a:hover { background: #221f30; color: #fff !important; }
.store-cats a.active { background: #2e2845; color: #fff !important; font-weight: 700; }
.store-tools { display: flex; flex: 1 1 auto; justify-content: flex-end; align-items: center; gap: 10px; }
.store-search input { width: min(260px, 100%); padding: 9px 12px; border: 1px solid #3b3550; border-radius: 8px; background: #221f30; color: #fff; font: inherit; font-size: 14px; }
.store-search input::placeholder { color: #a59dc2; }
.store-search input:focus { outline: 2px solid #b9a6ff; outline-offset: 1px; }
.store-account { padding: 9px 12px; color: #fff !important; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }

/* Page */
.store-main { display: flex; flex-direction: column; gap: 18px; padding: 18px var(--store-gutter) 48px; }
.store-crumbs { color: var(--store-muted); font-size: 14px; }
.store-crumbs a { color: var(--store-muted) !important; }
.store-note { margin: 0; padding: 12px 16px; border: 1px solid; border-radius: 10px; font-size: 14px; }
.store-note a { color: inherit !important; font-weight: 700; }
.store-note.is-draft { border-color: #f0c36d; background: #fff7e6; color: #7a4b00; }
.store-note.is-private { border-color: #b9a6e0; background: #f4f0fb; color: #3b2a5c; }
.store-note.is-beta { border-color: #9fd6c9; background: #eefaf6; color: #0f4f44; }

.store-panel { padding: clamp(18px, 2.4vw, 32px); border: 1px solid var(--store-line); border-radius: 14px; background: var(--store-card); scroll-margin-top: 16px; }
.store-panel h2 { margin: 0 0 14px; font-size: 22px; }
.store-panel h3 { margin: 22px 0 10px; font-size: 17px; }
.store-text { margin: 0; color: var(--store-text); font-size: 16px; line-height: 1.7; max-width: 90ch; }
.store-empty { text-align: center; color: var(--store-muted); }

/* Badges and chips */
.store-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.store-badge { display: inline-block; padding: 3px 10px; border-radius: 99px; background: #efe8ff; color: var(--store-purple-dark); font-size: 12px; font-weight: 700; }
.store-badge.is-new { background: #eefaf6; color: #0f4f44; }
.store-badge.is-latest { background: var(--store-purple); color: #fff; text-transform: uppercase; font-size: 11px; letter-spacing: .04em; }
.store-badge.is-featured { background: #fff; color: var(--store-purple-dark); }
.store-badge.is-private { background: #3b2a5c; color: #fff; }
.store-badge.is-beta { background: #0f6b5c; color: #fff; }
.store-chip { display: inline-block; padding: 2px 8px; border: 1px solid var(--store-line); border-radius: 6px; color: var(--store-text); font-size: 12px; font-weight: 600; }
.store-chip.is-platform { border-color: transparent; background: var(--store-purple-soft); color: var(--store-purple-dark); }

/* Hero: gallery + download box */
.store-hero { display: grid; grid-template-columns: minmax(280px, 620px) minmax(0, 1fr); gap: clamp(16px, 1.8vw, 26px); align-items: start; }
.store-gallery { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.store-gallery-main { display: block; overflow: hidden; border-radius: 12px; }
.store-gallery-main img { display: block; width: 100%; height: auto; max-height: 72vh; object-fit: contain; }
.store-gallery-main.is-empty { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; background: var(--store-dark); color: #b9a6ff; font: 700 40px/1 ui-monospace, Menlo, Consolas, monospace; }
.store-thumbs { display: flex; gap: 8px; overflow-x: auto; }
.store-thumbs a, .store-thumb-video { display: block; flex: none; width: 76px; height: 50px; overflow: hidden; border: 2px solid transparent; border-radius: 7px; background: var(--store-dark-2); }
.store-thumbs a:hover, .store-thumbs a.is-active { border-color: var(--store-purple); }
.store-thumbs img { display: block; width: 100%; height: 100%; object-fit: cover; }
.store-thumb-video { display: flex; align-items: center; justify-content: center; gap: 6px; color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; background: #3b2a5c; }
.store-thumb-video:hover { border-color: var(--store-purple); }

.store-info { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: clamp(16px, 1.8vw, 24px); border: 1px solid var(--store-line); border-radius: 14px; background: var(--store-card); }
.store-info-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 14px 20px; }
.store-info-title { display: flex; flex: 1 1 260px; flex-direction: column; gap: 6px; min-width: 0; }
.store-info h1 { margin: 0; font-size: clamp(24px, 2.2vw, 30px); line-height: 1.15; font-weight: 800; }
.store-buy { display: flex; flex: 0 1 300px; flex-direction: column; gap: 8px; min-width: min(100%, 240px); scroll-margin-top: 16px; }
.store-filenote { margin: 0; color: var(--store-muted); font-size: 12px; text-align: center; overflow-wrap: anywhere; }
.store-small { font-size: 13px; }
.store-about h2 { margin: 0 0 6px; font-size: 17px; font-weight: 700; }
.store-about .store-text { font-size: 15px; line-height: 1.65; max-width: 80ch; }
.store-tagline { margin: 0; color: var(--store-text); font-size: 15px; line-height: 1.45; }
.store-price { margin: 0; }
.store-price strong { font-size: 20px; font-weight: 800; }
.store-price span { color: var(--store-muted); font-size: 14px; }
.store-platforms { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 6px; }
.store-platforms button { min-height: 44px; padding: 8px; border: 1px solid #d8d3e6; border-radius: 9px; background: #fff; color: var(--store-text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.store-platforms button[aria-pressed="true"] { border: 2px solid var(--store-purple); background: var(--store-purple-soft); color: var(--store-purple-dark); }
.store-platform-panel { display: flex; flex-direction: column; gap: 10px; }
.store-platform-title { margin: 6px 0 0; font-size: 13px; font-weight: 700; color: var(--store-muted); text-transform: uppercase; letter-spacing: .05em; }
.js-store .store-platform-title { display: none; }
.js-store .store-platform-panel[hidden] { display: none; }
.store-download { display: block; padding: 12px; border-radius: 10px; background: var(--store-purple); color: #fff !important; font-size: 17px; font-weight: 700; text-align: center; text-decoration: none; }
.store-download:hover { background: var(--store-purple-dark); }
.store-filelist { margin: 0; padding: 0; list-style: none; border: 1px solid #ece9f3; border-radius: 10px; overflow: hidden; font-size: 14px; }
.store-filelist li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 10px; }
.store-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px 14px; margin: 0; padding-top: 12px; border-top: 1px solid #ece9f3; font-size: 13px; }
.store-facts div { min-width: 0; }
.store-facts dt { color: var(--store-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.store-facts dd { margin: 1px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.store-filelist li + li { border-top: 1px solid #ece9f3; }
.store-filelist a, .store-filelist li > span:first-child { display: flex; flex-direction: column; min-width: 0; color: var(--store-ink) !important; text-decoration: none; }
.store-filelist a:hover strong { color: var(--store-purple); text-decoration: underline; }
.store-filelist small { color: var(--store-muted); font-size: 12px; overflow-wrap: anywhere; }
.store-size { flex: none; color: var(--store-muted); }
.store-login { margin: 0; padding: 12px 14px; border: 1px solid #d8caff; border-radius: 9px; background: #f5f0ff; font-size: 14px; }
.store-login a { font-weight: 700; }
.store-login.is-asked { border-color: var(--store-purple); box-shadow: 0 0 0 3px rgba(106, 20, 224, .15); }

/* What's new, and the parts that fold open */
.store-whatsnew h2 { margin: 0 0 4px; font-size: 14px; font-weight: 700; }
.store-whatsnew .store-text { font-size: 14px; line-height: 1.6; }
.store-more { display: flex; flex-direction: column; }
.store-more-item { border-top: 1px solid #ece9f3; scroll-margin-top: 16px; }
.store-more-item:last-child { border-bottom: 1px solid #ece9f3; }
.store-more-item > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 0; font-size: 14px; font-weight: 700; cursor: pointer; list-style: none; }
.store-more-item > summary::-webkit-details-marker { display: none; }
.store-more-item > summary::before { content: "▸"; color: var(--store-purple); transition: transform .15s ease; }
.store-more-item[open] > summary::before { transform: rotate(90deg); }
.store-more-item[open] { padding-bottom: 12px; }
.store-more-item .store-text, .store-more-item .download-terms p { font-size: 14px; }

.store-features { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 20px; font-size: 14px; margin: 0; padding: 0; list-style: none; }
.store-features li { position: relative; padding-left: 26px; color: var(--store-text); }
.store-features li::before { content: "✓"; position: absolute; left: 0; color: var(--store-purple); font-weight: 800; }

.store-table-wrap { overflow-x: auto; }
.store-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.store-table th { width: 180px; padding: 8px 12px 8px 0; color: var(--store-muted); font-weight: 600; text-align: left; vertical-align: top; }
.store-table td { padding: 8px 0; }
.store-table tr + tr th, .store-table tr + tr td { border-top: 1px solid #ece9f3; }

/* Older versions */
.store-version + .store-version { margin-top: 12px; }
.store-version-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 4px; font-size: 14px; }
.store-version-date { color: var(--store-muted); font-size: 13px; }
.store-version .store-text { margin-bottom: 6px; }
.store-files { margin: 0; padding: 0; list-style: none; }
.store-files li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid #ece9f3; }
.store-file-name { display: flex; flex-direction: column; min-width: 0; }
.store-file-name small { color: var(--store-muted); font-size: 12px; overflow-wrap: anywhere; }
.store-file-button { padding: 6px 12px; border-radius: 8px; background: var(--store-purple); color: #fff !important; font-size: 14px; font-weight: 700; text-decoration: none; }
.store-file-button.is-login { background: #ececf1; color: var(--store-ink) !important; }

/* Licenses (xenolink_third_party_html) */
.download-terms p { margin: 0 0 10px; color: var(--store-text); line-height: 1.65; }
.third-party-list { margin: 0 0 10px; padding: 0; list-style: none; }
.third-party-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 8px; background: #faf9fd; }
.third-party-list li + li { margin-top: 6px; }
.download-terms-note { color: var(--store-muted) !important; font-size: 14px; }

/* Cards (overview and "More software") */
.store-listhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; }
.store-listhead h1 { margin: 0; font-size: clamp(28px, 3vw, 40px); font-weight: 800; }
.store-sort { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--store-muted); }
.store-sort select { padding: 9px 12px; border: 1px solid #d8d3e6; border-radius: 8px; background: #fff; font: inherit; font-size: 14px; }
.store-sort-go { padding: 9px 12px; border: 0; border-radius: 8px; background: var(--store-purple); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.js-store .store-sort-go { display: none; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: clamp(12px, 1.4vw, 20px); }
.store-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--store-line); border-radius: 14px; background: var(--store-card); color: var(--store-ink) !important; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.store-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(40, 20, 90, .12); }
.store-card-image { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; overflow: hidden; background: var(--store-dark); color: #b9a6ff; font: 700 26px/1 ui-monospace, Menlo, Consolas, monospace; }
.store-card-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.store-card-flags { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; font-family: Inter, system-ui, sans-serif; }
.store-card-body { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.store-card-kind { color: var(--store-purple); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.store-card-body strong { font-size: 19px; line-height: 1.25; }
.store-card-text { color: var(--store-text); font-size: 14px; }
.store-card-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.store-card-foot { display: flex; justify-content: space-between; margin-top: auto; padding-top: 10px; color: var(--store-muted); font-size: 13px; }
.store-card-foot span:first-child { color: var(--store-ink); font-weight: 700; }
.store-related h2 { margin: 0 0 14px; font-size: 22px; }

.store-pagebar { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 24px; }
.store-pages { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.store-pages a, .store-pages span { min-width: 44px; padding: 10px 12px; border: 1px solid var(--store-line); border-radius: 8px; background: #fff; text-align: center; text-decoration: none; }
.store-pages span { border-color: var(--store-purple); background: var(--store-purple); color: #fff; font-weight: 700; }

.store-limit h1 { margin: 0 0 12px; }
.store-limit-links { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 20px 0 0; }

/* Footer */
.store-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding: 20px var(--store-gutter); border-top: 1px solid var(--store-line); color: var(--store-muted); font-size: 14px; }
.store-footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
.store-footer a { color: var(--store-muted) !important; }

/* Lightbox (assets/js/lightbox.js), the same as on the rest of the site */
.lightbox { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 56px 64px; background: rgba(8, 6, 14, .6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.lightbox[hidden] { display: none; }
.lightbox-stage { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.lightbox-stage img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.lightbox-video { display: block; width: min(1280px, 100%, calc((100vh - 112px) * 16 / 9)); aspect-ratio: 16 / 9; border: 0; border-radius: 10px; background: #000; }
.lightbox button { position: absolute; display: flex; align-items: center; justify-content: center; width: 46px; height: 46px; border: 0; border-radius: 50%; background: rgba(20, 12, 40, .72); color: #fff; font: inherit; font-size: 22px; cursor: pointer; }
.lightbox button[hidden] { display: none; }
.lightbox button:hover, .lightbox button:focus-visible { background: var(--store-purple); }
.lightbox-close { top: 14px; right: 14px; }
.lightbox-prev { left: 12px; top: 50%; margin-top: -23px; }
.lightbox-next { right: 12px; top: 50%; margin-top: -23px; }
.lightbox-count { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); padding: 3px 10px; border-radius: 999px; background: rgba(20, 12, 40, .72); color: #e9e6f5; font-size: 13px; }
.lightbox-count:empty { display: none; }
body.lightbox-open { overflow: hidden; }

@media (max-width: 900px) {
    .store-hero { grid-template-columns: 1fr; }
    .store-gallery { max-width: 620px; }
}
@media (max-width: 700px) {
    .store-header { gap: 10px 12px; }
    .store-brand { font-size: 17px; }
    .store-cats { order: 5; flex-basis: 100%; }
    .store-tools { flex-basis: 100%; justify-content: space-between; }
    .store-search { flex: 1; }
    .store-search input { width: 100%; }
    .store-buy { flex-basis: 100%; }
    .store-table th { width: 38%; padding-left: 0; }
    .store-table td { padding-right: 0; overflow-wrap: anywhere; }
    .store-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
    .lightbox { padding: 64px 10px; }
    .lightbox-video { width: 100%; }
    .lightbox-prev, .lightbox-next { top: auto; bottom: 8px; margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .store-card, .store-more-item > summary::before { transition: none; }
}
