/*
Theme Name: Font Free
Theme URI: https://fonthub.com
Author: FontHub
Author URI: https://fonthub.com
Description: A clean, fast and SEO-optimized WordPress theme for free font downloads. Features font previewer, live text editor, image gallery and download management.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fonthub
Tags: fonts, download, clean, minimal, fast, seo
*/

/* ============================================================
   CSS Variables
============================================================ */
:root {
    --primary: #185FA5;
    --primary-light: #E6F1FB;
    --primary-dark: #0C447C;
    --accent: #378ADD;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-muted: #9090a0;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fc;
    --bg-tertiary: #f0f4ff;
    --border: #e2e8f0;
    --border-light: #f0f4f8;
    --success: #10b981;
    --warning: #f59e0b;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.05);
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Plus Jakarta Sans', sans-serif;
    --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; }

body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; transition: color var(--transition); }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; outline: none; }

/* ============================================================
   Typography
============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
}

h1 { font-size: clamp(1.5rem, 2.5vw, 2.1rem); }
h2 { font-size: clamp(1.2rem, 2vw, 1.6rem); }
h3 { font-size: clamp(1rem, 1.8vw, 1.2rem); }
h4 { font-size: 1rem; }

p { color: var(--text-secondary); margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ============================================================
   Layout
============================================================ */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-narrow {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.section { padding: 60px 0; }
.section-sm { padding: 40px 0; }

/* ============================================================
   Header & Navigation
============================================================ */
.site-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 60%, #1e1b4b 100%);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

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

.site-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    flex-shrink: 0;
    letter-spacing: -0.02em;
}

.site-logo-icon {
    width: 34px;
    height: 34px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -1px;
}

.site-logo span { color: var(--primary); }

.header-search {
    flex: 1;
    max-width: 480px;
    position: relative;
}

.header-search input {
    width: 100%;
    height: 40px;
    padding: 0 16px 0 42px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xl);
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.header-search input:focus {
    border-color: var(--primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.header-search input::placeholder { color: var(--text-muted); }

.header-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link {
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
    white-space: nowrap;
}

.nav-link:hover { color: var(--primary); background: var(--primary-light); }
.nav-link.active { color: var(--primary); }

.btn-submit {
    padding: 8px 18px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    transition: background var(--transition), transform var(--transition);
    white-space: nowrap;
}

.btn-submit:hover { background: var(--primary-dark); transform: translateY(-1px); }

.mobile-menu-btn {
    display: none;
    padding: 6px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
}

/* ============================================================
   Hero Section — Compact
============================================================ */
.hero {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 28px 0 22px;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-xl);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.hero h1 {
    font-size: clamp(1rem, 3.2vw, 2rem);
    margin-bottom: 8px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.hero h1 span { color: var(--primary); }

.hero-desc {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 420px;
    margin: 0 auto 18px;
    line-height: 1.5;
}

.hero-search {
    display: flex;
    gap: 6px;
    max-width: 500px;
    margin: 0 auto 18px;
    background: var(--bg-primary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 5px 5px 5px 16px;
    box-shadow: var(--shadow-md);
    transition: border-color var(--transition);
}

.hero-search:focus-within { border-color: var(--primary); }

.hero-search input {
    flex: 1;
    border: none;
    background: none;
    font-size: 14px;
    color: var(--text-primary);
    padding: 3px 0;
    font-family: var(--font-sans);
}

.hero-search input::placeholder { color: var(--text-muted); }

.hero-search-btn {
    padding: 8px 20px;
    background: var(--primary);
    color: #fff;
    border-radius: calc(var(--radius-xl) - 4px);
    font-size: 13px;
    font-weight: 700;
    transition: background var(--transition);
    white-space: nowrap;
    font-family: var(--font-sans);
}

.hero-search-btn:hover { background: var(--primary-dark); }

.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.hero-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-stat-num {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    font-family: var(--font-sans);
}

.hero-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.hero-stat-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
}

/* ============================================================
   Category Filter Bar
============================================================ */
.category-bar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 64px;
    z-index: 900;
}

.category-bar-inner {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-bar-inner::-webkit-scrollbar { display: none; }

.cat-pill {
    padding: 6px 16px;
    border-radius: var(--radius-xl);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
    background: var(--bg-primary);
    transition: all var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
}

.cat-pill:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.cat-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.cat-bar-sort {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.sort-select {
    padding: 6px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-primary);
    cursor: pointer;
}

/* ============================================================
   Font Grid
============================================================ */
.fonts-section { padding: 32px 0 60px; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
}

.section-count {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 3px 10px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
}

.fonts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
    gap: 20px;
}

/* ============================================================
   Font Card
============================================================ */
.font-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.font-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: #c8d8f0;
}

.font-card-preview {
    height: 110px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.font-card-preview-text {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.2;
    transition: transform var(--transition);
}

.font-card:hover .font-card-preview-text { transform: scale(1.05); }

.font-card-preview-overlay {
    position: absolute;
    inset: 0;
    background: rgba(24, 95, 165, 0.05);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition);
}

.font-card:hover .font-card-preview-overlay { opacity: 1; }

.font-card-preview-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    background: var(--bg-primary);
    padding: 4px 12px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.font-card-body { padding: 14px 16px; }

.font-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
}

.font-card-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.font-card-name a { color: inherit; }
.font-card-name a:hover { color: var(--primary); }

.font-card-license {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-xl);
    flex-shrink: 0;
}

.license-free { background: #d1fae5; color: #065f46; }
.license-commercial { background: var(--primary-light); color: var(--primary-dark); }

.font-card-designer {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.font-card-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.font-tag {
    font-size: 11px;
    padding: 3px 9px;
    border-radius: var(--radius-xl);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    font-weight: 500;
}

.font-tag.tag-style { background: var(--primary-light); color: var(--primary-dark); border-color: #b5d4f4; }

.font-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.font-card-downloads {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-download-card {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    transition: background var(--transition), transform var(--transition);
}

.btn-download-card:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-download-card svg { width: 14px; height: 14px; }

/* ============================================================
   Single Font Page
============================================================ */
.single-font-page { padding: 40px 0 60px; }

.single-font-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    align-items: start;
}

.font-main { min-width: 0; }

.font-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.font-breadcrumb a:hover { color: var(--primary); }
.font-breadcrumb-sep { color: var(--border); }

.font-single-header {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
}

.font-single-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 6px;
}

.font-single-title {
    font-family: var(--font-sans);
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
}

.font-single-designer {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.font-single-designer a { color: var(--primary); }

.font-meta-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.font-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.font-meta-label { color: var(--text-muted); }
.font-meta-value { color: var(--text-primary); font-weight: 600; }

/* ============================================================
   Font Image Gallery
============================================================ */
.font-gallery {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.gallery-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.gallery-item {
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    aspect-ratio: 16/9;
    background: var(--bg-tertiary);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img { transform: scale(1.04); }

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition);
}

.gallery-item:hover .gallery-item-overlay { opacity: 1; }
.gallery-item-overlay svg { width: 28px; height: 28px; color: #fff; }

.gallery-item:first-child {
    grid-column: 1 / -1;
    aspect-ratio: 16/7;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox.active { display: flex; }

.lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: background var(--transition);
}

.lightbox-close:hover { background: rgba(255,255,255,0.3); }

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: background var(--transition);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,0.3); }

/* ============================================================
   Font Previewer (Live Editor)
============================================================ */
.font-previewer {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.previewer-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.previewer-control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.previewer-control-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.previewer-size-slider {
    width: 140px;
    -webkit-appearance: none;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    outline: none;
    cursor: pointer;
}

.previewer-size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: transform var(--transition);
}

.previewer-size-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

.previewer-size-val {
    font-size: 12px;
    color: var(--primary);
    font-weight: 600;
    min-width: 30px;
}

.previewer-select {
    padding: 6px 10px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-primary);
    cursor: pointer;
    min-width: 120px;
}

.previewer-color {
    width: 32px;
    height: 32px;
    padding: 2px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--bg-primary);
}

.previewer-text-area {
    min-height: 120px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    font-size: 36px;
    line-height: 1.3;
    color: var(--text-primary);
    text-align: center;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
    resize: none;
    overflow: hidden;
    word-break: break-all;
}

.previewer-text-area:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: var(--bg-primary);
}

.previewer-sample-texts {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.sample-text-btn {
    padding: 4px 12px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    color: var(--text-secondary);
    background: var(--bg-primary);
    transition: all var(--transition);
    cursor: pointer;
}

.sample-text-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* ============================================================
   Font Info Table
============================================================ */
.font-info-table {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

.info-table-title {
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-table-row {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}

.info-table-row:last-child { border-bottom: none; }
.info-table-row:nth-child(even) { background: var(--bg-secondary); }

.info-table-key {
    width: 160px;
    flex-shrink: 0;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.info-table-val {
    color: var(--text-primary);
    font-weight: 500;
}

/* ============================================================
   Download Sidebar
============================================================ */
.font-sidebar { position: sticky; top: 80px; }

.download-box {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
}

.download-box-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.download-box-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.download-box-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.download-file-list { padding: 16px 20px; }

.download-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

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

.download-file-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.file-zip { background: #fef3c7; color: #92400e; }
.file-otf { background: var(--primary-light); color: var(--primary-dark); }
.file-ttf { background: #d1fae5; color: #065f46; }
.file-woff { background: #ede9fe; color: #5b21b6; }

.download-file-info { flex: 1; min-width: 0; }

.download-file-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.download-file-size {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

.download-file-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    flex-shrink: 0;
}

.download-file-btn:hover { background: var(--primary); color: #fff; }
.download-file-btn svg { width: 14px; height: 14px; }

.btn-download-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: calc(100% - 40px);
    margin: 0 20px 20px;
    padding: 14px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 700;
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
    box-shadow: 0 4px 14px rgba(24, 95, 165, 0.35);
}

.btn-download-main:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(24, 95, 165, 0.45);
}

.btn-download-main svg { width: 20px; height: 20px; }

.download-note {
    padding: 0 20px 16px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
}

/* Font details sidebar box */
.font-details-box {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
}

.details-box-title {
    padding: 14px 18px;
    font-size: 13px;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.details-box-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}

.details-box-row:last-child { border-bottom: none; }
.details-box-key { color: var(--text-muted); }
.details-box-val { color: var(--text-primary); font-weight: 600; }

/* ============================================================
   Related Fonts
============================================================ */
.related-fonts { padding: 40px 0 60px; }

/* ============================================================
   Archive / Category Page
============================================================ */
.archive-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 36px 0;
}

.archive-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.archive-desc {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 540px;
}

.archive-count {
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

/* ============================================================
   Search Results
============================================================ */
.search-hero {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 40px 0;
    text-align: center;
}

.search-hero h1 { font-size: 1.8rem; margin-bottom: 8px; }
.search-hero h1 span { color: var(--primary); }
.search-query { font-size: 15px; color: var(--text-secondary); }

/* ============================================================
   Pagination
============================================================ */







/* ============================================================
   Footer
============================================================ */
.site-footer {
    background: var(--text-primary);
    color: #94a3b8;
    padding: 0;
    margin-top: 40px;
    border-top: 1px solid #1e293b;
}
.footer-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    gap: 24px;
    flex-wrap: nowrap;
}
.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.footer-brand-logo-icon {
    width: 28px;
    height: 28px;
    background: var(--primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
}
.footer-brand-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}
.footer-links {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    flex-wrap: nowrap;
}
.footer-link {
    font-size: 13px;
    color: #94a3b8;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s;
}
.footer-link:hover { color: #fff; }
.footer-copy {
    font-size: 13px;
    color: #475569;
    white-space: nowrap;
    flex-shrink: 0;
}
/* ============================================================
   Admin: Font Upload (wp-admin styling hints)
============================================================ */
.fonthub-meta-box { padding: 16px; }
.fonthub-meta-row { margin-bottom: 16px; }
.fonthub-meta-label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13px; }
.fonthub-meta-input { width: 100%; padding: 8px 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; }
.fonthub-file-list { margin-top: 10px; }
.fonthub-file-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 8px; background: #f9f9f9; border-radius: 4px; border: 1px solid #eee; }
.fonthub-remove-file { color: #cc0000; cursor: pointer; font-size: 18px; line-height: 1; margin-left: auto; }

/* ============================================================
   Responsive
============================================================ */
@media (max-width: 1024px) {
    .single-font-layout { grid-template-columns: 1fr; }
    .font-sidebar { position: static; }
}

@media (max-width: 1024px) {
    .single-font-layout { grid-template-columns: 1fr; }
    .font-sidebar { position: static; }
}

@media (max-width: 768px) {
    /* Global fix */
    .container { padding: 0 12px; width: 100%; max-width: 100%; }

    /* Header */
    .header-nav { display: none; }
    .mobile-menu-btn { display: flex; }
    .header-inner { gap: 8px; height: 56px; }
    .header-search { max-width: 100%; flex: 1; min-width: 0; }
    .header-search input { font-size: 14px; }
    .site-logo { font-size: 1.1rem; }
    .site-logo-icon { width: 30px; height: 30px; font-size: 14px; }

    /* Hero */
    .hero { padding: 20px 0 18px; }
    .hero h1 {
        font-size: clamp(1rem, 5vw, 1.4rem);
        white-space: normal;
        max-width: 95%;
        word-break: break-word;
    }
    .hero-badge { font-size: 11px; margin-bottom: 8px; }
    .hero-desc { font-size: 13px; margin-bottom: 12px; max-width: 95%; }
    .hero-stats { gap: 10px; margin-top: 12px; }
    .hero-stat-num { font-size: 1.1rem; }
    .hero-stat-label { font-size: 11px; }
    .hero-stat-divider { height: 24px; }

    /* Category bar */
    .category-bar-inner {
        gap: 6px;
        padding: 10px 12px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .category-bar-inner::-webkit-scrollbar { display: none; }
    .cat-pill { font-size: 12px; padding: 5px 12px; white-space: nowrap; flex-shrink: 0; }
    .cat-bar-sort { flex-shrink: 0; }
    .sort-select { font-size: 12px; padding: 6px 10px; }

    /* Fonts grid — 2 columns fixed */
    .fonts-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    .section-header { margin-bottom: 12px; }
    .section-title { font-size: 1rem; }
    .section-count { font-size: 12px; }

    /* Font card */
    .fc-body { padding: 8px 8px 10px; }
    .fc-title { font-size: 0.82rem; margin-bottom: 3px; }
    .fc-designer { font-size: 0.72rem; margin-bottom: 6px; }
    .fc-top { gap: 4px; margin-bottom: 4px; }
    .fc-footer { margin-top: 6px; gap: 4px; }
    .fc-dl-btn { padding: 5px 8px; font-size: 10px; gap: 4px; }
    .fc-dl-btn svg { width: 11px; height: 11px; }
    .fc-downloads { font-size: 11px; }
    .fc-license, .fc-type { font-size: 10px; padding: 2px 5px; }

    /* Pagination */
    .pagination { gap: 4px; margin: 28px auto 20px; }
    .pagination a, .pagination span.current, .pagination span.dots {
        min-width: 34px; height: 34px; font-size: 12px; padding: 0 8px;
    }

    /* Single font page */
    .gallery-grid { grid-template-columns: 1fr; }
    .gallery-item:first-child { grid-column: auto; }
    .previewer-controls { flex-direction: column; }
    .font-meta-row { flex-direction: column; }
    .previewer-tabs { flex-wrap: wrap; gap: 4px; }
    .previewer-tab { font-size: 12px; padding: 6px 12px; }

    /* Designers page */
    .designers-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
    .designer-card { padding: 14px 10px !important; }

    /* Footer */
    .footer-inner { flex-direction: column; text-align: center; gap: 10px; }
    .footer-links { justify-content: center; flex-wrap: wrap; gap: 8px; }
    .footer-social { justify-content: center; }
}

@media (max-width: 480px) {
    .container { padding: 0 10px; }

    /* Hero */
    .hero h1 { font-size: clamp(0.95rem, 6vw, 1.2rem); }

    /* Grid */
    .fonts-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }

    /* Card compact */
    .fc-img-wrap { width: 100%; }
    .fc-body { padding: 7px 7px 9px; }
    .fc-title { font-size: 0.75rem; }
    .fc-dl-btn { padding: 5px 7px; font-size: 10px; }
    .fc-downloads svg { width: 10px; height: 10px; }

    /* Hero stats */
    .hero-stats { gap: 8px; }
    .hero-stat-num { font-size: 1rem; }
    .hero-stat-divider { height: 20px; }

    /* Pagination */
    .pagination a, .pagination span.current { min-width: 30px; height: 30px; font-size: 12px; }

    /* Designers */
    .designers-grid { grid-template-columns: 1fr 1fr !important; }

    /* Single font */
    .font-title { font-size: 1.3rem !important; }
    .download-btn { width: 100%; justify-content: center; }
}

@media (max-width: 360px) {
    .container { padding: 0 8px; }
    .hero h1 { font-size: 0.95rem; }
    .fonts-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 6px; }
    .fc-title { font-size: 0.7rem; }
    .hero-stats { flex-direction: column; gap: 4px; align-items: center; }
    .hero-stat-divider { display: none; }
    .site-logo-text { display: none; }
}

/* ============================================================
   Utilities
============================================================ */
.text-primary { color: var(--primary) !important; }
.text-muted { color: var(--text-muted) !important; }
.font-bold { font-weight: 700 !important; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8 { gap: 8px; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-light) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Fade in animation */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeInUp 0.4s ease forwards; }

.font-card:nth-child(1) { animation-delay: 0.05s; }
.font-card:nth-child(2) { animation-delay: 0.1s; }
.font-card:nth-child(3) { animation-delay: 0.15s; }
.font-card:nth-child(4) { animation-delay: 0.2s; }
.font-card:nth-child(5) { animation-delay: 0.25s; }
.font-card:nth-child(6) { animation-delay: 0.3s; }

/* ============================================================
   Font Card v2 — Full attractive image
============================================================ */
.font-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
}

.font-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
    border-color: #c8d8f0;
}

/* Image wrap */
.font-card-img-wrap {
    position: relative;
    display: block;
    overflow: hidden;
    background: var(--bg-tertiary);
    aspect-ratio: 4 / 2.8;
    flex-shrink: 0;
}

.font-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.font-card:hover .font-card-img-wrap img {
    transform: scale(1.04);
}

/* No image fallback */
.font-card-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    gap: 4px;
}

.font-card-sample {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--primary);
    line-height: 1.1;
}

.font-card-sample-sub {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Hover overlay */
.font-card-hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(24, 95, 165, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.font-card:hover .font-card-hover-overlay {
    opacity: 1;
}

.font-card-preview-pill {
    background: #fff;
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    transform: translateY(6px);
    transition: transform 0.2s ease;
}

.font-card:hover .font-card-preview-pill {
    transform: translateY(0);
}

/* License badge */
.font-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* Card body */
.font-card-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.font-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.font-card-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    flex: 1;
    min-width: 0;
}

.font-card-name a {
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.font-card-name a:hover { color: var(--primary); }

.font-card-type {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--primary-light);
    color: var(--primary-dark);
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid #b5d4f4;
}

.font-card-designer {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0;
}

.font-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.font-card-downloads {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-download-card {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
}

.btn-download-card:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    color: #fff;
}

/* Grid responsive */
.fonts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

@media (max-width: 480px) {
    .fonts-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .font-card-body { padding: 10px 12px; }
    .font-card-name { font-size: 0.85rem; }
    .btn-download-card { padding: 5px 10px; font-size: 11px; }
}

/* ============================================================
   Font Card v3 — Professional like reference
============================================================ */
.font-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.font-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.1);
    transform: translateY(-3px);
    border-color: #c5d8f0;
}

/* Image wrap */
.fc-img-wrap {
    display: block;
    position: relative;
    overflow: hidden;
    background: #111;
    aspect-ratio: 4 / 3;
    width: 100%;
}
.fc-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.4s ease, opacity 0.2s ease;
}
.font-card:hover .fc-img-wrap img { transform: scale(1.04); }

/* No image fallback */
.fc-no-img {
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #0d1117 0%, #1a2332 100%);
}
.fc-no-img-text {
    font-size: clamp(1rem, 3vw, 1.4rem);
    font-weight: 700;
    color: #fff;
    text-align: center;
    padding: 0 12px;
    line-height: 1.2;
}
.fc-no-img-sub {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.08em;
}

/* Preview hover label */
.fc-preview-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(24,95,165,0.12);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    opacity: 0;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(1px);
}
.font-card:hover .fc-preview-label { opacity: 1; }

/* Card body */
.fc-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

/* Top row */
.fc-top {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}
.fc-license {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.fc-free     { background: #d1fae5; color: #065f46; }
.fc-personal { background: #E6F1FB; color: #0C447C; }

.fc-type {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Title */
.fc-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
    margin: 0;
}
.fc-title a {
    color: inherit;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.fc-title a:hover { color: var(--primary); }

/* Designer */
.fc-designer {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Footer */
.fc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
    gap: 8px;
}
.fc-downloads {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
}
.fc-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    background: var(--primary);
    color: #fff !important;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    transition: background 0.15s, transform 0.15s;
    white-space: nowrap;
}
.fc-dl-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Grid */
.fonts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

@media (max-width: 640px) {
    .fonts-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .fc-body { padding: 10px 12px 12px; }
    .fc-dl-btn { padding: 6px 12px; font-size: 12px; }
}
@media (max-width: 360px) {
    .fonts-grid { grid-template-columns: 1fr; }
}

/* Social Media Icons */
.footer-social {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 16px;
}
.footer-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #94a3b8;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    text-decoration: none;
}
.footer-social-link:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

/* Share Buttons */
.font-share-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.font-share-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}
.font-share-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.font-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--share-color, #64748b);
    background: transparent;
    border: 1.5px solid var(--share-color, #64748b);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
}
.font-share-btn:hover {
    background: var(--share-color, #64748b);
    color: #fff;
}
.pv-active {
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
}

/* ── Pagination ── */
.pagination {
    display:flex; flex-wrap:wrap; align-items:center; justify-content:center;
    gap:6px; margin:56px auto 40px;
}
.pagination a,
.pagination span.current,
.pagination span.dots {
    display:inline-flex; align-items:center; justify-content:center;
    min-width:44px; height:44px; padding:0 16px;
    border-radius:12px; font-size:14px; font-weight:600;
    text-decoration:none; white-space:nowrap; line-height:1;
    transition:all .18s ease;
}
.pagination a {
    color:var(--text-secondary);
    border:1.5px solid var(--border);
    background:var(--bg-primary);
    box-shadow:0 1px 3px rgba(0,0,0,.06);
}
.pagination a:hover {
    border-color:var(--primary);
    color:var(--primary);
    background:var(--primary-light);
    transform:translateY(-2px);
    box-shadow:0 4px 12px rgba(37,99,235,.15);
}
.pagination span.current {
    background:var(--primary);
    color:#fff;
    border:1.5px solid var(--primary);
    box-shadow:0 4px 14px rgba(37,99,235,.30);
    transform:translateY(-1px);
}
.pagination span.dots {
    border:none; background:none;
    color:var(--text-muted); min-width:24px; padding:0;
    box-shadow:none;
}
/* Prev / Next arrows */
.pagination a[href]:first-child,
.pagination a[href]:last-child {
    font-size:18px; min-width:44px; padding:0;
    letter-spacing:0;
}

/* Hide Font Styles dropdown button */
.nav-categories-wrap,
.nav-categories-btn { display: none !important; }

/* ============================================================
   Mega Dropdown — Font Categories
============================================================ */
.mega-wrap {
    position: static;
}

.mega-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease;
    white-space: nowrap;
}
.mega-btn:hover { background: var(--primary-dark); }
.mega-arrow { transition: transform 0.2s ease; flex-shrink: 0; }
.mega-btn[aria-expanded="true"] .mega-arrow { transform: rotate(180deg); }

/* Full-width dropdown below header */
.mega-dropdown {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    width: 100%;
    background: #fff;
    border-top: 3px solid var(--primary);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    z-index: 999;
    animation: megaFadeIn 0.18s ease;
}
@keyframes megaFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.mega-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mega-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.mega-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease;
    border: 1px solid transparent;
}
.mega-item:hover {
    background: var(--primary-light);
    border-color: rgba(37,99,235,0.15);
    transform: translateX(3px);
}

.mega-item-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary);
    transition: background 0.15s ease;
}
.mega-item:hover .mega-item-icon {
    background: var(--primary);
    color: #fff;
}

.mega-item-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.mega-item-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mega-item:hover .mega-item-name { color: var(--primary); }

.mega-item-count {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.mega-footer {
    max-width: 1280px;
    margin: 0 auto;
    padding: 12px 24px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

.mega-all-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--primary);
    transition: all 0.15s ease;
}
.mega-all-link:hover {
    background: var(--primary);
    color: #fff;
}

/* Overlay when dropdown open */
.mega-overlay {
    position: fixed;
    inset: 0;
    top: 64px;
    background: rgba(0,0,0,0.3);
    z-index: 998;
    backdrop-filter: blur(2px);
}

/* Mobile — hide mega in mobile nav */
@media (max-width: 768px) {
    .mega-dropdown { top: 56px; }
    .mega-row { grid-template-columns: repeat(2, 1fr); }
    .mega-inner { padding: 16px 16px 12px; gap: 4px; }
}
@media (max-width: 480px) {
    .mega-row { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Designers Nav Button
============================================================ */
.nav-designers-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--bg-primary);
    transition: all 0.18s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}
.nav-designers-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-light) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.18s ease;
}
.nav-designers-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.15);
}
.nav-designers-btn:hover::before { opacity: 1; }

.nav-designers-avatars {
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    transition: transform 0.18s ease;
    position: relative;
    z-index: 1;
}
.nav-designers-btn:hover .nav-designers-avatars {
    transform: scale(1.1) rotate(-5deg);
}

.nav-designers-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: var(--primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    position: relative;
    z-index: 1;
    transition: background 0.18s ease;
}
.nav-designers-btn:hover .nav-designers-count {
    background: #6366f1;
}

/* ============================================================
   Dark Header — Element Overrides
============================================================ */
/* Logo */
.site-header .site-logo { color: #fff; }
.site-header .site-logo span { color: #60a5fa; }
.site-header .site-logo-icon { background: #2563eb; }

/* Search bar */
.site-header .header-search input {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.12);
    color: #fff;
}
.site-header .header-search input::placeholder { color: rgba(255,255,255,0.4); }
.site-header .header-search input:focus {
    background: rgba(255,255,255,0.12);
    border-color: #60a5fa;
}
.site-header .header-search-icon { color: rgba(255,255,255,0.4); }

/* Nav links */
.site-header .nav-link,
.site-header .nav-designers-link {
    color: rgba(255,255,255,0.75);
}
.site-header .nav-link:hover,
.site-header .nav-designers-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}
.site-header .nav-designers-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.site-header .nav-designers-link svg { opacity: 0.7; }
.site-header .nav-designers-link:hover svg { opacity: 1; }

/* Font Categories button */
.site-header .mega-btn {
    background: #2563eb;
    color: #fff;
}
.site-header .mega-btn:hover { background: #1d4ed8; }

/* Submit Font button */
.site-header .btn-submit {
    background: transparent;
    border: 1.5px solid rgba(255,255,255,0.3);
    color: #fff;
}
.site-header .btn-submit:hover {
    background: #fff;
    color: #0f172a;
    border-color: #fff;
}

/* Mobile menu button */
.site-header .mobile-menu-btn { color: rgba(255,255,255,0.8); }
.site-header .mobile-menu-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* Mega dropdown stays white */
.mega-dropdown { background: #fff; }

/* Mobile nav stays white */
#mobile-nav { background: #0f172a !important; border-top: 1px solid rgba(255,255,255,0.1) !important; }
#mobile-nav a { color: rgba(255,255,255,0.8) !important; }
#mobile-nav a:hover { color: #fff !important; }

/* Designers solid button — emerald green */
.nav-designers-solid {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    border: none;
    white-space: nowrap;
    transition: all 0.18s ease;
    box-shadow: 0 2px 8px rgba(5,150,105,0.35);
}
.nav-designers-solid:hover {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(5,150,105,0.5);
    color: #fff;
}
.nav-designers-solid:active { transform: translateY(0); }

/* Override the dark header nav-designers-link rule for old class */
.site-header .nav-designers-solid { color: #fff; }
.site-header .nav-designers-solid:hover { color: #fff; background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
