/*
Theme Name: Switch Graphics
Theme URI: https://www.switchgraphics.co.za/
Author: Switch Graphics (Pty) Ltd
Author URI: https://www.switchgraphics.co.za/
Description: Mobile-first WordPress theme with a centered menu popup and editable branded footer text.
Version: 1.0.2
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: switch-graphics
*/

:root {
    --sg-bg: #f5f5f5;
    --sg-surface: #ffffff;
    --sg-text: #1a1a1a;
    --sg-muted: #666666;
    --sg-border: #dedede;
    --sg-accent: #ff6600;
    --sg-header-grad-start: #0f0f0f;
    --sg-header-grad-end: #3a3a3a;
    --sg-menu-fill-start: #ff6600;
    --sg-menu-fill-end: #ff8533;
    --sg-menu-outline-color: #666666;
    --sg-menu-outline-width: 1px;
    --sg-footer-link: #2c5db1;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--sg-bg);
    color: var(--sg-text);
    line-height: 1.6;
}

body.sg-menu-open {
    overflow: hidden;
}

.sg-header {
    position: sticky;
    top: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(180deg, var(--sg-header-grad-start), var(--sg-header-grad-end));
    border-bottom: none;
}

.admin-bar .sg-header {
    top: 32px;
}

@media (max-width: 782px) {
    .admin-bar .sg-header {
        top: 46px;
    }
}

.sg-branding {
    min-width: 0;
}

.sg-branding .custom-logo-link {
    display: inline-flex;
}

.sg-branding .custom-logo {
    max-height: 44px;
    width: auto;
    height: auto;
}

.sg-site-title {
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.1rem;
}

.sg-menu-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: none;
    background: transparent;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 0;
}

.sg-menu-btn span {
    width: 24px;
    height: 4px;
    border-radius: 999px;
    border: var(--sg-menu-outline-width) solid var(--sg-menu-outline-color);
    background: linear-gradient(90deg, var(--sg-menu-fill-start), var(--sg-menu-fill-end));
}

.sg-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1390;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.sg-menu-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.sg-side-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    width: min(92vw, 560px);
    max-height: 82vh;
    background: #fff;
    z-index: 1400;
    transform: translate(-50%, -45%) scale(0.97);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.28s ease, opacity 0.22s ease;
    padding: 20px 16px 16px;
    overflow-y: auto;
    border-radius: 18px;
    border: 1px solid var(--sg-border);
    box-shadow: 0 25px 55px rgba(0, 0, 0, 0.28);
}

.sg-side-menu.is-open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.sg-side-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--sg-border);
}

.sg-side-menu-title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.2;
}

.sg-side-menu-close {
    width: 40px;
    height: 40px;
    border: 1px solid var(--sg-border);
    border-radius: 12px;
    background: #f3f3f3;
    color: #111;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.sg-side-menu-list,
.sg-side-menu-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sg-side-menu-list li {
    margin-bottom: 8px;
}

.sg-side-menu-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--sg-text);
    background: #f7f7f7;
    border: 1px solid var(--sg-border);
    border-radius: 12px;
    padding: 14px 16px;
    font-weight: 600;
}

.sg-side-menu-list a::after {
    content: "›";
    font-size: 18px;
    line-height: 1;
    color: var(--sg-muted);
}

.sg-side-menu-list a:hover {
    color: var(--sg-accent);
    border-color: var(--sg-accent);
}

.sg-side-menu-list .current-menu-item > a,
.sg-side-menu-list .current_page_item > a {
    color: var(--sg-accent);
    border-color: var(--sg-accent);
}

.sg-main {
    width: min(100%, 1000px);
    margin: 0 auto;
    padding: 20px 16px 24px;
}

.sg-post {
    background: var(--sg-surface);
    border: 1px solid var(--sg-border);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 16px;
}

.sg-post-title {
    margin: 0 0 8px;
    font-size: 1.3rem;
    line-height: 1.25;
}

.sg-post-title a {
    color: inherit;
    text-decoration: none;
}

.sg-post-title a:hover {
    color: var(--sg-accent);
}

.sg-post-meta {
    color: var(--sg-muted);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.sg-footer {
    padding: 20px 16px 28px;
    text-align: center;
}

.sg-footer p {
    margin: 0;
    color: var(--sg-muted);
    font-size: 0.95rem;
}

.sg-footer strong {
    font-weight: 800;
    color: var(--sg-text);
}

.sg-footer a {
    color: var(--sg-footer-link);
    text-decoration: none;
    font-weight: 700;
}

.sg-footer a:hover {
    text-decoration: underline;
}
