/* ── Post thumbnail / hover preview ───────────────────────────────────────── */

/* On mobile screens the grid-default card thumbnail should be taller */
@media screen and (max-width: 640px) {
    .list-group > .item.grid-default .post .post-thumb,
    .list-group > .item.group-item-grid-default .post .post-thumb {
        height: 220px;
    }
    .list-group > .item.grid-default,
    .list-group > .item.group-item-grid-default {
        margin-bottom: 0 !important;
    }
}

.post-thumb {
    position: relative;
    overflow: hidden;
    /* Prevent long-press context menu by disabling selection - key to iOS Safari fix */
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
    -webkit-highlight: none;
    -webkit-tap-highlight-color: transparent;
}

.post-thumb.has-hover-preview {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}

.thumb-link {
    position: absolute;
    inset: 0;
    z-index: 3;
    text-indent: -9999px;
    overflow: hidden;
    background: transparent;
}

@media (hover: none) and (pointer: coarse) {
    /* On touch devices, disable the anchor overlay that triggers Android long-press menu. */
    .post-thumb .thumb-link {
        pointer-events: none !important;
    }

    /* Carousel slides must remain tappable to open the respective item page. */
    .owl-carousel .post-thumb .thumb-link {
        pointer-events: auto !important;
    }
}

.hover-preview-video {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 2;
    pointer-events: none;
    /* Disable selection to prevent context menu - essential fix */
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
    -webkit-highlight: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
}

.post-thumb.has-hover-preview img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: auto;
    /* Disable selection to prevent context menu - essential fix from StackOverflow */
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
    -webkit-highlight: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
}

/* Keep horizontal swipe working inside Owl carousels on touch devices. */
@media (hover: none) and (pointer: coarse) {
    .owl-carousel .post-thumb.has-hover-preview,
    .owl-carousel .post-thumb.has-hover-preview img,
    .owl-carousel .post-thumb.has-hover-preview .hover-preview-video {
        touch-action: pan-x !important;
    }

    /* Mobile carousel: disable loop preview video and keep image visible only. */
    .owl-carousel .post-thumb.has-hover-preview .hover-preview-video {
        display: none !important;
    }

    .owl-carousel .post-thumb.has-hover-preview img {
        visibility: visible !important;
    }
}

.post-thumb.has-hover-preview .video-stats {
    z-index: 4;
}

#premium .post-thumb.has-hover-preview figcaption {
    position: absolute;
    z-index: 4;
    left: 0;
    right: 0;
    bottom: 0;
}

.post:hover .post-thumb.has-hover-preview .video-stats,
.post-thumb.has-hover-preview:hover .video-stats {
    transform: none !important;
}

/* ── Home v7 / mainContentv3 ──────────────────────────────────────────────── */

.mainContentv3 {
    font-size: 14px;
}

#premium .heading .preview-subtitle {
    margin: 6px 0 0;
    font-size: 13px;
    color: #8e8e8e;
}

.mainContentv3 .main-heading .head-title h4 {
    font-size: 20px;
    line-height: 1.2;
}

.mainContentv3 .main-heading .head-title .section-subtitle {
    margin: 6px 0 0 30px;
    font-size: 13px;
    line-height: 1.4;
    color: #8e8e8e;
}

.mainContentv3 .newest-heading-gap {
    margin-top: 30px;
    margin-bottom: 30px;
}

.mainContentv3 .head-text p,
.mainContentv3 .post-stats p,
.mainContentv3 .video-box-content p,
.mainContentv3 .media-content p,
.mainContentv3 .widgetContent p {
    font-size: 12px;
    line-height: 1.5;
}

/* Align post-stats paragraph text with the theme's explicit 11px for icons/spans.
   Specificity (0,8,1) beats theme's highest list-view stats rule (0,7,1), ensuring
   the text nodes ("07:11", dates, credits) are 11px on videos/photos pages too. */
.content.content-with-sidebar .list-group .item .post .post-des .post-stats p {
    font-size: 11px;
    line-height: 1.3;
}

.mainContentv3 .post-des h6 {
    font-size: 15px;
    line-height: 1.45;
}

.mainContentv3 .widgetTitle h5 {
    font-size: 16px;
    line-height: 1.3;
}

.mainContentv3 .video-box-content h6,
.mainContentv3 .media-content h6 {
    font-size: 14px;
    line-height: 1.4;
}

.mainContentv3 aside.sidebar {
    position: relative;
}

.mainContentv3 aside.sidebar > .row {
    margin-left: 0;
    margin-right: 0;
}

.mainContentv3 aside.sidebar > .row > .columns {
    padding-left: 0;
    padding-right: 0;
}

.home-grid-v7,
.home-list-v7 {
    display: flex;
    flex-wrap: wrap;
}

.v7-card {
    display: flex;
    margin-bottom: 10px;
}

.mainContentv3 .content .list-group.home-grid-v7 .item.v7-card {
    margin-bottom: 10px !important;
}

.home-list-v7 > .item {
    display: flex;
}

.home-grid-v7 .v7-card .post {
    display: flex;
    flex-direction: column;
}

.v7-card .post,
.home-list-v7 .post {
    width: 100%;
}

.mainContentv3
    .content.content-with-sidebar
    .list-group.home-grid-v7
    .v7-card
    .post
    .post-des {
    min-height: 85px !important;
    height: auto !important;
    max-height: none !important;
    margin-bottom: 3px;
    display: flex;
    flex-direction: column;
    overflow: visible;
    padding: 10px 10px 8px !important;
}

.v7-card .post-des h6 {
    min-height: 2.8em;
    line-height: 1.4em;
    margin-bottom: 6px !important;
}

.v7-card .post-des h6 a,
.video-box-content h6 a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

/* Linked video/photo titles must turn red on hover. */
.content .post .post-des h5 a:hover,
.content .post .post-des h6 a:hover,
.sidebar .widgetBox .widgetContent .video-box .video-box-content h6 a:hover,
.sidebar .widgetBox .widgetContent .media-object .media-content h6 a:hover {
    color: #ff0000 !important;
}

.mainContentv3
    .content.content-with-sidebar
    .list-group.home-grid-v7
    .v7-card
    .post
    .post-des
    .post-stats {
    margin-top: auto;
}

.mainContentv3
    .content.content-with-sidebar
    .list-group.home-grid-v7
    .v7-card
    .post
    .post-des
    .post-stats
    p {
    margin-bottom: 0 !important;
}

.mainContentv3
    .content.content-with-sidebar
    .list-group.home-grid-v7
    .v7-card
    .post
    .post-des
    .post-stats
    p.meta-compact {
    font-size: 11px;
    line-height: 1.3;
}

/* Header auth button style: red default, gray hover */
.top-button .menu li.dropdown-login > a.loginReg {
    background: #ff0000;
}

.top-button .menu li.dropdown-login > a.loginReg:hover {
    background: #555555;
}

/* TOP 5 widgets: 70x70 square thumbnail on small screens */
@media screen and (max-width: 39.9375em) {
    .sidebar
        .widgetBox
        .widgetContent
        .media-object
        .media-object-section
        .recent-img {
        width: 70px;
        height: 70px;
    }
}

/* Description: hidden in grid views, visible in list view only */
.list-group > .item .post .post-des .video-description,
.list-group > .item .post .post-des .photo-description {
    display: none !important;
}

.list-group > .item.list .post .post-des .video-description,
.list-group > .item.list .post .post-des .photo-description {
    display: block !important;
}

/* sidebarBg is purely decorative — never intercept mouse events */
.sidebar .sidebarBg {
    pointer-events: none;
}

.sidebar .widgetBox .widgetContent .media-object .media-object-section .recent-img.fallback-preview-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar .widgetBox .widgetContent .media-object .media-object-section .recent-img img.fallback-preview-logo {
    width: auto !important;
    height: auto !important;
    max-width: 68% !important;
    max-height: 68% !important;
    object-fit: contain !important;
}

/* Free previews carousel: keep fallback logo compact inside premium cards */
#premium .premium-img.fallback-preview-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

#premium .premium-img.fallback-preview-wrap img.fallback-preview-logo {
    width: auto !important;
    height: auto !important;
    max-width: 52% !important;
    max-height: 52% !important;
    object-fit: contain !important;
    margin: auto !important;
}

/* Global fallback logo sizing for listing/home preview cards even without helper classes */
.post-thumb img[src*="/frontend/images/logo-small.png"],
.post-thumb img[src*="/frontend/images/logo.png"],
.recent-img img[src*="/frontend/images/logo-small.png"],
.recent-img img[src*="/frontend/images/logo.png"] {
    width: auto !important;
    height: auto !important;
    max-width: 56% !important;
    max-height: 56% !important;
    object-fit: contain !important;
}

.post-thumb img[src*="/frontend/images/logo-small.png"],
.post-thumb img[src*="/frontend/images/logo.png"] {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
}

/* Remove bottom spacing from sidebar on small screens */
@media screen and (max-width: 39.9375em) {
    .sidebar {
        margin-bottom: 0;
        padding-bottom: 0;
    }
    .sidebar .widgetBox {
        margin-bottom: 0;
        padding: 0;
    }
}

/* Mobile sidebar search form — match desktop #searchform styling */
.sidebar.show-for-small-only .widgetBox form input {
    height: 40px;
    line-height: 40px;
    font-size: 13px;
    color: #aaaaaa;
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
}
.sidebar.show-for-small-only .widgetBox form input[type="submit"] {
    height: 40px;
    line-height: 40px;
    padding: 0 1.5625em;
    background-color: #444;
    color: #fff;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
    transition: background-color 0.25s ease-out;
}
.sidebar.show-for-small-only .widgetBox form input[type="submit"]:hover {
    background-color: #ff0000;
    color: #fff;
}

/* Fix: Foundation floats last column right when row isn't full */
.list-group > .item.grid-default:last-child {
    float: left !important;
}

/* Fix: Foundation .menu .active > a sets blue background — override for off-canvas menu */
.light-off-menu .off-menu li.active > a {
    background: transparent;
    color: #ff0000;
}
.light-off-menu .off-menu li.active > a i {
    color: #ff0000;
}

/* ── Free Previews sidebar banner ──────────────────────────────── */
.free-previews-banner {
    display: block;
    text-decoration: none;
    color: inherit;
}
.free-previews-banner-inner {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d0000 50%, #1a1a1a 100%);
    border: 1px solid #ff0000;
    border-radius: 4px;
    padding: 22px 18px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: border-color 0.25s ease, transform 0.2s ease;
}
.free-previews-banner-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(255,0,0,0.18) 0%, transparent 70%);
    pointer-events: none;
}
.free-previews-banner:hover .free-previews-banner-inner {
    border-color: #ff4444;
    transform: translateY(-2px);
}
.free-previews-banner-icon {
    margin-bottom: 10px;
    line-height: 1;
}
.free-previews-banner-icon .fa {
    font-size: 1.8rem;
    color: #ff0000;
    margin: 0 5px;
}
.free-previews-banner-inner h4 {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.free-previews-banner-inner p {
    color: #bbbbbb;
    font-size: 0.82rem;
    line-height: 1.5;
    margin: 0 0 14px;
}
.free-previews-banner-btn {
    background-color: #ff0000 !important;
    color: #fff !important;
    border: none !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: background-color 0.2s ease !important;
    pointer-events: none;
}
.free-previews-banner:hover .free-previews-banner-btn {
    background-color: #cc0000 !important;
}
/* ────────────────────────────────────────────────────────────── */

/* ── Inline feed icon links (section subtitle) ─────────────────── */
.feed-icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    font-size: 0.72rem;
    text-decoration: none;
    vertical-align: middle;
    margin-left: 4px;
    transition: opacity 0.2s ease;
}
.feed-icon-link:hover { opacity: 0.75; text-decoration: none; }
.feed-icon-link.rss  { background-color: #f26522; color: #fff; }
.feed-icon-link.atom { background-color: #5a67d8; color: #fff; }
/* ────────────────────────────────────────────────────────────── */

/* ── Sidebar widget footer ─────────────────────────────────────── */
.sidebar .widgetBox .widgetFooter {
    margin-top: 24px;
    padding-bottom: 4px;
    display: flex;
    justify-content: center;
}
.sidebar .widgetBox .widgetFooter .button {
    display: inline-block;
    width: auto;
    margin: 0;
}

/* Free page: remove sidebar bottom margin */
.mainContentv3 .sidebar {
    margin-bottom: 0;
}

/* Profile settings: Save Changes button — grey with red hover */
.profile-settings .setting-form .setting-form-inner .button {
    background: #6b7280;
    border-bottom: 3px solid #4b5563;
    color: #fff;
}
.profile-settings .setting-form .setting-form-inner .button:hover {
    background: #e53e3e;
    border-bottom-color: #c53030;
}

/* ── Free page: newsletter banner ──────────────────────────────── */
.free-newsletter-banner {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
    border-top: 1px solid rgba(255,255,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 0 16px;
    margin-top: 30px;
    margin-bottom: 0;
}
.free-newsletter-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 100px;
    max-width: 100%;
}
.free-newsletter-banner-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex-shrink: 0;
}
.free-newsletter-banner-text strong {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}
.free-newsletter-banner-text span {
    font-size: 0.82rem;
    color: #aac4e8;
    line-height: 1.3;
}
.free-newsletter-banner-form {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    align-self: center;
}
.free-newsletter-banner-form input[type="email"] {
    height: 38px;
    padding: 0 12px;
    font-size: 0.85rem;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 4px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    width: 220px;
    box-sizing: border-box;
    outline: none;
}
.free-newsletter-banner-form input[type="email"]::placeholder {
    color: rgba(255,255,255,0.5);
}
.free-newsletter-banner-form button {
    height: 38px;
    padding: 0 18px;
    font-size: 0.85rem;
    font-weight: 600;
    background: #e53e3e;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}
.free-newsletter-banner-form button:hover {
    background: #c53030;
}

/* Mobile: stack text above form */
@media screen and (max-width: 640px) {
    .free-newsletter-banner-inner {
        flex-direction: column;
        align-items: stretch;
        min-height: auto;
        padding: 16px 0;
        gap: 12px;
    }
    .free-newsletter-banner-form {
        width: 100%;
    }
    .free-newsletter-banner-form input[type="email"] {
        flex: 1;
        width: auto;
    }
}
/* ─────────────────────────────────────────────────────────────── */

/* ────────────────────────────────────────────────────────────── */

/* ── Feed subscription widget ──────────────────────────────────── */
.feed-widget-text {
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 12px;
    line-height: 1.5;
}
.feed-widget-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.feed-widget-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.feed-widget-label {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #bbb;
    margin: 0;
    flex-shrink: 0;
}
.feed-widget-badges {
    display: flex;
    align-items: center;
    gap: 5px;
}
.feed-widget-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s ease;
}
.feed-widget-btn:hover {
    opacity: 0.8;
    text-decoration: none;
}
.feed-widget-btn.rss {
    background-color: #f26522;
    color: #fff;
}
.feed-widget-btn.atom {
    background-color: #5a67d8;
    color: #fff;
}
/* ────────────────────────────────────────────────────────────── */
