
.gallery-hero{padding:65px 0 25px}.gallery-hero h1{font-size:clamp(35px,5.5vw,68px);margin:12px 0;letter-spacing:-.04em}.gallery-intro{max-width:760px;color:#62645e;line-height:1.8}.gallery-filters{display:flex;gap:10px;flex-wrap:wrap;margin:26px 0}.gallery-filters button{border:1px solid #cdc6ba;background:white;border-radius:28px;padding:11px 17px;cursor:pointer;font:inherit}.gallery-filters button[aria-pressed=true]{background:#586e62;color:#fff}.gallery-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:19px;padding-bottom:85px}.gallery-card{border:1px solid #ddd8cd;background:white;border-radius:13px;overflow:hidden}.gallery-cover{aspect-ratio:4/5;background:linear-gradient(140deg,#dfd7ca,#aab9a9);display:flex;align-items:center;justify-content:center;position:relative}.gallery-cover:after{content:'PHOTO ALBUM PREVIEW';font-size:12px;letter-spacing:.16em;color:#fff;position:absolute}.gallery-cover img{width:100%;height:100%;object-fit:cover;position:relative;z-index:1}.gallery-info{padding:17px}.gallery-info h2{font-size:21px;margin:5px 0}.gallery-info p{font-size:13px;color:#6e716b}.gallery-chip{font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:#8b665a}.gallery-empty{grid-column:1/-1;border:1px dashed #c7c4ba;padding:32px;text-align:center}.album-dialog{border:0;border-radius:15px;padding:0;max-width:min(830px,94vw);width:100%;max-height:88vh;overflow:auto}.album-dialog::backdrop{background:#171d19bd}.album-inner{padding:20px}.album-close{float:right;cursor:pointer;background:#efeee8;border:0;border-radius:20px;padding:9px 15px}.album-photos{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:16px}.album-photos img{width:100%;aspect-ratio:4/5;object-fit:cover;border-radius:8px}.album-note{padding:15px;background:#f5f1e9;border-radius:8px;color:#696c65}.gallery-admin{padding:60px 0 90px}.gallery-admin-grid{display:grid;grid-template-columns:1fr 1fr;gap:36px}.gallery-admin form{display:grid;gap:12px}.gallery-admin label{display:grid;gap:5px;font-size:13px}.gallery-admin input,.gallery-admin select,.gallery-admin textarea{width:100%;padding:12px;border:1px solid #d7d5cf;border-radius:7px}.gallery-admin textarea{min-height:110px}.gallery-admin .inline-check{display:flex;gap:8px;align-items:center}.gallery-admin .inline-check input{width:auto}.gallery-admin button{cursor:pointer}.album-admin-item{padding:16px 0;border-bottom:1px solid #ddd}.album-admin-item button{margin:5px 8px 0 0;padding:8px 12px}.gallery-note{background:#f6eadc;padding:14px;border-radius:8px;font-size:13px;line-height:1.7}@media(max-width:800px){.gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.gallery-admin-grid{grid-template-columns:1fr}}@media(max-width:490px){.gallery-grid{grid-template-columns:1fr}.gallery-hero{padding-top:35px}}

/* V20 — Bright Wabi-Sabi: Vietnamese lotus, Japanese seigaiha, sakura */
.v20-fusion{background:#fffcf5;color:#304237}
.v20-fusion .gallery-hero{position:relative;padding:72px 0 30px;isolation:isolate}
.v20-fusion .gallery-hero:before{content:"";position:absolute;right:1%;top:0;width:185px;height:120px;background:url('motif-sakura.svg') center/contain no-repeat;opacity:.54;z-index:-1;pointer-events:none}
.v20-fusion .gallery-hero:after{content:"";position:absolute;left:-75px;bottom:-25px;width:135px;height:145px;background:url('motif-lotus.svg') center/contain no-repeat;opacity:.24;z-index:-1;pointer-events:none}
.v20-fusion .gallery-filters{padding:16px 0 22px;border-top:1px solid #e9e7df}
.v20-fusion .gallery-filters button{background:#fffdf9;border-color:#d4d9ce;color:#3e594b}
.v20-fusion .gallery-filters button[aria-pressed=true]{background:#446451;color:white;border-color:#446451}
.v20-fusion .gallery-card{border:1px solid #e8e4d9;border-radius:3px;box-shadow:0 9px 28px rgba(40,55,44,.06)}
.v20-fusion .gallery-cover{background:linear-gradient(145deg,#f3e5d8,#d6e1d4 75%)}
.v20-fusion .gallery-cover:after{display:none}
.gallery-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;color:#758d7b}
.gallery-placeholder span{font:normal 75px/1 Georgia,serif;color:#d1a994}
.gallery-placeholder small{letter-spacing:.18em;color:#7c8b80;font-size:11px}
.v20-fusion .gallery-card:nth-child(3n+2) .gallery-cover{background:linear-gradient(145deg,#f4e9e4,#e5d1c8)}
.v20-fusion .gallery-card:nth-child(3n+3) .gallery-cover{background:linear-gradient(145deg,#e5eddf,#d5e1e0)}
.v20-fusion .gallery-grid{position:relative;isolation:isolate}
.v20-fusion .gallery-grid:after{content:"";position:absolute;right:0;bottom:0;width:160px;height:135px;background:url('motif-seigaiha.svg') repeat;opacity:.20;z-index:-1;pointer-events:none}
.v20-fusion .gallery-chip,.album-tag{display:inline-block;border-radius:2px;background:#edf1e7;color:#476452;padding:5px 8px;font-size:12px;letter-spacing:.02em;text-transform:none}
.v20-fusion .gallery-info h2{font-family:Georgia,serif;font-size:25px;color:#2e4335}
.v20-fusion .album-dialog{background:#fffaf2}
.v20-fusion .album-inner{padding:clamp(22px,4vw,45px)}
.v20-fusion .footer{position:relative;overflow:hidden}
.v20-fusion .footer:after{content:"";position:absolute;right:0;bottom:0;width:230px;height:130px;opacity:.13;background:url('motif-seigaiha.svg') repeat;pointer-events:none}
.gallery-admin h1{font-family:Georgia,serif;font-size:clamp(30px,5vw,54px)}
.gallery-admin .gallery-admin-grid{margin-top:35px}
.gallery-admin .admin-actions{display:flex;gap:10px;flex-wrap:wrap}
.gallery-admin .gallery-hint{font-size:12px;color:#66786b;line-height:1.7}
.gallery-admin .album-admin-item p{line-height:2}
@media(max-width:650px){.v20-fusion .gallery-hero:before{width:98px;height:70px;opacity:.35}.v20-fusion .gallery-hero:after{opacity:.12}.v20-fusion .gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.v20-fusion .gallery-info{padding:12px}.v20-fusion .gallery-info h2{font-size:19px}.v20-fusion .gallery-cover{aspect-ratio:3/4}.v20-fusion .gallery-filters button{font-size:13px;padding:10px 12px}}
@media(max-width:400px){.v20-fusion .gallery-grid{grid-template-columns:1fr}}

/* V21: the entire album cover opens the album; only the category tag is visible. */
.gallery-card{position:relative}
.gallery-cover-button{display:block;width:100%;height:100%;padding:0;border:0;text-align:left;background:transparent;cursor:pointer;color:inherit}
.gallery-cover-button .gallery-cover{display:block;width:100%;aspect-ratio:4/5;overflow:hidden;position:relative}
.gallery-cover-button .gallery-cover img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .25s ease}
.gallery-cover-button:hover .gallery-cover img{transform:scale(1.025)}
.gallery-cover-button:focus-visible{outline:3px solid #406f55;outline-offset:3px}
.gallery-cover-label{position:absolute;bottom:14px;left:14px;z-index:3;max-width:calc(100% - 65px);background:rgba(255,252,245,.93);color:#2e4938;padding:9px 12px;font-size:13px;font-weight:700;line-height:1.35;box-shadow:0 2px 12px rgba(33,43,35,.08)}
.gallery-cover-open{position:absolute;bottom:14px;right:13px;z-index:3;width:35px;height:35px;display:grid;place-items:center;background:rgba(47,77,55,.9);color:white;font-size:21px}
.v20-fusion .gallery-cover-button .gallery-cover{aspect-ratio:4/5}
.v20-fusion .gallery-card{overflow:hidden}
.v20-fusion .gallery-cover-button .gallery-placeholder{height:100%}
.v20-fusion .gallery-cover-button .gallery-placeholder small{margin-bottom:25px}
@media(max-width:650px){.v20-fusion .gallery-cover-button .gallery-cover{aspect-ratio:3/4}.gallery-cover-label{bottom:10px;left:10px;font-size:11px;padding:8px 9px;max-width:calc(100% - 57px)}.gallery-cover-open{bottom:10px;right:10px;width:30px;height:30px}}
@media(prefers-reduced-motion:reduce){.gallery-cover-button .gallery-cover img{transition:none}}

/* V27: Full-viewport native dialog with a centered, viewport-bounded panel. */
body.v20-fusion dialog.album-dialog {
  box-sizing: border-box !important;
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  margin: 0 !important;
  padding: 14px !important;
  border: 0 !important;
  border-radius: 0 !important;
  width: 100vw !important;
  min-width: 0 !important;
  max-width: 100vw !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
  overflow: hidden !important;
}
body.v20-fusion dialog.album-dialog:not([open]) { display: none !important; }
body.v20-fusion dialog.album-dialog[open] {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
body.v20-fusion dialog.album-dialog::backdrop { background: rgba(19,29,22,.72); }
body.v20-fusion dialog.album-dialog .album-inner {
  flex: 0 1 830px;
  box-sizing: border-box !important;
  position: relative;
  margin: auto;
  padding: 26px 22px 22px;
  width: 100%;
  min-width: 0;
  max-width: 830px;
  max-height: calc(100dvh - 28px);
  overflow-x: hidden;
  overflow-y: auto;
  background: #fffaf2;
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(0,0,0,.2);
}
body.v20-fusion dialog.album-dialog .album-close {
  position: absolute;
  float: none;
  right: 12px;
  top: 12px;
  z-index: 3;
  cursor: pointer;
  white-space: nowrap;
  padding: 8px 11px;
}
body.v20-fusion dialog.album-dialog #album-title {
  padding-right: 78px;
  overflow-wrap: anywhere;
  line-height: 1.18;
}
body.v20-fusion dialog.album-dialog .album-note {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
}
body.v20-fusion dialog.album-dialog .album-photos { min-width: 0; }
body.v20-fusion dialog.album-dialog .album-photos img { max-width: 100%; min-width: 0; }
@media (max-width: 490px) {
  body.v20-fusion dialog.album-dialog { padding: 12px !important; }
  body.v20-fusion dialog.album-dialog .album-inner {
    flex-basis: auto;
    max-width: 100%;
    padding: 22px 14px 18px;
    max-height: calc(100dvh - 24px);
  }
  body.v20-fusion dialog.album-dialog .album-close { top: 9px; right: 9px; }
  body.v20-fusion dialog.album-dialog #album-title {
    padding-right: 64px;
    font-size: clamp(23px, 6.3vw, 30px);
  }
  body.v20-fusion dialog.album-dialog .album-photos { grid-template-columns: minmax(0, 1fr); }
}

/* V31: safely constrain remotely approved crops in public albums */
.gallery-cover img,.album-photos img{max-width:100%;}
.gallery-cover{overflow:hidden}

/* V31 real albums: title + count on cover, thumbnail grid, full-size viewer */
.gallery-cover-label{display:flex;flex-direction:column;gap:3px}
.gallery-cover-title{font-family:Georgia,serif;font-size:17px;font-weight:700;line-height:1.2}
.gallery-cover-meta{font-size:11.5px;font-weight:600;color:#5d6f62;letter-spacing:.01em}
body.v20-fusion dialog.album-dialog .album-inner{max-width:1040px;flex-basis:1040px}
#album-description{margin:6px 0 0;color:#5d6f62;font-size:14px}
.album-photos.gallery-photo-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:18px}
.gallery-photo{display:block;padding:0;border:0;background:#eee8dc;border-radius:6px;overflow:hidden;cursor:zoom-in;aspect-ratio:3/4}
.gallery-photo img{display:block;width:100%;height:100%;object-fit:cover;border-radius:0!important;aspect-ratio:auto!important;transition:transform .2s ease}
.gallery-photo:hover img{transform:scale(1.03)}
.gallery-photo:focus-visible{outline:3px solid #406f55;outline-offset:2px}
@media(max-width:800px){.album-photos.gallery-photo-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:490px){body.v20-fusion dialog.album-dialog .album-photos.gallery-photo-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.gallery-cover-title{font-size:14px}.gallery-cover-meta{font-size:10.5px}}
dialog.gallery-viewer{position:fixed;inset:0;width:100vw;height:100dvh;max-width:100vw;max-height:100dvh;margin:0;padding:0;border:0;background:rgba(14,20,16,.94);color:#fff;overflow:hidden}
dialog.gallery-viewer[open]{display:flex;align-items:center;justify-content:center}
dialog.gallery-viewer::backdrop{background:rgba(14,20,16,.94)}
.gv-img{max-width:calc(100vw - 120px);max-height:calc(100dvh - 90px);width:auto;height:auto;object-fit:contain;border-radius:3px;user-select:none}
.gallery-viewer button{position:absolute;border:0;background:rgba(255,255,255,.14);color:#fff;cursor:pointer;display:grid;place-items:center;border-radius:50%;font:300 34px/1 Georgia,serif}
.gallery-viewer button:hover{background:rgba(255,255,255,.26)}
.gallery-viewer button:focus-visible{outline:3px solid #fff;outline-offset:2px}
.gallery-viewer button[hidden]{display:none}
.gv-close{top:14px;right:14px;width:46px;height:46px}
.gv-prev,.gv-next{top:50%;transform:translateY(-50%);width:50px;height:50px}
.gv-prev{left:12px}.gv-next{right:12px}
.gv-count{position:absolute;bottom:14px;left:50%;transform:translateX(-50%);font-size:13px;letter-spacing:.08em;background:rgba(0,0,0,.35);padding:5px 11px;border-radius:14px}
@media(max-width:650px){.gv-img{max-width:100vw;max-height:calc(100dvh - 120px)}.gv-prev,.gv-next{top:auto;bottom:8px;transform:none;width:44px;height:44px}.gv-count{bottom:20px}}
@media(prefers-reduced-motion:reduce){.gallery-photo img{transition:none}}
