/* ============================================
   SEBASTIAN DEAN - SITE STYLES v2
   Paper-and-ink bookstore. One accent: the
   spectrum hairline lifted from the logo.
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--ink-soft);
    background-color: var(--paper);
    line-height: 1.65;
    overflow-x: hidden;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--stone); }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--ink);
    line-height: 1.15;
}

h1 { font-size: 38px; letter-spacing: -0.01em; }
h2 { font-size: 26px; }
h3 { font-size: 20px; }

p { margin-bottom: 12px; }

img { max-width: 100%; height: auto; display: block; }

:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

/* THE SIGNATURE: spectrum hairline */
.spectrum-rule { height: 2px; background: var(--spectrum); }

/* Eyebrow labels - echo the letterspaced logo subtitle */
.eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--stone);
    margin-bottom: 10px;
}

/* LAYOUT */
#wrapper { display: flex; flex-direction: column; min-height: 100vh; }

#content {
    flex: 1;
    padding: 44px 24px 80px;
    max-width: 1120px;
    margin: 0 auto;
    width: 100%;
}

/* ============ HEADER ============ */
#header {
    background-color: var(--paper);
    width: 100%;
}

.header-bar {
    max-width: 1120px;
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.brand { display: block; flex-shrink: 0; }
.brand img {
    width: 230px;
    height: auto;
    /* the logo png ships with its own near-cream background;
       multiply blends it invisibly into the page */
    mix-blend-mode: multiply;
}

#navigation { margin-left: auto; }

.menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
}

.menu a {
    display: block;
    padding: 10px 13px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    position: relative;
}

.menu a::after {
    content: "";
    position: absolute;
    left: 13px; right: 13px; bottom: 4px;
    height: 2px;
    background: var(--spectrum);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.22s ease;
}
.menu a:hover { color: var(--ink); }
.menu a:hover::after { transform: scaleX(1); }

.menu-cart a {
    border: 1px solid var(--ink);
    padding: 9px 16px;
    margin-left: 10px;
}
.menu-cart a::after { display: none; }
.menu-cart a:hover { background: var(--ink); color: var(--paper); }

/* ============ PAGE INTRO ============ */
.page-intro {
    max-width: 680px;
    margin: 0 0 40px;
}
.page-intro h1 { margin-bottom: 8px; }
.intro-copy { color: var(--stone); font-size: 15px; margin: 0; }
.intro-copy a { border-bottom: 1px solid var(--hairline); }

/* ============ CATALOG GRID ============ */
.row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    gap: 22px;
}

.book-card {
    background: var(--card);
    border: 1px solid var(--hairline);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.book-card:hover {
    border-color: #CFC5B6;
    box-shadow: 0 8px 22px rgba(33, 30, 29, 0.09);
}
.book-card::after {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 3px;
    background: var(--spectrum);
    transform: scaleX(0);
    transition: transform 0.25s ease;
}
.book-card:hover::after { transform: scaleX(1); }

.book-card-image-link {
    display: block;
    background: #EFE9E0;
    aspect-ratio: 2 / 3;
    overflow: hidden;
}
.book-card-image-link img { width: 100%; height: 100%; object-fit: cover; }

.book-card-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 4px;
}
.book-card-title { font-size: 18px; margin: 0; }
.book-card-title a:hover { color: var(--stone); }
.book-card-subtitle { font-size: 13px; color: var(--stone); flex: 1; margin: 0; }

.book-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--hairline);
}
.book-card-price { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--ink); }
.book-card-button {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink);
    border: 1px solid var(--ink);
    padding: 7px 12px;
    transition: all 0.18s ease;
}
.book-card-button:hover { background: var(--ink); color: var(--paper); }

.empty-state { text-align: center; color: var(--stone); padding: 48px 0; }

/* ============ BREADCRUMBS ============ */
.breadcrumbs { margin-bottom: 28px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; letter-spacing: 0.04em; color: var(--stone); }
.breadcrumbs li i,
.breadcrumbs li svg {
    font-size: 8px;
    margin-right: 8px;
    position: relative;
    top: -1px;
    color: #C9BFB1;
}
.breadcrumbs a { color: var(--stone); }
.breadcrumbs a:hover { color: var(--ink); }

/* ============ BOOK DETAIL ============ */
.book-detail {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 48px;
    align-items: start;
    background: var(--card);
    border: 1px solid var(--hairline);
    border-top: 3px solid;
    border-image: var(--spectrum) 1;
    border-image-slice: 3 1 1 1;
    padding: 40px;
}

.book-detail-media img {
    width: 100%;
    height: auto;
    border: 1px solid var(--hairline);
}

.book-title { font-size: 36px; margin-bottom: 6px; }
.book-subtitle {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 19px;
    font-weight: 500;
    color: var(--stone);
    margin-bottom: 20px;
}

/* Compact purchase row directly under the title */
.buy-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 20px;
    padding: 16px 0;
    border-top: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
    margin-bottom: 22px;
}
.book-price {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 600;
    color: var(--ink);
}
.btn-add-to-cart {
    display: inline-block;
    padding: 13px 32px;
    background-color: var(--ink);
    color: var(--paper);
    border: none;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.18s ease;
}
.btn-add-to-cart:hover { background-color: var(--stone); }
.buy-note { font-size: 12px; color: var(--stone); }

/* The preface, beside the cover */
.book-preface p {
    font-size: 15.5px;
    line-height: 1.85;
    color: var(--ink-soft);
}
.book-preface p:last-child { margin-bottom: 0; }

/* Details, under the cover */
.book-meta { margin-top: 22px; }
.book-meta > div {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--hairline);
    font-size: 13px;
}
.book-meta > div:last-child { border-bottom: none; }
.book-meta dt {
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--stone);
    align-self: center;
}
.book-meta dd { color: var(--ink); }

/* ============ RELATED BOOKS ============ */
.related-books { margin-top: 56px; }
.related-books h2 { font-size: 22px; margin-bottom: 6px; }
.related-books h2::after {
    content: "";
    display: block;
    width: 72px;
    height: 2px;
    background: var(--spectrum);
    margin-top: 10px;
}
.related-books-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    margin-top: 24px;
}
.related-book-link { display: block; }
.related-book-link img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border: 1px solid var(--hairline);
    margin-bottom: 10px;
    transition: box-shadow 0.2s ease;
}
.related-book-link:hover img { box-shadow: 0 8px 20px rgba(33,30,29,0.13); }
.related-book-title { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--ink); }
.related-book-link:hover .related-book-title { color: var(--stone); }

/* ============ PAGINATION ============ */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 52px;
}
.pagination a, .pagination .current, .pagination .ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    border: 1px solid var(--hairline);
    background: var(--card);
    transition: all 0.15s ease;
}
.pagination a:hover { border-color: var(--ink); }
.pagination .current { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pagination .ellipsis { border: none; background: transparent; color: var(--stone); }

/* ============ FORMS / BUTTONS (shared + legacy pages) ============ */
.btn, button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 22px;
    background-color: var(--ink);
    color: var(--paper);
    border: none;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.18s ease;
}
.btn:hover, button[type="submit"]:hover { background-color: var(--stone); color: var(--paper); }

.btn-quiet {
    display: inline-flex;
    align-items: center;
    padding: 11px 22px;
    border: 1px solid var(--ink);
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transition: all 0.18s ease;
}
.btn-quiet:hover { background: var(--ink); color: var(--paper); }

.form-group { margin-bottom: 16px; text-align: left; }
.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--stone);
    margin-bottom: 6px;
}
.form-control {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--hairline);
    background: var(--card);
    color: var(--ink);
    font-size: 14px;
    font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--ink); }

.error-message {
    color: #7C3B35;
    background: #F3E2DF;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 18px;
}
.success-message {
    color: #3E5C45;
    background: #E2ECE3;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 18px;
}

/* ============ CART ============ */
.cart-list { display: flex; flex-direction: column; }
.cart-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: var(--card);
    border: 1px solid var(--hairline);
    border-bottom: none;
    padding: 14px 18px;
}
.cart-list .cart-row:last-of-type { border-bottom: 1px solid var(--hairline); }
.cart-row img { width: 44px; height: 58px; object-fit: cover; }
.cart-row-thumb-empty { width: 44px; height: 58px; background: #EFE9E0; flex-shrink: 0; }
.cart-row-info { flex: 1; }
.cart-row-info b { font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--ink); }
.cart-row-info p { font-size: 12px; color: var(--stone); margin: 2px 0 0; }
.cart-remove {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--stone);
    border-bottom: 1px solid var(--stone);
}
.cart-remove:hover { color: var(--ink); border-color: var(--ink); }

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--ink);
    color: var(--paper);
    padding: 16px 18px;
    margin-top: 16px;
    font-family: var(--font-display);
    font-size: 18px;
}
.cart-actions { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }

/* ============ TABLES (download page) ============ */
table {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    border-collapse: collapse;
    background: var(--card);
    border: 1px solid var(--hairline);
}
table th {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--stone);
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--hairline);
}
table td { padding: 12px 16px; border-bottom: 1px solid var(--hairline); font-size: 14px; color: var(--ink); }
table tr:last-child td { border-bottom: none; }
table a { color: var(--ink); border-bottom: 1px solid var(--ink); }
table a:hover { color: var(--stone); border-color: var(--stone); }

/* ============ INFO PANELS (cancel / legal pages) ============ */
.panel {
    background: var(--card);
    border: 1px solid var(--hairline);
    padding: 32px 36px;
    max-width: 820px;
    line-height: 1.8;
}
.panel h3 { margin: 24px 0 8px; }
.panel h3:first-child { margin-top: 0; }
.panel ul, .panel ol { margin: 8px 0 16px 22px; }

.callout {
    border-left: 3px solid;
    border-image: var(--spectrum) 1;
    border-image-slice: 0 0 0 3;
    background: var(--paper);
    padding: 14px 18px;
    margin-top: 24px;
    font-size: 14px;
}

/* ============ FOOTER ============ */
#footer {
    background-color: var(--ink);
    color: var(--paper);
    padding: 0 0 48px;
    width: 100%;
    margin-top: 40px;
}
#footer::before {
    content: "";
    display: block;
    height: 3px;
    background: var(--spectrum);
    margin-bottom: 48px;
}
.footer-content {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 48px;
}
.footer-column h4 {
    color: var(--paper);
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.footer-blurb { font-size: 13px; color: #A79E96; margin-bottom: 14px; }
.footer-column ul { list-style: none; }
.footer-column li { margin-bottom: 9px; }
.footer-column a { color: #D8D1C8; font-size: 13px; }
.footer-column a:hover { color: var(--paper); }

.footer-subscribe form { display: flex; flex-direction: column; gap: 10px; max-width: 340px; }
.footer-subscribe input[type="text"],
.footer-subscribe input[type="email"] {
    padding: 11px 12px;
    border: 1px solid #3B3735;
    background: #2B2826;
    color: var(--paper);
    font-size: 13px;
    font-family: inherit;
}
.footer-subscribe input::placeholder { color: #8A827A; }
.footer-subscribe input:focus { outline: none; border-color: var(--paper); }
.footer-subscribe label { font-size: 12px; color: #A79E96; display: flex; align-items: center; gap: 8px; }
.footer-subscribe .btn { background: var(--paper); color: var(--ink); margin-top: 4px; }
.footer-subscribe .btn:hover { background: #D8D1C8; color: var(--ink); }
.footer-legal .copyright { font-size: 12px; color: #8A827A; margin-top: 16px; }

/* ============ UTILITY ============ */
.text-center { text-align: center; }
.img-fluid { max-width: 100%; height: auto; }

/* ============ RESPONSIVE ============ */
@media (max-width: 920px) {
    .book-detail { grid-template-columns: 260px 1fr; gap: 32px; padding: 28px; }
    .book-title { font-size: 30px; }
}

@media (max-width: 768px) {
    #content { padding: 28px 16px 60px; }
    .header-bar { justify-content: center; padding: 16px; }
    #navigation { margin-left: 0; }
    .menu { justify-content: center; }
    .book-detail { grid-template-columns: 1fr; }
    .book-detail-media { max-width: 300px; margin: 0 auto; width: 100%; }
    .row { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
    .footer-content { grid-template-columns: 1fr 1fr; gap: 32px; }
    h1 { font-size: 30px; }
}

@media (max-width: 480px) {
    .row { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .book-card-info { padding: 12px; }
    .book-card-title { font-size: 16px; }
    .footer-content { grid-template-columns: 1fr; }
    .related-books-grid { grid-template-columns: repeat(2, 1fr); }
    .menu a { padding: 9px 9px; letter-spacing: 0.1em; }
    h1 { font-size: 26px; }
    .book-detail { padding: 20px; }
}

/* ============ FONT AWESOME ICON SPACING ============ */
.buy-note i, .menu-cart i, .btn i, .btn-quiet i, .btn-add-to-cart i,
.pagination i, .cart-remove i {
    margin-right: 6px;
    font-size: 0.9em;
}
.pagination .prev-next i { margin: 0 4px; }
.buy-note + .buy-note { margin-left: 6px; }

/* ============ BIOGRAPHY ============ */
.bio-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
    align-items: start;
}
.bio-photo {
    margin: 0;
    background: var(--card);
    border: 1px solid var(--hairline);
    padding: 16px;
}
.bio-photo img {
    width: 100%;
    height: auto;
    display: block;
    background: #EFE9E0;
    min-height: 280px;
    object-fit: cover;
}
.bio-photo figcaption {
    text-align: center;
    font-family: var(--font-display);
    font-size: 15px;
    color: var(--stone);
    padding-top: 12px;
}
.bio-text p { font-size: 15.5px; line-height: 1.85; }
@media (max-width: 768px) {
    .bio-layout { grid-template-columns: 1fr; }
    .bio-photo { max-width: 320px; margin: 0 auto; }
}

/* ============ RELATED BOOKS BUY ROW ============ */
.related-book-item { display: flex; flex-direction: column; }
.related-book-item .related-book-link { flex: 1; }
.related-book-buy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--hairline);
}
.related-book-price {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    color: var(--ink);
}
.related-add-btn {
    padding: 8px 12px;
    background-color: var(--ink);
    color: var(--paper);
    border: none;
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.18s ease;
    white-space: nowrap;
}
.related-add-btn:hover { background-color: var(--stone); }
.related-add-btn i, .related-add-btn svg { margin-right: 5px; font-size: 0.9em; }
@media (max-width: 480px) {
    .related-book-buy { flex-direction: column; align-items: stretch; text-align: center; }
}