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

body {
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.7;
    color: #2c3e50;
    background-color: #ffffff;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Header Styles */
header {
    background-color: #ffffff;
    color: #2c3e50;
    padding: 2rem 0;
    border-bottom: 1px solid #e8e8e8;
    position: relative;
}

.site-title {
    font-size: 3rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
    text-align: center;
    color: #1a1a1a;
    font-family: 'Playfair Display', 'Georgia', serif;
}

/* Navigation Styles */
.main-nav {
    border-top: 1px solid #e8e8e8;
    padding-top: 1rem;
}

.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.5rem;
}

.main-nav li {
    position: relative;
}

.main-nav a {
    color: #2c3e50;
    text-decoration: none;
    padding: 0.5rem 0;
    display: block;
    font-size: 0.95rem;
    font-weight: 400;
    transition: color 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.main-nav a:hover,
.main-nav a.active {
    color: #8b4513;
    border-bottom: 2px solid #8b4513;
}

/* Dropdown indicator */
.has-submenu > a::after {
    content: ' ▼';
    font-size: 0.7em;
    vertical-align: middle;
    margin-left: 0.3em;
    transition: transform 0.3s ease;
}

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

/* Submenu Styles */
.submenu {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffffff;
    min-width: 250px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    z-index: 1000;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    margin-top: 0;
    padding-top: 0.5rem;
    list-style: none;
    flex-direction: column;
    gap: 0;
}

/* Add invisible bridge to prevent gap */
.submenu::before {
    content: '';
    position: absolute;
    top: -0.5rem;
    left: 0;
    right: 0;
    height: 0.5rem;
}

/* Desktop hover behavior */
@media (min-width: 769px) {
    .has-submenu:hover .submenu,
    .submenu:hover {
        display: block !important;
    }
}

/* Mobile click behavior */
@media (max-width: 768px) {
    .has-submenu.active .submenu {
        display: block !important;
    }
}

.submenu li {
    margin: 0;
}

.submenu a {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    text-transform: none;
    font-size: 0.9rem;
    letter-spacing: 0;
}

.submenu li:last-child a {
    border-bottom: none;
}

.submenu a:hover {
    background-color: #f8f8f8;
    color: #8b4513;
    border-bottom-color: #f0f0f0;
}

/* Main Content Styles */
main {
    background-color: #ffffff;
    min-height: calc(100vh - 200px);
    padding: 4rem 0;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1.2rem;
    color: #1a1a1a;
    font-weight: 400;
    line-height: 1.3;
    font-family: 'Playfair Display', 'Georgia', serif;
}

h1 { 
    font-size: 2.5rem;
    font-weight: 400;
}
h2 { 
    font-size: 2.2rem;
    font-weight: 400;
    text-align: center;
    margin-bottom: 1.5rem;
}
h3 { 
    font-size: 1.4rem;
    font-weight: 400;
}

p {
    margin-bottom: 1.2rem;
    color: #4a4a4a;
}

a {
    color: #8b4513;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #a0522d;
    text-decoration: underline;
}

.lead {
    font-size: 1.2rem;
    color: #666;
    font-weight: 300;
    text-align: center;
    margin-bottom: 2rem;
}

/* Image Styles */
img {
    max-width: 100%;
    height: auto;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.image-gallery img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Hero Section */
.hero-section {
    padding: 3rem 0;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 4rem;
}

.hero-section h2 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    font-weight: 400;
}

.hero-section p {
    max-width: 800px;
    margin: 0 auto 1.5rem;
    text-align: justify;
    line-height: 1.8;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

.feature-item {
    text-align: center;
    padding: 2.5rem;
    background-color: #f9f9f9;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    background-color: #ffffff;
}

.feature-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1.5rem;
    opacity: 0.8;
}

.feature-icon svg {
    fill: #8b4513;
}

.feature-item h3 {
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.feature-item p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #666;
    margin-bottom: 1.5rem;
}

/* Button Styles */
.button {
    display: inline-block;
    padding: 0.75rem 2rem;
    background-color: #8b4513;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 400;
}

.button:hover {
    background-color: #a0522d;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 69, 19, 0.2);
}

/* Footer Styles */
footer {
    background-color: #f8f8f8;
    color: #666;
    text-align: center;
    padding: 3rem 0;
    margin-top: 5rem;
    border-top: 1px solid #e8e8e8;
}

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

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

footer p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Maryland Deed Specific Styles */
.deed-content {
    max-width: 900px;
    margin: 0 auto;
}

.deed-content .introduction {
    margin-bottom: 2rem;
}

.deed-document {
    background-color: #faf8f5;
    border: 1px solid #e0d9cc;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.deed-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #d0c5b0;
}

.deed-header h3 {
    font-family: 'Playfair Display', 'Georgia', serif;
    font-size: 1.5rem;
    line-height: 1.8;
    color: #4a3f2f;
    font-weight: 400;
}

.deed-body {
    font-size: 1.05rem;
    line-height: 1.8;
}

.deed-body h4, .deed-body h5 {
    font-family: 'Playfair Display', 'Georgia', serif;
    color: #4a3f2f;
    margin: 1.5rem 0 0.75rem;
}

.deed-body h4 {
    font-size: 1.4rem;
    border-bottom: 1px solid #d0c5b0;
    padding-bottom: 0.5rem;
}

.deed-body h5 {
    font-size: 1.2rem;
    color: #6b5d4f;
}

.deed-boundaries {
    background-color: #f5f2ed;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid #b8a788;
}

.deed-boundaries ul {
    list-style: none;
    padding-left: 0;
}

.deed-boundaries li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.deed-boundaries li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #8b7d6b;
}

.deed-body strong {
    color: #4a3f2f;
    font-weight: 600;
}

.deed-body em {
    font-style: italic;
    color: #6b5d4f;
}

.signature-block {
    margin: 2rem 0;
    text-align: right;
}

.signature {
    font-style: italic;
    font-size: 1.1rem;
    color: #4a3f2f;
}

.witnesses, .receipt, .acknowledgment {
    margin: 2rem 0;
    padding: 1rem;
    background-color: #f9f7f4;
    border-top: 1px solid #e0d9cc;
}

.receipt-signatures, .acknowledgment-signatures {
    margin-top: 1rem;
    font-style: italic;
}

/* Tidbits List Styles */
.tidbits-list {
    margin: 2rem 0;
}

.tidbit-item {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.tidbit-item:last-child {
    border-bottom: none;
}

.tidbit-icon {
    width: 24px;
    height: 24px;
    margin-right: 1rem;
    object-fit: contain;
}

.tidbit-item a {
    color: #333;
    font-size: 1.1rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

.tidbit-item a:hover {
    color: #0066cc;
    text-decoration: underline;
}

/* Research Content Styles */
.research-content {
    margin-top: 2rem;
}

.image-caption {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.5rem;
    font-style: italic;
}

.highlight-box {
    background: #fef5e7;
    border-left: 4px solid #df5300;
    padding: 1rem;
    margin: 2rem 0;
}

.highlight-box h3 {
    color: #df5300;
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.5;
}

.research-content h4 {
    color: #cf5300;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

blockquote {
    background: #f9f9f9;
    border-left: 4px solid #999;
    margin: 1.5rem 0;
    padding: 0.5rem 1rem;
    font-style: italic;
}

/* Heraldry Page Styles */
.heraldry-images {
    margin: 2rem 0;
}

.heraldry-description {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: center;
    font-style: italic;
}

.heraldry-description p {
    margin: 0;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-nav ul {
        flex-direction: column;
    }
    
    .main-nav li {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .submenu {
        position: static;
        display: none;
        margin-left: 1rem;
        box-shadow: none;
    }
    
    .has-submenu.active .submenu {
        display: block;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}

/* Pension Content Styles */
.pension-content {
    margin-top: 2rem;
    line-height: 1.8;
}

.pension-content p {
    margin-bottom: 1rem;
}

.pension-content hr {
    margin: 2rem 0;
    border: none;
    border-top: 2px solid #e0e0e0;
}

/* Notice Box Styles */
.notice-box {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 2rem;
    margin: 2rem 0;
    text-align: center;
}

.notice-box p {
    margin-bottom: 1rem;
}

.notice-box p:last-child {
    margin-bottom: 0;
}

/* Bible Content Styles */
.bible-content {
    margin-top: 2rem;
}

.bible-images {
    margin: 2rem 0;
}

.bible-image-item {
    text-align: center;
}

.bible-image-item img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.bible-note {
    background-color: #f0f8ff;
    border-left: 4px solid #3498db;
    padding: 1rem;
    border-radius: 5px;
}

/* Tidbits Page Styles */
.tidbit-note {
    font-style: italic;
    color: #666;
    margin-bottom: 2rem;
    text-align: center;
}

.tidbits-content {
    margin-top: 2rem;
}

.tidbit-item {
    margin-bottom: 2rem;
    text-align: center;
}

.tidbit-item img {
    max-width: 100%;
    height: auto;
    margin-bottom: 0.5rem;
}

.tidbit-section {
    margin-top: 3rem;
}

.tidbit-section ul {
    list-style: none;
    padding: 0;
}

.tidbit-section li {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e0e0e0;
}

.tidbit-section li:last-child {
    border-bottom: none;
}

.song-lyrics {
    background-color: #f8f9fa;
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 5px;
    text-align: center;
    font-style: italic;
}

.song-lyrics p {
    margin: 0.25rem 0;
}

.source-note {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
    margin-left: 2rem;
    font-style: italic;
}

.indent {
    margin-left: 2rem;
}

.land-list {
    background-color: #f8f9fa;
    padding: 1rem;
    margin: 1rem 2rem;
    border-radius: 5px;
    font-family: monospace;
}

.land-list p {
    margin: 0.25rem 0;
}

.poem {
    background-color: #fef5e7;
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 5px;
    font-style: italic;
}

/* Photo Gallery Styles */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.gallery-item {
    background-color: #f8f9fa;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.gallery-item h3 {
    padding: 1rem 1rem 0.5rem;
    font-size: 1.2rem;
    color: #2c3e50;
}

.gallery-item p {
    padding: 0 1rem 1rem;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

/* Terms of Use Styles */
.terms-content {
    margin-top: 2rem;
    line-height: 1.8;
}

.terms-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.terms-content p {
    margin-bottom: 1rem;
}

.terms-date {
    margin-top: 3rem;
    text-align: center;
    color: #666;
}

/* Utility Classes */
.text-center { text-align: center; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

/* Additional Refinements */
@media (min-width: 1200px) {
    .container {
        max-width: 1100px;
    }
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background-color: #8b4513;
    color: white;
}

::-moz-selection {
    background-color: #8b4513;
    color: white;
}

/* Mobile Menu Button */
.mobile-menu-button {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.mobile-menu-button span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #2c3e50;
    margin: 5px 0;
    transition: all 0.3s ease;
}

.mobile-menu-button.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-button.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-button.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Fade-in Animation */
@media (prefers-reduced-motion: no-preference) {
    .js .feature-item {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.6s ease, transform 0.6s ease;
    }
    
    .js .feature-item.fade-in {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Mobile Styles */
@media (max-width: 768px) {
    .mobile-menu-button {
        display: block;
    }
    
    .site-title {
        font-size: 2rem;
        padding-right: 3rem;
    }
    
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: white;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        border-top: 1px solid #e8e8e8;
    }
    
    .main-nav.active {
        display: block;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0;
    }
    
    .main-nav a {
        padding: 1rem 1.5rem;
        border-bottom: 1px solid #f0f0f0;
    }
    
    .submenu {
        position: static;
        transform: none;
        margin-top: 0;
        box-shadow: none;
        border: none;
        background-color: #f8f8f8;
    }
    
    .has-submenu .submenu {
        display: none;
    }
    
    .has-submenu.active .submenu {
        display: block;
    }
    
    .has-submenu > a::after {
        float: right;
    }
    
    header {
        position: relative;
    }
}