/* Works grid + detail view, shared by the project pages (same design as VainEgo) */

.works{padding:6vw 3vw 6vw;background:var(--paper)}
.works-head{display:flex;justify-content:space-between;align-items:baseline;gap:20px;max-width:1320px;margin:0 auto 1.6vw}
.works-head small{color:var(--umber);letter-spacing:.14em}
.works-note{margin:0;font-size:11px;color:#7a6e63}
.works-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:clamp(14px,1.8vw,26px);max-width:1320px;margin:0 auto;transition:opacity .22s ease}
.works-grid.is-leaving{opacity:0}
.work-card{display:block;border:0;padding:0;background:none;text-align:left;color:var(--ink);cursor:pointer;animation:wcIn .7s cubic-bezier(.2,.8,.2,1) both;animation-delay:calc(var(--i) * 45ms)}
@keyframes wcIn{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:none}}
.wc-media{position:relative;display:block;aspect-ratio:4/5;overflow:hidden;background:var(--paper-2)}
.wc-media img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .9s cubic-bezier(.2,.8,.2,1)}
.wc-view{position:absolute;left:0;right:0;bottom:0;padding:28px 14px 12px;font-size:10px;letter-spacing:.12em;color:var(--moon);background:linear-gradient(0deg,rgba(58,40,30,.72),rgba(58,40,30,0));opacity:0;transform:translateY(8px);transition:opacity .35s,transform .35s}
.work-card:hover .wc-media img,.work-card:focus-visible .wc-media img{transform:scale(1.05)}
.work-card:hover .wc-view,.work-card:focus-visible .wc-view{opacity:1;transform:none}
.work-card:focus-visible{outline:2px solid var(--umber);outline-offset:4px}
.wc-cap{display:flex;gap:10px;align-items:baseline;padding:10px 2px 0;font-size:10.5px;letter-spacing:.04em;border-top:0}
.wc-cap b{color:var(--umber);font-weight:500}
.wc-cap span{color:#4a3f37;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* detail view */
.work-view{padding:0;border:0;width:min(1180px,94vw);max-height:90vh;background:var(--paper);color:var(--ink);overflow:hidden}
.work-view::backdrop{background:rgba(59,46,37,.78);backdrop-filter:blur(6px)}
.work-view[open]{animation:wvIn .5s cubic-bezier(.2,.8,.2,1)}
@keyframes wvIn{from{opacity:0;transform:translateY(20px) scale(.98)}to{opacity:1;transform:none}}
.wv-close{position:absolute;right:14px;top:14px;z-index:3;width:44px;height:44px;border-radius:50%;border:1px solid var(--line-light);background:var(--paper);color:var(--ink);font-size:24px;line-height:1;cursor:pointer;transition:background .2s,color .2s}
.wv-close:hover,.wv-close:focus-visible{background:var(--ink);color:var(--paper);outline:0}
.wv-body{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(300px,.75fr);max-height:90vh}
.wv-media{margin:0;background:#f4f2ee;display:grid;place-items:center;padding:3vw;min-height:0}
.wv-image{display:block;width:min(100%,460px);max-width:100%;max-height:80vh;object-fit:contain;transition:opacity .18s ease,transform .3s ease}
.wv-info{position:relative;display:flex;flex-direction:column;gap:14px;padding:4.4vw 3vw 2.4vw;overflow:auto;transition:opacity .18s ease}
.work-view.is-switching .wv-image,.work-view.is-switching .wv-info{opacity:0}
.work-view.is-switching .wv-image{transform:scale(.985)}
.wv-label{color:var(--umber);letter-spacing:.14em}
.wv-title{margin:0;font-size:clamp(1.8rem,3vw,3.2rem)!important;line-height:.92!important}
.wv-text{margin:0;font-size:13px;line-height:1.7;color:#3a302a}
.wv-meta{margin:6px 0 0;border-top:1px solid var(--ink)}
.wv-meta div{display:grid;grid-template-columns:76px 1fr;gap:12px;padding:10px 0;border-bottom:1px solid var(--line-light);font-size:11.5px;line-height:1.55}
.wv-meta dt{color:var(--umber);letter-spacing:.08em;font-size:10px;padding-top:2px}
.wv-meta dd{margin:0}
.wv-qr{width:74px;height:74px;object-fit:contain}
.wv-nav{margin-top:auto;padding-top:18px;display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:11px;letter-spacing:.08em;color:#7a6e63}
.wv-nav button{width:44px;height:44px;border-radius:50%;border:1px solid var(--line-light);background:transparent;color:var(--ink);font-size:18px;cursor:pointer;transition:background .2s,color .2s,border-color .2s}
.wv-nav button:hover,.wv-nav button:focus-visible{background:var(--ink);border-color:var(--ink);color:var(--paper);outline:0}
@media(max-width:1000px){.works-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:700px){
  .works{padding:14vw 4vw}
  .works-head{flex-direction:column;gap:6px;margin-bottom:5vw}
  .works-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .work-view{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh}
  .wv-body{grid-template-columns:1fr;max-height:100dvh;overflow:auto}
  .wv-media{padding:16vw 5vw 6vw}
  .wv-image{max-height:52dvh}
  .wv-info{padding:6vw 6vw 8vw;overflow:visible}
}

/* shared by the project pages: neutralise older per-page .work-card styles */
.works .work-card{position:relative;aspect-ratio:auto;background:none;overflow:visible;text-align:left}
.works .work-card span{position:static;left:auto;bottom:auto;padding:0;background:none;font-size:inherit}
.works .work-card .wc-view{position:absolute;left:0;right:0;bottom:0;padding:28px 14px 12px;font-size:10px}
.works .work-card img{filter:none}
.works .work-card:hover img{filter:none}
.works-head{padding-bottom:12px;border-bottom:1px solid var(--line-light);margin-bottom:2.2vw}
.works-count{font-size:10px;letter-spacing:.08em;color:#7a6e63}

/* several photos per work: main photo + thumbnails */
.wv-media{grid-template-rows:minmax(0,1fr) auto;gap:14px}
.wv-image{width:auto;max-width:100%;max-height:70vh}
.wv-thumbs{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;max-width:100%}
.wv-thumbs:empty{display:none}
.wv-thumbs button{width:54px;height:54px;padding:0;border:1px solid transparent;background:#e7e2d9;cursor:pointer;opacity:.6;transition:opacity .2s,border-color .2s}
.wv-thumbs button img{display:block;width:100%;height:100%;object-fit:cover}
.wv-thumbs button:hover,.wv-thumbs button:focus-visible{opacity:1;outline:0}
.wv-thumbs button.is-active{opacity:1;border-color:var(--ink)}
@media(max-width:700px){.wv-image{max-height:48dvh}.wv-thumbs button{width:46px;height:46px}}
.wv-meta:empty{display:none}
/* exhibition detail: long summaries scroll inside the info column; link to the original page */
.event-view .wv-text{white-space:pre-line}
.event-view .wv-image{max-height:74vh}
.wv-link{align-self:flex-start;padding:10px 14px;border:1px solid var(--ink);font-size:10.5px;letter-spacing:.08em;color:var(--ink);text-decoration:none;transition:background .2s,color .2s}
.wv-link:hover,.wv-link:focus-visible{background:var(--ink);color:var(--paper);outline:0}
.wv-link[hidden]{display:none}
/* exhibition detail: fixed height, text pages */
.event-view .wv-body{height:min(760px,88vh)}
.event-view .wv-info{min-height:0;overflow:auto}
.event-view .wv-text{transition:opacity .14s ease;min-height:7.5em}
.event-view .wv-text.is-turning{opacity:0}
.wv-pager{display:flex;align-items:center;gap:10px;font-size:10.5px;letter-spacing:.08em;color:#7a6e63}
.wv-pager[hidden]{display:none}
.wv-pager button{width:30px;height:30px;border-radius:50%;border:1px solid var(--line-light);background:transparent;color:var(--ink);font-size:16px;line-height:1;cursor:pointer;transition:background .2s,color .2s}
.wv-pager button:hover:not(:disabled),.wv-pager button:focus-visible{background:var(--ink);color:var(--paper);outline:0}
.wv-pager button:disabled{opacity:.3;cursor:default}
@media(max-width:700px){.event-view .wv-body{height:auto}.event-view .wv-info{overflow:visible}}
/* info column: items keep their natural height (no overlapping), the column scrolls if needed */
.wv-info>*{flex-shrink:0}
.event-view .wv-title{font-size:clamp(1.5rem,2.3vw,2.5rem)!important;line-height:.98!important;overflow-wrap:anywhere}
.event-view .wv-text{min-height:0}
@media(max-width:700px){.event-view .wv-title{font-size:clamp(1.5rem,7vw,2rem)!important}}
/* text pages + fixed detail height on desktop (all detail views) */
.work-view .wv-text{transition:opacity .14s ease}
.work-view .wv-text.is-turning{opacity:0}
.wv-pager{display:flex;align-items:center;gap:10px;font-size:10.5px;letter-spacing:.08em;color:#7a6e63}
.wv-pager[hidden]{display:none}
.wv-pager button{width:30px;height:30px;border-radius:50%;border:1px solid var(--line-light);background:transparent;color:var(--ink);font-size:16px;line-height:1;cursor:pointer;transition:background .2s,color .2s}
.wv-pager button:hover:not(:disabled),.wv-pager button:focus-visible{background:var(--ink);color:var(--paper);outline:0}
.wv-pager button:disabled{opacity:.3;cursor:default}
@media(min-width:701px){.work-view .wv-body{height:min(760px,88vh)}.work-view .wv-info{min-height:0;overflow:auto}.work-view .wv-media{min-height:0;overflow:hidden}}
/* tighter gap between the intro line and the collection */
.works{padding-top:2.4vw!important}
@media(max-width:700px){.works{padding-top:7vw!important}}

/* 12-01: everything in the detail view fits on one screen; long text turns into pages */
.wv-pager[hidden]{display:flex!important;visibility:hidden}
.work-view .wv-info{overflow:hidden!important;min-height:0}
.work-view .wv-text{flex:1 1 auto;min-height:3.4em!important;overflow:hidden}
@media(min-width:701px){.work-view .wv-body{height:min(760px,88vh)!important}}
@media(max-width:700px){
  .work-view .wv-body{display:grid!important;grid-template-rows:auto minmax(0,1fr);height:100dvh!important;max-height:100dvh;overflow:hidden!important}
  .work-view .wv-media{padding:14vw 5vw 3vw!important}
  .work-view .wv-image{max-height:36dvh!important}
  .work-view .wv-info{display:flex;flex-direction:column;gap:10px;padding:4vw 6vw 5vw!important}
}
/* 12-01: detail titles a little smaller and softer */
.work-view .wv-title{font-size:clamp(1.2rem,1.75vw,1.9rem)!important;color:#6f5a49!important;line-height:1.02!important}
@media(max-width:700px){.work-view .wv-title{font-size:1.3rem!important}}
/* 12-01 b: no project name above the work title in the detail view */
.wv-label:empty{display:none}
/* 12-01 c: long titles wrap onto the next line instead of being cut */
.wv-title{white-space:normal!important;overflow:visible!important;text-overflow:clip!important;overflow-wrap:break-word!important;flex:none!important}
.wc-cap span{white-space:normal;overflow:visible;line-height:1.35}
.wv-title{padding-bottom:.1em!important}
/* 12-02: every card the same shape — photos line up at the top, titles keep to two lines */
.works-grid{align-items:start!important}
.work-card{align-self:start}
.wc-media{aspect-ratio:4/5!important}
.wc-cap{min-height:calc(2.7em + 10px);align-items:flex-start}
.wc-cap span{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;white-space:normal;line-height:1.35}
/* 12-02 d: exhibition view — photo, title, date, link and arrows stay put; only the text scrolls */
.event-view .wv-pager{display:none!important}
.event-view .wv-info{overflow:hidden!important;min-height:0}
.event-view .wv-text{flex:1 1 auto!important;min-height:4em!important;overflow-y:auto!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding-right:8px;scrollbar-width:thin;scrollbar-color:rgba(74,52,38,.35) transparent;
  -webkit-mask:linear-gradient(#000 calc(100% - 22px),transparent);mask:linear-gradient(#000 calc(100% - 22px),transparent);padding-bottom:18px}
.event-view .wv-meta div{padding:7px 0;font-size:11px}
.event-view .wv-link{padding:7px 11px;font-size:9.5px}
.event-view .wv-nav{padding-top:10px}
@media(min-width:701px){.event-view .wv-body{height:min(760px,88vh)!important}.event-view .wv-media{padding:28px!important}.event-view .wv-image{max-height:calc(min(760px,88vh) - 56px)!important}}
@media(max-width:700px){
  .event-view .wv-body{display:grid!important;grid-template-rows:auto minmax(0,1fr);height:100dvh!important;max-height:100dvh;overflow:hidden!important}
  .event-view .wv-media{padding:50px 4vw 6px!important;gap:0}
  .event-view .wv-image{max-height:33dvh!important}
  .event-view .wv-close{top:6px!important;right:6px!important;width:38px!important;height:38px!important;font-size:21px!important}
  .event-view .wv-info{display:flex;flex-direction:column;gap:9px;padding:4vw 6vw 4vw!important}
  .event-view .wv-meta{margin-top:0}
  .event-view .wv-nav{padding-top:6px}
  .event-view .wv-nav button{width:34px;height:34px;font-size:15px}
  .event-view .wv-title{font-size:1.35rem!important}
  .event-view .wv-label{font-size:9.5px}
  .event-view .wv-meta div{padding:5px 0!important;font-size:10.5px!important}
  .event-view .wv-link{padding:6px 10px!important;font-size:9px!important}
}
