/* Portfolio styles stay scoped; the existing page titles, header and footer are reused. */
.aed-projects { --project-accent:#58705c; --project-soft:#f2f0eb; --project-shadow:0 12px 32px rgba(25,42,48,.055); --project-hover-shadow:0 16px 38px rgba(20,33,42,.12); }
[data-theme="dark"] .aed-projects { --project-accent:#d3a17c; --project-soft:#171d20; --project-shadow:0 12px 32px rgba(0,0,0,.18); --project-hover-shadow:0 16px 38px rgba(0,0,0,.28); }
/* Match the Services surfaces and fading frames without changing the card layout. */
.aed-projects { --project-card-surface:#fff; --project-card-edge-top:#c8c5be; --project-card-edge-mid:#d5d2ca; --project-card-edge-bottom:#e2dfd8; --project-action-line:rgba(88,112,92,.36); --project-label-edge:#bac4b8; --project-label-shadow:rgba(17,32,39,.07); }
[data-theme="dark"] .aed-projects { --project-card-surface:#151c1d; --project-card-edge-top:rgba(211,161,124,.36); --project-card-edge-mid:rgba(211,161,124,.24); --project-card-edge-bottom:rgba(211,161,124,.12); --project-action-line:rgba(211,161,124,.4); --project-label-edge:#51433a; --project-label-shadow:rgba(0,0,0,.16); }
.aed-projects :where(h2,h3,h4,h5,h6) { color:var(--ink); }
/* Extra contrast for small text where the light drafting grid remains visible. */
html:not([data-theme="dark"]) .aed-project-listing :is(.aed-project-intro,.aed-project-showcase-copy) { --muted:#4e5b65; }
.aed-projects .site-shell { padding-bottom:52px; }
/* The outer page already supplies 48px before the footer. Avoid adding it twice. */
.aed-project-listing > .site-shell,
.aed-project-single > .site-shell { padding-bottom:0; }
/* Share the faded drafting grid across the portfolio and individual projects. */
:is(.aed-project-listing,.aed-project-single) > .site-shell { position:relative; isolation:isolate; }
:is(.aed-project-listing,.aed-project-single) > .site-shell::before {
 --project-draft-line:rgba(101,123,105,.045); --project-draft-major:rgba(101,123,105,.07);
 content:""; position:absolute; inset:-12px 0 24px; z-index:-1; pointer-events:none;
 background-image:linear-gradient(var(--project-draft-major) 1px,transparent 1px),linear-gradient(90deg,var(--project-draft-major) 1px,transparent 1px),linear-gradient(var(--project-draft-line) 1px,transparent 1px),linear-gradient(90deg,var(--project-draft-line) 1px,transparent 1px);
 background-size:160px 160px,160px 160px,32px 32px,32px 32px;
 -webkit-mask-image:linear-gradient(transparent,#000 64px,#000 65%,transparent);
 mask-image:linear-gradient(transparent,#000 64px,#000 65%,transparent);
}
[data-theme="dark"] :is(.aed-project-listing,.aed-project-single) > .site-shell::before { --project-draft-line:rgba(180,145,115,.035); --project-draft-major:rgba(180,145,115,.055); }
@media (max-width:1000px), print { :is(.aed-project-listing,.aed-project-single) > .site-shell::before { display:none; } }
/* Keep the listing opening as compact as the Services introduction. */
.aed-project-listing > .site-shell > .aed-page-title:has(+ .aed-project-intro) { margin-bottom:6px; }
.aed-project-listing > .site-shell > .aed-page-title--centred:has(+ .aed-project-intro) .aed-page-title-band { min-height:0; padding-bottom:0; }
.aed-project-intro { position:relative; margin:0 auto 22px; text-align:center; }
.aed-project-intro p { max-width:760px; margin:0 auto; color:var(--muted); font-size:1.06rem; line-height:1.7; text-wrap:pretty; }
/* Decorative drawings occupy only the spare gutters, never the text column. */
.aed-project-intro::before,.aed-project-intro::after { content:""; position:absolute; top:50%; transform:translateY(-50%); width:clamp(0px,calc((100% - 760px) / 2 - 44px),180px); height:66px; background:var(--project-accent); opacity:.38; pointer-events:none; -webkit-mask:var(--project-intro-art) center / contain no-repeat; mask:var(--project-intro-art) center / contain no-repeat; }
.aed-project-intro::before { left:20px; --project-intro-art:url('../images/decor/projects-intro-drafting.svg'); }
.aed-project-intro::after { right:20px; --project-intro-art:url('../images/decor/projects-intro-portfolio.svg'); }
[data-theme="dark"] .aed-project-intro::before,[data-theme="dark"] .aed-project-intro::after { opacity:.3; }
@media (max-width:1200px) { .aed-project-intro::before,.aed-project-intro::after { display:none; } }
.aed-project-catalogue { scroll-margin-top:120px; }
.aed-project-filters ul { display:flex; justify-content:center; flex-wrap:wrap; gap:10px; list-style:none; margin:0; padding:0; }
.aed-project-filters a { display:flex; align-items:center; justify-content:center; gap:9px; min-height:46px; padding:11px 18px; border:1px solid var(--line); border-radius:8px; background:var(--surface); color:var(--ink); text-decoration:none; text-align:center; font-size:.87rem; line-height:1.4; transition:background .2s,border-color .2s,box-shadow .2s; }
.aed-project-filters a > i { flex:0 0 1.1em; width:1.1em; color:var(--project-accent); text-align:center; }
.aed-project-filters a > span { min-width:0; }
.aed-project-filters a[aria-current] { border-color:var(--project-accent); box-shadow:inset 0 -2px var(--project-accent); font-weight:700; }
.aed-project-filters a:hover { background:var(--project-soft); border-color:var(--project-accent); }
.aed-project-filters { margin-bottom:22px; }
.aed-project-grid { --project-columns:2; --project-gutter:28px; display:flex; flex-wrap:wrap; justify-content:center; gap:var(--project-gutter); margin:0; padding:0; list-style:none; }
.aed-project-grid--1 { --project-columns:1; max-width:960px; margin-inline:auto; }
.aed-project-grid--3 { --project-columns:3; }
.aed-project-grid > li { min-width:0; flex:0 1 calc((100% - (var(--project-columns) - 1) * var(--project-gutter)) / var(--project-columns)); }
.aed-project-card { position:relative; isolation:isolate; height:100%; padding:0; border:0; border-radius:16px; background:var(--project-card-surface); box-shadow:var(--project-shadow); overflow:hidden; transition:transform .3s cubic-bezier(.2,.7,.2,1),box-shadow .3s; }
/* Image, labels and body reach the same outer edge beneath this single frame.
   A reserved one-pixel gutter would expose a second edge when the card scales. */
.aed-project-card::after {
 content:""; position:absolute; inset:0; z-index:2; border:1px solid transparent; border-radius:inherit; pointer-events:none;
 background:linear-gradient(165deg,var(--project-card-edge-top),var(--project-card-edge-mid) 48%,var(--project-card-edge-bottom)) border-box;
 -webkit-mask:linear-gradient(#fff 0 0) padding-box,linear-gradient(#fff 0 0); -webkit-mask-composite:xor;
 mask:linear-gradient(#fff 0 0) padding-box,linear-gradient(#fff 0 0); mask-composite:exclude;
 transition:border-color .3s;
}
.aed-project-card-link { display:flex; flex-direction:column; height:100%; text-decoration:none; color:var(--ink); }
.aed-project-card-image { position:relative; isolation:isolate; aspect-ratio:3/2; flex-shrink:0; background:var(--project-card-surface); overflow:hidden; }
.aed-project-card-image img { display:block; width:100%; height:100%; object-fit:cover; transition:transform .3s cubic-bezier(.2,.7,.2,1); }
/* A one-pixel overlap covers fractional raster edges at the image/body join. */
.aed-project-card-copy { position:relative; display:flex; flex-direction:column; flex:1; margin-top:-1px; padding:24px 28px 22px; background:var(--project-card-surface); }
.aed-project-kind { display:flex; align-items:center; gap:9px; color:var(--project-accent); font-size:.77rem; font-weight:700; letter-spacing:.045em; line-height:1.55; margin:0 0 10px; }
.aed-project-kind i { flex:0 0 18px; text-align:center; }
/* An opaque corner tab keeps the type readable over every project photograph.
   It remains text within the card link, with no additional interactive control. */
/* Inset edges scale with the label surface. Padding retains the former border
   space; the outer card ring alone draws the shared left/right perimeter. */
.aed-project-card-type { position:absolute; right:0; bottom:0; z-index:1; box-sizing:border-box; width:max-content; max-width:calc(100% - 20px); gap:7px; margin:0; padding:11px 16px 10px 23px; border:0; border-radius:44px 0 0 0 / 40px 0 0 0; background:var(--project-card-surface); color:#223b47; font-size:.78rem; line-height:1.45; letter-spacing:.015em; box-shadow:inset 1px 1px 0 var(--project-label-edge),-3px -3px 12px var(--project-label-shadow); transition:box-shadow .3s; }
.aed-project-card-type > i { color:var(--project-accent); }
.aed-project-card-type > span { min-width:0; padding-inline-start:7px; border-inline-start:1px solid rgba(88,112,92,.25); overflow-wrap:anywhere; text-wrap:pretty; }
[data-theme="dark"] .aed-project-card-type { color:#f0ece6; }
[data-theme="dark"] .aed-project-card-type > span { border-color:rgba(211,161,124,.28); }
/* A shared overlay row prevents the count and the type tab from colliding when
   labels wrap. Both are information within the card link, not extra controls. */
.aed-project-card-labels { position:absolute; inset:auto 0 0; z-index:1; display:flex; align-items:flex-end; gap:12px; pointer-events:none; }
.aed-project-card-labels > .aed-project-card-type { position:relative; flex:0 1 auto; min-width:0; margin-inline-start:auto; }
.aed-project-gallery-count { position:relative; display:inline-flex; flex:0 0 auto; align-items:center; gap:8px; margin:0; padding:11px 18px 10px 13px; border:0; border-radius:0 20px 0 0; background:var(--project-card-surface); color:#283a40; box-shadow:inset -1px 1px 0 var(--project-label-edge),3px -3px 10px var(--project-label-shadow); font-size:.9375rem; font-weight:600; line-height:1.4; font-variant-numeric:tabular-nums; transition:box-shadow .3s; }
/* An opaque, pre-blended rule stays clear of the image/body overlap. */
.aed-project-gallery-count::after { content:""; position:absolute; inset-inline:0; bottom:2px; height:1px; background:color-mix(in srgb,var(--project-label-edge) 65%,var(--project-card-surface)); pointer-events:none; transition:background-color .3s; }
.aed-project-media-indicator { display:inline-flex; align-items:center; gap:7px; white-space:nowrap; }
.aed-project-media-indicator > i { color:var(--project-accent); font-size:1em; }
.aed-project-media-indicator ~ .aed-project-media-tour { padding-inline-start:9px; border-inline-start:1px solid var(--project-label-edge); }
[data-theme="dark"] .aed-project-gallery-count { color:#f0ece6; }
.aed-project-card h2 { font-family:var(--font-display,Georgia,serif); font-variant-numeric:lining-nums; font-size:clamp(1.4rem,1rem + .7vw,1.65rem); line-height:1.25; font-weight:600; margin:0 0 12px; padding-bottom:12px; border-bottom:1px solid var(--line); text-align:center; overflow-wrap:anywhere; }
.aed-project-single .aed-page-title-band h1 { font-family:var(--font-display,Georgia,serif); font-variant-numeric:lining-nums; }
/* Clamp the visual preview only. Complete text and the full accessible link name
   remain in the HTML and on the project page; no extra link or tab stop is added. */
.aed-project-summary { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:6; overflow:hidden; color:var(--muted); font-size:.94rem; line-height:1.75; margin:0; overflow-wrap:anywhere; }
.aed-project-card-footer { display:flex; flex-direction:column; justify-content:flex-end; margin-top:auto; padding-top:18px; min-width:0; }
.aed-project-card-meta { display:grid; gap:4px; color:var(--muted); font-size:.875rem; line-height:1.6; margin:16px 0 0; }
.aed-project-card-location,.aed-project-card-status { display:flex; align-items:baseline; gap:7px; min-width:0; }
.aed-project-card-meta-value { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; overflow-wrap:anywhere; min-width:0; }
.aed-project-card-meta i { flex:0 0 1em; width:1em; text-align:center; color:var(--project-accent); }
.aed-project-card-action { display:flex; justify-content:space-between; align-items:center; gap:12px; border-top:1px solid var(--line); margin-top:0; padding-top:14px; font-size:.82rem; font-weight:700; transition:color .25s ease,border-color .25s ease; }
.aed-project-card-action i { flex-shrink:0; transform-origin:center; transition:transform .3s cubic-bezier(.2,.7,.2,1); }
/* The action remains part of the single card link, with no extra tab stop. */
.aed-project-card-link:focus-visible .aed-project-card-action { color:var(--project-accent); border-color:var(--project-action-line); }
@media (max-width:1200px) { .aed-project-grid--3 { --project-columns:2; } }
@media print {
 .aed-project-summary,.aed-project-card-meta-value { display:block; -webkit-line-clamp:unset; overflow:visible; }
}
@media (hover:hover) and (pointer:fine) {
 .aed-project-card:hover { --project-label-edge:var(--project-accent); box-shadow:var(--project-hover-shadow); }
 .aed-project-card:hover::after { border-color:var(--project-accent); }
 .aed-project-card:hover .aed-project-card-action { color:var(--project-accent); border-color:var(--project-action-line); }
}
/* Scale in place without moving neighbouring cards. The corner tab stays joined
   to the body and enlarges only with the card, avoiding a separately scaled seam.
   Touch and reduced-motion visitors retain the stationary card and focus ring. */
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
 /* Labels share the card's rendering plane; no separately promoted 3D layer. */
 .aed-project-card:hover { transform:scale(1.025); }
 .aed-project-card:hover .aed-project-card-image img { transform:scale(1.055); }
 .aed-project-card:hover .aed-project-card-action i { transform:translateX(5px) scale(1.1); }
}
@media (prefers-reduced-motion:no-preference) {
 .aed-project-card-link:focus-visible .aed-project-card-action i { transform:translateX(5px) scale(1.1); }
}
.aed-project-pagination { margin:32px 0 0; }
.aed-project-pagination ul { display:flex; justify-content:center; flex-wrap:wrap; gap:8px; list-style:none; padding:0; margin:0; }
.aed-project-pagination a,.aed-project-pagination span.page-numbers { display:flex; align-items:center; justify-content:center; min-width:44px; min-height:44px; padding:8px 12px; border:1px solid var(--line); border-radius:6px; color:var(--ink); text-decoration:none; }
.aed-project-pagination .current { background:var(--project-soft); border-color:var(--project-accent)!important; font-weight:700; }
.aed-project-pagination a:hover { border-color:var(--project-accent); }
.aed-project-text-link { display:inline-flex; align-items:center; gap:12px; color:var(--ink); min-height:44px; text-decoration:underline; text-decoration-color:var(--project-accent); text-underline-offset:5px; font-weight:600; }
.aed-project-cta { margin-top: var(--aed-ui-section-gap); }
@media (min-width:801px) {
 .aed-project-single .aed-project-navigation + .aed-project-cta { margin-top:40px; }
}
.aed-project-cta > div { max-width:660px; }
.aed-project-cta h2 { font-family:var(--font-display,Georgia,serif); font-size:clamp(1.6rem,2.2vw,2rem); margin:0 0 10px; line-height:1.25; }
.aed-project-cta p { color:var(--aed-ui-panel-muted); margin:0; line-height:1.7; }
.aed-project-cta > a { flex-shrink:0; max-width:100%; }
/* Share the Services closing-panel artwork across the listing and project pages. */
.aed-projects .aed-project-cta::before { content:""; position:absolute; inset:0 0 0 46%; z-index:-1; pointer-events:none; background:var(--aed-ui-panel-art); opacity:var(--aed-ui-panel-art-opacity); -webkit-mask:url('../images/decor/services-building-outline.svg') right bottom / cover no-repeat; mask:url('../images/decor/services-building-outline.svg') right bottom / cover no-repeat; }
/* Put the keyboard ring on the card: its rounded image clipping would otherwise
   hide the global link outline outside the inner link. */
.aed-project-card:has(> .aed-project-card-link:focus-visible) { --project-label-edge:var(--project-accent); box-shadow:var(--project-hover-shadow); outline:3px solid var(--aed-focus); outline-offset:3px; }
.aed-project-card:has(> .aed-project-card-link:focus-visible)::after { border-color:var(--project-accent); }
.aed-project-empty { text-align:center; padding:54px 32px; border:1px solid var(--line); border-radius:16px; background:var(--surface); }
.aed-project-catalogue > .aed-project-empty { padding-block:40px; }
.aed-project-empty h2 { margin:18px auto 14px; max-width:700px; font-family:var(--font-display,Georgia,serif); font-size:clamp(1.7rem,3vw,2.4rem); line-height:1.25; }
.aed-project-empty p { color:var(--muted); max-width:660px; margin:0 auto; line-height:1.8; }
.aed-project-empty-icon { color:var(--project-accent); font-size:2rem; }
.aed-project-empty > .aed-project-text-link { margin-top:20px; }
/* Empty and maintenance views sit openly on the page, with one fading top rule. */
.aed-project-empty--showcase { position:relative; border:0; border-radius:0; background:none; box-shadow:none; }
.aed-project-catalogue > .aed-project-empty--showcase { padding:36px clamp(8px,2vw,28px) 0; }
.aed-project-empty--showcase::before { content:""; position:absolute; top:0; inset-inline:0; height:1px; max-width:1080px; margin-inline:auto; background:linear-gradient(90deg,transparent,var(--project-accent) 24%,var(--project-accent) 76%,transparent); opacity:.26; pointer-events:none; }
[data-theme="dark"] .aed-project-empty--showcase::before { opacity:.2; }
.aed-project-showcase-inner { display:grid; grid-template-columns:250px minmax(0,530px); align-items:center; justify-content:center; gap:clamp(32px,4vw,60px); max-width:860px; margin-inline:auto; }
.aed-project-showcase-art { position:relative; isolation:isolate; width:100%; max-width:250px; margin-inline:auto; pointer-events:none; }
.aed-project-showcase-art::before { content:""; position:absolute; inset:-24% -20%; z-index:-1; background:radial-gradient(ellipse,rgba(88,112,92,.12),transparent 68%); }
[data-theme="dark"] .aed-project-showcase-art::before { background:radial-gradient(ellipse,rgba(210,156,111,.1),transparent 68%); }
.aed-project-showcase-art img { display:block; width:100%; height:auto; }
.aed-project-showcase-art .aed-project-showcase-art--dark { display:none; }
[data-theme="dark"] .aed-project-showcase-art .aed-project-showcase-art--light { display:none; }
[data-theme="dark"] .aed-project-showcase-art .aed-project-showcase-art--dark { display:block; }
.aed-project-showcase-copy { min-width:0; }
.aed-project-empty--showcase h2 { margin:0 auto 14px; font-size:clamp(1.65rem,2.2vw,1.95rem); line-height:1.3; text-wrap:balance; }
.aed-project-empty--showcase p { font-size:.96rem; line-height:1.75; text-wrap:pretty; }
.aed-project-showcase-link { margin-top: 22px; }
@media (max-width:800px) {
 .aed-project-catalogue > .aed-project-empty--showcase { padding-top:28px; }
 .aed-project-showcase-inner { grid-template-columns:minmax(0,540px); gap:22px; }
 .aed-project-showcase-art { max-width:190px; }
}
@media (max-width:420px) {
 .aed-project-showcase-art { max-width:165px; }
 .aed-project-showcase-inner { gap:18px; }
}
/* Individual project. */
.aed-project-hero { display:grid; grid-template-columns:minmax(0,.82fr) minmax(0,1.18fr); grid-template-rows:1fr auto auto 1fr var(--project-thumb-track,0px); align-items:start; column-gap:clamp(28px,4vw,64px); margin:12px 0 36px; }
/* Reserve the 64px thumbnail row plus its 26px spacing below the text tracks.
   This centres copy/facts on the large image, even when the copy is taller. */
.aed-project-hero:has(.aed-project-preview-thumbs) { --project-thumb-track:90px; }
.aed-project-hero-copy { grid-column:1; grid-row:2; min-width:0; }
.aed-project-hero > .aed-project-cover { grid-column:2; grid-row:1/-1; align-self:center; }
.aed-project-hero > .aed-project-facts { grid-column:1; grid-row:3; margin-top:24px; }
/* A compact tour joins the left-hand copy and facts without changing the
   image/gallery action or reserving space for missing optional fields. */
.aed-project-hero--compact-tour { grid-template-rows:1fr auto auto auto 1fr var(--project-thumb-track,0px); }
.aed-project-hero > .aed-project-tour-compact { grid-column:1; grid-row:4; margin-top:24px; text-align:center; }
.aed-project-hero-copy .aed-project-kind { font-size:.875rem; margin-bottom:12px; }
.aed-project-lead { color:var(--ink); font-size:clamp(1.08rem,1.6vw,1.25rem); line-height:1.8; margin:0; overflow-wrap:anywhere; }
/* Equal columns fill the available width and keep the same starting positions
   regardless of content. A minimum 24px gutter separates paired fields without
   adding large outer margins or shifting short fields towards the centre. */
.aed-project-facts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); margin:0; gap:20px clamp(24px,3vw,40px); padding:22px 0 0; border-top:1px solid var(--line); }
.aed-project-facts > div { display:grid; grid-template-rows:auto 1fr; gap:5px; min-width:0; }
.aed-project-facts > .aed-project-fact-wide { grid-column:1/-1; }
/* Share label/value tracks within each pair, even when one label wraps.
   Older browsers retain an ordinary two-column definition list. */
@supports (grid-template-rows:subgrid) {
 .aed-project-facts > div { grid-template-rows:subgrid; grid-row:span 2; }
}
.aed-project-facts dt { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:.76rem; line-height:1.6; margin:0; }
.aed-project-facts dt span { min-width:0; overflow-wrap:anywhere; }
.aed-project-facts dt i { flex:0 0 1rem; color:var(--project-accent); font-size:.85rem; text-align:center; }
/* Values follow their labels' text edge and wrap within their own column. */
.aed-project-facts dd { align-self:start; max-width:100%; margin:0; padding-inline-start:calc(1rem + 8px); color:var(--ink); font-size:.94rem; font-weight:600; line-height:1.55; text-align:start; text-wrap:pretty; overflow-wrap:anywhere; }
/* Full-row facts retain the first column's text edge when other facts exist.
   Centre only a sole fact; balance its icon around the label/value centre line. */
.aed-project-facts > div:only-child dt { justify-content:center; text-align:center; }
.aed-project-facts > div:only-child dt::after { content:""; flex:0 0 1rem; }
.aed-project-facts > div:only-child dd { justify-self:center; max-width:min(100%,40ch); padding-inline-start:0; text-align:center; }
.aed-project-fact-area:only-child dd { font-size:1.125rem; font-weight:700; }
.aed-project-cover { margin:0; min-width:0; }
.aed-project-facts a.aed-project-location-link { color:inherit; text-decoration:underline; text-decoration-color:var(--project-accent); text-underline-offset:.2em; transition:color .2s ease,text-decoration-color .2s ease; }
.aed-project-facts a.aed-project-location-link:is(:hover,:focus-visible) { color:var(--project-accent); text-decoration-color:currentColor; }
.aed-project-location-link > i { margin-inline-start:7px; font-size:.72em; color:var(--project-accent); }
.aed-project-cover > div { border-radius:14px; border:1px solid var(--line); overflow:hidden; background:#17262c; aspect-ratio:3/2; box-shadow:var(--project-shadow); }
.aed-project-cover img { display:block; width:100%; height:100%; object-fit:cover; }
/* Each rendered editor-content section owns one top divider, including after
   a virtual tour. No empty content section is rendered. Keep prose readable,
   while allowing author-created layouts to use the wider project canvas.
   Specificity intentionally exceeds the shared inner-page 900px limit. */
.aed-project-single .aed-project-content {
 /* Structured layouts align with the hero; ordinary prose keeps its measure. */
 --content-measure:46rem; --project-content-wide:100%;
 --wp--style--global--content-size:var(--content-measure);
 --wp--style--global--wide-size:var(--project-content-wide);
 width:100%; max-width:none; margin:0 0 40px; padding-top:clamp(24px,3vw,32px);
 border-top:1px solid var(--line); font-size:1.02rem; line-height:1.85; overflow-wrap:anywhere;
}
.aed-project-hero:has(+ .aed-project-content) { margin-bottom:28px; }
.aed-project-single .entry-content.aed-project-content > :where(:not(.alignleft):not(.alignright)) { min-width:0; max-width:min(100%,var(--content-measure)); margin-inline:auto; }
.aed-project-single .entry-content.aed-project-content > :is(.wp-block-columns,.wp-block-media-text,.alignwide) { width:100%; max-width:min(100%,var(--project-content-wide)); margin-inline:auto; }
.aed-project-single .entry-content.aed-project-content > .alignfull { width:100%; max-width:100%; margin-inline:0; }
.aed-project-content > :first-child { margin-top:0; }
.aed-project-content > :last-child { margin-bottom:0; }
.aed-project-content :where(img,video,iframe) { max-width:100%; }
/* Gutenberg owns the selected column proportions and its mobile stacking.
   Nested blocks stay inside their column, including wide/full media. */
.aed-project-content :where(.wp-block-column,.wp-block-media-text__content) { min-width:0; }
.aed-project-content :where(.wp-block-column,.wp-block-media-text__content) > :where(p,h2,h3,h4,h5,h6,ul,ol,dl,figure,.wp-block-buttons) { max-width:100%; margin-inline:0; }
.aed-project-content .wp-block-column > :first-child { margin-top:0; }
.aed-project-content .wp-block-column > :last-child { margin-bottom:0; }
/* Optional external tour: local preview only, no embedded third-party viewer. */
.aed-project-tour { display:grid; grid-template-columns:minmax(0,1fr) minmax(220px,max-content); align-items:center; gap:18px 32px; width:100%; margin:0 0 32px; padding-top:28px; border-top:1px solid var(--line); }
/* Text and action share a row. A third, decorative column is added only when
   there is enough space; narrower tablets keep the two useful columns. */
.aed-project-tour:not(.aed-project-tour--preview) > .aed-project-tour-copy { grid-column:1; }
.aed-project-tour:not(.aed-project-tour--preview) > .aed-project-tour-action { grid-column:2; }
.aed-project-tour--preview { grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr); }
.aed-project-tour-preview { grid-column:1; grid-row:1 / 3; min-width:0; border-radius:10px; overflow:hidden; background:var(--project-soft); aspect-ratio:16/9; }
.aed-project-tour-preview img { display:block; width:100%; height:100%; object-fit:cover; }
.aed-project-tour-preview-link { position:relative; display:block; width:100%; height:100%; border-radius:inherit; }
.aed-project-cover--tour > div { position:relative; transition:border-color .25s,box-shadow .25s; }
.aed-project-cover--tour > div:focus-within { border-color:var(--project-accent); }
.aed-project-cover--tour .aed-project-tour-preview-link { position:absolute; inset:0; }
.aed-project-tour-cue,.aed-project-image-open { position:absolute; right:16px; bottom:16px; display:inline-flex; align-items:center; justify-content:center; min-width:44px; min-height:44px; max-width:calc(100% - 32px); padding:10px 13px; border:1px solid rgba(255,255,255,.55); border-radius:24px; background:rgba(18,36,42,.9); color:#fff; box-shadow:0 3px 12px rgba(0,0,0,.12); font:600 .8rem/1.4 var(--font-sans); pointer-events:none; }
/* Opening-image controls grow to the right from a fixed left edge. The
   separate virtual-tour section retains its bottom-right control. */
.aed-project-image-open,.aed-project-cover--tour .aed-project-tour-cue { left:16px; right:auto; }
.aed-project-tour-cue > span,.aed-project-image-open > span { max-width:0; overflow:hidden; white-space:nowrap; opacity:0; transition:max-width .2s ease,margin .2s ease,opacity .2s ease; }
.aed-project-tour-preview-link:is(:hover,:focus-visible) .aed-project-tour-cue > span,
.aed-project-preview-main:is(:hover,:focus-visible) .aed-project-image-open > span { max-width:18rem; margin-left:9px; opacity:1; }
/* The VR cue expands on pointer hover and keyboard focus. Touch devices keep
   its label visible through the hover:none rule below. */
/* Keep both focus colours inside the cropped image, above its pixels. */
body .aed-projects a.aed-project-tour-preview-link:not(#wpadminbar *):focus-visible { outline-offset:-6px !important; box-shadow:none !important; }
.aed-project-tour-preview-link:focus-visible::after { content:""; position:absolute; inset:0; border:3px solid #fff; border-radius:inherit; pointer-events:none; }
@media (hover:none) { .aed-project-tour-cue > span,.aed-project-image-open > span { max-width:18rem; margin-left:9px; opacity:1; } }
.aed-project-tour-copy { min-width:0; }
.aed-project-tour-copy h2 { display:flex; align-items:center; gap:12px; margin:0 0 12px; font-size:clamp(1.5rem,2.2vw,2rem); line-height:1.2; }
.aed-project-tour-copy h2 > i { flex:0 0 auto; color:var(--project-accent); font-size:.75em; }
.aed-project-tour-copy h2 > span { min-width:0; overflow-wrap:anywhere; }
.aed-project-tour-intro { max-width:58ch; margin:0; color:var(--muted); line-height:1.75; white-space:pre-line; overflow-wrap:anywhere; }
.aed-project-tour--preview .aed-project-tour-copy { grid-column:2; grid-row:1; align-self:end; }
.aed-project-tour--preview .aed-project-tour-action { grid-column:2; grid-row:2; align-self:start; }
/* Keyboard users receive the complete tour context immediately, even if a
   section entrance fade has just started as the browser scrolls to focus. */
.aed-project-tour:focus-within > .aed-motion-managed { opacity:1; translate:none; transition:none; }
.aed-project-tour-action { min-width:0; }
.aed-project-tour-action .aed-project-button { max-width:100%; text-align:center; }
.aed-projects .aed-project-tour-compact .aed-project-button { gap:10px; }
.aed-project-tour-action .aed-project-button > span { min-width:0; overflow-wrap:anywhere; }
.aed-project-tour-action p { max-width:34ch; margin:10px 0 0; color:var(--muted); font-size:.8125rem; line-height:1.6; }
.aed-project-tour-compact p { margin-inline:auto; }
.aed-project-hero:has(+ .aed-project-tour) { margin-bottom:28px; }
/* In the side-by-side photo layout, gently inset the action from the copy. */
@media (min-width:801px) {
 .aed-project-tour--preview .aed-project-tour-action { padding-inline-start:16px; }
}
/* A photo section has room for a smaller motif beside its action on wide
   screens. Keep it in the action grid, below the copy and away from the photo. */
@media (min-width:1100px) {
 /* Equal action and artwork tracks balance the space beside the introduction. */
 .aed-project-tour:not(.aed-project-tour--preview) { grid-template-columns:minmax(0,1.8fr) repeat(2,minmax(0,1fr)); }
 .aed-project-tour:not(.aed-project-tour--preview) > .aed-project-tour-action { text-align:center; }
 .aed-project-tour:not(.aed-project-tour--preview) .aed-project-tour-action p { margin-inline:auto; }
 .aed-project-tour:not(.aed-project-tour--preview)::after { content:""; grid-column:3; grid-row:1; justify-self:center; width:clamp(180px,16vw,230px); max-width:100%; aspect-ratio:16/11; background:url('../images/decor/tour-headset-light.svg') center / contain no-repeat; pointer-events:none; }
 [data-theme="dark"] .aed-project-tour:not(.aed-project-tour--preview)::after { background-image:url('../images/decor/tour-headset-dark.svg'); }
 .aed-project-tour--preview .aed-project-tour-action { display:grid; grid-template-columns:minmax(0,max-content) minmax(0,1fr); gap:10px 20px; align-items:start; }
 .aed-project-tour--preview .aed-project-tour-action > a { grid-column:1; grid-row:1; justify-self:start; }
 /* Let only the button size the first track. The short notice may extend
    below it without shifting the midpoint of the illustration's free space. */
 .aed-project-tour--preview .aed-project-tour-action p { grid-column:1 / -1; grid-row:2; margin:0; }
 .aed-project-tour--preview .aed-project-tour-action::after { content:""; grid-column:2; grid-row:1 / 3; align-self:center; justify-self:center; width:160px; max-width:100%; aspect-ratio:16/11; background:url('../images/decor/tour-headset-light.svg') center / contain no-repeat; pointer-events:none; }
 [data-theme="dark"] .aed-project-tour--preview .aed-project-tour-action::after { background-image:url('../images/decor/tour-headset-dark.svg'); }
}
@media (max-width:800px) {
 .aed-project-tour,.aed-project-tour--preview { grid-template-columns:minmax(0,1fr); gap:20px; text-align:center; }
 .aed-project-tour:not(.aed-project-tour--preview) > .aed-project-tour-action { grid-column:1; }
 .aed-project-tour--preview .aed-project-tour-copy { grid-column:1; grid-row:auto; }
 .aed-project-tour-preview { grid-column:1; grid-row:auto; width:100%; max-width:640px; margin-inline:auto; }
 .aed-project-tour--preview .aed-project-tour-action { grid-column:1; grid-row:auto; }
 .aed-project-tour-copy h2 { justify-content:center; }
 .aed-project-tour-intro,.aed-project-tour-action p { margin-inline:auto; }
}
@media (max-width:420px) {
 .aed-project-tour-action .aed-project-button { width:100%; }
 /* Let the small icon flow with the label, instead of reserving a separate
    column beside every wrapped line. Keep the shared 52px minimum target. */
 .aed-projects .aed-project-tour-compact .aed-project-button { display:block; padding:12px 16px; text-wrap:balance; }
 .aed-project-tour-compact .aed-project-button > i { margin-inline-end:8px; }
}
/* Adjacent projects remain ordinary links, independent of gallery JavaScript. */
.aed-project-navigation { --project-nav-gap:clamp(20px,3vw,42px); --project-nav-hover:rgb(101 123 105 / 12%); position:relative; display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:center; gap:20px var(--project-nav-gap); margin-top:36px; padding-block:24px; border-block:1px solid var(--line); }
[data-theme="dark"] .aed-project-navigation { --project-nav-hover:var(--project-soft); }
/* Short rules occupy the gutters without affecting the link targets.
   Notes occupy missing desktop slots; a sole project needs no side rules. */
.aed-project-navigation:has(.aed-project-adjacent)::before { content:""; position:absolute; grid-column:2 / 3; grid-row:1 / 2; inset-inline:calc(var(--project-nav-gap) / -2); top:50%; height:36px; transform:translateY(-50%); pointer-events:none; }
.aed-project-navigation:has(.aed-project-adjacent--previous,.aed-project-boundary--previous)::before { border-inline-start:1px solid var(--line); }
.aed-project-navigation:has(.aed-project-adjacent--next,.aed-project-boundary--next)::before { border-inline-end:1px solid var(--line); }
.aed-project-boundary { grid-row:1; min-width:0; margin:0; padding:8px 12px; color:var(--muted); font-size:.82rem; line-height:1.6; overflow-wrap:anywhere; }
.aed-project-boundary--previous { grid-column:1; }
.aed-project-boundary--next { grid-column:3; text-align:right; }
.aed-project-adjacent { display:flex; flex-direction:column; align-self:stretch; justify-content:flex-start; gap:9px; min-width:0; min-height:64px; padding:8px 12px; border-radius:8px; color:var(--ink); text-decoration:none; }
.aed-project-adjacent--previous { grid-column:1; grid-row:1; }
.aed-project-adjacent--next { grid-column:3; grid-row:1; text-align:right; }
.aed-project-adjacent-label { display:flex; align-items:center; gap:10px; font-size:.78rem; font-weight:600; color:var(--project-accent); }
.aed-project-adjacent--next .aed-project-adjacent-label { flex-direction:row-reverse; }
.aed-project-adjacent-title { font-family:var(--font-display,Georgia,serif); font-size:clamp(1.05rem,1.4vw,1.22rem); line-height:1.45; overflow-wrap:anywhere; text-wrap:pretty; }
/* Navigation has its own feedback, independent of primary-action lift/shadow. */
.aed-project-navigation-all {
 grid-column:2; grid-row:1; display:inline-flex; align-self:stretch; align-items:center; justify-content:center; gap:16px;
 min-width:0; max-width:100%; min-height:64px; padding:14px 24px; border:1px solid transparent; border-radius:8px;
 color:#17384e; font-family:var(--font-sans); font-size:.9rem; font-weight:650; line-height:1.5; text-align:center; text-decoration:none;
}
.aed-project-navigation-all > i { flex-shrink:0; font-size:.85em; }
[data-theme="dark"] .aed-project-navigation-all { color:var(--aed-ui-copper); }
.aed-project-navigation > a { background:transparent; transition:background-color .2s; }
@media (hover:hover) and (pointer:fine) { .aed-project-navigation > a:hover { background:var(--project-nav-hover); text-decoration:none; } }
.aed-project-navigation > a:active { background:var(--project-nav-hover); }
.aed-project-navigation > a:focus-visible { outline:3px solid var(--aed-focus); outline-offset:3px; }
.aed-project-preview { container:aed-project-preview / inline-size; }
.aed-project-preview [hidden] { display:none!important; }
.aed-project-preview-main { display:block; position:relative; aspect-ratio:3/2; border:1px solid var(--line); border-radius:14px; overflow:hidden; background:var(--project-soft); box-shadow:var(--project-shadow); transition:border-color .25s,box-shadow .25s; }
.aed-project-preview-main > img { object-fit:contain; }
.aed-project-preview-main > img,.aed-project-tour-preview-link > img { transition:transform .45s cubic-bezier(.2,.7,.2,1); }
/* All image links remain in one scrollable row until the modal is ready. */
.aed-project-preview-thumbs { --project-preview-slots:3; display:flex; flex-wrap:nowrap; align-items:flex-start; gap:10px; list-style:none; margin:10px 0 0; padding:6px 5px 10px; overflow-x:auto; scrollbar-width:thin; scrollbar-color:var(--project-accent) transparent; }
.aed-project-preview-thumbs.is-enhanced { overflow:hidden; }
.aed-project-preview-thumbs > li { flex:0 0 min(96px,calc((100% - (var(--project-preview-slots) - 1) * 10px) / var(--project-preview-slots))); min-width:0; }
.aed-project-preview-thumb,.aed-project-preview-more { box-sizing:border-box; position:relative; display:block; width:100%; aspect-ratio:3/2; min-height:44px; padding:3px; border:1px solid var(--line); border-radius:7px; background:var(--surface); overflow:hidden; cursor:pointer; transition:border-color .2s,box-shadow .2s; }
.aed-project-preview-thumbs img { border-radius:3px; object-fit:cover; transition:transform .35s cubic-bezier(.2,.7,.2,1); }
.aed-project-preview-thumb[aria-current] { border-color:var(--project-accent); box-shadow:inset 0 0 0 1px var(--project-accent); }
.aed-project-preview-more > span { position:absolute; inset:3px; display:grid; place-items:center; border-radius:3px; background:rgba(16,30,39,.76); color:#fff; font-family:var(--font-sans); font-size:1.1rem; font-weight:700; }
.aed-project-preview :is(a,button):focus-visible { outline:3px solid var(--aed-focus); outline-offset:2px; }
@media (hover:hover) and (pointer:fine) {
 .aed-project-preview :is(a,button):hover,.aed-project-cover--tour > div:has(> a:hover) { border-color:var(--project-accent); }
}
/* Zoom only the clickable photograph, keeping frames, focus rings and controls
   stationary. The full-size modal image stays still for close inspection. */
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
 .aed-project-preview-main:hover > img,.aed-project-tour-preview-link:hover > img { transform:scale(1.025); }
 .aed-project-preview-thumbs :is(a,button):hover > img,
 .aed-gallery-thumbnails button:hover > img { transform:scale(1.05); }
}
/* Fit one row to the gallery width: allow roughly 84–96px per thumbnail,
   plus 10px gaps and the focus-ring gutter. Never add blank placeholder tiles. */
@container aed-project-preview (min-width:376px) { .aed-project-preview-thumbs { --project-preview-slots:4; } }
@container aed-project-preview (min-width:470px) { .aed-project-preview-thumbs { --project-preview-slots:5; } }
@container aed-project-preview (min-width:564px) { .aed-project-preview-thumbs { --project-preview-slots:6; } }
@container aed-project-preview (min-width:658px) { .aed-project-preview-thumbs { --project-preview-slots:7; } }
@container aed-project-preview (min-width:752px) { .aed-project-preview-thumbs { --project-preview-slots:8; } }
/* Native modal: visible controls, roving thumbnail focus and natural-size images. */
html.aed-project-gallery-open { overflow:hidden; scrollbar-gutter:stable; }
.aed-project-dialog:not([open]) { display:none; }
.aed-project-dialog [hidden] { display:none!important; }
.aed-project-dialog { padding:0; width:min(1200px,calc(100% - 24px)); height:min(880px,calc(100dvh - 24px)); max-width:none; max-height:calc(100dvh - 24px); margin:auto; background:#f4f3ef; color:var(--ink); border:1px solid var(--line); border-radius:16px; box-shadow:0 18px 56px rgba(14,26,32,.22); overflow:auto; overscroll-behavior:contain; }
.aed-project-dialog::backdrop { background:rgba(20,31,36,.5); backdrop-filter:blur(6px); }
[data-theme="dark"] .aed-project-dialog { background:#181e21; box-shadow:0 18px 56px rgba(0,0,0,.32); }
[data-theme="dark"] .aed-project-dialog::backdrop { background:rgba(2,6,8,.66); }
.aed-project-dialog[open] { animation:aed-project-dialog-in .23s ease-out both; }
.aed-project-dialog[open]::backdrop { animation:aed-project-backdrop-in .23s ease-out both; }
.aed-project-dialog.is-closing { animation:aed-project-dialog-out .18s ease-in both; }
.aed-project-dialog.is-closing::backdrop { animation:aed-project-backdrop-out .18s ease-in both; }
.aed-gallery-shell { box-sizing:border-box; height:100%; min-height:0; padding:12px 16px; display:grid; grid-template-rows:auto minmax(0,1fr) auto; gap:7px; }
.aed-gallery-toolbar { position:sticky; top:0; z-index:2; display:grid; grid-template-columns:140px minmax(0,1fr) 140px; align-items:center; gap:12px; background:#f4f3ef; }
[data-theme="dark"] .aed-gallery-toolbar { background:#181e21; }
.aed-gallery-label { align-self:start; margin:0; padding-top:2px; font-size:.7rem; letter-spacing:.025em; color:var(--muted); line-height:1.4; }
.aed-gallery-tools { grid-column:3; grid-row:1; display:flex; align-items:center; gap:6px; justify-self:end; }
.aed-gallery-tools > a { width:44px; height:44px; display:grid; place-items:center; border:1px solid var(--line); border-radius:7px; background:var(--surface-soft); color:var(--ink); text-decoration:none; }
.aed-gallery-tools > a:hover { border-color:var(--project-accent); }
.aed-gallery-toolbar h2 { grid-column:2; grid-row:1; font-family:var(--font-sans,Inter,sans-serif); font-size:1rem; line-height:1.4; margin:0; text-align:center; overflow-wrap:anywhere; }
.aed-project-dialog button { min-width:44px; min-height:44px; display:grid; place-items:center; background:var(--surface-soft); color:var(--ink); border:1px solid var(--line); border-radius:7px; cursor:pointer; padding:8px; }
.aed-project-dialog button:hover { border-color:var(--project-accent); }
.aed-project-dialog button:disabled { opacity:.35; cursor:default; }
.aed-gallery-stage { display:grid; grid-template-columns:44px minmax(0,1fr) 44px; grid-template-rows:minmax(0,1fr) auto; align-items:center; gap:6px 8px; min-height:0; }
.aed-gallery-stage figure { grid-column:2; grid-row:1; margin:0; min-width:0; min-height:0; height:100%; display:grid; grid-template-rows:minmax(100px,1fr) auto; }
.aed-gallery-stage > [data-gallery-prev] { grid-column:1; grid-row:1; }
.aed-gallery-stage > [data-gallery-next] { grid-column:3; grid-row:1; }
.aed-gallery-image-frame { display:flex; align-items:center; justify-content:center; min-height:0; min-width:0; height:100%; overflow:hidden; touch-action:pan-y pinch-zoom; }
.aed-gallery-stage img { display:block; width:auto; height:auto; max-width:100%; max-height:100%; min-height:0; border:1px solid var(--line); border-radius:7px; object-fit:contain; transition:opacity .18s,transform .22s cubic-bezier(.2,.7,.2,1); }
.aed-gallery-stage img.is-dragging { transform:translateX(var(--gallery-drag-x,0px)); transition:none; }
.aed-gallery-stage img.is-loading { opacity:.5; }
.aed-gallery-stage figcaption { display:grid; grid-template-columns:44px minmax(0,1fr) 44px; align-items:center; color:var(--muted); font-size:.82rem; line-height:1.45; margin:6px 0 0; text-align:center; overflow-wrap:anywhere; }
.aed-gallery-stage [data-gallery-caption] { grid-column:2; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
/* Match the FAQ disclosure symbol, inside a 44px target at the caption's start. */
.aed-project-dialog [data-gallery-caption-toggle] { --caption-accent:#526b7c; --caption-surface:#f7f9fa; --caption-line:#bac7cf; --caption-open-ink:#fffefc; grid-column:3; align-self:start; justify-self:center; width:44px; height:44px; padding:5px; background:transparent; border-color:transparent; border-radius:50%; }
[data-theme="dark"] .aed-project-dialog [data-gallery-caption-toggle] { --caption-accent:#d3a17c; --caption-surface:#202927; --caption-line:#615346; --caption-open-ink:#151c1d; }
.aed-project-dialog [data-gallery-caption-toggle]:hover { border-color:transparent; }
.aed-project-dialog [data-gallery-caption-toggle]:focus-visible { outline:2px solid var(--caption-accent); outline-offset:2px; }
.aed-gallery-caption-symbol { box-sizing:border-box; position:relative; width:32px; height:32px; border:1px solid var(--caption-line); border-radius:50%; background:var(--caption-surface); color:var(--caption-accent); pointer-events:none; transition:background-color .2s,border-color .2s,color .2s; }
.aed-gallery-caption-symbol::before,.aed-gallery-caption-symbol::after { content:''; position:absolute; width:12px; height:2px; top:50%; left:50%; margin:-1px 0 0 -6px; border-radius:1px; background:currentColor; }
.aed-gallery-caption-symbol::after { transform:rotate(90deg); transition:transform .2s; }
[data-gallery-caption-toggle]:is(:hover,:focus-visible) .aed-gallery-caption-symbol { border-color:var(--caption-accent); }
[data-gallery-caption-toggle][aria-expanded="true"] .aed-gallery-caption-symbol { background:var(--caption-accent); border-color:var(--caption-accent); color:var(--caption-open-ink); }
[data-gallery-caption-toggle][aria-expanded="true"] .aed-gallery-caption-symbol::after { transform:rotate(0); }
.aed-gallery-stage [data-gallery-position] { grid-column:2; grid-row:2; justify-self:center; color:var(--muted); font-size:.78rem; line-height:1.5; font-variant-numeric:tabular-nums; white-space:nowrap; }
/* Expanded descriptions use the dialog's normal scroll, never a tiny text scroller. */
.aed-project-dialog.has-expanded-caption { height:fit-content; }
.has-expanded-caption .aed-gallery-shell { height:auto; grid-template-rows:auto auto auto; }
.has-expanded-caption .aed-gallery-stage { grid-template-rows:auto auto; }
.has-expanded-caption .aed-gallery-stage figure { height:auto; grid-template-rows:auto auto; }
.has-expanded-caption .aed-gallery-image-frame { height:min(48dvh,600px); }
.has-expanded-caption [data-gallery-caption] { display:block; overflow:visible; }
.aed-project-dialog.is-single-image .aed-gallery-stage { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr); }
.aed-project-dialog.is-single-image .aed-gallery-stage figure { grid-column:1; }
.aed-project-dialog.is-single-image .aed-gallery-image-frame { touch-action:auto; }
.aed-project-dialog [data-gallery-thumbs-toggle] { grid-column:1; grid-row:1; justify-self:start; display:flex; align-items:center; justify-content:center; gap:6px; font:inherit; font-size:.72rem; padding:6px; }
.aed-gallery-strip { display:grid; grid-template-columns:minmax(0,1fr); align-items:center; gap:6px; min-width:0; border-top:1px solid var(--line); padding-top:6px; }
.aed-gallery-strip.has-overflow { grid-template-columns:44px minmax(0,1fr) 44px; }
.aed-gallery-strip [data-thumbs-previous] { grid-column:1; grid-row:1; }
.aed-gallery-strip [data-thumbs-next] { grid-column:3; grid-row:1; }
.aed-gallery-thumbnails { display:flex; align-items:center; gap:8px; overflow-x:auto; overflow-y:hidden; min-width:0; padding:4px; scrollbar-width:none; }
.aed-gallery-thumbnails::-webkit-scrollbar { display:none; }
.aed-gallery-thumbnails button { box-sizing:border-box; flex:0 0 72px; width:72px; min-width:72px; height:52px; min-height:52px; padding:3px; border:2px solid var(--line); border-radius:6px; background:var(--surface-soft); overflow:hidden; }
.aed-gallery-thumbnails button:first-child { margin-inline-start:auto; }
.aed-gallery-thumbnails button:last-child { margin-inline-end:auto; }
.aed-gallery-thumbnails button[aria-current="true"] { border-color:var(--project-accent); }
.aed-gallery-thumbnails img { display:block; width:100%; height:100%; min-height:0; min-width:0; max-height:42px; object-fit:cover; border-radius:3px; transition:transform .35s cubic-bezier(.2,.7,.2,1); }
.aed-project-dialog [data-gallery-error] { position:absolute; top:50%; left:15%; right:15%; color:var(--ink); background:var(--surface); text-align:center; padding:12px; margin:0; }
@media (max-width:900px) {
 .aed-gallery-toolbar { grid-template-columns:94px minmax(0,1fr) 94px; }
 .aed-gallery-label { display:none; }
}
@media (max-width:800px) {
 .aed-project-dialog { width:calc(100% - 16px); height:fit-content; max-height:calc(100dvh - 16px); border-radius:12px; }
 .aed-gallery-shell { height:auto; padding:10px; gap:6px; grid-template-rows:auto auto auto; }
 .aed-gallery-stage { grid-template-columns:minmax(0,1fr) 44px 56px 44px minmax(0,1fr); grid-template-rows:auto 44px; gap:6px 8px; }
 .aed-gallery-stage figure { grid-column:1/-1; grid-row:1; height:auto; grid-template-rows:auto auto; }
 .aed-gallery-stage > [data-gallery-prev] { grid-column:2; grid-row:2; }
 .aed-gallery-stage > [data-gallery-position] { grid-column:3; grid-row:2; }
 .aed-gallery-stage > [data-gallery-next] { grid-column:4; grid-row:2; }
 .aed-gallery-strip > button { background:transparent; border-color:transparent; }
 .aed-gallery-strip > button:hover { border-color:var(--line); }
}
/* With controls below the photograph, fit its natural proportions without empty
   bands. Cap tall images to preserve control space; side-arrow layouts stay fixed. */
@media (max-width:800px) and (min-height:501px) {
 .aed-gallery-image-frame,.has-expanded-caption .aed-gallery-image-frame { height:auto; }
 .aed-gallery-stage img { max-height:clamp(120px,min(72vw,calc(100dvh - 290px)),560px); }
}
@media (max-width:580px) {
 .aed-gallery-toolbar { grid-template-columns:minmax(0,1fr) 94px; gap:6px 12px; }
 .aed-gallery-toolbar h2 { grid-column:1/-1; grid-row:2; font-size:.95rem; }
 .aed-gallery-tools { grid-column:2; grid-row:1; }
}
/* Short windows retain side arrows and can trade the thumbnail strip for image space. */
@media (max-height:500px) {
 .aed-project-dialog { width:calc(100% - 16px); height:calc(100dvh - 16px); max-height:calc(100dvh - 16px); }
 .aed-gallery-shell { height:100%; padding:8px 10px; gap:4px; grid-template-rows:auto minmax(0,1fr) auto; }
 .aed-gallery-label { display:none; }
 .aed-gallery-toolbar { grid-template-columns:110px minmax(0,1fr) 94px; gap:8px; }
 .aed-gallery-toolbar h2 { grid-column:2; grid-row:1; font-size:.84rem; line-height:1.35; }
 .aed-gallery-tools { grid-column:3; grid-row:1; }
 .aed-gallery-stage { grid-template-columns:44px minmax(0,1fr) 44px; grid-template-rows:minmax(0,1fr) auto; gap:3px 6px; }
 .aed-gallery-stage figure { grid-column:2; grid-row:1; height:100%; grid-template-rows:minmax(100px,1fr) auto; }
 .aed-gallery-image-frame { height:100%; }
 .aed-gallery-stage > [data-gallery-prev] { grid-column:1; grid-row:1; }
 .aed-gallery-stage > [data-gallery-next] { grid-column:3; grid-row:1; }
 .aed-gallery-stage > [data-gallery-position] { grid-column:2; grid-row:2; }
 .aed-gallery-stage figcaption { margin-top:3px; font-size:.75rem; }
 .aed-project-dialog.has-expanded-caption { height:fit-content; }
 .has-expanded-caption .aed-gallery-shell { height:auto; grid-template-rows:auto auto auto; }
 .has-expanded-caption .aed-gallery-stage { grid-template-rows:auto auto; }
 .has-expanded-caption .aed-gallery-stage figure { height:auto; grid-template-rows:auto auto; }
 .has-expanded-caption .aed-gallery-image-frame { height:48dvh; }
}
@media (max-height:500px) and (max-width:580px) {
 .aed-gallery-toolbar { grid-template-columns:minmax(0,1fr) 94px; }
 .aed-gallery-toolbar h2 { grid-column:1/-1; grid-row:2; }
 .aed-gallery-tools { grid-column:2; }
}
@keyframes aed-project-dialog-in { from { opacity:0; transform:translateY(12px) scale(.99); } to { opacity:1; transform:none; } }
@keyframes aed-project-dialog-out { to { opacity:0; transform:translateY(8px) scale(.99); } }
@keyframes aed-project-backdrop-in { from { opacity:0; } to { opacity:1; } }
@keyframes aed-project-backdrop-out { to { opacity:0; } }
@media (max-width:1000px) { .aed-project-hero { grid-template-columns:1fr 1.15fr; column-gap:28px; } .aed-project-facts { row-gap:16px; } .aed-project-card-copy { padding:22px; } }
/* Stack before long introductions and optional details become cramped. */
@media (max-width:960px) {
 .aed-project-hero { grid-template-columns:minmax(0,1fr); grid-template-rows:none; gap:22px; }
 .aed-project-hero > :is(.aed-project-hero-copy,.aed-project-cover,.aed-project-facts,.aed-project-tour-compact) { grid-column:1; grid-row:auto; }
 .aed-project-hero-copy { max-width:680px; margin:auto; }
 .aed-project-hero-copy .aed-project-kind { justify-content:center; }
 .aed-project-lead { text-align:center; }
 .aed-project-hero > .aed-project-facts { width:100%; max-width:600px; margin:0 auto; padding-top:16px; }
 .aed-project-hero > .aed-project-tour-compact { width:100%; max-width:600px; margin:0 auto; }
 /* Centre the thumbnail group with the stacked gallery. Overflowing no-JS
    rows safely start at the left, so every image remains reachable. */
 .aed-project-preview-thumbs { justify-content:safe center; }
}
@media (max-width:800px) {
 .aed-project-single .aed-project-cta::before { display:none; }
 .aed-project-cta { gap:20px; }
 .aed-project-navigation { grid-template-columns:minmax(0,1fr); grid-auto-rows:1fr; gap:14px; padding-block:18px; }
 .aed-project-navigation::before { display:none; }
 .aed-project-boundary { display:none; }
 .aed-project-navigation > a { position:relative; grid-column:1; grid-row:auto; }
 .aed-project-navigation > a + a::before { content:""; position:absolute; inset-inline:0; top:-8px; border-top:1px solid var(--line); pointer-events:none; }
 .aed-project-adjacent { padding:10px 8px; }
 .aed-project-navigation-all { justify-self:stretch; width:100%; }
}
@media (max-width:700px) { .aed-project-grid { --project-columns:1; --project-gutter:24px; } .aed-project-filters a { font-size:.81rem; padding:10px 13px; } .aed-project-filters ul { gap:8px; } .aed-project-card-copy { padding:22px 24px; } .aed-project-cta { margin-top:32px; } }
@media (max-width:580px) {
 /* Keep every fact in the same flow, including both area measurements. */
 .aed-project-facts { grid-template-columns:minmax(0,1fr); }
 .aed-project-facts > div { grid-column:1/-1; }
 .aed-project-filters ul { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
 .aed-project-filters a { height:100%; padding:10px; }
 .aed-project-listing .aed-project-cta::before { display:none; }
 .aed-project-catalogue > .aed-project-empty:not(.aed-project-empty--showcase) { padding-block:32px; }
 .aed-project-empty { padding:32px 20px; }
}
@media (max-width:420px) { .aed-project-card-copy { padding:20px; }  .aed-project-cta > a { width:100%; } .aed-project-lead { font-size:1.05rem; } }
@media (prefers-reduced-motion:reduce) { .aed-projects *, .aed-projects *::before,.aed-projects *::after,.aed-project-dialog::backdrop { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }
@media (forced-colors:active) {
 .aed-project-tour:not(.aed-project-tour--preview)::after,.aed-project-tour--preview .aed-project-tour-action::after { visibility:hidden; }
 .aed-project-tour { border-color:CanvasText; }
 .aed-project-tour-cue,.aed-project-image-open { color:LinkText; background:Canvas; border-color:CanvasText; }
 .aed-project-media-indicator ~ .aed-project-media-tour { border-color:CanvasText; }
 .aed-gallery-caption-symbol::before,.aed-gallery-caption-symbol::after { background:CanvasText; forced-color-adjust:none; }
 [data-gallery-caption-toggle][aria-expanded] .aed-gallery-caption-symbol { background:Canvas; border-color:CanvasText; color:CanvasText; }
 .aed-project-button,.aed-project-dialog { border:1px solid CanvasText; }
 .aed-project-card::after { border-color:CanvasText!important; background:none; -webkit-mask:none; mask:none; }
 .aed-project-card-type,.aed-project-gallery-count { box-shadow:none; outline:1px solid CanvasText; outline-offset:-1px; }
 .aed-project-gallery-count::after { background:CanvasText; forced-color-adjust:none; }
 .aed-project-card:has(> .aed-project-card-link:focus-visible) { outline-color:Highlight; }
 .aed-gallery-thumbnails button[aria-current],.aed-project-filters a[aria-current] { outline:2px solid Highlight; }
 .aed-projects .aed-project-navigation { --project-nav-hover:Canvas; }
 html .aed-projects .aed-project-navigation > a { color:LinkText; }
 html .aed-project-navigation-all { border-color:ButtonText; }
 .aed-project-cta::before { display:none; }
}
@media print {
 html .aed-projects .aed-project-navigation-all { color:#111; border-color:#111; }
}
