/* =====================
   MOBILE RESPONSIVE
===================== */

/* Hide mobile elements on desktop by default */
#mobile-banner,
#mobile-menu-wrapper {
  display: none;
}

/* Mobile styles */
@media screen and (max-width: 768px) {
  
  /* Reset body background for mobile */
  body {
    margin: 0;
    padding: 0;
    background: #1A1A1A !important;
    background-image: none !important;
  }
  
  * {
    box-sizing: border-box;
  }
  
  /* === HIDE DESKTOP ELEMENTS === */
  #navbar,
  #navbar-iframe,
  #header-wrapper,
  #r_head,
  #navmenu,
  #fix {
    display: none !important;
  }
  
  /* === SHOW MOBILE BANNER === */
  #mobile-banner {
    width: 100%;
    display: block !important;
    margin: 0;
    padding: 0;
  }
  
  #mobile-banner img {
    width: 100%;
    height: auto;
    display: block;
  }
  
  /* === MOBILE MENU === */
  #mobile-menu-wrapper {
    display: block !important;
    width: 100%;
    font-family: Arial, sans-serif;
  }
  
  #mobile-menu-bar {
    background: #222;
    color: #fff;
    padding: 16px 12px;
    font-size: 18px;
    cursor: pointer;
    user-select: none;
    border-bottom: 2px solid #000;
    text-align: center; /* Center the content */
  }
  
  #mobile-menu {
    display: none;
    margin: 0;
    padding: 0;
    background: #111;
  }
  
  #mobile-menu li {
    list-style: none;
    border-bottom: 1px solid #333;
  }
  
  #mobile-menu a,
  .submenu-toggle {
    display: block;
    padding: 16px 12px;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    font-size: 16px; /* Increased from default */
  }
  
  #mobile-menu a:hover,
  .submenu-toggle:hover,
  #mobile-menu a:active,
  .submenu-toggle:active {
    background: #333;
  }
  
  /* Submenu */
  .submenu {
    display: none;
    background: #1b1b1b;
  }
  
  .submenu li {
    border-bottom: 1px solid #2a2a2a;
  }
  
   .submenu li a {
    padding-left: 45px !important; /* Increased from 30px */
    font-size: 15px !important; /* Increased from 14px */
  }
  
  /* Plus/Minus icon */
  .submenu-toggle {
    position: relative;
  }
  
  .submenu-toggle .icon {
    float: right;
    font-weight: bold;
    font-size: 20px;
  }

  
  /* === LAYOUT - SINGLE COLUMN === */
  #outer-wrapper,
  #wrap2,
  #content-wrapper {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #1A1A1A !important;
  }
  
  #main-wrapper {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 15px !important;
    background: #1A1A1A !important;
    border: none !important;
    overflow: visible !important;
  }
  
  #sidebar-wrapper {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 15px !important;
  }
  
  .sidebar {
    background: #1A1A1A !important;
    border: 1px solid #2D2D2D !important;
    padding: 10px !important;
  }
  
  /* === POST GRID TO 2 COLUMNS === */
  
  /* Container for posts */
  .blog-posts {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 15px !important; /* Space between items */
  }
  
  .post {
    width: calc(50% - 7.5px) !important; /* 2 columns accounting for gap */
    height: auto !important;
    margin: 0 !important;
    padding: 10px !important;
    display: block !important;
    float: none !important;
    background: #232323 !important;
    border: 1px solid #2D2D2D !important;
  }
  
  .post h3,
  .post h4,
  .post-title {
    font-size: 14px !important;
    line-height: 1.3 !important;
    padding: 0 0 8px 0 !important;
    margin: 0 !important;
  }
  
  .post h3 a,
  .post h4 a {
    color: #999 !important;
  }
  
  /* === FIX ALL IMAGES === */
  .post img,
  .post-body img {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: none !important;
    margin: 0 auto !important;
    padding: 0 !important;
    display: block !important;
  }
  
  .post-body {
    padding: 8px 0 !important;
    line-height: 1.4 !important;
  }
  
  /* Center the image container div */
  .post-body div {
    text-align: center !important;
  }
  
  .post-body a {
    display: inline-block !important;
    width: 100% !important;
  }
  
  /* Clear floats after posts */
  .blog-posts:after {
    content: "";
    display: table;
    clear: both;
  }
  
  /* === FOOTER === */
  
  /* Hide the desktop banner (first footer-wrapper with just an img) */
  #footer-wrapper:not(:last-of-type) {
    display: none !important;
  }
  
  /* Style the actual footer (last footer-wrapper) */
  #footer-wrapper:last-of-type {
    width: 100% !important;
    margin: 0 !important;
    padding: 20px 15px !important;
    border: none !important;
    border-top: 1px solid #2D2D2D !important;
  }
  
  #footer {
    width: 100% !important;
    padding: 0 !important;
    text-align: center;
  }
  
  #footer p {
    font-size: 12px;
    line-height: 1.8;
    margin: 0;
  }
  
  /* Center aligned divs */
  div[align="center"],
  DIV[align="center"] {
    text-align: center;
    font-size: 11px;
    padding: 15px 10px;
    line-height: 1.6;
  }
  
  /* === COMMENTS === */
  #comments-block {
    width: 100% !important;
  }
  
  .comment-bubble {
    margin: 10px 0 !important;
  }
  
  /* === MISC === */
  .bookmarkbox {
    width: 100% !important;
  }
  
  .clear {
    clear: both;
  }
}