/* ========================================
   Appian Way Press - Academic Publisher Design
   Modern, Light, Airy, Sophisticated
   ======================================== */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;0,700;1,400&family=Lato:wght@300;400;700&display=swap');

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Crimson Text', Georgia, 'Times New Roman', serif;
    line-height: 1.8;
    color: #2a2a2a;
    background-color: #faf8f5;
    font-size: 18px;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 30px;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: 'Lato', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

h2 {
    font-size: 2.5rem;
    color: #1a1a1a;
    margin-bottom: 2rem;
    font-weight: 300;
    letter-spacing: -0.03em;
}

h3 {
    font-size: 1.75rem;
    color: #2a2a2a;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 400;
}

h4 {
    font-size: 1.35rem;
    color: #2a2a2a;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Links */
a {
    color: #8b6f47;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #6b5537;
}

/* Header */
header {
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    color: #faf8f5;
    padding: 2rem 0 1.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border-bottom: 1px solid #8b6f47;
}

header .container {
    display: flex;
    flex-direction: column;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.header-left {
    flex: 1;
}

.header-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

header h1 {
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

header h1 a {
    color: #faf8f5;
    transition: color 0.3s ease;
}

header h1 a:hover {
    color: #d4c5a9;
}

header nav {
    margin-top: 0.5rem;
    font-family: 'Lato', sans-serif;
}

header nav a {
    color: #d4c5a9;
    margin-right: 2rem;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 400;
    transition: color 0.3s ease;
}

header nav a:hover {
    color: #faf8f5;
}

/* Search Box */
.search-form {
    width: 100%;
    max-width: 400px;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 0.6rem 3rem 0.6rem 1rem;
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    border: 1px solid #8b6f47;
    border-radius: 4px;
    background-color: rgba(250, 248, 245, 0.95);
    color: #2a2a2a;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #d4c5a9;
    background-color: #faf8f5;
    box-shadow: 0 0 0 2px rgba(212, 197, 169, 0.2);
}

.search-input::placeholder {
    color: #8b6f47;
    opacity: 0.7;
}

.search-button {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    color: #8b6f47;
    cursor: pointer;
    padding: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.search-button:hover {
    color: #6b5537;
}

.search-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    padding: 0;
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    background-color: #ffffff;
    border: 1px solid #d4c5a9;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    pointer-events: auto;
    display: none;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.autocomplete-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.autocomplete-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background-color: #f8f6f3;
}

.autocomplete-item:active {
    background-color: #f0ede8;
}

.autocomplete-text {
    color: #2a2a2a;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autocomplete-type {
    color: #8b6f47;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-left: 1rem;
    flex-shrink: 0;
}

/* Search Results */
.search-results {
    background-color: #faf8f5;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 2px;
    border: 1px solid #e8e4dc;
    display: none;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e8e4dc;
}

.search-results-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #2a2a2a;
}

.close-results {
    background: none;
    border: none;
    font-size: 2rem;
    color: #8b6f47;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
    line-height: 1;
}

.close-results:hover {
    color: #6b5537;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .header-left,
    .header-right {
        flex: none;
        width: 100%;
    }
    
    .header-right {
        justify-content: stretch;
        margin-top: 1rem;
    }
    
    .search-form {
        max-width: none;
    }
}

/* Main Content */
main {
    background-color: #ffffff;
    margin: 3rem auto;
    padding: 3.5rem 4rem;
    border-radius: 2px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    min-height: 60vh;
}

/* Home Page */
.hero {
    text-align: center;
    padding: 3rem 0 2.5rem;
    margin-bottom: 3rem;
    border-bottom: 1px solid #e8e4dc;
}

.hero h2 {
    font-size: 2.75rem;
    font-weight: 300;
    color: #1a1a1a;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero p {
    text-align: left;
    font-size: 1.2rem;
    color: #5a5a5a;
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.7;
}

.highlight-section {
    text-align: center;
    margin-bottom: 3.5rem;
    padding-top: 1rem;
}

.highlight-section h3 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    color: #2a2a2a;
}

.links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background-color: #8b6f47;
    color: #ffffff !important;
    border-radius: 2px;
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(139, 111, 71, 0.2);
}

.cta-button:hover {
    background-color: #6b5537;
    box-shadow: 0 4px 12px rgba(139, 111, 71, 0.3);
    transform: translateY(-1px);
}

.featured-books {
    margin-top: 3rem;
}

.featured-books h3 {
    font-size: 1.75rem;
    font-weight: 400;
    text-align: center;
    margin-bottom: 2rem;
    color: #2a2a2a;
}

/* Book Display Styles */
.book-list {
    list-style: none;
}

.book-item {
    margin-bottom: 2.5rem;
    padding: 0;
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 2rem;
    align-items: start;
}

.book-item .book-cover {
    width: 160px;
    height: auto;
    border-radius: 2px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-item .book-cover:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}

.book-item-search {
    margin-bottom: 2.5rem;
    padding: 0;
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 2rem;
    align-items: start;
}

.book-item-search .book-cover-search {
    width: 80px;
    height: auto;
    border-radius: 2px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-item-search .book-cover-search:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.18);
}

.book-item .book-info {
    flex: 1;
}

.book-item h3 a,
.book-item h4 a {
    color: #2a2a2a;
    transition: color 0.3s ease;
}

.book-item h3 a:hover,
.book-item h4 a:hover {
    color: #8b6f47;
}

.book-item .author {
    color: #5a5a5a;
    font-style: italic;
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
    font-weight: 400;
}

.book-item .description {
    margin-bottom: 1rem;
    line-height: 1.75;
    color: #3a3a3a;
}

.formats-summary {
    color: #8b6f47;
    font-size: 0.95rem;
    font-family: 'Lato', sans-serif;
    margin-top: 0.75rem;
    font-weight: 400;
}

/* Book Detail Page */
.book-detail {
    max-width: 900px;
    margin: 0 auto;
}

.book-detail-header {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
    padding-top: 18pt;
    align-items: start;
}

.book-detail-cover {
    width: 100%;
    height: auto;
    border-radius: 2px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.book-detail-info h2 {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.book-detail-info .author {
    color: #5a5a5a;
    font-style: italic;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.quick-buy-links {
    margin-top: 1.5rem;
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    color: #2a2a2a;
    line-height: 1.8;
}

.quick-buy-links a {
    color: #8b6f47;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 2px;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.quick-buy-links a:hover {
    color: #6b5537;
    background-color: #f2ede7;
}

.quick-buy-links strong {
    color: #2a2a2a;
    font-weight: 700;
}

.description {
    margin-bottom: 2.5rem;
    line-height: 1.8;
    font-size: 1.05rem;
    color: #3a3a3a;
}

.formats {
    background-color: #faf8f5;
    padding: 2rem;
    border-radius: 2px;
    margin-bottom: 2.5rem;
    border: 1px solid #e8e4dc;
}

.formats h3 {
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-weight: 600;
    color: #2a2a2a;
}

.format-list {
    list-style: none;
}

.format-list .format {
    margin-bottom: 1.25rem;
    padding: 1.25rem;
    background-color: #ffffff;
    border-radius: 2px;
    border-left: 3px solid #8b6f47;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    font-family: 'Lato', sans-serif;
}

.format strong {
    color: #2a2a2a;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.format a {
    color: #8b6f47;
    font-weight: 600;
    transition: color 0.3s ease;
}

.format a:hover {
    color: #6b5537;
}

.asin {
    color: #999;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

/* Series Pages */
.series-detail {
    max-width: 900px;
    margin: 0 auto;
}

.series-link {
    margin-bottom: 3rem;
    text-align: center;
}

.amazon-link {
    display: inline-block;
    padding: 1rem 2.5rem;
    background-color: #8b6f47;
    color: #ffffff !important;
    border-radius: 2px;
    font-family: 'Lato', sans-serif;
    font-weight: 400;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(139, 111, 71, 0.2);
}

.amazon-link:hover {
    background-color: #6b5537;
    box-shadow: 0 4px 12px rgba(139, 111, 71, 0.3);
    transform: translateY(-1px);
}

.series-items {
    list-style: none;
}

.series-item {
    margin-bottom: 2.5rem;
    padding: 2rem;
    background-color: #faf8f5;
    border-radius: 2px;
    border-left: 4px solid #8b6f47;
    transition: all 0.3s ease;
}

.series-item:hover {
    background-color: #f5f2eb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.series-item h3 a {
    color: #2a2a2a;
}

.book-count {
    color: #8b6f47;
    margin-bottom: 1rem;
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
}

/* Navigation */
.navigation {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e8e4dc;
}

.back-link {
    color: #8b6f47;
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.back-link:hover {
    color: #6b5537;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    color: #d4c5a9;
    padding: 2.5rem 0;
    text-align: center;
    margin-top: 4rem;
    border-top: 1px solid #8b6f47;
    font-family: 'Lato', sans-serif;
}

footer p {
    margin: 0;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }
    
    .container {
        padding: 0 20px;
    }
    
    main {
        padding: 2rem 1.5rem;
        margin: 1.5rem auto;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    header nav a {
        display: block;
        margin-bottom: 0.75rem;
        margin-right: 0;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    h3 {
        font-size: 1.4rem;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1.05rem;
    }
    
    .links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .book-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .book-item .book-cover {
        width: 120px;
        margin: 0 auto;
    }
    
    .book-detail-header {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .book-detail-cover {
        max-width: 280px;
        margin: 0 auto;
        display: block;
    }
    
    .book-detail-info h2 {
        font-size: 1.75rem;
    }
}
