/* ==========================================================================
   1. VARIABLES & BASE RESETS
   ========================================================================== */
:root {
    --primary-color: #3e2723;   /* Deep historic warm brown */
    --accent-color: #5d4037;    /* Elegant heritage brown */
    --text-color: #2c2c2c;
    --bg-color: #fdfbf7;        /* Warm ivory paper background */
    --card-bg: #ffffff;
    --border-color: #d7ccc8;
    
    /* Modern UI layout additions */
    --muted-color: #555555;
    --shadow-light: 0 2px 5px rgba(0,0,0,0.02);
    --shadow-medium: 0 4px 12px rgba(0,0,0,0.05);
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body {
    font-family: 'Georgia', serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* Typography Defaults */
h1, h2, h3 {
    font-weight: normal;
    color: var(--primary-color);
}

p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    max-width: 65ch; /* Optimizes readability width */
}

strong {
    color: var(--primary-color);
}

/* ==========================================================================
   2. HEADER & NAVIGATION
   ========================================================================== */
header {
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 3rem 1.5rem;
    border-bottom: 4px solid var(--accent-color);
}

.header-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    text-align: left;
}

.logo-container {
    flex-shrink: 0;
}

.logo {
    max-width: 160px;
    height: auto;
    filter: drop-shadow(0px 4px 6px rgba(0,0,0,0.3));
    display: block;
}

.header-text {
    flex-grow: 1;
}

header h1 {
    color: #ffffff;
    font-size: 2.2rem;
    letter-spacing: 1px;
    line-height: 1.2;
}

header p {
    color: #d7ccc8;
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.4;
    margin-top: 0.75rem;
}

/* ==========================================================================
   THREE-WAY HEADER & FOOTER NAVIGATION BAR
   ========================================================================== */
.page-nav-bar {
    display: flex;
    justify-content: space-between; /* Spreads items evenly: Left, Center, Right */
    align-items: center;
    max-width: 850px;
    margin: 2rem auto;
    padding: 1rem 1.5rem;
}

/* Adds a clean separator border block only for the bottom navigation */
.page-nav-bar.nav-bottom {
    border-top: 1px solid var(--border-color);
    margin-top: 5rem;
    margin-bottom: 2rem;
}

/* Adds a clean separator border block only for the top navigation */
.page-nav-bar.nav-top {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 3rem;
}

/* Shared typography for all nav links */
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-color);          
    text-decoration: none;
    font-family: 'Georgia', serif;
    font-size: 1rem;
    font-weight: bold;
    transition: color 0.2s ease-in-out;
    width: 33.33%; /* Gives equal spacing weight to all three segments */
}

/* Link specific text alignments */
.nav-link.lnk-prev { text-align: left; justify-content: flex-start; }
.nav-link.lnk-home { text-align: center; justify-content: center; }
.nav-link.lnk-next { text-align: right; justify-content: flex-end; }

.nav-link:hover, 
.nav-link:focus {
    color: #c62828; /* Heritage highlighted red hover color */
    text-decoration: underline;
}

/* ==========================================================================
   3. LAYOUT & SECTIONS
   ========================================================================== */
main {
    max-width: 850px;
    margin: 2rem auto 5rem auto;
    padding: 0 1.5rem;
}

.intro-section {
    text-align: center;
    margin-bottom: 3rem;
}

.intro-section h2 {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

h1.page-title {
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.subtitle {
    font-style: italic;
    color: var(--muted-color);
    margin-top: 0;
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
}

h2.section-title {
    font-size: 1.6rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.4rem;
    margin-top: 3rem;
}

/* ==========================================================================
   4. CARDS & GRID COMPONENTS
   ========================================================================== */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Traditional file card layout */
.file-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.file-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border-color: var(--accent-color);
}

.file-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
    text-decoration: underline;
}

.file-card p {
    margin: 0;
    font-size: 1rem;
    color: var(--muted-color);
}

/* The Union Central Row Block */
.union-anchor {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--primary-color);
    border-radius: 6px;
    padding: 2rem;
    margin: 2.5rem 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    text-align: center;
}

.union-names {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.union-details {
    font-style: italic;
    color: var(--muted-color);
    font-size: 1.05rem;
}

/* Grid Layout for Family/Children Profiles */
.children-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.child-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.25rem;
    box-shadow: var(--shadow-light);
}

.child-card h3 {
    margin-bottom: 0.25rem;
    font-size: 1.2rem;
}

.child-meta {
    font-size: 0.95rem;
    color: #666666;
    font-style: italic;
    margin-bottom: 0.5rem;
}

/* Lists */
ul {
    padding-left: 1.5rem;
    margin-bottom: 2rem;
    max-width: 65ch;
}

li {
    margin-bottom: 0.8rem;
    font-size: 1.05rem;
}

/* ==========================================================================
   5. MEDIA & EXTRA PACKAGES
   ========================================================================== */
.image-wrapper {
    margin: 2rem 0;
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: 6px;
    box-shadow: var(--shadow-medium);
}

.image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.image-caption {
    margin-top: 0.75rem;
    font-style: italic;
    font-size: 0.95rem;
    color: var(--muted-color);
    text-align: center;
    line-height: 1.4;
}

/* ==========================================================================
   6. FOOTER
   ========================================================================== */
footer {
    margin-top: 5rem;
    padding: 2rem 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: #666666;
    text-align: center;
}

/* ==========================================================================
   7. RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 600px) {
    .header-container {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
}
