/* -------------------------------------------------- */
/* Container                                           */
/* -------------------------------------------------- */

##bpv-container {
    width: 100%;
    /* max-width: 900px; */
    margin: 40px auto;
    perspective: 1500px; /* optional */
    box-sizing: border-box; /* wichtig! */
    min-height: 50px;
    visibility: hidden;
}

#bpv-container {
    --wp--custom--ast-content-width-size: <?php echo $book_width; ?>px !important;
    max-width: <?php echo $book_width; ?>px !important;
}

#bpv-container.bpv-ready {
    visibility: visible;
}

/* -------------------------------------------------- */
/* Buch / Rahmen                                      */
/* -------------------------------------------------- */

.bpv-book {
    position: relative;
    width: 100%;
    min-height: 300px;
    background: #fdf8e4;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    box-sizing: border-box;
    overflow: hidden;
}

/* -------------------------------------------------- */
/* Layout Desktop: links Bild, rechts Text            */
/* -------------------------------------------------- */

.bpv-page {
  display: flex;
  width: 100%;          /* Gesamtbreite = 100% des Viewports oder Elterncontainers */
  max-width: 1200px;    /* optional: feste Gesamtbreite, damit klar ist, wovon die Prozente berechnet werden */
  margin: 0 auto;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

.bpv-left {
  flex: 0 0 15%;        /* prozentuale Breite der linken Spalte */
  background: blue !important; /* Testfarbe */
  padding: 10px;
  box-sizing: border-box;
  min-width: 0;
}

.bpv-content {
  flex: 1;              /* nimmt den Rest */
  background: #fff;
  padding: 10px;
  box-sizing: border-box;
  overflow-y: auto;
  min-height: 0;
}

.bpv-img {
    height: 200px;
    width: auto;
    max-width: 100%;
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

/* -------------------------------------------------- */
/* Desktop Titel                                       */
/* -------------------------------------------------- */

.bpv-desktop-title {
    display: inline-block;
    text-align: center;
    font-family: Arial, sans-serif;
    font-size: 24px;
    font-weight: bold;
    color: #FFA500;
    margin-top: 10px;
    padding: 5px;
    border: 5px solid green;
    background: #ffffff;
    width: calc(100% - 10px);
    margin-left: 5px;
    margin-right: 5px;
    word-wrap: break-word;
    word-break: break-word;
    box-sizing: border-box;
}

/* -------------------------------------------------- */
/* Content rechts                                      */
/* -------------------------------------------------- */

.bpv-content {
    flex: 1;
    overflow-y: auto;
    max-height: 300px;
    padding-right: 10px;
    box-sizing: border-box;
}

.bpv-content::-webkit-scrollbar {
    width: 8px;
}

.bpv-content::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
}

.bpv-content::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
}

.bpv-content p {
    margin-top: 0;
    margin-bottom: 1em;
}

.bpv-content h1,
.bpv-content h2,
.bpv-content h3,
.bpv-content h4,
.bpv-content h5,
.bpv-content h6 {
    margin-top: 0;
}

/* -------------------------------------------------- */
/* Navigation                                          */
/* -------------------------------------------------- */

.bpv-arrows {
    margin-top: 3px;
	margin-bottom: 30px; /* oder 2em, je nach Design */
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
}

.bpv-bold {
    font-weight: bold;
}
.bpv-italic {
    font-style: italic;
}
.bpv-underline {
    text-decoration: underline;
}

/* -------------------------------------------------- */
/* Mobile Titel                                        */
/* -------------------------------------------------- */

.bpv-mobile-title {
    display: none;
    box-sizing: border-box;
}

/* -------------------------------------------------- */
/* Responsive                                          */
/* -------------------------------------------------- */

@media (max-width: 1024px) {

    .bpv-book {
        background: transparent !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        min-height: auto !important;
    }

    .bpv-page,
    .bpv-desktop-title {
        display: none !important;
    }

    .bpv-mobile-title {
        display: block !important;
        text-align: center;
        font-family: Arial, sans-serif;
        font-size: 24px;
        font-weight: bold;
        color: #FFA500;
        margin: 10px 0 5px 0;
        padding: 10px;
        border: 1px solid #ccc;
        border-radius: 6px;
        background: #ffffff;
    }

    .bpv-arrows {
        margin-top: 10px !important;
        justify-content: center !important;
        gap: 12px !important;
        flex-wrap: wrap;
    }
}

/* -------------------------------------------------- */
/* Mobile Titel (statisch, ohne Styling!)             */
/* -------------------------------------------------- */

.bpv-mobile-title {
    display: none;
    box-sizing: border-box;
    word-wrap: break-word;
    word-break: break-word;
}

/* -------------------------------------------------- */
/* Responsive                                          */
/* -------------------------------------------------- */

@media (max-width: 1024px) {

    .bpv-book {
        background: transparent !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        min-height: auto !important;
    }

    /* Desktop-Layout ausblenden */
    .bpv-page,
    .bpv-desktop-title {
        display: none !important;
    }

    /* Mobile Titel aktivieren */
    .bpv-mobile-title {
        display: block !important;
    }

    /* Mobile Layout: einspaltig */
    .bpv-content {
        width: 100% !important;
        padding: 10px;
        box-sizing: border-box;
    }

    .bpv-left {
        display: none !important;
    }

    .bpv-arrows {
        margin-top: 10px !important;
        justify-content: center !important;
        gap: 12px !important;
        flex-wrap: wrap;
    }
}

@media (max-width: 600px) {

    #bpv-container {
        margin: 20px auto;
        padding: 0 10px;
    }

    .bpv-mobile-title {
        padding: 8px;
    }
}
