/* Shared, approved Catalog List and contact-sheet layout. */
:root { --study-gutter:clamp(20px,4vw,64px); --catalog-safe-top:env(safe-area-inset-top, 0px); --catalog-nav-offset:calc(var(--site-logo-top) + var(--site-logo-height) * .9 + 12px + var(--catalog-safe-top)); --contact-meta-size:12px; --contact-meta-gap:20px; --contact-close-space:72px; }
/* Keep the sticky categories below the scaled logo, including phone safe areas. */
body > .site-name { top:calc(var(--site-logo-top) + var(--catalog-safe-top)); }
body > #menu-btn { top:calc(34px + var(--catalog-safe-top)); }
.edits-head { max-width:none; padding:125px var(--study-gutter) 48px; }
.head-grid { grid-template-columns:minmax(0,1.2fr) minmax(280px,.8fr); align-items:end; gap:7vw; }
.edits-head h1 { font-size:clamp(62px,8vw,126px); font-weight:500; line-height:1.02; letter-spacing:-.035em; padding-bottom:0; }
.edits-head h1 .title-mask { padding-inline:.04em; margin-inline:-.04em; }
#edits-title { display:flex; gap:.2em; flex-wrap:wrap; }
.head-grid>div:last-child { justify-self:end; max-width:380px; }
.head-note { max-width:380px; font-size:15px; line-height:1.4; }
.head-meta { margin-top:20px; font-size:10px; color:var(--muted); }
.head-overview, .edits-head .kicker { font-size:12px; }
.filter-shell { margin:0 var(--study-gutter); padding:0; display:flex; align-items:center; gap:24px; max-width:none; border-block:1px solid var(--line); z-index:12; }
/* Overdraw the upper edge to cover the border and fractional sticky rounding. */
.filter-shell::before { top:calc(-1 * var(--catalog-nav-offset) - 4px); opacity:0; }
.filter-shell.is-pinned::before { opacity:1; }
/* The outer shell owns the dividers; suppress the old inner bottom border. */
.filter-bar { flex:1; min-width:0; display:flex; justify-content:flex-start; overflow-x:auto; gap:22px; padding:17px 0; border:0; scrollbar-width:none; }
.filter-bar::-webkit-scrollbar { display:none; }
.filter-kicker { display:none; }
.filter-btn { flex-shrink:0; font-size:12px; padding:0; white-space:nowrap; border:0; }
.filter-btn .filter-count { font-size:9px; }
.contact-view-toggle { display:flex; gap:2px; flex-shrink:0; border:1px solid var(--line); border-radius:24px; padding:3px; }
.contact-view-toggle button { display:flex; align-items:center; gap:7px; padding:6px 12px; border:0; border-radius:20px; background:none; color:var(--muted); font:inherit; font-size:11px; cursor:pointer; }
.contact-view-toggle button[aria-pressed="true"] { background:var(--ink); color:#111; }
.contact-view-toggle svg { width:11px; height:11px; fill:currentColor; }
.contact-view-toggle button:focus-visible { outline:1px solid var(--ink); outline-offset:4px; }
.contact-view-note { margin:19px var(--study-gutter) 0; display:flex; justify-content:space-between; gap:20px; font-size:10px; color:var(--muted); }
.edit-index { max-width:none; margin:0; padding:18px var(--study-gutter) 90px; }
.contact-meta,.contact-cover,.contact-close { display:none; }
/* The list keeps the existing floating reveal and menu-like 12px title movement. */
body[data-view="list"] #edit-list .edit-item { border-bottom:1px solid var(--line); }
body[data-view="list"] #edit-list .edit-row { padding:20px 0; clip-path:none; }
body[data-view="list"] #edit-list .edit-title { font-size:clamp(27px,4vw,60px); letter-spacing:-.035em; font-weight:500; }
body[data-view="list"] #edit-list :is(.case-kind,.edit-year) { color:var(--muted); font-size:var(--contact-meta-size); line-height:1.4; font-weight:400; letter-spacing:0; }
body[data-view="list"] #edit-list .edit-line { grid-template-columns:minmax(0,1fr) auto auto; gap:var(--contact-meta-gap); padding-right:var(--contact-close-space); }
body[data-view="list"] #edit-preview { width:clamp(230px,25vw,360px); }
/* The contact sheet adds covers only; every original drawer remains underneath. */
body[data-view="grid"] #edit-list { --contact-columns:5; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); box-shadow:inset 1px 0 var(--line); border-top:1px solid var(--line); }
body[data-view="grid"] #edit-list:has(.edit-item.open) { box-shadow:none; }
body[data-view="grid"] #edit-list :is(.edit-item,.contact-grid-placeholder) { min-width:0; border-right:1px solid var(--line); border-bottom:1px solid var(--line); padding:14px; }
body[data-view="grid"] #edit-list .edit-row { display:block; padding:0; clip-path:none; }
body[data-view="grid"] .contact-meta { display:flex; justify-content:space-between; gap:10px; margin-bottom:12px; color:var(--muted); font-size:10px; font-weight:400; }
body[data-view="grid"] .contact-cover { display:block; position:relative; aspect-ratio:4/5; overflow:hidden; background:#141414; }
.contact-cover img { width:100%; height:100%; object-fit:cover; }
/* Featured projects use wide artwork; all other covers remain portrait. */
body[data-view="grid"] #edit-list > [data-grid-span="2"]:not(.open) { grid-column:span 2; }
body[data-view="grid"] #edit-list > [data-grid-span="2"] .contact-cover { aspect-ratio:16/9; }
/* Balanced rows share the available width without dense visual reordering.
   The controller also places open drawers on their own complete row. */
body[data-view="grid"] #edit-list[data-packed] { grid-template-columns:repeat(60,minmax(0,1fr)); }
body[data-view="grid"] #edit-list[data-packed] > :is(.edit-item,.contact-grid-placeholder) {
  grid-column:span var(--contact-grid-span);
  grid-row:var(--contact-grid-row);
}
body[data-view="grid"] .contact-cover--full-art { display:grid; place-items:center; background:#000; }
body[data-view="grid"] .contact-cover--full-art img {
  height:auto;
  object-fit:contain;
  /* Clip the image's actual edges, not the taller 16:9 letterbox frame.
     The supplied artwork has a fine gray rule on its right and bottom. */
  clip-path:inset(0 1px 1px 0);
}

body[data-view="grid"] #edit-list .edit-line { display:flex; flex-direction:column; align-items:flex-start; gap:6px; min-height:57px; padding-top:12px; }
body[data-view="grid"] #edit-list .edit-title { font-size:12px; font-weight:400; line-height:1.25; letter-spacing:0; color:var(--ink); overflow-wrap:normal; }
/* Outrank the shared list's :has(hover) rule in every grid state. */
body[data-view="grid"] #edit-list .edit-title { transform:none !important; transition:color 100ms; }
body[data-view="grid"] #edit-list .case-kind { display:block; font-size:9px; line-height:1.4; font-weight:400; color:var(--muted); }
body[data-view="grid"] #edit-list .edit-year { display:none; }
body[data-view="grid"] #edit-preview { display:none; }
/* One expanded layout for both browsing modes. Keep the selected grid cover in its row. */
body[data-view] #edit-list .edit-item.open { padding:0; border:0; border-bottom:1px solid var(--line); background:var(--bg); overflow-anchor:none; }
body[data-view="grid"] #edit-list .edit-item.open { grid-column:1/-1; }
body[data-view] #edit-list .edit-item.open .contact-cover,
body[data-view] #edit-list .edit-item.open .contact-meta { display:none; }
/* The heading keeps the list row's size and outer alignment as only the media opens. */
body[data-view] #edit-list .edit-item.open .edit-row { position:relative; display:block; width:100%; max-width:none; margin:0; padding:20px 0; clip-path:none; }
body[data-view] #edit-list .edit-item.open .edit-line { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; padding:0 var(--contact-close-space) 0 0; min-height:0; gap:var(--contact-meta-gap); }
body[data-view="list"] #edit-list .edit-line:not(:has(.edit-year)),
body[data-view] #edit-list .edit-item.open .edit-line:not(:has(.edit-year)) { grid-template-columns:minmax(0,1fr) auto; }
body[data-view] #edit-list .edit-item.open .edit-title { font-size:clamp(27px,4vw,60px); line-height:1.12; font-weight:500; letter-spacing:-.035em; transform:translateX(12px) !important; }
body[data-view] #edit-list .edit-item.open .case-kind,
body[data-view] #edit-list .edit-item.open .edit-year { display:block; color:var(--muted); font-size:var(--contact-meta-size); line-height:1.4; font-weight:400; letter-spacing:0; }
body[data-view] #edit-list .edit-item.open .contact-close { position:absolute; right:0; top:50%; transform:translateY(-50%); display:grid; place-items:center; width:28px; height:36px; color:var(--muted); }
.contact-close svg { display:block; width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.2; transform:translateY(-1px); }
body[data-view] #edit-list .edit-item.open .edit-inner { width:calc(100% - 48px); max-width:1080px; margin:0 auto; padding:24px 0 34px; }
body[data-view] #edit-list .edit-item.open .edit-panel { transition:none; }
#edit-list .contact-grid-placeholder { position:relative; }
#edit-list:has(.edit-item.open) .contact-grid-placeholder { z-index:2; }
body[data-view="grid"] #edit-list .contact-grid-placeholder .edit-title { color:var(--ink); }
body[data-view="grid"] #edit-list .contact-grid-placeholder .contact-cover { outline:1px solid var(--ink); outline-offset:3px; }
#edit-list { overflow-anchor:none; }
/* Keep neighboring work sharp; its text and covers simply recede. */
body[data-view] #edit-list::before { display:none; }
body[data-view] #edit-list:has(.edit-item.open) .edit-item:not(.open),
body[data-view]:has(#edit-list .edit-item.open)>footer { filter:none; }
body[data-view] #edit-list:has(.edit-item.open) .edit-item:not(.open) .edit-title { color:var(--muted); }
body[data-view="grid"] #edit-list .contact-cover { transition:opacity 250ms ease; }
body[data-view="grid"] #edit-list:has(.edit-item.open) .edit-item:not(.open) .contact-cover { opacity:.65; }
@media(min-width:1600px) { body[data-view="grid"] #edit-list { --contact-columns:6; grid-template-columns:repeat(6,minmax(0,1fr)); } }
@media(max-width:1050px) { body[data-view="grid"] #edit-list { --contact-columns:4; grid-template-columns:repeat(4,minmax(0,1fr)); } .head-grid { gap:30px; } }
@media(max-width:720px) {
  :root { --contact-close-space:56px; }
  .contact-study-bar { font-size:9px; gap:10px; } .contact-study-bar>span:nth-child(2) { display:none; }
  .edits-head { padding-top:110px; padding-bottom:35px; } .head-grid { grid-template-columns:1fr; gap:28px; } .head-grid>div:last-child { justify-self:start; }
  .edits-head h1 { font-size:clamp(52px,12vw,82px); } .head-meta { display:none; }
  .filter-shell { flex-wrap:wrap; gap:0; padding:0 0 10px; } .filter-bar { flex-basis:100%; padding-block:13px; gap:20px; }
  .contact-view-toggle { margin-left:auto; } .contact-view-note { margin-top:15px; }
  body[data-view="grid"] #edit-list { --contact-columns:2; grid-template-columns:repeat(2,minmax(0,1fr)); }
  body[data-view="grid"] #edit-list :is(.edit-item,.contact-grid-placeholder) { padding:10px; }
  body[data-view="list"] #edit-list .case-kind { display:none; }
  body[data-view="list"] #edit-list .edit-row { padding:18px 0; }
  body[data-view="list"] #edit-list .edit-title { font-size:clamp(24px,6vw,38px); }
  body[data-view="list"] #edit-list .edit-line { grid-template-columns:minmax(0,1fr) auto; }
  body[data-view] #edit-list .edit-item.open { padding:0; }
  body[data-view] #edit-list .edit-item.open .edit-inner { width:calc(100% - 20px); }
  body[data-view] #edit-list .edit-item.open .edit-row { padding:18px 0; }
  body[data-view] #edit-list .edit-item.open .edit-line { grid-template-columns:minmax(0,1fr) auto; gap:12px; }
  body[data-view] #edit-list .edit-item.open .case-kind { display:none; }
  body[data-view] #edit-list .edit-item.open .edit-title { font-size:clamp(24px,6vw,38px); }
}
@media(prefers-reduced-motion:reduce) { .contact-cover img,body[data-view="grid"] #edit-list .contact-cover { transition:none; } }
@media (pointer:coarse) {
  .filter-bar { padding-block:0; }
  .filter-btn, .contact-view-toggle button { min-height:44px; min-width:44px; }
}

/* Drawers own one full row throughout opening/closing, never a card-sized slot. */
body[data-view] #edit-list .catalog-transitioning { overflow:hidden; transition:none; }
body[data-view] #edit-list .edit-item:not(.open) .contact-close { display:none !important; }
body[data-view] #edit-list .edit-panel { transition:none; }
body[data-view] #edit-list :is(.edit-thumb,.edit-subline,.edit-state) { display:none; }
body[data-view="grid"] #edit-list>.edit-item:not(.open) .edit-line,
body[data-view="grid"] #edit-list>.contact-grid-placeholder .edit-line { transform:none !important; }
body[data-view="grid"] #edit-list>.edit-item:not(.open) { align-self:stretch; }
body[data-view="grid"] #edit-list .contact-cover img { display:block; }
.contact-draft-label { position:absolute; inset:0; display:grid; place-items:center; padding:20px; color:var(--muted); font-size:12px; }
body[data-view] #edit-list .edit-row { cursor:pointer; }
body[data-view="grid"] #edit-list .edit-title { overflow-wrap:anywhere; }

/* Match the home covers: move the whole frame, leaving labels stationary. */
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
  body[data-view="grid"] #edit-list .contact-cover {
    transform:perspective(900px) translate(var(--cover-x,0px),var(--cover-y,0px)) rotateX(var(--cover-rx,0deg)) rotateY(var(--cover-ry,0deg)) scale(var(--cover-scale,1));
    transform-origin:center;
    transition:transform .6s cubic-bezier(.165,.84,.44,1), opacity 250ms ease;
  }
}
