/* Homepage only; shared galleries keep their existing theme. */

/* Zoom is confined to the photo; captions, download and Close stay fixed. */
.gallery-home .lightbox .lb-container { overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.gallery-home .lightbox .lb-image { transform-origin: center; }
.gallery-home .is-zoomed .lb-image { cursor: grab; will-change: transform; }
.gallery-home .is-zoomed .lb-image:active { cursor: grabbing; }
.gallery-home .is-zoomed .lb-nav { visibility: hidden; pointer-events: none; }
.gallery-home .lb-dataContainer { display: grid !important; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; min-width: min(420px, calc(100vw - 32px)); }
.gallery-home .lb-dataContainer > .lb-data { grid-column: 1 / -1; grid-row: 1; }
.gallery-home > .photo-zoom { display: none; position: fixed; z-index: 10001; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); align-items: center; overflow: hidden; border: 1px solid #ffffff30; border-radius: 22px; background: #171818e6; }
.gallery-home.lb-disable-scrolling > .photo-zoom { display: flex; }
.gallery-home .photo-zoom button { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px; border: 0; background: transparent; color: #eee; font: inherit; font-size: 20px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.gallery-home .photo-zoom button:nth-child(2) { min-width: 60px; font-size: 12px; }
.gallery-home .photo-zoom button:disabled { color: #777; cursor: default; }
.gallery-home .photo-zoom button:focus-visible { outline: 2px solid #c9b89b; outline-offset: -4px; }
.gallery-home .photo-fullscreen { border-left: 1px solid #ffffff30 !important; }
.gallery-home .photo-fullscreen .photo-collapse-icon { display: none; }
.gallery-home .photo-fullscreen[aria-pressed="true"] .photo-expand-icon { display: none; }
.gallery-home .photo-fullscreen[aria-pressed="true"] .photo-collapse-icon { display: inline; }
.gallery-home.viewer-fullscreen .lightbox { top: 0 !important; transform: none; height: 100vh; height: 100dvh; display: flex !important; align-items: center; justify-content: center; }
.gallery-home.viewer-fullscreen .lb-outerContainer { width: 100vw !important; height: 100vh !important; height: 100dvh !important; max-width: none; flex-shrink: 0; }
.gallery-home.viewer-fullscreen .lightbox .lb-container { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.gallery-home.viewer-fullscreen .lightbox .lb-image { max-width: none; max-height: none; flex-shrink: 0; }
.gallery-home.viewer-fullscreen .is-zoomed .lb-nav { visibility: visible; pointer-events: auto; }
.gallery-home.viewer-fullscreen .lb-dataContainer { position: absolute; z-index: 20; bottom: max(12px, env(safe-area-inset-bottom)); left: 16px; width: calc(100% - 32px) !important; min-width: 0; max-width: none; padding: 8px 12px; background: #0009; border-radius: 6px; }
.gallery-home.viewer-fullscreen .lightboxOverlay { opacity: 1 !important; }
.gallery-home.viewer-fullscreen { background: #000; }
html:has(body.gallery-home) { background: #111213; scroll-behavior: smooth; }
body.gallery-home { margin: 0; background: #111213; color: #eceae5; font-family: Arial, Helvetica, sans-serif; font-size: 15px; font-weight: 400; letter-spacing: 0; line-height: 1.6; -webkit-font-smoothing: antialiased; }
.gallery-home *, .gallery-home *::before, .gallery-home *::after { box-sizing: border-box; }
.gallery-home a { border: 0; color: inherit; text-decoration: none; }
.gallery-home a:focus-visible { outline: 2px solid #c9b89b; outline-offset: 5px; }
.gallery-home .site-header, .gallery-home main, .gallery-home .site-footer { width: calc(100% - 80px); margin: 0 auto; }
.gallery-home .site-header { min-height: 100px; display: flex; justify-content: space-between; align-items: center; gap: 24px; border-bottom: 1px solid #ffffff14; }
.gallery-home .site-name { font-size: 15px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }
.gallery-home .site-name span { display: block; margin-top: 3px; color: #92928f; font-size: 10px; font-weight: 400; letter-spacing: .2em; }
.gallery-home nav { display: flex; gap: 30px; font-size: 12px; }
.gallery-home nav a { color: #c3c2bd; transition: color .2s; }
.gallery-home nav a:hover { color: #fff; }
.gallery-home nav span { margin-left: 5px; color: #969185; }
.gallery-home .gallery-intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 24px 0 20px; }
.gallery-home h1 { margin: 0; color: #cfcdc6; font-size: 13px; font-weight: 400; letter-spacing: 0; line-height: 1.5; text-transform: none; }
.gallery-home .gallery-meta { display: flex; align-items: center; gap: 24px; flex-shrink: 0; text-align: right; font-size: 11px; line-height: 1.6; }
.gallery-home .gallery-meta span { color: #cfcdc6; }
.gallery-home .date-sort { appearance: none; display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border: 1px solid #ffffff30; border-radius: 3px; background: transparent; color: #cfcdc6; font: inherit; line-height: 1.6; white-space: nowrap; cursor: pointer; }
.gallery-home .date-sort::after { content: ''; flex: none; width: 12px; height: 12px; background: center / 12px 12px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 2v8M3 7l3 3 3-3' fill='none' stroke='%23cfcdc6' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.gallery-home .date-sort.is-ascending::after { transform: rotate(180deg); }
.gallery-home .date-sort:hover { background: #ffffff0a; border-color: #ffffff60; }
.gallery-home .date-sort:focus-visible { outline: 2px solid #c9b89b; outline-offset: 3px; }
.gallery-home .date-sort:disabled { opacity: .45; cursor: default; }
.gallery-home .gallery-meta p { margin: 0; color: #868984; font-size: 11px; line-height: inherit; letter-spacing: 0; text-transform: none; }
.gallery-home .photo-grid { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.gallery-home .photo-grid.masonry-ready { display: block; }
.gallery-home .photo-tile { position: relative; display: block; overflow: hidden; background: #1d1e1e; }
.gallery-home .masonry-ready .photo-tile { position: absolute; }
.gallery-home .photo-tile img { display: block; width: 100%; height: auto; filter: none; transition: transform .45s ease; }
.gallery-home .photo-open { position: absolute; bottom: 0; left: 0; right: 0; padding: 30px 16px 14px; background: linear-gradient(transparent, #0009); color: #fff; font-size: 11px; opacity: 0; transform: translateY(4px); transition: opacity .25s, transform .25s; pointer-events: none; }
.gallery-home .photo-tile:focus-visible .photo-open { opacity: 1; transform: none; }
@media (hover: hover) {
    .gallery-home .photo-tile:hover img { transform: scale(1.025); }
    .gallery-home .photo-tile:hover .photo-open { opacity: 1; transform: none; }
}
.gallery-home .thumb-status { margin: 0 0 20px; color: #aaa; font-size: 12px; }
.gallery-home [hidden] { display: none !important; }
.gallery-home .site-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 36px; padding: 26px 0 36px; border-top: 1px solid #ffffff14; color: #969892; font-size: 11px; }
.gallery-home .site-footer p { margin: 0; }
.gallery-home .empty-gallery { padding: 50px 0; color: #999; }
.gallery-home .skip-link { position: fixed; left: 16px; top: -80px; z-index: 10000; padding: 10px 16px; background: #eceae5; color: #111; }
.gallery-home .skip-link:focus { top: 12px; }
.gallery-home .lightbox .lb-image { border: 0; border-radius: 0; width: auto !important; height: auto !important; max-width: calc(100vw - 32px); max-height: var(--photo-max-height, calc(100vh - 110px)); margin: auto; }
.gallery-home .lb-outerContainer { border-radius: 0; background: #111213; max-width: calc(100vw - 32px); height: auto !important; }
.gallery-home .lightboxOverlay { position: fixed; inset: 0; width: 100vw !important; height: 100vh !important; opacity: .97; }
.gallery-home .lightbox { position: fixed; top: 24px !important; left: 0 !important; }
.gallery-home .lb-dataContainer { padding-top: 14px; max-width: calc(100vw - 32px); }
.gallery-home .lb-data { padding: 0; }
/* Keep the loaded preview stable while Lightbox prepares a decoded replacement. */
.gallery-home .photo-ready .lb-dataContainer { opacity: 1 !important; }
.gallery-home .photo-ready .lb-image,
.gallery-home .photo-ready.has-album .lb-nav, .gallery-home .photo-ready.has-album .lb-prev,
.gallery-home .photo-ready.has-album .lb-next { display: block !important; opacity: 1 !important; }
.gallery-home .photo-ready .lb-loader { display: none !important; }
.gallery-home .progressive-status { display: none; position: absolute; z-index: 11; left: 50%; bottom: 16px; transform: translateX(-50%); align-items: center; gap: 8px; padding: 8px 12px; border-radius: 20px; background: #171818e6; color: #eee; font-size: 11px; line-height: 1.5; white-space: nowrap; pointer-events: none; }
.gallery-home .is-loading .progressive-status, .gallery-home .load-error .progressive-status { display: flex; }
.gallery-home .is-loading .progressive-status::before { content: ''; width: 12px; height: 12px; border: 2px solid #ffffff40; border-top-color: #fff; border-radius: 50%; animation: photo-loading .8s linear infinite; }
@keyframes photo-loading { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .gallery-home .is-loading .progressive-status::before { animation: none; } }
.gallery-home .lb-data .lb-details { width: 100%; }
.gallery-home .lb-data .lb-number { display: flex !important; align-items: center; justify-content: space-between; gap: 20px; min-height: 36px; margin: 0; padding: 0; color: #aaa; font-size: 12px; }
.gallery-home .lb-number .vn-red { float: none; margin: 0; }
.gallery-home .vn-red a { margin: 0; padding: 8px 14px; background: #202121; border: 1px solid #ffffff30; border-radius: 3px; color: #e8e8e4; font-size: 11px; line-height: 1.5; }
.gallery-home .vn-red a::before { content: none; }
.gallery-home .vn-red a:hover { background: #333; }
.gallery-home > .lb-close { position: fixed; z-index: 10001; top: max(12px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); display: none; place-items: center; width: 44px; height: 44px; margin: 0; background: #171818e6; border: 1px solid #ffffff30; border-radius: 50%; opacity: 1; cursor: pointer; }
.gallery-home.lb-disable-scrolling > .lb-close { display: grid; }
.gallery-home .lb-close::before { content: ''; display: block; width: 18px; height: 18px; background: linear-gradient(45deg, transparent 45%, #eee 46%, #eee 54%, transparent 55%), linear-gradient(-45deg, transparent 45%, #eee 46%, #eee 54%, transparent 55%); }
/* These links cover half the photo; suppress the browser's full-area tap flash. */
.gallery-home .lb-nav a.lb-prev, .gallery-home .lb-nav a.lb-next { position: relative; width: 50%; background: none; opacity: 1 !important; -webkit-tap-highlight-color: transparent; }
.gallery-home .lb-prev::before, .gallery-home .lb-next::before { content: ''; position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 1px solid #ffffff30; border-radius: 50%; background: #171818c9; }
.gallery-home .lb-prev::before { left: 12px; }
.gallery-home .lb-next::before { right: 12px; }
.gallery-home .lb-prev::after, .gallery-home .lb-next::after { content: ''; position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; background-position: center; background-repeat: no-repeat; }
.gallery-home .lb-prev::after { left: 12px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cpath d='M26 14L18 22L26 30' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.gallery-home .lb-next::after { right: 12px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cpath d='M18 14L26 22L18 30' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.gallery-home .lb-prev::before, .gallery-home .lb-prev::after, .gallery-home .lb-next::before, .gallery-home .lb-next::after { transition: opacity .25s ease; }
.gallery-home .controls-hidden .lb-prev::before, .gallery-home .controls-hidden .lb-prev::after, .gallery-home .controls-hidden .lb-next::before, .gallery-home .controls-hidden .lb-next::after { opacity: 0; pointer-events: none; }
@media (min-width: 1800px) { .gallery-home .photo-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .gallery-home .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) {
    .gallery-home .site-header, .gallery-home main, .gallery-home .site-footer { width: calc(100% - 32px); }
    .gallery-home .site-header { min-height: 84px; gap: 12px; }
    .gallery-home .site-name { font-size: 12px; letter-spacing: .09em; }
    .gallery-home nav { gap: 16px; font-size: 11px; }
    .gallery-home nav span { display: none; }
    .gallery-home .gallery-intro { padding: 20px 0 16px; }
    .gallery-home .gallery-meta { gap: 10px; text-align: right; }
    .gallery-home .gallery-meta p { margin: 0; }
    .gallery-home .gallery-meta p { display: none; }
    .gallery-home .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .gallery-home .lightbox { top: 50% !important; transform: translateY(-50%); }
}
@media (prefers-reduced-motion: reduce) {
    html:has(body.gallery-home) { scroll-behavior: auto; }
    .gallery-home .photo-tile img, .gallery-home .photo-open { transition: none; }
}
