/* EGM Brands prototype v1 — scoped styles. No changes to DaonTheme CSS. */
.egm-brands{--brand-ink:#182941;--brand-muted:#6c7a8a;--brand-line:#e1e7ed;--brand-accent:#0b3a68;--brand-cloud:#f5f8fb;max-width:1200px;margin:0 auto 100px;color:var(--brand-ink);font-family:inherit}
.egm-brands *{box-sizing:border-box}
.egm-brands .egm-brands-intro{max-width:820px;margin:12px auto 42px;text-align:center}
.egm-brands .egm-brands-intro p{font-size:16px;line-height:1.8;color:#516278;margin:0 auto 16px;word-break:keep-all}
.egm-brands .egm-note{display:inline-flex;align-items:center;gap:8px;border:1px solid #dfe6ed;background:#f6f8fb;color:#66778a;padding:9px 14px;border-radius:4px;font-size:12px;line-height:1.5;text-align:left}
.egm-brands .egm-note:before{content:'i';display:inline-flex;justify-content:center;align-items:center;width:17px;height:17px;flex:0 0 17px;border:1px solid #738aa2;border-radius:50%;font-size:10px;font-weight:700}
.egm-brands .egm-toolbar{display:flex;gap:16px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin:0 0 20px;padding:0 0 20px;border-bottom:1px solid var(--brand-line)}
.egm-brands .egm-filters{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.egm-brands .egm-chip{appearance:none;border:1px solid #dce5ee;background:#fff;color:#566779;padding:10px 16px;cursor:pointer;border-radius:3px;font-family:inherit;font-weight:500;font-size:13px;line-height:1.2;transition:background .22s,border-color .22s,color .22s}
.egm-brands .egm-chip:hover,.egm-brands .egm-chip:focus-visible{border-color:#164773;color:#164773}
.egm-brands .egm-chip.is-active{border-color:#0e355e;color:#fff;background:#0e355e}
.egm-brands .egm-search{position:relative;display:flex;align-items:center;min-width:225px}
.egm-brands .egm-search input{font-family:inherit;border:1px solid #dce5ee;background:#fff;color:#1d3145;padding:11px 38px 11px 13px;width:100%;border-radius:3px;font-size:13px;line-height:1.2}
.egm-brands .egm-search input:focus{outline:2px solid #bad3e8;outline-offset:1px}
.egm-brands .egm-search .egm-search-icon{position:absolute;right:14px;width:13px;height:13px;border:2px solid #8a99a8;border-radius:50%;pointer-events:none}
.egm-brands .egm-search .egm-search-icon:after{content:'';position:absolute;right:-6px;bottom:-4px;background:#8a99a8;width:8px;height:2px;transform:rotate(45deg)}
.egm-brands .egm-library-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 18px;font-size:13px;color:#718197}
.egm-brands .egm-library-meta label{display:flex;align-items:center;gap:7px;cursor:pointer}
.egm-brands .egm-library-meta input{accent-color:#0e355e;width:15px;height:15px}
.egm-brands .egm-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;margin-bottom:48px;list-style:none;padding:0}
.egm-brands .egm-card-wrap{min-width:0;margin:0}
.egm-brands .egm-card-wrap[hidden],.egm-brands .egm-detail-pane[hidden],.egm-brands .egm-no-results[hidden]{display:none!important}
.egm-brands .egm-card{width:100%;height:190px;appearance:none;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:16px;border:1px solid #e4e8ed;background:#fff;padding:18px 12px;position:relative;cursor:pointer;transition:transform .25s,border-color .25s,box-shadow .25s;text-align:center;color:#1b3450;font-family:inherit}
.egm-brands .egm-card:hover{transform:translateY(-4px);box-shadow:0 12px 28px rgba(18,46,72,.09);border-color:#b2c4d5}
.egm-brands .egm-card:focus-visible{outline:3px solid #2f80c5;outline-offset:3px}
.egm-brands .egm-card.is-selected{border-color:#173e63;box-shadow:inset 0 -3px #173e63,0 9px 26px rgba(9,37,65,.07)}
.egm-brands .egm-card img{max-width:100%;height:78px;max-height:78px;object-fit:contain;display:block}
.egm-brands .egm-brand-word{font-family:Arial,'Noto Sans',sans-serif;display:flex;align-items:center;justify-content:center;min-height:78px;font-size:clamp(14px,1.35vw,21px);font-weight:800;letter-spacing:-.02em;overflow-wrap:anywhere;line-height:1.25}
.egm-brands .egm-card .egm-name{font-size:12px;line-height:1.5;color:#78899a;max-width:100%;text-wrap:balance}
.egm-brands .egm-card .egm-card-hidden{position:absolute;top:10px;right:10px;color:#8a6b47;background:#fbf2e6;font-size:10px;padding:4px 6px}
.egm-brands .egm-no-results{font-size:14px;padding:24px;text-align:center;color:#738395;background:#f6f8fb}
.egm-brands .egm-detail{background:linear-gradient(128deg,#f5f8fb 0,#fff 40%);border:1px solid #e1e7ed;min-height:360px;scroll-margin-top:80px}
.egm-brands .egm-detail-head{padding:36px 42px 26px;border-bottom:1px solid var(--brand-line);display:flex;justify-content:space-between;align-items:end;gap:20px;flex-wrap:wrap}
.egm-brands .egm-detail-eyebrow{font-family:inherit;letter-spacing:-.02em;font-weight:400;line-height:1.6;color:#666;font-size:13px;margin:0 0 8px}
.egm-brands .egm-detail-head h3{font-family:inherit;font-size:30px;line-height:1.2;font-weight:600;letter-spacing:-.02em;margin:0;color:#333}
.egm-brands .egm-detail-body{padding:35px 42px 40px}
.egm-brands .egm-detail-image{display:flex;align-items:center;justify-content:center;min-height:260px;background:#fff;border:1px solid #e8edf2;overflow:hidden}
.egm-brands .egm-detail-image img{max-width:100%;height:auto;width:auto;display:block;object-fit:contain}
.egm-brands .egm-detail-placeholder{padding:45px 22px;text-align:center;max-width:600px;margin:0 auto}
.egm-brands .egm-detail-placeholder strong{display:block;font-size:22px;color:#294763;line-height:1.5;margin-bottom:14px}
.egm-brands .egm-detail-placeholder p{color:#728399;font-size:13px;line-height:1.8;margin:0 auto 18px}
.egm-brands .egm-detail-placeholder a{font-size:12px;color:#164a7d;text-decoration:underline;text-underline-offset:3px;overflow-wrap:anywhere}
.egm-brands .egm-detail .egm-emptyhint{margin-top:15px;font-size:12px;color:#6c7f90}
.egm-brands .egm-assets-status{display:flex;gap:10px;align-items:center;margin-top:10px;color:#97a3af;font-size:12px}
@media(max-width:1050px){.egm-brands .egm-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.egm-brands .egm-card{height:174px}}
@media(max-width:760px){.egm-brands .egm-toolbar{align-items:stretch;flex-direction:column}.egm-brands .egm-search{width:100%}.egm-brands .egm-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.egm-brands .egm-detail-head,.egm-brands .egm-detail-body{padding:24px}.egm-brands .egm-card{height:150px;padding:10px;gap:6px}.egm-brands .egm-brand-word{font-size:15px;min-height:65px}.egm-brands .egm-card img{height:65px}.egm-brands .egm-library-meta{align-items:start;flex-direction:column}}
@media(max-width:440px){.egm-brands .egm-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.egm-brands .egm-card{height:140px}.egm-brands .egm-brands-intro p{font-size:14px}.egm-brands .egm-filters{gap:6px}.egm-brands .egm-chip{font-size:12px;padding:10px 11px}.egm-brands .egm-detail-head,.egm-brands .egm-detail-body{padding:19px}}
@media(prefers-reduced-motion:reduce){.egm-brands .egm-card,.egm-brands .egm-chip{transition:none}.egm-brands .egm-card:hover{transform:none}}

/* v2: only super administrators can access the independent visibility manager. */
.egm-brands .egm-brand-manage-link{display:inline-flex;color:#0e426f;border:1px solid #c5d8e9;padding:7px 11px;border-radius:3px;text-decoration:none;font-weight:600;font-size:12px}
.egm-brands .egm-brand-manage-link:hover{background:#edf5fb}

/* v4: The category filters are removed; keep brand search aligned right. */
.egm-brands .egm-toolbar .egm-search{margin-left:auto}

/* v5: DaonTheme typography, mobile-adjusted title. */
@media(max-width:760px){.egm-brands .egm-detail-head h3{font-size:26px}}

/* v6: transparent, responsive hotspot over the original image's embedded URL button.
   Original EGM image-map coordinates are x=815..973, y=110..145 (source pixels).
   The SVG viewBox in brands.php uses the real local JPEG dimensions. */
.egm-brands .egm-detail-picture{
  position:relative;
  display:inline-block;
  flex:0 1 auto;
  width:fit-content;
  max-width:100%;
  line-height:0;
}
.egm-brands .egm-detail-picture>img{display:block;width:auto;max-width:100%;height:auto}
.egm-brands .egm-brand-map-overlay{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  display:block;
  pointer-events:none;
}
.egm-brands .egm-brand-map-overlay a,
.egm-brands .egm-brand-map-hit{
  pointer-events:all;
  cursor:pointer;
}
.egm-brands .egm-brand-map-hit{fill:transparent}
.egm-brands .egm-brand-map-overlay a:hover .egm-brand-map-hit,
.egm-brands .egm-brand-map-overlay a:focus-visible .egm-brand-map-hit{
  fill:rgba(9,51,91,.08);
  stroke:rgba(9,51,91,.85);
  stroke-width:2;
}

/* v7: external destination for new content images (no embedded button). */
.egm-brands .egm-brand-external{display:flex;justify-content:center;align-items:center;width:100%;padding:20px 10px 5px}
.egm-brands .egm-brand-external a{display:inline-flex;align-items:center;border:1px solid #234b6e;padding:11px 18px;color:#fff;background:#123b60;text-decoration:none;font-size:13px;font-weight:600;line-height:1.4;font-family:inherit}
.egm-brands .egm-brand-external a:hover{background:#255d88}

/* v8 — legacy logo clarity: retain each JPEG's native pixel size.
 * Previously height:78px (65px mobile) forcibly enlarged tiny legacy logos.
 * There is no CSS-only method to reconstruct missing bitmap detail.
 * For a crisp full-size display, replace the brand logo with a 2x–3x
 * original via the Gnuboard EGM brand manager (transparent PNG preferred).
 */
.egm-brands .egm-card{
  display:grid;
  grid-template-rows:minmax(0,1fr) auto;
  align-items:center;
  justify-items:center;
  gap:8px;
}
.egm-brands .egm-card > img{
  display:block;
  width:auto;
  height:auto;
  max-width:min(100%, 176px);
  max-height:74px;
  min-width:0;
  min-height:0;
  object-fit:contain;
  image-rendering:auto;
  justify-self:center;
  align-self:center;
}
.egm-brands .egm-card > .egm-brand-word{
  justify-self:center;
  align-self:center;
}
.egm-brands .egm-card > .egm-name{
  align-self:center;
  line-height:1.4;
}
@media(max-width:760px){
  .egm-brands .egm-card > img{
    width:auto;
    height:auto;
    max-height:62px;
    max-width:100%;
  }
}
@media(max-width:440px){
  .egm-brands .egm-card > img{max-height:58px}
}
