/* main.css */

/* ─── Color theme — override Bootstrap primary ──────── */
:root {
    --header-height: 92px;
    --bs-primary: #5B7FA6;
    --bs-primary-rgb: 91, 127, 166;
    --bs-primary-bg-subtle: #e8f0f8;
    --bs-primary-border-subtle: #b8cfe3;
    --bs-primary-text-emphasis: #3d5a7a;
    --bs-link-color: #5B7FA6;
    --bs-link-color-rgb: 91, 127, 166;
    --bs-link-hover-color: #3d5a7a;
    --bs-link-hover-color-rgb: 61, 90, 122;
}

.btn-primary {
    --bs-btn-bg: #5B7FA6;
    --bs-btn-border-color: #5B7FA6;
    --bs-btn-hover-bg: #4a6d92;
    --bs-btn-hover-border-color: #4a6d92;
    --bs-btn-active-bg: #3d5a7a;
    --bs-btn-active-border-color: #3d5a7a;
    --bs-btn-disabled-bg: #5B7FA6;
    --bs-btn-disabled-border-color: #5B7FA6;
}

.btn-outline-primary {
    --bs-btn-color: #5B7FA6;
    --bs-btn-border-color: #5B7FA6;
    --bs-btn-hover-bg: #5B7FA6;
    --bs-btn-hover-border-color: #5B7FA6;
    --bs-btn-active-bg: #5B7FA6;
    --bs-btn-active-border-color: #5B7FA6;
}

/* ─── Base typography ───────────────────────────────── */
body {
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    line-height: 1.7;
    color: #333;
    font-feature-settings: "kern" 1, "liga" 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 2rem;   font-weight: 600; }
h3 { font-size: 1.5rem; font-weight: 600; }

p, .lead {
    line-height: 1.7;
    margin-bottom: 1rem;
}

.lead {
    font-size: 1.15rem;
    font-weight: 400;
}

/* UI chrome stays sans-serif for clarity */
.navbar, .btn, .form-control, .card-title,
input, textarea, select, .table, .badge,
.alert, .pagination, .dropdown-item {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

.navbar-brand {
    font-family: 'Lora', Georgia, serif;
    font-weight: 700;
    font-size: 1.1rem;
}

.btn {
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Post/article reading content */
.post-content, .content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.post-content h1, .post-content h2, .post-content h3,
.content h1, .content h2, .content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* Quotes */
blockquote, .blockquote {
    font-style: italic;
    font-size: 1.05rem;
}

.blockquote-footer {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-style: normal;
    font-size: 0.9rem;
}

/* ─── Header ─────────────────────────────────────────── */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #f4f4f4;
    padding: 1rem 0;
    z-index: 1030;
    transition: transform 0.3s ease-in-out;
    transform: translateY(0);
}

.header-hidden {
    transform: translateY(-100%);
}

.main-content {
    margin-top: var(--header-height);
}

/* Anchor scroll offset — compensate for fixed navbar */
[id] {
    scroll-margin-top: calc(var(--header-height) + 12px);
}

/* ─── Section backgrounds ────────────────────────────── */
.bg-warm {
    background-color: #FAF8F5;
}

/* ─── Cards ──────────────────────────────────────────── */
.card {
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.card:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.10);
    transform: translateY(-2px);
}

/* ─── Services pricing tables ───────────────────────── */
.price-table {
    table-layout: fixed;
    width: 100%;
}

.price-table th:nth-child(2),
.price-table td:nth-child(2) {
    width: 28%;
}

.price-table th:nth-child(3),
.price-table td:nth-child(3) {
    width: 26%;
}

/* ─── Search ─────────────────────────────────────────── */
.search-container {
    position: relative;
}

#search-form {
    display: flex;
    align-items: center;
}

#search-form input[type="text"] {
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 20px 0 0 20px;
    font-size: 14px;
}

#search-form button {
    background-color: #f8f9fa;
    border: 1px solid #ccc;
    border-left: none;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
    padding: 5px 10px;
}

#search-form button img {
    width: 20px;
    height: 20px;
}

.search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 100%;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
    margin-top: 5px;
}

.search-dropdown a {
    display: block;
    padding: 10px;
    text-decoration: none;
    color: #333;
    font-family: 'Inter', sans-serif;
}

.search-dropdown a:hover {
    background-color: #f8f9fa;
}

/* ─── Book page ──────────────────────────────────────── */

.book-cover {
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 2/3;
    background: #f8f8f8;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    transition: box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.book-cover:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.18);
    transform: translateY(-4px);
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-badge {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    padding: 5px 14px;
    border-radius: 40px;
    font-weight: 600;
}

.book-badge-gold {
    background: #fff8e1;
    color: #b7860b;
    border: 1px solid #f0c84a;
}

.book-badge-blue {
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
    border: 1px solid var(--bs-primary);
}

.book-highlight {
    font-size: 1.15rem;
    color: var(--bs-primary-text-emphasis);
    font-style: italic;
    margin: 0 0 1rem;
    padding-left: 1rem;
    border-left: 3px solid var(--bs-primary);
}

.book-can-do-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.95rem;
    color: #666;
    padding: 8px 0;
}

.book-can-do-item::before {
    content: '\2192';
    color: var(--bs-primary);
    font-weight: 700;
    flex-shrink: 0;
}

.book-manifest {
    background: #f8f8f8;
    border-radius: 12px;
    padding: 2rem;
}

.book-manifest-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.book-manifest-item {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.book-manifest-num {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.book-manifest-num.n1, .book-manifest-num.n4, .book-manifest-num.n7 { background: #f39c12; }
.book-manifest-num.n2, .book-manifest-num.n5, .book-manifest-num.n8 { background: #27ae60; }
.book-manifest-num.n3, .book-manifest-num.n6, .book-manifest-num.n9 { background: #c0392b; }

.book-manifest-footer {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-top: 1px solid #e0e0e0;
    padding-top: 1rem;
    margin-bottom: 0;
}

.book-review {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.25rem;
    height: 100%;
}

.book-review-text {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.75;
    margin-bottom: 0.75rem;
    font-style: italic;
}

.book-review-author {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
}

.book-review-role {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.8rem;
    color: #666;
}

.book-review-source {
    font-size: 0.8rem;
    color: var(--bs-primary-text-emphasis);
    text-decoration: none;
    border-bottom: 1px solid var(--bs-primary);
}

.book-livelib-link {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--bs-primary-text-emphasis);
    text-decoration: none;
    border-bottom: 1px solid var(--bs-primary);
}

.book-press-item {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: #1a1a1a;
    transition: border-color 0.2s;
}

.book-press-item:hover {
    border-color: var(--bs-primary);
    color: #1a1a1a;
}

.book-press-name {
    font-size: 0.875rem;
    font-weight: 700;
    min-width: 140px;
    flex-shrink: 0;
}

.book-press-title {
    font-size: 0.8rem;
    color: #666;
    flex: 1;
}

.book-press-arrow {
    font-size: 0.875rem;
    color: var(--bs-primary);
    flex-shrink: 0;
}

.book-store-btn {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    display: inline-block;
    padding: 8px 18px;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid #e0e0e0;
    color: #1a1a1a;
    background: #fff;
    transition: border-color 0.2s, color 0.2s;
}

.book-store-btn:hover {
    border-color: var(--bs-primary);
    color: var(--bs-primary-text-emphasis);
}

.book-store-btn-primary {
    background: var(--bs-primary);
    color: #fff;
    border-color: var(--bs-primary);
}

.book-store-btn-primary:hover {
    background: var(--bs-link-hover-color);
    color: #fff;
}

.book-stores-accordion {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.book-stores-accordion summary {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--bs-primary-text-emphasis);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.book-stores-accordion summary::-webkit-details-marker { display: none; }
.book-stores-accordion summary::after { content: '\2193'; }
.book-stores-accordion[open] summary::after { content: '\2191'; }

.book-country-heading {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #666;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.book-country-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.book-country-list li {
    padding: 2px 0;
}

.book-country-list a {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.8rem;
    color: var(--bs-primary-text-emphasis);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    display: inline-block;
    padding: 2px 0;
}

.book-country-list a:hover {
    border-bottom-color: var(--bs-primary);
}

/* ─── Footer ─────────────────────────────────────────── */

.footer-top {
    background: var(--bs-primary);
    padding: 1.5rem 0;
}

.footer-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-top-cta {
    font-family: 'Lora', Georgia, serif;
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
    margin: 0;
}

.footer-top-sub {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.75);
    margin: 4px 0 0;
}

.footer-btn {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    display: inline-block;
    background: #fff;
    color: var(--bs-primary-text-emphasis);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 20px;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.15s;
}

.footer-btn:hover {
    opacity: 0.85;
    color: var(--bs-primary-text-emphasis);
}

.footer-bottom {
    background: #f5f8fb;
    padding: 1.25rem 0;
}

.footer-bottom .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.footer-icons {
    display: flex;
    gap: 6px;
    align-items: center;
}

.footer-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    text-decoration: none;
    background: #e8f0f8;
    transition: opacity 0.15s;
}

.footer-icon-link:hover {
    opacity: 0.7;
}

.footer-icon-link svg {
    width: 18px;
    height: 18px;
}

.footer-rss {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e8f0f8;
    border-radius: 20px;
    padding: 0 12px 0 8px;
    height: 38px;
    text-decoration: none;
    transition: opacity 0.15s;
}

.footer-rss:hover {
    opacity: 0.7;
}

.footer-rss svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.footer-rss span {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--bs-primary);
}

.footer-legal {
    display: flex;
    gap: 1rem;
}

.footer-legal a {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.75rem;
    color: var(--bs-primary);
    text-decoration: none;
    padding: 0.5rem 0;
    display: inline-block;
}

.footer-legal a:hover {
    text-decoration: underline;
}

.footer-copy {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.75rem;
    color: #8fa8be;
    width: 100%;
    margin: 0;
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }

    .post-content, .content {
        font-size: 1rem;
    }

    .lead { font-size: 1rem; }

    .footer-top .container {
        text-align: center;
        flex-direction: column;
    }

    .footer-bottom .container {
        justify-content: center;
        text-align: center;
    }

    .footer-icons {
        justify-content: center;
        flex-wrap: wrap;
    }

    .footer-legal {
        justify-content: center;
    }

    .footer-copy {
        text-align: center;
    }

    .book-press-name {
        min-width: 0;
    }

    .book-press-item {
        gap: 0.5rem;
        padding: 0.6rem 0.75rem;
    }
}

/* Collapsed navbar adjustments */
@media (max-width: 991.98px) {
    .navbar-nav .btn-sm {
        padding: 0.5rem 0;
        font-size: 1rem;
        margin-left: 0 !important;
        width: 100%;
        text-align: left;
    }

    .navbar-nav {
        margin-bottom: 0.75rem;
    }

    #search-form {
        width: 100% !important;
    }
}

/* ─── Smooth scrolling ───────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}
