/*
Theme Name: MP Docs Theme
Theme URI: https://magepeople.com
Author: MagePeople Team
Author URI: https://magepeople.com
Description: A simple, lightweight theme built for the MP Docs documentation site. It stays out of the way of the MP Docs plugin (which renders the full documentation UI) and only supplies a clean site masthead, footer, and fallback page styles.
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mp-docs-theme
*/

/* ==========================================================================
   Variables — mirrors the MP Docs plugin's --mp-* tokens (and picks up its
   admin color settings automatically when the plugin is active) so the
   masthead/footer match the documentation UI without hard-coding colors.
   ========================================================================== */
:root {
    --mp-primary: #1F2937;
    --mp-secondary: #10B981;
    --mp-border: #E5E7EB;
    --mp-text: #374151;
    --mp-text-light: #6B7280;
    --mp-light: #F9FAFB;
    --mp-white: #FFFFFF;
    --mp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --mp-light: #0B0F19;
        --mp-white: #131826;
        --mp-border: #232A3B;
        --mp-text: #E5E7EB;
        --mp-text-light: #9CA3AF;
    }
}

/* ==========================================================================
   Base
   ========================================================================== */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--mp-font);
    color: var(--mp-text);
    background: var(--mp-white);
    line-height: 1.6;
}

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

a {
    color: var(--mp-secondary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.mp-site-wrap {
    max-width: var(--mp-site-container-width, 1200px);
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   Masthead
   ========================================================================== */
.mp-site-header {
    border-bottom: 1px solid var(--mp-border);
    background: var(--mp-white);
}

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

.mp-site-branding {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    color: var(--mp-primary);
}

.mp-site-branding img {
    display: block;
    max-height: 36px;
    width: auto;
}

.mp-site-branding:hover {
    text-decoration: none;
    color: var(--mp-primary);
}

.mp-primary-nav ul {
    display: flex;
    align-items: center;
    gap: 28px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mp-primary-nav a {
    color: var(--mp-text);
    font-size: 14px;
    font-weight: 500;
}

.mp-primary-nav a:hover,
.mp-primary-nav .current-menu-item > a {
    color: var(--mp-secondary);
    text-decoration: none;
}

.mp-nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--mp-border);
    border-radius: 6px;
    padding: 6px 10px;
    color: var(--mp-primary);
    font-size: 14px;
    cursor: pointer;
}

/* ==========================================================================
   Page content (fallback templates: page.php, single.php, search.php, 404.php)
   ========================================================================== */
.mp-content-wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 56px 24px 96px;
}

/* Applied by page-templates/full-width.php — trades the narrow ~760px
   reading width for the site's own container width (see the Layout
   section in Appearance > Customize), for pages that need more room
   (tables, embeds, wide layouts) rather than long-form reading text. */
.mp-content-wrap.is-full-width {
    max-width: var(--mp-site-container-width, 1200px);
}

.mp-content-wrap .mp-page-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--mp-primary);
    margin: 0 0 8px;
}

.mp-content-wrap .mp-post-meta {
    color: var(--mp-text-light);
    font-size: 14px;
    margin-bottom: 32px;
}

.mp-content-wrap article + article {
    margin-top: 48px;
    padding-top: 48px;
    border-top: 1px solid var(--mp-border);
}

.mp-content-wrap .mp-entry-summary a.mp-read-more {
    font-weight: 600;
}

.mp-pagination {
    margin-top: 40px;
    display: flex;
    gap: 16px;
}

.mp-no-results {
    color: var(--mp-text-light);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.mp-site-footer {
    border-top: 1px solid var(--mp-border);
    background: var(--mp-light);
    margin-top: auto;
}

.mp-site-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 24px 0;
    font-size: 13px;
    color: var(--mp-text-light);
}

.mp-footer-nav ul {
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mp-footer-nav a {
    color: var(--mp-text-light);
    font-size: 13px;
}

.mp-footer-nav a:hover {
    color: var(--mp-secondary);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 700px) {
    .mp-nav-toggle {
        display: inline-block;
    }

    .mp-primary-nav {
        display: none;
        width: 100%;
        order: 3;
    }

    .mp-primary-nav.is-open {
        display: block;
    }

    .mp-primary-nav ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 12px 0 20px;
    }

    .mp-site-header-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 0;
    }

    .mp-site-footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}
