/* ============================================
   MASTER CONTRACTORS INC - MODERN CSS
   Mobile-First, Consolidated Stylesheet
   ============================================ */

/* CSS Variables for Easy Theme Management */
:root {
    --primary-color: #8d191d;
    --primary-dark: #6a1316;
    --primary-light: #a32025;
    --secondary-color: #333;
    --text-color: #333;
    --text-light: #666;
    --bg-light: #f4f4f4;
    --white: #ffffff;
    --border-color: #ddd;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--primary-color);
}

.bg-light {
    background-color: var(--bg-light);
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */
.site-header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    position: relative;
}

/* Logo styling - responsive scaling */
.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    width: 100%;
    max-width: 280px;
    height: auto;
    min-width: 200px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
}

.mobile-menu-toggle .bar {
    width: 30px;
    height: 3px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.mobile-menu-toggle.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Navigation - Mobile First */
.main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: var(--shadow);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.main-nav.active {
    max-height: 500px;
}

.nav-list {
    padding: 1rem 0;
}

.nav-list > li {
    border-bottom: 1px solid var(--border-color);
}

.nav-list > li > a {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.nav-list > li > a:hover,
.nav-list > li > a.active {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Dropdown Menu */
.has-dropdown {
    position: relative;
}

.dropdown {
    display: none;
    background-color: var(--bg-light);
}

.has-dropdown:hover .dropdown,
.has-dropdown.active .dropdown {
    display: block;
}

.dropdown li a {
    display: block;
    padding: 0.75rem 2rem;
    color: var(--text-color);
}

.dropdown li a:hover {
    background-color: var(--primary-light);
    color: var(--white);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    position: relative;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: var(--white);
    padding: 6rem 0;
    text-align: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h100v100H0z" fill="none"/><path d="M50 0L100 50 50 100 0 50z" fill="rgba(255,255,255,0.05)"/></svg>');
    opacity: 0.1;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--white);
    color: var(--primary-color);
}

.btn-primary:hover {
    background-color: transparent;
    border-color: var(--white);
    color: var(--white);
}

.btn-secondary {
    background-color: transparent;
    border-color: var(--white);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: var(--white);
    color: var(--primary-color);
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

/* ============================================
   SERVICES GRID
   ============================================ */
.services-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

.service-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.service-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.link-arrow {
    color: var(--primary-color);
    font-weight: 600;
}

.link-arrow:hover {
    color: var(--primary-dark);
}

/* ============================================
   FEATURES GRID
   ============================================ */
.features-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

.feature {
    text-align: center;
}

.feature h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.feature p {
    color: var(--text-light);
}

/* ============================================
   CTA SECTION
   ============================================ */
.cta {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    text-align: center;
}

.cta-content h2 {
    color: var(--white);
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
    background-color: var(--secondary-color);
    color: var(--white);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--primary-light);
    margin-bottom: 1rem;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    text-align: center;
    opacity: 0.8;
}

/* ============================================
   TABLET STYLES (768px and up)
   ============================================ */
@media (min-width: 768px) {
    .logo-img {
        max-width: 350px;
        min-width: 280px;
    }

    .services-grid,
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   DESKTOP STYLES (1024px and up)
   ============================================ */
@media (min-width: 1024px) {
    .logo-img {
        max-width: 450px;
        min-width: 350px;
    }

    .mobile-menu-toggle {
        display: none;
    }

    .main-nav {
        position: static;
        max-height: none;
        box-shadow: none;
    }

    .nav-list {
        display: flex;
        padding: 0;
    }

    .nav-list > li {
        border-bottom: none;
    }

    .nav-list > li > a {
        padding: 0.5rem 1rem;
        border-radius: 4px;
    }

    .dropdown {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 200px;
        box-shadow: var(--shadow);
        border-radius: 4px;
        overflow: hidden;
    }

    .services-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .footer-content {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero {
        padding: 8rem 0;
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

.d-none { display: none; }
.d-block { display: block; }

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .site-header,
    .mobile-menu-toggle,
    .hero,
    .cta,
    .site-footer {
        display: none;
    }

    body {
        font-size: 12pt;
        color: #000;
    }

    .section {
        page-break-inside: avoid;
    }
}