/*
Theme Name: FiveMHub
Theme URI: https://fivemhub.com
Author: DMV Web Guys
Author URI: https://dmvwebguys.com
Description: Lean, SEO-first theme for the FiveMHub directory site. Designed to pair with the FiveMHub Core plugin. Dark, performant, mobile-first.
Version: 0.1.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fivemhub
Tags: dark-mode, custom-colors, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ---------------------------------------------
   Design Tokens
--------------------------------------------- */
:root {
    /* Color system - dark editorial */
    --fmh-bg:           #0a0d12;
    --fmh-bg-elev:      #11161e;
    --fmh-bg-card:      #161c26;
    --fmh-border:       #232a36;
    --fmh-border-hover: #353e4d;

    --fmh-text:         #e6ebf1;
    --fmh-text-muted:   #8a94a4;
    --fmh-text-dim:     #5a6271;

    --fmh-accent:       #f59e0b;        /* amber - high-contrast on dark */
    --fmh-accent-hover: #fbbf24;
    --fmh-success:      #22c55e;
    --fmh-danger:       #ef4444;
    --fmh-info:         #3b82f6;

    /* Typography */
    --fmh-font-display: 'Space Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --fmh-font-body:    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --fmh-font-mono:    'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

    /* Spacing */
    --fmh-space-1: 4px;
    --fmh-space-2: 8px;
    --fmh-space-3: 12px;
    --fmh-space-4: 16px;
    --fmh-space-6: 24px;
    --fmh-space-8: 32px;
    --fmh-space-12: 48px;
    --fmh-space-16: 64px;

    /* Layout */
    --fmh-radius-sm: 4px;
    --fmh-radius-md: 8px;
    --fmh-radius-lg: 12px;
    --fmh-container: 1280px;

    /* Effects */
    --fmh-shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --fmh-shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --fmh-shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
}

/* ---------------------------------------------
   Base reset & typography
--------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--fmh-bg);
    color: var(--fmh-text);
    font-family: var(--fmh-font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--fmh-font-display);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 var(--fmh-space-4);
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: 1.5rem; }

p { margin: 0 0 var(--fmh-space-4); }

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

code, pre {
    font-family: var(--fmh-font-mono);
    background: var(--fmh-bg-elev);
    border: 1px solid var(--fmh-border);
    border-radius: var(--fmh-radius-sm);
}
code { padding: 2px 6px; font-size: 0.9em; }
pre { padding: var(--fmh-space-4); overflow-x: auto; }
pre code { padding: 0; background: none; border: none; }

img { max-width: 100%; height: auto; display: block; }

/* ---------------------------------------------
   Layout
--------------------------------------------- */
.fmh-container {
    max-width: var(--fmh-container);
    margin: 0 auto;
    padding: 0 var(--fmh-space-6);
}

.fmh-site {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.fmh-main {
    flex: 1;
    padding: var(--fmh-space-12) 0;
}

/* ---------------------------------------------
   Header
--------------------------------------------- */
.fmh-header {
    background: var(--fmh-bg-elev);
    border-bottom: 1px solid var(--fmh-border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.fmh-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--fmh-space-6);
    padding: var(--fmh-space-4) 0;
}

.fmh-logo {
    font-family: var(--fmh-font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--fmh-text);
    letter-spacing: -0.04em;
}
.fmh-logo span { color: var(--fmh-accent); }

.fmh-nav {
    display: flex;
    gap: var(--fmh-space-6);
    align-items: center;
}
.fmh-nav a {
    color: var(--fmh-text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.15s ease;
}
.fmh-nav a:hover, .fmh-nav .current-menu-item a { color: var(--fmh-text); }

/* ---------------------------------------------
   Card grid (shared across listings)
--------------------------------------------- */
.fivemhub-grid {
    display: grid;
    gap: var(--fmh-space-6);
}
.fivemhub-grid--cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.fivemhub-grid--cols-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.fivemhub-grid--cols-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.fivemhub-card {
    background: var(--fmh-bg-card);
    border: 1px solid var(--fmh-border);
    border-radius: var(--fmh-radius-md);
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.fivemhub-card:hover {
    transform: translateY(-2px);
    border-color: var(--fmh-border-hover);
    box-shadow: var(--fmh-shadow-md);
}

.fivemhub-card__link {
    display: block;
    color: inherit;
}
.fivemhub-card__link:hover { color: inherit; }

.fivemhub-card__thumb {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--fmh-bg-elev);
}
.fivemhub-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.fivemhub-card:hover .fivemhub-card__thumb img { transform: scale(1.04); }

.fivemhub-card__body { padding: var(--fmh-space-4); }

.fivemhub-card__title {
    font-size: 1.125rem;
    margin: 0 0 var(--fmh-space-2);
    color: var(--fmh-text);
}

.fivemhub-card__author {
    font-size: 0.85rem;
    color: var(--fmh-text-dim);
    margin: 0 0 var(--fmh-space-3);
}

.fivemhub-card__excerpt {
    font-size: 0.9rem;
    color: var(--fmh-text-muted);
    margin: 0 0 var(--fmh-space-3);
}

.fivemhub-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--fmh-space-2);
    margin-top: var(--fmh-space-3);
}

/* ---------------------------------------------
   Badges
--------------------------------------------- */
.fivemhub-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border: 1px solid var(--fmh-border);
}
.fivemhub-badge--free      { background: rgba(34,197,94,0.1);  color: var(--fmh-success); border-color: rgba(34,197,94,0.3); }
.fivemhub-badge--paid      { background: rgba(245,158,11,0.1); color: var(--fmh-accent);  border-color: rgba(245,158,11,0.3); }
.fivemhub-badge--framework { background: var(--fmh-bg-elev);   color: var(--fmh-text-muted); }
.fivemhub-badge--stars     { background: var(--fmh-bg-elev);   color: var(--fmh-text-muted); }

/* ---------------------------------------------
   Search form
--------------------------------------------- */
.fivemhub-search {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: var(--fmh-space-2);
    padding: var(--fmh-space-4);
    background: var(--fmh-bg-card);
    border: 1px solid var(--fmh-border);
    border-radius: var(--fmh-radius-md);
    margin-bottom: var(--fmh-space-8);
}
@media (max-width: 768px) {
    .fivemhub-search { grid-template-columns: 1fr; }
}

.fivemhub-search__input,
.fivemhub-search__filter {
    background: var(--fmh-bg);
    border: 1px solid var(--fmh-border);
    color: var(--fmh-text);
    padding: 10px 14px;
    border-radius: var(--fmh-radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
}
.fivemhub-search__input:focus,
.fivemhub-search__filter:focus {
    outline: none;
    border-color: var(--fmh-accent);
}

.fivemhub-search__submit,
.fivemhub-cta {
    background: var(--fmh-accent);
    color: #0a0d12;
    border: none;
    padding: 10px 20px;
    border-radius: var(--fmh-radius-sm);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
    display: inline-block;
    text-decoration: none;
}
.fivemhub-search__submit:hover,
.fivemhub-cta:hover {
    background: var(--fmh-accent-hover);
    transform: translateY(-1px);
}

/* ---------------------------------------------
   Hosting comparison table
--------------------------------------------- */
.fivemhub-hosting-table {
    background: var(--fmh-bg-card);
    border: 1px solid var(--fmh-border);
    border-radius: var(--fmh-radius-md);
    overflow: hidden;
    overflow-x: auto;
}
.fivemhub-hosting-table table {
    width: 100%;
    border-collapse: collapse;
}
.fivemhub-hosting-table th,
.fivemhub-hosting-table td {
    padding: var(--fmh-space-4);
    text-align: left;
    border-bottom: 1px solid var(--fmh-border);
}
.fivemhub-hosting-table th {
    background: var(--fmh-bg-elev);
    font-family: var(--fmh-font-display);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fmh-text-muted);
}
.fivemhub-hosting-table tr:last-child td { border-bottom: none; }
.fivemhub-hosting-table ul { margin: 0; padding-left: 1.2em; font-size: 0.9rem; }
.fivemhub-hosting-table img { width: 40px; height: 40px; border-radius: var(--fmh-radius-sm); margin-bottom: 8px; }

/* ---------------------------------------------
   Submit form
--------------------------------------------- */
.fivemhub-submit-form {
    max-width: 640px;
    background: var(--fmh-bg-card);
    border: 1px solid var(--fmh-border);
    border-radius: var(--fmh-radius-md);
    padding: var(--fmh-space-8);
}
.fivemhub-field { margin-bottom: var(--fmh-space-4); }
.fivemhub-field label {
    display: block;
    margin-bottom: var(--fmh-space-2);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--fmh-text);
}
.fivemhub-field input,
.fivemhub-field textarea {
    width: 100%;
    background: var(--fmh-bg);
    border: 1px solid var(--fmh-border);
    color: var(--fmh-text);
    padding: 10px 14px;
    border-radius: var(--fmh-radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
}
.fivemhub-field--honeypot { position: absolute; left: -9999px; }
.fivemhub-submit-message {
    margin-top: var(--fmh-space-4);
    padding: var(--fmh-space-3);
    border-radius: var(--fmh-radius-sm);
}
.fivemhub-submit-message.success { background: rgba(34,197,94,0.1); color: var(--fmh-success); }
.fivemhub-submit-message.error   { background: rgba(239,68,68,0.1); color: var(--fmh-danger); }

/* ---------------------------------------------
   Single script page
--------------------------------------------- */
.fmh-script-single {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--fmh-space-8);
}
@media (max-width: 900px) {
    .fmh-script-single { grid-template-columns: 1fr; }
}

.fmh-script-sidebar {
    background: var(--fmh-bg-card);
    border: 1px solid var(--fmh-border);
    border-radius: var(--fmh-radius-md);
    padding: var(--fmh-space-6);
    position: sticky;
    top: 100px;
    align-self: start;
}

.fmh-script-sidebar dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--fmh-space-3);
    margin: var(--fmh-space-4) 0;
    font-size: 0.9rem;
}
.fmh-script-sidebar dt { color: var(--fmh-text-muted); }
.fmh-script-sidebar dd { margin: 0; color: var(--fmh-text); }

.fmh-script-sidebar .fivemhub-cta {
    display: block;
    text-align: center;
    margin-top: var(--fmh-space-4);
}

/* ---------------------------------------------
   Hero / homepage
--------------------------------------------- */
.fmh-hero {
    text-align: center;
    padding: var(--fmh-space-16) 0 var(--fmh-space-12);
    background: radial-gradient(ellipse at top, rgba(245,158,11,0.08), transparent 60%);
}
.fmh-hero h1 { margin-bottom: var(--fmh-space-4); }
.fmh-hero p { font-size: 1.125rem; color: var(--fmh-text-muted); max-width: 640px; margin: 0 auto var(--fmh-space-6); }

/* ---------------------------------------------
   Footer
--------------------------------------------- */
.fmh-footer {
    background: var(--fmh-bg-elev);
    border-top: 1px solid var(--fmh-border);
    padding: var(--fmh-space-12) 0 var(--fmh-space-8);
    color: var(--fmh-text-muted);
    font-size: 0.9rem;
}
.fmh-footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--fmh-space-8);
    margin-bottom: var(--fmh-space-8);
}
@media (max-width: 768px) {
    .fmh-footer__grid { grid-template-columns: 1fr 1fr; }
}
.fmh-footer h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fmh-text);
    margin-bottom: var(--fmh-space-3);
}
.fmh-footer ul { list-style: none; padding: 0; margin: 0; }
.fmh-footer li { margin-bottom: var(--fmh-space-2); }
.fmh-footer a { color: var(--fmh-text-muted); }
.fmh-footer a:hover { color: var(--fmh-text); }
.fmh-footer__bottom {
    border-top: 1px solid var(--fmh-border);
    padding-top: var(--fmh-space-4);
    text-align: center;
    font-size: 0.85rem;
}
