/* Esarey Family Website - Classic/Traditional Style */

:root {
    --primary-color: #8d1e06;
    --primary-dark: #6b1705;
    --secondary-color: #2a557e;
    --text-color: #333;
    --text-light: #666;
    --bg-cream: #faf8f5;
    --bg-white: #ffffff;
    --border-color: #ddd;
    --accent-gold: #c9a227;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-cream);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Georgia', serif;
    color: var(--primary-color);
    margin-bottom: 1rem;
    line-height: 1.3;
}

h1 {
    font-size: 2.5rem;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 1.8rem;
    margin-top: 2rem;
}

h3 {
    font-size: 1.4rem;
    color: var(--secondary-color);
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

a:visited {
    color: var(--secondary-color);
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo img {
    height: 60px;
    width: auto;
}

.logo h1 {
    font-size: 1.5rem;
    color: white;
    border: none;
    margin: 0;
    padding: 0;
}

.logo a {
    color: white;
    text-decoration: none;
}

.logo a:hover {
    text-decoration: none;
}

/* Navigation */
nav ul {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

nav a {
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: normal;
    transition: background 0.2s;
}

nav a:hover, nav a.active {
    background: rgba(255,255,255,0.2);
    text-decoration: none;
}

nav a:visited {
    color: white;
}

/* Mobile navigation */
.nav-toggle {
    display: none;
    background: none;
    border: 2px solid white;
    color: white;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1rem;
}

/* Search box in header */
.header-search {
    display: flex;
    gap: 0.5rem;
}

.header-search input {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    width: 200px;
}

.header-search button {
    padding: 0.5rem 1rem;
    background: var(--accent-gold);
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-family: inherit;
}

.header-search button:hover {
    background: #b8911f;
}

/* Main content */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

main.container {
    background: var(--bg-white);
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Home page hero */
.hero {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-white);
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.hero h1 {
    border: none;
    font-size: 2.8rem;
}

.hero-image {
    max-width: 200px;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Two column layout */
.two-column {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}

.sidebar-image {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Navigation grid for home page */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.nav-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
}

.nav-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    text-decoration: none;
}

.nav-card:visited {
    color: inherit;
}

.nav-card-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.nav-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.nav-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin: 0;
}

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

.gallery-item {
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: transform 0.2s;
}

.gallery-item:hover {
    transform: scale(1.02);
}

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

.gallery-item figcaption {
    padding: 0.75rem;
    font-size: 0.85rem;
    background: var(--bg-white);
    text-align: center;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 4px;
}

.lightbox-caption {
    color: white;
    text-align: center;
    margin-top: 1rem;
    font-size: 1.1rem;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 2001;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 2rem;
    padding: 1rem;
    cursor: pointer;
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.3);
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

/* Family tree */
.family-tree {
    overflow-x: auto;
    padding: 2rem 0;
}

.tree-container {
    min-width: 800px;
}

.tree-node {
    background: var(--bg-white);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    margin: 0.5rem;
    display: inline-block;
    min-width: 180px;
}

.tree-node.ancestor {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.tree-node h4 {
    margin: 0;
    font-size: 1rem;
}

.tree-node.ancestor h4 {
    color: white;
}

.tree-node .dates {
    font-size: 0.85rem;
    color: var(--text-light);
}

.tree-node.ancestor .dates {
    color: rgba(255,255,255,0.8);
}

.tree-level {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.tree-connector {
    width: 2px;
    height: 30px;
    background: var(--primary-color);
    margin: 0 auto;
}

/* Blockquote styling for letters/testimonials */
blockquote {
    background: var(--bg-cream);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    border-radius: 0 8px 8px 0;
}

blockquote cite {
    display: block;
    margin-top: 1rem;
    font-style: normal;
    font-weight: bold;
    color: var(--primary-color);
}

/* Content sections */
.section {
    margin: 3rem 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.section:first-child {
    border-top: none;
    margin-top: 0;
}

/* Divider */
hr {
    border: none;
    border-top: 2px solid var(--primary-color);
    margin: 2rem 0;
}

/* Lists */
ul, ol {
    margin: 1rem 0 1rem 2rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

th, td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

th {
    background: var(--primary-color);
    color: white;
}

tr:nth-child(even) {
    background: var(--bg-cream);
}

/* Search results */
.search-results {
    margin: 2rem 0;
}

.search-result {
    padding: 1.5rem;
    background: var(--bg-white);
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-result h3 {
    margin-top: 0;
}

.search-result .excerpt {
    color: var(--text-light);
}

.search-result mark {
    background: #fff3cd;
    padding: 0 2px;
}

/* Footer */
footer {
    background: var(--primary-dark);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

footer a {
    color: var(--accent-gold);
}

footer a:visited {
    color: var(--accent-gold);
}

/* Responsive design */
@media (max-width: 900px) {
    .two-column {
        grid-template-columns: 1fr;
    }

    .sidebar-image {
        max-width: 300px;
        margin: 0 auto;
        display: block;
    }
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        text-align: center;
    }

    .nav-toggle {
        display: block;
    }

    nav {
        width: 100%;
        display: none;
    }

    nav.active {
        display: block;
    }

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

    nav a {
        display: block;
        padding: 0.75rem;
    }

    .header-search {
        width: 100%;
    }

    .header-search input {
        flex: 1;
    }

    h1 {
        font-size: 2rem;
    }

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

    body {
        font-size: 16px;
    }

    main.container {
        margin: 1rem;
        padding: 1.5rem;
    }

    footer .container {
        flex-direction: column;
        text-align: center;
    }
}

/* Print styles */
@media print {
    header, footer, .lightbox, .header-search, nav {
        display: none;
    }

    main.container {
        box-shadow: none;
        margin: 0;
    }

    a {
        color: var(--text-color);
    }

    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}
