/* Presentation layer. Slider, zoom, crop, and page image sizing stay in viewer.css. */

.ar-epaper-shell {
    --ar-epaper-header-bg: #ffffff;
    --ar-epaper-header-text: #1a1a1a;
    --ar-epaper-menu-bg: #e10600;
    --ar-epaper-menu-text: #ffffff;
    --ar-epaper-scroller-bg: #ffffff;
    --ar-epaper-scroller-label-bg: #e10600;
    --ar-epaper-scroller-label-text: #ffffff;
    --ar-epaper-scroller-text: #1a1a1a;
    --ar-epaper-title-bg: #e10600;
    --ar-epaper-title-text: #ffffff;
    --ar-epaper-social-bg: #ffffff;
    --ar-epaper-social-icon: #111111;
    --ar-epaper-viewer-bg: #ffffff;
    --ar-epaper-page-bg: #ffffff;
    --ar-epaper-thumb-bg: #ffffff;
    --ar-epaper-thumb-text: #222222;
    --ar-epaper-thumb-active-border: #e10600;
    --ar-epaper-thumb-active-bg: #fff5f5;
    --ar-epaper-toolbar-bg: #0b1f4b;
    --ar-epaper-button-bg: #ffffff;
    --ar-epaper-button-text: #111111;
    --ar-epaper-button-hover: #f3f3f3;
    --ar-epaper-button-active: #e10600;
    --ar-epaper-footer-bg: #111111;
    --ar-epaper-footer-text: #f3f3f3;
    --ar-epaper-footer-link: #ffffff;
    --ar-epaper-footer-border: #2c2c2c;
    background: var(--ar-epaper-viewer-bg);
    color: var(--ar-epaper-header-text);
    padding: 0 0 108px;
    margin: 0 auto;
    max-width: 100%;
    box-sizing: border-box;
}

.ar-epaper-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 64px;
    padding: 8px 12px;
    background: var(--ar-epaper-header-bg);
    color: var(--ar-epaper-header-text);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.ar-epaper-logo-link,
.ar-epaper-site-fallback {
    text-decoration: none;
    color: var(--ar-epaper-header-text);
    flex: 0 1 auto;
    min-width: min-content;
}

.ar-epaper-align-center .ar-epaper-logo-link,
.ar-epaper-align-center .ar-epaper-site-fallback {
    margin-left: auto;
    margin-right: auto;
}

.ar-epaper-align-right .ar-epaper-logo-link,
.ar-epaper-align-right .ar-epaper-site-fallback {
    margin-left: auto;
}

.ar-epaper-header-logo {
    display: block;
    width: auto;
    max-width: min(100%, var(--ar-epaper-logo-width, 180px));
    height: auto;
    max-height: var(--ar-epaper-logo-height, 56px);
    object-fit: contain;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.ar-epaper-site-fallback {
    font-size: 22px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.ar-epaper-menu-btn,
.ar-epaper-tool,
.ar-epaper-shell .ars-toolbar button,
.ar-epaper-shell .ars-toolbar a.ar-epaper-tool {
    min-width: 44px;
    min-height: 44px;
}

.ar-epaper-menu-btn {
    margin-left: auto;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 12px;
    border: 0;
    border-radius: 6px;
    background: var(--ar-epaper-menu-bg);
    color: var(--ar-epaper-menu-text);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
}

.ar-epaper-menu-icon,
.ar-epaper-menu-icon::before,
.ar-epaper-menu-icon::after {
    display: block;
    width: 16px;
    height: 2px;
    background: currentColor;
    position: relative;
    content: "";
}

.ar-epaper-menu-icon::before { top: -5px; position: absolute; left: 0; }
.ar-epaper-menu-icon::after { top: 5px; position: absolute; left: 0; }

.ar-epaper-titlebar {
    min-height: 36px;
    padding: 8px 12px;
    background: var(--ar-epaper-title-bg);
    color: var(--ar-epaper-title-text);
    text-align: center;
}

.ar-epaper-title-text {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ar-epaper-social {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    padding: 12px 10px;
    background: var(--ar-epaper-social-bg);
}

.ar-epaper-social a,
.ar-epaper-social button {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    padding: 0;
}

.ar-epaper-social svg {
    width: 22px;
    height: 22px;
    display: block;
}

.ar-epaper-social-fb { background: #1877f2; }
.ar-epaper-social-x { background: #111111; }
.ar-epaper-social-wa { background: #25d366; }
.ar-epaper-social-tg { background: #2aabee; }
.ar-epaper-social-copy { background: #8d97a3; color: #fff; }

.ar-epaper-menu-panel {
    display: none;
    background: var(--ar-epaper-menu-bg);
    color: var(--ar-epaper-menu-text);
    padding: 8px 16px 12px;
}

.ar-epaper-menu-panel.is-open {
    display: block;
}

.ar-epaper-menu-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ar-epaper-menu-panel a {
    display: block;
    padding: 10px 0;
    color: var(--ar-epaper-menu-text);
    text-decoration: none;
}

.ar-epaper-scroller {
    display: flex;
    align-items: stretch;
    overflow: hidden;
    background: var(--ar-epaper-scroller-bg);
    color: var(--ar-epaper-scroller-text);
    min-height: 32px;
}

.ar-epaper-scroller-label {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: var(--ar-epaper-scroller-label-bg);
    color: var(--ar-epaper-scroller-label-text);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ar-epaper-scroller-viewport {
    overflow: hidden;
    flex: 1;
    display: flex;
    align-items: center;
}

.ar-epaper-scroller-track {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%;
    animation: ar-epaper-scroll var(--ar-epaper-scroller-duration, 18s) linear infinite;
}

.ar-epaper-scroller-text {
    font-size: 14px;
}

@keyframes ar-epaper-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.ar-epaper-stage {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 8px 4px 16px;
    box-sizing: border-box;
}

.ar-epaper-shell .ars-main-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ar-epaper-shell.ar-epaper-thumbs-above .ars-sidebar {
    order: -1;
}

.ar-epaper-shell .ars-sidebar {
    width: 100%;
    height: auto;
    position: relative;
    top: auto;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    background: transparent;
    border: 0;
    padding: 4px 2px 8px;
}

.ar-epaper-shell .ars-thumb-link {
    flex: 0 0 92px;
    width: 92px;
    color: var(--ar-epaper-thumb-text);
    margin: 0;
    padding: 4px;
    background: var(--ar-epaper-thumb-bg);
    border-radius: 6px;
    color: inherit;
}

.ar-epaper-shell .ars-thumb-image {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
    background: var(--ar-epaper-page-bg);
}

.ar-epaper-shell .ars-thumb-link.active {
    background: var(--ar-epaper-thumb-active-bg);
}

.ar-epaper-shell .ars-thumb-link.active .ars-thumb-image {
    border-color: var(--ar-epaper-thumb-active-border);
    box-shadow: 0 0 0 2px var(--ar-epaper-thumb-active-border);
}

.ar-epaper-shell .ars-main-layout,
.ar-epaper-shell .ars-content,
.ar-epaper-shell .ars-slider-wrapper,
.ar-epaper-shell .ars-slider-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.ar-epaper-shell .ars-content {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.ar-epaper-shell .ars-slider-wrapper {
    background: var(--ar-epaper-page-bg);
}

.ar-epaper-shell .ars-slide {
    box-sizing: border-box;
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    justify-content: center;
}

.ar-epaper-shell .ars-slide .ars-image-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.ar-epaper-shell .ars-slide .ars-page-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    display: block;
}

.ar-epaper-shell .ars-toolbar {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    transform: none !important;
    z-index: 100002;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    align-items: center;
    gap: 0;
    padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
    background: var(--ar-epaper-toolbar-bg);
    border-radius: 0;
    box-shadow: none;
}

.ar-epaper-shell .ars-toolbar button,
.ar-epaper-shell .ars-toolbar a.ar-epaper-tool,
.ar-epaper-shell .ars-toolbar select {
    background: var(--ar-epaper-button-bg);
    color: var(--ar-epaper-button-text);
    border: 0;
    border-radius: 10px;
    min-width: 0;
    height: 48px;
    padding: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.ar-epaper-toolbar-nav,
.ar-epaper-toolbar-actions,
.ar-epaper-toolbar-more {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.ar-epaper-toolbar-actions {
    margin-left: auto;
}

.ar-epaper-toolbar-more {
    margin-left: 8px;
}

.ar-epaper-shell .ars-toolbar .ar-epaper-nav-btn,
.ar-epaper-shell #ars-prev-page,
.ar-epaper-shell #ars-next-page {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    height: 48px;
    padding: 0;
}

.ar-epaper-shell .ars-toolbar svg {
    width: 20px;
    height: 20px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ar-epaper-shell #ars-pdf-download svg,
.ar-epaper-shell #ars-start-crop svg,
.ar-epaper-date-btn > svg {
    fill: currentColor;
    stroke: none;
}

.ar-epaper-shell #ars-pdf-download {
    flex-direction: column;
    gap: 1px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1;
}

.ar-epaper-shell #ars-pdf-download svg {
    width: 16px;
    height: 16px;
}

.ar-epaper-date-btn {
    position: relative;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 10px;
    background: var(--ar-epaper-button-active);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ar-epaper-date-btn > svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.ar-epaper-shell .ar-epaper-date-btn .ars-edition-select {
    position: absolute;
    inset: 0;
    width: 48px;
    max-width: 48px;
    height: 48px;
    margin: 0;
    opacity: 0.02;
    z-index: 2;
    cursor: pointer;
}

.ar-epaper-shell #ars-pdf-download,
.ar-epaper-shell #ars-start-crop {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 10px;
}

.ar-epaper-shell .ars-toolbar .ar-epaper-action,
.ar-epaper-shell #ars-start-crop,
.ar-epaper-shell #ars-pdf-download,
.ar-epaper-shell #ars-edition-select-header {
    background: var(--ar-epaper-button-active) !important;
    color: #ffffff !important;
    border-radius: 10px;
}

.ar-epaper-shell .ars-toolbar button:hover,
.ar-epaper-shell .ars-toolbar a.ar-epaper-tool:hover,
.ar-epaper-shell .ars-toolbar select:hover {
    background: var(--ar-epaper-button-hover);
    color: var(--ar-epaper-button-text);
    transform: none;
}

.ar-epaper-shell .ars-toolbar .ar-epaper-action:hover,
.ar-epaper-shell #ars-start-crop:hover,
.ar-epaper-shell #ars-pdf-download:hover {
    background: var(--ar-epaper-button-active);
    color: #ffffff;
}

.ar-epaper-shell .ars-toolbar button:active,
.ar-epaper-shell .ars-toolbar a.ar-epaper-tool:active {
    background: var(--ar-epaper-button-active);
}

.ar-epaper-shell .ars-toolbar button:focus-visible,
.ar-epaper-shell .ars-toolbar a.ar-epaper-tool:focus-visible,
.ar-epaper-shell .ars-toolbar select:focus-visible,
.ar-epaper-menu-btn:focus-visible,
.ar-epaper-shell .ars-thumb-link:focus-visible {
    outline: 2px solid var(--ar-epaper-button-hover);
    outline-offset: 2px;
}

.ar-epaper-shell #ars-prev-page,
.ar-epaper-shell #ars-next-page,
.ar-epaper-shell #ar-epaper-page-select,
.ar-epaper-shell #ars-zoom-in,
.ar-epaper-shell #ars-zoom-out,
.ar-epaper-shell #ars-zoom-reset,
.ar-epaper-shell #ars-fullscreen {
    background: var(--ar-epaper-button-bg) !important;
    color: var(--ar-epaper-button-text) !important;
}

.ar-epaper-shell #ars-page-indicator {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.ar-epaper-page-wrap {
    position: relative;
    width: 112px;
    height: 48px;
    flex: 0 0 112px;
}

.ar-epaper-shell .ars-toolbar .ar-epaper-page-select {
    width: 112px;
    min-width: 112px;
    max-width: 112px;
    height: 48px;
    padding: 0 26px 0 10px;
    font-size: 15px;
    font-weight: 600;
    line-height: 48px;
    text-align: center;
    text-align-last: center;
    appearance: none;
    -webkit-appearance: none;
    background-image: none;
}

.ar-epaper-shell .ars-toolbar .ar-epaper-page-chevron {
    position: absolute;
    right: 8px;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    pointer-events: none;
    color: var(--ar-epaper-button-text);
}

.ar-epaper-shell #ars-zoom-in,
.ar-epaper-shell #ars-zoom-out,
.ar-epaper-shell #ars-zoom-reset,
.ar-epaper-shell #ars-fullscreen {
    width: auto;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    font-size: 12px;
    border-radius: 8px;
}

.ar-epaper-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ar-epaper-footer {
    margin-top: 20px;
    padding: 20px 16px;
    background: var(--ar-epaper-footer-bg);
    color: var(--ar-epaper-footer-text);
    border-top: 1px solid var(--ar-epaper-footer-border);
    text-align: center;
}

.ar-epaper-footer a {
    color: var(--ar-epaper-footer-link);
}

.ar-epaper-brand-footer {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 72px;
    margin: 0 auto 10px;
    object-fit: contain;
}

.ar-epaper-footer-logo {
    display: block;
    max-width: 160px;
    max-height: 48px;
    width: auto;
    height: auto;
    margin: 0 auto 10px;
    object-fit: contain;
}

.ar-epaper-footer-text,
.ar-epaper-footer-copy {
    margin: 0 0 6px;
    font-size: 13px;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .ar-epaper-shell .ars-toolbar {
        left: 0;
        right: 0;
        width: 100%;
        transform: none;
        border-radius: 0;
    }

    .ar-epaper-shell .ars-toolbar button,
    .ar-epaper-shell .ars-toolbar a.ar-epaper-tool,
    .ar-epaper-shell .ars-toolbar select {
        flex: 0 0 auto;
    }

    .ar-epaper-site-fallback {
        font-size: 18px;
    }
}

@media (min-width: 1024px) {
    .ar-epaper-header {
        min-height: 72px;
        padding: 10px 20px;
    }

    .ar-epaper-stage {
        max-width: 920px;
        padding-top: 12px;
    }
}
