/* One linkable project window above the retained catalogue. */
html{scrollbar-gutter:stable}
html:has(dialog[open]){overflow:hidden}
body.project-overlay-open{overflow:hidden;overscroll-behavior:none}
body.project-overlay-open:not(.project-native)::before{content:"";position:fixed;inset:0;z-index:90;background:#15252866;backdrop-filter:blur(2px)}
.project-dialog{position:fixed;inset:0;z-index:100;box-sizing:border-box;width:min(780px,calc(100vw - 48px));height:fit-content;max-width:none;max-height:calc(100dvh - 64px);margin:auto;padding:0;border:0;border-radius:18px;overflow:hidden;background:#fff;color:#171717;box-shadow:0 22px 80px #162d3024;direction:rtl}
.project-dialog[open]{display:grid;grid-template-rows:auto minmax(0,1fr) auto}
.project-dialog::backdrop{background:#15252866;backdrop-filter:blur(2px)}
.project-modal-header{display:flex;align-items:center;justify-content:space-between;padding:8px 20px;min-height:52px;box-sizing:border-box;background:#fff}
.project-modal-header button{min-height:44px;border:0;outline:none!important;box-shadow:none!important;background:transparent;color:#5e7276;font:400 14px/1.5 Tajawal,Arial,sans-serif;padding:0;cursor:pointer}
.project-modal-back{display:flex;align-items:center;gap:6px}
.project-modal-header .project-modal-close{display:flex;align-items:center;justify-content:center;width:44px;color:#314e50}
.project-modal-header button:focus-visible{color:#178489;background:#f3f6f5;border-radius:8px}
.project-modal-close svg{width:21px;height:21px}
.project-dialog-content{box-sizing:border-box;min-height:0;max-height:calc(100dvh - 220px);padding:8px 28px 28px;overflow-y:auto;overflow-x:hidden;overscroll-behavior:none;scrollbar-gutter:stable;touch-action:pan-y pinch-zoom}
.project-dialog-content:focus,#modalProjectTitle:focus{outline:none}
.project-dialog .project-identity{gap:20px}
.project-dialog .project-title-group{min-width:0}
.project-dialog h1{font-size:23px;line-height:1.65;font-weight:600;margin:0;overflow-wrap:anywhere}
.project-dialog .project-meta{margin:0;max-width:36%;font-size:12px}
.project-dialog .project-information{padding-top:24px;margin-top:24px;border:0;border-top:1px solid #eef0f0;background:transparent;border-radius:0}
.project-dialog .project-information h2{font-size:19px;color:#171717;margin:0 0 12px;line-height:1.7}
.project-dialog .project-narrative{font-size:17px;line-height:1.9;color:#171717;margin:0}
.project-dialog .project-toolbar{box-sizing:border-box;position:static;display:flex!important;direction:rtl;align-items:center;justify-content:flex-start;gap:8px;width:100%;margin:0;padding:14px 24px;border-top:1px solid #e8eded;background:#fff}
.project-dialog .project-toolbar .detail-visit{flex:0 1 180px;min-width:130px;width:180px;height:44px;min-height:44px;padding:10px 14px;gap:7px;font-size:14px;border-radius:10px}
.project-dialog .project-toolbar .toolbar-icon{display:flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;min-width:44px;height:44px;padding:10px;margin:0;border-radius:10px;border:0;background:#f3f5f5;color:#5d6568}
.project-dialog .project-toolbar .whatsapp-share{background:#edf7f1;color:#236c43}
.project-dialog .project-toolbar .project-favorite[aria-pressed=true],.project-dialog .project-toolbar .ai-select[aria-pressed=true]{color:#178489}
.project-dialog .project-toolbar .action-label{display:none}
.project-dialog .toast,.project-dialog .action-added{position:absolute;bottom:84px;max-width:calc(100% - 24px)}
.project-dialog .back-to-top{position:absolute;bottom:88px;right:14px;left:auto;z-index:5}
.project-dialog .project-extra-links:empty{display:none}
@media(max-width:700px){
 html{scrollbar-gutter:auto}
 .project-dialog{width:100vw;max-width:100vw;inset:0 auto 0 0;height:100vh;height:100dvh;max-height:100dvh;margin:0;border-radius:0;box-shadow:none}
 .project-dialog[open]{grid-template-rows:calc(60px + env(safe-area-inset-top,0px)) minmax(0,1fr) auto}
 .project-modal-header{padding:env(safe-area-inset-top,0px) max(14px,env(safe-area-inset-right,0px)) 0 max(14px,env(safe-area-inset-left,0px));min-height:60px}
 .project-dialog-content{max-height:none;padding:24px 20px 28px}
 .project-dialog h1{font-size:20px;line-height:1.7}
 .project-dialog .project-identity{flex-direction:column;align-items:stretch;gap:8px}
 .project-dialog .project-meta{margin-inline-start:44px;max-width:none;justify-content:flex-start;gap:8px 10px;font-size:12px}
 .project-dialog .project-meta bdi{font-size:12px}
 .project-dialog .project-toolbar{display:grid!important;grid-template-columns:minmax(0,1fr) repeat(4,44px);gap:4px;padding:12px max(14px,env(safe-area-inset-right,0px)) calc(12px + env(safe-area-inset-bottom,0px)) max(14px,env(safe-area-inset-left,0px))}
 .project-dialog .project-toolbar .detail-visit{min-width:0;width:auto;padding:10px 4px;font-size:13px;gap:5px}
 .project-dialog .toast,.project-dialog .action-added{bottom:calc(81px + env(safe-area-inset-bottom,0px))}
 .project-dialog .back-to-top{bottom:calc(83px + env(safe-area-inset-bottom,0px))}
}
@media(max-width:360px){.project-dialog-content{padding-inline:14px}.project-dialog .project-toolbar .detail-visit{font-size:12px;gap:4px}.project-dialog .detail-visit svg{width:16px;height:16px}}

.project-dialog .ai-notice{position:absolute;bottom:84px;width:calc(100% - 28px);box-sizing:border-box}

.directory-header{width:min(1120px,calc(100% - 40px));margin:24px auto 0;display:flex;align-items:center;justify-content:space-between}.directory-return{display:inline-flex;align-items:center;gap:6px;min-height:44px;color:#65767c;text-decoration:none;font-size:14px}.project-modal-noscript-back{display:inline-flex;align-items:center;min-height:44px;color:#65767c;text-decoration:none}html:not(.catalog-js) .project-modal-header button{display:none}
