@import url('https://fonts.googleapis.com/css2?family=Istok+Web:wght@400;700&display=swap');

:root {
    --primary-color: #252525;
    --secondary-color: #987864;
    --light-color: #DBDBDB;
    --text-color: #252525;
    --home-bg-color: #FCFCFC;
}

/* ── Title section ─────────────────────────────────── */

.brochure-header {
    padding-bottom: 60px;
}

h2 {
    font-size: 50px;
    font-weight: bold;
    text-transform: uppercase;
}

.top-line {
    height: 3px;
    width: 20em;
    margin: 35px 0;
    background-color: var(--secondary-color);
}

.download-btn {
    display: inline-block;
    padding: 12px 44px;
    background-color: var(--primary-color);
    color: var(--light-color);
    border-radius: 8px;
    font-family: 'Istok Web', Arial, sans-serif;
    font-weight: bold;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background-color 0.2s ease, color 0.2s ease;
    border: 2px solid var(--primary-color);
}

.download-btn:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #fff;
}

/* ── Book section background ───────────────────────── */

.book-section {
    background-color: #f0eeec;
    padding: 70px 6% 90px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 60px;
}

/* ── Intro text (left column) ──────────────────────── */

.brochure-intro {
    flex: 0 0 300px;
    text-align: left;
}

.brochure-intro h3 {
    font-size: 22px;
    font-weight: bold;
    text-transform: uppercase;
    line-height: 1.3;
    margin-bottom: 16px;
}

.brochure-intro p {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

/* ── Book area (right column) ──────────────────────── */

.book-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* ── Loading spinner ───────────────────────────────── */

.book-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 80px 40px;
    color: #888;
    font-size: 15px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e0dbd7;
    border-top-color: var(--secondary-color);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Book wrapper: flip buttons + canvas ───────────── */

.book-wrapper {
    display: none;
    align-items: center;
    gap: 20px;
    max-width: 100%;
    overflow: hidden;
}

.book-section {
    overflow: hidden;   /* clip any JS-sized canvas that overflows */
}

.flip-btn {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--secondary-color);
    background: #fff;
    color: var(--secondary-color);
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    padding: 0;
    user-select: none;
}

.flip-btn:hover {
    background-color: var(--secondary-color);
    color: #fff;
}

/* The StPageFlip container receives its own inline dimensions */
#book-container {
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.12),
        0 16px 48px rgba(0, 0, 0, 0.18);
}

/* Pages inside StPageFlip */
#book-container .page {
    background-color: #fff;
    overflow: hidden;
}

#book-container .page canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* ── Page counter ──────────────────────────────────── */

.book-info {
    display: none;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #777;
    letter-spacing: 0.5px;
}

/* ── Error / no PDF state ──────────────────────────── */

.book-error {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 60px 40px;
    text-align: center;
    color: #666;
    font-size: 15px;
    line-height: 1.8;
}

/* ── Responsive ────────────────────────────────────── */

@media (max-width: 1100px) {
    .book-section {
        flex-direction: column;
        align-items: center;
        padding: 50px 20px 70px;
    }

    .brochure-intro {
        flex: none;
        width: 100%;
        text-align: center;
    }

    .book-area {
        width: 100%;
    }

    .flip-btn {
        width: 36px;
        height: 36px;
        font-size: 22px;
    }
}
