/* ==========================================
   KR Handyman Services - Custom Global Theme
   Colors: Dark Charcoal (#111) & Gold (#dfb249)
   Optimized for cross-device responsiveness
   ========================================== */

/* Global Reset & Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    /* Prevents font scaling bugs on mobile orientation changes */
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a1a; /* Dark sleek background */
    color: #e0e0e0;            /* Light gray text for high readability */
    line-height: 1.6;
    font-size: 17px;           /* Slightly optimized baseline for mobile readability */
    overflow-x: hidden;        /* Absolute hard-stop on horizontal page breaking/scrolling */
    word-wrap: break-word;     /* Forces long URLs/emails to wrap instead of breaking containers */
    webkit-font-smoothing: antialiased;
}

/* Container Layout */
.container {
    width: 100%;
    max-width: 1050px;
    margin: 0 auto;
    padding: 30px 16px;        /* Slightly tighter padding for small phone frames */
}

/* Navigation Menu Styling */
nav {
    background-color: #0b0b0b;
    padding: 10px 0;
    text-align: center;
    border-bottom: 1px solid #222;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-links {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;                  /* Tighter gap handles small phone screens without wrapping ugly */
    flex-wrap: wrap;
    padding: 0 10px;
}

.nav-links a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;        /* Scaled down marginally to fit 5-item menus on compact devices */
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.25s ease;
    display: inline-block;
}

.nav-links a:hover, 
.nav-links a.active {
    color: #dfb249;
    background-color: #1a1a1a;
    transform: translateY(-1px);
}

/* Header Styling */
header {
    background-color: #0b0b0b; /* Pitch black for the header block */
    color: #ffffff;
    padding: 50px 16px;        /* Scaled down block padding on mobile */
    text-align: center;
    border-bottom: 4px solid #dfb249; /* Gold accent line */
}

header h1 {
    font-size: 2.2rem;         /* Scaled for mobile viewports by default */
    color: #dfb249;            /* Matching the logo gold */
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    font-weight: 700;
    line-height: 1.2;
}

header .subtitle {
    font-size: 1.1rem;         /* Clean mobile font sizing */
    color: #ffffff;
    max-width: 700px;
    margin: 0 auto 25px auto;
    padding: 0 8px;
}

/* Header Logo Styling - Forced Circle */
.header-logo {
    display: block;
    margin: 0 auto 20px auto;
    width: 140px;              /* Fluid base size */
    height: 140px;        
    object-fit: cover;    
    border-radius: 50%;   
    border: 3px solid #dfb249; 
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.header-logo:hover {
    transform: scale(1.05) rotate(3deg);
}

/* Call to Action Button */
.btn {
    display: inline-block;
    background-color: #dfb249;
    color: #111111;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.25s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    max-width: 100%;           /* Prevents oversized button stretching */
    text-align: center;
}

.btn:hover {
    background-color: #f5c65c;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(223, 178, 73, 0.3);
}

/* Headings */
h2 {
    color: #dfb249;
    font-size: 1.7rem;         /* Fluid header scaling */
    margin: 30px 0 15px 0;
    border-left: 5px solid #dfb249;
    padding-left: 12px;
    line-height: 1.3;
}

/* Optimized Services Grid & Container (For your updated services page layout) */
.services-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Drop to 1 column on tiny screens automatically */
    gap: 20px;
    margin-top: 25px;
}

.service-block {
    background-color: #242424;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #dfb249;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: all 0.25s ease;
}

.service-block:hover {
    transform: translateX(3px) translateY(-2px);
    background-color: #2a2a2a;
}

.service-block h3 {
    color: #dfb249;
    margin-bottom: 10px;
    font-size: 1.25rem;
}

/* Fallback legacy service-grid code just in case */
.services-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.services-grid li {
    background-color: #242424;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #dfb249;
    font-weight: 500;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: all 0.25s ease;
}

.services-grid li:hover {
    transform: translateX(3px) translateY(-1px);
    background-color: #2a2a2a;
}

/* Content Cards & Section text padding fixes */
.card {
    background-color: #242424; 
    padding: 20px;              /* Responsive compact base padding */
    border-radius: 12px;
    margin-bottom: 25px;
    border: 1px solid #333333;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

p {
    margin-bottom: 16px;
    color: #cccccc;
}

/* ==========================================
   Tablet & Desktop Breakpoint Adjustments (Media Queries)
   ========================================== */
@media (min-width: 768px) {
    body {
        font-size: 18px;       /* Scale up font for widescreen monitor setups */
    }
    .container {
        padding: 40px 24px;
    }
    nav {
        padding: 15px 0;
    }
    .nav-links {
        gap: 20px;
    }
    .nav-links a {
        font-size: 1.1rem;
    }
    header {
        padding: 70px 20px;
    }
    header h1 {
        font-size: 3rem;       /* Bold, impactful typography on desktop displays */
    }
    header .subtitle {
        font-size: 1.3rem;
    }
    .header-logo {
        width: 160px;
        height: 160px;
    }
    h2 {
        font-size: 2.1rem;
    }
    .card {
        padding: 30px;         /* Generous layout sizing on massive viewports */
    }
}
