/*
Theme Name: SiteEngine
Theme URI:
Author:
Author URI:
Description: A controlled WordPress framework for high-quality client websites. One core engine, many brands, many industries. No page builders. No bloat.
Version: 0.5.7
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: siteengine
Tags: custom-theme, framework, local-seo, custom-post-types
*/

/* ============================================================
   SiteEngine Base Styles — Phase 1 Foundation
   Do not add brand styles here. Brand styles live in brands/
   Do not add page builder classes.
   ============================================================ */

/* --- CSS Custom Properties
     Static defaults. PHP (enqueue.php) overrides --mtse-primary/secondary/accent/radius/
     section-spacing/accent-rgb at runtime via wp_add_inline_style.
     --- */
:root {
    /* Base palette — always available */
    --mtse-white:     #ffffff;
    --mtse-light:     #f5f5f5;
    --mtse-dark:      #111111;
    --mtse-text:      #333333;
    --mtse-muted:     #666666;
    --mtse-border:    #e0e0e0;
    --mtse-shadow:    0 2px 8px rgba(0,0,0,0.08);

    /* Brand colors — overridden at runtime; these are safe fallbacks */
    --mtse-primary:   #111827;
    --mtse-secondary: #f9fafb;
    --mtse-accent:    #f97316;
    --mtse-accent-rgb: 249, 115, 22;  /* RGB components of the default accent */

    /* Layout / spacing — overridden per brand at runtime */
    --mtse-radius:          6px;
    --mtse-section-spacing: 5rem;
    --mtse-bg-alt:          var(--mtse-light);

    /* Typography */
    --mtse-font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mtse-font-size: 16px;
    --mtse-line:      1.65;
    --mtse-max-width: 1200px;
}

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

html {
    font-size: var(--mtse-font-size);
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--mtse-font);
    font-size: 1rem;
    line-height: var(--mtse-line);
    color: var(--mtse-text);
    background-color: var(--mtse-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--mtse-dark);
    margin-bottom: 0.75rem;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p { margin-bottom: 1rem; }

a {
    color: var(--mtse-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover { color: var(--mtse-accent); }

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

/* --- Layout Utilities --- */
.mtse-container {
    width: 100%;
    max-width: var(--mtse-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.mtse-section {
    padding: 4rem 0;
}

.mtse-section--tight {
    padding: 2.5rem 0;
}

/* --- Skip Link --- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--mtse-primary);
    color: var(--mtse-white);
    padding: 0.75rem 1.5rem;
    z-index: 9999;
    font-size: 0.875rem;
    text-decoration: none;
    border-radius: 0 0 var(--mtse-radius) 0;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--mtse-accent);
    outline-offset: 2px;
}

/* --- Keyboard Navigation --- */
:focus {
    outline: none;
}

:focus-visible {
    outline: 3px solid var(--mtse-accent);
    outline-offset: 3px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--mtse-accent);
    outline-offset: 3px;
}

/* --- Buttons --- */
.mtse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 2.25rem;
    border-radius: var(--mtse-radius);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.25s ease;
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.mtse-btn--primary {
    background: var(--mtse-accent);
    color: var(--mtse-white);
    border-color: var(--mtse-accent);
}

.mtse-btn--primary:hover {
    background: transparent;
    color: var(--mtse-accent);
}

.mtse-btn--secondary {
    background: transparent;
    color: var(--mtse-primary);
    border-color: var(--mtse-primary);
}

.mtse-btn--secondary:hover {
    background: var(--mtse-primary);
    color: var(--mtse-white);
}

/* --- Header --- */
.mtse-header {
    background: var(--mtse-white);
    border-bottom: 1px solid var(--mtse-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--mtse-shadow);
}

.mtse-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.mtse-header__logo img {
    height: 48px;
    width: auto;
}

.mtse-header__logo span {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--mtse-primary);
}

.mtse-header__nav ul {
    display: flex;
    gap: 1.75rem;
    list-style: none;
    align-items: center;
}

.mtse-header__nav a {
    font-weight: 500;
    color: var(--mtse-text);
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.mtse-header__nav a:hover {
    color: var(--mtse-accent);
}

.mtse-header__cta {
    font-weight: 700;
    color: var(--mtse-accent) !important;
}

/* --- Footer --- */
.mtse-footer {
    background: var(--mtse-dark);
    color: rgba(255,255,255,0.75);
    padding: 3rem 0 1.5rem;
    font-size: 0.9rem;
}

.mtse-footer__inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.mtse-footer__name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--mtse-white);
    margin-bottom: 0.5rem;
}

.mtse-footer a {
    color: rgba(255,255,255,0.65);
    transition: color 0.2s ease;
}

.mtse-footer a:hover {
    color: var(--mtse-accent);
}

.mtse-footer nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mtse-footer__bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* --- Hero Section --- */
.mtse-hero {
    position: relative;
    min-height: 520px;
    display: flex;
    align-items: center;
    background: var(--mtse-primary);
    color: var(--mtse-white);
    overflow: hidden;
}

.mtse-hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.35;
    z-index: 0;
}

.mtse-hero__content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    padding: 4rem 0;
}

.mtse-hero__eyebrow {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--mtse-accent);
    margin-bottom: 1rem;
}

.mtse-hero__headline {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: var(--mtse-white);
    margin-bottom: 1rem;
    line-height: 1.15;
}

.mtse-hero__subheadline {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 2rem;
    max-width: 580px;
}

/* --- CTA Strip --- */
.mtse-cta-strip {
    background: var(--mtse-accent);
    color: var(--mtse-white);
    padding: 3rem 0;
    text-align: center;
}

.mtse-cta-strip__headline {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--mtse-white);
    margin-bottom: 0.75rem;
}

.mtse-cta-strip__text {
    font-size: 1.05rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 1.75rem;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Trust Bar --- */
.mtse-trust-bar {
    background: var(--mtse-light);
    padding: 2rem 0;
    border-top: 1px solid var(--mtse-border);
    border-bottom: 1px solid var(--mtse-border);
}

.mtse-trust-bar__items {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 2.5rem;
    justify-content: center;
    align-items: center;
}

.mtse-trust-bar__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--mtse-dark);
}

.mtse-trust-bar__item::before {
    content: '✓';
    font-weight: 800;
    color: var(--mtse-accent);
}

/* --- Cards --- */
.mtse-card {
    background: var(--mtse-white);
    border: 1px solid var(--mtse-border);
    border-radius: var(--mtse-radius);
    overflow: hidden;
    box-shadow: var(--mtse-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mtse-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.mtse-card__image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.mtse-card__body {
    padding: 1.5rem;
}

.mtse-card__title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--mtse-dark);
    margin-bottom: 0.5rem;
}

.mtse-card__text {
    font-size: 0.9rem;
    color: var(--mtse-muted);
    margin-bottom: 1rem;
}

/* --- Testimonial Card --- */
.mtse-testimonial-card {
    background: var(--mtse-light);
    border-left: 4px solid var(--mtse-accent);
    border-radius: var(--mtse-radius);
    padding: 1.75rem;
}

.mtse-testimonial-card__quote {
    font-size: 1rem;
    font-style: italic;
    color: var(--mtse-text);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.mtse-testimonial-card__author {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--mtse-dark);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .mtse-header__nav {
        display: none; /* Phase 2: implement mobile nav toggle */
    }

    .mtse-footer__bottom {
        flex-direction: column;
        text-align: center;
    }

    .mtse-hero__content {
        padding: 3rem 0;
    }
}

/* ============================================================
   Navigation & List Reset Failsafe
   These rules duplicate critical selectors from main.css so the site
   remains usable even when main.css is cached, delayed, or unavailable.
   main.css still provides the full design treatment; these are the minimum
   structural rules needed to prevent raw bullet-list rendering.
   ============================================================ */

/* Site header */
.mtse-site-header {
    background: var(--mtse-white);
    border-bottom: 1px solid var(--mtse-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.mtse-site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 1.5rem;
}

.mtse-site-header__logo-img {
    height: var(--mtse-logo-height, 60px);
    max-height: var(--mtse-logo-height, 60px);
    width: auto;
    display: block;
}

.mtse-site-header__logo-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--mtse-primary);
}

/* Primary navigation — strip bullets unconditionally */
.mtse-nav-list,
.mtse-site-header__nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.75rem;
    align-items: center;
    justify-content: flex-end;
}

.mtse-nav-list a,
.mtse-site-header__nav ul a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--mtse-text);
    text-decoration: none;
}

/* Utility bar — strip bullets */
.mtse-utility-bar {
    background: var(--mtse-primary);
    color: rgba(255,255,255,0.85);
    font-size: 0.825rem;
}

.mtse-utility-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0;
}

.mtse-utility-bar__items,
.mtse-utility-bar__socials {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.25rem 1.25rem;
    flex-wrap: wrap;
}

/* Footer — strip bullets on all list columns */
.mtse-site-footer {
    background: var(--mtse-dark);
    color: rgba(255,255,255,0.75);
}

.mtse-footer__cols {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    align-items: start;
    padding: 4rem 0 2.5rem;
}

.mtse-footer__links,
.mtse-footer__contact-list,
.mtse-footer__socials,
.mtse-site-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mtse-footer__bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1.25rem 0;
}

.mtse-footer__bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* ============================================================
   End SiteEngine Base Styles
   ============================================================ */
