:root {
    --libby-teal: #00848E;
    --libby-berry: #A64686;
    --libby-bg: #FFFFFF;
    --tag-gray: #eeeff1;
    --text-dark: #111111;
    --text-light: #595b69;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--libby-bg);
    color: var(--text-dark);
    font-size: 14px; /* mobile-first base */
    margin: 0;
    padding: 0;
    padding-bottom: 80px; /* Space for sticky footer */
}

/* --- Header --- */
.header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    position: relative;
}

.libby-logo {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--libby-teal);
    display: flex;
    align-items: center;
    gap: 5px;
}

.libby-icon {
    width: 24px;
    height: 24px;
    background: #d63d48; /* Christmas Red for the icon background */
    border-radius: 50%;
    position: relative;
}

/* Little book icon inside the logo circle */
.libby-icon::after {
    content: "📖";
    font-size: 14px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
}

/* --- Layout Container & Card --- */
.container {
    max-width: 1200px;
    margin: 18px auto;
    padding: 0 20px;
}


/* --- Hero Section --- */
.hero {
    padding: 10px 0px;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.greeting {
    flex: 1;
    font-weight: 700;
    margin: 0;
}

.greeting .sub {
    display: block;
    color: var(--text-light);
    font-weight: 400;
    margin-bottom: 6px;
}

.avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background-color: #eee;
    background-image: url('family-photo.jpg'); /* REPLACE WITH YOUR FAMILY PHOTO */
    background-size: cover;
    background-position: center;
    position: absolute;
    right: 0px;
    top: -40px; /* overlap the top of the card */
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
    border: 1px solid #fff;
}

@media (min-width: 768px) {
    .avatar { width: 140px; height: 140px; top: -50px; }
}

.greeting {
    font-size: 1.3rem;
    font-weight: 300;
    line-height: 1.5;
    margin: 0;
    color: var(--text-light)
}

.greeting .sub {
    color: var(--text-dark);
    display: block;
    font-weight: 700;
}

@media (min-width: 768px) {
    .greeting { font-size: 1.6rem; }
}

/* --- Tags/Pills --- */
.tags {
    padding: 10px 0px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.pill {
    background-color: var(--tag-gray);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Roboto Slab', 'Times New Roman', Times, serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 2px rgba(0,0,0,0.04);
}

.pill.teal-icon {
    color: var(--libby-teal);
    background-color: #E6F3F4;
    box-shadow: 0 2px 2px rgba(0,132,142,0.08);
}

.count {
    color: var(--text-light);
    font-size: 0.8rem;
    margin-left: 6px;
}

.pill:focus, .pill:hover { transform: translateY(-2px); }

@media (min-width: 768px) {
    .pill { font-size: 1.2rem; }
    .pill.teal-icon { height: -webkit-fill-available; }
    .count { font-size: 1rem; }
}

/* ------- Content Section ------- */

/* --- Section Header --- */
.section-header {
    padding: 20px 0px 10px;
    position: relative;
}

.section-title {
    color: var(--libby-berry);
    font-family: 'Roboto Slab', 'Times New Roman', Times, serif;
    font-size: 1.2rem;
    font-weight: 500;
    border-bottom: 1px solid var(--libby-berry);
    margin: 0 0 5px 0;
    padding: 0 0 10px 0;
}

.section-link {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    cursor: pointer;
}
.section-link span {
    font-size: 2rem;
    margin: -4px 4px 0 4px;
}

/* --- Book Grid (mobile-first, colocated breakpoints) --- */
.book-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Mobile (small): 3 columns for compact thumbnails */
    gap: 20px;
    padding: 10px 0px;
    justify-items: center;
}

/* Different desktop layout of the content section */
@media (min-width: 768px) {
    .content-section {
        display: flex;
        flex-direction: row-reverse;
        margin-top: 40px;
    }
    .section-header {
        flex: 0 0 auto;
        width: 336px;
        padding-left: 0;
    }
    .section-content {
        flex-grow: 1;
        margin-right: 30px;
    }
}

/* Slightly larger text & spacing on small screens */
@media (min-width: 480px) {
    body { font-size: 15px; }
    .greeting h1 { font-size: 1.2rem; }
    .section-title { font-size: 1.25rem; }
    .book-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Tablet / small desktop: 4 columns (4x2 typical at mid widths) */
@media (min-width: 768px) {
    body { font-size: 15.5px; }
    .book-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Large desktop: 5 columns */
@media (min-width: 1280px) {
    body { font-size: 16px; }
    .book-grid { gap: 30px; }
}

.book-card {
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.1s;
}

.book-card:active { transform: scale(0.98); }

/* Book card visuals: white border, soft shadow, hover lift */
.book-card {
    background: #fff;
    border-radius: 1px;
    overflow: hidden;
    box-shadow: 4px 4px 0px rgba(0,0,0,0.6);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    display: block;
    width: 100%;
    aspect-ratio: 3/4;
}

.book-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 8px 8px rgba(0,0,0,0.6);
}

.book-card:active { transform: scale(0.98); }

.book-img {
    width: 100%;
    height: 100%;
    min-height: 129px;
    object-fit: cover;
    display: block;
}

@media (min-width: 768px) {
    .book-card {
        box-shadow: 8px 8px 0px rgba(0,0,0,0.6);
    }
}



/* --- Sticky Footer --- */
.footer-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-light);
    font-size: 0.7rem;
    cursor: pointer;
}

.nav-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    fill: currentColor;
}

/* --- Modal (Book Detail) --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 800px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    padding: 25px;
    text-align: center;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
}

.modal-cover {
    width: 100%;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    margin-bottom: 15px;
}

.modal-title {
    font-family: 'Roboto Slab', serif;
    font-size: 1.4rem;
    margin: 0 0 5px 0;
    color: var(--text-dark);
}

.modal-author {
    color: var(--text-light);
    margin-bottom: 20px;
}

.modal-desc {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #444;
    text-align: left;
    margin-bottom: 20px;
}

.action-btn {
    background-color: var(--libby-teal);
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

/* --- Bio Modal Styles --- */
.bio-details {
    text-align: left;
    margin-bottom: 15px;
}

.bio-info {
    font-size: 0.95rem;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.4;
}

.bio-info strong {
    color: var(--libby-berry);
}

/* --- Photo Modal Styles --- */
.photo-modal-content {
    background: transparent;
    box-shadow: none;
    padding: 0;
    width: 95%;
    max-width: 600px;
}

.full-photo {
    width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.photo-modal-content .close-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    z-index: 1001;
}

/* --- Photo Gallery Modal --- */
.gallery-modal-content {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    background: white;
    overflow-y: auto;
}

.gallery-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    justify-content: center;
}

.gallery-photo {
    max-width: 65vw;
    max-height: 55vh;
    object-fit: contain;
    border-radius: 6px;
}

.gallery-nav {
    background: var(--libby-teal);
    color: white;
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 50%;
    font-size: 18px;
    transition: background 0.2s;
}

.gallery-nav:hover {
    background: #005f66;
}

.gallery-thumbs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    max-width: 100%;
    padding: 10px 0;
    justify-content: center;
}

.thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 4px;
    transition: border-color 0.2s;
    flex-shrink: 0;
}

.thumb:hover {
    border-color: #ccc;
}

.thumb.active {
    border-color: var(--libby-teal);
}

/* --- Tooltip --- */
.tooltip {
    position: fixed;
    background: var(--libby-teal);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000;
}

.tooltip.show {
    opacity: 1;
    transform: scale(1);
}


