/* 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; }
}

.yatoon-sf-credit {
    text-align: center;
    margin-top: 10px;
    font-size: 11px;
}
.yatoon-sf-credit a {
    color: #9ca3af;
    text-decoration: none;
    opacity: .8;
}
.yatoon-sf-credit a:hover {
    opacity: 1;
    text-decoration: underline;
}
