/* =====================================================================
 * gallery.css — lightbox ของ js/gallery.js (โทนธีม watch: เขียวเข้ม/ทอง)
 * ===================================================================== */
html.gl-lock { overflow: hidden; }

.gl-trigger { cursor: zoom-in; }

.gl-box {
    position: fixed; inset: 0; z-index: 2000;
    display: grid; grid-template-rows: auto 1fr auto;
    background: rgba(10, 24, 16, .94);
    color: #fff;
    font-family: 'Sarabun', sans-serif;
    animation: gl-fade .18s ease-out;
}
.gl-box[hidden] { display: none; }
@keyframes gl-fade { from { opacity: 0; } to { opacity: 1; } }

.gl-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; }
.gl-count { font-family: 'IBM Plex Mono', monospace; font-size: 13px; letter-spacing: .06em; color: #E8D9B0; }
.gl-tools { display: flex; gap: 8px; }

.gl-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 42px; padding: 0;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); border-radius: 50%;
    color: #fff; cursor: pointer; transition: background-color .15s, border-color .15s;
}
.gl-btn:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .4); }
.gl-btn:focus-visible { outline: 2px solid #C9A24B; outline-offset: 2px; }
.gl-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gl-btn[hidden] { display: none; }
.gl-zoom[aria-pressed="true"] { background: #C9A24B; border-color: #C9A24B; color: #123B27; }

.gl-stage { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 0 72px; min-height: 0; }
.gl-img {
    max-width: 100%; max-height: 100%; object-fit: contain;
    background: #fff; box-shadow: 0 18px 48px rgba(0, 0, 0, .45);
    cursor: zoom-in; user-select: none; -webkit-user-drag: none;
    transition: opacity .2s;
}
.gl-box.is-loading .gl-img { opacity: .25; }
.gl-box.is-loading .gl-stage::after {
    content: ''; position: absolute; width: 36px; height: 36px; border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .25); border-top-color: #C9A24B; animation: gl-spin .8s linear infinite;
}
@keyframes gl-spin { to { transform: rotate(360deg); } }

/* โหมดซูม: แสดงขนาดจริง เลื่อนดูได้ */
.gl-box.is-zoom .gl-stage { overflow: auto; display: block; padding: 0; }
.gl-box.is-zoom .gl-img { max-width: none; max-height: none; cursor: zoom-out; margin: 0 auto; display: block; }

.gl-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; }
.gl-prev { left: 14px; }
.gl-next { right: 14px; }
.gl-box.is-zoom .gl-nav { display: none; }

.gl-bottom { padding: 10px 16px 14px; text-align: center; }
.gl-cap { min-height: 1.5em; font-size: 14.5px; color: #E6EFE8; margin-bottom: 10px; }
.gl-cap:empty { display: none; }
.gl-thumbs { display: flex; justify-content: center; gap: 8px; overflow-x: auto; padding: 2px; }
.gl-thumbs[hidden] { display: none; }
.gl-thumb { flex: none; width: 76px; height: 52px; padding: 0; border: 2px solid transparent; background: #fff; opacity: .5; cursor: pointer; transition: opacity .15s, border-color .15s; }
.gl-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gl-thumb:hover { opacity: .85; }
.gl-thumb.is-active { opacity: 1; border-color: #C9A24B; }
.gl-thumb:focus-visible { outline: 2px solid #C9A24B; outline-offset: 2px; }

@media (max-width: 640px) {
    .gl-stage { padding: 0 8px; }
    .gl-nav { top: auto; bottom: 8px; transform: none; width: 44px; height: 44px; }
    .gl-thumb { width: 60px; height: 42px; }
}
