/* PlusSocial v0.1 — Instagram grid + lightbox */
.ps-root {
  --ps-gap: 8px;
  --ps-cols: 8;
  --ps-radius: 4px;
  --ps-focus: #ff4da6;
  --ps-overlay: rgba(0, 0, 0, 0.92);
  --ps-muted: #888;
  box-sizing: border-box;
  width: 100%;
  font-family: inherit;
  color: inherit;
}
.ps-root *, .ps-root *::before, .ps-root *::after { box-sizing: border-box; }

.ps-status {
  padding: 1rem 1.25rem;
  border: 1px dashed currentColor;
  border-radius: 8px;
  opacity: 0.85;
  font-size: 0.95rem;
  line-height: 1.45;
}
.ps-status--fixture {
  border-color: #e6b800;
  background: rgba(230, 184, 0, 0.12);
  color: inherit;
}
.ps-status--error,
.ps-status--not_connected {
  border-color: currentColor;
}

.ps-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--ps-cols), minmax(0, 1fr));
  gap: var(--ps-gap);
}
.ps-item { margin: 0; padding: 0; min-width: 0; }
.ps-tile {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--ps-radius);
  background: #111;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
}
.ps-tile:focus-visible {
  outline: 3px solid var(--ps-focus);
  outline-offset: 2px;
}
.ps-tile__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.ps-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  pointer-events: none;
}
.ps-badge svg { width: 14px; height: 14px; fill: currentColor; }

/* Responsive columns: 8 desktop / 4 tablet / 2 mobile */
@media (max-width: 1024px) {
  .ps-root { --ps-cols: 4; }
}
@media (max-width: 640px) {
  .ps-root { --ps-cols: 2; --ps-gap: 6px; }
}

/* Lightbox */
.ps-lb[hidden] { display: none !important; }
.ps-lb {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ps-lb__backdrop {
  position: absolute;
  inset: 0;
  background: var(--ps-overlay);
  border: 0;
  padding: 0;
  cursor: pointer;
}
.ps-lb__dialog {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(92vh, 920px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  outline: none;
}
.ps-lb__stage {
  position: relative;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  max-height: 70vh;
  display: grid;
  place-items: center;
}
.ps-lb__media {
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  object-fit: contain;
}
.ps-lb__media--fill {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ps-lb__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  background: rgba(255,255,255,0.14);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.ps-lb__nav:hover { background: rgba(255,255,255,0.28); }
.ps-lb__nav:focus-visible { outline: 3px solid var(--ps-focus); }
.ps-lb__nav--prev { left: 10px; }
.ps-lb__nav--next { right: 10px; }
.ps-lb__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 0;
  background: rgba(0,0,0,0.55);
  color: #fff;
  cursor: pointer;
  z-index: 2;
}
.ps-lb__close:focus-visible { outline: 3px solid var(--ps-focus); }
.ps-lb__meta {
  color: #f2f2f2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
  justify-content: space-between;
  font-size: 0.95rem;
}
.ps-lb__caption {
  margin: 0;
  flex: 1 1 240px;
  white-space: pre-wrap;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}
.ps-lb__link {
  color: #ff9ad0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ps-lb__link:focus-visible { outline: 2px solid var(--ps-focus); outline-offset: 2px; }
.ps-lb__count { opacity: 0.7; white-space: nowrap; }
.ps-lb__child-nav {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.ps-lb__child-nav button {
  min-width: 36px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.25);
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.ps-lb__child-nav button[aria-current="true"] {
  background: rgba(255,255,255,0.2);
}
.ps-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}
