.ast-container {
  max-width: 1240px !important;
}
/* --- Responsive Grid for Archive --- */
.techmaher-ie-grid-container {
  display: grid;
  grid-template-columns: repeat(1, 1fr); /* 1 column on mobile */
  gap: 20px;
}

/* Medium screens: 2 columns */
@media (min-width: 600px) {
  .techmaher-ie-grid-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Large screens: 3 columns */
@media (min-width: 900px) {
  .techmaher-ie-grid-container {
    grid-template-columns: repeat(4, 1fr);
  }
}

.ie-grid-item {
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}
.ie-grid-item a {
  text-decoration: none;
  color: inherit;
}
.ie-grid-item .techmaher-ie-item-image img {
  width: 100%;
  height: auto;
  display: block;
}
.ie-grid-item .techmaher-ie-item-content {
  padding: 15px;
}
.ie-grid-item .techmaher-ie-item-title {
  margin-top: 0;
  font-size: 1.25rem;
}

/* --- Single Ingredient Page --- */
.ie-single-ingredient .techmaher-ie-basic-info {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 30px;
}
.ie-single-ingredient .techmaher-ie-image {
  flex: 1;
  min-width: 250px;
}
.ie-single-ingredient .techmaher-ie-meta-summary {
  flex: 2;
  min-width: 300px;
}
.ie-single-ingredient .techmaher-ie-meta-summary p {
  margin-bottom: 10px;
}

/* --- Tabs --- */
.techmaher-ie-tab-nav {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
  border-bottom: 2px solid #ddd;
}
.techmaher-ie-tab-nav li a {
  display: block;
  padding: 10px 20px;
  text-decoration: none;
  color: #555;
  font-weight: bold;
  border: 1px solid transparent;
  border-bottom: none;
}
.techmaher-ie-tab-nav li a.active {
  background: #fff;
  border-color: #ddd;
  border-bottom: 2px solid #fff;
  position: relative;
  top: 2px;
}
.techmaher-ie-tab-pane {
  display: none; /* Hide all panes by default */
}
.techmaher-ie-tab-pane.active {
  display: block; /* Show active pane */
}
/* --- Archive Page Filters --- */
.techmaher-ie-filters {
  background: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  border: 1px solid #eee;
}

.techmaher-ie-filters-form {
  /* Use Flexbox for a responsive horizontal layout */
  display: flex;
  flex-wrap: wrap; /* Allows filters to stack on small screens */
  gap: 15px;
  align-items: flex-end; /* Aligns items to the bottom */
}

.techmaher-ie-filter-group {
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Each group will try to take equal space */
}

.techmaher-ie-filter-group.techmaher-ie-filter-search {
  flex-basis: 250px; /* Give the search bar more base width */
}

.techmaher-ie-filter-group.techmaher-ie-filter-dropdown {
  flex-basis: 150px; /* Give dropdowns a base width */
}

.techmaher-ie-filter-group.techmaher-ie-filter-submit {
  flex-grow: 0; /* Don't grow */
  flex-basis: auto; /* Size based on content */
  flex-direction: row; /* Align buttons side-by-side */
  gap: 10px;
}

.techmaher-ie-filter-group label {
  font-size: 0.875rem;
  font-weight: bold;
  margin-bottom: 5px;
  color: #555;
}

.techmaher-ie-filters-form input[type="search"],
.techmaher-ie-filters-form select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  background: #fff;
  box-sizing: border-box; /* Important for padding */
}

/* Style the buttons */
.techmaher-ie-filter-button {
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: bold;
  color: #fff;
  background-color: #0073e6; /* A nice blue, change to your site's color */
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.techmaher-ie-filter-button:hover {
  background-color: #005aaa;
}

.techmaher-ie-filter-reset {
  display: inline-block;
  padding: 10px 15px;
  font-size: 1rem;
  color: #555;
  background-color: #eee;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-decoration: none;
  line-height: 1.5; /* Align height with button */
  box-sizing: border-box;
  transition: background-color 0.2s;
}

.techmaher-ie-filter-reset:hover {
  background-color: #ddd;
}
/**/
article.ingredient {
  padding: 1em 1em !important;
  width: 100% !important;
}


article.ingredient.ast-article-single {
  padding: 1em 1em !important;
  width: 70% !important;
}

div.ie-single-ingredient {
  margin: 2em 0 !important;
}
.page-title {
  font-family: "Outfit", sans-serif;
  font-size: 2.5rem;
  font-weight: 600;
  color: #1c0d0a;
  margin: 0;
  text-align: center !important;
}
.techmaher-ie-page-header {
  margin-bottom: 30px;
  border-bottom: 1px solid #e0e0e0;
  padding-bottom: 20px;
}
.techmaher-ie-pagination-wrapper {
  text-align: center;
  margin: 10px 0;
}
.techmaher-ie-pagination-wrapper .pagination {
  display: inline-block;
  text-align: center;
}
.techmaher-ie-pagination-wrapper .page-numbers.current {
  background: #ff6210;
  border-color: #ff6210;
  color: #fff;
}
.techmaher-ie-pagination-wrapper .page-numbers {
  display: inline-block;
  padding: 8px 15px;
  margin: 0 3px;
  border: 1px solid var(--mrp-border-color);
  border-radius: 5px;
  font-family: var(--mrp-font-body);
  font-weight: 600;
  color: var(--mrp-body);
  text-decoration: none;
  transition: all 0.2s ease;
}
.techmaher-ie-sidebar{
  width: 25%!important;
  background: #f1f1f1;
}
.techmaher-ie-sidebar h2{
  font-size: 24px;
  padding: 20px 10px 0;
  text-align: center;
}
@media only screen and (max-width: 768px) {
    .ie-single-ingredient #main{flex-direction: column;}
    .techmaher-ie-sidebar{width: 100%!important;}
    .ie-single-ingredient article.ingredient{width: 100%!important;}
    article.ingredient{width: 100% !important;}
}
/* --- Responsive Tabs (Mobile) --- */
@media (max-width: 768px) {
    .techmaher-ie-tab-nav {
        flex-direction: column; /* This is the key: it stacks the tabs */
        border-bottom: none; /* Remove the horizontal line, as it's not needed */
    }

    .techmaher-ie-tab-nav li {
        width: 100%;
    }

    .techmaher-ie-tab-nav li a {
        border: 1px solid #ddd;
        border-bottom: none; /* We'll add a border to the last item instead */
        margin-bottom: 0;
        text-align: center; /* Looks better centered on mobile */
    }
    
    .techmaher-ie-tab-nav li:last-child a {
         border-bottom: 1px solid #ddd; /* Add the bottom border to the last tab */
    }

    /* Adjust the 'active' style for this new vertical layout */
    .techmaher-ie-tab-nav li a.active {
        background: #f0f0f0; /* A simple background is better than the border trick */
        border-bottom-color: #ddd; /* Reset the active border */
        top: 0; /* Reset the position trick */
    }
}