/* === WP AUTOP JAVÍTÁS (Megakadályozza, hogy a <br> vagy <p> tagek szétverjék a Grid-et) === */
.mtm-pm-gallery-wrapper > br,
.mtm-pm-gallery-wrapper > p {
    display: none !important;
}

/* === ALAP KONTÉNER === */
.mtm-pm-gallery-wrapper {
    display: grid;
    gap: 10px;
    margin: 30px 0;
    grid-template-columns: repeat(2, 1fr);
}



/* Szigorított szabályok, hogy a theme CSS ne bírja felülírni */
.mtm-pm-gallery-item {
    display: block !important;
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    margin: 0 !important;
    padding: 0 !important;
    text-decoration: none !important;
}

.mtm-pm-hidden-item {
    display: none !important; /* Erőszakos rejtés, hogy véletlenül se vegyen fel helyet a Grid-ben */
}

/* Alap konténer */
.mtm-pm-gallery-wrapper {
    display: grid;
    gap: 10px;
    margin: 30px 0;
    /* Alapértelmezés mobilon: 2 oszlop */
    grid-template-columns: repeat(2, 1fr);
}

.mtm-pm-gallery-item {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.mtm-pm-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    transition: transform 0.3s ease;
    display: block;
}

/* Hover effektus csak ha link (lightbox) */
a.mtm-pm-gallery-item:hover img {
    transform: scale(1.05);
}

/* === KÉPARÁNYOK (Aspect Ratio) === */
.mtm-pm-ratio-4-3 .mtm-pm-gallery-item { aspect-ratio: 4 / 3; }
.mtm-pm-ratio-16-9 .mtm-pm-gallery-item { aspect-ratio: 16 / 9; }
.mtm-pm-ratio-1-1 .mtm-pm-gallery-item { aspect-ratio: 1 / 1; }
/* Eredeti méret esetén eltüntetjük az aspect ratiot és a képek megtartják eredeti arányukat */
.mtm-pm-ratio-auto .mtm-pm-gallery-item {
    aspect-ratio: auto; 
}
.mtm-pm-ratio-auto .mtm-pm-gallery-item img {
    object-fit: contain; /* vagy auto, ízlés kérdése */
    height: auto;
}

/* === OSZLOPOK SZABÁLYOZÁSA === */

/* Tablet (Fix 3 oszlop) */
@media (min-width: 768px) {
    .mtm-pm-gallery-wrapper {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

/* Desktop (Dinamikus oszlopszám) */
@media (min-width: 1024px) {
    .mtm-pm-gallery-wrapper { gap: 20px; }
    
    .mtm-pm-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .mtm-pm-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .mtm-pm-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .mtm-pm-cols-5 { grid-template-columns: repeat(5, 1fr); }
}

/* === TOVÁBBI KÉPEK GOMBOK === */
.mtm-pm-gallery-actions {
    text-align: center;
    margin-top: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.mtm-pm-more-text {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #495057;
}

.mtm-pm-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.mtm-pm-btn {
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 50px; /* Fancy pirula forma */
    cursor: pointer;
    transition: all 0.3s ease;
}

.mtm-pm-btn-primary {
    background: #0d6efd;
    color: #fff;
    box-shadow: 0 4px 6px rgba(13, 110, 253, 0.2);
}

.mtm-pm-btn-primary:hover {
    background: #0b5ed7;
    transform: translateY(-2px);
    box-shadow: 0 6px 10px rgba(13, 110, 253, 0.3);
}

.mtm-pm-btn-secondary {
    background: #e9ecef;
    color: #212529;
}

.mtm-pm-btn-secondary:hover {
    background: #dee2e6;
    transform: translateY(-2px);
}