/* =====================================================
   MOBILE-FIRST NEWSPAPER THEME STYLES
   NewsXPaper Pro - Enhanced Mobile Experience
   ===================================================== */

/* =====================================================
   DESKTOP SAVED ARTICLES BUTTON (in menu bar)
   ===================================================== */

.menu-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-inner .main-navigation {
  flex: 1;
}

.menu-saved-articles {
  margin-left: 20px;
}

.np-saved-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--color-primary, #0a95ff);
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-size: 14px;
}

.np-saved-btn:hover {
  background:rgb(0 0 0 / 50%) !important;
}

.np-saved-btn svg {
  width: 20px;
  height: 20px;
}

.np-saved-btn .saved-count {
  background: var(--color-primary, #0a95ff);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* =====================================================
   BASE MOBILE STYLES (Mobile First Approach)
   ===================================================== */

/* Touch-friendly tap targets - minimum 44px */
.mobile-menu-bar a,
.mobile-menu-bar button,
.np-mobile-bottom-nav a,
.np-mobile-share a {
  min-width: 44px;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Prevent body scroll when overlay open */
body.overlay-open,
body.mobile-menu-open {
  overflow: hidden;
}

/* =====================================================
   IMPROVED MOBILE MENU
   ===================================================== */

.mobile-menu-bar {
  display: none;
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

.mobile-logo {
  flex: 1;
}

.mobile-logo img {
  max-height: 40px;
  width: auto;
}

.mobile-site-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

/* Hamburger Icon */
.hamburger-icon {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  margin-right: 8px;
}

.hamburger-icon .bar {
  width: 100%;
  height: 2px;
  background-color: #fff;
  transition: all 0.3s ease;
}

.menu-active .hamburger-icon .bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-active .hamburger-icon .bar:nth-child(2) {
  opacity: 0;
}

.menu-active .hamburger-icon .bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Menu Button */
.menu-btn {
  display: flex;
  align-items: center;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 10px;
  font-size: 14px;
  font-weight: 500;
}

/* Submenu Toggle Button */
.submenu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary, #0a95ff);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: auto;
  transition: all 0.3s ease;
}

.submenu-toggle:hover,
.submenu-toggle:focus {
  background: var(--color-heding, #0d1013);
}

.submenu-toggle i {
  transition: transform 0.3s ease;
}

.submenu-open > .submenu-toggle i {
  transform: rotate(180deg);
}

/* Mobile Menu List - Fixed for fallback pages */
ul#wsm-menu,
nav.mobile-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

ul#wsm-menu li,
nav.mobile-navigation ul li {
  position: relative;
}

ul#wsm-menu li a,
nav.mobile-navigation ul li a {
  display: block;
  padding: 12px 15px;
  color: var(--color-heding, #0d1013);
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-size: 15px;
}

ul#wsm-menu li a:hover,
ul#wsm-menu li a:focus,
nav.mobile-navigation ul li a:hover {
  background: rgba(10, 149, 255, 0.1);
  color: var(--color-primary, #0a95ff);
}

ul#wsm-menu li.current-menu-item > a,
ul#wsm-menu li.current_page_item > a {
  color: var(--color-primary, #0a95ff);
  font-weight: 600;
}

/* Submenu styles */
ul#wsm-menu .sub-menu,
ul#wsm-menu .children {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: rgba(0,0,0,0.02);
  padding-left: 15px;
}

ul#wsm-menu .submenu-open > .sub-menu,
ul#wsm-menu .submenu-open > .children,
ul#wsm-menu .menu-item-has-children.clicked > .sub-menu,
ul#wsm-menu .page_item_has_children.clicked > .children {
  max-height: 500px;
}

/* =====================================================
   MOBILE BOTTOM NAVIGATION
   ===================================================== */

.np-mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  z-index: 9998;
  transition: transform 0.3s ease;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.np-mobile-bottom-nav.hidden {
  transform: translateY(100%);
}

.np-mobile-bottom-nav a.bottom-nav-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 5px 12px;
  color: var(--gray, #6c757d);
  text-decoration: none;
  font-size: 10px;
  transition: all 0.2s ease;
  gap: 4px;
}
a#npBookmarkToggle{
  position: relative;
}
.np-mobile-bottom-nav a.bottom-nav-item i {
  font-size: 20px;
}

.np-mobile-bottom-nav a.bottom-nav-item span {
  font-size: 10px;
  font-weight: 500;
}

.np-mobile-bottom-nav a.bottom-nav-item.active,
.np-mobile-bottom-nav a.bottom-nav-item:hover {
  color: var(--color-primary, #0a95ff);
}

/* =====================================================
   FLOATING SHARE BAR
   ===================================================== */

.np-floating-share {
  position: fixed;
  bottom: 80px;
  left: 15px;
  transform: translateX(0) translateY(100px);
  background: var(--color-primary, #0a95ff);
  padding: 12px;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(10, 149, 255, 0.4);
  z-index: 9997;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  display: none;
  cursor: pointer;
}

.np-floating-share.visible {
  transform: translateX(0) translateY(0);
  opacity: 1;
  visibility: visible;
}

.np-floating-share:hover {
  transform: translateX(0) scale(1.1);
  box-shadow: 0 6px 25px rgba(10, 149, 255, 0.5);
}

/* Share buttons wrapper - shows on click/hover */
.np-mobile-share {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.np-mobile-share .share-label {
  display: none;
}

.np-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  transition: transform 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.np-share-btn:hover {
  transform: scale(1.15);
  color: #fff;
}

.share-whatsapp { background: #25D366; }
.share-facebook { background: #1877F2; }
.share-twitter { background: #000; }
.share-telegram { background: #0088cc; }

/* =====================================================
   MOBILE SEARCH & CATEGORIES OVERLAY
   ===================================================== */

.np-mobile-search-overlay,
.np-mobile-categories-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 999999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 0;
  overflow-y: auto;
}

.np-mobile-search-overlay.active,
.np-mobile-categories-overlay.active {
  opacity: 1;
  visibility: visible;
}

.search-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
}

.categories-overlay-inner {
  max-width: 500px;
  margin: 0 auto;
  padding: 80px 20px 100px;
  position: relative;
}

.categories-overlay-inner h3 {
  color: #fff;
  font-size: 24px;
  margin-bottom: 20px;
  text-align: center;
}

/* Close Buttons - Improved visibility */
.close-search,
.close-categories {
  position: fixed;
  top: 15px;
  right: 15px;
  background: var(--color-primary, #0a95ff);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000000;
  box-shadow: 0 4px 15px rgba(10, 149, 255, 0.4);
  transition: all 0.3s ease;
}

.close-search:hover,
.close-categories:hover {
  background: #0880e0;
  transform: scale(1.1);
}

.close-search::before,
.close-categories::before {
  content: '✕';
  font-size: 22px;
  font-weight: bold;
  line-height: 1;
}

.close-search i,
.close-categories i {
  display: none;
}

/* Search Form Styling */
.search-overlay-inner .search-form,
.np-mobile-search-overlay .search-form {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.search-overlay-inner .search-form label {
  width: 100%;
}

.search-overlay-inner .search-form input[type="search"],
.np-mobile-search-overlay input[type="search"] {
  width: 100%;
  padding: 18px 20px;
  font-size: 18px;
  border: none;
  border-radius: 50px;
  background: #fff;
  color: #333;
  outline: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.search-overlay-inner .search-form input[type="search"]:focus,
.np-mobile-search-overlay input[type="search"]:focus {
  box-shadow: 0 4px 25px rgba(10, 149, 255, 0.4);
}

.search-overlay-inner .search-form input[type="search"]::placeholder {
  color: #999;
}

.search-overlay-inner .search-form .search-submit,
.np-mobile-search-overlay .search-submit {
  background: var(--color-primary, #0a95ff);
  color: #fff;
  border: none;
  padding: 16px 30px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

.search-overlay-inner .search-form .search-submit:hover,
.np-mobile-search-overlay .search-submit:hover {
  background: #0880e0;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(10, 149, 255, 0.4);
}

/* Search overlay title */
.search-overlay-inner::before {
  content: 'Search';
  display: block;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 30px;
  text-align: center;
}

/* Categories List Styling */
.mobile-category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-category-list li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-category-list li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 15px;
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  transition: all 0.3s ease;
}

.mobile-category-list li a:hover {
  background: rgba(10, 149, 255, 0.2);
  color: var(--color-primary, #0a95ff);
  padding-left: 25px;
}

.mobile-category-list .cat-item-count {
  background: var(--color-primary, #0a95ff) !important;
  color: #fff;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
}

/* =====================================================
   SAVED ARTICLES OVERLAY & FUNCTIONALITY
   ===================================================== */

.np-mobile-saved-overlay {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 999999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 0;
  overflow-y: auto;
}

.np-mobile-saved-overlay.active {
  opacity: 1;
  visibility: visible;
}

.close-saved {
  position: fixed;
  top: 15px;
  right: 15px;
  background: var(--color-primary, #0a95ff);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000000;
  box-shadow: 0 4px 15px rgba(10, 149, 255, 0.4);
  transition: all 0.3s ease;
}

.close-saved:hover {
  background: #0880e0;
  transform: scale(1.1);
}

.close-saved::before {
  content: '✕';
  font-size: 22px;
  font-weight: bold;
  line-height: 1;
}

.saved-overlay-inner {
  max-width: 500px;
  margin: 0 auto;
  padding: 80px 20px 100px;
}

.saved-overlay-inner h3 {
  color: #fff;
  font-size: 28px;
  margin-bottom: 5px;
  text-align: center;
}

.saved-subtitle {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  text-align: center;
  margin-bottom: 30px;
}

/* Saved Articles List */
.saved-articles-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.saved-article-item {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  position: relative;
  transition: all 0.3s ease;
}

.saved-article-item:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(5px);
}

.saved-article-link {
  display: flex;
  align-items: center;
  flex: 1;
  text-decoration: none;
  padding: 12px;
  gap: 12px;
}

.saved-article-thumb {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.saved-article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.saved-article-content {
  flex: 1;
  min-width: 0;
}

.saved-article-title {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 5px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.saved-article-date {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

.remove-saved-btn {
  background: rgba(255, 0, 0, 0.2);
  border: none;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.remove-saved-btn:hover {
  background: rgba(255, 0, 0, 0.4);
}

.remove-saved-btn span {
  color: #fff;
  font-size: 24px;
  line-height: 1;
}

/* Empty State */
.saved-empty {
  text-align: center;
  padding: 60px 20px;
}

.saved-empty-icon {
  font-size: 60px;
  margin-bottom: 20px;
}

.saved-empty h4 {
  color: #fff;
  font-size: 20px;
  margin-bottom: 10px;
}

.saved-empty p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  line-height: 1.6;
}

/* Saved Count Badge */
.saved-count-badge {
  position: absolute;
  top: 5px;
  right: 50%;
  transform: translateX(15px);
  background: #ff3b30;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* Save Article Button (for article cards) */
.np-save-article-btn {
  background: rgba(0, 0, 0, 0.5);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
  padding: 0;
}

.np-save-article-btn svg {
  width: 20px;
  height: 20px;
  color: #fff;
  transition: all 0.3s ease;
}

.np-save-article-btn .bookmark-icon-filled {
  display: none;
}

.np-save-article-btn:hover {
  background: var(--color-primary, #0a95ff);
  transform: scale(1.1);
}

.np-save-article-btn.saved {
  background: var(--color-primary, #0a95ff);
}

.np-save-article-btn.saved .bookmark-icon-outline {
  display: none;
}

.np-save-article-btn.saved .bookmark-icon-filled {
  display: block;
  color: #fff;
}

/* Save button position in grid items */
.grid-item-img {
  position: relative;
}

.grid-save-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
}

.list-save-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
}

/* =====================================================
   PULL TO REFRESH
   ===================================================== */

.np-pull-refresh {
  display: none;
  position: fixed;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary, #0a95ff);
  color: #fff;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 12px;
  z-index: 99998;
  transition: top 0.3s ease;
}

.np-pull-refresh.pulling {
  top: 60px;
}

.np-pull-refresh.refreshing {
  top: 60px;
}

.np-pull-refresh.refreshing::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =====================================================
   READING TIME
   ===================================================== */

.reading-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--gray, #6c757d);
}

.reading-time i {
  font-size: 14px;
}

/* =====================================================
   RESPONSIVE BREAKPOINTS
   ===================================================== */

/* Medium Layout: 1280px. */
@media only screen and (min-width: 992px) and (max-width: 1200px) {
}

/* Tablet Layout: 768px. */
@media only screen and (min-width: 768px) and (max-width: 991px) {
}

/* Mobile Layout: 991px and below */
@media only screen and (max-width: 991px) {
  .slicknav_menu {
    display: block;
  }
  .menu-bar {
    position: relative;
    left: 0;
    top: 0;
  }
  
  /* Hide desktop saved button on mobile */
  .menu-saved-articles {
    display: none;
  }

  h1 {
    font-size: 35px;
  }
  h1.page-title {
    font-size: 20px;
  }
  h2 {
    font-size: 28px;
  }
  nav#site-navigation {
    display: none;
  }

  /* Mobile Menu style */
  .mobile-menu-bar {
    background: rgb(0, 0, 0);
    display: block;
    position: sticky;
    top: 0;
    z-index: 9999;
  }

  .admin-bar .mobile-menu-bar {
    top: 32px;
  }

  .mobile-menu-bar button {
    display: flex;
    justify-content: flex-end;
    margin-left: auto;
  }

  nav#mobile-navigation {
    position: relative;
  }

  nav ul.wsm-menu {
    box-shadow: 0px 5px 42px -6px rgb(92 91 92);
    padding: 15px;
    margin-bottom: 10px;
    background: var(---light-body, #fff);
    position: absolute;
    left: auto;
    right: 0;
    top: 80px;
    z-index: 99999;
    visibility: hidden;
    opacity: 0;
    transition: 0.3s ease;
    min-width: 280px;
    max-width: 320px;
    border-radius: 8px;
    max-height: 70vh;
    overflow-y: auto;
  }

  nav.menu-active ul.wsm-menu {
    top: 55px;
    visibility: visible;
    opacity: 1;
  }

  ul.wsm-menu {
    margin: 0;
    padding: 0;
  }

  ul.wsm-menu li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }

  ul.wsm-menu li a {
    flex: 1;
    padding: 12px 10px;
    text-decoration: none;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: block;
  }

  .mobile-navigation ul {
    list-style: none;
  }

  .menu-item-has-children,
  .page_item_has_children {
    display: flex;
    flex-flow: row wrap;
  }

  .menu-item-has-children .sub-menu,
  .page_item_has_children .children {
    display: block;
    width: 100%;
  }

  span.mclose {
    display: none;
  }

  ul#wsm-menu ul.sub-menu,
  ul#wsm-menu ul.children {
    visibility: hidden;
    max-height: 0;
    height: auto;
    opacity: 0;
    transition: 0.3s ease;
  }

  ul#wsm-menu .menu-item-has-children.clicked > ul.sub-menu,
  ul#wsm-menu .menu-item-has-children.focus > ul.sub-menu,
  ul#wsm-menu .page_item_has_children.clicked > ul.children,
  ul#wsm-menu .page_item_has_children.focus > ul.children,
  ul#wsm-menu .submenu-open > ul.sub-menu,
  ul#wsm-menu .submenu-open > ul.children {
    max-height: 1000px;
    visibility: visible;
    opacity: 1;
    height: auto;
  }

  .footer-bottom-last-section {
    justify-content: center;
  }

  .designer-details.copytext {
    margin-bottom: 10px;
  }

  /* Show mobile-first features */
  .np-mobile-bottom-nav {
    display: flex;
  }

  .np-floating-share {
    display: block;
    bottom: 70px;
  }

  .np-mobile-search-overlay,
  .np-mobile-categories-overlay {
    display: block;
  }

  .np-pull-refresh {
    display: block;
  }

  /* Add padding for bottom nav */
  body {
    padding-bottom: 60px;
  }
}

/* Wide Mobile Layout: 767px */
@media only screen and (max-width: 767px) {
  h1 {
    font-size: 28px !important;
  }
  h1.page-title {
    font-size: 22px !important;
  }
  h2 {
    font-size: 24px;
  }
  .nx-list-item figure {
    width: 100%;
  }
  .footer-bottom-last-section {
    justify-content: center;
  }
  .footer-last-menu ul {
    padding-left: 0;
  }
  .designer-details.copytext {
    margin-bottom: 10px;
  }
  .news-update.ticker {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
  }
  .header .breaking-news {
    display: flex;
    flex-direction: column;
  }
  .footer-social-icon a {
    padding: 10px 11px;
  }

  /* Smaller floating share */
  .np-share-btn {
    width: 36px;
    height: 36px;
  }
}

@media only screen and (max-width: 599px) {
  .admin-bar .mobile-menu-bar {
    top: 46px;
  }

  nav ul.wsm-menu {
    min-width: 260px;
    right: -10px;
  }
}

/* Small Mobile Layout: 479px */
@media only screen and (max-width: 479px) {
  .header-search-form {
    right: 0;
  }

  h1 {
    font-size: 24px !important;
  }

  nav ul.wsm-menu {
    min-width: calc(100vw - 30px);
    max-width: calc(100vw - 30px);
  }

  .np-mobile-share .share-label {
    display: none;
  }
}
