.phx-ig { --phx-cols: 3; --phx-cols-t: 3; --phx-cols-m: 2; --phx-ratio: 1 / 1; }
.phx-ig-grid { display: grid; grid-template-columns: repeat(var(--phx-cols), minmax(0, 1fr)); gap: 8px; }
@media (max-width: 1024px) { .phx-ig-grid { grid-template-columns: repeat(var(--phx-cols-t), minmax(0, 1fr)); } }
@media (max-width: 767px) { .phx-ig-grid { grid-template-columns: repeat(var(--phx-cols-m), minmax(0, 1fr)); } }
.phx-ig-item { position: relative; display: block; overflow: hidden; border-radius: 10px; aspect-ratio: var(--phx-ratio); background: #f1ece6; }
.phx-ig-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.phx-ig-item:hover img, .phx-ig-item:focus-visible img { transform: scale(1.04); }
.phx-ig-item:focus-visible { outline: 3px solid #5C3670; outline-offset: 2px; }
.phx-ig-badge { position: absolute; top: 10px; left: 10px; color: #fff; line-height: 0; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); pointer-events: none; }
.phx-ig-badge svg { display: block; width: 20px; height: 20px; }
.phx-ig-cap { position: absolute; inset: auto 0 0 0; padding: 22px 10px 9px; font-size: 13px; line-height: 1.45; color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.72), transparent); opacity: 0; transition: opacity .25s; text-align: right; }
.phx-ig-item:hover .phx-ig-cap, .phx-ig-item:focus-visible .phx-ig-cap { opacity: 1; }
@media (hover: none) { .phx-ig-cap { display: none; } }
.phx-ig-actions { display: flex; gap: 16px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.phx-ig-more { border: 0; border-radius: 999px; padding: 10px 26px; background: #5C3670; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.phx-ig-more[disabled] { opacity: .6; cursor: default; }
.phx-ig-profile { color: #5C3670; font-weight: 700; text-decoration: none; }
.phx-ig-profile:hover { text-decoration: underline; }
.phx-ig-err { color: #8B1A1A; font-size: 13px; width: 100%; text-align: center; }
.phx-ig-empty { padding: 14px; border: 1px dashed #c9b8d6; border-radius: 10px; color: #6B6560; font-size: 14px; }
/* Popup */
html.phx-ig-lock { overflow: hidden; }
.phx-ig-pop { position: fixed; inset: 0; z-index: 99999; background: rgba(20, 12, 26, .82); display: flex; align-items: center; justify-content: center; padding: 24px; }
.phx-ig-pop[hidden] { display: none; }
.phx-ig-pop-card { position: relative; display: flex; background: #fff; border-radius: 14px; overflow: hidden; max-width: 1000px; width: 100%; max-height: calc(100vh - 48px); box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.phx-ig-pop-media { position: relative; flex: 1 1 62%; background: #000; display: flex; align-items: center; justify-content: center; min-height: 320px; }
.phx-ig-pop-el { display: block; max-width: 100%; max-height: calc(100vh - 48px); width: auto; height: auto; object-fit: contain; }
.phx-ig-pop-side { flex: 1 1 38%; display: flex; flex-direction: column; gap: 16px; padding: 48px 22px 22px; min-width: 0; }
.phx-ig-pop-cap { flex: 1 1 auto; overflow: auto; white-space: pre-line; font-size: 15px; line-height: 1.6; color: #2b2330; text-align: right; }
.phx-ig-pop-stats { font-size: 14px; color: #6B6560; text-align: right; }
.phx-ig-pop-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.phx-ig-pop-btns > a { flex: 1 1 140px; }
.phx-ig-pop-reply { text-align: center; border-radius: 999px; padding: 10px 18px; border: 2px solid #5C3670; color: #5C3670 !important; font-weight: 700; text-decoration: none; background: #fff; }
.phx-ig-pop-reply:hover { background: #f7f2fa; }
.phx-ig-pop-ig { align-self: stretch; text-align: center; border-radius: 999px; padding: 11px 20px; background: #5C3670; color: #fff !important; font-weight: 700; text-decoration: none; }
.phx-ig-pop-ig:hover { filter: brightness(1.1); }
.phx-ig-pop-x { position: absolute; top: 8px; left: 10px; z-index: 3; width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); color: #2b2330; font-size: 26px; line-height: 1; cursor: pointer; }
.phx-ig-pop-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,.88); color: #2b2330; font-size: 28px; line-height: 1; cursor: pointer; }
.phx-ig-pop-nav[hidden] { display: none; }
.phx-ig-pop-prev { right: 10px; }
.phx-ig-pop-next { left: 10px; }
.phx-ig-pop-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; gap: 6px; justify-content: center; pointer-events: none; }
.phx-ig-pop-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.5); }
.phx-ig-pop-dots span.on { background: #fff; }
.phx-ig-pop button:focus-visible, .phx-ig-pop a:focus-visible { outline: 3px solid #c9a0e0; outline-offset: 2px; }
@media (max-width: 767px) {
  .phx-ig-pop { padding: 0; }
  .phx-ig-pop-card { flex-direction: column; border-radius: 0; max-height: 100vh; height: 100%; }
  .phx-ig-pop-media { flex: 0 1 auto; max-height: 68vh; }
  .phx-ig-pop-el { max-height: 68vh; }
  .phx-ig-pop-side { padding: 14px 16px 18px; gap: 12px; }
}
