/* v5 — direct manipulation editor + reusable background library */
.page-backdrop:has(+ .page-foreground){pointer-events:none}
.page-backdrop{overflow:hidden;background:var(--bg-color,transparent)}
.page-backdrop::before{background-position:var(--bg-x,50%) var(--bg-y,50%),center;will-change:transform}
.site-header.chrome-custom{background-color:transparent;color:inherit}
.site-header.chrome-custom .site-nav a,.site-header.chrome-custom .header-mark{color:inherit}
.site-header.chrome-custom a:hover{opacity:.75}
.site-footer.chrome-custom .footer-panel{background:transparent;color:inherit;border:0}
.site-footer.chrome-custom .footer-panel .footer-eyebrow,.site-footer.chrome-custom .footer-panel h2,.site-footer.chrome-custom .footer-panel p,.site-footer.chrome-custom .contact-links{color:inherit}
.site-footer.chrome-custom .footer-bottom{color:inherit}
.site-footer.chrome-custom .contact-entry{color:inherit;border-color:currentColor}
/* Media layout is identical in the real site and its editor iframe. */
.hero-visual[data-hero-media]{position:relative;overflow:hidden}
.hero-visual[data-hero-media]>img,.hero-visual[data-hero-media]>video{position:absolute!important;max-height:none!important;max-width:none!important;object-fit:fill!important;transform:none!important}
.gallery-grid.smart-gallery{grid-template-columns:repeat(12,minmax(0,1fr))!important;grid-auto-flow:row;grid-auto-rows:12px;gap:16px;align-items:stretch}
.gallery-grid.smart-gallery .gallery-card{grid-column:span var(--gallery-span,4)!important;grid-row:span var(--gallery-rows,13)!important;align-self:stretch;height:auto!important;min-height:0!important;aspect-ratio:auto!important;position:relative;border-radius:16px}
.gallery-grid.smart-gallery .gallery-card .gallery-media{position:absolute;inset:0;overflow:hidden}
.gallery-grid.smart-gallery .gallery-card .gallery-media>img,.gallery-grid.smart-gallery .gallery-card .gallery-media>video{position:absolute!important;max-width:none!important;max-height:none!important;object-fit:fill!important}
.gallery-grid.smart-gallery .gallery-card .gallery-info{position:absolute;z-index:2}
@media(max-width:980px){.gallery-grid.smart-gallery .gallery-card{grid-column:span min(12,calc(var(--gallery-span,4)*2))!important}}
@media(max-width:600px){.gallery-grid.smart-gallery .gallery-card{grid-column:span 12!important;grid-row:span max(9,var(--gallery-rows,13))!important}}
/* Draggable handles belong to the image, with a larger hover/focus target. */
.gallery-resize-handle,.gallery-move-handle{position:absolute;z-index:8;pointer-events:auto;touch-action:none;cursor:nwse-resize;color:#24442d;background:rgba(250,255,250,.94);backdrop-filter:blur(9px);box-shadow:0 3px 15px rgba(0,0,0,.16);border:1px solid rgba(35,94,50,.2);display:grid;place-items:center;transition:transform .15s,background .15s,opacity .15s}
.gallery-resize-handle{right:9px;bottom:9px;width:27px;height:27px;border-radius:9px 4px 10px 4px;transform-origin:bottom right}
.gallery-resize-handle .handle-grip{width:10px;height:10px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;border-radius:0 0 2px 0;opacity:.72}
.gallery-resize-handle:hover,.gallery-resize-handle:focus-visible,.gallery-card.editor-gallery-selected .gallery-resize-handle{transform:scale(1.25);background:#fff;outline:0}
.gallery-move-handle{left:9px;top:9px;width:29px;height:29px;border-radius:9px;cursor:grab;font-size:22px;line-height:1;opacity:.86}
.gallery-move-handle:active{cursor:grabbing}
.gallery-card.is-resizing{outline:2px solid #55956b;outline-offset:3px;z-index:3}
.gallery-card.is-dragging{opacity:.55}
/* Editor visual hierarchy */
body.is-admin #admin-root .editor-title h1{font-size:18px;letter-spacing:-.035em}
body.is-admin #admin-root .editor-head{justify-content:space-between}
.history-buttons{margin-left:auto;display:flex;align-items:center;gap:5px;padding:3px;background:#edf2ec;border:1px solid #dce7da;border-radius:12px}
.history-buttons button{width:35px;height:33px;display:grid;place-items:center;border:0;background:#fff;color:#3a5841;border-radius:9px;cursor:pointer;box-shadow:0 1px 5px rgba(22,49,28,.06)}
.history-buttons button:hover:not(:disabled){background:#dff0e1;color:#1d6538}
.history-buttons button:disabled{opacity:.35;cursor:default}
.history-buttons button:focus-visible{outline:2px solid #44835a;outline-offset:2px}
body.is-admin .editor-tabs{align-items:center}
body.is-admin .editor-tab{height:38px;border-radius:10px}
body.is-admin .preview-heading>span{display:none}
.bg-actions{display:flex;gap:7px;flex-wrap:wrap}
.bg-actions button,.editor-gallery-feature .small-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;background:#f2f7f2;border:1px solid #d8e7da;border-radius:10px;padding:9px 11px;font-size:11px;font-weight:650;color:#3c6247;cursor:pointer}
.bg-actions .muted{background:#fafafa;border-color:#e4e8e3;color:#7b807c}
.background-editor{display:flex;flex-direction:column;gap:11px;padding:0 0 10px}
.bg-library-thumb{width:100%;max-height:120px;object-fit:cover;border-radius:10px;border:1px solid #dae6db}
.chrome-panel{border:1px solid #dfe9df;border-radius:12px;background:#f8faf7;overflow:hidden}
.chrome-panel summary{padding:12px 13px;display:flex;align-items:center;justify-content:space-between;font-weight:700;font-size:12px;cursor:pointer;list-style:none}
.chrome-panel summary::-webkit-details-marker{display:none}
.chrome-panel[open] summary{background:#eef7ef}
.chrome-panel[open] summary .ui-icon{transform:rotate(180deg)}
.chrome-panel-content{display:flex;flex-direction:column;gap:12px;padding:13px}
.chrome-panel input[type=color]{width:100%;height:40px;padding:4px;border:1px solid #d8e4da;border-radius:10px;background:white;cursor:pointer}
.editor-gallery-feature{gap:10px}
.editor-gallery-feature .crop-open{width:100%;margin:0}
/* A separate, full-width browser-sized backdrop composer, not a misleading miniature. */
.background-composer{position:fixed;inset:0;z-index:999999;background:rgba(16,28,20,.75);padding:2vh 2vw;display:flex;align-items:stretch;justify-content:center;font-family:system-ui,-apple-system,sans-serif}
.background-composer-window{background:#f7f9f5;width:100%;max-width:1850px;min-height:0;border-radius:18px;overflow:hidden;display:grid;grid-template-rows:auto minmax(0,1fr);box-shadow:0 22px 100px rgba(0,0,0,.36)}
.background-composer-header{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:12px 18px;border-bottom:1px solid #e0e8df;background:#fff}
.background-composer-header>div:first-child{display:flex;flex-direction:column;gap:3px}
.background-composer-header strong{font-size:14px;color:#223628}
.background-composer-header small{font-size:10px;color:#8a968c}
.background-composer-tools{display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.background-composer-tools button{height:34px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 11px;border:1px solid #e0e8dd;background:#f7f9f5;color:#3e5342;border-radius:9px;cursor:pointer;font-size:11px;font-weight:650}
.background-composer-tools button.is-active{border-color:#91bea0;background:#e5f2e8;color:#275c37}
.background-composer-tools button.primary{background:#275d3b;color:white;border-color:#275d3b}
.background-composer-tools output{font-size:12px;min-width:44px;text-align:center;font-variant-numeric:tabular-nums}
.background-composer-content{position:relative;min-height:0;overflow:hidden;background:#f3f5f1}
.background-composer-content iframe{display:block;border:0;width:100%;height:100%;background:white}
.background-drag-layer{position:absolute;inset:0;touch-action:none;cursor:grab;background:transparent}
.background-drag-layer.is-dragging{cursor:grabbing}
.background-drag-layer.is-inactive{pointer-events:none}
@media(max-width:820px){.background-composer{padding:0}.background-composer-window{border-radius:0}.background-composer-header{align-items:flex-start;flex-direction:column;gap:7px;padding:9px 12px}.background-composer-header small{display:none}.background-composer-tools{width:100%;justify-content:space-between;gap:3px}.background-composer-tools button{height:31px;font-size:10px;padding:0 6px}}
/* Keep the editor handles above the title/gradient overlay. */
.gallery-grid.smart-gallery .gallery-card .gallery-media{z-index:3;pointer-events:none}
.gallery-grid.smart-gallery .gallery-card .gallery-info{z-index:4;pointer-events:none}
.gallery-grid.smart-gallery .gallery-card .gallery-resize-handle,.gallery-grid.smart-gallery .gallery-card .gallery-move-handle{pointer-events:auto}

.feature-move-handle{position:absolute;top:9px;left:9px;width:30px;height:30px;z-index:8;display:grid;place-items:center;cursor:grab;color:#284832;background:rgba(252,255,252,.94);border:1px solid rgba(34,91,48,.22);border-radius:9px;box-shadow:0 2px 9px rgba(0,0,0,.18);font-size:22px;pointer-events:auto;touch-action:none}
.feature-move-handle:active{cursor:grabbing}
.featured-tile .card-meta{pointer-events:none}
