@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;1,500&family=Inter:wght@400;500;600&display=swap');

/* ---------- Theme tokens ---------- */

.tiab-wrap {
    --tiab-bg: #e6e8eb;
    --tiab-card: #ffffff;
    --tiab-ink: #1f2124;
    --tiab-ink-2: #3a3d42;
    --tiab-muted: #6f747c;
    --tiab-line: #d4d8de;
    --tiab-shadow: 0 10px 28px rgba(31, 33, 36, .12);
    --tiab-shadow-hover: 0 22px 44px rgba(31, 33, 36, .22);
    --tiab-cover-a: #6b7078;
    --tiab-cover-b: #2a2d31;
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    color: var(--tiab-ink);
    background: var(--tiab-bg);
    padding: 8px;
    border-radius: 18px;
    box-sizing: border-box;
}

.tiab-wrap *,
.tiab-wrap *::before,
.tiab-wrap *::after {
    box-sizing: border-box;
}

.tiab-theme-dark {
    --tiab-bg: #1c1e21;
    --tiab-card: #2a2d31;
    --tiab-ink: #eceef1;
    --tiab-ink-2: #c7cbd1;
    --tiab-muted: #9aa0a8;
    --tiab-line: #3d4147;
    --tiab-shadow: 0 10px 28px rgba(0, 0, 0, .45);
    --tiab-shadow-hover: 0 22px 44px rgba(0, 0, 0, .6);
    --tiab-cover-a: #4a4e55;
    --tiab-cover-b: #17181b;
}

/* ---------- Collection layouts ---------- */

.tiab-collection {
    display: grid;
    gap: 28px;
}

.tiab-cols-1 { --tiab-cols: 1; }
.tiab-cols-2 { --tiab-cols: 2; }
.tiab-cols-3 { --tiab-cols: 3; }
.tiab-cols-4 { --tiab-cols: 4; }

.tiab-layout-grid {
    grid-template-columns: repeat(var(--tiab-cols, 3), minmax(0, 1fr));
}

.tiab-layout-list,
.tiab-layout-feature {
    grid-template-columns: minmax(0, 1fr);
}

/* ---------- Card ---------- */

.tiab-book {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--tiab-card);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--tiab-shadow);
    transition: transform .3s ease, box-shadow .3s ease;
}

.tiab-book:hover {
    transform: translateY(-4px);
    box-shadow: var(--tiab-shadow-hover);
}

.tiab-cover {
    position: relative;
    aspect-ratio: 2 / 3;
    width: 100%;
    overflow: hidden;
    background: linear-gradient(160deg, var(--tiab-cover-a), var(--tiab-cover-b));
}

.tiab-cover img,
.tiab-cover-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s ease;
}

.tiab-book:hover .tiab-cover img {
    transform: scale(1.04);
}

.tiab-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 4rem;
    color: #e6e8eb;
    opacity: .85;
}

.tiab-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 22px 24px 26px;
    min-width: 0;
}

.tiab-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.tiab-badge,
.tiab-pill {
    display: inline-block;
    font-size: .66rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 999px;
    line-height: 1;
}

.tiab-badge {
    background: var(--tiab-ink);
    color: var(--tiab-card);
}

.tiab-badge--in_progress {
    background: var(--tiab-line);
    color: var(--tiab-ink);
}

.tiab-badge--upcoming {
    background: transparent;
    color: var(--tiab-ink);
    box-shadow: inset 0 0 0 1px var(--tiab-ink);
}

.tiab-pill {
    background: transparent;
    color: var(--tiab-muted);
    box-shadow: inset 0 0 0 1px var(--tiab-line);
}

.tiab-series {
    margin: 0 0 4px;
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--tiab-muted);
}

.tiab-series a {
    color: inherit;
    text-decoration: none;
}

.tiab-title {
    margin: 2px 0 4px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.85rem;
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: .2px;
    color: var(--tiab-ink);
}

.tiab-title a {
    color: inherit;
    text-decoration: none;
    background-image: linear-gradient(currentColor, currentColor);
    background-size: 0 1px;
    background-repeat: no-repeat;
    background-position: 0 100%;
    transition: background-size .3s ease;
}

.tiab-title a:hover,
.tiab-title a:focus-visible {
    background-size: 100% 1px;
}

.tiab-subtitle {
    margin: 0 0 6px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-size: 1.15rem;
    color: var(--tiab-ink-2);
}

.tiab-author {
    margin: 0 0 14px;
    font-size: .8rem;
    font-weight: 500;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--tiab-muted);
}

.tiab-desc {
    font-size: .95rem;
    line-height: 1.65;
    color: var(--tiab-ink-2);
    margin-bottom: 14px;
}

.tiab-desc p:first-child {
    margin-top: 0;
}

.tiab-desc p:last-child {
    margin-bottom: 0;
}

/* ---------- Progress ---------- */

.tiab-progress-wrap {
    margin-bottom: 14px;
}

.tiab-progress {
    height: 6px;
    width: 100%;
    background: var(--tiab-line);
    border-radius: 6px;
    overflow: hidden;
}

.tiab-progress-bar {
    display: block;
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--tiab-cover-a), var(--tiab-ink));
    transition: width .8s ease;
}

.tiab-progress-label {
    margin: 6px 0 0;
    font-size: .8rem;
    color: var(--tiab-muted);
}

/* ---------- Countdown ---------- */

.tiab-countdown {
    display: flex;
    gap: 10px;
    margin: 4px 0 8px;
}

.tiab-count {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    padding: 10px 6px 8px;
    border-radius: 10px;
    background: var(--tiab-bg);
    box-shadow: inset 0 0 0 1px var(--tiab-line);
}

.tiab-count span {
    display: block;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1;
    color: var(--tiab-ink);
    font-variant-numeric: tabular-nums;
}

.tiab-count small {
    display: block;
    margin-top: 4px;
    font-size: .62rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--tiab-muted);
}

.tiab-release-date {
    margin: 0 0 14px;
    font-size: .85rem;
    color: var(--tiab-muted);
}

/* ---------- Quote ---------- */

.tiab-quote {
    margin: 16px 0;
    padding: 2px 0 2px 18px;
    border-left: 2px solid var(--tiab-ink);
}

.tiab-quote p {
    margin: 0;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-size: 1.3rem;
    line-height: 1.35;
    color: var(--tiab-ink);
}

.tiab-quote footer {
    margin-top: 8px;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--tiab-muted);
}

/* ---------- Notify form ---------- */

.tiab-notify {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 6px;
}

.tiab-notify input[type="email"] {
    flex: 1 1 200px;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--tiab-line);
    border-radius: 999px;
    background: var(--tiab-bg);
    color: var(--tiab-ink);
    font: inherit;
    font-size: .9rem;
}

.tiab-notify input[type="email"]:focus {
    outline: 2px solid var(--tiab-ink);
    outline-offset: 2px;
}

.tiab-notify button:disabled {
    opacity: .6;
    cursor: wait;
}

.tiab-notify-msg {
    flex-basis: 100%;
    margin: 2px 0 0;
    font-size: .82rem;
    color: var(--tiab-muted);
}

.tiab-notify-msg.is-ok {
    color: var(--tiab-ink);
}

.tiab-notify-msg.is-error {
    color: #8a2b2b;
}

.tiab-hp,
.tiab-sr {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------- Buttons and links ---------- */

.tiab-links {
    list-style: none;
    margin: auto 0 0;
    padding: 14px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tiab-btn {
    display: inline-block;
    padding: 9px 16px;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-decoration: none;
    color: var(--tiab-ink);
    box-shadow: inset 0 0 0 1px var(--tiab-ink);
    transition: background .2s ease, color .2s ease;
}

.tiab-btn:hover,
.tiab-btn:focus-visible {
    background: var(--tiab-ink);
    color: var(--tiab-card);
}

.tiab-btn--solid {
    background: var(--tiab-ink);
    color: var(--tiab-card);
    border: 0;
    cursor: pointer;
    font: inherit;
    font-size: .8rem;
    font-weight: 600;
    padding: 11px 18px;
}

.tiab-btn--solid:hover {
    opacity: .88;
}

.tiab-isbn {
    margin: 12px 0 0;
    font-size: .72rem;
    letter-spacing: .06em;
    color: var(--tiab-muted);
}

/* ---------- Feature layout ---------- */

.tiab-layout-feature .tiab-book {
    flex-direction: row;
    max-width: 980px;
    margin: 0 auto;
}

.tiab-layout-feature .tiab-cover {
    flex: 0 0 38%;
    max-width: 38%;
    aspect-ratio: auto;
    min-height: 420px;
}

.tiab-layout-feature .tiab-body {
    padding: 36px 40px;
}

.tiab-layout-feature .tiab-title {
    font-size: 2.6rem;
}

/* ---------- List layout ---------- */

.tiab-layout-list .tiab-book {
    flex-direction: row;
    align-items: stretch;
}

.tiab-layout-list .tiab-cover {
    flex: 0 0 120px;
    max-width: 120px;
    aspect-ratio: 2 / 3;
    height: auto;
}

.tiab-layout-list .tiab-body {
    padding: 18px 22px;
}

.tiab-layout-list .tiab-title {
    font-size: 1.5rem;
}

.tiab-layout-list .tiab-desc {
    margin-bottom: 0;
}

.tiab-layout-list .tiab-quote,
.tiab-layout-list .tiab-notify,
.tiab-layout-list .tiab-countdown {
    display: none;
}

/* ---------- Author bio ---------- */

.tiab-bio {
    display: flex;
    gap: 22px;
    align-items: flex-start;
    margin: 28px auto 0;
    max-width: 980px;
    padding: 24px 28px;
    border-radius: 14px;
    background: var(--tiab-card);
    box-shadow: var(--tiab-shadow);
}

.tiab-bio-media {
    flex: 0 0 96px;
}

.tiab-bio-photo,
.tiab-bio-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
}

.tiab-bio-initial {
    background: linear-gradient(160deg, var(--tiab-cover-a), var(--tiab-cover-b));
    color: #e6e8eb;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2.2rem;
}

.tiab-bio-kicker {
    margin: 0 0 4px;
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--tiab-muted);
}

.tiab-bio-name {
    margin: 0 0 8px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--tiab-ink);
}

.tiab-bio-body {
    margin: 0 0 10px;
    line-height: 1.65;
    color: var(--tiab-ink-2);
}

.tiab-bio-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.tiab-bio-links a {
    font-size: .8rem;
    font-weight: 600;
    color: var(--tiab-ink);
    text-decoration: none;
    border-bottom: 1px solid var(--tiab-line);
}

.tiab-bio-links a:hover {
    border-bottom-color: var(--tiab-ink);
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
    .tiab-layout-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .tiab-layout-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .tiab-layout-feature .tiab-book {
        flex-direction: column;
    }

    .tiab-layout-feature .tiab-cover {
        flex: none;
        max-width: none;
        min-height: 0;
        width: 100%;
    }

    .tiab-layout-feature .tiab-body,
    .tiab-body {
        padding: 22px 20px;
    }

    .tiab-layout-feature .tiab-title {
        font-size: 2rem;
    }

    .tiab-bio {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .tiab-bio-links {
        justify-content: center;
    }
}

/* ---------- Shelf ---------- */

.tiab-shelf {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    padding: 22px 16px 0;
    min-height: 260px;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, var(--tiab-bg) 0%, var(--tiab-card) 100%);
    box-shadow: inset 0 -12px 0 var(--tiab-line), var(--tiab-shadow);
    overflow-x: auto;
}

.tiab-spine {
    flex: 1 1 0;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 6px;
    border-radius: 3px 3px 0 0;
    color: #f2f3f5;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .12), inset 5px 0 8px -5px rgba(0, 0, 0, .45), 0 2px 4px rgba(0, 0, 0, .2);
    transition: transform .25s ease;
}

.tiab-spine:hover {
    transform: translateY(-6px);
}

.tiab-spine-1 { background: linear-gradient(90deg, #373b41, #4a4f57); }
.tiab-spine-2 { background: linear-gradient(90deg, #52575f, #656a73); }
.tiab-spine-3 { background: linear-gradient(90deg, #202327, #2f3338); }
.tiab-spine-4 { background: linear-gradient(90deg, #6b7079, #7d828b); }
.tiab-spine-5 { background: linear-gradient(90deg, #41454b, #565b63); }

.tiab-spine-title {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    max-height: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: .04em;
    line-height: 1.1;
}

/* Spines are buttons: reset the browser look and keep the spine's own styling. */
.tiab-spine {
    appearance: none;
    border: 0;
    margin: 0;
    font: inherit;
    cursor: pointer;
    min-height: 0;
}

.tiab-spine:focus-visible {
    outline: 2px solid var(--tiab-ink);
    outline-offset: 3px;
}

.tiab-spine.is-active {
    transform: translateY(-10px);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .2), 0 0 0 2px var(--tiab-ink), 0 8px 18px rgba(0, 0, 0, .35);
}

/* ---------- Opened book (shelf) ---------- */

.tiab-shelf-stage:empty {
    display: none;
}

.tiab-shelf-stage {
    margin-top: 28px;
}

.tiab-open-wrap {
    position: relative;
    animation: tiab-stage-in .45s ease both;
}

@keyframes tiab-stage-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

.tiab-open-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    padding: 6px 14px;
    border: 1px solid var(--tiab-line);
    border-radius: 999px;
    background: var(--tiab-card);
    color: var(--tiab-ink);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.tiab-open-close:focus-visible {
    outline: 2px solid var(--tiab-ink);
    outline-offset: 2px;
}

.tiab-open-book {
    position: relative;
    perspective: 1800px;
    max-width: 880px;
    margin: 0 auto;
    min-height: 440px;
    border-radius: 4px 10px 10px 4px;
    background: #f7f7f5;
    box-shadow: var(--tiab-shadow);
    color: #1c1e21;
}

.tiab-open-pages {
    position: relative;
    padding: 44px 48px;
    min-height: 440px;
    box-sizing: border-box;
}

.tiab-open-pages .tiab-badges {
    margin-bottom: 10px;
}

.tiab-open-pages .tiab-badge {
    background: #1c1e21;
    color: #f7f7f5;
}

.tiab-open-pages .tiab-pill {
    color: #4a4f57;
    box-shadow: inset 0 0 0 1px #b8bcc2;
}

.tiab-open-pages .tiab-series,
.tiab-open-pages .tiab-open-author,
.tiab-open-pages .tiab-open-sub,
.tiab-open-pages .tiab-progress-label,
.tiab-open-pages .tiab-open-meta,
.tiab-open-pages .tiab-isbn {
    color: #5b6068;
}

.tiab-open-title {
    margin: 4px 0 4px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2.4rem;
    font-weight: 600;
    line-height: 1.1;
    color: #111315;
}

.tiab-open-sub {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-style: italic;
}

.tiab-open-author {
    margin: 0 0 14px;
    font-size: .95rem;
}

.tiab-open-pages .tiab-progress {
    background: #d9dce0;
    margin: 12px 0 4px;
}

.tiab-open-pages .tiab-progress-bar {
    background: #1c1e21;
}

.tiab-open-desc {
    margin: 18px 0;
    font-size: .98rem;
    line-height: 1.65;
    max-height: 340px;
    overflow-y: auto;
    padding-right: 6px;
}

.tiab-open-desc p {
    margin: 0 0 .9em;
}

.tiab-open-pages .tiab-quote {
    border-left-color: #1c1e21;
    color: #2b2f35;
}

.tiab-open-pages .tiab-quote footer {
    color: #5b6068;
}

.tiab-open-pages .tiab-links .tiab-btn {
    background: #1c1e21;
    color: #f7f7f5;
    box-shadow: none;
}

.tiab-open-pages .tiab-notify {
    margin-top: 14px;
}

/* The front cover sits over the pages and swings open from its left edge. */
.tiab-open-cover {
    position: absolute;
    inset: 0;
    z-index: 3;
    transform-origin: left center;
    transform-style: preserve-3d;
    transition: transform 1.1s cubic-bezier(.45, .05, .25, 1);
    cursor: pointer;
    border-radius: 4px 10px 10px 4px;
}

.tiab-open-book.is-open .tiab-open-cover {
    transform: rotateY(-172deg);
}

.tiab-open-front,
.tiab-open-back {
    position: absolute;
    inset: 0;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: inherit;
}

.tiab-open-front {
    background: linear-gradient(160deg, var(--tiab-cover-a), var(--tiab-cover-b));
    box-shadow: inset 6px 0 10px -6px rgba(0, 0, 0, .5);
}

.tiab-open-front .tiab-cover-img,
.tiab-open-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tiab-open-back {
    transform: rotateY(180deg);
    background: linear-gradient(90deg, #d9dce0, #f1f2f4);
    box-shadow: inset -8px 0 12px -8px rgba(0, 0, 0, .25);
}

@media (prefers-reduced-motion: reduce) {
    .tiab-open-cover,
    .tiab-open-wrap,
    .tiab-spine {
        transition: none;
        animation: none;
    }
}

/* ---------- Overlay card (carousel) ---------- */

.tiab-book--overlay {
    position: relative;
    isolation: isolate;
    min-height: 480px;
    background: #1c1e21;
    color: #f2f3f5;
}

.tiab-overlay-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    background: linear-gradient(160deg, var(--tiab-cover-a), var(--tiab-cover-b));
}

.tiab-overlay-bg .tiab-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .7;
    filter: blur(.5px) saturate(.9);
    transform: scale(1.03);
}

.tiab-overlay-scrim {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, rgba(18, 19, 22, .72) 0%, rgba(18, 19, 22, .4) 50%, rgba(18, 19, 22, .08) 100%);
}

.tiab-overlay-content {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 480px;
    max-width: 62%;
    padding: 40px 44px;
}

.tiab-book--overlay .tiab-badge {
    background: #f2f3f5;
    color: #1c1e21;
}

.tiab-book--overlay .tiab-badge--in_progress {
    background: rgba(255, 255, 255, .18);
    color: #f2f3f5;
}

.tiab-book--overlay .tiab-badge--upcoming {
    background: transparent;
    color: #f2f3f5;
    box-shadow: inset 0 0 0 1px #f2f3f5;
}

.tiab-book--overlay .tiab-pill {
    color: #c9ced5;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}

.tiab-book--overlay .tiab-series,
.tiab-book--overlay .tiab-author,
.tiab-book--overlay .tiab-progress-label,
.tiab-book--overlay .tiab-release-date {
    color: #aeb3ba;
}

.tiab-book--overlay .tiab-title {
    color: #fff;
    font-size: 2.6rem;
}

.tiab-book--overlay .tiab-title a {
    color: inherit;
    text-decoration: none;
}

.tiab-book--overlay .tiab-subtitle {
    color: #d6d9de;
}

.tiab-overlay-desc {
    margin: 14px 0 0;
    max-width: 56ch;
    font-size: .98rem;
    line-height: 1.6;
    color: #e3e6ea;
}

.tiab-book--overlay .tiab-quote {
    border-left-color: #f2f3f5;
}

.tiab-book--overlay .tiab-quote p {
    color: #fff;
}

.tiab-book--overlay .tiab-quote footer {
    color: #aeb3ba;
}

.tiab-book--overlay .tiab-progress {
    background: rgba(255, 255, 255, .15);
}

.tiab-book--overlay .tiab-progress-bar {
    background: #f2f3f5;
}

.tiab-book--overlay .tiab-links {
    margin-top: auto;
}

.tiab-book--overlay .tiab-btn {
    color: #f2f3f5;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6);
}

.tiab-book--overlay .tiab-btn:hover,
.tiab-book--overlay .tiab-btn:focus-visible {
    background: #f2f3f5;
    color: #1c1e21;
}

.tiab-book--overlay .tiab-notify input[type="email"] {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .3);
    color: #fff;
}

.tiab-book--overlay .tiab-notify button {
    background: #f2f3f5;
    color: #1c1e21;
}

@media (max-width: 640px) {
    .tiab-overlay-content {
        max-width: 100%;
        padding: 28px 22px;
    }

    .tiab-overlay-scrim {
        background: linear-gradient(180deg, rgba(18, 19, 22, .6) 0%, rgba(18, 19, 22, .95) 55%);
    }

    .tiab-book--overlay .tiab-title {
        font-size: 2rem;
    }
}

/* Read more toggle inside the overlay card */
.tiab-more summary {
    display: inline-block;
    list-style: none;
    cursor: pointer;
    margin-top: 6px;
    padding-bottom: 2px;
    border-bottom: 1px solid rgba(255, 255, 255, .4);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #f2f3f5;
}

.tiab-more summary::-webkit-details-marker {
    display: none;
}

.tiab-more summary:focus-visible {
    outline: 2px solid #f2f3f5;
    outline-offset: 3px;
}

.tiab-more-close {
    display: none;
}

.tiab-more[open] .tiab-more-open {
    display: none;
}

.tiab-more[open] .tiab-more-close {
    display: inline;
}

.tiab-more > p {
    margin: 10px 0 0;
    max-width: 56ch;
    font-size: .98rem;
    line-height: 1.6;
    color: #e3e6ea;
}

/* ---------- Carousel ---------- */

.tiab-carousel-wrap {
    position: relative;
}

.tiab-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 12px 0 24px;
}

.tiab-carousel::-webkit-scrollbar {
    display: none;
}

.tiab-carousel:focus-visible {
    outline: 2px solid var(--tiab-ink);
    outline-offset: 4px;
}

.tiab-carousel-item {
    flex: 0 0 100%;
    box-sizing: border-box;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    justify-content: center;
}

.tiab-carousel-item .tiab-book {
    width: 100%;
    max-width: 980px;
}

/* Arrows sit on the left and right edges of the card; the layer itself ignores
   clicks so the card stays usable everywhere else. */
.tiab-carousel-nav {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
}

.tiab-carousel-nav button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
    background: rgba(18, 19, 22, .6);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background .2s ease, transform .2s ease;
}

.tiab-carousel-nav button:hover {
    background: rgba(18, 19, 22, .85);
}

.tiab-carousel-nav button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.tiab-carousel-prev {
    left: 8px;
}

.tiab-carousel-next {
    right: 8px;
}

.tiab-carousel-nav button:disabled {
    opacity: .3;
    cursor: default;
}

.tiab-carousel-count {
    position: absolute;
    left: 50%;
    bottom: 4px;
    transform: translateX(-50%);
    pointer-events: auto;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(18, 19, 22, .6);
    color: #fff;
    font-size: .8rem;
    letter-spacing: .1em;
    font-variant-numeric: tabular-nums;
}

/* Cover tiles used by the spotlight strip */
.tiab-shelf-item {
    text-align: center;
    transition: transform .3s ease;
}

.tiab-shelf-item:hover {
    transform: translateY(-6px);
}

.tiab-shelf-cover {
    display: block;
    text-decoration: none;
}

.tiab-shelf-cover .tiab-cover {
    border-radius: 3px 6px 6px 3px;
    box-shadow: inset 7px 0 9px -5px rgba(0, 0, 0, .4), 0 10px 18px rgba(0, 0, 0, .22);
}

.tiab-shelf-title {
    margin: 10px 0 2px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: .98rem;
    font-weight: 600;
    line-height: 1.2;
}

.tiab-shelf-title a {
    color: var(--tiab-ink);
    text-decoration: none;
}

.tiab-shelf-author {
    margin: 0;
    font-size: .68rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--tiab-muted);
}

/* ---------- Spotlight ---------- */

.tiab-spotlight-hero {
    margin-bottom: 28px;
}

.tiab-spotlight-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 22px 18px;
    max-width: 980px;
    margin: 0 auto;
    padding: 0 4px;
}

/* ---------- Timeline ---------- */

.tiab-timeline {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 860px;
}

.tiab-timeline::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 129px;
    width: 2px;
    background: var(--tiab-line);
}

.tiab-timeline-item {
    display: grid;
    grid-template-columns: 100px 24px 1fr;
    column-gap: 18px;
    padding-bottom: 26px;
}

.tiab-timeline-item:last-child {
    padding-bottom: 0;
}

.tiab-timeline-date {
    padding-top: 18px;
    text-align: right;
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--tiab-muted);
}

.tiab-timeline-dot {
    justify-self: center;
    width: 12px;
    height: 12px;
    margin-top: 22px;
    border-radius: 50%;
    background: var(--tiab-card);
    box-shadow: 0 0 0 2px var(--tiab-ink);
    position: relative;
    z-index: 1;
}

.tiab-timeline-card {
    background: var(--tiab-card);
    border-radius: 12px;
    box-shadow: var(--tiab-shadow);
    padding: 16px 20px;
}

.tiab-timeline-card .tiab-badges {
    margin-bottom: 6px;
}

.tiab-timeline-title {
    margin: 2px 0 2px;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.45rem;
    font-weight: 600;
    line-height: 1.1;
}

.tiab-timeline-title a {
    color: var(--tiab-ink);
    text-decoration: none;
}

.tiab-timeline-meta {
    margin: 0;
    font-size: .78rem;
    color: var(--tiab-muted);
}

.tiab-timeline-excerpt {
    margin: 8px 0 0;
    font-size: .9rem;
    line-height: 1.55;
    color: var(--tiab-ink-2);
}

/* ---------- Catalog ---------- */

.tiab-catalog-wrap {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: var(--tiab-shadow);
}

.tiab-catalog {
    width: 100%;
    border-collapse: collapse;
    background: var(--tiab-card);
    font-size: .9rem;
}

.tiab-catalog th,
.tiab-catalog td {
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--tiab-line);
}

.tiab-catalog tbody tr:last-child td {
    border-bottom: 0;
}

.tiab-catalog th {
    background: var(--tiab-bg);
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--tiab-muted);
    white-space: nowrap;
}

.tiab-catalog-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--tiab-ink);
    text-decoration: none;
}

.tiab-catalog-sub {
    font-size: .8rem;
    color: var(--tiab-muted);
}

.tiab-catalog .tiab-btn {
    padding: 6px 12px;
    font-size: .72rem;
}

/* ---------- Layout responsive rules ---------- */

@media (max-width: 640px) {
    .tiab-timeline::before {
        left: 7px;
    }

    .tiab-timeline-item {
        grid-template-columns: 24px 1fr;
        column-gap: 14px;
    }

    .tiab-timeline-date {
        grid-column: 2;
        grid-row: 1;
        padding-top: 0;
        text-align: left;
    }

    .tiab-timeline-dot {
        grid-column: 1;
        grid-row: 1 / span 2;
        margin-top: 2px;
    }

    .tiab-timeline-card {
        grid-column: 2;
        grid-row: 2;
    }

    .tiab-catalog .tiab-col-hide-sm {
        display: none;
    }

    .tiab-spotlight-strip {
        grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .tiab-shelf-item,
    .tiab-carousel-item {
        transition: none;
    }

    .tiab-book,
    .tiab-cover img,
    .tiab-progress-bar,
    .tiab-title a {
        transition: none;
    }
}

/* Carousel description: white panel with black text. Placed last and scoped
   to the carousel card so it wins over the general overlay rules above. */
.tiab-book.tiab-book--overlay .tiab-overlay-desc {
    margin: 18px 0 0;
    max-width: none;
    padding: 22px 26px;
    border-radius: 6px;
    background: #fff;
    color: #111;
    font-size: .95rem;
    line-height: 1.65;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}

.tiab-book.tiab-book--overlay .tiab-overlay-desc p,
.tiab-book.tiab-book--overlay .tiab-overlay-desc div,
.tiab-book.tiab-book--overlay .tiab-overlay-desc li {
    color: #111;
}

.tiab-book.tiab-book--overlay .tiab-overlay-desc > p:first-child {
    margin-top: 0;
}

.tiab-book.tiab-book--overlay .tiab-overlay-desc p {
    margin: 0 0 .9em;
}

.tiab-book.tiab-book--overlay .tiab-overlay-desc .tiab-more {
    margin-top: 6px;
}

.tiab-book.tiab-book--overlay .tiab-overlay-desc .tiab-more summary {
    display: inline-block;
    list-style: none;
    cursor: pointer;
    padding-bottom: 2px;
    border-bottom: 1px solid #111;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #111;
}

.tiab-book.tiab-book--overlay .tiab-overlay-desc .tiab-more summary::-webkit-details-marker {
    display: none;
}

.tiab-book.tiab-book--overlay .tiab-overlay-desc .tiab-more-body {
    margin-top: .9em;
}

.tiab-book.tiab-book--overlay .tiab-overlay-desc .tiab-more-close {
    display: none;
}

.tiab-book.tiab-book--overlay .tiab-overlay-desc .tiab-more[open] .tiab-more-open {
    display: none;
}

.tiab-book.tiab-book--overlay .tiab-overlay-desc .tiab-more[open] .tiab-more-close {
    display: inline;
}

