/* Yatoon Social Feed - Public Grid Styles */

.yatoon-sf-grid {
    display: grid;
    grid-template-columns: repeat(var(--yatoon-cols, 4), 1fr);
    gap: var(--yatoon-gap, 8px);
    width: 100%;
}

.yatoon-sf-grid--masonry {
    display: block;
    column-count: var(--yatoon-cols, 4);
    column-gap: var(--yatoon-gap, 8px);
}

.yatoon-sf-grid--masonry .yatoon-sf-item {
    display: inline-block;
    width: 100%;
    margin: 0 0 var(--yatoon-gap, 8px);
    break-inside: avoid;
}

.yatoon-sf-item {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
}

.yatoon-sf-item--text,
.yatoon-sf-item--no-image {
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 14px;
}

.yatoon-sf-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.yatoon-sf-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 square */
    overflow: hidden;
    border-radius: 6px;
    background: #f3f4f6;
}

.yatoon-sf-grid--masonry .yatoon-sf-img-wrap {
    padding-top: 0;
}

.yatoon-sf-grid--masonry .yatoon-sf-img {
    position: static;
    height: auto;
    aspect-ratio: auto;
}

.yatoon-sf-img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
    display: block;
}

.yatoon-sf-link:hover .yatoon-sf-img,
.yatoon-sf-item:hover .yatoon-sf-img {
    transform: scale(1.06);
}

/* Hover overlay */
.yatoon-sf-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background .3s;
    border-radius: 6px;
}
.yatoon-sf-link:hover .yatoon-sf-overlay,
.yatoon-sf-item:hover .yatoon-sf-overlay {
    background: rgba(0, 0, 0, .18);
}

.yatoon-sf-view-label {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -42%);
    z-index: 2;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 99px;
    background: rgba(17, 24, 39, .72);
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
}

.yatoon-sf-link:hover .yatoon-sf-view-label,
.yatoon-sf-item:hover .yatoon-sf-view-label {
    opacity: 1;
    transform: translate(-50%, -50%);
}

/* Video items: persistent play-icon overlay (unlike the "View"/"Play"
   label above, this stays visible at all times, not just on hover, so
   it's clear at a glance which grid items are videos). */
.yatoon-sf-play-icon {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(17, 24, 39, .55);
    pointer-events: none;
    transition: background .2s ease, transform .2s ease;
}
.yatoon-sf-play-icon::after {
    content: '';
    position: absolute;
    left: 55%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 8px 0 8px 14px;
    border-color: transparent transparent transparent #fff;
}
.yatoon-sf-link:hover .yatoon-sf-play-icon,
.yatoon-sf-item:hover .yatoon-sf-play-icon {
    background: rgba(17, 24, 39, .75);
    transform: translate(-50%, -50%) scale(1.08);
}
/* Video item with no thumbnail available at all - show a plain dark
   fill instead of a broken/empty box, so the play icon still has
   something visible to sit on top of. */
.yatoon-sf-img--video-noposter {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #1f2937;
}

/* Platform badge */
.yatoon-sf-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    color: #fff;
    letter-spacing: .5px;
    z-index: 2;
    opacity: .85;
}
.yatoon-sf-badge--ig {
    background: linear-gradient(135deg, #f9a8d4, #c084fc);
}
.yatoon-sf-badge--fb {
    background: #1877f2;
}

/* Caption */
.yatoon-sf-caption {
    margin: 6px 0 0;
    font-size: 13px;
    color: #374151;
    line-height: 1.4;
}

.yatoon-sf-item--text .yatoon-sf-caption {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
}

/* Empty state */
.yatoon-sf-empty {
    text-align: center;
    padding: 40px 20px;
    color: #9ca3af;
    font-size: 15px;
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .yatoon-sf-grid {
        grid-template-columns: repeat(
            min(var(--yatoon-cols, 4), 2),
            1fr
        );
    }
    .yatoon-sf-grid--masonry {
        column-count: 2;
    }
}
@media (max-width: 480px) {
    .yatoon-sf-grid {
        grid-template-columns: repeat(
            min(var(--yatoon-cols, 4), 2),
            1fr
        );
        gap: 4px;
    }
    .yatoon-sf-grid--masonry {
        column-count: 2;
    }
}

/* Lightbox */
.yatoon-sf-lightbox-open {
    overflow: hidden;
}

.yatoon-sf-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.yatoon-sf-lightbox.is-open {
    display: flex;
}

.yatoon-sf-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, .82);
}

.yatoon-sf-lightbox-dialog {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    max-height: calc(100vh - 48px);
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,.35);
}

.yatoon-sf-lightbox-img {
    display: block;
    width: 100%;
    max-height: 72vh;
    object-fit: contain;
    background: #111827;
}

.yatoon-sf-lightbox-video {
    display: none;
    width: 100%;
    max-height: 72vh;
    background: #000;
}

.yatoon-sf-lightbox-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(17, 24, 39, .72);
    color: #fff;
    font-size: 24px;
    line-height: 30px;
    cursor: pointer;
    z-index: 2;
}

.yatoon-sf-lightbox-meta {
    padding: 14px 16px 16px;
}

.yatoon-sf-lightbox-meta strong {
    font-size: 13px;
    color: #111827;
}

.yatoon-sf-lightbox-date {
    font-size: 12px;
    color: #6b7280;
}

.yatoon-sf-lightbox-caption {
    margin: 8px 0 10px;
    color: #374151;
    font-size: 14px;
    line-height: 1.55;
}

.yatoon-sf-lightbox-link {
    color: #2563eb;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.yatoon-sf-lightbox-link:hover {
    text-decoration: underline;
}

/* ---------------------------------------------------------------
   Profile Headers
--------------------------------------------------------------- */
.yatoon-sf-headers {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.yatoon-sf-header-card {
    flex: 1;
    min-width: 260px;
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.yatoon-sf-header-fb { background: #fff; border: 1.5px solid #dbeafe; }
.yatoon-sf-header-ig { background: #fff; border: 1.5px solid #f3e8ff; }

.yatoon-sf-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.yatoon-sf-header-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}
.yatoon-sf-header-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.1);
}
.yatoon-sf-header-icon-only {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}
.yatoon-sf-header-fb-icon.yatoon-sf-header-icon-only { background: #1877f2; }
.yatoon-sf-header-ig-icon.yatoon-sf-header-icon-only { background: linear-gradient(135deg,#f9a8d4,#c084fc); }
.yatoon-sf-header-icon-only svg { width: 22px; height: 22px; }

.yatoon-sf-header-platform-icon {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}
.yatoon-sf-header-fb-icon { background: #1877f2; color: #fff; }
.yatoon-sf-header-ig-icon { background: linear-gradient(135deg,#f9a8d4,#c084fc); color: #fff; }
.yatoon-sf-header-platform-icon svg { width: 10px; height: 10px; }

.yatoon-sf-header-info { display: flex; flex-direction: column; gap: 2px; }
.yatoon-sf-header-name { font-size: 16px; font-weight: 700; color: #111827; display: block; }
.yatoon-sf-header-followers { font-size: 12px; color: #6b7280; }
.yatoon-sf-header-bio { font-size: 13px; color: #374151; margin: 4px 0 0; line-height: 1.4; }

.yatoon-sf-follow-btn {
    display: inline-block;
    padding: 9px 18px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity .15s, transform .1s;
    color: #fff !important;
    flex-shrink: 0;
}
.yatoon-sf-follow-btn:hover { opacity: .85; transform: translateY(-1px); }
.yatoon-sf-header-fb-btn { background: #1877f2; }
.yatoon-sf-header-ig-btn { background: linear-gradient(135deg, #f9a8d4, #c084fc); }

@media (max-width: 600px) {
    .yatoon-sf-headers { flex-direction: column; }
    .yatoon-sf-header-card { flex-direction: column; align-items: flex-start; }
}

/* 1.1: container-responsive feeds also work in narrow sidebars and editors. */
.yatoon-sf-feed { container-type:inline-size; container-name:yatoon-feed; width:100%; color:#243047; }
.yatoon-sf-feed * { box-sizing:border-box; }
.yatoon-sf-feed [hidden],.yatoon-sf-lightbox [hidden] { display:none!important; }
.yatoon-sf-feed .yatoon-sf-grid { grid-template-columns:repeat(var(--yatoon-cols,4),minmax(0,1fr)); gap:var(--yatoon-gap,8px); }
.yatoon-sf-feed .yatoon-sf-item,.yatoon-sf-feed .yatoon-sf-img-wrap { border-radius:var(--yatoon-radius,10px); }
.yatoon-sf-item--both { border:1px solid #e4e7ee; background:#fff; }
.yatoon-sf-item--both .yatoon-sf-img-wrap { border-radius:0; }
.yatoon-sf-item--both .yatoon-sf-caption { padding:13px 15px 16px; margin:0; line-height:1.65; }
.yatoon-sf-caption { overflow-wrap:anywhere; }
.yatoon-sf-badge--ig { background:#97436e; }
.yatoon-sf-feed .yatoon-sf-link:focus-visible { outline:3px solid #5b42cc; outline-offset:-3px; }
.yatoon-sf-feed .yatoon-sf-link:focus-visible .yatoon-sf-view-label { opacity:1; }
.yatoon-sf-feed .yatoon-sf-header-card { box-shadow:none; border:1px solid #e3e7ee; background:#fff; min-width:0; }
.yatoon-sf-header-info { min-width:0; }
.yatoon-sf-header-name,.yatoon-sf-header-bio { overflow-wrap:anywhere; }
.yatoon-sf-feed .yatoon-sf-follow-btn { color:#fff; }
.yatoon-sf-feed .yatoon-sf-header-ig-btn { background:#91406a; }
.yatoon-sf-feed .yatoon-sf-header-fb-btn { background:#1563c5; }
.yatoon-sf-load-more-wrap { text-align:center; margin:24px 0 8px; }
.yatoon-sf-load-more,.yatoon-sf-tiktok-load { border:1px solid #d6dce7; border-radius:8px; background:#fff; color:#27344a; padding:11px 22px; font:inherit; font-size:14px; font-weight:600; cursor:pointer; }
.yatoon-sf-load-status { display:block; font-size:12px; color:#657087; margin-top:8px; }
.yatoon-sf-lightbox-dialog { overflow:auto; max-height:calc(100dvh - 40px); }
.yatoon-sf-lightbox-caption { max-height:25vh; overflow:auto; overflow-wrap:anywhere; }
.yatoon-sf-lightbox-toolbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; }
.yatoon-sf-lightbox-toolbar button { border:1px solid #dce1e9; border-radius:8px; color:#25354f; background:#f6f7fa; width:42px; height:36px; cursor:pointer; }
.yatoon-sf-lightbox-count { font-size:12px; color:#657087; }
.yatoon-sf-media-error { color:#9c3b36; font-size:14px; }
.yatoon-sf-feed button:focus-visible,.yatoon-sf-lightbox :is(button,a,video):focus-visible { outline:3px solid #7661ce; outline-offset:3px; }
.yatoon-sf-tiktok-card { border:1px solid #e2e6ee; border-radius:12px; overflow:hidden; background:#fff; }
.yatoon-sf-tiktok-player { aspect-ratio:9/16; background:#17202e; color:white; }
.yatoon-sf-tiktok-player { position:relative; overflow:hidden; }
.yatoon-sf-tiktok-cover { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; opacity:.58; }
.yatoon-sf-tiktok-player iframe { width:100%; height:100%; border:0; display:block; }
.yatoon-sf-tiktok-placeholder { display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:24px 18px; height:100%; }
.yatoon-sf-tiktok-mark { font-size:40px; color:#6ed9d2; margin-bottom:16px; }
.yatoon-sf-tiktok-placeholder p { font-size:12px; color:#d3d9e5; line-height:1.7; }
.yatoon-sf-tiktok-caption { color:#fff!important; font-size:13px!important; margin:8px 0 0; }
.yatoon-sf-tiktok-card > a { display:flex; justify-content:space-between; padding:14px 16px; color:#344259; font-size:13px; text-decoration:none; }
.yatoon-sf-tiktok-load { font-size:12px; padding:10px 14px; }
@container yatoon-feed (max-width:600px) {
    .yatoon-sf-feed .yatoon-sf-grid { grid-template-columns:repeat(min(var(--yatoon-cols,4),var(--yatoon-mobile-cols,2)),minmax(0,1fr)); }
    .yatoon-sf-feed .yatoon-sf-grid--masonry { column-count:min(var(--yatoon-cols,4),var(--yatoon-mobile-cols,2)); }
    .yatoon-sf-headers { flex-direction:column; }
    .yatoon-sf-header-card { flex-wrap:wrap; }
    .yatoon-sf-follow-btn { margin-left:0; }
    .yatoon-sf-feed .yatoon-sf-tiktok-grid { grid-template-columns:1fr; }
}
@media(max-width:600px) {
    .yatoon-sf-feed .yatoon-sf-grid { grid-template-columns:repeat(min(var(--yatoon-cols,4),var(--yatoon-mobile-cols,2)),minmax(0,1fr)); }
    .yatoon-sf-feed .yatoon-sf-grid--masonry { column-count:min(var(--yatoon-cols,4),var(--yatoon-mobile-cols,2)); }
    .yatoon-sf-feed .yatoon-sf-tiktok-grid { grid-template-columns:1fr; }
}
@media(prefers-reduced-motion:reduce) { .yatoon-sf-feed *,.yatoon-sf-lightbox * { transition:none!important; animation:none!important; scroll-behavior:auto!important; } }
