/* === Reset & Variables === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --cream:    #FBF7F2;
    --dark:     #1C1008;
    --accent:   #8B1A1A;
    --accent-h: #A52832;
    --text:     #2C2318;
    --muted:    #6B5E52;
    --border:   #DDD5C8;
    --radius:   6px;
    --serif:    Georgia, 'Times New Roman', serif;
    --sans:     -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --max-w:    960px;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    background: var(--cream);
    color: var(--text);
    line-height: 1.7;
}

/* === Layout === */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.section    { padding: 80px 0; }
.bg-cream   { background: var(--cream); }
.bg-dark    { background: var(--dark); color: #F5E6D3; }

/* === Navbar === */
.navbar {
    position: sticky; top: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 32px;
    background: var(--cream);
    border-bottom: 1px solid var(--border);
}
.nav-brand {
    font-family: var(--serif);
    font-size: 1.05rem; font-weight: bold;
    color: var(--accent); letter-spacing: .02em;
}

/* === Buttons === */
.btn-primary {
    display: inline-block;
    background: var(--accent); color: #fff;
    padding: 14px 32px; border-radius: var(--radius);
    font-size: 1rem; font-weight: 600;
    text-decoration: none; border: none; cursor: pointer;
    transition: background .2s;
}
.btn-primary:hover { background: var(--accent-h); }

.btn-outline {
    display: inline-block;
    border: 2px solid var(--accent); color: var(--accent);
    padding: 8px 20px; border-radius: var(--radius);
    font-size: .875rem; font-weight: 600;
    text-decoration: none;
    transition: background .2s, color .2s;
}
.btn-outline:hover { background: var(--accent); color: #fff; }

/* === Eyebrow label === */
.eyebrow {
    text-transform: uppercase; letter-spacing: .12em;
    font-size: .72rem; font-weight: 600;
    color: var(--accent); margin-bottom: 10px;
}
.bg-dark .eyebrow { color: #D4967A; }

/* === Headings === */
h1, h2 { font-family: var(--serif); line-height: 1.2; }
h1 { font-size: 3rem; color: var(--dark); margin-bottom: 12px; }
h2 { font-size: 2rem; color: var(--dark); margin-bottom: 24px; }
.bg-dark h2 { color: #F5E6D3; }

/* === Hero === */
.hero {
    padding: 80px 0;
    background: linear-gradient(to bottom, #FBF7F2, #EFE7DC);
}
.hero-inner {
    display: flex; align-items: center; gap: 64px;
}

/* === Lightbox === */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,.88);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: lb-in .2s ease;
}
.lightbox[hidden] { display: none; }

@keyframes lb-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lightbox img {
    max-width: min(90vw, 560px);
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
    cursor: default;
    animation: lb-scale .2s ease;
}

@keyframes lb-scale {
    from { transform: scale(.94); }
    to   { transform: scale(1); }
}

.lightbox-close {
    position: absolute;
    top: 20px; right: 24px;
    background: none; border: none;
    color: #fff; font-size: 1.6rem;
    cursor: pointer; line-height: 1;
    opacity: .7; transition: opacity .15s;
}
.lightbox-close:hover { opacity: 1; }

/* Real book cover photo */
.cover-img {
    width: 240px;
    display: block;
    border-radius: 3px 8px 8px 3px;
    box-shadow: 6px 6px 18px rgba(0,0,0,.22), 12px 16px 40px rgba(0,0,0,.28);
    transform: perspective(600px) rotateY(-4deg);
    transition: transform .3s, box-shadow .3s;
    cursor: zoom-in;
}
.cover-img:hover {
    transform: perspective(600px) rotateY(0deg);
    box-shadow: 8px 10px 28px rgba(0,0,0,.32), 16px 20px 50px rgba(0,0,0,.3);
}

/* Author photo */
.author-img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 3px solid rgba(255,255,255,.2);
    display: block;
}

/* Book cover placeholder */
.cover-placeholder {
    width: 220px; height: 330px;
    background: linear-gradient(108deg, #5C1515 0%, #8B1A1A 10%, #A52832 100%);
    border-radius: 2px 8px 8px 2px;
    box-shadow: inset -4px 0 8px rgba(0,0,0,.25), 8px 14px 32px rgba(0,0,0,.38);
    display: flex; overflow: hidden; flex-shrink: 0;
}
.cover-spine {
    width: 18px;
    background: rgba(0,0,0,.28);
    border-radius: 2px 0 0 2px;
    flex-shrink: 0;
}
.cover-body {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 24px 16px; text-align: center;
    color: #F5E6D3;
}
.cover-title {
    font-family: var(--serif);
    font-size: 1.1rem; font-weight: bold;
    line-height: 1.4; margin-bottom: 18px;
}
.cover-rule {
    width: 36px; height: 1px;
    background: rgba(245,230,211,.45);
    margin-bottom: 18px;
}
.cover-author { font-size: .78rem; opacity: .82; letter-spacing: .04em; }

/* Hero text */
.hero-byline { color: var(--muted); font-size: 1.05rem; margin-bottom: 20px; }
.hero-price  {
    font-size: 1.35rem; font-weight: 700;
    color: var(--text); margin-bottom: 32px;
}
.price-note { font-size: .88rem; font-weight: 400; color: var(--muted); }

/* === About book === */
.about-grid {
    display: flex;
    gap: 56px;
    align-items: flex-start;
}
.prose-col { flex: 1; min-width: 0; }
.back-cover-col {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.back-cover-img {
    width: 260px;
    border-radius: 3px 8px 8px 3px;
    box-shadow: 4px 6px 20px rgba(0,0,0,.18);
    cursor: zoom-in;
    transition: transform .2s, box-shadow .2s;
}
.back-cover-img:hover {
    transform: scale(1.03);
    box-shadow: 6px 10px 28px rgba(0,0,0,.26);
}
.cover-caption {
    font-size: .78rem;
    color: var(--muted);
    text-align: center;
}

.prose p { font-size: 1.05rem; max-width: 660px; margin-bottom: 16px; color: var(--text); }

.prose blockquote {
    border-left: 3px solid var(--accent);
    margin: 0 0 28px 0;
    padding: 12px 0 12px 24px;
    max-width: 660px;
    font-family: var(--serif);
    font-size: 1.08rem;
    font-style: italic;
    color: var(--muted);
    line-height: 1.75;
}

.prose .attribution {
    font-size: .9rem;
    color: var(--muted);
    font-style: italic;
    margin-top: -8px;
}

/* === Author === */
.author-grid { display: flex; align-items: flex-start; gap: 48px; }
.photo-placeholder {
    width: 160px; height: 160px; border-radius: 50%;
    background: rgba(255,255,255,.1);
    border: 2px solid rgba(255,255,255,.18);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--serif); font-size: 2rem;
    color: rgba(255,255,255,.55);
    flex-shrink: 0;
}
.author-info p { color: rgba(245,230,211,.82); font-size: 1.05rem; max-width: 560px; margin-bottom: 14px; }

/* === Order form === */
.order-note { color: var(--muted); font-size: 1rem; margin-bottom: 36px; }

.order-form { max-width: 560px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.form-group { margin-bottom: 20px; }
.form-group label {
    display: block; font-size: .875rem; font-weight: 600;
    color: var(--text); margin-bottom: 6px;
}
.label-optional { font-weight: 400; color: var(--muted); }

.form-group input,
.form-group textarea {
    width: 100%; padding: 12px 14px;
    border: 1.5px solid var(--border); border-radius: var(--radius);
    font-size: .95rem; font-family: var(--sans);
    background: #fff; color: var(--text);
    transition: border-color .18s;
}
.form-group input:focus,
.form-group textarea:focus { outline: none; border-color: var(--accent); }
.form-group textarea { resize: vertical; }

/* Quantity */
.qty-group { max-width: 200px; }
.qty-control { display: flex; }
.qty-control input {
    width: 56px; text-align: center;
    border-radius: 0; border-left: none; border-right: none;
}
.qty-btn {
    width: 40px; height: 44px;
    border: 1.5px solid var(--border);
    background: #fff; cursor: pointer;
    font-size: 1.2rem; color: var(--text);
    display: flex; align-items: center; justify-content: center;
    transition: background .15s;
}
.qty-btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.qty-btn:last-child  { border-radius: 0 var(--radius) var(--radius) 0; }
.qty-btn:hover { background: #EDE7DF; }

.btn-submit { width: 100%; padding: 16px; font-size: 1rem; margin-top: 8px; }
.btn-submit:disabled { opacity: .65; cursor: not-allowed; }

/* Messages */
.form-msg {
    margin-top: 20px; padding: 14px 18px;
    border-radius: var(--radius); font-size: .93rem; font-weight: 500;
}
.form-msg.success { background: #EBF7EC; color: #1A5C20; border: 1px solid #A8DDB5; }
.form-msg.error   { background: #FDEDED; color: #7B1919; border: 1px solid #F5C2C2; }

/* === Footer === */
.footer {
    background: var(--dark);
    color: rgba(255,255,255,.4);
    text-align: center; padding: 28px;
    font-size: .83rem;
}

/* === Responsive === */
@media (max-width: 680px) {
    .navbar { padding: 14px 20px; }
    .hero-inner { flex-direction: column; gap: 36px; text-align: center; }
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.6rem; }
    .cover-placeholder { width: 180px; height: 270px; }
    .cover-img { width: 180px; }
    .about-grid { flex-direction: column-reverse; }
    .back-cover-img { width: 200px; }
    .author-grid { flex-direction: column; align-items: center; text-align: center; }
    .form-row { grid-template-columns: 1fr; }
    .qty-group { max-width: 100%; }
    .section { padding: 56px 0; }
}
