.ypm-portfolio,.ypm-works{width:min(96vw,2400px);max-width:none!important;margin:35px auto 90px}.ypm-heading{font-size:clamp(24px,3vw,42px);font-weight:400;letter-spacing:.09em;margin:0 0 36px}.ypm-wall{columns:5 220px;column-gap:14px}.ypm-tile{display:block!important;break-inside:avoid;margin:0 0 14px;padding:0!important;width:100%;border:0!important;background:transparent!important;cursor:zoom-in;line-height:0;overflow:hidden}.ypm-tile img{display:block;width:100%;height:auto;max-width:100%;transition:opacity .2s}.ypm-tile:hover img{opacity:.83}.ypm-more{display:block;margin:40px auto;padding:12px 35px;background:transparent;border:1px solid #777;cursor:pointer}.ypm-works-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.ypm-work-card{text-decoration:none!important;color:inherit;display:block}.ypm-work-card img,.ypm-placeholder{display:block;width:100%;aspect-ratio:4/3;object-fit:cover;background:#eee}.ypm-work-card span:last-child{display:block;padding:12px 0;letter-spacing:.07em}.ypm-category-page{min-height:55vh}.ypm-single{max-width:1400px;margin:auto;text-align:center}.ypm-single-image{max-height:85vh;width:auto;height:auto;object-fit:contain}.ypm-single-meta{font-size:.9em;color:#777}.ypm-single-caption{max-width:700px;margin:25px auto 40px;text-align:left}.ypm-overlay{position:fixed;inset:0;background:rgba(8,8,8,.97);z-index:999999;display:flex;flex-direction:column;align-items:center;justify-content:center;color:white;padding:42px 70px 18px;box-sizing:border-box}.ypm-overlay[hidden]{display:none!important}.ypm-overlay img{display:block;max-width:100%;max-height:calc(100vh - 160px);width:auto;height:auto;object-fit:contain}.ypm-overlay .ypm-info{text-align:center;margin-top:12px;font-size:13px;line-height:1.6;max-width:720px}.ypm-overlay .ypm-info small{display:block;opacity:.7}.ypm-overlay button{position:absolute;background:transparent;border:0;color:#fff;cursor:pointer;font-size:36px;padding:15px}.ypm-close{top:4px;right:20px}.ypm-prev{left:12px;top:45%}.ypm-next{right:12px;top:45%}.ypm-overlay .ypm-caption{font-size:12px;opacity:.8;max-height:3.4em;overflow:auto}.ypm-overlay .ypm-counter{position:absolute;bottom:8px;right:18px;font-size:12px;opacity:.6}body.ypm-lock{overflow:hidden}@media(max-width:850px){.ypm-wall{columns:3 160px;column-gap:9px}.ypm-tile{margin-bottom:9px}.ypm-works-grid{grid-template-columns:repeat(2,1fr)}.ypm-overlay{padding:55px 30px 20px}.ypm-overlay img{max-height:calc(100vh - 195px)}.ypm-prev{left:0}.ypm-next{right:0}}@media(max-width:500px){.ypm-wall{columns:2 125px}.ypm-works-grid{gap:12px}.ypm-portfolio,.ypm-works{width:96vw}}

/* v0.2.3: Mouse clicks must not leave a dark outline on photo tiles.
   Retain an accessible focus indicator for keyboard navigation. */
.ypm-tile:focus:not(:focus-visible){outline:none!important;box-shadow:none!important}
.ypm-tile:focus-visible{outline:2px solid #555!important;outline-offset:3px}
.ypm-tile img{outline:none!important;box-shadow:none!important}

/* Apply minimal portfolio layout only to the photo wall preview and pages
   containing the wall shortcode. Do not change unrelated pages. */
body.ypm-site-mode .wp-block-post-title{display:none!important}
body.ypm-site-mode .wp-site-blocks>main,
body.ypm-site-mode main.wp-block-group{margin-block-start:0!important;padding-block-start:0!important}
body.ypm-site-mode .ypm-portfolio{margin-top:16px;margin-bottom:36px}
body.ypm-site-mode .wp-site-blocks>footer,
body.ypm-site-mode footer.wp-block-template-part{display:none!important}

/* v0.2.6: Restore the brand/navigation on the published front page.
   The block theme may use a front-page template without the preview header. */
.ypm-home-header{width:min(96vw,2400px);margin:0 auto 24px;display:flex;align-items:center;justify-content:space-between;gap:24px;padding:24px 0 0;font-family:inherit}
.ypm-home-header a{color:inherit;text-decoration:none!important}
.ypm-home-brand{font-weight:650;font-size:clamp(17px,1.5vw,22px);letter-spacing:-.02em}
.ypm-home-header nav{display:flex;align-items:center;flex-wrap:wrap;gap:clamp(16px,2vw,34px);font-size:15px}
.ypm-home-header nav a:hover{text-decoration:underline!important;text-underline-offset:5px}
body.ypm-site-mode .ypm-home-header+.ypm-portfolio{margin-top:0}
@media(max-width:600px){.ypm-home-header{padding-top:16px;gap:12px;align-items:flex-start;flex-direction:column}.ypm-home-header nav{gap:20px;font-size:13px}}

/* v0.2.7: gallery layout and consistent category navigation */
body.ypm-category-mode .wp-site-blocks>header,
body.ypm-category-mode .wp-site-blocks>footer,
body.ypm-category-mode header.wp-block-template-part,
body.ypm-category-mode footer.wp-block-template-part{display:none!important}
body.ypm-category-mode .wp-site-blocks{padding-top:0!important}
.ypm-category-page{width:100%;min-height:65vh}
.ypm-category-page .ypm-portfolio{width:min(94vw,1680px);margin:32px auto 90px}
.ypm-category-gallery .ypm-wall{columns:2 360px;column-gap:32px}
.ypm-category-gallery .ypm-tile{margin-bottom:32px}
.ypm-category-gallery .ypm-tile img{width:100%;height:auto;object-fit:contain}
body.ypm-category-mode .ypm-home-header{margin-bottom:28px}
@media(max-width:760px){.ypm-category-gallery .ypm-wall{columns:2 240px;column-gap:16px}.ypm-category-gallery .ypm-tile{margin-bottom:16px}}
@media(max-width:540px){.ypm-category-gallery .ypm-wall{columns:1;column-gap:0}.ypm-category-gallery .ypm-tile{margin-bottom:24px}}

/* v0.2.8: category uses a standalone template; no block-theme header/footer. */
body.ypm-standalone-category{margin:0;background:#fff;color:#171717}
body.ypm-standalone-category .ypm-category-page{display:flow-root}
body.ypm-standalone-category .ypm-home-header{box-sizing:border-box}

/* v0.2.9: Limit only HOME wall image height without cropping or stretching.
   Category galleries retain their original large two-column presentation. */
body.ypm-site-mode:not(.ypm-category-mode) .ypm-portfolio .ypm-wall .ypm-tile img{
  width:auto;max-width:100%;height:auto;max-height:350px;object-fit:contain;object-position:left top;
}
/* Use more of the viewport for lightbox images while preserving the caption. */
.ypm-overlay{padding:12px 54px 10px}
.ypm-overlay img{max-height:calc(100dvh - 105px);max-width:100%;flex-shrink:1;min-height:0}
.ypm-overlay .ypm-info{margin-top:6px;flex-shrink:0}
@media(max-width:850px){
 .ypm-overlay{padding:30px 28px 12px}
 .ypm-overlay img{max-height:calc(100dvh - 135px)}
}
@media(max-width:500px){
 .ypm-overlay{padding:42px 20px 14px}
 .ypm-overlay img{max-height:calc(100dvh - 155px)}
}

/* v0.3.0: HOME packs tiles into shortest-height columns; category layout unchanged. */
body.ypm-site-mode:not(.ypm-category-mode) .ypm-portfolio:not(.ypm-category-gallery) .ypm-wall:has(.ypm-packed-column){
  columns:auto;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;align-items:start;
}
.ypm-packed-column{min-width:0;display:flex;flex-direction:column;gap:14px}
.ypm-packed-column .ypm-tile{margin:0!important}
@media(max-width:850px){
 body.ypm-site-mode:not(.ypm-category-mode) .ypm-portfolio:not(.ypm-category-gallery) .ypm-wall:has(.ypm-packed-column){grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
 .ypm-packed-column{gap:9px}
}
@media(max-width:500px){
 body.ypm-site-mode:not(.ypm-category-mode) .ypm-portfolio:not(.ypm-category-gallery) .ypm-wall:has(.ypm-packed-column){grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* v0.3.1: maximize lightbox image within the viewport, with a compact metadata row. */
.ypm-overlay{padding:4px 38px 4px;gap:0}
.ypm-overlay img{max-width:100%;max-height:calc(100dvh - 54px);min-height:0;flex:0 1 auto;object-fit:contain}
.ypm-overlay .ypm-info{margin-top:3px;font-size:12px;line-height:1.25;flex:0 0 auto}
.ypm-overlay .ypm-info small{font-size:10px}
.ypm-overlay .ypm-caption{max-height:2.2em}
@media(max-width:850px){.ypm-overlay{padding:6px 28px 5px}.ypm-overlay img{max-height:calc(100dvh - 66px)}}
@media(max-width:500px){.ypm-overlay{padding:8px 18px 5px}.ypm-overlay img{max-height:calc(100dvh - 80px)}}

/* v0.3.2: gap-free justified photo rows on HOME only. */
body.ypm-site-mode:not(.ypm-category-mode) .ypm-portfolio:not(.ypm-category-gallery) .ypm-wall:has(.ypm-justified-row){display:flex!important;flex-direction:column;gap:12px;columns:auto!important}
.ypm-justified-row{display:flex;flex-wrap:nowrap;gap:12px;align-items:start;width:100%}
.ypm-justified-row .ypm-tile{flex:0 0 auto;min-width:0;margin:0!important;overflow:hidden}
body.ypm-site-mode:not(.ypm-category-mode) .ypm-justified-row .ypm-tile img{display:block;max-width:100%;max-height:none;object-fit:contain}
@media(max-width:850px){body.ypm-site-mode:not(.ypm-category-mode) .ypm-portfolio:not(.ypm-category-gallery) .ypm-wall:has(.ypm-justified-row),.ypm-justified-row{gap:9px}}
