/* Custom Stylesheet overrides */

/* ============================================================
   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;
}

/* 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;    
}

/* ============================================================
   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;
}

/* 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 {
        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 .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 p {
    line-height: 150%;
    margin-top: 0;
    margin-bottom: 0.6rem;
    font-weight: 350 !important;
}
.work-synopsis strong {
    font-weight:600 !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 */
    }
}
