/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Charter, 'Bitstream Charter', 'Sitka Text', Cambria, Georgia, serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5fae3;
    margin: 0;
    padding: 0;
}

/* Header and Navigation */
header {
    background-color: transparent;
    padding: 2rem 0 1rem 0;
    text-align: center;
}

nav {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    position: relative;
}

nav a {
    color: #8b4513;
    text-decoration: none;
    font-weight: 400;
    font-size: 1rem;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #a0522d;
}

/* Dropdown navigation */
.dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f5fae3;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    border: 1px solid #8b4513;
    z-index: 1;
    top: 100%;
    padding-top: 0.5rem;
    margin-top: 0;
}

.dropdown-content a {
    color: #8b4513;
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: block;
    border-bottom: 1px solid #e9ecef;
    white-space: nowrap;
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: #fff;
    color: #a0522d;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Create an invisible bridge to prevent gap when hovering */
.dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 0.5rem;
    background: transparent;
}

/* Banner image */
.banner-image {
    text-align: center;
    margin: 2rem auto;
    max-width: 600px;
}

.banner-image img {
    width: 100%;
    height: auto;
    max-width: 600px;
    border: 1px solid #dee2e6;
}

/* Main content */
main {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: #fff;
    border: 1px solid #add8e6;
    border-radius: 0;
    box-shadow: none;
}

/* Button row on home page */
.button-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0 1.5rem 0;
}

.button-row .button {
    display: inline-block;
    background-color: #8b4513;
    color: #f5fae3;
    padding: 0.6rem 1.25rem;
    border: 2px solid #654321;
    border-radius: 0;
    font-size: 1rem;
    font-family: Georgia, 'Times New Roman', serif;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.button-row .button:hover {
    background-color: #a0522d;
    border-color: #8b4513;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.15);
}

/* Typography */
h1 {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #333;
    text-align: center;
    font-weight: normal;
}

/* Override h1 styles for bookshelf title */
.bookshelf-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
    text-align: left !important;
    font-size: 3rem !important;
    font-weight: 700 !important;
}

h1 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

h1 a:hover {
    color: #8b4513;
}

h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem 0;
    color: #333;
    font-weight: normal;
}

h3 {
    font-size: 1.2rem;
    margin: 1.5rem 0 0.5rem 0;
    color: #333;
    font-weight: normal;
}

p {
    margin-bottom: 1rem;
}

/* Blog specific styles */
.blog-post h1 {
    font-size: 2rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.blog-post .meta {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    font-style: italic;
}

/* Code blocks */
pre {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

pre code {
    background-color: transparent;
    padding: 0;
}

/* Links */
a {
    color: #8b4513;
    text-decoration: none;
}

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

/* Lists */
ul, ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Blockquotes */
blockquote {
    border-left: 4px solid #3498db;
    margin: 1rem 0;
    padding-left: 1rem;
    color: #555;
    font-style: italic;
}

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

th, td {
    border: 1px solid #ddd;
    padding: 0.5rem;
    text-align: left;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Footer */
footer {
    background-color: transparent;
    color: #666;
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

footer a {
    color: #8b4513;
    text-decoration: none;
    margin: 0 0.5rem;
}

footer a:hover {
    color: #a0522d;
}

/* Contact form styles */
.contact-form {
    max-width: 600px;
    margin: 2rem auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

input, textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

button {
    background-color: #3498db;
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #2980b9;
}

/* Newsletter signup */
.newsletter-signup {
    background-color: #f8f9fa;
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
    text-align: center;
}

.newsletter-signup h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.newsletter-form {
    display: flex;
    gap: 1rem;
    max-width: 400px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
}

/* Bookshelf page specific styles */
.bookshelf-main {
    background-color: #fafafa;
    border: none;
    padding: 0;
    max-width: 100%;
    margin: 0;
}

.bookshelf-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Bookshelf header */
.bookshelf-header {
    margin-bottom: 2rem;
}

.library-label {
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.bookshelf-title {
    font-size: 3rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 0.75rem 0;
    text-align: left;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.bookshelf-description {
    font-size: 1rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
    font-weight: 400;
}

/* Bookshelf tabs */
.bookshelf-tabs {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    border-bottom: none;
}

.tab-button {
    background: none;
    border: none;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    position: relative;
    transition: color 0.2s ease;
}

.tab-button:hover {
    color: #333;
}

.tab-button.active {
    color: #333;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #ff6600;
    width: calc(100% + 0.5rem);
    margin-left: -0.25rem;
}

/* Bookshelf content */
.bookshelf-content {
    margin-top: 2rem;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Books row */
.books-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 1rem 1rem 2rem 1rem;
}

/* Book item */
.book-item {
    flex: 0 0 auto;
    width: 180px;
}

.book-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.book-cover-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 0.65;
    margin-bottom: 0.75rem;
    background-color: #e0e0e0;
    overflow: visible;
    border-radius: 2px 6px 6px 2px;
    transition: transform 0.1s ease-out, box-shadow 0.1s ease-out;
    /* Hardcover book shadow effect */
    box-shadow: inset 1px 1px 0 1px rgba(255,255,255,0.2), 
                inset 0 0 0 1px rgba(0,0,0,0.1), 
                -4px 2px 4px 0 rgba(0,0,0,0.3), 
                -8px 8px 20px 0 rgba(0,0,0,0.2);
}

/* Book spine effect */
.book-cover-wrapper::before {
    content: "";
    background-image: linear-gradient(to right, 
        rgba(0,0,0,0.2), 
        rgba(255,255,255,0.3) 1%, 
        transparent 6%, 
        rgba(0,0,0,0.15) 8%, 
        rgba(255,255,255,0.2) 9%, 
        transparent 20%);
    width: 100%;
    position: absolute;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
    border-radius: 2px 6px 6px 2px;
}

.book-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 2px 6px 6px 2px;
    position: relative;
    z-index: 0;
}

/* Hover effect - lift and scale the book */
.book-item:hover .book-cover-wrapper {
    transform: translateY(-4px) scale(1.03);
    box-shadow: inset 1px 1px 0 1px rgba(255,255,255,0.2), 
                inset 0 0 0 1px rgba(0,0,0,0.1), 
                -4px 4px 8px 0 rgba(0,0,0,0.3), 
                -12px 16px 30px 0 rgba(0,0,0,0.3);
}

.book-status-label {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #333;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    z-index: 2;
}

.book-info {
    text-align: left;
}

.book-name {
    font-size: 0.9375rem;
    color: #333;
    font-weight: 400;
    margin-bottom: 0.25rem;
    line-height: 1.4;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.book-author-name {
    font-size: 0.875rem;
    color: #999;
    font-weight: 400;
    line-height: 1.4;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Responsive design */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .dropdown {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .dropdown > a {
        text-align: center;
    }
    
    .dropdown-content {
        left: 50%;
        transform: translateX(-50%);
    }
    
    main {
        padding: 0 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .bookshelf-wrapper {
        padding: 2rem 1rem;
    }
    
    .bookshelf-title {
        font-size: 2rem;
    }
    
    .bookshelf-tabs {
        gap: 1.5rem;
    }
    
    .book-item {
        width: 150px;
    }
}
