:root {
    --primary-purple: #6f42c1;
    --accent-gold: #DDBA3E;
    --dark-charcoal: #343a40;
    --soft-white: #f8f9fa;
}

/* Basic Styles */
body {
    font-family: sans-serif;
    margin: 0;
    line-height: 1.6;
    background: var(--soft-white);
    color: var(--dark-charcoal);
}

.container {
    width: 80%;
    margin: auto;
    overflow: hidden;
}

/* Header */
header {
    background: #fff;
    padding: 0;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 1000; /* Ensure header is above other content */
    overflow: visible; /* Allow dropdown to overflow */
}

.top-bar {
    background: var(--primary-purple);
    color: #fff;
    padding: 0.5rem 0;
    text-align: right; /* Changed from center to right */
    font-size: 0.9rem;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

header .logo img {
    height: 150px; /* Tripled size */
}

header nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

header nav ul li {
    margin-left: 20px;
    position: relative; /* Ensure li is positioning context for dropdown */
}

header nav a {
    color: var(--dark-charcoal);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s ease-in-out;
}

header nav a.active, header nav a:hover {
    color: var(--primary-purple);
}

/* Dropdown Menu */
.dropdown {
    position: relative; /* Crucial for positioning dropdown-content */
    display: inline-block;
}

.dropdown-content {
    display: none; /* Hidden by default */
    position: absolute;
    background-color: #f9f9f9;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1001; /* Ensure it's above other content */
    top: 100%; /* Position directly below the button */
    right: 0;
    min-width: auto; /* Adjust width based on content */
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    white-space: nowrap; /* Prevent text wrapping */
    text-align: center; /* Center text within each item */
}

.dropdown-content a:hover {background-color: #f1f1f1}

/* This class is toggled by JavaScript */
.dropdown-content.show {
    display: flex; /* Changed to flex for horizontal display */
    flex-direction: row; /* Ensure horizontal layout when shown */
}

.dropbtn {
    cursor: pointer;
    background: none; /* Remove default button background */
    border: none; /* Remove default button border */
    font-size: 1rem; /* Match nav link font size */
    font-weight: bold; /* Match nav link font weight */
    color: var(--dark-charcoal); /* Match nav link color */
    padding: 0; /* Remove default button padding */
    transition: color 0.2s ease-in-out;
}

.dropbtn:hover, .dropbtn:focus {
    color: var(--primary-purple);
    outline: none; /* Remove outline on focus */
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    background: var(--primary-purple);
    color: #fff;
    padding: 4rem 0;
    text-align: center;
    border-bottom: 3px solid var(--accent-gold);
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #fff; /* Ensure heading is white on purple background */
}

.hero .lead-text {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
}

/* Intro Text Section */
.intro-text {
    padding: 2rem 0;
    text-align: center;
    background: #fff;
    margin-bottom: 2rem;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

.intro-text h2 {
    color: var(--primary-purple);
    margin-bottom: 1rem;
}

/* Buttons */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 1rem;
    transition: background-color 0.2s ease-in-out;
}

.btn-primary {
    background: var(--accent-gold);
    color: var(--dark-charcoal);
}

.btn-primary:hover {
    background: #c29e32;
}

.btn-secondary {
    background: var(--dark-charcoal);
    color: #fff;
    margin-left: 10px;
}

.btn-secondary:hover {
    background: #23272b;
}

/* Features Section */
.features {
    padding: 2rem 0;
}

.features .container {
    display: flex;
    justify-content: space-between;
}

.features .feature {
    background: #fff;
    padding: 2rem;
    text-align: center;
    width: 30%;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    border-top: 3px solid var(--primary-purple);
}

.features .feature h2 {
    color: var(--primary-purple);
}

/* Page Title */
.page-title {
    background: var(--primary-purple);
    color: #fff;
    padding: 2rem 0;
    text-align: center;
    border-bottom: 1px solid #ddd;
    margin-bottom: 2rem;
}

.page-title h2 {
    color: #fff;
}

/* About Page */
.about-section {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.about-section h2, .about-section h3 {
    color: var(--primary-purple);
}

.about-image img {
    max-width: 100%;
    border-radius: 50%;
    border: 5px solid var(--accent-gold);
}

.team-section {
    margin-top: 3rem;
    text-align: center;
}

.team-section h3 {
    color: var(--primary-purple);
}

.team-members {
    display: flex;
    justify-content: space-around;
    margin-top: 2rem;
}

.team-member img {
    border-radius: 50%;
    border: 3px solid var(--primary-purple);
}

/* Services Page */
.service-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.card {
    background: #fff;
    padding: 2rem;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    border-left: 5px solid var(--primary-purple);
}

.card h3 {
    color: var(--primary-purple);
}

/* Obituaries Page */
.obituary-item {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    background: #fff;
    padding: 1.5rem;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    border-left: 5px solid var(--accent-gold);
}

.obituary-item h3 {
    color: var(--primary-purple);
}

.obituary-item img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
}

/* FAQ Page */
.faq-item {
    background: #fff;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    border-left: 5px solid var(--accent-gold);
}

.faq-item h4 {
    color: var(--primary-purple);
    margin-top: 0;
}

/* Forms Table */
.forms-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2rem;
}

.forms-table th,
.forms-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.forms-table th {
    background-color: var(--primary-purple);
    color: #fff;
}

.forms-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

.forms-table a {
    color: var(--primary-purple);
    text-decoration: none;
    font-weight: bold;
}

.forms-table a:hover {
    text-decoration: underline;
}

/* Contact Page */
.content {
    display: flex;
    gap: 2rem;
}

.contact-info h3, .contact-form h3 {
    color: var(--primary-purple);
}

.contact-info, .contact-form {
    flex: 1;
}

.contact-form .form-group {
    margin-bottom: 1rem;
}

.contact-form label {
    display: block;
    margin-bottom: 5px;
}

.contact-form input, .contact-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

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

footer a {
    color: #fff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media(max-width: 768px) {
    header .container {
        flex-wrap: wrap;
    }

    header nav {
        display: none;
        width: 100%;
        flex-direction: column;
    }

    header nav.active {
        display: flex;
    }

    header nav ul {
        flex-direction: column;
        width: 100%;
    }

    header nav ul li {
        margin: 10px 0;
        text-align: center;
    }

    .menu-toggle {
        display: block;
    }

    .features .container, .content {
        flex-direction: column;
    }

    .features .feature {
        width: 100%;
        margin-bottom: 1rem;
    }

    .service-cards {
        grid-template-columns: 1fr;
    }
}