/* ═══════════════════════════════════════════════════════════════════════
   css/tb1-photo-viewer.css — ตัวดูภาพขยายที่ใช้ร่วมกันได้ทุกหน้า (คู่กับ js/tb1-photo-viewer.js) · 5 ต.ค. 2569
   พื้นมืดเต็มจอ ภาพอยู่กลาง คำบรรยายและลำดับภาพใต้ภาพ ปุ่มปิดมุมขวาบน ปุ่มก่อนหน้า/ถัดไปสองข้าง
   (มือถือย้ายปุ่มก่อนหน้า/ถัดไปลงไปด้านล่าง นิ้วโป้งกดถึง)
   เต็มจอด้วย inset ไม่ใช้ 100vw/100vh: fonts/tb1-size.css ย่อทั้งหน้าด้วย zoom ซึ่งทำให้ 100vw เหลือ 90% ของจอ
   ═══════════════════════════════════════════════════════════════════════ */

.pv {
    position: fixed;
    inset: 0;
    width: auto;
    max-width: none;
    height: auto;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(3, 7, 18, .94);
    color: #fff;
}

.pv:not([open]) {
    display: none;
}

.pv::backdrop {
    background: rgba(3, 7, 18, .7);
}

.pv-fig {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    height: 100%;
    margin: 0;
    padding: 3.75rem 3.75rem 1.5rem;
}

.pv-fig img {
    display: block;
    max-width: 100%;
    max-height: calc(100% - 3.5rem);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

.pv-fig figcaption {
    max-width: 48rem;
    text-align: center;
    font-size: .95rem;
    line-height: 1.55;
    color: #fff;
}

.pv-count {
    margin-left: .4rem;
    color: #CBD5E1;
    font-size: .85rem;
    white-space: nowrap;
}

.pv-btn {
    position: absolute;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
    background: rgba(15, 23, 42, .75);
    color: #fff;
    font-size: 1.05rem;
    cursor: pointer;
}

.pv-btn:hover {
    background: rgba(30, 41, 59, .95);
    border-color: #fff;
}

.pv-btn:focus-visible {
    outline: 3px solid #F59E0B;
    outline-offset: 2px;
}

.pv-btn.is-close {
    right: 12px;
    top: 12px;
}

.pv-btn.is-prev,
.pv-btn.is-next {
    top: 50%;
    transform: translateY(-50%);
}

.pv-btn.is-prev {
    left: 8px;
}

.pv-btn.is-next {
    right: 8px;
}

@media (max-width: 640px) {
    .pv-fig {
        padding: 3.5rem .5rem 5rem;
    }

    .pv-btn.is-prev,
    .pv-btn.is-next {
        top: auto;
        bottom: 14px;
        transform: none;
    }

    .pv-btn.is-prev {
        left: calc(50% - 56px);
    }

    .pv-btn.is-next {
        right: calc(50% - 56px);
    }
}

html.tb1-contrast-high .pv {
    background: #000;
}

html.tb1-contrast-high .pv-btn {
    background: #000;
    border: 2px solid #facc15;
    color: #facc15;
}

html.tb1-contrast-high .pv-count {
    color: #fff;
}

@media print {
    .pv {
        display: none !important;
    }
}

/* ★ 30 ต.ค. 2569: ชุดที่มีภาพเดียว (js ติดคลาส is-single) ไม่มีปุ่มก่อนหน้า/ถัดไปและลำดับภาพ */
.pv.is-single .pv-btn.is-prev,
.pv.is-single .pv-btn.is-next,
.pv.is-single .pv-count {
    display: none;
}

/* ไอคอน SVG ในปุ่ม (หน้าที่ไม่ได้โหลด Font Awesome) */
.pv-btn svg {
    width: 22px;
    height: 22px;
}
