.filter-drawer:not([open])>form{display:grid}
.choice-box{border:1px solid var(--line);border-radius:12px;padding:14px}
.checkbox-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:260px;overflow:auto}
.template-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.legacy-tool summary{cursor:pointer;color:var(--wine)}
@media(max-width:760px){
  .filter-drawer:not([open])>form{display:none}
  .checkbox-grid,.template-links{grid-template-columns:1fr}
}

/* On desktop the price/contact panel shares only the opening row. Every
   following section spans the full container, so no empty sidebar continues
   down the page. */
.profile-layout{align-items:start}
.profile-layout>*{min-width:0}
.profile-main,.profile-aside{min-width:0}
@media(min-width:761px){
  .profile-main{display:contents}
  .profile-main>*{grid-column:1/-1;min-width:0}
  .profile-main>:first-child{grid-column:1;grid-row:1;align-self:stretch}
  .profile-aside{grid-column:2;grid-row:1;align-self:start}
}
.sticky-card{z-index:2;isolation:isolate;background:#fff;overflow-wrap:anywhere}
.gallery{gap:12px}
.gallery>.gallery-photo{display:block;min-width:0;min-height:0;overflow:hidden;border-radius:12px;background:var(--cream)}
.gallery>.gallery-photo img{width:100%;height:100%;object-fit:cover;border-radius:12px}
.gallery>.gallery-photo.photo-0{grid-row:1/3}
.gallery.placeholder-gallery{display:grid;height:520px;max-height:520px}
.gallery.count-1{display:block;height:auto;max-height:none}
.gallery.count-1>.gallery-photo{width:100%;height:auto;max-height:none;overflow:hidden}
.gallery.count-1>.gallery-photo img{width:100%;height:auto;max-height:720px;object-fit:contain}
.gallery.count-2{height:480px;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:1fr}
.gallery.count-2>.gallery-photo.photo-0{grid-row:auto}
.gallery.count-3{height:500px;grid-template-columns:2fr 1fr;grid-template-rows:1fr 1fr}
.gallery.count-4{height:500px;grid-template-columns:2fr 1fr 1fr;grid-template-rows:1fr 1fr}
.gallery.count-4>.photo-3{grid-column:2/4}
.collection-grid>a{display:block;overflow:hidden;border-radius:10px;background:var(--cream)}
.collection-grid>a img{transition:transform .2s ease}
.collection-grid>a:hover img{transform:scale(1.015)}
a[data-lightbox] img{cursor:zoom-in}
.idea-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;columns:auto}
.idea-card{margin-bottom:0;min-width:0}
.idea-card>a:first-child{display:block;background:var(--cream);aspect-ratio:4/5;overflow:hidden}
.idea-card>a:first-child img{width:100%;height:100%;object-fit:cover}
.media-fallback{object-fit:cover!important;object-position:center!important}
.story-manager,.story-list-section{margin-top:24px}
.story-list-section>.card-title{margin:34px 0 16px}
.story-manage-card,.story-admin-card,.story-public-card{min-width:0}
.story-thumb-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin:16px 0}
.story-thumb-grid img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:8px}
.story-thumb-grid small{display:block;margin-top:5px}
.story-thumb-grid .danger-link{font-size:.75rem;margin-top:5px}
.media-rights-consent{align-items:flex-start;padding:14px;border:1px solid rgba(130,27,69,.16);border-radius:14px;background:#fff9fb;line-height:1.5}
.media-rights-consent input{flex:0 0 auto;margin-top:4px}
.mini-upload:has(.media-rights-consent){display:grid;grid-template-columns:1fr}
.category-card{background-image:linear-gradient(0deg,rgba(35,11,20,.9),rgba(35,11,20,.12)),var(--cover),url('../images/category-default.webp')}
.city-card{background-image:linear-gradient(0deg,rgba(38,14,24,.85),rgba(38,14,24,.08)),var(--cover),url('../images/hero-bg.webp')}
.story-admin-card{margin-top:18px;padding-top:18px;border-top:1px solid var(--line)}
.story-public-list{display:grid;gap:22px}
.story-public-card{padding:20px;border:1px solid var(--line);border-radius:14px;background:var(--cream)}
.story-public-card h3{font:28px Georgia;margin:3px 0 6px}
.story-public-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin-top:15px}
.story-public-grid a{display:block;aspect-ratio:1.2;overflow:hidden;border-radius:9px;background:#fff}
.story-public-grid img{width:100%;height:100%;object-fit:cover}

/* Multi-badge system: wrapping is deliberate so two or more tags never
   overlap a title, thumbnail or one another. */
.vendor-badges{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:8px 0 11px;max-width:100%}
.vendor-badge{display:inline-flex;align-items:center;gap:5px;max-width:100%;padding:5px 9px;border:1px solid transparent;border-radius:999px;font-size:10px;font-weight:850;line-height:1.2;letter-spacing:.02em;white-space:normal}
.vendor-badge--verified{color:#075985;background:#e0f2fe;border-color:#7dd3fc}
.vendor-badge--featured{color:#6b3f00;background:#fff2c7;border-color:#e9c15e}
.vendor-badge--premium{color:#5b257a;background:#f5e9ff;border-color:#d8acef}
.vendor-badge--popular{color:#8b2146;background:#fde8ef;border-color:#efb6ca}
.vendor-badge--handpicked{color:#60223d;background:#f3e8ed;border-color:#d8b6c5}
.vendor-badge--top-rated{color:#78450a;background:#fff5dc;border-color:#efca78}
.vendor-badge--budget-friendly{color:#17603f;background:#e7f7ee;border-color:#a9dcc0}
.vendor-badge--elite{color:#f6d594;background:#35231b;border-color:#b98b49}
.vendor-badge--emerging{color:#314b91;background:#ebefff;border-color:#bdc9ef}
.profile-badges{margin:12px 0}
.vendor-card-badges{margin:8px 0}
.admin-list-badges{margin:7px 0 0}
.admin-badge-preview{margin-top:15px}
.badge-admin-fieldset{border:1px solid var(--line);border-radius:14px;padding:18px;margin:0;min-width:0}
.badge-admin-fieldset>legend{padding:0 7px;font-weight:850}
.badge-admin-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}
.badge-admin-option{align-items:flex-start;padding:12px;border:1px solid var(--line);border-radius:10px;background:var(--cream)}
.badge-admin-option span,.badge-admin-option small{display:block}

/* Claim and protected-action dialogs. */
.claim-card{border-color:#dcb8c6;background:linear-gradient(135deg,#fff,#fbf3f6)}
.claim-card h2{margin-top:4px}
.site-dialog{width:min(620px,calc(100% - 28px));max-width:none;max-height:calc(100dvh - 28px);padding:0;border:0;border-radius:20px;background:transparent;color:var(--ink);box-shadow:0 28px 85px rgba(33,13,21,.28)}
.site-dialog::backdrop{background:rgba(25,15,19,.62);backdrop-filter:blur(4px)}
.site-dialog-card{position:relative;max-height:calc(100dvh - 28px);overflow:auto;padding:30px;background:#fff;border:1px solid var(--line);border-radius:20px}
.site-dialog-card h2{font-size:clamp(1.8rem,5vw,2.6rem);padding-right:35px}
.dialog-close{position:absolute;top:12px;right:13px;z-index:2;width:38px;height:38px;display:grid;place-items:center;padding:0;border:1px solid var(--line);border-radius:50%;background:#fff;color:var(--ink);font-size:25px;line-height:1}
.dialog-close:hover{border-color:var(--wine);color:var(--wine)}
.masked-email{padding:13px 15px;border:1px solid #d8c5cd;border-radius:10px;background:var(--cream);font-weight:850;letter-spacing:.035em;overflow-wrap:anywhere}
.dialog-actions{display:flex;flex-wrap:wrap;gap:9px;margin:22px 0 12px}
.dialog-legal{margin:22px 0 0;padding-top:17px;border-top:1px solid var(--line);font-size:12px;color:var(--muted)}
.auth-gate-card{background:radial-gradient(circle at 92% 5%,rgba(213,154,80,.16),transparent 30%),#fff}

/* Reusable, keyboard-accessible image viewer. */
.media-lightbox{width:100vw;max-width:none;height:100dvh;max-height:none;margin:0;padding:0;border:0;background:rgba(20,13,16,.96);color:#fff}
.media-lightbox::backdrop{background:rgba(20,13,16,.96)}
.media-lightbox-shell{position:relative;width:100%;height:100%;display:grid;place-items:center;padding:54px 82px 48px}
.media-lightbox figure{width:100%;height:100%;margin:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px}
.media-lightbox img{display:block;max-width:100%;max-height:calc(100dvh - 125px);width:auto;height:auto;object-fit:contain;border-radius:10px;box-shadow:0 18px 60px rgba(0,0,0,.35)}
.media-lightbox figcaption{max-width:850px;color:#eee;text-align:center;font-size:13px}
.media-lightbox-close,.media-lightbox-nav{position:absolute;z-index:2;display:grid;place-items:center;border:1px solid rgba(255,255,255,.35);background:rgba(255,255,255,.1);color:#fff;border-radius:50%;line-height:1}
.media-lightbox-close{top:16px;right:18px;width:42px;height:42px;font-size:29px}
.media-lightbox-nav{top:50%;width:48px;height:48px;transform:translateY(-50%);font-size:36px}
.media-lightbox-nav.previous{left:18px}
.media-lightbox-nav.next{right:18px}
.media-lightbox-close:hover,.media-lightbox-nav:hover{background:#fff;color:var(--wine)}
.contact-actions button:disabled{cursor:not-allowed;opacity:.52}

@media(max-width:760px){
  .profile-main{display:grid;gap:20px;grid-row:2}
  .profile-main>*{grid-column:auto;grid-row:auto}
  .profile-aside{grid-row:1;grid-column:auto}
  .sticky-card{position:static;top:auto;width:100%}
  .gallery,.gallery.count-1,.gallery.count-2,.gallery.count-3,.gallery.count-4,.gallery.placeholder-gallery{display:grid;height:auto;max-height:none;grid-template-columns:1fr;grid-template-rows:auto;gap:12px}
  .gallery>.gallery-photo,.gallery>.gallery-photo.photo-0,.gallery.count-1>.gallery-photo,.gallery.placeholder-gallery>.gallery-photo,.gallery.count-4>.photo-3{display:block!important;grid-row:auto;grid-column:auto;width:100%;height:auto;max-height:none;overflow:hidden}
  .gallery>.gallery-photo img,.gallery.count-1>.gallery-photo img,.gallery.placeholder-gallery>.gallery-photo img{display:block!important;width:100%;height:auto;max-height:none;object-fit:contain;border-radius:12px}
  .placeholder-notice{grid-column:1;position:static;margin-top:0}
  .collection-grid{gap:12px}
  .idea-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
  .story-thumb-grid,.story-public-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .badge-admin-grid{grid-template-columns:1fr}
  .site-dialog-card{padding:24px 20px}
  .dialog-actions{display:grid;grid-template-columns:1fr}
  .dialog-actions .btn{width:100%}
  .media-lightbox-shell{padding:58px 14px 76px}
  .media-lightbox img{max-height:calc(100dvh - 155px)}
  .media-lightbox-nav{top:auto;bottom:17px;transform:none;width:44px;height:44px}
  .media-lightbox-nav.previous{left:calc(50% - 54px)}
  .media-lightbox-nav.next{right:calc(50% - 54px)}
}

@media(max-width:470px){
  .collection-grid{grid-template-columns:1fr}
  .contact-actions{grid-template-columns:1fr}
  .contact-actions .btn{grid-column:auto!important}
  .vendor-badge{font-size:9px}
  .idea-grid{grid-template-columns:1fr}
  .story-thumb-grid,.story-public-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
