/* 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) */
  }
}


/* 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);
}
