:root {
    --color-primary: #1E2A3B;
    --color-secondary: #F1DFA8;
    --color-text-light: #ffffff;
    --color-text-dark: #333333;
    --color-bg-dark: #151e2b;
    --font-main: 'Montserrat', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--color-bg-dark);
    color: var(--color-text-light);
    line-height: 1.6;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 700;
    margin-bottom: 1rem;
}

h1 span {
    color: var(--color-secondary);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

/* Top Bar */
.top-bar {
    background-color: #F9E1A5;
    color: #1D1E20;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1001;
    /* Higher than nav initially, or same? sticky stacking works. */
    text-align: center;
    padding: 0 1rem;
}

.top-bar a {
    color: inherit;
    text-decoration: none;
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 10%;
    /* Reduced to tight padding */
    background: rgba(30, 42, 59, 0.95);
    /* Reverted to Dark Blue transparent */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    /* Scrolls away naturally */
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    border: none;
    padding: 0.5rem 1rem;
    letter-spacing: 2px;
}

.logo img {
    border: none;
    outline: none;
}

.nav-links a {
    margin-left: 2rem;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.nav-links a:hover {
    color: var(--color-secondary);
}

/* Hero Section */
.logo img {
    height: 50px;
    /* Kept at 50px, with 10px padding nav total is ~70px */
}

.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 2rem;
    position: relative;
    overflow: hidden;
    color: var(--color-text-light);
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 15, 25, 0.75);
    /* Darker overlay for readability */
    z-index: -1;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    z-index: 1;
}

.hero p {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 1.5rem 0 2.5rem;
    opacity: 0.9;
    z-index: 1;
    /* Added z-index for paragraph */
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border: 2px solid var(--color-secondary);
    color: var(--color-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0.5rem;
    cursor: pointer;
}

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

/* About Section */
.section {
    padding: 5rem 10%;
    overflow: visible;
    /* Allow overlap */
}

.bg-secondary {
    background-color: var(--color-secondary);
    color: var(--color-text-dark);
}

.about-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.about-images {
    position: relative;
    height: 500px;
    width: 100%;
}

.img-office {
    width: 80%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
}

.img-david {
    width: 50%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    position: absolute;
    bottom: 0;
    left: 10%;
    z-index: 2;
    border: 5px solid white;
    /* Framing effect */
}

.about-content {
    /* text-align: left now for grid */
    text-align: left;
}

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

.about-content p {
    font-size: 1.1rem;
    line-height: 1.8;
}

@media (max-width: 900px) {
    .about-layout {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .about-images {
        height: 400px;
        margin-bottom: 2rem;
    }

    .about-content {
        text-align: center;
    }
}

@media (max-width: 900px) {
    #about-firm .about-layout {
        grid-template-columns: 1fr;
        display: flex;
        flex-direction: column;
    }

    #about-firm .about-content {
        order: 1 !important;
    }

    #about-firm .about-images {
        order: 2 !important;
        margin-top: 2rem;
    }
}

/* Contact Section */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 3rem;
}

.contact-info div {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-family: inherit;
}

.contact-form button {
    width: 100%;
    background: var(--color-secondary);
    color: var(--color-primary);
    border: none;
    padding: 1rem;
    font-weight: 700;
    cursor: pointer;
}

/* Footer */
footer {
    background: #0f1621;
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Admin UI */
.admin-bar {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #333;
}

.admin-tools {
    display: flex;
    gap: 5px;
    margin-right: 10px;
    padding-right: 10px;
    border-right: 1px solid #ddd;
}

.admin-tools button {
    cursor: pointer;
    border: 1px solid #ccc;
    background: #f0f0f0;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.admin-tools button:hover {
    background: #e0e0e0;
}

.admin-bar.hidden {
    display: none;
}

.contact-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    filter: brightness(0.4);
    /* Darken for text readability */
}

[contenteditable="true"] {
    outline: 2px dashed var(--color-secondary);
    padding: 2px;
}

/* Image Manager Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-content {
    background: #1e2a3b;
    padding: 2rem;
    width: 600px;
    max-width: 90%;
    border: 1px solid var(--color-secondary);
    border-radius: 8px;
    color: white;
}

.img-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    max-height: 300px;
    overflow-y: auto;
    margin: 1rem 0;
    padding: 10px;
    background: #151e2b;
}

.img-thumb {
    width: 100%;
    height: 100px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
}

.img-thumb:hover,
.img-thumb.selected {
    border-color: var(--color-secondary);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
}

/* Utilites */
.hidden {
    display: none !important;
}

/* Testimonial Quote Styling */
.quote-icon {
    font-family: 'Times New Roman', serif;
    font-size: 8rem;
    line-height: 1;
    color: var(--color-primary);
    opacity: 0.3;
    margin-bottom: -40px;
    margin-top: -20px;
    height: 80px;
    display: block;
    user-select: none;
    font-weight: bold;
    pointer-events: none;
    /* Allow clicks to pass through to the text below */
}

/* Mobile Improvements */
@media (max-width: 768px) {

    /* Safe Area & Body */
    body {
        overflow-x: hidden;
    }

    /* Top Bar - Let it scroll away on mobile to save space */
    .top-bar {
        position: relative;
        height: auto;
        padding: 0.5rem;
        font-size: 0.75rem;
        line-height: 1.2;
    }

    /* Nav - Stack nicely */
    nav {
        flex-direction: column;
        padding: 1rem;
    }

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

    .nav-links a {
        margin-left: 0;
        margin: 0 0.5rem;
        font-size: 0.85rem;
    }

    /* Hero Text Scaling */
    .hero h1 {
        font-size: 2.2rem;
        padding: 0 1rem;
    }

    .hero p {
        font-size: 1rem;
        padding: 0 1rem;
    }

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

    .btn {
        margin: 0;
    }

    /* Section Padding */
    .section {
        padding: 3rem 5%;
    }

    /* About Images - Stop specific overlap issues */
    .about-images {
        height: 350px;
    }

    .img-office {
        width: 100%;
        position: relative;
        height: 250px;
        object-fit: cover;
    }

    .img-david {
        width: 60%;
        bottom: 0;
        right: 0;
        left: auto;
        border-width: 3px;
        position: absolute;
    }

    /* Services - Full width cards */
    #services>div {
        flex-direction: column;
        align-items: center;
    }

    #services>div>div {
        width: 100% !important;
        max-width: 400px;
    }

    /* Contact - Stack grid */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Footer */
    footer {
        padding: 1rem;
    }
}
/* Admin Button Contrast Fix */
.admin-bar .btn {
    background: var(--color-primary); /* Dark Navy */
    color: var(--color-secondary);    /* Gold */
    border: 1px solid var(--color-primary);
    margin-left: 0.5rem;
}
.admin-bar .btn:hover {
    background: var(--color-secondary);
    color: var(--color-primary);
}
.admin-tools button {
    border-color: #999;
    color: #333;
    background: #e0e0e0;
}

/* Modal Button Visibility */
#btn-trigger-upload,
#btn-confirm-img {
    background: var(--color-secondary); /* Solid Gold */
    color: var(--color-primary);        /* Dark Navy Text */
    border: 1px solid var(--color-secondary);
}
#btn-trigger-upload:hover,
#btn-confirm-img:hover {
    background: white; /* Hover effect */
    color: var(--color-primary);
    border-color: white;
}
