/* ============================================
   Max Book Popup — full-screen sponsored book ad
   Full-viewport takeover shown to ad-supported
   (non-ad-free) visitors, once/day, after 2 min.
   Blocks the whole screen until dismissed or
   clicked through to Amazon.
   ============================================ */

.bookad-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(20, 14, 8, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}
.bookad-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Full-screen takeover panel */
.bookad-popup {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    background: radial-gradient(circle at 50% 30%, #fdf6ec 0%, #f3e4cd 55%, #e9d5b6 100%);
    color: #3a2e26;
    transform: scale(1.04);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
    overflow-y: auto;
}
.bookad-overlay.visible .bookad-popup {
    transform: scale(1);
    opacity: 1;
}

/* Sponsored label — pinned top */
.bookad-label {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9a7b56;
}
.bookad-label-text {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
}
.bookad-series {
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.75rem;
    color: #b07a3c;
    font-weight: 700;
}

/* Close button — pinned top-right, always available */
.bookad-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(58, 46, 38, 0.2);
    background: rgba(255, 255, 255, 0.7);
    color: #6b5a48;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s, transform 0.2s;
}
.bookad-close:hover {
    color: #3a2e26;
    background: #fff;
    transform: rotate(90deg);
}

/* Centered content column */
.bookad-content {
    max-width: 560px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bookad-cover {
    width: 220px;
    max-width: 55vw;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
    display: block;
    margin-bottom: 1.4rem;
}

.bookad-title {
    margin: 0 0 0.3rem;
    font-size: 1.9rem;
    line-height: 1.15;
    font-weight: 800;
    color: #2f2016;
}
@media (max-width: 480px) {
    .bookad-title { font-size: 1.5rem; }
    .bookad-cover { margin-bottom: 1rem; }
}
.bookad-author {
    margin: 0 0 0.7rem;
    font-size: 0.95rem;
    color: #7a6555;
}
.bookad-author strong {
    color: #5a4636;
    font-weight: 600;
}

/* Star rating */
.bookad-rating {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.9rem;
    font-size: 0.9rem;
    color: #7a6555;
}
.bookad-stars {
    color: #e6a817;
    letter-spacing: 2px;
    font-size: 1rem;
}

.bookad-blurb {
    margin: 0 0 1.6rem;
    font-size: 1rem;
    line-height: 1.55;
    color: #4a3a2d;
    max-width: 480px;
}

/* Primary CTA */
.bookad-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-width: 260px;
    padding: 0.9rem 2rem;
    background: linear-gradient(180deg, #ffd814 0%, #f7ca00 100%);
    color: #111;
    font-size: 1.05rem;
    font-weight: 800;
    text-decoration: none;
    border: 1px solid #e0a800;
    border-radius: 999px;
    box-shadow: 0 6px 18px rgba(240, 190, 0, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.bookad-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 9px 24px rgba(240, 190, 0, 0.5);
    color: #111;
    text-decoration: none;
}

.bookad-skip {
    margin-top: 1.1rem;
    background: none;
    border: none;
    color: #9a8574;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.bookad-skip:hover {
    color: #6b5a48;
}
