/* ==========================================================
   REX SINNER — SHARED BOOK PAGE STYLES
   Used by /rexsinner/books/*/
   ========================================================== */

/* 01 — Palette and foundations
   All var() uses below include color fallbacks, so an absent :root block
   cannot cause the entire palette to disappear.
*/
:root {
    --coral: #fb706c;
    --coral-deep: #e75a56;
    --ink: #2b2220;
    --muted: #60544e;
    --accent: #a52f36;
    --accent-hover: #802329;
    --cream: #fff9ed;
    --paper: #fffdf9;
    --mint: #b6d9cd;
    --border: #e8d8cb;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--cream, #fff9ed);
    color: var(--ink, #2b2220);
    font: 18px/1.65 Georgia, 'Times New Roman', serif;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
a:focus-visible { outline: 3px solid var(--accent, #a52f36); outline-offset: 4px; }
.container { width: min(calc(100% - 36px), 1030px); margin-inline: auto; }

/* 02 — Header and brand */
.site-header {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 173px;
    padding: 23px 16px 19px;
    display: grid;
    place-items: center;
    text-align: center;
    background:
        radial-gradient(ellipse 180px 75px at 6% -14%, rgba(175,44,53,.15) 0 65%, transparent 66%),
        radial-gradient(ellipse 185px 115px at 95% 120%, rgba(175,44,53,.15) 0 65%, transparent 66%),
        linear-gradient(115deg, #ff8179, var(--coral, #fb706c) 58%, #ff7a75);
}
.site-header::before, .site-header::after {
    content: '';
    position: absolute;
    z-index: -1;
    pointer-events: none;
    width: 265px;
    height: 265px;
    border: 28px solid rgba(165,47,54,.12);
    border-radius: 47% 53% 68% 32% / 63% 34% 66% 37%;
}
.site-header::before { left: -115px; top: -156px; transform: rotate(-28deg); }
.site-header::after { right: -95px; bottom: -192px; transform: rotate(46deg); }
.brand-note {
    display: block;
    margin-bottom: 8px;
    color: #4d2827;
    font: 700 10px/1.25 Arial, Helvetica, sans-serif;
    text-transform: uppercase;
    letter-spacing: .24em;
}
.brand {
    color: #201b1b;
    font: 900 clamp(52px, 8vw, 80px)/.95 Arial, Helvetica, sans-serif;
    letter-spacing: -.065em;
    text-decoration: none;
}

/* Gumroad — Pink Button */
.store-link--gumroad {
    --store-accent: #d63377;
    background: #ffbdd8;
    color: #391526;
    border-color: #f18ab5;
    border-left: 5px solid #d63377;
}

.store-link--gumroad[href]:hover {
    background: #fdecce;
    border-color: #d63377;
    box-shadow: 0 5px 14px rgba(214, 51, 119, .20);
    transform: translateY(-1px);
}

.brand span { color: #fffdf8; }
.header-subtitle {
    margin: 11px 0 0;
    color: #442625;
    font: 600 14px/1.3 Arial, Helvetica, sans-serif;
    letter-spacing: .045em;
}

/* 03 — Tagline and navigation */
.tagline-bar { background: var(--ink, #2b2220); color: white; font-family: Arial, Helvetica, sans-serif; }
.tagline-inner {
    width: min(calc(100% - 36px), 1030px);
    min-height: 49px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.tagline-text { font-size: 11px; font-weight: 800; letter-spacing: .12em; line-height: 1.4; }
.tagline-cta { flex-shrink: 0; color: #ffbdaf; font-size: 12px; font-weight: 800; text-underline-offset: 4px; }
.tagline-cta:hover { color: #fff; }

/* 04 — Book cover and heading */
main { padding-top: 30px; }
.breadcrumb { margin: 0 0 22px; color: var(--muted, #60544e); font: 700 13px/1.5 Arial, Helvetica, sans-serif; }
.breadcrumb a { text-underline-offset: 3px; }
.book-panel {
    display: grid;
    grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
    column-gap: clamp(24px, 5vw, 65px);
    align-items: start;
    padding: clamp(22px, 4vw, 42px);
    background: var(--paper, #fffdf9);
    border: 1px solid var(--border, #e8d8cb);
    border-radius: 7px;
}
.cover-column { min-width: 0; text-align: center; }
.book-cover {
    display: block;
    width: min(100%, 200px);
    height: auto;
    aspect-ratio: 5/8;
    margin: 0 auto;
    border-radius: 3px;
    box-shadow: 0 12px 28px rgba(43,34,32,.25);
}
.cover-column .rex-price { margin-top: 17px; }
.book-meta {
    margin: 0 0 11px;
    color: var(--accent, #a52f36);
    font: 800 11px/1.5 Arial, Helvetica, sans-serif;
    letter-spacing: .14em;
    text-transform: uppercase;
}
h1 {
    margin: 0 0 14px;
    color: var(--accent, #a52f36);
    font: italic 700 clamp(31px, 4.2vw, 48px)/1.13 Georgia, 'Times New Roman', serif;
    letter-spacing: -.025em;
}
.subtitle { margin: 0 0 17px; color: var(--muted, #60544e); font: italic 18px/1.45 Georgia, 'Times New Roman', serif; }
.series { margin: 0; color: var(--muted, #60544e); font: 700 12px/1.5 Arial, Helvetica, sans-serif; }

/* 05 — Book description */
.blurb { max-width: 730px; margin: 32px auto 0; padding: 0 8px 34px; }
.blurb h2, .get-section h2 {
    margin: 0 0 21px;
    color: var(--accent, #a52f36);
    font: italic 700 clamp(29px, 4vw, 39px)/1.18 Georgia, 'Times New Roman', serif;
}
.blurb p { margin: 0 0 17px; line-height: 1.65; }
.blurb .hook { font-weight: 700; font-size: 21px; line-height: 1.4; }
.blurb .emphasis, .blurb .audience { font-weight: 700; }

/* 06 — Compact ebook details */
.ebook-divider { border: 0; border-top: 1px solid var(--border, #e8d8cb); margin: 24px 0 16px; }
.ebook-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 5px 8px;
    margin: 18px 0;
    color: var(--muted, #60544e);
    font: 600 12px/1.5 Arial, Helvetica, sans-serif;
    letter-spacing: .02em;
    text-align: center;
}
.ebook-info-dot { color: var(--accent, #a52f36); font-weight: 700; }

/* 07 — Store buttons */
.get-section {
    max-width: 760px;
    margin: 0 auto 64px;
    padding: 28px;
    background: var(--mint, #b6d9cd);
    border-radius: 6px;
    text-align: center;
}
.get-section h2 { margin-bottom: 9px; }
.get-section p { max-width: 550px; margin: 0 auto 13px; font-size: 16px; }
.store-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 610px;
    margin: 23px auto 0;
}
.store-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 12px 16px;
    border: 1px solid var(--border, #e8d8cb);
    border-left: 5px solid var(--store-accent, #a52f36);
    border-radius: 6px;
    background: var(--paper, #fffdf9);
    color: var(--ink, #2b2220);
    font: 800 15px/1.3 Arial, Helvetica, sans-serif;
    text-align: center;
    text-decoration: none;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.store-link[href]:hover {
    border-color: var(--store-accent, #a52f36);
    box-shadow: 0 5px 14px rgba(43,34,32,.11);
    transform: translateY(-1px);
}
.store-link:focus-visible { outline: 3px solid var(--accent, #a52f36); outline-offset: 3px; }
.store-link--apple { --store-accent: #333333; }
.store-link--google { --store-accent: #4285f4; }
.store-link--bn { --store-accent: #31725a; }
.store-link--kobo { --store-accent: #bf3655; }
.store-link--smashwords { --store-accent: #ef8536; }
.store-link--pending { opacity: .78; cursor: default; }
.store-note { margin: 16px auto 0; color: var(--muted, #60544e); font: 12px/1.5 Arial, Helvetica, sans-serif; }
.get-section .back-link {
    display: block;
    margin-top: 22px;
    color: var(--accent, #a52f36);
    font: 700 13px/1.5 Arial, Helvetica, sans-serif;
    text-underline-offset: 4px;
}

/* 08 — Compact final subscribe: email left, button right */
.rex-final-subscribe {
    max-width: 620px;
    margin: 35px auto 15px;
    padding: 20px 12px;
    text-align: center;
}
.rex-final-subscribe h2 {
    margin: 0 0 15px;
    color: var(--accent, #a52f36);
    font: 800 22px/1.3 Arial, Helvetica, sans-serif;
}
.rex-inline-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}
.rex-inline-row input[type="email"] {
    flex: 1;
    min-width: 0;
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid #c8bcb0;
    border-radius: 5px;
    background: #fff;
    font: 16px Arial, Helvetica, sans-serif;
}
.rex-final-subscribe .rex-inline-row button {
    flex: 0 0 auto;
    width: auto;
    min-height: 46px;
    margin: 0;
    padding: 10px 18px;
    border: 0;
    border-radius: 5px;
    background: var(--accent, #a52f36);
    color: white;
    font: 800 14px Arial, Helvetica, sans-serif;
    cursor: pointer;
}
.rex-final-subscribe .rex-inline-row button:hover { background: var(--accent-hover, #802329); }
.rex-final-subscribe .rex-inline-row button:focus-visible { outline: 3px solid var(--ink, #2b2220); outline-offset: 3px; }
.rex-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.rex-subscribe-hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* 09 — Footer */
footer {
    padding: 24px 18px 33px;
    border-top: 1px solid var(--border, #e8d8cb);
    color: var(--muted, #60544e);
    font: 13px/1.5 Arial, Helvetica, sans-serif;
    text-align: center;
}
.footer-brand { display: inline; color: var(--ink, #2b2220); font-weight: 800; letter-spacing: .08em; }
.footer-slogan { display: inline; }

/* 10 — Responsive adjustments */
@media (max-width: 680px) {
    body { font-size: 16px; line-height: 1.58; }
    .container { width: min(calc(100% - 24px), 1030px); }
    .site-header { min-height: 126px; padding: 17px 12px; }
    .brand-note { font-size: 9px; margin-bottom: 6px; }
    .brand { font-size: clamp(46px, 12vw, 66px); }
    .header-subtitle { margin-top: 7px; font-size: 12px; }
    .tagline-inner { flex-direction: column; justify-content: center; gap: 3px; padding: 9px 0; text-align: center; }
    .tagline-text { font-size: 10px; letter-spacing: .055em; }
    .tagline-cta { font-size: 11px; }
    main { padding-top: 17px; }
    .book-panel { grid-template-columns: 1fr; text-align: center; padding: 24px 17px; }
    .cover-column { margin-bottom: 25px; }
    .cover-column .rex-price { margin-top: 13px; }
    .subtitle { font-size: 17px; }
    .blurb { margin-top: 34px; padding: 0 4px 24px; }
    .get-section { padding: 23px 16px; margin-bottom: 42px; }
}

@media (max-width: 600px) {
    .store-links { grid-template-columns: 1fr; max-width: 420px; }
    .store-link { min-height: 52px; font-size: 15px; }
    .blurb .ebook-info {
        gap: 4px 6px;
        margin: 15px 0;
        font-size: 10px;
        line-height: 1.4;
        letter-spacing: 0;
        justify-content: center;
        text-align: center;
    }
    .rex-final-subscribe { margin: 25px auto 10px; padding: 15px 0; }
    .rex-final-subscribe h2 { margin-bottom: 12px; font-size: 19px; }
    .rex-inline-row { gap: 6px; }
    .rex-inline-row input[type="email"] { padding: 10px; font-size: 16px; }
    .rex-final-subscribe .rex-inline-row button { padding: 10px 12px; font-size: 12px; }
}

@media (max-width: 359px) {
    .rex-final-subscribe .rex-inline-row button { padding-inline: 9px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .store-link { transition: none; }
}

/* AMAZON KINDLE — Orange Buy Button */
.store-link--amazon {
    --store-accent: #e47911;
    background: #ffa41c;
    color: #0f1111;
    border-color: #e47911;
    border-left: 5px solid #e47911;
}

.store-link--amazon[href]:hover {
    background: #fa8900;
    border-color: #c45500;
    box-shadow: 0 5px 14px rgba(228, 121, 17, .22);
    transform: translateY(-1px);
}