/*
 * SarahGay.com global styles (Bootstrap 5.3), shared by the public site and the admin.
 */

/* DESIGN TOKENS */
:root {
    --sg-ink: #2a2733;
    --sg-muted: #6b6676;
    --sg-accent: #c45800;
    --sg-accent-dark: #9c4400;
    --sg-accent-soft: #fbeee3;
    --sg-plum: #5a3b5d;
    --sg-surface: #ffffff;
    --sg-bg: #faf7f2;
    --sg-border: #e9e3da;
    --sg-radius: 14px;
    --sg-radius-sm: 8px;
    --sg-shadow-sm: 0 1px 2px rgba(42, 39, 51, .06), 0 2px 8px rgba(42, 39, 51, .06);
    --sg-shadow: 0 2px 4px rgba(42, 39, 51, .05), 0 12px 32px rgba(42, 39, 51, .10);
    --sg-font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --sg-font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;

    /* Widest the page grows. Set to 100% for truly unbounded width. */
    --sg-max-width: 1720px;
    --sg-gutter: clamp(1rem, 3vw, 2.5rem);
    --sg-header-height: 72px;

    /* Bootstrap 5.3 theming hooks. */
    --bs-body-font-family: var(--sg-font-body);
    --bs-body-font-size: 1.125rem;
    --bs-body-line-height: 1.6;
    --bs-body-color: #3d3a46;
    --bs-body-bg: var(--sg-bg);
    --bs-link-color: var(--sg-accent-dark);
    --bs-link-color-rgb: 156, 68, 0;
    --bs-link-hover-color: #6f3100;
    --bs-link-hover-color-rgb: 111, 49, 0;
    --bs-border-color: var(--sg-border);
    --bs-border-radius: var(--sg-radius-sm);
    --bs-heading-color: var(--sg-ink);
}

/* BASE */
html { scroll-padding-top: calc(var(--sg-header-height) + 1rem); }
body.site-body { display: flex; flex-direction: column; min-height: 100vh; }
h1, h2, h3, h4, h5, h6 { font-family: var(--sg-font-heading); font-weight: 600; letter-spacing: -.01em; }
a { text-decoration: none; text-underline-offset: .18em; }
a:hover { text-decoration: underline; }
p a:not(.btn), .help-block a, li p a { text-decoration: underline; }
p { margin: 0 0 1.25rem 0; }
img { max-width: 100%; }
.grecaptcha-badge { visibility: hidden; }
:focus-visible { outline: 3px solid rgba(196, 88, 0, .45); outline-offset: 2px; }
.offcanvas:focus-visible, .modal:focus-visible { outline: 0; }

.site-container { width: 100%; max-width: var(--sg-max-width); margin-inline: auto; padding-inline: var(--sg-gutter); }
.page-content { flex: 1 0 auto; padding: 1.75rem 0 4rem 0; }
body.page-index .page-content { padding-top: 0; }

/* BUTTONS */
.btn { --bs-btn-font-weight: 600; --bs-btn-border-radius: 999px; --bs-btn-padding-x: 1.4rem; --bs-btn-padding-y: .55rem; transition: background-color .15s, border-color .15s, box-shadow .15s, transform .15s; }
.btn-lg { --bs-btn-padding-x: 1.8rem; --bs-btn-padding-y: .75rem; }
.btn-sm { --bs-btn-padding-x: .9rem; --bs-btn-padding-y: .3rem; }
.btn-primary, .btn-info {
    --bs-btn-color: #fff; --bs-btn-bg: var(--sg-accent); --bs-btn-border-color: var(--sg-accent);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--sg-accent-dark); --bs-btn-hover-border-color: var(--sg-accent-dark);
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #7d3600; --bs-btn-active-border-color: #7d3600;
    --bs-btn-focus-shadow-rgb: 196, 88, 0;
}
.btn-warning {
    --bs-btn-color: var(--sg-ink); --bs-btn-bg: #f7c04d; --bs-btn-border-color: #f7c04d;
    --bs-btn-hover-color: var(--sg-ink); --bs-btn-hover-bg: #f1b230; --bs-btn-hover-border-color: #f1b230;
}
.btn-outline-secondary { --bs-btn-color: var(--sg-ink); --bs-btn-border-color: #cfc8bd; --bs-btn-hover-bg: var(--sg-ink); --bs-btn-hover-border-color: var(--sg-ink); }
.btn.btn-submitted-spinner { position: relative !important; background-color: transparent !important; border-color: transparent !important; color: transparent; box-shadow: none !important; }
.form-control { border-radius: var(--sg-radius-sm); padding: .65rem .9rem; border-color: #d8d1c6; }
.form-control:focus { border-color: var(--sg-accent); box-shadow: 0 0 0 .25rem rgba(196, 88, 0, .18); }

/* HEADER */
/* The frosted background lives on ::before, not on the header itself: backdrop-filter on an element makes it the
   containing block for position: fixed descendants, which squashed the mobile menu (an offcanvas) to the header's height.
   z-index sits above Bootstrap's offcanvas backdrop (1040) so the menu, which lives inside the header, is not dimmed or covered by it,
   and below modals (1055). */
.site-header { background: transparent; border-bottom: 1px solid var(--sg-border); z-index: 1046; }
.site-header::before { content: ''; position: absolute; inset: 0; z-index: -1; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
.site-header .navbar { min-height: var(--sg-header-height); padding: .4rem 0; }
.site-header .navbar > .site-container { display: flex; flex-wrap: nowrap; align-items: center; gap: 1rem; }
.site-header .navbar-brand { display: flex; align-items: center; gap: .75rem; margin: 0; padding: 0; color: var(--sg-ink); text-decoration: none; }
.site-header .navbar-brand img { width: 44px; height: 44px; flex: none; }
.site-header .brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.site-header .brand-name { font-family: var(--sg-font-heading); font-weight: 700; font-size: 1.35rem; letter-spacing: -.01em; }
.site-header .brand-tagline { font-size: .72rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--sg-muted); }
.site-header .header-actions { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.site-header .header-actions .btn-link, .site-header .navbar-toggler { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; color: var(--sg-ink); font-size: 1.35rem; line-height: 1; }
.site-header .header-actions .btn-link:hover, .site-header .navbar-toggler:hover { background: var(--sg-accent-soft); color: var(--sg-accent-dark); }
.site-header .navbar-toggler:focus { box-shadow: none; }

.site-header .navbar-nav { gap: .25rem; font-size: .95rem; font-weight: 500; }
.site-header .nav-link { position: relative; color: var(--sg-ink); padding: .6rem .85rem; border-radius: 999px; }
.site-header .nav-link:hover { color: var(--sg-accent-dark); background: var(--sg-accent-soft); }
.site-header .nav-link.active { color: var(--sg-accent-dark); font-weight: 600; }
.site-header .nav-link.nav-offers { color: #fff; background: #b22626; font-weight: 600; }
.site-header .nav-link.nav-offers:hover { background: #8f1e1e; color: #fff; }
.site-header .nav-link.nav-offers.active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #b22626; }

@media (min-width: 992px) {
    .site-header .nav-link.active:not(.nav-offers)::after { content: ''; position: absolute; left: .85rem; right: .85rem; bottom: .2rem; height: 2px; border-radius: 2px; background: var(--sg-accent); }
    .site-header .offcanvas { flex-grow: 1; }
    .site-header .navbar-toggler { display: none; }
}

/* Mobile menu (offcanvas) */
@media (max-width: 991.98px) {
    .site-header .offcanvas { --bs-offcanvas-width: min(86vw, 360px); }
    .site-header .offcanvas-title { font-family: var(--sg-font-heading); font-weight: 700; font-size: 1.35rem; }
    .site-header .offcanvas-body { padding-top: .5rem; }
    .site-header .navbar-nav { gap: .15rem; font-size: 1.15rem; }
    .site-header .nav-link { padding: .85rem 1rem; border-radius: var(--sg-radius-sm); }
    .site-header .nav-link.active { background: var(--sg-accent-soft); }
    .site-header .nav-link.nav-offers { display: inline-block; margin: .25rem 0; }
}

/* HEADER SEARCH (panel below the header) */
.header-search-form-cnt { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--sg-border); box-shadow: var(--sg-shadow); padding: 1rem 0 1.25rem 0; }
.header-search-form-cnt .search-field { position: relative; }
.header-search-form-cnt .search-field .bi { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--sg-muted); pointer-events: none; }
.header-search-form-cnt .search-field .form-control { padding-left: 2.75rem; border-radius: 999px; font-size: 1.05rem; }
.header-search-form-cnt .search-results { display: none; margin-top: .75rem; border: 1px solid var(--sg-border); border-radius: var(--sg-radius-sm); overflow: hidden; font-size: 1rem; font-weight: 400; background: #fff; max-height: 60vh; overflow-y: auto; }
.header-search-form-cnt .search-results > ul { list-style: none; padding: 0; margin: 0; }
.header-search-form-cnt .search-results > ul > li { padding: 0; }
.header-search-form-cnt .search-results > ul > li a { display: block; padding: .65rem 1rem; border-bottom: 1px solid var(--sg-border); color: var(--sg-ink); text-decoration: none; }
.header-search-form-cnt .search-results > ul > li:last-child a { border-bottom: none; }
.header-search-form-cnt .search-results > ul > li a:hover, .header-search-form-cnt .search-results > ul > li a:focus { background: var(--sg-accent-soft); outline: none; color: var(--sg-accent-dark); }
.header-search-form-cnt .search-results .no-results { padding: .75rem 1rem; }

/* FOOTER */
.site-footer { margin-top: auto; background: var(--sg-ink); color: #d9d5df; padding: 2.5rem 0 1.5rem 0; font-size: .95rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: #f3c9a3; text-decoration: underline; }
.site-footer .footer-main { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; }
.site-footer .footer-brand { display: flex; align-items: center; gap: .9rem; }
.site-footer .footer-brand img { background: #fff; border-radius: 50%; padding: 4px; }
.site-footer .footer-name { font-family: var(--sg-font-heading); font-size: 1.35rem; font-weight: 700; color: #fff; }
.site-footer .footer-tagline { font-size: .85rem; color: #aaa5b3; }
.site-footer .footer-nav { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; margin: 0; }
.site-footer .footer-social { display: flex; gap: .75rem; margin: 0; }
.site-footer .footer-social img { width: 34px; height: 34px; border-radius: 50%; transition: transform .15s; }
.site-footer .footer-social a:hover img { transform: translateY(-2px); }
.site-footer .footer-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .85rem; color: #aaa5b3; }
.site-footer .footer-bottom .btn-outline-secondary { --bs-btn-color: #fff; --bs-btn-border-color: rgba(255, 255, 255, .35); --bs-btn-hover-bg: #fff; --bs-btn-hover-color: var(--sg-ink); }

/* MAIN CONTENT HELPERS (kept from the original stylesheet) */
.href { color: var(--bs-link-color); cursor: pointer; }
.href:hover { text-decoration: underline; }
.page-title { font-family: var(--sg-font-heading); }
h1.page-title { background: var(--sg-surface); padding: 1rem 1.25rem; text-align: center; margin: 0 0 1.25rem 0; border-radius: var(--sg-radius); box-shadow: var(--sg-shadow-sm); }
.white-body { background: var(--sg-surface); padding: 1rem; border-radius: var(--sg-radius); box-shadow: var(--sg-shadow-sm); }
.top-spacer { margin-top: 1.25rem; }
.bold { font-weight: 700; }
.not-bold { font-weight: normal !important; }
.italic { font-style: italic; }
.smaller { font-size: 0.9em !important; }
.no-margin { margin: 0 !important; }
.no-bottom-margin { margin-bottom: 0 !important; }
.no-bottom-padding { padding-bottom: 0 !important; }
.no-top-margin { margin-top: 0 !important; }
.email-register-message, .email-register-success { margin-bottom: .75rem; font-style: italic; }
.horz-line { border-top: 2px solid var(--sg-border); width: 80px; margin: .75rem auto; }
.star-rating img { margin: -2px 0 0 2px; }
.number-of-ratings { font-size: 0.8em; display: inline-block; margin-left: 15px; }
.buy-now-iframe { width: 120px; height: 240px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.width-50 { width: 50%; }
.pointer { cursor: pointer; }
.font-abel { font-family: var(--sg-font-heading); }
.clear-both { clear: both; }

/* Bootstrap 3 names the site's own scripts and views still use. */
.hidden { display: none !important; }
.help-block { display: block; margin-top: .35rem; color: var(--sg-muted); }
.form-group { position: relative; margin-bottom: 1rem; }
.form-group.has-error .form-control { border-color: #dc3545; }
.text-center .btn { white-space: normal; }

/* Anti-spam honeypot: kept off-screen (not display:none) so bots still see and fill it. */
.fg-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* EMAIL SIGNUP */
.email-signup { background: var(--sg-surface); padding: 1.75rem; text-align: center; font-size: 0.9rem; border-radius: var(--sg-radius); box-shadow: var(--sg-shadow); border-top: 4px solid var(--sg-accent); }
.email-signup h3 { margin: 0; text-align: center; font-weight: 700; font-size: 1.6rem; }
.email-signup p { margin: 1rem 0 1.25rem 0; }
.email-signup label { font-weight: normal; }
.email-signup button.btn { width: 100%; }
.text-signup { margin-top: 1.25rem; }
.timeline-snippet { margin-bottom: 1.25rem; }
.email-signup .free-book-details p { font-weight: 600; }
.email-signup .free-book-details img.free-book { height: 150px; width: auto; margin-bottom: 11px; border-radius: 4px; box-shadow: var(--sg-shadow-sm); }
#email-signup-free-book-details .modal-body { overflow: auto; font-size: 0.95rem; }
#email-signup-free-book-details img.free-book { width: 30%; height: auto; float: left; margin: 0 1.25rem 1.25rem 0; }
#email-signup-free-book-details p { margin-top: 1rem; }
.giveaway-form-with-no-sales { max-width: 400px; margin: 0 auto 1.25rem auto; border: 10px solid white; padding: 15px; }

/* COUNTDOWN TIMER */
.countdown-timer { font-size: 0.8em; text-align: center; }
.countdown-timer .timer { display: flex; gap: .35rem; }
.countdown-timer .time-block { flex: 1 1 0; }
.countdown-timer .time-block .inner { border: 1px solid var(--sg-border); border-radius: var(--sg-radius-sm); overflow: hidden; background: #fff; }
.countdown-timer .time-block .time { font-size: 1.5em; background: var(--sg-accent); color: white; }

/* SARAH'S OTHER BOOKS */
.sarahs-other-books { margin-top: 1.25rem; }
.sarahs-other-books .sarahs-books { list-style: none; margin: 0; padding: 0; }
.sarahs-other-books .sarahs-books a { display: block; width: 100%; font-size: 0.9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sarahs-other-books h4 a { color: inherit; }

/* START : ANIMATED BOOK COVER */
@media (min-width: 767px) {
    .animated-book-container { width: 200px; height: 300px; margin: 30px; display: flex; align-items: center; justify-content: center; perspective: 400px; }
    .animated-book { transform: rotateY(-25deg); position: relative; transform-style: preserve-3d; width: 200px; height: 300px; transition: transform 1s ease; animation: 1s ease 0s 1 initAnimation; }
    .animated-book:hover { transform: rotate(0deg); }
    .animated-book > :first-child { position: absolute; background: #0d47a1aa; width: 200px; height: 300px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; box-shadow: 5px 5px 20px #666; }
    .animated-book::before { content: ' '; background: #fff; height: calc(300px - 2 * 3px); width: 50px; top: 3px; position: absolute; transform: translateX(calc(200px - 50px / 2 - 3px)) rotateY(90deg) translateX(calc(50px / 2)); }
    .animated-book::after { content: ' '; position: absolute; left: 0; width: 200px; height: 300px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; background: #01060f; transform: translateZ(-50px); box-shadow: -10px 0 50px 10px #666; }
    @keyframes initAnimation {
      0% { transform: rotateY(0deg); }
      100% { transform: rotateY(-25deg); }
    }
}

/* MODALS */
.modal-content { border: 0; border-radius: var(--sg-radius); box-shadow: var(--sg-shadow); }
.modal-title { font-family: var(--sg-font-heading); }

/* SMALL SCREENS */
@media (max-width: 767.98px) {
    :root { --bs-body-font-size: 1.0625rem; --sg-header-height: 64px; }
    .site-header .navbar-brand img { width: 38px; height: 38px; }
    .site-header .brand-name { font-size: 1.2rem; }
    .page-content { padding-top: 1rem; }
    .site-footer .footer-main { flex-direction: column; align-items: flex-start; }
    .site-footer .footer-bottom { flex-direction: column; align-items: flex-start; gap: .75rem; }
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
