/* FinetoShine Asymmetric Bento Grid */

.finetoshine-bento-grid {
    display: block;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* Base sizing fallback (Pure CSS Masonry) before JS takes over */
.finetoshine-bento-grid {
    display: block;
    width: 100%;
    margin: 0 auto;
    padding: 12px;
    box-sizing: border-box;
    column-count: 5;
    column-gap: 12px;
}

.finetoshine-bento-item {
    break-inside: avoid;
    width: 100%;
    margin-bottom: 12px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: #f0f0f0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
}

/* Responsive Columns Fallback */
@media (max-width: 1200px) {
    .finetoshine-bento-grid { column-count: 4; }
}
@media (max-width: 900px) {
    .finetoshine-bento-grid { column-count: 3; }
}
@media (max-width: 600px) {
    .finetoshine-bento-grid { column-count: 2; column-gap: 4px; padding: 4px; }
    .finetoshine-bento-item { margin-bottom: 4px; border-radius: 12px; }
}



.finetoshine-bento-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.fts-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
}

.fts-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: block;
}

.fts-card-image {
    width: 100%;
    display: block;
    object-fit: cover;
    border-radius: 16px;
}

/* Asymmetric Heights */
.fts-tall .fts-card-image { aspect-ratio: 9/16; }
.fts-wide .fts-card-image { aspect-ratio: 4/3; }
.fts-square .fts-card-image { aspect-ratio: 1/1; }

/* Overlay UI */
.fts-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 5px 3px 5px;
    border-radius: 16px;
    pointer-events: none; /* Let clicks pass through to image link */
}

.finetoshine-bento-item:hover .fts-card-overlay {
    opacity: 1;
}

.fts-card-title {
    color: #ffffff;
    font-size: 10px;
    font-weight: 500;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    pointer-events: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-text-size-adjust: 100%;
}

/* Top Right Actions */
.fts-card-top-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.finetoshine-bento-item:hover .fts-card-top-actions {
    opacity: 1;
}

.fts-dropdown-container {
    position: relative;
}

.fts-dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    padding: 5px;
    display: none; /* toggled by JS */
    flex-direction: column;
    min-width: 120px;
    z-index: 20;
}

.fts-dropdown-menu.active {
    display: flex;
}

.fts-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    width: 100%;
}

.fts-dropdown-item:hover {
    background: #f5f5f5;
}

.fts-dropdown-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.fts-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    text-decoration: none;
    pointer-events: auto;
}

.fts-action-btn:hover {
    background: #fff;
    color: #000;
    transform: scale(1.1);
}

.fts-action-btn .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}



/* Spinner for infinite load */
.finetoshine-feed-loader {
    width: 100%;
    padding: 40px 0;
    display: flex;
    justify-content: center;
    clear: both;
    min-height: 100vh;
}
.fts-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0,0,0,0.1);
    border-left-color: #ff3366;
    border-radius: 50%;
    animation: fts-spin 1s linear infinite;
}
@keyframes fts-spin {
    to { transform: rotate(360deg); }
}
