/* ==========================================================================
   Article Grid Tile Hover Overlay Effect
   Matches mockup with outline pen-to-square & camera icons
   ========================================================================== */

.post-feed .post {
    position: relative;
    overflow: hidden;
}

.post-link {
    position: relative;
    display: block;
    overflow: hidden;
    text-decoration: none;
}

.post-link .post-image {
    display: block;
    width: 100%;
    height: auto;
    /* Scale animation removed per user request for rock-solid stability */
}

/* Semi-transparent dark overlay container */
.post-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 38px 16px 16px 16px;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.88) 0%,
        rgba(0, 0, 0, 0.72) 45%,
        rgba(0, 0, 0, 0.35) 75%,
        rgba(0, 0, 0, 0) 100%
    );
    color: #ffffff;
    opacity: 0;
    visibility: hidden;
    transform: translateY(18px);
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.35s;
    pointer-events: none;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Show on hover or keyboard focus (Desktop) */
.post:hover .post-overlay,
.post-link:focus .post-overlay {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Content layout with coordinated upward glide */
.post-overlay-content {
    display: flex;
    flex-direction: column;
    gap: 7px;
    width: 100%;
    transform: translateY(10px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.post:hover .post-overlay-content,
.post-link:focus .post-overlay-content {
    transform: translateY(0);
}

/* Rows for title and camera/film meta */
.post-overlay-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    line-height: 1.35;
}

.post-overlay-row i,
.post-overlay-row .post-overlay-icon {
    flex-shrink: 0;
    font-size: 15px;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

/* Title text styling */
.post-overlay-title .post-overlay-text {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* Meta (Camera & Film Stock) text styling */
.post-overlay-meta .post-overlay-text {
    font-size: 13.5px;
    font-weight: 400;
    color: #eeeeee;
    letter-spacing: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* Reposition lightbox expand button to top-right to prevent overlap */
.post-lightbox {
    position: absolute;
    right: 14px;
    top: 14px;
    bottom: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    line-height: 32px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
    transform: scale(0.85);
    z-index: 3;
}

.post:hover .post-lightbox,
.post-link:hover + .post-lightbox,
.post-lightbox:hover {
    opacity: 1;
    transform: scale(1);
}

.post-lightbox:hover {
    background-color: #ffffff;
}

/* ==========================================================================
   Mobile / Touch Devices Experience (Option 1)
   Always visible with sleek, compact bottom gradient while scrolling.
   ========================================================================== */
@media (hover: none), (pointer: coarse), (max-width: 640px) {
    .post-overlay {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
        transition: none !important;
        padding: 26px 12px 10px 12px;
        background: linear-gradient(
            to top,
            rgba(0, 0, 0, 0.82) 0%,
            rgba(0, 0, 0, 0.6) 45%,
            rgba(0, 0, 0, 0.2) 75%,
            rgba(0, 0, 0, 0) 100%
        );
    }

    .post-overlay-content {
        transform: translateY(0) !important;
        transition: none !important;
    }

    .post-overlay-title .post-overlay-text {
        font-size: 13.5px;
        font-weight: 600;
    }

    .post-overlay-meta .post-overlay-text {
        font-size: 12px;
        font-weight: 400;
        color: #e5e5e5;
    }

    .post-overlay-row {
        gap: 8px;
    }

    .post-overlay-row i,
    .post-overlay-row .post-overlay-icon {
        font-size: 13px;
        width: 14px;
        height: 14px;
    }

    /* Hide the lightbox expand circle button on mobile to keep the view clean */
    .post-lightbox {
        display: none !important;
    }
}
