/* =========================================================
   Theme Name: Skin of Hardware Master
   Author: Matteo Russo
   Domain: skin_hwmaster_rsso
   ========================================================= */

/* =========================================================
   1. Base Styles
   ========================================================= */
body {
  font-family: "Lato", sans-serif;
  font-size: 15px;
  color: #222;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  /* Improve mobile scrolling performance */
  -webkit-overflow-scrolling: touch;
}

a {
  color: #005eaf;
  text-decoration: none;
}
a:hover {
  color: #005eaf;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

/* Optimize images for mobile */
@media (max-width: 768px) {
  img {
    height: auto;
    object-fit: cover;
  }
}

sup {
    color: #ffffff87;
    font-size: .7em;
}

/* =========================================================
   2. Typography
   ========================================================= */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 1em;
  line-height: 1.3;
  font-weight: 700;
}

h1 { font-size: 1.2em; margin-bottom: 0.3em; }
h2 { font-size: 1.1em; }
h3 { font-size: 1em; }
h4 { font-size: 0.9em; }
h5 { font-size: 0.8em; }
h6 { font-size: 0.7em; font-weight: 600; }

.text-center { text-align: center; }
.smallest { font-size: 0.8em; }
.smaller { font-size: 0.9em; }
.small { font-size: 0.95em; }

/* =========================================================
   3. Containers
   ========================================================= */
.container-md {
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 20px;
}
.container-xl {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Mobile container optimization */
@media (max-width: 768px) {
  .container-md,
  .container-xl {
    padding: 0 15px;
  }
}

/* =========================================================
   4. Header
   ========================================================= */
.site-header {
  width: 100%;
  margin: 2em 0;
}

/* Mobile header optimization */
@media (max-width: 768px) {
  .site-header {
    margin: 1em 0;
  }
}

.header-top {
  display: flex;
  align-items: flex-end;
}

.header-top .logo {
  flex: 0 0 153px;
  padding-right: 25px;
  margin-bottom: -7px;
}

.header-top .logo img {
  width: 125px;
  height: auto;
  position: relative;
  left: 13px;
  bottom: -37px;
}

.header-top .border_header {
  flex: 1 0 85%;
  height: 25px;
  text-align: right;
  color: #777;
  font-style: italic;
  font-size: 0.95em;
}

.binary {
  position: relative;
  left: 13px;
  bottom: -34px;
  font-size: 13px;
  color: #c5daed;
  letter-spacing: 0;
  cursor: pointer;
}

.bordo-bottom {
  margin-top: 1px;
}

/* =========================================================
   5. Layout Wrapper
   ========================================================= */
.page-layout {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.main-content {
  flex: 0 0 728px;
  margin-right: 40px;
}

.sidebar {
  flex: 1;
  position: sticky;
  top: 20px;
  align-self: flex-start;
}

.page_content {
  text-align: justify;
  margin-top: 3em;
}

/* Responsive Layout */
@media (max-width: 980px) {
  .page-layout { 
    flex-direction: column; 
    gap: 15px;
  }
  .main-content { 
    flex: 1 1 auto; 
    width: 100%; 
    margin-right: 0; 
    max-width: 100%;
  }
  .sidebar { 
    position: static; 
    width: 100%; 
  }
}


/* =========================================================
   6. Navigation
   ========================================================= */
/* ----- Desktop Menu ----- */
.desktop_menu {
  text-align: right;
  line-height: 3em;
  background: linear-gradient(to right, #ffffff 0%, #005eaf 46%, #005eaf 50%, #2B88D9 100%);
}

.desktop_menu .menu {
  list-style: none;
  margin: 0;
  display: inline-flex;
}

.desktop_menu li {
  padding: 0 40px;
  border-right: 1px solid #ffffff26;
}

.desktop_menu .menu li a {
  text-decoration: none;
  font-weight: 600;
  color: #ffffff;
  font-size: 1em;
}

.desktop_menu .menu li.active {
  background: black;
  padding: 0 40px;
  line-height: 44px;
  border: 0 !important;
}

.desktop_menu .menu li.active a {
  color: #ffffff;
}

.desktop_menu .menu li.last {
  border: 0 !important;
}

/* ----- Mobile Navigation ----- */
.mobile-nav {
  color: #fff;
  width: 100%;
  position: relative;
  z-index: 999;
  border-bottom: 3px solid #eee;
  padding-bottom: 1em;
}

.nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  margin-right: -5px;
}

button.menu-toggle.open {
  position: relative;
  right: -12px;
  bottom: 7px;
}

.menu-toggle .bar {
  width: 38px;
  height: 3px;
  background-color: #1169b4;
  border-radius: 0;
  transition: all 0.3s ease;
}

.menu-toggle.open .bar:nth-child(1) {
  transform: rotate(45deg) translateY(15px) translateX(8px);
}
.menu-toggle.open .bar:nth-child(2) {
  opacity: 0;
}
.menu-toggle.open .bar:nth-child(3) {
  transform: rotate(-45deg) translateY(-7px);
}

.mobile-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
  flex-direction: column;
}

.mobile-menu li a {
  display: block;
  padding: 0.75rem 1em;
  color: #000;
  text-decoration: none;
  transition: background 0.3s;
  font-size: 1.1rem;
  font-weight: 600;
  border-bottom: 1px solid #eee;
}

.mobile-menu li a:hover {
  background: #f5f5f5;
  color: #1169b4;
}

.mobile-menu li.active a {
  background: #1169b4;
  color: #fff;
}

.mobile-menu.open {
  display: flex;
}

@media (min-width: 769px) {
  .mobile-nav { display: none; }
}

/* =========================================================
   7. Footer
   ========================================================= */
.site-footer {
  text-align: center;
  padding: 2em 0;
  border-top: 3px solid #e3e3ef;
  font-size: 0.9em;
  margin: 4em 0 0;
}

.footer-menu ul,
.footer-submenu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-menu li {
  display: inline;
  margin: 0 20px;
}

.footer-menu a {
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 800;
  color: #777777;
}
.footer-menu a:hover {
  text-decoration: none;
}

.footer-submenu li {
  display: inline;
  margin: 0 10px;
}

.footer-submenu a {
  text-decoration: underline;
}
.footer-submenu a:hover {
  text-decoration: none;
}

.footer-copy {
  margin-top: 10px;
  color: #777;
}

/* ----- Responsive Footer ----- */
@media (max-width: 768px) {
  .site-footer { text-align: left; }
  .footer-menu li,
  .footer-submenu li {
    display: inline-block;
    margin: 5px 25px 5px 0;
  }
  .footer-copy, .disclaimer { text-align: left; }
}

/* =========================================================
   8. Donation Box
   ========================================================= */
a.paypal-donate-btn {
  display: block;
  color: #000;
  border-radius: 4px;
  text-align: center;
  height: 30px;
  line-height: 30px;
  font-size: 13px;
  background: #e3e3ef;
  font-weight: 700;
}

.paypal-donate-btn img {
  width: 70px;
  margin-left: 4px;
  vertical-align: middle;
}

.donation-box { margin-top: 5px; }

p.donation-subtext {
  font-size: 11px;
  text-align: center;
  font-style: italic;
  color: gray;
  margin-top: 0;
}

p.donation-subtext a {
    color: gray;
    border-bottom: 1px dotted;
}

/* Responsive Donation */
@media (max-width: 768px) {
  a.paypal-donate-btn {
    height: 45px;
    line-height: 45px;
    font-size: 18px;
    font-weight: 800;
  }
  .paypal-donate-btn img { width: 100px; }
  p.donation-subtext { font-size: 15px; }
}

/* =========================================================
   9. Lightbox Extras
   ========================================================= */
.fancybox__counter,
.fancybox__nav,
button.carousel__button.fancybox__button--slideshow {
  display: none;
}

.lightbox-text {
  text-align: center;
  font-size: 0.85em;
  margin-top: 0.5em;
    display: none;	
}

.lightbox-text a {
  text-decoration: none;
  color: gray !important;
  font-style: italic;
  font-weight: normal !important;
}

/* =========================================================
   10. Extras
   ========================================================= */
.t_head {
  font-weight: bold;
  text-transform: uppercase;
  font-size: 1.2em;
  margin: 3em 0 1em;
  padding-top: 1em;
  border-top: 3px solid #e3e3ef;
}

.comments_info {
  margin-top: 1em;
}
.comments_info a {
  font-weight: bold;
}

.pulsante {
    display: block;
    color: #ffffff;
    border-radius: 4px;
    text-align: center;
    height: 30px;
    line-height: 30px;
    font-size: 13px;
    background: linear-gradient(to right, #2a87d8 50%, #005eaf 100%);
    font-weight: 700;
    margin-bottom: 1em;
}


.pulsante:hover {
    color: #fff;
}

/* =========================================================
   11. Related Posts / Categories
   ========================================================= */
.subcat-list {
  margin: 25px 0 40px;
}
.subcat-list h3 {
  font-size: 1.2em;
  margin-bottom: 10px;
}
.subcat-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.subcat-list li {
  display: block;
  color: #000;
  border-radius: 4px;
  text-align: center;
  height: 30px;
  line-height: 30px;
  font-size: 13px;
  background: #e3e3ef;
  font-weight: 700;
  padding: 0 15px;
  transition: all 0.2s ease;
}

/* Mobile optimization for subcategory list */
@media (max-width: 768px) {
  .subcat-list li {
    height: 40px;
    line-height: 40px;
    font-size: 16px;
    padding: 0 20px;
    margin-bottom: 8px;
  }
  
  .subcat-list ul {
    gap: 8px;
  }
}
.subcat-list a { color: black; }

.subcat-count {
  color: #005eaf;
  font-size: 0.9em;
  margin-left: 3px;
}

.related-title {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.posts-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.post-item { text-align: center; }
.post-item .thumb img { width: 100%; height: auto; }

.post-title {
  font-size: 0.8rem;
  margin-top: 0.7rem;
}
.post-title a {
  color: #000;
  text-decoration: none;
  transition: color 0.3s ease;
}
.post-title a:hover {
  color: #0073aa;
}

/* Responsive Grid */
@media (max-width: 900px) {
  .posts-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .posts-grid-4 { grid-template-columns: 1fr; }
  .post-title { font-size: 1rem; }
}

/* Category List */
.cat-list {
  display: flex;
  flex-direction: column;
  gap: 0px;
}
.cat-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 2em;
}
.cat-thumbnail img {
  width: 200px;
  height: 120px;
  object-fit: cover;
}
.cat-content { flex: 1; }
.cat-content a { color: black; }
.cat-content h2 { margin-bottom: 5px; }

/* Mobile optimization for cat-wrapper */
@media (max-width: 768px) {
  .cat-wrapper {
    gap: 15px;
    margin-bottom: 1.5em;
  }
  
  .cat-thumbnail img {
    width: 100%;
    height: auto;
    max-height: 150px;
  }
}

.cat-title {
  margin: 0 0 5px;
}
.cat-title a {
  text-decoration: none;
  color: #000;
}
.cat-title a:hover {
  color: #0073aa;
}

.cat-meta {
  font-size: 0.9em;
}
.cat-excerpt {margin-top: 5px;text-align: justify;}

.cat-pagination {
  margin-top: 30px;
  text-align: center;
}

/* Pagination container */
.cat-pagination {
  margin-top: 30px;
  text-align: center;
}

.cat-meta a {
    color: #0866b7;
}

/* General link styles */
.cat-pagination .page-numbers {
  display: inline-block;
  margin: 0 4px;
  padding: 0 15px;
  height: 30px;
  line-height: 30px;
  font-size: 13px;
  font-weight: 700;
  color: #000;
  background: #e3e3ef;
  border-radius: 4px;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s ease;
}

/* Mobile pagination optimization */
@media (max-width: 768px) {
  .cat-pagination .page-numbers {
    height: 40px;
    line-height: 40px;
    font-size: 16px;
    padding: 0 20px;
    margin: 0 6px;
  }
  
  .cat-pagination .prev,
  .cat-pagination .next {
    height: 40px;
    line-height: 40px;
    font-size: 16px;
    padding: 0 20px;
  }
}

/* Hover effect */
.cat-pagination .page-numbers:hover {
  background: #cccce0;
}

/* Current page */
.cat-pagination .page-numbers.current {
  background: #005eaf;
  color: #fff;
}

/* Style specifically next and previous links */
.cat-pagination .prev,
.cat-pagination .next {
  display: inline-block;
  color: #000;
  background: #e3e3ef;
  border-radius: 4px;
  text-align: center;
  height: 30px;
  line-height: 30px;
  font-size: 13px;
  font-weight: 700;
  padding: 0 15px;
  transition: all 0.2s ease;
}

.cat-pagination .prev:hover,
.cat-pagination .next:hover {
  background: #cccce0;
}
/* --- Featured Grid Container --- */
.featured-grid-container {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Two columns: left (2 parts), right (1 part) */
    grid-template-rows: auto auto; /* Two rows for the right side */
    gap: 20px; /* Space between grid items */
    margin-bottom: 40px; /* Space below the entire featured grid */
}

/* 1. Big Post on the Left */
.featured-grid-container .featured-main {
    grid-column: 1 / 2; /* Spans the first column */
    grid-row: 1 / 3;    /* Spans both rows */
    height: 400px; /* Set a fixed height or min-height for the main post */
}

/* 2. Two Stacked Posts on the Right */
.featured-grid-container .featured-side {
    height: 190px; /* Set a fixed height for each side post (adjust as needed) */
    /* Accounts for gap: (400px - 20px gap) / 2 = 190px */
}

/* Specific styling for the link acting as the background container */
.featured-post-link {
    display: block; /* Make the anchor fill its parent */
    width: 100%;
    height: 100%;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    position: relative; /* For positioning the overlay */
    overflow: hidden; /* Hide any overflow */
    text-decoration: none; /* Remove underline from link */
    color: inherit; /* Inherit color, or set a default */
}

/* Overlay for Title and Date */
.featured-content-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgb(0 0 0 / 120%) 0%, rgba(0, 0, 0, 0) 100%); /* Fading dark overlay */
    color: #fff; /* White text for contrast */
    text-align: left;
}

.featured-content-overlay h2 {
    font-size: 1.6em; /* Adjust font size for main title */
    margin: 0 0 5px 0;
    line-height: 1.2;
    color: #fff; /* Ensure title is white */
}

.featured-grid-container .featured-side .featured-content-overlay h2 {
    font-size: 1em; /* Smaller font for side post titles */
}

.featured-content-overlay .featured-meta {
    font-size: 0.9em;
}

/* Ensure the .cat-wrapper inside featured posts doesn't interfere */
.featured-grid-container .cat-wrapper {
    height: 100%; /* Make wrapper fill the article */
}


/* --- General .cat-item adjustments --- */
/* You might need to reset some default styles that apply to .cat-item for the featured ones */
.featured-grid-container .cat-item {
    padding: 0; /* Remove default padding if any */
    border: none; /* Remove default borders */
    background: none; /* Remove default background */
}


/* --- Remaining Posts (List Style) --- */
/* These posts will maintain your original list layout */
.cat-list article:nth-child(n+4) {
    display: flex; /* Assuming your list items are flex */
    /* Add any other default list item styles here if they were overridden */
     /* Example spacing */
     /* Example separator */
}

/* Media Queries for responsiveness */
@media (max-width: 768px) {
    .featured-grid-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 15px;
        margin-bottom: 30px;
    }
    .featured-grid-container .featured-main,
    .featured-grid-container .featured-side {
        grid-column: 1 / -1;
        grid-row: auto;
        height: 200px;
    }
    
    .featured-content-overlay {
        padding: 12px;
    }
    
    .featured-content-overlay h2 {
        font-size: 1.1em;
        line-height: 1.3;
    }
    
    .featured-grid-container .featured-side .featured-content-overlay h2 {
        font-size: 1em;
    }
}

/* =========================================================
   12. Responsive Helpers & Performance
   ========================================================= */
.mobile-only { display: none; }
.desktop-only { display: block; }

/* Improve animation performance */
* {
  box-sizing: border-box;
}

.menu-toggle,
.mobile-menu,
.subcat-list li,
.cat-pagination .page-numbers {
  will-change: transform;
}

@media (max-width: 768px) {
  .mobile-only { display: block; }
  .desktop-only { display: none; }

  /* Increase base font size for mobile */
  body { 
    font-size: 18px;
    /* Optimize mobile rendering */
    text-rendering: optimizeSpeed;
  }
  h1 { font-size: 1.4em; }
  h2 { font-size: 1.25em; }
  h3 { font-size: 1.1em; }
  h4 { font-size: 1em; }
  h5 { font-size: 0.95em; }
  h6 { font-size: 0.9em; }
  
  /* Improve touch targets */
  a, button, input, select, textarea {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Mobile styles for .cat-list */
@media only screen and (max-width: 768px) {
  
  .cat-list {
    display: flex;
    flex-direction: column;
    gap: 0px;
  }

  .cat-item {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
  }

  .cat-wrapper {
    display: flex;
    flex-direction: column;
  }

  .cat-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    min-width: 450px;
  }

  .cat-content {
    padding: 10px 0;
  }

  .cat-content h2 {
    font-size: 1.2rem;
    margin: 0 0 8px 0;
  }

  .cat-meta {
    font-size: 0.8rem;
    margin-bottom: -15px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }

  .cat-meta img {
    width: 16px;
    height: 16px;
    vertical-align: middle;
  }

  .cat-excerpt {
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: justify;
  }
}
nav.breadcrumb {
    font-size: .80em;
    margin-bottom: 2em;
    color: #777;
}

.addtoany_shortcode {
    text-align: center;
    margin-bottom: .5em;
}

/* =========================================================
   Mobile Navigation
   ========================================================= */

/* Hide mobile navigation by default */
.mobile-only {
    display: none;
}

/* Show mobile navigation on small screens */
@media (max-width: 768px) {
    .desktop-only {
        display: none;
    }
    
    .mobile-only {
        display: block;
    }
    
    body {
        padding-top: 60px;
    }
}

/* Mobile Header */
.mobile-header {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 60px;
}

.mobile-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

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

/* Hamburger Menu Button */
.mobile-menu-toggle {
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 40px;
    height: 40px;
    border-radius: 3px;
}

.mobile-menu-toggle:hover {
    background-color: rgba(0, 94, 175, 0.1);
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 3px 0;
    display: block;
    transition: background-color 0.3s ease;
}

.mobile-menu-toggle:hover span {
    background-color: #005eaf;
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 999;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-menu-list li {
    border-bottom: 1px solid #eee;
}

.mobile-menu-list li:last-child {
    border-bottom: none;
}

.mobile-menu-list a {
    display: block;
    padding: 15px 20px;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s ease;
}

.mobile-menu-list a:hover {
    background: #f5f5f5;
    color: #005eaf;
}