/* ==========================================================================
   PTI — v2 reading navigation styles (Phase 2)
   Pairs with assets/js/pti-v2-nav.js. Every class here is created by that
   script; if the script is absent none of these rules match anything.
   ========================================================================== */

/* Elementor's kit sets Roboto Condensed on every <a> and its own colours on
   <button> (0,1,1). Everything this script draws uses the site sans instead. */
body.pti .pti-crumbs a,
body.pti .pti-toc a,
body.pti .pti-pn a,
body.pti .pti-bar a,
body.pti .pti-bar button,
body.pti .pti-sheet a,
body.pti .pti-sheet button,
body.pti .pti-top { font-family: var(--pti-font-body); }

/* ---------- Breadcrumbs (inside the navy hero) ---------- */
.pti-crumbs { margin: 0 0 18px; font-family: var(--pti-font-body); }
.pti-crumbs__list {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0;
    list-style: none; margin: 0; padding: 0;
    font-size: 14px; line-height: 1.5; color: #C3CFDB;
}
.pti-crumbs__list li { display: inline-flex; align-items: center; margin: 0; padding: 0; }
.pti-crumbs__list li::before { content: none; }
.pti-crumbs__list li + li::before {
    content: "›"; position: static; width: auto; height: auto; background: none;
    margin: 0 9px; color: #8FA3B8;
}
.ptipg .pti-crumbs a { color: #C3CFDB; text-decoration: none; border-bottom: 1px solid transparent; }
.ptipg .pti-crumbs a:hover { color: #fff; border-bottom-color: rgba(255,255,255,.5); }
.pti-crumbs [aria-current="page"] {
    color: #fff; font-weight: 600;
    max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- Contents column (wide screens) ---------- */
.pti-toc { display: none; }

@media (min-width: 1240px) {
    .ptipg .ptipg__w.pti-has-toc {
        display: grid;
        grid-template-columns: 250px minmax(0, 1fr);
        column-gap: 56px;
        align-items: start;
    }
    .ptipg .ptipg__w.pti-has-toc > .ptipg__prose { margin: 0; max-width: 46rem; }
    .ptipg .ptipg__w.pti-has-toc > :not(.pti-toc):not(.ptipg__prose) { grid-column: 2; }

    .pti-toc {
        display: block;
        position: sticky;
        top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--pti-header-h, 68px) + 24px);
        max-height: calc(100vh - var(--pti-header-h, 68px) - 48px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 4px 6px 16px 0;
        font-family: var(--pti-font-body);
        scrollbar-width: thin;
    }
}
.pti-toc__where {
    margin: 0 0 18px; padding: 0 0 16px; border-bottom: 1px solid #E4EAF1;
    display: flex; flex-direction: column; gap: 4px;
}
.ptipg .pti-toc__where a { font-size: 15px; font-weight: 700; color: #0D1E30; text-decoration: none; }
.ptipg .pti-toc__where a:hover { color: #17707F; }
.pti-toc__where span { font-size: 13px; color: #4A5868; }
.pti-toc__title,
.pti-sheet__title {
    margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .12em;
    text-transform: uppercase; color: #4A5868;
}
.ptipg .pti-toc__list,
.pti-sheet__list { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.ptipg .pti-toc__list li,
.pti-sheet__list li { margin: 0; padding: 0; }
.ptipg .pti-toc__list li::before,
.pti-sheet__list li::before { content: none; }
.ptipg .pti-toc__list a {
    display: block; padding: 7px 10px 7px 14px; margin-left: 1px;
    border-left: 2px solid #E4EAF1;
    font-size: 14.5px; line-height: 1.4; color: #4A5868; text-decoration: none;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.ptipg .pti-toc__list a:hover { color: #0D1E30; border-left-color: #8FB8C1; }
.ptipg .pti-toc__list a[aria-current="true"] {
    color: #0F5560; font-weight: 600; border-left-color: #17707F; background: #E3F1F3;
    border-radius: 0 8px 8px 0;
}

/* ---------- Reading progress (under the sticky header) ---------- */
.pti-progress { position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; pointer-events: none; }
.pti-progress span {
    display: block; height: 100%; background: #C9A84C;
    transform: scaleX(0); transform-origin: 0 50%;
    transition: transform .1s linear;
}

/* ---------- Previous / next ---------- */
.pti-pn {
    max-width: 46rem;
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px;
    margin: 56px 0 8px; font-family: var(--pti-font-body);
}
.ptipg .pti-pn__card {
    display: flex; flex-direction: column; gap: 6px;
    padding: 20px 22px; border-radius: 16px; text-decoration: none;
    background: #fff; border: 1px solid #DDE3EA;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.ptipg .pti-pn__card:hover { border-color: #17707F; box-shadow: 0 10px 28px rgba(13,30,48,.08); transform: translateY(-2px); }
.ptipg .pti-pn__card--next { text-align: right; background: #0D1E30; border-color: #0D1E30; }
.ptipg .pti-pn__card--next:hover { border-color: #C9A84C; }
.pti-pn__dir { font-size: 13px; font-weight: 700; letter-spacing: .02em; color: #4A5868; }
.pti-pn__card--next .pti-pn__dir { color: #E0BE63; }
.pti-pn__title {
    font-family: var(--pti-font-display); font-size: 1.3rem; font-weight: 600;
    line-height: 1.25; color: #0D1E30;
}
.pti-pn__card--next .pti-pn__title { color: #fff; }
@media (max-width: 600px) {
    .pti-pn { grid-template-columns: 1fr; }
    .pti-pn__gap { display: none; }
}

/* ---------- Back to top ---------- */
body.pti .pti-top {
    position: fixed; padding: 0; font: inherit; letter-spacing: normal; text-transform: none; right: 20px; bottom: 24px; z-index: 150;
    width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    background: #0D1E30; color: #fff; box-shadow: 0 8px 22px rgba(13,30,48,.25);
    opacity: 0; visibility: hidden; transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
body.pti .pti-top.is-on { opacity: 1; visibility: visible; transform: none; }
body.pti .pti-top:hover { background: #17707F; }
.pti-top:focus-visible { outline: 3px solid #C9A84C; outline-offset: 3px; }

/* ---------- Phone / tablet reading bar + contents sheet ---------- */
.pti-bar { display: none; }
@media (max-width: 1239px) {
    .pti-bar {
        position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 160;
        display: flex; justify-content: center; gap: 6px;
        max-width: 520px; margin: 0 auto; padding: 6px;
        background: #0D1E30; border-radius: 16px;
        box-shadow: 0 12px 28px rgba(13,30,48,.32);
        font-family: var(--pti-font-body);
        transform: translateY(140%); transition: transform .25s ease;
    }
    .pti-bar.is-on { transform: none; }
    body.pti .pti-bar__btn {
        flex: 1 1 0; padding: 0 10px; letter-spacing: normal; text-transform: none; min-height: 48px; border: 0; border-radius: 11px; cursor: pointer;
        display: inline-flex; align-items: center; justify-content: center; gap: 6px;
        background: transparent; color: #fff; text-decoration: none;
        font: 600 14px/1 var(--pti-font-body);
    }
    body.pti .pti-bar__btn--main { background: #1A3A5C; }
    body.pti .pti-bar__btn:hover, body.pti .pti-bar__btn:focus-visible { background: #17707F; color: #fff; outline: none; }
    /* The bar sits where the back-to-top button would. */
    body.pti.pti-has-bar .pti-top { bottom: 84px; }
    body.pti-has-bar .pti-footer { padding-bottom: 84px; }
}

.pti-sheet[hidden] { display: none; }
.pti-sheet { position: fixed; inset: 0; z-index: 300; font-family: var(--pti-font-body); }
.pti-sheet__backdrop { position: absolute; inset: 0; background: rgba(13,30,48,.5); }
.pti-sheet__panel {
    position: absolute; left: 0; right: 0; bottom: 0;
    max-height: 78vh; overflow-y: auto; overscroll-behavior: contain;
    background: #fff; border-radius: 22px 22px 0 0; padding: 14px 16px 24px;
    box-shadow: 0 -12px 32px rgba(13,30,48,.2);
    max-width: 640px; margin: 0 auto;
}
.pti-sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 8px; }
.pti-sheet__head .pti-sheet__title { margin: 0; }
body.pti .pti-sheet__close {
    width: 44px; padding: 0; height: 44px; border: 0; border-radius: 10px; cursor: pointer;
    background: #EEF3F7; color: #0D1E30; display: flex; align-items: center; justify-content: center;
}
body.pti .pti-sheet__list a {
    display: block; padding: 12px 14px; border-radius: 10px;
    font-size: 16px; line-height: 1.4; color: #1F2B38; text-decoration: none;
}
body.pti .pti-sheet__list a:hover { background: #EEF3F7; }
body.pti .pti-sheet__list a[aria-current="true"] { background: #E3F1F3; color: #0F5560; font-weight: 600; }
html.pti-sheet-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
    .pti-bar, .pti-top, .pti-progress span, .ptipg .pti-pn__card, .ptipg .pti-toc__list a { transition: none; }
}
@media print {
    .pti-toc, .pti-bar, .pti-sheet, .pti-top, .pti-progress, .pti-pn { display: none !important; }
}
