/* =========================================================
   ÉCHO TANGO - LECTEUR LIVRE 3.6
   Les pages sont des images générées une fois côté WordPress.
========================================================= */

.alc-echo-pdf,
.alc-echo-pdf * {
    box-sizing: border-box;
}

.alc-echo-pdf {
    --alc-orange: #f85903;
    --alc-black: #171717;
    width: min(1280px, calc(100% - 32px));
    max-width: 100%;
    margin: 42px auto 64px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, .09);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 16px 42px rgba(0, 0, 0, .09);
}

.alc-echo-pdf__header {
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    padding: 24px 28px;
    border-bottom: 4px solid var(--alc-orange);
    background: var(--alc-black);
    color: #fff;
}

.alc-echo-pdf__heading {
    min-width: 0;
}

.alc-echo-pdf__eyebrow {
    display: block;
    margin-bottom: 5px;
    color: var(--alc-orange);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.alc-echo-pdf__heading h2 {
    display: flex;
    gap: .16em;
    align-items: baseline;
    min-width: 0;
    margin: 0 !important;
    color: #fff !important;
    font-size: clamp(34px, 4vw, 58px) !important;
    font-weight: 900 !important;
    line-height: .94 !important;
    letter-spacing: -.035em;
    white-space: nowrap;
    text-transform: uppercase;
}

.alc-echo-pdf__heading h2 strong {
    color: var(--alc-orange);
    font-weight: inherit;
}

.alc-echo-pdf__meta {
    display: flex;
    gap: 9px;
    align-items: center;
    min-width: 0;
    margin-top: 10px;
    color: #d8d8d8;
    font-size: 13px;
    font-weight: 700;
}

.alc-echo-pdf__meta span {
    min-width: 0;
}

.alc-echo-pdf__meta i {
    flex: 0 0 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--alc-orange);
}

.alc-echo-pdf__header-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 9px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.alc-echo-pdf__action {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 14px;
    border: 1px solid var(--alc-orange);
    border-radius: 9px;
    background: var(--alc-orange);
    color: #fff !important;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.15;
    text-decoration: none !important;
    text-transform: uppercase;
}

.alc-echo-pdf__action--secondary {
    background: transparent;
}

.alc-echo-pdf__action .dashicons {
    flex: 0 0 auto;
}

.alc-echo-pdf__reader {
    width: 100%;
    min-width: 0;
    padding: 20px 22px 24px;
    outline: none;
    background: #ececec;
}

.alc-echo-pdf__toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    width: min(1080px, 100%);
    margin: 0 auto 16px;
}

.alc-echo-pdf__nav,
.alc-echo-pdf__tool {
    border: 0;
    cursor: pointer;
    font: inherit;
    transition: opacity .18s ease, transform .18s ease, background .18s ease;
}

.alc-echo-pdf__nav {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    justify-content: center;
    width: max-content;
    max-width: 100%;
    min-height: 40px;
    padding: 8px 13px;
    border-radius: 9px;
    background: var(--alc-black);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.alc-echo-pdf__nav:first-child {
    justify-self: start;
}

.alc-echo-pdf__nav:last-child {
    justify-self: end;
}

.alc-echo-pdf__nav:hover:not(:disabled),
.alc-echo-pdf__tool:hover {
    transform: translateY(-1px);
}

.alc-echo-pdf__nav:disabled {
    cursor: default;
    opacity: .28;
}

.alc-echo-pdf__counter {
    min-width: 86px;
    color: #333;
    font-size: 13px;
    font-weight: 900;
    text-align: center;
    white-space: nowrap;
}

.alc-echo-pdf__tools {
    display: flex;
    gap: 5px;
}

.alc-echo-pdf__tool {
    display: inline-flex;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #fff;
    color: #222;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .07);
}

.alc-echo-pdf__viewport {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 0 15px;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.alc-echo-pdf__pages {
    --alc-pdf-zoom: 1;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    min-width: 100%;
    margin: 0 auto;
    transition: opacity .12s ease, transform .12s ease;
}

.alc-echo-pdf__pages.is-turning {
    opacity: .58;
    transform: translateX(5px);
}

.alc-echo-pdf__page {
    position: relative;
    flex: 0 0 auto;
    width: calc(min(46%, 515px) * var(--alc-pdf-zoom));
    max-width: none;
    aspect-ratio: 210 / 297;
    overflow: hidden;
    margin: 0;
    border: 1px solid #cfcfcf;
    background: #fff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .16);
}

.alc-echo-pdf__pages.is-single .alc-echo-pdf__page {
    width: calc(min(60%, 565px) * var(--alc-pdf-zoom));
}

.alc-echo-pdf__page img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none !important;
    margin: 0;
    object-fit: contain;
    background: #fff;
    user-select: none;
    -webkit-user-drag: none;
}

.alc-echo-pdf__page-loader {
    position: absolute;
    z-index: 3;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: #f7f7f7;
}

.alc-echo-pdf__page.is-loading .alc-echo-pdf__page-loader {
    display: flex;
}

.alc-echo-pdf__page-loader i {
    display: block;
    width: 28px;
    height: 28px;
    border: 3px solid #dedede;
    border-top-color: var(--alc-orange);
    border-radius: 50%;
    animation: alcEchoPageSpin .7s linear infinite;
}

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

.alc-echo-pdf__pages.is-spread .alc-echo-pdf__page:first-child::after,
.alc-echo-pdf__pages.is-spread .alc-echo-pdf__page:last-child::after {
    position: absolute;
    z-index: 2;
    top: 0;
    width: 16px;
    height: 100%;
    content: "";
    pointer-events: none;
}

.alc-echo-pdf__pages.is-spread .alc-echo-pdf__page:first-child::after {
    right: -1px;
    background: linear-gradient(to left, rgba(0, 0, 0, .10), transparent);
}

.alc-echo-pdf__pages.is-spread .alc-echo-pdf__page:last-child::after {
    left: -1px;
    background: linear-gradient(to right, rgba(0, 0, 0, .08), transparent);
}

.alc-echo-pdf__page-fallback {
    display: flex;
    width: min(560px, 90%);
    min-height: 260px;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
    padding: 30px;
    margin: 0 auto;
    border: 1px dashed #bbb;
    border-radius: 12px;
    background: #fff;
    color: #555;
    text-align: center;
}

.alc-echo-pdf__page-fallback a {
    color: var(--alc-orange);
    font-weight: 900;
}

.alc-echo-pdf__hint {
    display: flex;
    gap: 7px;
    align-items: center;
    justify-content: center;
    max-width: 900px;
    margin: 5px auto 0;
    padding: 0 10px;
    color: #666;
    font-size: 11px;
    line-height: 1.35;
    text-align: center;
}

.alc-echo-pdf__empty {
    padding: 48px 28px;
    background: #f3f3f3;
    color: #666;
    font-weight: 800;
    text-align: center;
}

.alc-echo-pdf__reader:fullscreen {
    box-sizing: border-box;
    overflow: auto;
    width: 100vw;
    height: 100vh;
    padding: 18px;
    background: #dedede;
}

.alc-echo-pdf__reader:fullscreen .alc-echo-pdf__pages.is-single .alc-echo-pdf__page {
    width: calc(min(70vh, 620px) * var(--alc-pdf-zoom));
}

.alc-echo-pdf__reader:fullscreen .alc-echo-pdf__pages.is-spread .alc-echo-pdf__page {
    width: calc(min(43vw, 560px) * var(--alc-pdf-zoom));
}

/* =========================================================
   TABLETTE
========================================================= */

@media only screen and (max-width: 980px) {
    .alc-echo-pdf__header {
        align-items: flex-start;
    }

    .alc-echo-pdf__heading h2 {
        font-size: clamp(32px, 5.5vw, 48px) !important;
    }

    .alc-echo-pdf__header-actions {
        max-width: 280px;
    }

    .alc-echo-pdf__page {
        width: calc(min(45%, 450px) * var(--alc-pdf-zoom));
    }
}

/* =========================================================
   SMARTPHONE - aucune largeur ne dépasse le conteneur
========================================================= */

@media only screen and (max-width: 760px) {
    .alc-echo-pdf {
        width: 100%;
        max-width: 100%;
        margin: 24px auto 38px;
        border-radius: 14px;
    }

    .alc-echo-pdf__header {
        display: block;
        width: 100%;
        padding: 18px 16px 17px;
    }

    .alc-echo-pdf__eyebrow {
        margin-bottom: 5px;
        font-size: 9px;
        letter-spacing: .08em;
    }

    .alc-echo-pdf__heading h2 {
        gap: .14em;
        width: 100%;
        max-width: 100%;
        font-size: clamp(27px, 9.2vw, 38px) !important;
        line-height: .98 !important;
        letter-spacing: -.045em;
        white-space: nowrap;
    }

    .alc-echo-pdf__meta {
        gap: 7px;
        flex-wrap: wrap;
        margin-top: 8px;
        font-size: 11px;
        line-height: 1.25;
    }

    .alc-echo-pdf__header-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        max-width: none;
        margin-top: 15px;
    }

    .alc-echo-pdf__header-actions .alc-echo-pdf__action:only-child {
        grid-column: 1 / -1;
    }

    .alc-echo-pdf__action {
        width: 100%;
        min-width: 0;
        min-height: 39px;
        padding: 8px 7px;
        font-size: 9px;
    }

    .alc-echo-pdf__action .dashicons {
        width: 16px;
        height: 16px;
        font-size: 16px;
    }

    .alc-echo-pdf__reader {
        width: 100%;
        min-width: 0;
        padding: 11px 8px 16px;
    }

    .alc-echo-pdf__toolbar {
        grid-template-columns: 42px minmax(66px, auto) 42px;
        gap: 7px;
        width: 100%;
        margin-bottom: 9px;
    }

    .alc-echo-pdf__tools {
        display: none;
    }

    .alc-echo-pdf__nav {
        width: 42px;
        height: 38px;
        min-height: 38px;
        padding: 0;
        border-radius: 8px;
    }

    .alc-echo-pdf__nav:first-child,
    .alc-echo-pdf__nav:last-child {
        justify-self: center;
    }

    .alc-echo-pdf__nav-label {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
    }

    .alc-echo-pdf__nav .dashicons {
        width: 20px;
        height: 20px;
        font-size: 20px;
    }

    .alc-echo-pdf__counter {
        min-width: 0;
        font-size: 12px;
    }

    .alc-echo-pdf__viewport {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        padding: 3px 0 8px;
        touch-action: pan-y;
    }

    .alc-echo-pdf__pages,
    .alc-echo-pdf__pages.is-single,
    .alc-echo-pdf__pages.is-spread {
        display: flex;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        gap: 0;
        align-items: flex-start;
        justify-content: center;
        transform: none;
    }

    .alc-echo-pdf__page,
    .alc-echo-pdf__pages.is-single .alc-echo-pdf__page,
    .alc-echo-pdf__pages.is-spread .alc-echo-pdf__page {
        width: 100%;
        max-width: 100%;
        flex: 0 1 100%;
        margin: 0;
        border-radius: 2px;
        box-shadow: 0 7px 20px rgba(0, 0, 0, .15);
    }

    .alc-echo-pdf__page img {
        width: 100%;
        max-width: 100% !important;
        height: 100%;
    }

    .alc-echo-pdf__pages.is-spread .alc-echo-pdf__page::after {
        display: none;
    }

    .alc-echo-pdf__page-fallback {
        width: 100%;
        min-height: 220px;
        padding: 22px 16px;
    }

    .alc-echo-pdf__hint {
        gap: 5px;
        margin-top: 5px;
        padding: 0 4px;
        font-size: 9px;
        line-height: 1.3;
    }

    .alc-echo-pdf__hint .dashicons {
        display: none;
    }

    .alc-echo-pdf__reader:fullscreen {
        padding: 10px 7px;
    }

    .alc-echo-pdf__reader:fullscreen .alc-echo-pdf__page,
    .alc-echo-pdf__reader:fullscreen .alc-echo-pdf__pages.is-single .alc-echo-pdf__page,
    .alc-echo-pdf__reader:fullscreen .alc-echo-pdf__pages.is-spread .alc-echo-pdf__page {
        width: 100%;
        max-width: 100%;
    }
}

@media only screen and (max-width: 380px) {
    .alc-echo-pdf__heading h2 {
        font-size: clamp(25px, 8.8vw, 32px) !important;
    }

    .alc-echo-pdf__header-actions {
        grid-template-columns: 1fr;
    }

    .alc-echo-pdf__action {
        min-height: 37px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .alc-echo-pdf__pages,
    .alc-echo-pdf__nav,
    .alc-echo-pdf__tool {
        transition: none;
    }

    .alc-echo-pdf__page-loader i {
        animation: none;
        border-top-color: #dedede;
    }
}
