.slmg-wrapper {
    --slmg-gap: 30px;
    --slmg-primary-color: #333;
    --slmg-secondary-color: #666;
    --slmg-accent-color: #00a99d;
    /* Teal color from your example */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    text-align: center;
}

.slmg-wrapper .slmg-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--slmg-gap);
    text-align: left;
}

.slmg-wrapper .slmg-grid-item {
    display: flex;
    flex-direction: column;
}

/* Image Styles & Hover Effect */
.slmg-wrapper .slmg-item-image-link {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 0px;
    margin-bottom: 15px;
    aspect-ratio: 4 / 3;
}

.slmg-wrapper .slmg-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Teal overlay effect on hover */
.slmg-wrapper .slmg-item-image-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: var(--slmg-accent-color);
    opacity: 0;
    z-index: 1;
    transition: opacity 0.3s ease-in-out;
}

.slmg-wrapper .slmg-grid-item:hover .slmg-item-image-link::before {
    opacity: 0.25;
}

.slmg-wrapper .slmg-grid-item:hover .slmg-item-image {
    transform: scale(1.05);
}

/* Content Styles */
.slmg-wrapper .slmg-item-content {
    padding: 0 5px;
    /* Optional padding for text */
}

.slmg-wrapper .slmg-item-meta {
    display: inline-block;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--e-global-color-text);
}

.slmg-wrapper .slmg-author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
}

.slmg-wrapper .slmg-item-title {
    font-size: 17px;
    line-height: 1.3em;
    color: var(--e-global-color-secondary);
    margin: 0;
}

.slmg-wrapper .slmg-item-title a {
    text-decoration: none;
    font-size: 17px;
    line-height: 1.3em;
    color: var(--e-global-color-secondary);
    transition: color 0.2s ease;
}

.slmg-wrapper .slmg-grid-item:hover .slmg-item-title a {
    color: var(--e-global-color-e20fe0f);
    text-decoration: none !important;
}

/* Core logic for the "load more" effect. Hidden rows are animated into view. */
.slmg-wrapper .slmg-row.slmg-is-hidden {
    visibility: hidden;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    margin-top: 0;
    transition: max-height 0.7s ease-in-out, opacity 0.5s ease-in, margin-top 0.7s ease-in-out, visibility 0s 0.7s;
}

.slmg-wrapper .slmg-row {
    visibility: visible;
    opacity: 1;
    /* Large arbitrary value */
    margin-top: var(--slmg-gap);
    transition: max-height 0.7s ease-in-out, opacity 0.5s ease-in 0.2s, margin-top 0.7s ease-in-out, visibility 0s;
}

.slmg-wrapper .slmg-row:first-child {
    margin-top: 0;
}

.slmg-wrapper .slmg-controls {
    margin-top: calc(var(--slmg-gap) * 1.5);
}

.slmg-wrapper .slmg-button,
.slmg-wrapper .slmg-blog-link {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.slmg-wrapper .slmg-button {
    display: inline-block;
    padding: 2px 25px 2px 25px;
    border: 1px solid var(--e-global-color-secondary);
    background-color: var(--e-global-color-secondary);
    border-radius: 50px 50px 50px 50px;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.slmg-wrapper .slmg-blog-link {
    display: inline-block;
    padding: 2px 25px 2px 25px;
    border: 1px solid var(--e-global-color-secondary);
    background-color: var(--e-global-color-secondary);
    border-radius: 50px 50px 50px 50px;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    transition: background-color 0.2s ease, color 0.2s ease;
}


.slmg-wrapper .slmg-is-hidden {
    display: none !important;
}

/* --- SLMG General Wrapper --- */
.slmg-wrapper {
    font-family: sans-serif;
    color: #333;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* --- Tab Navigation --- */
.slmg-tabs-nav {
    margin-bottom: 6rem;
    overflow-x: auto;
    /* For mobile */
    -webkit-overflow-scrolling: touch;
}

.slmg-tabs-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 0.5rem 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.slmg-tab-item {
    margin: 0;
}

.slmg-tab-link {
    display: block;
    padding: 10px 0;
    text-decoration: none;
    position: relative; 
    border-bottom: 3px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
    font-family: var(--thegem-to-tabs-title-thin-font-family);
    font-style: var(--thegem-to-tabs-title-thin-font-style);
    font-weight: var(--thegem-to-tabs-title-thin-font-weight);
    text-transform: var(--thegem-to-tabs-title-thin-text-transform);
    font-size: var(--thegem-to-tabs-title-thin-font-size);
    line-height: var(--thegem-to-tabs-title-thin-line-height);
    letter-spacing: var(--thegem-to-tabs-title-thin-letter-spacing);
    color: var(--thegem-to-h6-color);
}

.slmg-tab-link::after {
    content: '';
    position: absolute; 
    left: 50%;  
    bottom: -2px; 
    transform: translateX(-50%);  
    width: 0; 
    height: 3px;  
    background-color: var(--thegem-to-h6-color); 
    transition: width 0.3s ease-in-out; 
}


.slmg-tab-link:hover::after {
    width: 100%; 
}


.slmg-tab-link:hover {
    color: #000;
}

.slmg-tab-link.is-active {

    border-bottom-color: var(--thegem-to-h6-color);
    font-family: var(--thegem-to-tabs-title-font-family);
    font-style: var(--thegem-to-tabs-title-font-style);
    font-weight: var(--thegem-to-tabs-title-font-weight);
    text-transform: var(--thegem-to-tabs-title-text-transform);
    font-size: var(--thegem-to-tabs-title-font-size);
    line-height: var(--thegem-to-tabs-title-line-height);
    letter-spacing: 0;
    color: var(--thegem-to-h6-color);
}

/* --- Tab Content --- */
.slmg-tab-pane {
    display: none;
    /* Hide panes by default */
}

.slmg-tab-pane.is-active {
    display: block;
    /* Show active pane */
}

/* --- Grid & Item Styling (largely from original) --- */
.slmg-row {
    margin-bottom: 2rem;
}

.slmg-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.slmg-grid-item {
    display: flex;
    flex-direction: column;
}

.slmg-item-image-link {
    display: block;
    margin-bottom: 1rem;
    aspect-ratio: 4 / 3;
}

.slmg-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0px;
}

.slmg-item-meta {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.slmg-author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-right: 8px;
}

.slmg-separator {
    margin: 0 0.5em;
}

.slmg-item-title {
    font-size: 1.25rem;
    line-height: 1.4;
    margin: 0;
}

.slmg-item-title a {
    text-decoration: none;
    color: #005a87;
    /* Example title color */
}

.slmg-item-title a:hover {
    text-decoration: underline;
}

/* --- Controls & Buttons --- */
.slmg-controls {
    text-align: center;
    margin-top: 2rem;
}

.slmg-button,
.slmg-blog-link {
    display: inline-block;
    padding: 10px 20px 10px 20px;
    border: 1px solid var(--e-global-color-secondary);
    background-color: var(--e-global-color-secondary);
    border-radius: 50px 50px 50px 50px;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.slmg-button:hover,
.slmg-blog-link:hover {
    background-color: #005a87;
    border-color: #005a87;
}

/* --- Utility Classes --- */
.slmg-is-hidden {
    display: none;
}

/* --- Responsive Adjustments --- */
@media (max-width: 992px) {
    .slmg-grid {
        grid-template-columns: repeat(2, 1fr);
    }

	.slmg-wrapper{
		padding-left: 10px;
		padding-right: 10px;
	}
}

@media (max-width: 768px) {
    .slmg-grid {
        grid-template-columns: 1fr;
    }

    .slmg-tabs-list {
        gap: 0.5rem 1.5rem;
    }

	.slmg-tabs-list a{
		padding: 0;
	}
}

@media (max-width: 768px) {
    .slmg-wrapper .slmg-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .slmg-wrapper{
		padding-left: 0px;
		padding-right: 0px;
	}
}

@media (max-width: 480px) {
    .slmg-wrapper .slmg-grid {
        grid-template-columns: 1fr;
    }
    .slmg-wrapper{
		padding-left: 0px;
		padding-right: 0px;
	}
}

/*
 * SLMG Responsive Grid Adjustments 
 * -------------------------------------------------- */

/* 
 * Tablet View: 768px and below
 * - Sets the grid to 2 columns.
 * - Hides the 3rd item in each row to create a clean 2-item row.
 */
@media (max-width: 768px) {
  .slmg-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* In each grid, simply hide the 3rd item. */
  .slmg-grid .slmg-grid-item:nth-child(3) {
    display: none;
  }
}


/* 
 * Mobile View: 480px and below
 * - Switches the grid to a single column.
 * - IMPORTANT: Shows the 3rd item again so all 3 stack vertically.
 * - Manages the "Show All" controls for a mobile experience.
 */
@media (max-width: 480px) {
  .slmg-grid {
    grid-template-columns: 1fr;
  }

 
  .slmg-grid .slmg-grid-item:nth-child(3) {
    display: block; /* 'block' will work perfectly here. */
  }

  
  #show-all .slmg-controls .slmg-load-more-btn {
    display: none;
  }

  #show-all .slmg-controls .slmg-blog-link {
    display: inline-block !important;
  }
}