/* Portello Social Feeds — inherits the theme's fonts and colors; one accent variable. */
.portello-social {
  --psf-accent: #1f2937;
  --psf-radius: 10px;
  --psf-cols: 4;
  --psf-cols-t: 2;
  --psf-cols-m: 2;
  --psf-gap: 10px;
  margin: 0 auto 1.5em;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 15px;
  line-height: 1.5;
}
.portello-social *,
.portello-social *::before,
.portello-social *::after { box-sizing: border-box; }
.portello-social.psf-instagram { --psf-accent: #d62976; }
.portello-social.psf-facebook { --psf-accent: #1877f2; }
.portello-social.psf-youtube { --psf-accent: #ff0000; }

/* Header */
.psf-header { margin: 0 0 16px; }
.psf-header-link { display: inline-flex; align-items: center; gap: 14px; color: inherit !important; text-decoration: none !important; }
.psf-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; margin: 0 !important; }
.psf-avatar-icon { display: inline-flex; align-items: center; justify-content: center; background: var(--psf-accent); color: #fff; }
.psf-avatar-icon .psf-icon { width: 32px; height: 32px; }
.psf-header-text { display: flex; flex-direction: column; }
.psf-name { font-weight: 700; font-size: 1.15em; line-height: 1.25; }
.psf-sub { opacity: .7; font-size: .9em; }

/* Grid */
.psf-items { display: grid; grid-template-columns: repeat(var(--psf-cols), minmax(0, 1fr)); gap: var(--psf-gap); }
@media (max-width: 1024px) { .psf-items { grid-template-columns: repeat(var(--psf-cols-t), minmax(0, 1fr)); } }
@media (max-width: 640px) { .psf-items { grid-template-columns: repeat(var(--psf-cols-m), minmax(0, 1fr)); } }
.psf-item[hidden] { display: none !important; }
.psf-item { min-width: 0; margin: 0; }

.psf-media { position: relative; display: block; overflow: hidden; border-radius: var(--psf-radius); background: rgba(0, 0, 0, .06); line-height: 0; }
.psf-media img { display: block; width: 100%; height: 100%; object-fit: cover; margin: 0 !important; transition: transform .35s ease; max-width: none; border-radius: 0 !important; }
.psf-media:hover img, .psf-media:focus-visible img { transform: scale(1.04); }
.psf-aspect-square .psf-media { aspect-ratio: 1 / 1; }
.psf-aspect-portrait .psf-media { aspect-ratio: 4 / 5; }
.psf-aspect-video .psf-media { aspect-ratio: 16 / 9; }
.psf-aspect-original .psf-media img { height: auto; }
.psf-media:focus-visible { outline: 3px solid var(--psf-accent); outline-offset: 2px; }

.psf-badge { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .55)); line-height: 0; }
.psf-badge svg { width: 100%; height: 100%; fill: currentColor; }
.psf-youtube .psf-play, .psf-cards .psf-play { top: 50%; left: 50%; right: auto; width: 60px; height: 42px; transform: translate(-50%, -50%); background: rgba(0, 0, 0, .7); border-radius: 12px; padding: 8px 18px; filter: none; transition: background .2s; }
.psf-youtube .psf-media:hover .psf-play { background: #ff0000; }
.psf-hover { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px; background: rgba(0, 0, 0, .45); color: #fff; font-weight: 700; font-size: 15px; line-height: 1; opacity: 0; transition: opacity .2s; }
.psf-sep { display: inline-block; width: 14px; }
.psf-media:hover .psf-hover, .psf-media:focus-visible .psf-hover { opacity: 1; }

.psf-title { font-size: 1em !important; line-height: 1.35 !important; margin: 10px 0 2px !important; font-weight: 600 !important; padding: 0 !important; text-transform: none !important; letter-spacing: 0 !important; }
.psf-title a { color: inherit !important; text-decoration: none !important; }
.psf-title a:hover { text-decoration: underline !important; }
.psf-text { margin: 8px 0 0; font-size: .95em; overflow-wrap: anywhere; }
.psf-meta, .psf-date { font-size: .85em; opacity: .7; margin-top: 4px; }

/* Cards (list layout, Facebook) */
.psf-cards .psf-items { grid-template-columns: repeat(var(--psf-cols), minmax(0, 1fr)); }
.psf-card { background: #fff; color: #1c1e21; border: 1px solid rgba(0, 0, 0, .1); border-radius: var(--psf-radius); padding: 16px; height: 100%; }
.psf-card .psf-media { margin-top: 12px; border-radius: calc(var(--psf-radius) - 4px); }
.psf-cards.psf-aspect-square .psf-media, .psf-cards.psf-aspect-portrait .psf-media { aspect-ratio: auto; }
.psf-cards .psf-media img { height: auto; max-height: 520px; object-fit: contain; background: #f0f2f5; }
.psf-card-head { display: flex; align-items: center; gap: 10px; }
.psf-card-head > span { display: flex; flex-direction: column; line-height: 1.3; }
.psf-mini-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; margin: 0 !important; }
.psf-card-name { font-weight: 700; }
.psf-card .psf-date { margin-top: 0; }
.psf-card .psf-text { margin-top: 12px; }
.psf-card .psf-meta { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(0, 0, 0, .08); }
.psf-card a { color: var(--psf-accent); }

/* Carousel */
.psf-layout-carousel { position: relative; }
.psf-track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - (var(--psf-cols) - 1) * var(--psf-gap)) / var(--psf-cols)); gap: var(--psf-gap); overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; overscroll-behavior-x: contain; }
.psf-track::-webkit-scrollbar { display: none; }
.psf-track > .psf-item { scroll-snap-align: start; }
@media (max-width: 1024px) { .psf-track { grid-auto-columns: calc((100% - (var(--psf-cols-t) - 1) * var(--psf-gap)) / var(--psf-cols-t)); } }
@media (max-width: 640px) { .psf-track { grid-auto-columns: calc((100% - (var(--psf-cols-m) - 1) * var(--psf-gap)) / var(--psf-cols-m)); } }
.psf-nav { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.psf-nav button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); background: #fff; color: #111; font-size: 26px; line-height: 1; cursor: pointer; padding: 0 0 3px; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.psf-nav button:hover { background: var(--psf-accent); color: #fff; border-color: var(--psf-accent); }
.psf-nav button:disabled { opacity: .35; cursor: default; background: #fff; color: #111; border-color: rgba(0, 0, 0, .15); }

/* Buttons */
.psf-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.psf-btn { display: inline-flex !important; align-items: center; gap: 8px; padding: 10px 20px !important; border-radius: 999px !important; border: 2px solid var(--psf-accent) !important; background: var(--psf-accent) !important; color: #fff !important; font: inherit; font-weight: 600 !important; font-size: 15px !important; line-height: 1.2 !important; text-decoration: none !important; cursor: pointer; margin: 0 !important; box-shadow: none !important; text-transform: none !important; letter-spacing: 0 !important; }
.psf-btn:hover { filter: brightness(1.08); }
.psf-btn.psf-more { background: transparent !important; color: var(--psf-accent) !important; }
.psf-btn.psf-more:hover { background: var(--psf-accent) !important; color: #fff !important; }
.psf-btn .psf-icon { width: 18px; height: 18px; fill: currentColor; }
.psf-btn:focus-visible, .psf-nav button:focus-visible { outline: 3px solid var(--psf-accent); outline-offset: 3px; }

.portello-social-admin-note { padding: 10px 14px; background: #fff8e5; border-left: 4px solid #dba617; color: #3c434a; font-size: 14px; }

/* Lightbox */
.psf-lb { position: fixed; inset: 0; z-index: 999999; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .88); padding: 24px; }
.psf-lb[hidden] { display: none; }
.psf-lb-box { display: flex; width: min(1100px, 100%); max-height: calc(100vh - 48px); background: #fff; color: #1c1e21; border-radius: 10px; overflow: hidden; }
.psf-lb-media { flex: 1 1 62%; background: #000; display: flex; align-items: center; justify-content: center; position: relative; min-height: 300px; }
.psf-lb-media img { max-width: 100%; max-height: calc(100vh - 48px); object-fit: contain; display: block; margin: 0 !important; }
.psf-lb-media iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; }
.psf-lb-side { flex: 1 1 38%; padding: 22px; overflow-y: auto; font-size: 15px; line-height: 1.55; }
.psf-lb-side h3 { margin: 0 0 8px !important; font-size: 18px !important; line-height: 1.3 !important; color: inherit !important; }
.psf-lb-side .psf-lb-date { font-size: 13px; opacity: .65; margin-bottom: 12px; }
.psf-lb-side .psf-lb-text { white-space: pre-line; overflow-wrap: anywhere; }
.psf-lb-side a.psf-lb-link { display: inline-block; margin-top: 16px; font-weight: 600; color: #1877f2; }
.psf-lb-close, .psf-lb-prev, .psf-lb-next, .psf-lb-sprev, .psf-lb-snext { position: absolute; border: 0; background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer; line-height: 1; padding: 0; border-radius: 50%; width: 44px; height: 44px; font-size: 28px; }
.psf-lb-close { top: 14px; right: 14px; font-size: 26px; }
.psf-lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.psf-lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.psf-lb-sprev, .psf-lb-snext { width: 34px; height: 34px; font-size: 22px; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, .85); color: #111; }
.psf-lb-sprev { left: 10px; }
.psf-lb-snext { right: 10px; }
.psf-lb-dots { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; font-size: 0; }
.psf-lb-dots span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .5); margin: 0 3px; }
.psf-lb-dots span.on { background: #fff; }
.psf-lb button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
@media (max-width: 800px) {
  .psf-lb { padding: 0; }
  .psf-lb-box { flex-direction: column; max-height: 100vh; height: 100%; border-radius: 0; }
  .psf-lb-media { flex: 0 0 auto; max-height: 60vh; }
  .psf-lb-media img { max-height: 60vh; }
  .psf-lb-prev, .psf-lb-next { top: auto; bottom: 14px; transform: none; }
}
body.psf-lb-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  .psf-media img, .psf-track { transition: none; scroll-behavior: auto; }
}
