/*
Theme Name: SoftDrop
Theme URI: https://softdrop.com
Author: SoftDrop Team
Description: A professional software download directory theme with dark/light mode, AJAX search, version tables, and full SEO support.
Version: 1.0.5
License: GPL-2.0-or-later
Text Domain: softdrop
*/

/* ============================================================
   CSS VARIABLES & DESIGN TOKENS
   ============================================================ */
:root {
    --bg:          #0f1117;
    --bg-card:     #1a1d2e;
    --bg-elevated: #222640;
    --bg-input:    #1e2235;
    --border:      #2d3154;
    --border-light:#3a3f6e;

    --text:        #e8eaf6;
    --text-muted:  #8b92b8;
    --text-dim:    #555e8a;

    --accent:      #4f7cff;
    --accent-hover:#6b93ff;
    --accent-glow: rgba(79,124,255,0.25);
    --accent-dim:  rgba(79,124,255,0.12);

    --green:       #22c55e;
    --green-dim:   rgba(34,197,94,0.12);
    --orange:      #f59e0b;
    --orange-dim:  rgba(245,158,11,0.12);
    --red:         #ef4444;
    --red-dim:     rgba(239,68,68,0.12);
    --purple:      #a855f7;

    --radius-sm:   6px;
    --radius:      12px;
    --radius-lg:   18px;
    --radius-xl:   24px;

    --shadow-sm:   0 2px 8px rgba(0,0,0,0.4);
    --shadow:      0 4px 24px rgba(0,0,0,0.5);
    --shadow-lg:   0 8px 48px rgba(0,0,0,0.6);
    --shadow-accent: 0 4px 24px rgba(79,124,255,0.3);

    --font-body:   'Plus Jakarta Sans', system-ui, sans-serif;
    --font-mono:   'JetBrains Mono', 'Fira Code', monospace;

    --header-h:    68px;
    --container:   1280px;
    --sidebar-w:   300px;

    --transition:  0.2s cubic-bezier(0.4,0,0.2,1);
}

[data-theme="light"] {
    --bg:          #f4f5fb;
    --bg-card:     #ffffff;
    --bg-elevated: #eef0f9;
    --bg-input:    #f0f2fc;
    --border:      #dde1f2;
    --border-light:#c8cde8;

    --text:        #1a1d2e;
    --text-muted:  #555e8a;
    --text-dim:    #8b92b8;

    --accent:      #3b6eff;
    --accent-hover:#2559e8;
    --accent-glow: rgba(59,110,255,0.18);
    --accent-dim:  rgba(59,110,255,0.08);

    --shadow-sm:   0 2px 8px rgba(100,116,180,0.1);
    --shadow:      0 4px 24px rgba(100,116,180,0.15);
    --shadow-lg:   0 8px 48px rgba(100,116,180,0.2);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
    overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ============================================================
   HEADER
   ============================================================ */
#site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-h);
    background: rgba(15,17,23,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}
[data-theme="light"] #site-header { background: rgba(244,245,251,0.92); }

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 20px;
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}
.logo-icon {
    width: 36px; height: 36px;
    background: var(--accent);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    box-shadow: var(--shadow-accent);
}
.logo-text { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.logo-text span { color: var(--accent); }

/* Navigation */
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all var(--transition);
}
.main-nav a:hover, .main-nav a.active {
    color: var(--text);
    background: var(--accent-dim);
}

/* Header search */
.header-search { flex: 1; max-width: 380px; position: relative; }
.header-search input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 9px 40px 9px 16px;
    font-size: 14px;
    color: var(--text);
    transition: all var(--transition);
    outline: none;
}
.header-search input::placeholder { color: var(--text-dim); }
.header-search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    background: var(--bg-card);
}
.search-btn {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); padding: 0; display: flex;
    background: transparent;
}

/* Search dropdown */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 420px;
    overflow-y: auto;
    display: none;
    z-index: 999;
}
.search-results-dropdown.open { display: block; animation: dropIn 0.15s ease; }
@keyframes dropIn { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }

.search-result-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
    text-decoration: none;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--accent-dim); }
.search-result-thumb {
    width: 40px; height: 40px; border-radius: 8px;
    object-fit: cover; background: var(--bg-elevated); flex-shrink: 0;
}
.search-result-info { flex: 1; min-width: 0; }
.search-result-name { font-size: 14px; font-weight: 600; color: var(--text); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-meta { font-size: 12px; color: var(--text-muted); }
.search-no-results { padding: 24px; text-align: center; color: var(--text-muted); font-size: 14px; }
.search-loading { padding: 20px; text-align: center; }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.theme-toggle {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition);
    font-size: 16px;
}
.theme-toggle:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }

.submit-btn {
    padding: 8px 18px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    transition: all var(--transition);
    white-space: nowrap;
}
.submit-btn:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-accent);
    color: #fff;
    transform: translateY(-1px);
}

/* Mobile menu toggle */
.mobile-menu-btn {
    display: none;
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border);
    align-items: center; justify-content: center;
    font-size: 20px; color: var(--text);
}

/* ============================================================
   HERO / HOMEPAGE BANNER
   ============================================================ */
.hero {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
    border-bottom: 1px solid var(--border);
    padding: 72px 0 56px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(ellipse 800px 400px at 60% 50%, var(--accent-glow), transparent 70%);
    pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; text-align: center; }
.hero h1 { font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 800; letter-spacing: -1px; line-height: 1.15; margin-bottom: 16px; }
.hero h1 span { color: var(--accent); }
.hero p { font-size: 17px; color: var(--text-muted); max-width: 520px; margin: 0 auto 36px; }

/* Hero search */
.hero-search { max-width: 580px; margin: 0 auto; position: relative; }
.hero-search-box {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 6px 6px 24px;
    box-shadow: var(--shadow);
    transition: all var(--transition);
}
.hero-search-box:focus-within {
    border-color: var(--accent);
    box-shadow: var(--shadow), 0 0 0 4px var(--accent-glow);
}
.hero-search-box input {
    flex: 1; background: none; border: none; outline: none;
    font-size: 16px; color: var(--text); padding: 6px 0;
}
.hero-search-box input::placeholder { color: var(--text-dim); }
.hero-search-btn {
    background: var(--accent); color: #fff;
    padding: 10px 24px; border-radius: 999px;
    font-weight: 600; font-size: 14px;
    transition: all var(--transition);
}
.hero-search-btn:hover { background: var(--accent-hover); box-shadow: var(--shadow-accent); }

.hero-stats { display: flex; justify-content: center; gap: 40px; margin-top: 40px; }
.hero-stat-num { font-size: 24px; font-weight: 800; color: var(--text); display: block; }
.hero-stat-label { font-size: 13px; color: var(--text-muted); }

/* Category pills (quick links) */
.category-pills { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.cat-pill {
    padding: 7px 18px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition);
}
.cat-pill:hover, .cat-pill.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

/* ============================================================
   SECTION LAYOUT
   ============================================================ */
.site-main { padding: 48px 0; }

.content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr var(--sidebar-w);
    gap: 32px;
    align-items: start;
}

.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px;
}
.section-title {
    font-size: 20px; font-weight: 700; color: var(--text);
    display: flex; align-items: center; gap: 10px;
}
.section-title::before {
    content: '';
    width: 4px; height: 20px;
    background: var(--accent);
    border-radius: 2px;
    display: block;
}
.section-link { font-size: 13px; color: var(--accent); font-weight: 500; }
.section-link:hover { text-decoration: underline; }

/* ============================================================
   SOFTWARE CARD
   ============================================================ */
.software-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
    overflow: hidden;
}
.software-card::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, var(--accent-dim) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--transition);
    pointer-events: none;
}
.software-card:hover { border-color: var(--border-light); box-shadow: var(--shadow); transform: translateY(-2px); }
.software-card:hover::before { opacity: 1; }

.card-top { display: flex; align-items: flex-start; gap: 14px; }
.card-thumb {
    width: 60px; height: 60px; border-radius: 14px;
    object-fit: cover; background: var(--bg-elevated);
    border: 1px solid var(--border); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    overflow: hidden;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 13px; }

.card-meta { flex: 1; min-width: 0; }
.card-category {
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--accent); margin-bottom: 4px;
}
.card-title {
    font-size: 15px; font-weight: 700; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    text-decoration: none; display: block;
}
.card-title:hover { color: var(--accent); }
.card-version {
    font-size: 12px; color: var(--text-muted); margin-top: 3px;
    font-family: var(--font-mono);
}
.card-desc {
    font-size: 13px; color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.card-size { font-size: 12px; color: var(--text-dim); font-family: var(--font-mono); }

.btn-download-card {
    padding: 7px 16px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    transition: all var(--transition);
    display: flex; align-items: center; gap: 6px;
    text-decoration: none;
}
.btn-download-card:hover {
    background: var(--accent-hover);
    box-shadow: var(--shadow-accent);
    color: #fff;
    transform: translateY(-1px);
}

.badge-featured {
    position: absolute; top: 12px; right: 12px;
    background: linear-gradient(135deg, var(--orange), #f97316);
    color: #fff; font-size: 10px; font-weight: 700;
    padding: 3px 10px; border-radius: 999px;
    text-transform: uppercase; letter-spacing: 0.5px;
}

/* ============================================================
   CATEGORIES GRID
   ============================================================ */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 40px;
}
.cat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align: center;
    text-decoration: none;
    transition: all var(--transition);
    display: block;
}
.cat-card:hover { border-color: var(--accent); background: var(--accent-dim); transform: translateY(-2px); }
.cat-card-icon { font-size: 32px; margin-bottom: 8px; display: block; }
.cat-card-name { font-size: 13px; font-weight: 600; color: var(--text); display: block; }
.cat-card-count { font-size: 11px; color: var(--text-muted); display: block; margin-top: 2px; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar { position: sticky; top: calc(var(--header-h) + 24px); }

.widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}
.widget-title {
    font-size: 14px; font-weight: 700; color: var(--text);
    text-transform: uppercase; letter-spacing: 0.8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.widget-cat-list li { margin-bottom: 2px; }
.widget-cat-list a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 10px; border-radius: var(--radius-sm);
    font-size: 13px; color: var(--text-muted);
    text-decoration: none; transition: all var(--transition);
}
.widget-cat-list a:hover { background: var(--accent-dim); color: var(--accent); }
.widget-cat-list .count {
    background: var(--bg-elevated);
    padding: 2px 8px; border-radius: 999px;
    font-size: 11px; color: var(--text-dim);
    font-family: var(--font-mono);
}

.trending-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0; border-bottom: 1px solid var(--border);
}
.trending-item:last-child { border-bottom: none; padding-bottom: 0; }
.trending-rank {
    width: 24px; height: 24px; border-radius: 6px;
    background: var(--bg-elevated);
    font-size: 11px; font-weight: 700; color: var(--text-dim);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.trending-rank.top { background: var(--accent-dim); color: var(--accent); }
.trending-thumb {
    width: 36px; height: 36px; border-radius: 8px;
    background: var(--bg-elevated); object-fit: cover; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 18px;
    overflow: hidden;
}
.trending-thumb img { width: 100%; height: 100%; object-fit: cover; }
.trending-info { flex: 1; min-width: 0; }
.trending-name { font-size: 13px; font-weight: 600; color: var(--text); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.trending-name:hover { color: var(--accent); }
.trending-version { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); }

/* ============================================================
   SINGLE SOFTWARE PAGE
   ============================================================ */
.single-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    align-items: start;
}

/* Breadcrumb */
.breadcrumb {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--text-muted);
    margin-bottom: 24px; flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--text-dim); }
.breadcrumb-current { color: var(--text); font-weight: 500; }

/* Software header */
.software-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
}
.software-header-top { display: flex; gap: 24px; align-items: flex-start; }
.software-icon {
    width: 100px; height: 100px; border-radius: 22px;
    border: 1px solid var(--border);
    object-fit: cover; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 52px; background: var(--bg-elevated);
    overflow: hidden;
}
.software-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 21px; }
.software-header-info { flex: 1; }
.software-title { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; color: var(--text); margin-bottom: 6px; }
.software-tagline { font-size: 15px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.5; }
.software-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.software-tag {
    padding: 4px 12px; border-radius: 999px;
    font-size: 12px; font-weight: 500;
    background: var(--bg-elevated); color: var(--text-muted);
    border: 1px solid var(--border);
}
.software-tag.cat-tag { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }
.software-tag.os-tag { background: var(--green-dim); color: var(--green); border-color: var(--green); }

/* Ratings */
.software-rating { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.stars { color: var(--orange); font-size: 15px; letter-spacing: -1px; }
.rating-num { font-size: 14px; font-weight: 700; color: var(--text); }
.rating-count { font-size: 13px; color: var(--text-muted); }

/* Meta grid (version, size, etc.) */
.software-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.meta-item { text-align: center; }
.meta-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-dim); display: block; margin-bottom: 4px; }
.meta-value { font-size: 14px; font-weight: 700; color: var(--text); display: block; font-family: var(--font-mono); }
.meta-value.green { color: var(--green); }
.meta-value.orange { color: var(--orange); }

/* Content sections */
.content-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
}
.content-section h2 {
    font-size: 18px; font-weight: 700; color: var(--text);
    margin-bottom: 18px; padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.content-section h2 .section-icon { font-size: 18px; }
.content-section p { font-size: 15px; color: var(--text-muted); line-height: 1.75; margin-bottom: 14px; }
.content-section p:last-child { margin-bottom: 0; }
.content-section h3 { font-size: 16px; font-weight: 600; color: var(--text); margin: 20px 0 10px; }

/* Features list */
.features-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.features-list li {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 14px; color: var(--text-muted); line-height: 1.5;
}
.features-list li::before {
    content: '✓';
    color: var(--green);
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

/* System requirements table */
.sysreq-table { width: 100%; border-collapse: collapse; }
.sysreq-table tr { border-bottom: 1px solid var(--border); }
.sysreq-table tr:last-child { border-bottom: none; }
.sysreq-table td { padding: 10px 12px; font-size: 14px; }
.sysreq-table td:first-child {
    font-weight: 600; color: var(--text); width: 38%;
    background: var(--bg-elevated); border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}
.sysreq-table td:last-child { color: var(--text-muted); }

/* ============================================================
   VERSIONS TABLE
   ============================================================ */
.versions-table-wrap { overflow-x: auto; }
.versions-table { width: 100%; border-collapse: collapse; }
.versions-table thead tr { border-bottom: 2px solid var(--border); }
.versions-table th {
    padding: 12px 16px; text-align: left;
    font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--text-dim);
}
.versions-table td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--border); }
.versions-table tbody tr:last-child td { border-bottom: none; }
.versions-table tbody tr:hover td { background: var(--accent-dim); }

.version-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-mono); font-size: 13px;
    color: var(--text); font-weight: 600;
}
.latest-badge {
    display: inline-block;
    background: var(--green-dim); color: var(--green);
    font-size: 10px; font-weight: 700; padding: 2px 7px;
    border-radius: 999px; text-transform: uppercase; letter-spacing: 0.5px;
    margin-left: 6px;
}
.version-date { color: var(--text-muted); font-size: 13px; }
.version-size { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); }

.btn-dl-sm {
    padding: 7px 16px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 12px; font-weight: 600;
    transition: all var(--transition);
    display: inline-flex; align-items: center; gap: 5px;
    text-decoration: none; white-space: nowrap;
}
.btn-dl-sm:hover { background: var(--accent-hover); box-shadow: var(--shadow-accent); color: #fff; transform: translateY(-1px); }
.btn-dl-sm.mirror { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); }
.btn-dl-sm.mirror:hover { background: var(--bg-card); color: var(--text); }

.load-more-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 12px;
    background: var(--bg-elevated);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px; color: var(--text-muted); font-weight: 500;
    cursor: pointer; transition: all var(--transition);
    margin-top: 12px;
}
.load-more-btn:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }

/* ============================================================
   SCREENSHOTS GALLERY
   ============================================================ */
.gallery-slider { position: relative; overflow: hidden; border-radius: var(--radius); }
.gallery-track { display: flex; gap: 12px; transition: transform 0.4s cubic-bezier(0.4,0,0.2,1); }
.gallery-slide {
    flex-shrink: 0;
    width: calc(33.333% - 8px);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: border-color var(--transition);
}
.gallery-slide:hover { border-color: var(--accent); }
.gallery-slide img { width: 100%; height: 160px; object-fit: cover; display: block; }
.gallery-nav { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.gallery-btn {
    width: 32px; height: 32px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: 14px; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all var(--transition);
}
.gallery-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Lightbox */
.lightbox {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.92);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s ease;
}
.lightbox.open { opacity: 1; pointer-events: all; }
.lightbox-img { max-width: 90vw; max-height: 90vh; border-radius: var(--radius); }
.lightbox-close {
    position: absolute; top: 20px; right: 24px;
    font-size: 32px; color: #fff; cursor: pointer;
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.1); border-radius: 50%;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ============================================================
   DOWNLOAD BUTTONS (main CTA)
   ============================================================ */
.download-cta-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}
.btn-download-main {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 16px 24px;
    background: linear-gradient(135deg, var(--accent), #6b93ff);
    color: #fff; border-radius: var(--radius);
    font-size: 16px; font-weight: 700;
    text-decoration: none;
    transition: all var(--transition);
    box-shadow: var(--shadow-accent);
    margin-bottom: 10px;
}
.btn-download-main:hover {
    background: linear-gradient(135deg, var(--accent-hover), #7da5ff);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(79,124,255,0.4);
    color: #fff;
}
.btn-download-main .dl-icon { font-size: 20px; }
.btn-download-main .dl-size { font-size: 12px; opacity: 0.8; font-family: var(--font-mono); margin-left: 4px; }

.btn-mirror {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 12px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius);
    font-size: 14px; font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
}
.btn-mirror:hover { background: var(--bg-card); color: var(--text); border-color: var(--border-light); }

.secure-badge {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; margin-top: 12px;
    background: var(--green-dim);
    border: 1px solid rgba(34,197,94,0.2);
    border-radius: var(--radius-sm);
    font-size: 12px; color: var(--green);
}

/* File info sidebar box */
.file-info-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 20px; }
.file-info-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-dim); margin-bottom: 16px; }
.file-info-list { list-style: none; }
.file-info-list li {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.file-info-list li:last-child { border-bottom: none; }
.fi-label { color: var(--text-dim); font-weight: 500; white-space: nowrap; }
.fi-value { color: var(--text); font-weight: 600; text-align: right; font-family: var(--font-mono); font-size: 12px; }
.fi-value.green { color: var(--green); font-family: var(--font-body); font-size: 13px; }

/* ============================================================
   RELATED SOFTWARE
   ============================================================ */
.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.related-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px;
    text-decoration: none; display: block;
    transition: all var(--transition);
}
.related-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.related-thumb {
    width: 48px; height: 48px; border-radius: 12px;
    background: var(--bg-elevated); margin-bottom: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; border: 1px solid var(--border);
    overflow: hidden;
}
.related-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; }
.related-name { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 3px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.related-version { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); display: block; margin-bottom: 6px; }
.related-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ============================================================
   DOWNLOAD PAGE (COUNTDOWN)
   ============================================================ */
.download-page-wrap { max-width: 680px; margin: 60px auto; text-align: center; padding: 0 24px; }
.download-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-xl); padding: 48px;
    box-shadow: var(--shadow-lg);
}
.download-software-icon { font-size: 72px; margin-bottom: 16px; display: block; }
.download-software-name { font-size: 26px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.download-software-version { font-size: 14px; color: var(--text-muted); font-family: var(--font-mono); margin-bottom: 32px; }

.countdown-ring { position: relative; width: 120px; height: 120px; margin: 0 auto 24px; }
.countdown-ring svg { transform: rotate(-90deg); }
.countdown-ring-circle { fill: none; stroke: var(--border); stroke-width: 6; }
.countdown-ring-progress {
    fill: none; stroke: var(--accent); stroke-width: 6;
    /* circumference = 2 * PI * 50 = 314.159 */
    stroke-dasharray: 314.159;
    stroke-dashoffset: 0;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}
.countdown-number {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; font-weight: 800; color: var(--accent);
}

.download-status { font-size: 15px; color: var(--text-muted); margin-bottom: 28px; }
.download-status strong { color: var(--text); }

.btn-download-now {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 16px 40px;
    background: linear-gradient(135deg, var(--accent), #6b93ff);
    color: #fff; border-radius: var(--radius);
    font-size: 16px; font-weight: 700;
    text-decoration: none; box-shadow: var(--shadow-accent);
    transition: all var(--transition);
    opacity: 1; pointer-events: all;
}
.btn-download-now:hover {
    background: linear-gradient(135deg, var(--accent-hover), #7da5ff);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(79,124,255,0.4);
}
.btn-download-now.ready {
    animation: pulse-download 1s ease-in-out 2;
}
@keyframes pulse-download {
    0%, 100% { box-shadow: var(--shadow-accent); }
    50%       { box-shadow: 0 0 0 8px rgba(79,124,255,0.25), var(--shadow-accent); }
}

.download-security { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 24px; flex-wrap: wrap; }
.sec-badge { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.sec-badge .icon { font-size: 14px; color: var(--green); }

.download-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; text-align: left; }
.dl-info-item { background: var(--bg-elevated); border-radius: var(--radius-sm); padding: 12px 14px; }
.dl-info-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-dim); display: block; margin-bottom: 3px; }
.dl-info-value { font-size: 14px; font-weight: 600; color: var(--text); font-family: var(--font-mono); }

/* ============================================================
   ARCHIVE PAGE
   ============================================================ */
.archive-header {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 28px 32px; margin-bottom: 28px;
}
.archive-title { font-size: 24px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.archive-desc { font-size: 15px; color: var(--text-muted); }
.archive-count {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--accent-dim); color: var(--accent);
    padding: 4px 12px; border-radius: 999px;
    font-size: 13px; font-weight: 600; margin-top: 10px;
}

/* Sort / filter bar */
.filter-bar {
    display: flex; align-items: center; gap: 10px; margin-bottom: 24px; flex-wrap: wrap;
}
.filter-btn {
    padding: 8px 16px; border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    font-size: 13px; color: var(--text-muted); font-weight: 500;
    cursor: pointer; transition: all var(--transition);
}
.filter-btn.active, .filter-btn:hover {
    background: var(--accent-dim); border-color: var(--accent); color: var(--accent);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin-top: 40px;
}
.page-btn {
    width: 36px; height: 36px; border-radius: var(--radius-sm);
    background: var(--bg-card); border: 1px solid var(--border);
    font-size: 13px; color: var(--text-muted); font-weight: 500;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; transition: all var(--transition);
}
.page-btn:hover, .page-btn.current {
    background: var(--accent); border-color: var(--accent); color: #fff;
}
.page-btn.prev, .page-btn.next { width: auto; padding: 0 14px; gap: 4px; }

/* ============================================================
   FOOTER
   ============================================================ */
#site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 56px 0 24px;
    margin-top: 80px;
}
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer-brand .logo-text { font-size: 22px; margin-bottom: 12px; display: block; }
.footer-brand p { font-size: 14px; color: var(--text-muted); line-height: 1.65; }
.footer-col h4 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-dim); margin-bottom: 16px; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { font-size: 13px; color: var(--text-muted); text-decoration: none; transition: color var(--transition); }
.footer-col ul li a:hover { color: var(--accent); }
.footer-bottom {
    display: flex; align-items: center; justify-content: space-between;
    padding-top: 24px; border-top: 1px solid var(--border);
    font-size: 13px; color: var(--text-dim);
}
.footer-bottom a { color: var(--text-dim); text-decoration: none; }
.footer-bottom a:hover { color: var(--accent); }

/* ============================================================
   LOADING SPINNER
   ============================================================ */
.spinner {
    width: 20px; height: 20px; border: 2px solid var(--border);
    border-top-color: var(--accent); border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   NOTIFICATIONS / TOAST
   ============================================================ */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9998; display: flex; flex-direction: column; gap: 8px; }
.toast {
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 18px;
    font-size: 14px; color: var(--text);
    display: flex; align-items: center; gap: 10px;
    box-shadow: var(--shadow);
    animation: slideUp 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}
.toast.success { border-color: var(--green); }
.toast.error   { border-color: var(--red); }
@keyframes slideUp { from { transform: translateY(20px); opacity:0; } to { transform: none; opacity:1; } }
@keyframes fadeOut { to { opacity:0; transform: translateY(-10px); } }

/* ============================================================
   ADMIN META BOX STYLES (wp-admin)
   ============================================================ */
.sd-meta-box { padding: 12px 0; }
.sd-meta-row { display: grid; grid-template-columns: 160px 1fr; gap: 16px; align-items: center; margin-bottom: 14px; }
.sd-meta-row label { font-size: 13px; font-weight: 600; color: #1d2327; }
.sd-meta-row input, .sd-meta-row select, .sd-meta-row textarea {
    width: 100%; padding: 8px 12px; border: 1px solid #8c8f94;
    border-radius: 4px; font-size: 13px; color: #1d2327;
}
.sd-meta-row textarea { min-height: 80px; resize: vertical; }
.sd-versions-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.sd-versions-table th { background: #f6f7f7; padding: 8px 12px; font-size: 12px; font-weight: 600; text-align: left; border: 1px solid #ddd; color: #50575e; text-transform: uppercase; }
.sd-versions-table td { padding: 8px 12px; border: 1px solid #ddd; }
.sd-versions-table td input { width: 100%; border: 1px solid #ddd; padding: 5px 8px; border-radius: 3px; font-size: 12px; }
.sd-add-version { margin-top: 8px; background: #2271b1; color: #fff; padding: 6px 14px; border: none; border-radius: 3px; cursor: pointer; font-size: 12px; }
.sd-remove-version { background: #d63638; color: #fff; border: none; padding: 4px 10px; border-radius: 3px; cursor: pointer; font-size: 11px; }

/* ============================================================
   RESPONSIVE — COMPLETE MOBILE-FIRST OVERHAUL
   ============================================================ */

/* ── Tablet: 1024px ─────────────────────────────────────── */
@media (max-width: 1024px) {

    /* Layout */
    .content-with-sidebar,
    .single-layout { grid-template-columns: 1fr; }
    .sidebar { position: static; top: auto; }

    /* Grids */
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .related-grid { grid-template-columns: repeat(3, 1fr); }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }

    /* Single page meta */
    .software-meta-grid { grid-template-columns: repeat(2, 1fr); }

    /* Hero stats */
    .hero-stats { gap: 28px; }

    /* Versions table: allow horizontal scroll */
    .versions-table-wrap { -webkit-overflow-scrolling: touch; }
}

/* ── Mobile: 768px ──────────────────────────────────────── */
@media (max-width: 768px) {

    /* ── Global ── */
    .container { padding: 0 16px; }
    body { font-size: 15px; }

    /* ── Header ── */
    #site-header { height: 58px; }
    :root { --header-h: 58px; }

    .header-inner { gap: 10px; }
    .header-inner .main-nav  { display: none; }
    .header-inner .submit-btn { display: none; }
    .mobile-menu-btn { display: flex; }

    /* Search bar shrinks to fill available space */
    .header-search { flex: 1; min-width: 0; max-width: none; }
    .header-search input { padding: 8px 36px 8px 12px; font-size: 13px; }

    /* Logo text hides on very small, icon stays */
    .logo-text { font-size: 17px; }

    /* Search dropdown full-width on mobile */
    .search-results-dropdown {
        position: fixed;
        top: 58px;
        left: 0; right: 0;
        border-radius: 0 0 var(--radius) var(--radius);
        max-height: 60vh;
    }

    /* ── Hero ── */
    .hero { padding: 40px 0 32px; }
    .hero h1 { font-size: 1.75rem; letter-spacing: -0.5px; }
    .hero p  { font-size: 15px; margin-bottom: 24px; }

    .hero-search-box { padding: 5px 5px 5px 16px; }
    .hero-search-box input { font-size: 15px; }
    .hero-search-btn { padding: 9px 16px; font-size: 13px; }

    .hero-stats { gap: 20px; flex-wrap: wrap; justify-content: center; }
    .hero-stat-num { font-size: 20px; }
    .hero-stat-label { font-size: 12px; }

    .category-pills { gap: 6px; }
    .cat-pill { padding: 6px 14px; font-size: 12px; }

    /* ── Sections ── */
    .site-main { padding: 32px 0; }
    .section-header { margin-bottom: 16px; }
    .section-title { font-size: 17px; }

    /* ── Categories grid ── */
    .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .cat-card { padding: 16px 10px; }
    .cat-card-icon { font-size: 26px; margin-bottom: 6px; }
    .cat-card-name { font-size: 12px; }
    .cat-card-count { font-size: 10px; }

    /* ── Software grids ── */
    .grid-2,
    .grid-3 { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .related-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    /* ── Software card ── */
    .software-card { padding: 14px; gap: 10px; }
    .card-thumb { width: 48px; height: 48px; border-radius: 11px; font-size: 22px; }
    .card-title { font-size: 13px; }
    .card-version { font-size: 11px; }
    .card-desc { font-size: 12px; -webkit-line-clamp: 2; }
    .card-footer { gap: 6px; flex-wrap: wrap; }
    .card-size { font-size: 11px; }
    .btn-download-card { padding: 6px 12px; font-size: 11px; }

    /* ── Single software page ── */
    .software-header { padding: 20px; }
    .software-header-top { flex-direction: column; align-items: flex-start; gap: 14px; }
    .software-icon { width: 72px; height: 72px; font-size: 36px; border-radius: 16px; }
    .software-icon img { border-radius: 15px; }
    .software-title { font-size: 22px; }
    .software-tagline { font-size: 14px; }
    .software-meta-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; padding-top: 18px; }
    .meta-label { font-size: 10px; }
    .meta-value { font-size: 13px; }

    /* Content sections */
    .content-section { padding: 18px; margin-bottom: 16px; }
    .content-section h2 { font-size: 16px; margin-bottom: 14px; padding-bottom: 12px; }
    .content-section p { font-size: 14px; }

    /* Features list — single col on mobile */
    .features-list { grid-template-columns: 1fr; gap: 6px; }
    .features-list li { font-size: 13px; }

    /* System req table */
    .sysreq-table td { padding: 8px 10px; font-size: 13px; }
    .sysreq-table td:first-child { width: 42%; }

    /* Versions table */
    .versions-table th,
    .versions-table td { padding: 10px 10px; font-size: 13px; }
    .versions-table th { font-size: 11px; }
    .btn-dl-sm { padding: 6px 12px; font-size: 11px; }
    .load-more-btn { font-size: 13px; padding: 11px; }

    /* Gallery */
    .gallery-slide { width: calc(50% - 6px); }
    .gallery-slide img { height: 120px; }

    /* Download CTA sidebar (stacks below content on mobile) */
    .download-cta-box { padding: 18px; }
    .btn-download-main { padding: 14px 20px; font-size: 15px; }

    /* File info box */
    .file-info-box { padding: 16px; }
    .file-info-list li { font-size: 12px; }

    /* Related section */
    .related-card { padding: 12px; }
    .related-thumb { width: 40px; height: 40px; font-size: 20px; }
    .related-name { font-size: 12px; }
    .related-version { font-size: 10px; }
    .related-desc { font-size: 11px; }

    /* Archive */
    .archive-header { padding: 20px; }
    .archive-title { font-size: 20px; }
    .filter-bar { gap: 7px; }
    .filter-btn { padding: 7px 12px; font-size: 12px; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    #site-footer { padding: 40px 0 20px; margin-top: 48px; }
    .footer-bottom { flex-direction: column; gap: 6px; text-align: center; font-size: 12px; }

    /* Download page */
    .download-page-wrap { margin: 32px auto; padding: 0 16px; }
    .download-card { padding: 32px 20px; }
    .download-software-name { font-size: 22px; }
    .download-info-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .dl-info-item { padding: 10px 12px; }
    .dl-info-value { font-size: 12px; }
    .download-security { gap: 12px; }
    .sec-badge { font-size: 11px; }

    /* Pagination */
    .pagination { gap: 4px; margin-top: 28px; flex-wrap: wrap; }
    .page-btn { width: 32px; height: 32px; font-size: 12px; }
    .page-btn.prev,
    .page-btn.next { padding: 0 10px; font-size: 12px; }

    /* Breadcrumb */
    .breadcrumb { font-size: 12px; margin-bottom: 16px; }

    /* Sidebar widgets compact */
    .widget { padding: 16px; margin-bottom: 14px; }
    .widget-title { font-size: 12px; margin-bottom: 12px; padding-bottom: 10px; }
    .trending-item { padding: 8px 0; gap: 10px; }
    .trending-thumb { width: 32px; height: 32px; font-size: 16px; }
    .trending-name { font-size: 12px; }

    /* Toast */
    .toast-container { bottom: 16px; right: 16px; left: 16px; }
    .toast { font-size: 13px; padding: 12px 14px; }
}

/* ── Small mobile: 480px ────────────────────────────────── */
@media (max-width: 480px) {

    /* Grids go single column */
    .grid-2,
    .grid-3,
    .grid-4 { grid-template-columns: 1fr; gap: 12px; }
    .related-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    /* Categories 2 cols */
    .categories-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .cat-card { padding: 14px 8px; }

    /* Hero */
    .hero h1 { font-size: 1.5rem; }
    .hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
    .category-pills { justify-content: flex-start; overflow-x: auto; padding-bottom: 4px; flex-wrap: nowrap; }
    .cat-pill { flex-shrink: 0; }

    /* Header: logo icon only, no text */
    .logo-text { display: none; }

    /* Single page */
    .software-meta-grid { grid-template-columns: 1fr 1fr; }
    .software-title { font-size: 19px; }

    /* Content section padding */
    .content-section { padding: 14px; }
    .software-header { padding: 16px; }

    /* Versions table: card-style stacking */
    .versions-table,
    .versions-table thead,
    .versions-table tbody,
    .versions-table th,
    .versions-table td,
    .versions-table tr { display: block; width: 100%; }
    .versions-table thead { display: none; }
    .versions-table tbody tr {
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        margin-bottom: 10px;
        padding: 12px;
        background: var(--bg-card);
    }
    .versions-table td {
        border: none;
        padding: 4px 0;
        font-size: 13px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .versions-table td::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 600;
        color: var(--text-dim);
        text-transform: uppercase;
        letter-spacing: 0.6px;
        margin-right: 8px;
        flex-shrink: 0;
    }
    .versions-table td:last-child { margin-top: 8px; justify-content: flex-start; }

    /* Gallery single col */
    .gallery-slide { width: 100%; }
    .gallery-slide img { height: 180px; }

    /* Download page */
    .download-card { padding: 24px 16px; }
    .download-info-grid { grid-template-columns: 1fr; }
    .countdown-ring { width: 100px; height: 100px; }
    .countdown-ring svg { width: 100px; height: 100px; }
    .countdown-number { font-size: 26px; }
    .btn-download-now { padding: 14px 24px; font-size: 15px; }

    /* Related under download page: single col */
    .related-grid[style*="grid-template-columns:repeat(2,1fr)"] {
        grid-template-columns: 1fr !important;
    }

    /* Footer compact */
    .footer-brand .logo-text { display: block; font-size: 18px; }
    .footer-col h4 { font-size: 12px; }
    .footer-col ul li a { font-size: 12px; }

    /* File info layout */
    .file-info-list li { flex-direction: column; align-items: flex-start; gap: 2px; }
    .fi-value { text-align: left; }

    /* Hero search */
    .hero-search-box { padding: 5px; }
    .hero-search-box input { padding: 10px 12px; font-size: 14px; }
    .hero-search-btn { padding: 9px 14px; border-radius: 8px; font-size: 13px; }
}

/* ── Extra small: 360px ─────────────────────────────────── */
@media (max-width: 360px) {
    .container { padding: 0 12px; }
    .hero h1 { font-size: 1.3rem; }
    .software-title { font-size: 17px; }
    .categories-grid { grid-template-columns: repeat(2, 1fr); gap: 7px; }
    .cat-card-icon { font-size: 22px; }
    .related-grid { grid-template-columns: 1fr; }
    .software-meta-grid { grid-template-columns: 1fr 1fr; }
    .download-card { padding: 20px 12px; }
}

/* ── Sticky download bar on mobile ──────────────────────── */
@media (max-width: 768px) {
    /* Show floating sticky bar at bottom on single-software pages */
    .sticky-dl-bar {
        position: fixed;
        bottom: 0; left: 0; right: 0;
        z-index: 900;
        background: var(--bg-card);
        border-top: 1px solid var(--border);
        padding: 12px 16px;
        display: flex;
        align-items: center;
        gap: 10px;
        box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }
    .sticky-dl-bar.visible { transform: none; }
    .sticky-dl-bar-info { flex: 1; min-width: 0; }
    .sticky-dl-bar-name { font-size: 13px; font-weight: 700; color: var(--text); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .sticky-dl-bar-size { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
    .sticky-dl-bar-btn {
        background: var(--accent);
        color: #fff;
        padding: 11px 20px;
        border-radius: var(--radius-sm);
        font-size: 14px;
        font-weight: 700;
        text-decoration: none;
        white-space: nowrap;
        flex-shrink: 0;
        transition: background var(--transition);
    }
    .sticky-dl-bar-btn:hover { background: var(--accent-hover); color: #fff; }

    /* Pad page bottom so sticky bar doesn't cover content */
    .single-software-page .site-main { padding-bottom: 100px; }
}

/* ── Landscape phone ────────────────────────────────────── */
@media (max-width: 768px) and (orientation: landscape) {
    .hero { padding: 28px 0 20px; }
    .hero h1 { font-size: 1.5rem; }
    .hero-stats { flex-direction: row; gap: 24px; flex-wrap: nowrap; }
    .download-card { padding: 20px 24px; }
    .countdown-ring { width: 90px; height: 90px; }
}

/* ── Touch targets ──────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
    /* Ensure 44px minimum tap targets */
    .btn-download-card,
    .btn-dl-sm,
    .filter-btn,
    .cat-pill,
    .page-btn,
    .gallery-btn,
    .theme-toggle,
    .mobile-menu-btn { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }

    .main-nav a { min-height: 44px; display: inline-flex; align-items: center; }
    .widget-cat-list a { min-height: 44px; }
    .search-result-item { min-height: 56px; }

    /* Remove hover transforms on touch — prevents sticky hover states */
    .software-card:hover { transform: none; }
    .btn-download-card:hover { transform: none; }
    .btn-download-main:hover { transform: none; }
    .related-card:hover { transform: none; }
    .btn-dl-sm:hover { transform: none; }
}
/* Mobile menu overlay — appended to style.css automatically via functions.php
   But we keep it here for completeness */

.mobile-overlay {
    position: fixed; inset: 0; z-index: 1100;
    background: rgba(0,0,0,0.6);
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s ease;
}
.mobile-overlay.open { opacity: 1; pointer-events: all; }

.mobile-menu {
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 280px; max-width: 85vw;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 0;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
    display: flex; flex-direction: column;
}
.mobile-overlay.open .mobile-menu { transform: none; }

.mobile-menu-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}
.mobile-menu-close {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--bg-elevated); color: var(--text-muted);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; cursor: pointer;
}

.mobile-nav { padding: 12px; flex: 1; overflow-y: auto; }
.mobile-nav a {
    display: block; padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 15px; font-weight: 500; color: var(--text-muted);
    text-decoration: none; margin-bottom: 2px;
    transition: all var(--transition);
}
.mobile-nav a:hover { background: var(--accent-dim); color: var(--accent); }
