/* Magazine.css - bladerviewer voor het magazine (hoort bij JavaScript/Magazine.js) */

.dbwmag {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 225px); /* kop + menu van de webshop zijn samen ~212px: het boek past dan zonder scrollen */
    min-height: 440px;
    max-height: 1200px;
    background: #e9e7e3;
    color: #2b2b2b;
    border-radius: 6px;
    overflow: hidden;
    text-align: left;
    outline: none;
    -webkit-user-select: none;
    user-select: none;
    box-sizing: border-box;
}
.dbwmag *, .dbwmag *::before, .dbwmag *::after { box-sizing: border-box; }
.dbwmag:fullscreen { height: 100%; max-height: none; border-radius: 0; }
.dbwmag:-webkit-full-screen { height: 100%; max-height: none; border-radius: 0; width: 100%; }
.dbwmag.dbwmag-venster { position: fixed; top: 0; right: 0; bottom: 0; left: 0; height: auto; max-height: none; z-index: 100000; border-radius: 0; }

/* ---- werkbalk ---- */
.dbwmag-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #fff;
    border-bottom: 1px solid #d6d3cd;
    flex: 0 0 auto;
}
.dbwmag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #2b2b2b;
    cursor: pointer;
    flex: 0 0 auto;
}
.dbwmag-btn:hover, .dbwmag-btn:focus-visible { background: #efedea; color: #000; }
.dbwmag-btn:disabled { opacity: .25; cursor: default; }
.dbwmag-zoek {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 340px;
    margin: 0 auto 0 4px;
    border: 1px solid #cfcbc4;
    border-radius: 6px;
    background: #fff;
}
.dbwmag-zoek input {
    flex: 1 1 auto;
    min-width: 0;
    height: 38px;
    padding: 0 10px;
    border: 0;
    background: transparent;
    font-size: 16px; /* onder 16px zoomt iOS de pagina in bij focus */
    outline: none;
    -webkit-user-select: text;
    user-select: text;
}
.dbwmag-zoek .dbwmag-btn { width: 38px; height: 38px; }
.dbwmag-pos { display: inline-flex; align-items: center; white-space: nowrap; font-size: 15px; flex: 0 0 auto; }
.dbwmag-pos input {
    width: 54px;
    height: 38px;
    padding: 0 4px;
    border: 1px solid #cfcbc4;
    border-radius: 6px;
    text-align: center;
    font-size: 16px;
    -moz-appearance: textfield;
    appearance: textfield;
}
.dbwmag-pos input::-webkit-outer-spin-button, .dbwmag-pos input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.dbwmag-van { padding: 0 6px 0 4px; color: #666; }

/* ---- boek ---- */
.dbwmag-view { position: relative; flex: 1 1 auto; min-height: 0; display: flex; }
.dbwmag-scroll {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    overflow: hidden;
    padding: 14px 52px;
    -webkit-overflow-scrolling: touch;
}
.dbwmag-enkel .dbwmag-scroll { padding: 8px; }
.dbwmag-ingezoomd .dbwmag-scroll { overflow: auto; padding: 8px; cursor: grab; }
.dbwmag-boek {
    position: relative;
    margin: auto;
    flex: 0 0 auto;
    display: flex;
    -webkit-perspective: 2600px;
    perspective: 2600px;
    transition: transform .6s ease, -webkit-transform .6s ease;
    cursor: pointer;
}
.dbwmag-ingezoomd .dbwmag-boek { cursor: inherit; transition: none; }
.dbwmag-half { position: relative; flex: 1 1 0; min-width: 0; height: 100%; background: #fff; box-shadow: 0 3px 14px rgba(0, 0, 0, .22); }
.dbwmag-enkel .dbwmag-l { display: none; }
.dbwmag-half img, .dbwmag-blad img { display: block; width: 100%; height: 100%; -webkit-user-drag: none; }
/* schaduw in de rug van het boek */
.dbwmag-dubbel .dbwmag-l::after, .dbwmag-dubbel .dbwmag-r::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 7%;
    pointer-events: none;
}
.dbwmag-dubbel .dbwmag-l::after { right: 0; background: linear-gradient(to left, rgba(0, 0, 0, .16), rgba(0, 0, 0, 0)); }
.dbwmag-dubbel .dbwmag-r::after { left: 0; background: linear-gradient(to right, rgba(0, 0, 0, .16), rgba(0, 0, 0, 0)); }

/* het omslaande blad */
.dbwmag-blad {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    z-index: 5;
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
    transition: transform .7s cubic-bezier(.45, .05, .35, 1), -webkit-transform .7s cubic-bezier(.45, .05, .35, 1);
}
.dbwmag-blad-r { left: 50%; -webkit-transform-origin: left center; transform-origin: left center; }
.dbwmag-blad-l { left: 0; -webkit-transform-origin: right center; transform-origin: right center; }
.dbwmag-blad img {
    position: absolute;
    top: 0;
    left: 0;
    background: #fff;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    box-shadow: 0 3px 14px rgba(0, 0, 0, .25);
}
.dbwmag-blad .dbwmag-achter { -webkit-transform: rotateY(180deg); transform: rotateY(180deg); }

/* enkele pagina: kort inschuiven */
@keyframes dbwmag-in-r { from { transform: translateX(28%); opacity: .2; } to { transform: none; opacity: 1; } }
@keyframes dbwmag-in-l { from { transform: translateX(-28%); opacity: .2; } to { transform: none; opacity: 1; } }
.dbwmag-in-r { animation: dbwmag-in-r .25s ease-out; }
.dbwmag-in-l { animation: dbwmag-in-l .25s ease-out; }

/* pijlen links en rechts */
.dbwmag-nav {
    position: absolute;
    top: 50%;
    width: 44px;
    height: 64px;
    margin-top: -32px;
    background: rgba(255, 255, 255, .85);
    box-shadow: 0 1px 5px rgba(0, 0, 0, .2);
    z-index: 6;
}
.dbwmag-nav:hover { background: #fff; }
.dbwmag-prev { left: 4px; }
.dbwmag-next { right: 4px; }
.dbwmag-enkel .dbwmag-nav { display: none; } /* telefoon: vegen of tikken */
.dbwmag-ingezoomd.dbwmag-enkel .dbwmag-nav { display: inline-flex; }

/* ---- paneel met miniaturen / zoekresultaten ---- */
.dbwmag-paneel {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 340px;
    max-width: 100%;
    display: none;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid #d6d3cd;
    box-shadow: 4px 0 16px rgba(0, 0, 0, .15);
    z-index: 10;
}
.dbwmag-paneel.dbwmag-open { display: flex; }
.dbwmag-paneelkop { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 4px 14px; border-bottom: 1px solid #e3e0da; flex: 0 0 auto; }
.dbwmag-paneelinhoud { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px; }
.dbwmag-minis { display: flex; flex-wrap: wrap; margin: -5px; }
.dbwmag-mini { width: 33.333%; padding: 5px; border: 0; background: transparent; cursor: pointer; font-size: 12px; color: #666; }
.dbwmag-mini img { display: block; width: 100%; height: auto; background: #f1efec; border: 2px solid transparent; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
.dbwmag-mini span { display: block; padding-top: 3px; text-align: center; }
.dbwmag-mini:hover img { border-color: #9aa3b5; }
.dbwmag-mini.dbwmag-nu img { border-color: #1f3f7a; }
.dbwmag-mini.dbwmag-nu span { color: #1f3f7a; font-weight: bold; }
.dbwmag-treffer {
    display: block;
    width: 100%;
    padding: 9px 8px;
    border: 0;
    border-bottom: 1px solid #eeebe6;
    background: transparent;
    text-align: left;
    font-size: 14px;
    line-height: 1.4;
    color: #2b2b2b;
    cursor: pointer;
}
.dbwmag-treffer:hover { background: #f5f3f0; }
.dbwmag-treffer strong { display: block; color: #1f3f7a; }
.dbwmag-treffer mark { background: #ffe58a; padding: 0 1px; }
.dbwmag-leeg { padding: 12px 6px; color: #666; }

/* ---- schuifbalk ---- */
.dbwmag-voet { flex: 0 0 auto; padding: 4px 16px 8px; background: #e9e7e3; }
.dbwmag-voet input { display: block; width: 100%; max-width: 700px; margin: 0 auto; height: 28px; cursor: pointer; }

@media (max-width: 600px) {
    .dbwmag { height: calc(100vh - 90px); border-radius: 0; }
    /* te smal voor alles naast elkaar: het zoekveld krijgt een eigen regel eronder */
    .dbwmag-bar { gap: 2px; padding: 4px 6px; flex-wrap: wrap; }
    .dbwmag-btn { width: 38px; }
    .dbwmag-pos { margin-left: auto; }
    .dbwmag-zoek { order: 10; flex: 1 1 100%; max-width: none; margin: 4px 0 2px; }
    .dbwmag-pos input { width: 46px; }
    .dbwmag-van { padding-right: 2px; }
    .dbwmag-mini { width: 33.333%; }
}

@media (prefers-reduced-motion: reduce) {
    .dbwmag-boek, .dbwmag-blad { transition: none; }
    .dbwmag-in-r, .dbwmag-in-l { animation: none; }
}
