/* 
   Raleigh Cabinets Main Stylesheet
   This file contains all styles for the Raleigh Cabinets website
*/

/* Color Scheme */
:root {
    --dark-blue: #083842; /* Changed from #0A1128 to teal */
    --navy-background: #083842; /* Changed from #162447 to teal */
    --cream: #E8DDB5;
    --accent: #B18C51; /* Gold accent color */
    --light: #F5F5F5;
    --dark: #212121;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--navy-background);
    color: var(--light);
    line-height: 1.6;
    text-align: center; /* Added to center all text by default */
}

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

/* Header Styles */
header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(177, 140, 81, 0.2);
}

.logo {
    display: block;
    margin: 0 auto 20px;
    padding: 12px 25px;
    background-color: var(--dark-blue); /* Now using teal */
    border-radius: 4px;
    border: 1px solid var(--accent);
    max-width: 400px;
    width: 90%;
}

.logo h1 {
    font-size: 32px;
    color: var(--accent);
    font-weight: bold;
    white-space: nowrap; /* Prevents line break in the title */
}

/* Navigation - Fixed for all orientations */
.main-nav {
    width: 100%;
    text-align: center;
    margin: 0 0 20px 0;
}

.main-nav ul {
    display: inline;
    padding: 0;
    margin: 0;
}

.main-nav li {
    display: inline-block;
    margin: 0 15px;
    position: relative;
}

.main-nav a {
    text-decoration: none;
    color: var(--light);
    font-weight: 500;
    padding: 5px 0;
    white-space: nowrap;
}

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

.main-nav a.active {
    color: var(--accent);
}

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent);
}

/* Main Content Styles */
main {
    padding: 40px 0;
}

h2 {
    color: var(--accent);
    margin-bottom: 25px;
    text-align: center;
    font-size: 2.2rem;
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--cream);
}

h3 {
    color: var(--accent);
    margin: 25px 0 15px;
    font-size: 1.5rem;
}

p {
    margin-bottom: 20px;
}

.centered-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 30px auto;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Featured Image */
.feature-image {
    text-align: center;
    margin-bottom: 30px;
}

.feature-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columns on larger screens */
    gap: 30px;
    margin-top: 40px;
}

.portfolio-item {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s;
}

.portfolio-item:hover {
    transform: translateY(-5px);
}

.portfolio-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.portfolio-item h3 {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(8, 56, 66, 0.8); /* Updated to use teal with opacity */
    color: var(--accent);
    margin: 0;
    padding: 15px;
    text-align: center;
}

/* List Styling */
ul, ol {
    margin-left: 20px;
    margin-bottom: 20px;
    text-align: left; /* Keep lists left-aligned for better readability */
}

li {
    margin-bottom: 10px;
}

/* Veteran Badge */
.veteran-badge {
    display: inline-block;
    background-color: var(--cream);
    color: var(--dark-blue); /* Now using teal */
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 0.9rem;
    font-weight: bold;
    margin: 10px 0 20px;
}

/* Contact Form */
.contact-form {
    max-width: 800px;
    margin: 40px auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    text-align: left; /* Keep form labels left-aligned */
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #333;
    border-radius: 4px;
    background-color: rgba(255,255,255,0.05);
    color: var(--light);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

button {
    padding: 12px 25px;
    background-color: var(--cream);
    color: var(--dark-blue); /* Now using teal */
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #d8cda5;
}

/* Gallery Grid Layout - Controls overall gallery structure */
.gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 images per row on large screens */
    gap: 20px; /* Space between gallery items */
    margin-top: 30px; /* Space between gallery and content above it */
}

/* Individual Gallery Item Container - Controls the box containing each image */
.gallery-item {
    position: relative;
    border-radius: 4px; /* Rounded corners on image containers */
    overflow: hidden; /* Ensures images don't spill out of rounded corners */
    box-shadow: 0 5px 15px rgba(0,0,0,0.2); /* Shadow effect beneath each image */
    cursor: pointer; /* Changes cursor to hand when hovering over images */
}

/* Different aspect ratios for different gallery types */
.door-gallery .gallery-item {
    aspect-ratio: 3/4; /* Taller aspect ratio for door styles */
}

.project-gallery .gallery-item {
    aspect-ratio: 4/3; /* Wider aspect ratio for project galleries */
}

/* Gallery Image Styling - Controls how images fit inside their containers */
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Makes images cover their container without distortion */
    display: block;
    transition: transform 0.3s; /* Controls speed of hover zoom effect */
}

/* Image Hover Effect - Controls what happens when user hovers over an image */
.gallery-item:hover img {
    transform: scale(1.05); /* Makes image grow slightly when hovered */
}

/* Lightbox Container - Controls the darkened fullscreen overlay when clicking an image */
.lightbox {
    display: none; /* Hidden by default until activated */
    position: fixed;
    z-index: 1000; /* Ensures lightbox appears on top of all other content */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9); /* Semi-transparent black background */
    justify-content: center;
    align-items: center;
}

/* Lightbox Content Wrapper - Controls the container of the enlarged image */
.lightbox-content {
    max-width: 90%;
    max-height: 90%;
}

/* Enlarged Image in Lightbox - Controls how the clicked image appears when enlarged */
.lightbox-content img {
    max-width: 100%;
    max-height: 90vh; /* Ensures image doesn't exceed 90% of viewport height */
    display: block;
    margin: 0 auto;
    border-radius: 4px; /* Rounded corners on enlarged image */
}

/* Close Button - Controls the X button to close the lightbox */
.close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 30px;
    color: white;
    cursor: pointer;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid rgba(177, 140, 81, 0.2);
    margin-top: 60px;
    color: rgba(255,255,255,0.7);
}

footer a {
    color: var(--cream) !important;
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: var(--accent) !important;
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 columns on medium screens */
    }
    
    .gallery {
        grid-template-columns: repeat(3, 1fr); /* 3 columns on medium-large screens */
    }
}

@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile/tablet */
    }
    
    .gallery {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on tablet/small screens */
    }
    
    form {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width {
        grid-column: span 1;
    }
}

@media (max-width: 500px) {
    nav ul {
        flex-wrap: wrap;
    }
    
    nav a {
        font-size: 0.9rem;
        white-space: nowrap;
    }
    
    .gallery {
        grid-template-columns: 1fr; /* 1 column on very small screens */
    }
}