/*
Theme Name: LocalLoot News (Freenews Child)
Theme URI: https://localloot.com
Description: Child theme for Freenews with LocalLoot AI integration.
Author: Antigravity
Author URI: https://google.com
Template: freenews
Version: 1.0.0
*/

/* ============================================================
   GLOBAL — Prevent horizontal overflow
   ============================================================ */
html,
body {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

/* ============================================================
   SEARCH REMOVAL — Hide any leftover search form container
   ============================================================ */
.header-media-search,
.search-container {
    display: none !important;
}

/* ============================================================
   SECONDARY NAV — Hide right menu toggle (does nothing)
   ============================================================ */
.secondary-navigation,
.secondary-menu-toggle {
    display: none !important;
}

/* ============================================================
   HEADER IMAGE / "FREE NEWS" — Hidden globally, replaced by ad
   ============================================================ */
.custom-header,
.custom-header-media {
    display: none !important;
}

/* ============================================================
   AD CONTAINERS — Responsive by default
   ============================================================ */
.ad-in-content,
.ad-placeholder,
.header-banner,
.advertise-area {
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.ad-in-content iframe,
.ad-in-content img,
.header-banner iframe,
.header-banner img {
    max-width: 100%;
    height: auto;
}

/* ============================================================
   PWA INSTALL BANNER
   ============================================================ */
.pwa-install-banner {
    display: none;
    /* Hidden by default, shown via JS */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #BA1818 0%, #8B1111 100%);
    color: #fff;
    padding: 14px 20px;
    z-index: 99999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    animation: slideUpBanner 0.4s ease-out;
}

@keyframes slideUpBanner {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.pwa-install-banner.visible {
    display: flex;
}

.pwa-install-banner__icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    flex-shrink: 0;
}

.pwa-install-banner__text {
    flex: 1;
    min-width: 0;
}

.pwa-install-banner__title {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
    margin: 0;
}

.pwa-install-banner__subtitle {
    font-size: 12px;
    opacity: 0.85;
    margin: 2px 0 0;
    line-height: 1.3;
}

.pwa-install-banner__btn {
    background: #fff;
    color: #BA1818;
    border: none;
    padding: 10px 22px;
    border-radius: 24px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
}

.pwa-install-banner__btn:active {
    transform: scale(0.95);
}

.pwa-install-banner__close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
}

.pwa-install-banner__close:hover {
    color: #fff;
}

/* ============================================================
   STICKY BOTTOM AD (Mobile)
   ============================================================ */
.mobile-sticky-ad {
    display: none;
    /* Only shown on mobile */
}

/* ============================================================
   TABLET — max-width: 768px
   ============================================================ */
@media only screen and (max-width: 768px) {

    /* --- Header: center logo, make it bigger --- */
    .main-header-brand .header-brand-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .main-header-brand .site-branding {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        text-align: center;
    }

    .main-header-brand .header-right {
        display: none;
        /* Hide header ad on mobile */
    }

    .site-branding .custom-logo-link {
        display: flex;
        justify-content: center;
        padding-right: 0;
        float: none;
    }

    /* --- LOGO: Make it bigger and more visible --- */
    .site-branding .custom-logo-link img {
        max-width: 280px;
        width: 280px;
        height: auto;
    }

    .site-title {
        text-align: center;
        float: none;
        font-size: 28px;
    }

    .site-description {
        text-align: center;
    }

    /* --- Flash/Breaking News bar --- */
    .top-header {
        overflow: hidden;
    }

    .flash-news {
        width: 100%;
        overflow: hidden;
    }

    .marquee {
        overflow: hidden;
    }

    /* --- Hide banner social icons (keep article share buttons) --- */
    .header-social-menu {
        display: none !important;
    }

    /* --- Content layout: SINGLE COLUMN --- */
    .wrap.wrap-width {
        padding: 0 10px;
    }

    /* Force all article grids to single column */
    .posts-holder,
    .category-content-holder {
        display: flex !important;
        flex-direction: column !important;
    }

    .posts-holder .post,
    .posts-holder .page,
    .posts-holder article,
    .category-content-holder .post,
    .category-content-holder article,
    .posts-holder .hentry {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        flex: 0 0 100% !important;
        margin-bottom: 20px;
    }

    /* Homepage category widget columns — force single column */
    .widget_list_category_posts {
        display: block !important;
        width: 100% !important;
        float: none !important;
    }

    .list-category-posts-half,
    .list-category-posts-half.lcp-left,
    .list-category-posts-half.lcp-right {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        display: block !important;
        margin-bottom: 15px;
    }

    /* Category slider — let Slick handle widths, just constrain the container */
    .widget_category_slide {
        width: 100% !important;
        overflow: hidden;
    }

    .widget_category_slide .slick-list {
        overflow: hidden !important;
    }

    .widget_category_slide .slick-track {
        display: flex !important;
    }

    /* Force featured/highlighted sections single column too */
    .highlighted-category,
    .highlighted-category-left,
    .highlighted-category-right,
    .banner-list {
        width: 100% !important;
        float: none !important;
        margin-bottom: 15px;
    }

    .main-banner-section {
        display: flex;
        flex-direction: column;
    }

    /* --- Hide header image / "FREE NEWS" area on mobile --- */
    .header-media-search {
        display: none !important;
    }

    /* --- Clock --- */
    .clock {
        display: none;
    }

    /* --- MOBILE MENU ---
       Keep the first .navigation-top for its toggle button.
       Collapse its bar, position toggle in the logo area.
       Hide #nav-sticker (duplicate). JS in child theme wires the toggle. */

    /* Collapse the first nav bar — only toggle stays visible */
    .main-header>.navigation-top:first-child {
        position: static;
        background: transparent;
        padding: 0;
        margin: 0;
        min-height: 0;
        height: 0;
        overflow: visible;
    }

    .main-header>.navigation-top:first-child .wrap {
        padding: 0;
    }

    /* Position the toggle button in the logo bar */
    .main-header>.navigation-top:first-child .menu-toggle {
        position: absolute;
        top: 50%;
        left: 5px;
        transform: translateY(-50%);
        z-index: 99999;
        background: transparent;
        color: #333;
        border: none;
        padding: 8px 12px;
        font-size: 22px;
        line-height: 1;
        margin: 0;
        display: block !important;
    }

    /* Hide desktop menu items by default */
    .main-header>.navigation-top:first-child .main-navigation .menu {
        display: none;
    }

    /* When toggled open — slide-in panel */
    .main-header>.navigation-top:first-child .main-navigation.toggled .menu {
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: #222 !important;
        z-index: 99999;
        padding: 60px 0 20px;
        margin: 0;
        list-style: none;
        overflow-y: auto;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
    }

    .main-header>.navigation-top:first-child .main-navigation.toggled .menu li {
        display: block !important;
        width: 100% !important;
        float: none !important;
        border-bottom: 1px solid #444;
    }

    .main-header>.navigation-top:first-child .main-navigation.toggled .menu li a {
        color: #fff !important;
        padding: 14px 20px !important;
        display: block !important;
        font-size: 16px;
        text-decoration: none;
        background: transparent !important;
    }

    .main-header>.navigation-top:first-child .main-navigation.toggled .menu li a:hover {
        background: #333 !important;
    }

    /* Sub-menus inside mobile nav */
    .main-header>.navigation-top:first-child .main-navigation.toggled .sub-menu {
        display: block;
        position: static !important;
        background: #1a1a1a !important;
        box-shadow: none;
        padding-left: 15px;
    }

    /* Hide #nav-sticker entirely on mobile */
    #nav-sticker {
        display: none !important;
    }

    /* Logo bar is the positioning context */
    .header-brand {
        position: relative;
        padding-left: 45px;
    }

    /* Hide clock */
    .clock {
        display: none;
    }

    .ad-in-content {
        padding: 10px 0;
    }

    .ad-placeholder {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        min-height: 80px;
    }

    /* --- Article content --- */
    .entry-content img,
    .entry-content iframe {
        max-width: 100%;
        height: auto;
    }

    /* --- Sidebar & widget areas: stack below content on mobile --- */
    .widget {
        max-width: 100%;
        overflow: hidden;
    }

    .sidebar,
    .widget-area,
    #primary,
    #secondary,
    .main-content-area,
    .left-widget-area,
    .right-widget-area {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        display: block !important;
    }

    /* Ensure the content wrapper stacks vertically */
    .site-content-cell,
    .wrap.wrap-width {
        display: flex !important;
        flex-direction: column !important;
    }

    .wrap.wrap-width>* {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
    }

    /* --- Footer --- */
    .footer-menu li {
        width: 50%;
    }

    .site-info {
        text-align: center;
        padding: 15px 10px;
    }

    /* --- Sticky bottom ad visible --- */
    .mobile-sticky-ad {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9999;
        background: #fff;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
        text-align: center;
        padding: 5px;
    }
}

/* ============================================================
   MOBILE — max-width: 500px
   ============================================================ */
@media only screen and (max-width: 500px) {

    /* Logo slightly smaller on small phones but still readable */
    .site-branding .custom-logo-link img {
        max-width: 220px;
        width: 220px;
    }

    .site-title {
        font-size: 22px;
    }

    /* Full-width content */
    .wrap.wrap-width {
        padding: 0 8px;
    }

    /* Footer menu single column */
    .footer-menu li {
        width: 100%;
        text-align: center;
    }

    /* Tighter header */
    .header-brand {
        padding: 10px 0;
    }
}

/* ============================================================
   SMALL PHONES — max-width: 375px
   ============================================================ */
@media only screen and (max-width: 375px) {
    .site-branding .custom-logo-link img {
        max-width: 180px;
        width: 180px;
    }

    .site-title {
        font-size: 20px;
    }

    .pwa-install-banner {
        padding: 12px 12px;
        gap: 8px;
    }

    .pwa-install-banner__btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}