/* One bounded gallery; deliberately no global typography, scrolling, or input rules. */
.yh-gallery-section {
  --yh-bg: var(--brand-deep,#211729);
  --yh-ink: var(--brand-paper,#f6eade);
  --yh-muted: rgba(var(--brand-paper-rgb,246,234,222),.65);
  --yh-accent: var(--brand-accent,#d4965e);
  --yh-line: rgba(var(--brand-paper-rgb,246,234,222),.18);
  --yh-ease: cubic-bezier(.22,.61,.36,1);
  --yh-pad: clamp(20px,4vw,64px);
  padding: clamp(48px,6vw,84px) var(--yh-pad);
  background: var(--yh-bg);
  color: var(--yh-ink);
}
.yh-gallery-section * { box-sizing: border-box; }
.yh-gallery-section [hidden] { display:none!important; }
.yh-gallery-section button, .yh-gallery-section a { -webkit-tap-highlight-color: transparent; }
.yh-gallery-section button:focus-visible, .yh-gallery-section a:focus-visible {
  outline: 2px solid var(--yh-accent); outline-offset: 5px;
}
.yh-gallery-top, .yh-gallery-bottom, .yh-gallery-grid, .yh-gallery-carousel {
  width: min(100%,1320px); margin-inline: auto;
}
.yh-gallery-top { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:18px; }
.yh-gallery-heading { margin:0; font-size:clamp(24px,2.6vw,34px); line-height:1.4; font-weight:500; }
.yh-gallery-heading span { display:block; }
.yh-gallery-heading span+span { color:var(--yh-muted); font-size:.6em; font-weight:400; margin-top:4px; }
.yh-gallery-view-controls { display:inline-flex; padding:3px; gap:2px; border:1px solid var(--yh-line); border-radius:6px; }
.yh-gallery-section:not([data-yh-gallery-ready="true"]) .yh-gallery-view-controls { display:none; }
.yh-gallery-view-controls button {
  min-height:44px; padding:8px 18px; border-radius:4px; font-size:12px; font-weight:500;
  background:transparent; color:var(--yh-muted); transition:background .3s,color .3s;
}
.yh-gallery-view-controls button[aria-pressed="true"] { background:rgba(var(--brand-paper-rgb,246,234,222),.1); color:var(--yh-ink); }
.yh-gallery-view-controls button:disabled { cursor:default; opacity:.45; }
.yh-gallery-stage {
  position:relative; width:min(100%,1320px); height:clamp(480px,68svh,720px); margin-inline:auto;
  overflow:hidden; isolation:isolate; perspective:1100px; touch-action:pan-y;
  cursor:grab; opacity:1; border-radius:6px;
}
.yh-gallery-stage.yh-gallery-dragging { cursor:grabbing; }
.yh-gallery-stage:before {
  content:""; position:absolute; inset:0; pointer-events:none; z-index:0;
  background:radial-gradient(ellipse at center,rgba(var(--brand-paper-rgb,246,234,222),.055),rgba(var(--brand-deep-rgb,33,23,41),.12) 48%,rgba(var(--brand-deep-rgb,33,23,41),.58) 100%);
}
.yh-gallery-world { position:absolute; width:0; height:0; left:50%; top:50%; transform-style:preserve-3d; }
.yh-gallery-orb { position:absolute; width:0; height:0; transform-style:preserve-3d; }
.yh-gallery-card {
  position:absolute; padding:0; margin:0; width:var(--yh-card-width,132px); height:var(--yh-card-height,88px);
  top:calc(var(--yh-card-height,88px) / -2); left:calc(var(--yh-card-width,132px) / -2);
  background:var(--yh-bg); border-radius:5px; overflow:hidden; backface-visibility:hidden;
  box-shadow:0 9px 24px rgba(0,0,0,.18); user-select:none; -webkit-user-select:none;
  transform-style:preserve-3d; transition:box-shadow .25s;
}
.yh-gallery-card img { width:100%; height:100%; object-fit:cover; pointer-events:none; -webkit-user-drag:none; }
.yh-gallery-card:after { content:""; position:absolute; inset:0; background:var(--yh-bg); opacity:var(--yh-depth-shade,.08); pointer-events:none; }
.yh-gallery-card:hover { box-shadow:0 9px 30px rgba(0,0,0,.32); }
.yh-gallery-card[aria-hidden="true"] { pointer-events:none; }
.yh-gallery-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; }
.yh-gallery-grid-card { display:block; text-align:start; color:var(--yh-ink); background:transparent; padding:0; border-radius:5px; overflow:hidden; }
.yh-gallery-grid-card img { width:100%; aspect-ratio:3/2; object-fit:cover; background:var(--yh-bg); border-radius:5px; transition:transform .45s var(--yh-ease); }
.yh-gallery-grid-card:hover img { transform:scale(1.012); }
.yh-gallery-grid-card span { display:block; margin:10px 0 2px; color:var(--yh-muted); font-size:12px; font-weight:400; }
.yh-gallery-grid-card.yh-gallery-image-failed img { opacity:.45; }
/* The enhanced photo view shows the complete image; only its small navigational thumbnails crop. */
.yh-gallery-carousel { outline-offset:7px; }
.yh-gallery-carousel-frame { background:rgba(var(--brand-paper-rgb,246,234,222),.035); border-radius:6px; overflow:hidden; }
.yh-gallery-carousel-media {
  display:block; width:100%; padding:0; border:0; background:transparent; color:inherit;
  touch-action:pan-y; user-select:none; -webkit-user-select:none; cursor:zoom-in;
}
.yh-gallery-carousel-photo {
  display:block; width:100%; height:clamp(360px,65svh,700px); object-fit:contain;
  background:transparent; -webkit-user-drag:none; transition:transform .22s var(--yh-ease);
}
.yh-gallery-carousel-details { display:flex; justify-content:space-between; align-items:flex-start; gap:24px; padding-block:21px 18px; }
.yh-gallery-carousel-copy { min-width:0; max-width:760px; }
.yh-gallery-carousel-copy h3 { font-size:clamp(16px,1.7vw,21px); line-height:1.55; font-weight:500; margin:0; }
.yh-gallery-carousel-copy p { font-size:13px; color:var(--yh-muted); line-height:1.85; margin:6px 0 0; }
.yh-gallery-carousel-navigation { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.yh-gallery-carousel-counter { min-width:49px; margin-inline-end:8px; color:var(--yh-muted); font-size:12px; direction:ltr; font-variant-numeric:tabular-nums; text-align:center; }
.yh-gallery-carousel-navigation button {
  display:grid; place-items:center; width:46px; height:46px; min-width:44px; padding:0;
  border:1px solid var(--yh-line); border-radius:5px; color:var(--yh-ink); background:transparent;
  transition:background .2s,border-color .2s;
}
.yh-gallery-carousel-navigation button:hover { background:rgba(var(--brand-paper-rgb,246,234,222),.08); border-color:var(--yh-accent); }
.yh-gallery-carousel-navigation svg { width:18px; height:18px; }
.yh-gallery-section[dir="rtl"] .yh-gallery-carousel-navigation svg { transform:scaleX(-1); }
.yh-gallery-carousel-thumbnails {
  display:flex; align-items:center; gap:10px; padding:7px 5px 12px; overflow-x:auto; overflow-y:hidden;
  overscroll-behavior-x:contain; scrollbar-width:thin; scrollbar-color:var(--yh-line) transparent;
}
.yh-gallery-carousel-thumb {
  flex:0 0 76px; height:56px; min-height:44px; padding:3px; border:1px solid transparent;
  border-radius:5px; background:transparent; opacity:.56; transition:opacity .2s,border-color .2s;
}
.yh-gallery-carousel-thumb[aria-pressed="true"] { opacity:1; border-color:var(--yh-accent); }
.yh-gallery-carousel-thumb:hover { opacity:1; }
.yh-gallery-carousel-thumb img { display:block; width:100%; height:100%; object-fit:cover; border-radius:2px; }
.yh-gallery-carousel-retry { margin-top:9px; padding:7px 11px; min-height:44px; color:var(--yh-ink); border:1px solid var(--yh-line); border-radius:4px; background:transparent; font-size:12px; }
.yh-gallery-carousel-media.yh-gallery-swiping { cursor:grabbing; }
.yh-gallery-swiping .yh-gallery-carousel-photo, .yh-gallery-viewer-photo.yh-gallery-swiping { transition:none; }
.yh-gallery-bottom { display:flex; align-items:flex-end; justify-content:space-between; gap:28px; padding-top:28px; }
.yh-gallery-support { font-size:13px; line-height:1.8; color:var(--yh-muted); }
.yh-gallery-hint { display:block; font-size:11px; color:var(--yh-muted); margin-top:5px; }
.yh-gallery-cta { min-height:44px; display:inline-flex; align-items:center; justify-content:center; gap:18px; padding:10px 0; font-size:13px; font-weight:500; color:var(--yh-ink); white-space:nowrap; border-bottom:1px solid var(--yh-accent); }
.yh-gallery-cta svg { width:27px; height:16px; }
.yh-gallery-section[dir="rtl"] .yh-gallery-cta svg { transform:scaleX(-1); }
.yh-gallery-stage.yh-gallery-entered { animation:yh-gallery-enter .7s var(--yh-ease) both; }
.yh-gallery-carousel.yh-gallery-view-enter, .yh-gallery-stage.yh-gallery-view-enter { animation:yh-gallery-view .3s var(--yh-ease); }
@keyframes yh-gallery-enter { from { opacity:.3; transform:translateY(14px); } to { opacity:1; transform:none; } }
@keyframes yh-gallery-view { from { opacity:.25; } to { opacity:1; } }
/* The native dialog stays inside this section's namespace and its own top layer. */
.yh-gallery-viewer {
  --yh-ink:var(--brand-paper,#f6eade); --yh-muted:rgba(var(--brand-paper-rgb,246,234,222),.65); --yh-accent:var(--brand-accent,#d4965e); --yh-line:rgba(var(--brand-paper-rgb,246,234,222),.18);
  position:fixed; inset:0; width:100%; height:100%; max-width:none; max-height:none; margin:0; padding:24px;
  background:rgba(var(--brand-deep-rgb,33,23,41),.98); color:var(--yh-ink); border:0; box-shadow:none; overflow:auto;
}
.yh-gallery-viewer::backdrop { background:rgba(var(--brand-deep-rgb,33,23,41),.85); backdrop-filter:none; }
.yh-gallery-viewer-shell { width:min(1200px,100%); min-height:calc(100% - 1px); margin:auto; display:flex; flex-direction:column; justify-content:center; }
.yh-gallery-viewer-top { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:15px; }
.yh-gallery-viewer-counter { direction:ltr; font-size:12px; font-variant-numeric:tabular-nums; color:var(--yh-muted); }
.yh-gallery-viewer button { color:var(--yh-ink); background:transparent; min-width:44px; min-height:44px; border:1px solid var(--yh-line); border-radius:5px; }
.yh-gallery-viewer button:focus-visible { outline:2px solid var(--yh-accent); outline-offset:4px; }
.yh-gallery-close { display:inline-flex; align-items:center; gap:9px; padding:8px 14px; font-size:12px; }
.yh-gallery-close svg { width:15px; height:15px; }
.yh-gallery-viewer-photo { width:100%; height:min(65svh,740px); min-height:240px; object-fit:contain; background:transparent; touch-action:pan-y; user-select:none; -webkit-user-select:none; -webkit-user-drag:none; transition:transform .22s var(--yh-ease); }
.yh-gallery-viewer-bottom { display:flex; justify-content:space-between; gap:24px; align-items:center; padding-top:18px; }
.yh-gallery-viewer-copy h3 { font-size:clamp(15px,1.7vw,20px); font-weight:500; line-height:1.55; }
.yh-gallery-viewer-copy { min-width:0; max-width:850px; }
.yh-gallery-viewer-copy p.yh-gallery-viewer-description { color:var(--yh-muted); font-size:13px; line-height:1.85; margin-top:6px; }
.yh-gallery-viewer-nav { display:flex; gap:8px; }
.yh-gallery-viewer-nav button { display:grid; place-items:center; width:46px; padding:0; }
.yh-gallery-viewer-nav svg { width:18px; height:18px; }
.yh-gallery-viewer[dir="rtl"] .yh-gallery-viewer-nav svg { transform:scaleX(-1); }
.yh-gallery-retry { font-size:11px; margin-top:9px; padding:5px 11px; }
.yh-gallery-flight { position:fixed; z-index:3; pointer-events:none; object-fit:cover; border-radius:5px; max-width:none; transform-origin:top left; }
@media(max-width:900px) { .yh-gallery-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; } }
@media(max-width:600px) {
  .yh-gallery-top { flex-wrap:wrap; gap:13px; margin-bottom:14px; }
  .yh-gallery-view-controls { margin-inline-start:auto; }
  .yh-gallery-view-controls button { padding:8px 12px; font-size:11px; }
  .yh-gallery-heading { font-size:23px; }
  .yh-gallery-stage { height:clamp(380px,60svh,560px); perspective:760px; }
  .yh-gallery-bottom { display:block; padding-top:22px; }
  .yh-gallery-support { font-size:12px; }
  .yh-gallery-cta { margin-top:22px; font-size:12px; }
  .yh-gallery-grid { gap:18px 12px; }
  .yh-gallery-grid-card span { font-size:11px; margin-top:8px; }
  .yh-gallery-carousel-photo { height:clamp(280px,54svh,470px); }
  .yh-gallery-carousel-details { flex-wrap:wrap; gap:13px; padding-block:16px 14px; }
  .yh-gallery-carousel-copy h3 { font-size:16px; }
  .yh-gallery-carousel-copy p { font-size:12px; }
  .yh-gallery-carousel-navigation { margin-inline-start:auto; }
  .yh-gallery-carousel-thumbnails { gap:7px; }
  .yh-gallery-carousel-thumb { flex-basis:65px; height:49px; }
  .yh-gallery-viewer { padding:14px; }
  .yh-gallery-viewer-top { margin-bottom:10px; }
  .yh-gallery-viewer-photo { height:62svh; min-height:180px; }
  .yh-gallery-viewer-bottom { gap:12px; align-items:flex-start; padding-top:14px; }
  .yh-gallery-viewer-copy { min-width:0; }
  .yh-gallery-viewer-copy h3 { font-size:14px; }
  .yh-gallery-viewer-copy p.yh-gallery-viewer-description { font-size:12px; }
  .yh-gallery-viewer-nav { flex-shrink:0; gap:5px; }
  .yh-gallery-viewer-nav button { width:44px; }
}
@media(max-width:359px) { .yh-gallery-grid { grid-template-columns:1fr; } .yh-gallery-top { align-items:flex-start; } .yh-gallery-view-controls { margin-inline-start:0; } }
@media(max-height:500px) and (orientation:landscape) {
  .yh-gallery-stage { height:360px; }
  .yh-gallery-carousel-photo { height:68svh; min-height:230px; }
  .yh-gallery-viewer { padding:12px 20px; }
  .yh-gallery-viewer-photo { height:58svh; min-height:140px; }
  .yh-gallery-viewer-top { margin-bottom:5px; }
  .yh-gallery-viewer-bottom { padding-top:8px; }
}
@media(prefers-reduced-motion:reduce) {
  .yh-gallery-section *, .yh-gallery-viewer * { animation:none!important; transition:none!important; }
}
