/* ==========================================
   C.D.S. Corporation - Main Stylesheet
   ========================================== */

/* CSS Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background-color: #ecf0f1;
}

/* Color Variables - Muted Earthy Palette */
:root {
    --primary: #2c3e50;        /* Deep Navy - Main text and headers */
    --secondary: #34495e;      /* Steel Blue - Section headings */
    --accent: #7f8c8d;         /* Stone Gray - Buttons and highlights */
    --supporting: #95a5a6;     /* Light Gray - Secondary elements */
    --background: #ecf0f1;     /* Off White - Page backgrounds */
    --light-background: #ffffff; /* White - Header background */
    --borders: #95a5a6;        /* Light Gray - Subtle borders */
    --white: #ffffff;
    --text-light: #7f8c8d;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--primary);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    color: var(--secondary);
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

/* Buttons */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

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

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

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

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

/* Hero section button font size increase */
.hero-actions .btn-secondary {
    font-size: 1.25rem;
}

.cta-button {
    background-color: var(--primary);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.3rem;
    transition: all 0.3s ease;
    border: 2px solid var(--accent);
    justify-self: end;
}

.cta-button:hover {
    background-color: var(--secondary);
    border-color: var(--secondary);
}

/* Header */
.header {
    background-color: var(--light-background);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 1rem 10rem 0.25rem 10rem; /* brought edges closer to center, reduced bottom spacing by 50% */
    width: 100%;
    margin: 0;
    gap: 2rem;
}

.logo {
    justify-self: start;
}

.logo-img {
    height: 74px;
    width: auto;
}

/* Move center nav toward the logo */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 4rem;
    align-items: center;
    justify-self: center;
    transform: translateX(-4rem); /* bumped even further left */
}

.nav-link {
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    font-size: 1.3rem;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--accent);
}

/* Dropdown Menu */
.nav-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--white);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-radius: 5px;
    padding: 1rem 0;
    list-style: none;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    padding: 0;
}

.dropdown-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.dropdown-menu a:hover {
    color: var(--accent);
    background-color: var(--background);
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
    justify-self: end;
    padding: 8px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.mobile-menu-toggle:hover {
    background-color: rgba(127, 140, 141, 0.1);
}

.mobile-menu-toggle span {
    width: 28px;
    height: 3px;
    background-color: var(--primary);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100vh;
    background-color: var(--primary);
    z-index: 999;
    transition: left 0.3s ease;
}

.mobile-menu.active {
    left: 0;
}

.mobile-menu-content {
    padding: 2rem;
    margin-top: 90px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.mobile-phone {
    margin-bottom: 2rem;
    text-align: center;
}

.mobile-phone a {
    color: var(--white);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 600;
}

.mobile-nav-menu {
    list-style: none;
    margin-bottom: 2rem;
}

.mobile-nav-menu li {
    margin-bottom: 1rem;
}

.mobile-nav-menu a {
    color: var(--white);
    text-decoration: none;
    font-size: 1.2rem;
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.mobile-nav-menu a:hover {
    color: var(--accent);
    padding-left: 1rem;
}

/* Mobile Dropdown Styles */
.mobile-dropdown {
    position: relative;
}

.mobile-dropdown > a::after {
    content: " ▼";
    font-size: 0.8rem;
    float: right;
    transition: transform 0.3s ease;
}

.mobile-dropdown.active > a::after {
    transform: rotate(180deg);
}

.mobile-dropdown-menu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 1rem;
}

.mobile-dropdown.active .mobile-dropdown-menu {
    max-height: 300px;
}

.mobile-dropdown-menu li {
    margin-bottom: 0.5rem;
}

.mobile-dropdown-menu a {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-cta-button {
    display: block;
    background-color: var(--accent);
    color: var(--white);
    text-align: center;
    padding: 18px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.mobile-cta-button:hover {
    background-color: var(--secondary);
    transform: translateY(-2px);
}

/* Main Content */
main {
    margin-top: 80px;
}

/* Hero Section */
.hero {
    position: relative;
    height: 80vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-color: var(--primary); /* Navy blue placeholder while image loads */
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.6);
    opacity: 0; /* Start hidden for smooth fade-in */
    transition: opacity 0.5s ease-in;
}

.hero-img.loaded {
    opacity: 1; /* Fade in when loaded */
}

/* Ensure all other images display normally without fade effect */
img:not(.hero-img) {
    opacity: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: -1;
}

.hero-content {
    position: relative;
    z-index: 1;
    color: var(--white);
    text-align: center;
}

.hero-headline {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--white);
}

.hero-subheadline {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--white);
    font-weight: 500;
}

.hero-description {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* Services Overview Section */
.services-overview {
    padding: 80px 0;
    background-color: var(--white);
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-light);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card {
    background-color: var(--background);
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--borders);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.service-icon {
    margin-bottom: .5rem;
}

.service-icon img {
    width: 60px;
    height: 60px;
    filter: invert(41%) sepia(12%) saturate(17%) hue-rotate(314deg) brightness(84%) contrast(89%);
}

/* Specific sizing for solar and quarry icons */
.service-icon img[src*="solar-icon"], 
.service-icon img[src*="quarry-icon"] {
    width: 68px;
}

.service-icon img[src*="commercial-icon"] {
    opacity: 0.8;
}

.service-card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.service-card p {
    margin-bottom: 1.5rem;
    color: var(--secondary);
}

.service-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.service-link:hover {
    color: var(--secondary);
}

/* Trust Section */
.trust-section {
    padding: 80px 0;
    background-color: var(--secondary);
    color: var(--white);
}

.trust-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: center;
}

.trust-stats {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-item h3 {
    font-size: 3.6rem;
    color: var(--white);
    margin-bottom: 0.5rem;
}

.stat-item p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.32rem;
}

.trust-info h2 {
    color: var(--white);
    margin-bottom: 2rem;
    font-size: 2.4rem;
}

.certifications {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cert-item {
    display: flex;
    gap: 2rem;
    font-size: 1.5rem;
    color: var(--white);
}

.cert-label {
    font-weight: 600;
    color: var(--white);
    min-width: 120px;
    font-size: 1.5rem;
}

/* Contact CTA Section */
.contact-cta {
    padding: 80px 0;
    background-color: var(--background);
    color: var(--primary);
    text-align: center;
}

.cta-content h2 {
    color: var(--primary);
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--primary);
}

.cta-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-actions .btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.cta-actions .btn-primary:hover {
    background-color: var(--secondary);
    border-color: var(--secondary);
}

.hero-actions .btn-primary {
    background-color: var(--primary);
    border: 2px solid var(--supporting);
}

.hero-actions .btn-primary:hover {
    background-color: var(--secondary);
    border: 2px solid var(--supporting);
}

/* Footer */
.footer {
    background-color: var(--primary);
    color: var(--white);
    padding: 60px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo img {
    height: 64px;
    margin-bottom: .25rem;
    filter: brightness(0) invert(1);
}

.footer-logo p {
    color: rgba(255, 255, 255, 0.8);
}

.footer-nav h4 {
    color: var(--accent);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-nav ul {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.footer-nav li {
    margin-bottom: 0.5rem;
}

.footer-nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.footer-contact h4 {
    color: var(--accent);
    margin-bottom: 1rem;
}

.contact-item {
    margin-bottom: 0.5rem;
}

.contact-item a {
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
}

.contact-item span {
    color: rgba(255, 255, 255, 0.8);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }