/* Color Palette & Variables */
:root {
    --bg-dark: #292929;
    --text-main: #2b2b2b;
    --text-light: #f4f1eb;
    --copper: #D22027;
    --copper-hover: #99191d;
    --wood-dark: #3b2f2f;
    --wood-light: #f5f0e6;
}

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

body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-main);
    background-color: var(--wood-light);
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    color: var(--wood-dark);
}

a {
    text-decoration: none;
    color: var(--copper);
    transition: color 0.3s ease;
}

.container {
    width: 95%;
    max-width: 1450px; /* Increased from 1200px to fit everything side-by-side */
    margin: 0 auto;
}

/* Header & Navigation */
header {
    background-color: var(--bg-dark);
    color: var(--text-light);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
    border-bottom: 3px solid var(--copper);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem; /* Add this line */
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: 1px;
    min-width: 0;   /* Add this: allows the flex item to shrink below image size */
    flex-shrink: 1; /* Add this: tells it to shrink if space runs out */
}

.logo span {
    color: var(--copper);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-light);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--copper);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    flex-shrink: 0; /* Add this line */
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--copper);
}

/* Hero Section */
.hero {
    min-height: 30vh; /* Changed from fixed height to min-height */
    padding: 3rem 1rem; /* Added padding so text doesn't touch the edges */
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-light);
    margin-bottom: 3rem;
}

.hero-content {
    max-width: 1000px;
}

.hero h1 {
    font-size: 3.5rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    font-weight: 300;
}

.btn {
    display: inline-block;
    background-color: var(--copper);
    color: var(--text-light);
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 3px;
    text-transform: uppercase;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: var(--copper-hover);
    color: var(--text-light);
}

.btn-sml {
    display: inline-block;
    background-color: var(--copper);
    color: var(--text-light);
    padding: 0.4rem 1rem;
    /* font-size: 1.1rem;
    font-weight: bold; */
    border-radius: 3px;
    /* text-transform: uppercase; */
    transition: background-color 0.3s ease;
}

.btn-sml:hover {
    background-color: var(--copper-hover);
    color: var(--text-light);
}

.logo-container img {
    max-height: 100px; /* Changed from height: 100px */
    max-width: 100%;   /* Add this: prevents image from overflowing its container */
    width: auto;       /* Add this: maintains aspect ratio */
    height: auto;      /* Add this: scales height down proportionally when width shrinks */
    display: block;    /* Add this: removes tiny extra space below the image */
    object-fit: contain;
    background-color: #fdfcfc; 
    padding: 5px 15px;
    border-radius: 4px;
}

/* Page Headers (About & Contact) */
.page-header {
    height: 40vh;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-light);
    border-bottom: 5px solid var(--copper);
}

.page-header h1 {
    font-size: 3rem;
    color: var(--text-light);
}

/* General Sections */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin: 4rem 0 2rem;
    position: relative;
}

.section-title::after {
    content: '';
    width: 60px;
    height: 3px;
    background-color: var(--copper);
    display: block;
    margin: 10px auto 0;
}

/* Grid Layout (Home) */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem; /* THIS is the line that creates the spacing between cards */
}

.card {
    background-color: #fff;
    border: 1px solid #e0d8c3;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 3px solid var(--copper);
}

.card-content {
    padding: 1.5rem;
}

.card-content h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.card-content h3 {
    text-align: center; /* Add this line to the existing h3 block */
}

.service-intro {
    font-style: italic;
    color: #666;
    margin-bottom: 1.5rem;
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.service-subsections h4 {
    font-size: 1.1rem;
    color: var(--copper);
    margin-bottom: 0.2rem;
}

.service-subsections p {
    font-size: 0.95rem;
    margin-bottom: 1.2rem;
    line-height: 1.5;
}

.service-subsections p:last-child {
    margin-bottom: 0;
}

/* Team Section (About) */
.team {
    margin: 4rem auto;
}

.attorney-profile {
    background-color: #fff;
    padding: 3rem;
    margin-bottom: 2rem;
    border-left: 5px solid var(--copper);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    display: flex; /* Makes the image and text sit side-by-side */
    gap: 2.5rem;
    align-items: flex-start;
}

/* The .reverse class places the photo on the right instead of the left */
.attorney-profile.reverse {
    flex-direction: row-reverse;
    border-left: none;
    border-right: 5px solid var(--copper);
}

.profile-image {
    flex-shrink: 0;
}

.profile-image img {
    width: 250px;
    height: 250px;
    object-fit: cover; /* Keeps image proportions nice */
    border-radius: 5px;
    border: 3px solid var(--copper);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.profile-text {
    flex: 1; /* Allows the text to take up remaining space */
}

.profile-text h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--wood-dark);
}

.profile-text p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Contact Section */
.contact-section {
    margin: 4rem auto;
    display: flex;
    justify-content: center;
}

.contact-card {
    background-color: #fff;
    padding: 3rem;
    max-width: 700px;
    text-align: center;
    border-top: 5px solid var(--copper);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.contact-card h2 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
}

.contact-info {
    margin: 2rem 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 1rem;
    text-align: left;
}

.info-item {
    background-color: var(--wood-light);
    padding: 1.5rem;
    border-radius: 5px;
    min-width: 200px;
}

.cta-box {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #ddd;
}

.cta-box h3 {
    margin-bottom: 1rem;
}

.cta-box p {
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: #666;
}

/* Footer */
footer {
    background-color: var(--bg-dark);
    color: var(--text-light);
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

/* Main Layout (Sidebar + Content) */
.main-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    margin-bottom: 4rem;
}

/* Sidebar Styles */
.sidebar-bios {
    background-color: #fff;
    padding: 2rem;
    border-top: 5px solid var(--copper);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.sidebar-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
    border-bottom: 2px solid var(--wood-light);
    padding-bottom: 0.5rem;
}

.bio-snippet {
    margin-bottom: 2rem;
    text-align: center;
}

.bio-snippet:last-child {
    margin-bottom: 0;
}

.bio-snippet img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--copper);
    margin-bottom: 1rem;
}

.bio-snippet h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.bio-snippet p {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.bio-link {
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.bio-link:hover {
    color: var(--copper-hover);
}

@media(max-width: 950px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .sidebar-bios {
        position: relative;
        top: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

/* Responsive Styles for Mobile */
@media(max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: var(--bg-dark);
        padding: 1rem 0;
        text-align: center;
    }
    
    .nav-links.active {
        display: flex;
    }

    .hamburger {
        display: flex;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    /* Stack images on top of text on mobile screens */
    .attorney-profile, .attorney-profile.reverse {
        flex-direction: column;
        align-items: center;
        text-align: center;
        border-left: 5px solid var(--copper);
        border-right: none;
        padding: 2rem 1.5rem;
    }

    .profile-image img {
        margin-bottom: 1rem;
    }
}