/* Global Variables */
:root {
    --color-golden-rod: #ffc107; /* use this in place of the Bootstrap "Warning" color */
    --color-midnight: #111923;
    --color-deep-slate: #192633;
    --color-muted-plum: #302432;
    --color-soft-teal: #203437;
    --color-info-teal: #0dcaf0;
    --color-warning-golden-rod: #ffc107;
}
.text-teal {
    color: var(--color-info-teal);
}

.text-golden-rod {
    color: var(--color-warning-golden-rod);
}

/* Custom Stylesheet overrides */

.bg-custom-01 {
    background: linear-gradient(180deg, #192633 0%, #242f3c 42%, #18242f 100%);
}

.bg-footer {
    background: linear-gradient(to bottom, #001122 0%, #000000 85%);
}

.bg-book-cover {
    background: #00000055;
}

.bg-common-reddish-gray-grad {
    background: linear-gradient(130deg, var(--color-muted-plum) 0%, #211f2b 48%, var(--color-deep-slate) 100%);
}

.bg-main {
    background-color: var(--color-midnight);
    background: linear-gradient(rgba(17, 25, 35, 0.78), rgba(17, 25, 35, 0.88));
    background-position: center top;
    background-size: cover;
}

.bg-footer-tile {
    display: flex;
    align-items: center;
    min-height: 250px;
    padding: 1rem 0;
    background-color: #051116;
    background-image: url(../images/AlienCittyScapeTile_smaller_06.png);
    background-repeat: repeat-x;
    background-position: center bottom;
}

.site-navbar {
    background: linear-gradient(100deg, #20252d 0%, #18232d 100%);
}

.bg-card-other-books {
    background-color: unset;
}

.bg-join-newsletter {
    background: #1d2f1f;
}

.bg-send-fan-mail {
    background: #113344;
}

@media screen and (min-width: 992px) {
    #newsletter > .bg-join-newsletter,
    #contact > .bg-send-fan-mail {
        display: flex;
        flex-direction: column;
    }

    #newsletter-form,
    #contact-form {
        display: flex;
        flex: 1;
        flex-direction: column;
    }

    #newsletter-form > .row,
    #contact-form > .row {
        display: flex;
        flex: 1;
        flex-direction: column;
    }

    #newsletter-form > .row > .col-12:last-child,
    #contact-form > .row > .col-12:last-child {
        margin-top: auto !important;
    }
}

.bk-stacked-book-info {
    background: var(--bs-gray-900);
}

.btn-view_details {
    font-family: sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    border: 3px solid;
    border-radius: .5em;
    text-decoration: none;
    padding: 0.2em 1.3em 0.2em 1.2em;
    margin-top: 0.5em;
}

.arrow-view_details {
    -webkit-text-stroke: 2px currentColor;
    vertical-align: middle;
}

#stacked-list-section .custom-card-title {
    color: white !important;
    font-family: sans-serif !important;
    font-weight: 100 !important;
    
}

#stacked-list-section .custom-card-subtitle {
    color: var(--color-golden-rod) !important;               /* same as bootstrap "warning" color */
    font-family: sans-serif !important;
    font-weight: 100 !important;
    
}

#stacked-list-section .synapsis-text p, li {
    color: var(--bs-gray-500) !important;
    font-family: sans-serif !important;
    font-weight: 300 !important;
}

#stacked-list-section .section-title {
    color: var(--bs-gray-500) !important;
    font-family: sans-serif !important;
    font-weight: 300 !important;
    
}

#stacked-list-section .section-subtitle {
    color: var(--bs-green) !important;
    font-family: sans-serif !important;
    font-weight: 300 !important;
    
}



/* ============================================================
   COOKIE OPT-OUT NOTICE
   ============================================================ */
.cookie-notice {
    background-color: #2b2b2b;
    color: #f8f9fa;
    font-size: 0.9rem;
    border-bottom: 1px solid #444;
    z-index: 1030;
}
.cookie-notice.cookie-hidden {
    display: none !important;
}
.cookie-notice p {
    line-height: 1.4;
}

/* Two-column layout: icon left, text+button right */
.cookie-notice-row {
    gap: 0;
}

.cookie-notice-icon {
    flex: 0 0 60px;
    background-color: rgba(255, 255, 255, 0.07);
    font-size: 2.5rem;
    color: #e0c068;
}

.cookie-notice-icon i {
    line-height: 1;
}

.cookie-notice-content {
    flex: 1 1 auto;
    min-width: 0;
}

/* Mobile: shrink icon column, reduce icon size */
@media (max-width: 576px) {
    .cookie-notice-icon {
        flex: 0 0 40px;
        font-size: 1.8rem;
    }
    .cookie-notice-content {
        padding-left: 0.75rem !important;
    }
}

.navbar-brand {
    letter-spacing: 0.05rem;
}

/* Custom cards for the stacked list view */
.hover-shadow:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.125) !important;
    transition: all 0.3s ease-in-out;
}
.hover-shadow {
    transition: all 0.3s ease-in-out;
}

/* Custom platform social links */
.hover-light:hover {
    color: #fff !important;
    transition: color 0.2s ease-in-out;
}

/* Compact and center the details action on tablet and smaller screens */
@media (max-width: 991.98px) {
    #stacked-list-section .border-top.pt-3.mt-3 > .d-flex {
        justify-content: center;
    }

    #stacked-list-section .btn-view_details {
        font-size: 1.25rem;
        padding: 0.2em 0.9em;
        margin-left: 0;
    }

    #stacked-list-section .arrow-view_details {
        font-size: 1.25rem;
    }
}

/* Center titles only on phone-sized screens */
@media (max-width: 575.98px) {
    .bg-common-reddish-gray-grad .display-4,
    .bg-common-reddish-gray-grad .fw-subtitle,
    #stacked-list-section .custom-card-title,
    #stacked-list-section .custom-card-subtitle {
        text-align: center;
    }
}

/* Hero Section adjustments */
.hero-book-shadow {
    filter: drop-shadow(10px 10px 15px rgba(0,0,0,0.3));
}

/* The container forces everything onto one row and centers them vertically */
.logo {
  display: inline-flex;
  align-items: center;       
  font-family: sans-serif; 
  font-weight: 400;
  font-size: 20px;           /* Reduced from 50px by a factor of 0.3 */
  color: #D3D3D3;            /* Changed to light gray */
  letter-spacing: -0.3px;    /* Scaled down spacing */
}

/* The circle must have block-like dimensions to render */
.circle-o {
  display: inline-block;     
  width: 2em;              
  height: 2em;             
  border: 0.14em solid #D3D3D3; /* Matches the text light gray */
  border-radius: 50%;        
  margin: 0 0.05em;           
  box-sizing: border-box;    
}

.purc_grp_price {
    font-size: smaller;
    font-weight:300;
    padding-top:3px;
}

/* ===========================================================
                 Work pricing pop-up styles
   =========================================================== */
/* IMPORTANT - where each class lives in featured-hero.php:
     .pricing-card         -> the .modal root (Bootstrap's fixed, full-viewport
                              overlay + scroll container)
     .pricing-card-content -> the .modal-content (the visible card)
     .pricing-card-body    -> the .modal-body
     .pricing-card-footer  -> the .modal-footer
   Never put width / height / margin / padding on .pricing-card: the .modal
   element MUST remain a full-viewport, full-height overlay or the dialog can
   no longer center (Bootstrap centers .modal-dialog inside it via auto
   margins + .modal-dialog-centered). All sizing lives on
   #priceInfoModal .modal-dialog near the end of this section. */

.pricing-card-content {
    background-color: #ffffff !important;
    border: 2px solid #009999 !important;
}
.pricing-card .head {
    color: #ffffcc !important;
    background-color: #339999 !important;
}
.pricing-card-body {
    background-color: #ccffff !important;
}
.pricing-card-footer {
    background-color: #ffccff !important;
}
.pricing-card-content .intro {
    font-size: 0.97rem;
    color: #555555;
}
.pricing-card-content .esplain {
    background-color: white !important;
    font-size: 0.95rem;
    color: #555555;
}

/* Explicit text colors for the DB-driven body content.
   The modal body HTML comes from the database (see featured-hero.php), so it
   carries no classes of its own and relied on inheriting Bootstrap's default
   --bs-body-color. Bootstrap 5.3 paints default text via CSS custom
   properties (var(--bs-emphasis-color)), and older mobile WebViews - e.g.
   Samsung Internet on a Galaxy S9 - can fail to resolve the var() chain,
   which computes to "unset" => white text on white backgrounds. Pin literal
   color values here so the modal never depends on custom properties.
   td is included; th is deliberately NOT, so table.custom-table th keeps its
   white-on-teal header styling. */
.pricing-card .modal-body p,
.pricing-card .modal-body li,
.pricing-card .modal-body td {
    color: #333333;
}

/* Table Layout Fixes for Bootstrap */
.table-responsive-wrapper {
    border-radius: 6px 6px 0 0;
    overflow: hidden;
}
table.custom-table th, table.custom-table td {
    padding: 5px 15px !important;
}
table.custom-table th {
    background-color: #339999 !important;
    color: #ffffff !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    border-bottom: none;
}
/* Alternating blue and white row striping */
table.custom-table tbody tr:nth-child(even) {
    background-color: #f0f7ff !important;
}
table.custom-table tbody tr:nth-child(odd) {
    background-color: #ffffff !important;
}
table.custom-table tbody tr:hover {
    background-color: #e2f0fe !important;
}

/* Compact sizing for the pricing-info modal (#priceInfoModal in featured-hero.php).
   The dialog hugs the pricing card instead of stretching it inside a wide box:
   - Bootstrap dialogs are pure max-width values (default 500px, modal-lg 800px).
     560px fits the pricing table + padding with no dead margins. Tune this one
     number to resize the whole popup.
   - Body padding reduced from the 1rem default to 0.75rem. */
#priceInfoModal .modal-dialog {
    max-width: 560px;
}

#priceInfoModal .modal-title {
    color: darkcyan;
    text-align: center;
    width: 100%;
}

/* Close button: a real Bootstrap-icon "X" (bi-x-lg), centered without hacks.
   Bootstrap's stock .btn-close overlaps the header padding via NEGATIVE
   margins (.modal-header .btn-close { margin: -.5rem ...; padding: .5rem }),
   which is what made the old "&nbsp; spacer" hack necessary once this header
   was switched to p-0 - and why the glyph kept drifting off-center.
   This custom button is an ordinary flex item instead:
     - .modal-header gets align-items:stretch, so the button fills the full
       height of the title strip and the teal title band stretches with it;
     - flex centering (align-items + justify-content) centers the glyph on
       both axes regardless of title height, font size, or icon choice. */
#priceInfoModal .modal-header {
    align-items: stretch;
}
#priceInfoModal .pricing-modal-close {
    flex: 0 0 auto;           /* never shrunk by the width:100% title */
    display: flex;
    align-items: center;      /* vertical centering */
    justify-content: center;  /* horizontal centering */
    width: 2.25rem;
    margin: 0 0.25rem 0 0;    /* small breathing room from the right edge */
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: transparent;
    color: #339999;           /* matches the teal title band */
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}
#priceInfoModal .pricing-modal-close:hover,
#priceInfoModal .pricing-modal-close:focus-visible {
    background-color: rgba(51, 153, 153, 0.12);
    color: #027373;
}
#priceInfoModal .pricing-modal-close:focus-visible {
    outline: 2px solid #339999;
    outline-offset: -2px;
}

/* Close button: a real Bootstrap-icon "X" (bi-x-lg), centered without hacks.
   Bootstrap's stock .btn-close overlaps the header padding via NEGATIVE
   margins (.modal-header .btn-close { margin: -.5rem ...; padding: .5rem }),
   which is what made the old "&nbsp; spacer" hack necessary once this header
   was switched to p-0 - and why the glyph kept drifting off-center.
   This custom button is an ordinary flex item instead:
     - .modal-header gets align-items:stretch, so the button fills the full
       height of the title strip and the teal title band stretches with it;
     - flex centering (align-items + justify-content) centers the glyph on
       both axes regardless of title height, font size, or icon choice. */
#priceInfoModal .modal-header {
    align-items: stretch;
}
#priceInfoModal .pricing-modal-close {
    flex: 0 0 auto;           /* never shrunk by the width:100% title */
    display: flex;
    align-items: center;      /* vertical centering */
    justify-content: center;  /* horizontal centering */
    width: 2.25rem;
    margin: 0 0.25rem 0 0;    /* small breathing room from the right edge */
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: transparent;
    color: #339999;           /* matches the teal title band */
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}
#priceInfoModal .pricing-modal-close:hover,
#priceInfoModal .pricing-modal-close:focus-visible {
    background-color: rgba(51, 153, 153, 0.12);
    color: #027373;
}
#priceInfoModal .pricing-modal-close:focus-visible {
    outline: 2px solid #339999;
    outline-offset: -2px;
}

#priceInfoModal .modal-body {
    padding: 0.75rem;
}

/* ============================================================
   SAMPLE READER PANE
   ============================================================ */

/* Overlay backdrop */
#sample-reader-overlay {
  /* 1. Define the duration in one place here */
  --fade-duration: 1s;

  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  background-color: rgba(18, 18, 18, 0.95);
  
  display: flex;
  align-items: center;
  justify-content: center;
  
  /* Initial hidden tracking states */
  opacity: 0;
  visibility: hidden;
  
  /* Transition opacity cleanly, then let visibility snap to hidden at the tail-end */
  transition: opacity var(--fade-duration) ease-in-out, visibility 0s linear var(--fade-duration);
}

#sample-reader-overlay.active {
  opacity: 1;
  visibility: visible;
  /* Reset the transition delay so visibility activates instantly when opening */
  transition: opacity var(--fade-duration) ease-in-out, visibility 0s linear 0s;
}

/* The reader pane itself */
#sample-reader-pane {
    position: relative;
    width: 95vw;
    max-width: 900px;
    height: 90vh;
    max-height: 90vh;
    background: #fdfdfb;
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#sample-reader-pane .st-text-centered {
    text-align: center;
}

/* Mobile adjustments */
@media (max-width: 576px) {
    #sample-reader-pane {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    .sample-reader-content {
        padding: 1rem 1.25rem;
    }
    .sample-reader-toolbar {
        padding: 0.4rem 0.5rem;
    }
    .sample-reader-toolbar .btn-reader,
    .sample-reader-toolbar .chapter-navigation .btn-chapter-top {
        padding: 0.3rem 0.4rem;
        font-size: 0.8rem;
    }
    .sample-reader-toolbar .toolbar-title {
        max-width: 100%;
        font-size: 0.9rem;
    }
}

/* Toolbar at top */
.sample-reader-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: #2b2b2b;
    color: #fff;
    border-bottom: 1px solid #444;
    flex-shrink: 0;
}
.sample-reader-toolbar .toolbar-title {
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50%;
}
.sample-reader-toolbar .toolbar-buttons {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.sample-reader-toolbar .chapter-navigation {
    display: inline-flex;
    align-items: stretch;
    flex: 0 0 auto;
}
.sample-reader-toolbar .chapter-navigation[hidden] {
    display: none;
}
.sample-reader-toolbar .chapter-select {
    max-width: 190px;
    min-width: 135px;
    padding: 0.3rem 1.8rem 0.3rem 0.55rem;
    border: 1px solid #666;
    border-radius: 6px 0 0 6px;
    background-color: #444;
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
}
.sample-reader-toolbar .chapter-select:focus {
    position: relative;
    z-index: 1;
    outline: 2px solid #f0ad4e;
    outline-offset: 2px;
}
.sample-reader-toolbar .chapter-navigation .btn-chapter-top {
    margin-left: -1px;
    background: #444;
    color: #fff;
    border: 1px solid #555;
    border-radius: 0 6px 6px 0;
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.sample-reader-toolbar .chapter-navigation .btn-chapter-top:hover {
    background: #666;
}
.sample-reader-toolbar .chapter-navigation .btn-chapter-top:focus {
    position: relative;
    z-index: 1;
}
.sample-reader-toolbar .btn-reader {
    background: #444;
    color: #fff;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.sample-reader-toolbar .btn-reader:hover {
    background: #666;
}
.sample-reader-toolbar .btn-reader.btn-close-reader {
    background: #c0392b;
    border-color: #e74c3c;
}
.sample-reader-toolbar .btn-reader.btn-close-reader:hover {
    background: #e74c3c;
}

/* Content scroll area */
.sample-reader-content {
    flex: 1;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2rem 2.5rem;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #222;
    word-wrap: break-word;
}
.sample-reader-content h1,
.sample-reader-content h2,
.sample-reader-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}
.sample-reader-content h1 {
    font-size: 1.8rem;
    text-align: center;
}
.sample-reader-content p {
    margin-bottom: 1rem;
}
.sample-reader-content hr {
    border: none;
    border-top: 1px solid #ccc;
    margin: 1.5rem 0;
}
.sample-reader-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}
.sample-reader-content .sample-note {
    font-style: italic;
    color: #666;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 1rem;
}

/* Zoom states */
.sample-reader-content.zoom-large {
    font-size: 1.3rem;
}
.sample-reader-content.zoom-xlarge {
    font-size: 1.6rem;
}

/* Loading indicator */
.sample-reader-loading {
    text-align: center;
    padding: 3rem;
    color: #888;
    font-size: 1.1rem;
}

/* Error message */
.sample-reader-error {
    text-align: center;
    padding: 3rem;
    color: #c0392b;
    font-size: 1.1rem;
}

.lights-down {
  /* Starts the animation automatically on load */
  animation: dimLights 5s forwards; 
}

@keyframes dimLights {
  from {
    background-color: #ffffff; /* Starting background color (e.g., white) */
  }
  to {
    background-color: #121212; /* Ending background color (e.g., dark gray/black) */
  }
}

.word-count-box {
    border: 1px solid #777777;
    padding: 1px 4px;
}

.work-synopsis {
    color: var(--bs-gray-500) !important;
}

.fw-subtitle {
    font-size: 1.25rem !important;
    font-style: italic !important;
    color: var(--color-golden-rod) !important;
    font-weight: 400 !important;
}

.work-synopsis p {
    line-height: 1.5;
    margin-top: 0;
    margin-bottom: 0.6rem;
    font-weight: 350 !important;
    font-size: 1rem !important;
}
.work-synopsis strong {
    font-weight:700 !important;
}

/* Make the cover image clickable */
.cover-read-sample {
    cursor: pointer;
    transition: transform 0.2s ease-in-out, filter 0.2s ease-in-out;
}
.cover-read-sample:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

/* ================================================= */
/*          Social Meadia Share Buttons              */
/* ================================================= */

/* Base Layout (Mobile First: Inline & Centered at Bottom) */
.social-widget-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px 0;
    background: transparent;
    width: 100%;
}

/* Individual Icon Styling */
.social-icon {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    position: relative;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.social-icon svg {
    fill: #ffffff; /* Icon color */
}

.social-icon svg path {
    fill: #ffffff;
}

/* Per-brand icon sizes to balance visual weight */
.social-icon.facebook svg {
    width: 34px;
    height: 34px;
}

.social-icon.whatsapp svg {
    width: 28px;
    height: 28px;
}

/* Brand Colors & Hover Effects */
.facebook { background-color: #1877F2; }
.x-twitter { background-color: #000000; }
.whatsapp { background-color: #25D366; }
.instagram { background-color: #E1306C; }

.social-icon:hover {
    transform: scale(1.1);
}

/* Hover Tooltip */
.social-icon[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10000;
}

/* Desktop: tooltip appears to the left of the icon */
@media screen and (min-width: 768px) {
    .social-icon[data-tooltip]::after {
        right: 55px;
        top: 50%;
        transform: translateY(-50%);
    }

    /* Arrow pointing right toward the icon */
    .social-icon[data-tooltip]::before {
        content: '';
        position: absolute;
        right: 49px;
        top: 50%;
        transform: translateY(-50%);
        border: 5px solid transparent;
        border-left-color: rgba(0, 0, 0, 0.85);
        opacity: 0;
        transition: opacity 0.2s ease;
        z-index: 10000;
    }

    .social-icon[data-tooltip]:hover::after,
    .social-icon[data-tooltip]:hover::before {
        opacity: 1;
    }
}

/* Mobile: tooltip appears above the icon */
@media screen and (max-width: 767px) {
    .social-icon[data-tooltip]::after {
        bottom: 52px;
        left: 50%;
        transform: translateX(-50%);
    }

    /* Arrow pointing down toward the icon */
    .social-icon[data-tooltip]::before {
        content: '';
        position: absolute;
        bottom: 46px;
        left: 50%;
        transform: translateX(-50%);
        border: 5px solid transparent;
        border-top-color: rgba(0, 0, 0, 0.85);
        opacity: 0;
        transition: opacity 0.2s ease;
        z-index: 10000;
    }

    .social-icon[data-tooltip]:hover::after,
    .social-icon[data-tooltip]:hover::before {
        opacity: 1;
    }
}

/* Desktop Layout (Large Screens: Floating on Right) */
@media screen and (min-width: 768px) {
    .social-widget-container {
        position: fixed;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        flex-direction: column;
        width: auto;
        padding: 0;
        z-index: 9999; /* Ensures it stays on top of other content */
    }
}
