/* =============================================================
   Eve Geiger Author Site — Main Stylesheet
   Colors: Beige #ecd0a1 | Rust #e95930 | Brown #946659
   Fonts: DM Serif Display (headings) | Sora (body)
   ============================================================= */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --beige:       #ecd0a1;
    --beige-light: #f5e8d0;
    --beige-dark:  #d4b87a;
    --rust:        #e95930;
    --rust-dark:   #c94520;
    --brown:       #946659;
    --brown-dark:  #6b4940;
    --dark:        #171921;
    --charcoal:    #30333a;
    --white:       #ffffff;
    --off-white:   #fffaf8;
    --gray:        #dddddd;
    --gray-light:  #f2f5f7;
    --shadow-sm:   0 2px 8px rgba(0,0,0,.08);
    --shadow-md:   0 4px 20px rgba(0,0,0,.12);
    --shadow-lg:   0 8px 40px rgba(0,0,0,.16);
    --radius:      8px;
    --radius-lg:   14px;
    --transition:  .25s ease;
    --header-h:    72px;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'Sora', sans-serif;
    color: var(--dark);
    background: var(--off-white);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--rust); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--rust-dark); }

h1, h2, h3, h4, h5, h6 {
    font-family: 'DM Serif Display', serif;
    color: var(--dark);
    line-height: 1.25;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.8rem); }
h4 { font-size: 1.2rem; }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

ul { list-style: none; }

/* ---------- Helpers ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.text-center { text-align: center; }
.text-rust  { color: var(--rust); }
.text-brown { color: var(--brown); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-4 { margin-bottom: 2rem; }
.section { padding: 80px 0; }
.section-sm { padding: 50px 0; }

/* ---------- Skip Link ---------- */
.skip-link {
    position: absolute; top: -100px; left: 8px;
    background: var(--rust); color: var(--white);
    padding: 8px 16px; border-radius: 4px; z-index: 999;
    transition: top .2s;
}
.skip-link:focus { top: 8px; color: var(--white); }

/* ---------- Flash Messages ---------- */
.flash {
    padding: 14px 20px; border-radius: var(--radius);
    margin: 16px 0; font-size: .95rem; font-weight: 500;
}
.flash-success { background: #d4edda; color: #155724; border-left: 4px solid #28a745; }
.flash-error   { background: #f8d7da; color: #721c24; border-left: 4px solid #dc3545; }
.flash-info    { background: #d1ecf1; color: #0c5460; border-left: 4px solid #17a2b8; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 28px; border-radius: 40px;
    font-family: 'Sora', sans-serif; font-size: .9rem; font-weight: 600;
    cursor: pointer; border: 2px solid transparent;
    transition: all var(--transition); text-decoration: none;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--rust); color: var(--white); border-color: var(--rust); }
.btn-primary:hover { background: var(--rust-dark); border-color: var(--rust-dark); color: var(--white); }

.btn-secondary { background: var(--brown); color: var(--white); border-color: var(--brown); }
.btn-secondary:hover { background: var(--brown-dark); border-color: var(--brown-dark); color: var(--white); }

.btn-outline { background: transparent; color: var(--rust); border-color: var(--rust); }
.btn-outline:hover { background: var(--rust); color: var(--white); }

.btn-outline-white { background: transparent; color: var(--white); border-color: var(--white); }
.btn-outline-white:hover { background: var(--white); color: var(--rust); }

.btn-dark { background: var(--dark); color: var(--white); border-color: var(--dark); }
.btn-dark:hover { background: var(--charcoal); border-color: var(--charcoal); color: var(--white); }

.btn-sm { padding: 8px 20px; font-size: .82rem; }
.btn-lg { padding: 16px 36px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

.btn-danger { background: #dc3545; color: var(--white); border-color: #dc3545; }
.btn-danger:hover { background: #b02a37; border-color: #b02a37; color: var(--white); }

/* ---------- Top Banner ---------- */
.top-banner {
    background: var(--rust); color: var(--white);
    text-align: center; padding: 8px 16px;
    font-size: .85rem; font-weight: 500;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--beige);
    border-bottom: 1px solid var(--beige-dark);
    box-shadow: var(--shadow-sm);
    min-height: var(--header-h);
}

.header-inner {
    display: flex; align-items: center; gap: 24px;
    height: var(--header-h);
}

.site-logo {
    text-decoration: none; flex-shrink: 0;
}
.site-logo img { height: var(--logo-max-h, 56px); width: auto; object-fit: contain; }
.logo-text {
    font-family: 'DM Serif Display', serif;
    font-size: 1.6rem; color: var(--dark);
    letter-spacing: -.5px;
}
.logo-text:hover { color: var(--rust); }

.main-nav { flex: 1; }
.nav-list { display: flex; gap: 32px; align-items: center; }
.nav-list a {
    font-size: .9rem; font-weight: 500; color: var(--dark);
    letter-spacing: .3px; padding: 4px 0;
    position: relative;
}
.nav-list a::after {
    content: ''; position: absolute; bottom: -2px; left: 0;
    width: 0; height: 2px; background: var(--rust);
    transition: width var(--transition);
}
.nav-list a:hover, .nav-list a.active { color: var(--rust); }
.nav-list a:hover::after, .nav-list a.active::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }

/* Cart */
.cart-btn {
    position: relative; color: var(--dark);
    display: flex; align-items: center; padding: 4px;
}
.cart-btn:hover { color: var(--rust); }
.cart-count {
    position: absolute; top: -6px; right: -6px;
    background: var(--rust); color: var(--white);
    font-size: 11px; font-weight: 700;
    width: 18px; height: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}

/* Account Dropdown */
.account-menu { position: relative; }
.account-btn {
    display: flex; align-items: center; gap: 4px;
    background: none; border: none; cursor: pointer;
    font-family: 'Sora', sans-serif; font-size: .88rem; font-weight: 600;
    color: var(--dark); padding: 4px 8px; border-radius: 4px;
}
.account-btn:hover { color: var(--rust); }
.account-dropdown {
    position: absolute; right: 0; top: calc(100% + 8px);
    background: var(--white); border-radius: var(--radius);
    box-shadow: var(--shadow-md); min-width: 180px;
    border: 1px solid var(--gray);
    opacity: 0; pointer-events: none; transform: translateY(-8px);
    transition: all var(--transition);
}
.account-dropdown.open { opacity: 1; pointer-events: all; transform: translateY(0); }
.account-dropdown li a {
    display: block; padding: 10px 16px;
    font-size: .88rem; color: var(--dark);
}
.account-dropdown li a:hover { background: var(--beige-light); color: var(--rust); }
.dropdown-divider { height: 1px; background: var(--gray); margin: 4px 0; }

/* Hamburger */
.hamburger {
    display: none; flex-direction: column; gap: 5px;
    background: none; border: none; cursor: pointer;
    padding: 4px;
}
.hamburger span {
    display: block; width: 24px; height: 2px;
    background: var(--dark); border-radius: 2px;
    transition: all var(--transition);
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero / Banner ---------- */
.hero {
    background: var(--beige);
    padding: 100px 0 80px;
    position: relative; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(148,102,89,.15) 0%, transparent 60%);
}
.hero-inner {
    position: relative; display: grid;
    grid-template-columns: 1fr 1fr; gap: 60px; align-items: center;
}
.hero-subtitle {
    font-size: .85rem; font-weight: 600; letter-spacing: 2px;
    text-transform: uppercase; color: var(--brown);
    margin-bottom: 16px; display: block;
}
.hero-title { margin-bottom: 20px; }
.hero-description { font-size: 1.05rem; color: var(--charcoal); margin-bottom: 32px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-image { position: relative; }
.hero-image img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%; object-fit: cover;
}
.hero-image::after {
    content: ''; position: absolute;
    bottom: -16px; right: -16px; width: 80%; height: 80%;
    border: 3px solid var(--beige-dark); border-radius: var(--radius-lg);
    z-index: -1;
}

/* ---------- Section Headers ---------- */
.section-header { text-align: center; margin-bottom: 50px; }
.section-header h2 { margin-bottom: 12px; }
.section-header p { color: var(--charcoal); font-size: 1.05rem; max-width: 600px; margin: 0 auto; }
.section-label {
    display: inline-block; font-size: .8rem; font-weight: 700;
    letter-spacing: 2px; text-transform: uppercase;
    color: var(--rust); margin-bottom: 10px;
}

/* ---------- Book Cards ---------- */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 28px;
}

.book-card {
    background: var(--white); border-radius: var(--radius-lg);
    overflow: hidden; box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex; flex-direction: column;
}
.book-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.book-card-cover {
    position: relative; overflow: hidden;
    aspect-ratio: 2/3; background: var(--beige-light);
}
.book-card-cover img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform .4s ease;
}
.book-card:hover .book-card-cover img { transform: scale(1.04); }

.book-card-badge {
    position: absolute; top: 12px; left: 12px;
    background: var(--rust); color: var(--white);
    font-size: .72rem; font-weight: 700; letter-spacing: .5px;
    padding: 3px 10px; border-radius: 20px;
}

.book-card-body {
    padding: 18px 16px 20px; flex: 1;
    display: flex; flex-direction: column;
}
.book-card-title {
    font-family: 'DM Serif Display', serif;
    font-size: 1.05rem; color: var(--dark); margin-bottom: 4px;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.book-card-author { font-size: .82rem; color: var(--brown); margin-bottom: 12px; }
.book-card-footer {
    display: flex; align-items: center;
    justify-content: space-between; margin-top: auto;
}
.book-price { font-size: 1.05rem; font-weight: 700; color: var(--dark); }
.book-card-footer .btn { padding: 8px 16px; font-size: .8rem; }

.out-of-stock { opacity: .65; }
.out-of-stock .btn { pointer-events: none; background: var(--gray); border-color: var(--gray); color: var(--charcoal); }

/* ---------- Single Book Page ---------- */
.book-detail { padding: 60px 0; }
.book-detail-grid { display: grid; grid-template-columns: 320px 1fr; gap: 60px; align-items: start; }
.book-detail-cover img {
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    width: 100%;
}
.book-detail-meta { margin: 20px 0; display: flex; flex-direction: column; gap: 8px; }
.book-meta-item { display: flex; gap: 8px; font-size: .9rem; }
.book-meta-item strong { color: var(--brown); min-width: 80px; }
.book-detail-price { font-size: 2rem; font-weight: 700; color: var(--dark); margin: 20px 0 8px; }
.book-detail-actions { display: flex; gap: 12px; align-items: center; margin: 24px 0; flex-wrap: wrap; }
.qty-input { width: 70px; padding: 10px 12px; border: 2px solid var(--gray); border-radius: var(--radius); font-size: 1rem; text-align: center; }
.book-description { margin-top: 32px; padding-top: 32px; border-top: 1px solid var(--gray); }

/* ---------- Blog Cards ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 32px; }

.blog-card {
    background: var(--white); border-radius: var(--radius-lg);
    overflow: hidden; box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.blog-card-image { aspect-ratio: 16/9; overflow: hidden; background: var(--beige-light); }
.blog-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.blog-card:hover .blog-card-image img { transform: scale(1.04); }

.blog-card-body { padding: 22px; }
.blog-card-meta { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.blog-date { font-size: .8rem; color: var(--brown); }
.blog-author { font-size: .8rem; color: var(--charcoal); }
.blog-card-title { font-size: 1.15rem; margin-bottom: 10px; }
.blog-card-title a { color: var(--dark); }
.blog-card-title a:hover { color: var(--rust); }
.blog-card-excerpt { font-size: .9rem; color: var(--charcoal); margin-bottom: 16px; }

/* ---------- Single Post ---------- */
.post-header { background: var(--beige); padding: 60px 0 40px; }
.post-header-meta { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.post-title { margin-bottom: 20px; }
.post-cover { margin: 40px 0; border-radius: var(--radius-lg); overflow: hidden; max-height: 480px; }
.post-cover img { width: 100%; object-fit: cover; max-height: 480px; }
.post-content { max-width: 780px; margin: 0 auto; padding: 40px 0; font-size: 1.05rem; line-height: 1.85; }
.post-content h2, .post-content h3 { margin: 32px 0 16px; }
.post-content p { margin-bottom: 20px; }
.post-content img { border-radius: var(--radius); margin: 24px 0; }
.post-content blockquote {
    border-left: 4px solid var(--rust); padding: 16px 24px;
    background: var(--beige-light); border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic; margin: 24px 0;
}

/* Comments */
.comments-section { max-width: 780px; margin: 0 auto; padding: 40px 0; border-top: 1px solid var(--gray); }
.comment { display: flex; gap: 16px; margin-bottom: 28px; padding-bottom: 28px; border-bottom: 1px solid var(--gray-light); }
.comment:last-child { border-bottom: none; }
.comment-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--beige); display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-weight: 700; font-size: 1rem; color: var(--brown);
}
.comment-body { flex: 1; }
.comment-header { display: flex; gap: 12px; align-items: baseline; margin-bottom: 6px; flex-wrap: wrap; }
.comment-name { font-weight: 600; font-size: .92rem; color: var(--dark); }
.comment-date { font-size: .78rem; color: var(--brown); }
.comment-text { font-size: .95rem; color: var(--charcoal); }
.comment-form { margin-top: 40px; }
.comment-form h3 { margin-bottom: 24px; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: .88rem; font-weight: 600; color: var(--dark); margin-bottom: 6px; }
.form-control {
    width: 100%; padding: 12px 16px;
    border: 2px solid var(--gray); border-radius: var(--radius);
    font-family: 'Sora', sans-serif; font-size: .95rem; color: var(--dark);
    background: var(--white); transition: border-color var(--transition);
    appearance: none;
}
.form-control:focus { outline: none; border-color: var(--rust); }
.form-control::placeholder { color: #aaa; }
textarea.form-control { min-height: 120px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-note { font-size: .8rem; color: var(--charcoal); margin-top: 5px; }
.form-check { display: flex; gap: 10px; align-items: flex-start; }
.form-check input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; accent-color: var(--rust); }

/* Auth forms */
.auth-page { min-height: calc(100vh - var(--header-h)); display: flex; align-items: center; justify-content: center; padding: 60px 24px; background: var(--beige-light); }
.auth-card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 44px 48px; width: 100%; max-width: 480px; }
.auth-card h1 { font-size: 1.8rem; margin-bottom: 8px; }
.auth-subtitle { color: var(--charcoal); margin-bottom: 32px; }
.auth-footer { text-align: center; margin-top: 24px; font-size: .88rem; color: var(--charcoal); }

/* ---------- Cart Page ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 32px; align-items: start; padding: 60px 0; }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: left; padding: 12px 16px; font-size: .82rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--brown); border-bottom: 2px solid var(--gray); }
.cart-table td { padding: 16px; border-bottom: 1px solid var(--gray-light); vertical-align: middle; }
.cart-item-info { display: flex; gap: 14px; align-items: center; }
.cart-item-cover { width: 64px; height: 90px; object-fit: cover; border-radius: var(--radius); flex-shrink: 0; }
.cart-item-title { font-weight: 600; font-size: .95rem; color: var(--dark); }
.cart-item-author { font-size: .82rem; color: var(--brown); }
.cart-qty { width: 60px; padding: 6px 10px; border: 2px solid var(--gray); border-radius: var(--radius); text-align: center; font-size: .9rem; }
.cart-remove { background: none; border: none; color: var(--charcoal); cursor: pointer; }
.cart-remove:hover { color: #dc3545; }

.cart-summary { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 28px; position: sticky; top: calc(var(--header-h) + 20px); }
.cart-summary h3 { margin-bottom: 20px; border-bottom: 1px solid var(--gray); padding-bottom: 16px; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: .95rem; }
.summary-row.total { font-weight: 700; font-size: 1.15rem; border-top: 1px solid var(--gray); padding-top: 12px; margin-top: 12px; }

.cart-empty { text-align: center; padding: 80px 0; }
.cart-empty svg { margin: 0 auto 20px; color: var(--gray); }
.cart-empty h2 { margin-bottom: 12px; }

/* ---------- Checkout Page ---------- */
.checkout-layout { display: grid; grid-template-columns: 1fr 360px; gap: 40px; align-items: start; padding: 60px 0; }
.checkout-section { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 28px; margin-bottom: 24px; }
.checkout-section h2 { font-size: 1.25rem; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--gray); }
.order-review-item { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--gray-light); }
.order-review-item:last-of-type { border-bottom: none; }
.order-review-cover { width: 50px; height: 70px; object-fit: cover; border-radius: 4px; }
.order-review-title { font-size: .9rem; font-weight: 600; }
.order-review-qty { font-size: .82rem; color: var(--brown); }
.order-review-price { margin-left: auto; font-weight: 700; }

/* PayPal container */
#paypal-button-container { margin-top: 20px; }

/* ---------- Account / Orders ---------- */
.account-layout { display: grid; grid-template-columns: 220px 1fr; gap: 32px; padding: 60px 0; align-items: start; }
.account-sidebar { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.account-sidebar ul li a {
    display: block; padding: 14px 20px;
    font-size: .9rem; font-weight: 500; color: var(--dark);
    border-bottom: 1px solid var(--gray-light);
}
.account-sidebar ul li:last-child a { border-bottom: none; }
.account-sidebar ul li a:hover, .account-sidebar ul li a.active { background: var(--beige-light); color: var(--rust); }
.account-content { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 32px; }
.account-content h2 { margin-bottom: 24px; }

.orders-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.orders-table th { text-align: left; padding: 10px 14px; background: var(--beige-light); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--brown); }
.orders-table td { padding: 12px 14px; border-bottom: 1px solid var(--gray-light); }
.orders-table tr:last-child td { border-bottom: none; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 700; }
.badge-pending  { background: #fff3cd; color: #856404; }
.badge-paid     { background: #d4edda; color: #155724; }
.badge-shipped  { background: #d1ecf1; color: #0c5460; }
.badge-delivered{ background: #c3e6cb; color: #155724; }
.badge-cancelled{ background: #f8d7da; color: #721c24; }

/* ---------- Shop Page ---------- */
.shop-header { background: var(--beige); padding: 60px 0 40px; }
.shop-controls { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 32px; flex-wrap: wrap; }
.search-bar { display: flex; gap: 0; flex: 1; max-width: 400px; }
.search-bar input { flex: 1; border-radius: var(--radius) 0 0 var(--radius); border-right: none; }
.search-bar button { padding: 12px 18px; background: var(--rust); color: var(--white); border: 2px solid var(--rust); border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; }
.results-count { font-size: .88rem; color: var(--charcoal); }

/* ---------- Admin Layout ---------- */
.admin-wrapper { display: flex; min-height: calc(100vh - var(--header-h)); }
.admin-sidebar {
    width: 240px; flex-shrink: 0;
    background: var(--dark); color: var(--white);
    padding: 24px 0; min-height: calc(100vh - var(--header-h));
    position: sticky; top: var(--header-h);
}
.admin-sidebar-logo { padding: 0 20px 24px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 16px; }
.admin-sidebar-logo span { font-family: 'DM Serif Display', serif; font-size: 1.1rem; }
.admin-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 20px; font-size: .88rem; font-weight: 500;
    color: rgba(255,255,255,.75); transition: all var(--transition);
}
.admin-nav a:hover, .admin-nav a.active {
    background: rgba(233,89,48,.2); color: var(--white);
    border-left: 3px solid var(--rust);
}
.admin-nav .nav-section-title {
    font-size: .7rem; font-weight: 700; letter-spacing: 1.5px;
    text-transform: uppercase; color: rgba(255,255,255,.35);
    padding: 16px 20px 6px;
}
.admin-main { flex: 1; padding: 32px; background: var(--gray-light); }
.admin-header { margin-bottom: 28px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.admin-header h1 { font-size: 1.6rem; }
.admin-card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 24px; margin-bottom: 24px; }
.admin-card h2 { font-size: 1.15rem; margin-bottom: 16px; }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; margin-bottom: 28px; }
.stat-card { background: var(--white); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-sm); }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; font-family: 'DM Serif Display', serif; margin: 8px 0 4px; }
.stat-card .stat-label { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--brown); }
.stat-card .stat-icon { color: var(--rust); }

/* Admin Table */
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.admin-table th { text-align: left; padding: 10px 14px; background: var(--beige-light); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--brown); }
.admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--gray-light); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--gray-light); }
.table-actions { display: flex; gap: 6px; }
.btn-icon { padding: 6px 10px; font-size: .78rem; border-radius: 6px; }

/* Admin image preview */
.img-preview { max-width: 120px; max-height: 160px; object-fit: cover; border-radius: var(--radius); margin-top: 8px; display: none; }

/* ---------- About Page ---------- */
.about-hero { background: var(--beige); padding: 80px 0; }
.about-grid { display: grid; grid-template-columns: 350px 1fr; gap: 60px; align-items: start; }
.about-photo img { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; }
.about-bio h1 { margin-bottom: 16px; }
.about-bio p { color: var(--charcoal); margin-bottom: 16px; }

/* ---------- Contact Page ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; padding: 60px 0; align-items: start; }
.contact-info h2 { margin-bottom: 20px; }
.contact-info p { color: var(--charcoal); margin-bottom: 12px; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { display: flex; gap: 8px; align-items: center; font-size: .85rem; color: var(--charcoal); margin-bottom: 24px; flex-wrap: wrap; }
.breadcrumb a { color: var(--brown); }
.breadcrumb a:hover { color: var(--rust); }
.breadcrumb-sep { color: var(--gray); }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 48px; }
.page-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: var(--radius);
    font-size: .88rem; font-weight: 600; color: var(--dark);
    border: 2px solid var(--gray); transition: all var(--transition);
}
.page-link:hover, .page-link.active { background: var(--rust); border-color: var(--rust); color: var(--white); }

/* ---------- Scroll to Top ---------- */
.scroll-top {
    position: fixed; bottom: 24px; right: 24px;
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--rust); color: var(--white);
    border: none; cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    box-shadow: var(--shadow-md); opacity: 0; pointer-events: none;
    transition: all var(--transition); z-index: 50;
}
.scroll-top.visible { opacity: 1; pointer-events: all; }
.scroll-top:hover { background: var(--rust-dark); transform: translateY(-2px); }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: rgba(255,255,255,.8); margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; padding: 60px 0 40px; }
.footer-heading { font-family: 'DM Serif Display', serif; font-size: 1.1rem; color: var(--white); margin-bottom: 16px; }
.footer-bio { font-size: .88rem; line-height: 1.7; color: rgba(255,255,255,.65); margin-bottom: 16px; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { font-size: .88rem; color: rgba(255,255,255,.65); }
.footer-links a:hover { color: var(--beige); }
.footer-contact a { font-size: .88rem; color: var(--beige); }
.footer-note { font-size: .82rem; color: rgba(255,255,255,.5); margin-top: 12px; }
.social-links { display: flex; gap: 12px; }
.social-links a { color: rgba(255,255,255,.65); transition: color var(--transition); }
.social-links a:hover { color: var(--beige); }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding: 20px 0;
}
.footer-bottom .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-bottom p { font-size: .82rem; color: rgba(255,255,255,.5); }
.footer-legal { display: flex; gap: 20px; }
.footer-legal a { font-size: .82rem; color: rgba(255,255,255,.5); }
.footer-legal a:hover { color: var(--beige); }

/* ---------- Page Hero (inner pages) ---------- */
.page-hero { background: var(--beige); padding: 60px 0; border-bottom: 1px solid var(--beige-dark); }
.page-hero h1 { margin-bottom: 10px; }
.page-hero p { color: var(--charcoal); font-size: 1.05rem; }

/* ---------- Success / Cancel Pages ---------- */
.status-page { text-align: center; padding: 80px 24px; max-width: 540px; margin: 0 auto; }
.status-icon { width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 24px; }
.status-icon.success { background: #d4edda; color: #28a745; }
.status-icon.error   { background: #f8d7da; color: #dc3545; }
.status-page h1 { margin-bottom: 16px; }
.status-page p { color: var(--charcoal); margin-bottom: 28px; }

/* ---------- Mobile Responsive ---------- */
@media (max-width: 922px) {
    .main-nav {
        display: none; position: absolute;
        top: var(--header-h); left: 0; right: 0;
        background: var(--beige); padding: 16px 24px;
        border-bottom: 2px solid var(--beige-dark);
        box-shadow: var(--shadow-md);
    }
    .main-nav.open { display: block; }
    .nav-list { flex-direction: column; gap: 4px; }
    .nav-list a { padding: 10px 0; font-size: 1rem; }

    .hamburger { display: flex; }

    .site-header { position: relative; }

    .hero-inner { grid-template-columns: 1fr; text-align: center; }
    .hero-actions { justify-content: center; }
    .hero-image { display: none; }

    .books-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }

    .book-detail-grid { grid-template-columns: 1fr; }
    .book-detail-cover { max-width: 280px; margin: 0 auto; }

    .cart-layout { grid-template-columns: 1fr; }

    .checkout-layout { grid-template-columns: 1fr; }

    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }

    .form-row { grid-template-columns: 1fr; }

    .about-grid { grid-template-columns: 1fr; }
    .about-photo { max-width: 280px; margin: 0 auto; }

    .contact-grid { grid-template-columns: 1fr; }

    .account-layout { grid-template-columns: 1fr; }

    .admin-wrapper { flex-direction: column; }
    .admin-sidebar { width: 100%; position: static; min-height: auto; }

    .blog-grid { grid-template-columns: 1fr; }
}

@media (max-width: 544px) {
    .footer-grid { grid-template-columns: 1fr; }
    .auth-card { padding: 28px 20px; }
    .admin-main { padding: 16px; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- Rich text editor (for admin blog) ---------- */
.rich-editor-toolbar { display: flex; gap: 4px; flex-wrap: wrap; padding: 8px; background: var(--gray-light); border: 2px solid var(--gray); border-bottom: none; border-radius: var(--radius) var(--radius) 0 0; }
.rich-editor-toolbar button { padding: 5px 10px; background: var(--white); border: 1px solid var(--gray); border-radius: 4px; cursor: pointer; font-size: .82rem; }
.rich-editor-toolbar button:hover { background: var(--beige-light); }
.rich-editor { min-height: 250px; padding: 14px; border: 2px solid var(--gray); border-radius: 0 0 var(--radius) var(--radius); font-family: 'Sora', sans-serif; font-size: .95rem; line-height: 1.7; }
.rich-editor:focus { outline: none; border-color: var(--rust); }

/* ---------- Utility overrides ---------- */
.no-results { text-align: center; padding: 60px 0; color: var(--charcoal); }
.no-results svg { margin: 0 auto 16px; opacity: .3; }

.loading { display: inline-block; width: 20px; height: 20px; border: 3px solid var(--gray); border-top-color: var(--rust); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================
   Block Renderer — public-facing styles for EditorJS blocks
   ===================================================== */

.block-paragraph {
    font-size: 1.05rem; line-height: 1.85; color: var(--charcoal);
    margin: 0 0 1.2em;
}
.block-heading {
    font-family: 'DM Serif Display', serif; color: var(--dark);
    margin: 1.6em 0 .5em; line-height: 1.2;
}
.block-list {
    padding-left: 1.6em; margin: 0 0 1.2em; color: var(--charcoal);
    line-height: 1.8;
}
.block-list li { margin-bottom: .3em; }

.block-delimiter {
    border: none; border-top: 2px solid var(--beige-dark);
    margin: 2.5em auto; width: 60px;
}

.block-image {
    margin: 2em 0;
}
.block-image img {
    width: 100%; border-radius: var(--radius-lg); display: block;
}
.block-image.with-border img { border: 2px solid var(--beige-dark); }
.block-image.with-background { background: var(--beige); padding: 16px; border-radius: var(--radius-lg); }
.block-image.stretched img { width: 100%; }
.block-image figcaption {
    text-align: center; font-size: .83rem; color: var(--muted, #888);
    margin-top: 8px; font-style: italic;
}

.block-quote {
    border-left: 4px solid var(--rust); padding: 12px 0 12px 24px;
    margin: 2em 0; color: var(--charcoal);
}
.block-quote p { font-size: 1.1rem; line-height: 1.75; font-style: italic; margin: 0 0 8px; }
.block-quote cite { font-size: .85rem; color: var(--brown); font-style: normal; }

.block-attaches { margin: 1.5em 0; }
.block-attaches-link {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px; border-radius: 10px;
    border: 1.5px solid var(--beige-dark); background: var(--beige);
    text-decoration: none; color: var(--dark); transition: border-color .2s;
}
.block-attaches-link:hover { border-color: var(--brown); }
.block-attaches-ext {
    background: var(--brown); color: #fff; font-size: .72rem; font-weight: 700;
    padding: 4px 8px; border-radius: 5px; flex-shrink: 0; text-transform: uppercase;
}
.block-attaches-info { flex: 1; }
.block-attaches-name { font-weight: 600; font-size: .92rem; }
.block-attaches-size { font-size: .78rem; color: var(--muted, #888); margin-left: 4px; }

.block-table-wrap { overflow-x: auto; margin: 1.5em 0; }
.block-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.block-table th, .block-table td {
    padding: 10px 14px; text-align: left;
    border: 1px solid var(--beige-dark);
}
.block-table th { background: var(--beige); font-weight: 700; color: var(--dark); }
.block-table tr:nth-child(even) td { background: var(--beige); }

.block-embed { margin: 2em 0; }
.block-embed-ratio { position: relative; padding-top: 56.25%; }
.block-embed-ratio iframe {
    position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 8px;
}
.block-embed figcaption { text-align: center; font-size: .83rem; color: var(--muted, #888); margin-top: 8px; font-style: italic; }

.block-warning {
    border: 1.5px solid #ffc107; background: #fffbea;
    border-radius: 8px; padding: 14px 18px; margin: 1.5em 0;
}
.block-warning-title { font-weight: 700; margin-bottom: 4px; color: #856404; }
.block-warning-text  { color: #533f03; line-height: 1.6; }

.block-code {
    background: #1e1e2e; color: #cdd6f4; border-radius: 8px;
    padding: 18px 20px; margin: 1.5em 0; overflow-x: auto;
    font-family: 'Courier New', monospace; font-size: .88rem; line-height: 1.6;
}

/* ================================================================
   Public page canvas — responsive flow layout
   (The admin drag-drop canvas uses absolute positioning;
    public visitors get a clean flex-based row layout instead.)
   ================================================================ */
.eg-canvas-flow {
    width: 100%;
    background: var(--beige-light, #f5e8d0);
}
.eg-flow-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 40px;
    align-items: center;
    padding: 48px 40px;
    max-width: 1260px;
    margin: 0 auto;
    box-sizing: border-box;
}
.eg-flow-block {
    min-width: 0;
    flex-shrink: 1;
}
/* Images: capped by admin-controlled max height, never squished */
.eg-flow-block figure.blk-image {
    margin: 0;
    width: 100%;
    height: auto !important;
    overflow: hidden;
    border-radius: var(--radius, 8px);
}
.eg-flow-block .blk-image img {
    width: 100%;
    height: auto !important;
    max-height: 480px; /* fallback */
    object-fit: cover;
    display: block;
}
.eg-flow-block figure[data-role="hero_image"] img {
    max-height: var(--hero-img-max-h, 480px);
}
.eg-flow-block figure[data-role="author_photo"] img {
    max-height: var(--author-img-max-h, 500px);
}
/* Dividers and spacers span full width */
.eg-flow-row--full .eg-flow-block {
    flex: 0 0 100%;
}
/* Rich text in flow */
.eg-flow-block .blk-richtext {
    padding: 0;
}
/* Stack on tablet / mobile */
@media (max-width: 860px) {
    .eg-flow-row {
        flex-direction: column;
        padding: 32px 20px;
        gap: 24px;
    }
    .eg-flow-block {
        flex: 0 0 100% !important;
        width: 100% !important;
    }
}
