/*
 * PDF flipbook (resources/views/flipbook/show.blade.php, js/pages/flipbook.js).
 * A full-screen reader in the Integrated Report look: colours, top bar,
 * buttons and glowing background come from layout/report-theme.css (shared
 * with the report microsite). This file: the reader's own layout, the book,
 * the navigation bar, the side panel and the zoom layer. Phone rules:
 * flipbook-mobile.css.
 */

:root {
    --fb-top: var(--nav-h);
    --fb-bar: 68px;
    /* Reader names for the report-theme colours */
    --fb-navy: var(--deep);
    --fb-ink: var(--navy);
    --fb-teal: var(--teal);
    --fb-teal-light: var(--teal-light);
    --fb-line: var(--line);
    --fb-muted: var(--muted);
}

html, body.fb { height: 100%; }
body.fb { overflow: hidden; display: flex; flex-direction: column; }
body.fb button { font-family: inherit; }
/* The glowing blobs sit behind everything */
body.fb > .blob { position: fixed; z-index: 0; }
.fb-top, .fb-stage, .fb-bar { position: relative; z-index: 1; }
.fb-top, .fb-bar { z-index: 20; }

/* ---------- Buttons ---------- */
.fb-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    min-width: 40px; height: 40px; padding: 0 10px;
    border-radius: 999px; border: 1px solid transparent; background: transparent;
    color: #fff !important; font-size: 1.05rem; font-weight: 600; text-decoration: none; cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
}
.fb-btn span { font-size: .88rem; }
.fb-btn:hover:not(:disabled), .fb-btn:focus-visible { background: rgba(243, 107, 33, .3); outline: none; }
.fb-btn:disabled { opacity: .35; cursor: default; }
.fb-btn[aria-expanded="true"], .fb-btn[aria-pressed="false"] { background: rgba(8, 186, 187, .18); border-color: rgba(8, 186, 187, .5); color: var(--fb-teal-light) !important; }
.fb-btn--text { padding: 0 14px; border-color: rgba(255, 255, 255, .3); }

/* ---------- Top bar: the microsite's .topnav (solid) ---------- */
.fb-top {
    flex: none; height: var(--fb-top);
    display: flex; align-items: center; gap: 18px; padding: 0 max(16px, calc((100% - 1200px) / 2));
    background: rgba(7, 22, 33, .96); border-bottom: 1px solid var(--fb-line);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    z-index: 20;
}
.fb-top .brand img { display: block; height: 34px; width: auto; }
.fb-back { display: inline-flex; align-items: center; gap: 6px; padding: .45rem .85rem; border-radius: 999px; color: rgba(255, 255, 255, .78) !important; font-size: .85rem; font-weight: 500; text-decoration: none; transition: background .2s, color .2s; }
.fb-back:hover { color: #fff !important; background: rgba(243, 107, 33, .3); }
.fb-title { flex: 1; min-width: 0; text-align: center; line-height: 1.15; }
.fb-title .eyebrow { font-size: .66rem; }
.fb-title h1 { margin: 2px 0 0; color: #fff; font-family: 'Playfair Display', Georgia, serif; font-size: 1.2rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fb-top-tools { display: flex; align-items: center; gap: .35rem; }
.fb-top .lang-switch a:not(.is-active):hover { background: rgba(243, 107, 33, .3); color: #fff; }
/* "Download PDF": the microsite's bordered nav pill */
.fb-cta {
    display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .95rem; border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .3); color: rgba(255, 255, 255, .9); font-size: .85rem; font-weight: 500; text-decoration: none;
    transition: background .2s, border-color .2s, color .2s;
}
.fb-cta:hover { background: var(--orange); border-color: var(--orange); color: #fff; }

/* ---------- Stage and book ---------- */
.fb-stage { flex: 1; min-height: 0; }
.fb-note { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 5; margin: 0; padding: 5px 12px; border-radius: 999px; background: rgba(7,22,33,.7); border: 1px solid var(--fb-line); color: var(--fb-muted); font-size: .78rem; white-space: nowrap; }
.fb-note i { color: var(--fb-teal); }
.fb-book-wrap { position: absolute; inset: 44px 84px 24px; }
.fb-book { width: 100%; height: 100%; opacity: 0; transition: opacity .5s ease; }
.fb-stage.is-ready .fb-book { opacity: 1; }
/* Each page: white paper with the drawn PDF page filling it */
.fb-page { background: #fff; overflow: hidden; }
.fb-page canvas { display: block; width: 100%; height: 100%; }
.fb-page:not(.is-drawn)::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, #f1f4f6 30%, #fff 50%, #f1f4f6 70%) no-repeat; background-size: 250% 100%; animation: fbShimmer 1.4s linear infinite; }
@keyframes fbShimmer { from { background-position: 130% 0; } to { background-position: -30% 0; } }
/* Soft drop shadow under the book */
.fb-book .stf__block { filter: drop-shadow(0 26px 40px rgba(0,0,0,.45)); }

/* Big previous / next arrows at the sides: PhoenixBev orange, with the
   2026 report's arrow shape (ticket IR-14) */
.fb-arrow {
    position: absolute; top: 50%; z-index: 4; transform: translateY(-50%);
    width: 52px; height: 52px; border-radius: 50%; padding: 0;
    border: 1px solid var(--orange); background: var(--orange); color: #fff;
    box-shadow: 0 10px 26px rgba(243, 107, 33, .35);
    cursor: pointer; display: grid; place-items: center;
    transition: background .2s, border-color .2s, opacity .2s, transform .2s, box-shadow .2s;
}
.fb-arrow svg { width: 20px; height: 20px; margin-left: 3px; }
.fb-arrow--prev svg { transform: scaleX(-1); margin: 0 3px 0 0; }
.fb-arrow--prev { left: 18px; }
.fb-arrow--next { right: 18px; }
.fb-arrow:hover:not(:disabled), .fb-arrow:focus-visible { background: var(--orange-light); border-color: #fff; box-shadow: 0 14px 34px rgba(243, 107, 33, .55); transform: translateY(-50%) scale(1.08); outline: none; }
.fb-arrow:disabled { opacity: 0; pointer-events: none; }

/* Loading: the cover with a progress bar */
.fb-loading { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px; transition: opacity .5s ease; }
.fb-loading.is-done { opacity: 0; pointer-events: none; }
.fb-loading-cover { max-height: calc(100% - 110px); max-width: min(420px, 80vw); border-radius: 4px; box-shadow: 0 30px 60px rgba(0,0,0,.5); animation: fbBreathe 2.4s ease-in-out infinite; }
@keyframes fbBreathe { 50% { transform: translateY(-6px); } }
.fb-loading-text { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--fb-muted); font-size: .9rem; }
.fb-progress { display: block; width: 220px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; }
.fb-progress span { display: block; width: 8%; height: 100%; background: linear-gradient(90deg, var(--fb-teal), var(--fb-teal-light)); transition: width .3s; }
.fb-loading.is-error .fb-progress, .fb-loading.is-error .fb-loading-cover { animation: none; opacity: .5; }

/* ---------- Navigation bar ---------- */
.fb-bar {
    flex: none; height: var(--fb-bar); position: relative; z-index: 20;
    display: flex; align-items: center; gap: 18px; padding: 0 20px;
    background: rgba(7, 22, 33, .96); border-top: 1px solid var(--fb-line);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.fb-bar-group { display: flex; align-items: center; gap: 6px; }
/* The theme spaces forms and stacks inputs: keep the page box and "of 229" on one line */
.fb-goto { display: flex; flex-direction: row !important; flex-wrap: nowrap; align-items: center; gap: 8px; margin: 0 6px !important; padding: 0; }
.fb-goto input[type="text"] { display: inline-block; margin: 0; }
.fb-goto input {
    width: 72px; height: 38px; padding: 0 8px; border-radius: 999px;
    border: 1px solid var(--fb-line); background: rgba(255,255,255,.06);
    color: #fff; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums;
}
.fb-goto input::placeholder { color: var(--fb-muted); font-weight: 600; font-size: .8rem; }
.fb-goto input:focus { outline: none; border-color: var(--fb-teal); box-shadow: 0 0 0 3px rgba(8,186,187,.25); }
.fb-total { color: var(--fb-muted); font-size: .85rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fb-slider { position: relative; flex: 1; min-width: 80px; }
.fb-slider input { width: 100%; accent-color: var(--orange); cursor: pointer; }
.fb-slider-tip { position: absolute; bottom: 30px; transform: translateX(-50%); padding: 4px 9px; border-radius: 8px; background: var(--orange); color: #fff; font-size: .78rem; font-weight: 700; white-space: nowrap; pointer-events: none; }
.fb-toast { position: absolute; right: 20px; bottom: calc(100% + 10px); padding: 0 12px; border-radius: 999px; background: #2fd27a; color: var(--fb-navy); font-size: .82rem; font-weight: 700; line-height: 30px; }
.fb-toast:empty { display: none; }

/* ---------- Side panel: contents / thumbnails ---------- */
.fb-panel {
    position: fixed; top: var(--fb-top); right: 0; bottom: var(--fb-bar); z-index: 30;
    width: min(380px, 92vw); display: flex; flex-direction: column;
    background: rgba(7,22,33,.96); border-left: 1px solid var(--fb-line);
    box-shadow: -20px 0 50px rgba(0,0,0,.4);
    transform: translateX(105%); transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
.fb-panel.is-open { transform: none; }
.fb-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--fb-line); }
.fb-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255,255,255,.06); }
.fb-tab { padding: .45rem .9rem; border: 0; border-radius: 999px; background: transparent; color: var(--fb-muted); font-size: .85rem; font-weight: 700; cursor: pointer; }
.fb-tab.is-active { background: var(--fb-teal); color: var(--fb-navy); }
.fb-panel-body { flex: 1; overflow-y: auto; padding: 14px 16px 24px; overscroll-behavior: contain; }
.fb-scrim { position: fixed; inset: var(--fb-top) 0 var(--fb-bar); z-index: 25; background: rgba(0,0,0,.35); }

.fb-toc, .fb-toc ol { list-style: none; margin: 0; padding: 0; }
.fb-toc-section + .fb-toc-section { margin-top: 18px; }
.fb-toc-heading { display: block; margin-bottom: 6px; color: var(--fb-teal); font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.fb-toc a { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; margin: 0 -10px; border-radius: 10px; color: rgba(255,255,255,.85) !important; font-size: .9rem; text-decoration: none; transition: background .2s, color .2s; }
.fb-toc a:hover { background: rgba(243,107,33,.2); color: #fff !important; }
.fb-toc a.is-current { background: rgba(8,186,187,.15); color: var(--fb-teal-light) !important; }
.fb-toc-num { flex: none; color: var(--fb-muted); font-variant-numeric: tabular-nums; }

.fb-thumbs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.fb-thumb { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--fb-muted); font-size: .78rem; font-weight: 600; cursor: pointer; }
.fb-thumb-img { display: block; width: 100%; border-radius: 3px; overflow: hidden; background: rgba(255,255,255,.9); outline: 2px solid transparent; outline-offset: 2px; transition: outline-color .2s, transform .2s; }
.fb-thumb:not(.is-drawn) .fb-thumb-img { background: rgba(255,255,255,.1); }
.fb-thumb canvas { display: block; width: 100%; height: 100%; }
.fb-thumb:hover .fb-thumb-img { transform: translateY(-2px); outline-color: var(--orange); }
.fb-thumb.is-current .fb-thumb-img { outline-color: var(--fb-teal); }
.fb-thumb.is-current { color: var(--fb-teal-light); }

/* ---------- Zoom layer ---------- */
.fb-zoom { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: rgba(4,12,18,.97); }
.fb-zoom[hidden] { display: none; }
.fb-zoom-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; padding: 0 16px; border-bottom: 1px solid var(--fb-line); background: #040c12; }
.fb-zoom-label { color: var(--fb-muted); font-weight: 600; }
.fb-zoom-body { flex: 1; overflow: auto; padding: 16px; outline: none; }
/* Drag to move the zoomed page: open hand, closed while dragging (IR-16) */
@media (pointer: fine) {
    .fb-zoom-body { cursor: grab; }
    .fb-zoom-body.is-panning { cursor: grabbing; -webkit-user-select: none; user-select: none; }
}
.fb-zoom-row { display: flex; justify-content: center; gap: 0; width: max-content; min-width: 100%; margin: 0 auto; }
.fb-zoom-row canvas { display: block; background: #fff; box-shadow: 0 20px 50px rgba(0,0,0,.5); }

@media (prefers-reduced-motion: reduce) {
    .fb-panel, .fb-book, .fb-loading { transition: none; }
    .fb-loading-cover, .fb-page:not(.is-drawn)::after { animation: none; }
}
