/* ---------------------------------------------------------
   theSullivanClan.com — Shared Global Stylesheet
   Unified Rockwell/Americana theme
---------------------------------------------------------- */

/* GLOBAL PAGE STYLING */
body {
    font-family: Georgia, serif;
    background-color: #f7f2e8;
    color: #3a2f2f;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* BASIC TEXT ELEMENTS */
p {
    font-size: 1.1rem;
    color: #3a2f2f;
}

/* ---------------------------------------------------------
   UNIFIED HEADER (used on ALL pages)
---------------------------------------------------------- */
header {
    background-color: #d9c7a3;
    border-bottom: 6px solid #b59a6a;
    padding: 30px 20px;
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 2.4rem;
    color: #4a3a2a;
}

header h2 {
    margin: 10px 0 0;
    font-size: 1.4rem;
    color: #4a3a2a;
    font-weight: normal;
}

/* ---------------------------------------------------------
   MAIN CONTENT AREA & SECTIONS
---------------------------------------------------------- */
.content {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

.section {
    margin-bottom: 40px;
}

/* Shared section/generation titles */
.section h3,
.generation h3 {
    font-size: 1.6rem;
    color: #4a3a2a;
    margin-bottom: 10px;
}

/* Centered introductory text (Books, etc.) */
.intro {
    text-align: center;
    margin-bottom: 40px;
    color: #6b4e31;
    font-size: 1.15rem;
}

/* ---------------------------------------------------------
   UNIVERSAL BUTTONS & GRID MENUS
---------------------------------------------------------- */

/* Equal-width grid with real spacing */
.nav-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    justify-items: center;
}

/* Generic auto-fit grid helper */
.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

/* Primary nav button style */
.nav-button {
    background-color: #e8dfcf;
    border: 2px solid #c8b79a;
    padding: 12px 18px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: #4a3a2a;
    text-decoration: none;
    display: block;
    width: 100%;
    max-width: 260px;
    border-radius: 6px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nav-button:hover {
    background-color: #dcd1bd;
    border-color: #b59a6a;
}

/* ---------------------------------------------------------
   BOOKS PAGE — GRID & CARDS
---------------------------------------------------------- */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
}

.book-card {
    background: #faf7f2;
    border: 2px solid #c8b79a;
    padding: 16px;
    text-align: center;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.12);
}

.book-card img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #c8b79a;
    margin-bottom: 12px;
}

.book-title {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #4a3a2a;
}

/* INDIVIDUAL BOOK PAGE — COVER IMAGE */
.cover {
    text-align: center;
    margin: 20px 0 30px;
}

.cover img {
    max-width: 260px;
    height: auto;
    border-radius: 4px;
    border: 1px solid #c8b79a;
}

/* INDIVIDUAL BOOK PAGE — BUTTON STACK */
.button-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
    align-items: center;
}

/* ---------------------------------------------------------
   STORY GRID (Lois’s Short Stories menu)
---------------------------------------------------------- */
.story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    justify-items: center;
}

/* ---------------------------------------------------------
   IFRAMES (Google Docs embeds)
---------------------------------------------------------- */
iframe {
    width: 100%;
    height: 900px;
    border: none;
    background: white;
}

/* ---------------------------------------------------------
   FAMILY TREE PAGE
---------------------------------------------------------- */

/* Controls bar */
.controls {
    background-color: #d9c7a3;
    border-bottom: 6px solid #b59a6a;
    padding: 20px;
    text-align: center;
}

.controls button {
    background: #7A4E2D;
    color: white;
    border: none;
    padding: 10px 18px;
    margin: 5px;
    border-radius: 4px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.controls button:hover {
    background: #9C6A3A;
}

/* Breadcrumb */
.breadcrumb {
    text-align: center;
    margin: 20px auto;
    font-size: 1.2rem;
    color: #5a4a3a;
    max-width: 900px;
    padding: 0 10px;
}

.breadcrumb span {
    cursor: pointer;
    color: #7A4E2D;
    text-decoration: underline;
}

/* Tree container */
.tree-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Generations */
.generation {
    margin: 30px 0;
}

.generation h3 {
    margin-bottom: 15px;
    text-align: left;
}

/* Family unit boxes */
.family-unit {
    background-color: #e8dfcf;
    border: 2px solid #c8b79a;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 8px 0;
    display: inline-block;
    max-width: 100%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease,
                background-color 0.15s ease, border-color 0.15s ease;
}

.family-unit.root {
    display: block;
    margin: 0 auto 10px auto;
    text-align: center;
}

.family-unit.child:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.12);
    background-color: #dcd1bd;
    border-color: #b59a6a;
}

/* Names inside family-unit */
.family-names {
    font-size: 1.2rem;
    font-weight: bold;
    color: #4a3a2a;
    line-height: 1.4;
    text-align: center;
}

/* Children layout */
.children-container {
    margin-left: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* ---------------------------------------------------------
   FOOTER
---------------------------------------------------------- */
footer {
    text-align: center;
    padding: 20px;
    background-color: #d9c7a3;
    border-top: 6px solid #b59a6a;
    margin-top: 60px;
    font-size: 0.9rem;
    color: #5a4a3a;
}

/* ---------------------------------------------------------
   LIBRARY LIST (Stories & Letters)
   Responsive 2–3 column layout
---------------------------------------------------------- */

.library-list {
    list-style: none;
    padding: 0;
    margin: 0 auto;
    max-width: 900px;

    /* Default: 2 columns on normal screens */
    columns: 2;
    column-gap: 40px;
}

.library-list li {
    break-inside: avoid;
    margin: 10px 0;
}

.library-list a {
    font-size: 1.25rem;
    color: #4a3a2a;
    text-decoration: none;
    border-bottom: 1px solid #c8b79a;
    padding-bottom: 4px;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.library-list a:hover {
    color: #7A4E2D;
    border-color: #7A4E2D;
}

/* Large screens: expand to 3 columns */
@media (min-width: 1200px) {
    .library-list {
        columns: 3;
    }
}

/* Mobile: collapse to 1 column */
@media (max-width: 600px) {
    .library-list {
        columns: 1;
    }
}

/* ---------------------------------------------------------
   MOBILE TWEAKS (max-width: 600px)
---------------------------------------------------------- */
@media (max-width: 600px) {
    header {
        padding: 20px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    header h2 {
        font-size: 1.2rem;
    }

    .content {
        margin: 20px auto;
        padding: 0 15px;
    }

    .nav-buttons,
    .story-grid {
        grid-template-columns: 1fr;
    }

    .controls {
        padding: 15px;
    }

    .controls button {
        width: 100%;
        font-size: 1.2rem;
        padding: 12px;
    }

    .breadcrumb {
        font-size: 1.1rem;
    }

    .tree-container {
        padding: 10px;
    }

    .family-unit {
        width: 100%;
        box-sizing: border-box;
    }

    .children-container {
        margin-left: 0;
    }

    .generation h3 {
        text-align: center;
    }

    iframe {
        height: 700px;
    }
}
