.pm-loop-wrapper {
    padding: 0;
}

.pm-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.pm-filter {
    border: 0;
    border-radius: 999px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.45);
    color: #1f1f1a;
    font-size: 13px;
    cursor: pointer;
}

.pm-filter.is-active {
    background: #1f1f1a;
    color: #fff;
}

/* Underline filter style */
.pm-filters-underline {
    gap: 0;
    border-bottom: none;
    padding-bottom: 0;
    color: #522008 !important;
}

.pm-filters-underline .pm-filter {
    border-radius: 0;
    background: transparent;
    padding: 8px 16px;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    font-size: 30px;
    color: #522008 !important;
}

.pm-filters-underline .pm-filter.is-active {
    background: transparent;
    color: inherit;
    border-bottom-color: #522008;
    font-weight: 700;
}

.pm-filters-underline .pm-filter-label {
    margin-right: 12px;
    padding: 8px 0;
    font-size: 20px;
    font-weight: 400;
    opacity: 0.7;
}

.pm-grid,
.pm-grid-masonry {
    column-count: 3;
    column-gap: 30px;
}

.pm-card {
    break-inside: avoid;
    display: inline-block;
    width: 100%;
    margin: 0 0 14px;
    background: transparent;
    color: inherit;
}

.pm-grid-regular {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    column-count: auto;
}

.pm-grid-regular .pm-card {
    display: flex;
    flex-direction: column;
    break-inside: auto;
    margin: 0;
}

.pm-grid-regular .pm-card-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.pm-grid-regular .pm-card-excerpt {
    flex: 1 1 auto;
}

.pm-card-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Regular grid: uniform image tiles (crop with object-fit; matches typical card grids). */
.pm-grid-regular .pm-card-image {
    display: block;
    overflow: hidden;
    aspect-ratio: 4 / 3;
}

.pm-grid-regular .pm-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.pm-card-content {
    padding: 25px 25px 26px;
    background-color: rgba(255, 255, 255, 0.3);
}

.pm-card-title {
    margin: 0 0 8px;
    line-height: 1.25;
    font-size: inherit;
    font-weight: inherit;
}

.pm-card-title a {
    color: inherit;
    text-decoration: none;
}

.pm-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-bottom: 8px;
    font-size: inherit;
    font-weight: inherit;
}

.pm-card-meta .pm-meta-item a {
    color: inherit;
    text-decoration: none;
}

/*
 * Excerpt text does not set font-size here. Without Design-tab / Divi rules, size is inherited
 * from the theme (often the root 16px browser default), which is why DevTools “Computed” can
 * show 16px even when no rule on .pm-card-excerpt lists font-size.
 */
.pm-card-excerpt p {
    margin: 0 0 8px;
}

.pm-card-programme-details {
    padding-bottom: 10px;
}

.pm-card-custom-fields {
    font-weight: bold;
}

.pm-card-custom-fields ul {
    margin: 4px 0 0;
    padding-left: 16px;
    font-size: inherit;
    font-family: inherit;
}

/* Shortcode output (e.g. Divi Text): match parent module typography */
.pm-shortcode-custom-fields {
    margin: 0.5em 0;
    font-size: inherit;
    font-family: inherit;
}

.pm-shortcode-custom-fields ul {
    margin: 4px 0 0;
    padding-left: 16px;
    font-size: inherit;
    font-family: inherit;
}

.pm-shortcode-custom-fields li {
    font-size: inherit;
    font-family: inherit;
}

/* Lift above overlapping builder row/section layers; plugin does not set a body background color. */
.pm-shortcode-post-content {
    margin: 0.5em 0;
    font-size: inherit;
    font-family: inherit;
    position: relative;
    z-index: 2;
    isolation: isolate;
    background-color: transparent;
}

.pm-programme-details {
    margin: 8px 0 0;
    font-size: inherit;
    font-family: inherit;
    line-height: 1.45;
}

.pm-programme-details .pm-programme-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-bottom: 4px;
}

.pm-programme-details .pm-programme-row:last-child {
    margin-bottom: 0;
}

.pm-programme-details .pm-programme-label {
    font-weight: 700;
    flex: 0 0 auto;
}

.pm-programme-details .pm-programme-value {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: bold;
}

.pm-read-more {
    display: inline-block;
    margin-top: 8px;
    padding: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font-size: inherit;
    font-weight: bold;
    text-decoration: underline;
}

.pm-pagination {
    margin-top: 20px;
}

.pm-pagination ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pm-pagination a,
.pm-pagination span {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.35);
    color: #202015;
    text-decoration: none;
}

.pm-pagination .current {
    background: #202015;
    color: #fff;
}

/* 50/50 layout: one card per row, image left / content right. */
.pm-grid-5050 {
    display: flex;
    flex-direction: column;
    gap: 40px;
    column-count: auto;
}

.pm-grid-5050 .pm-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    break-inside: auto;
    margin: 0;
    padding-top: 40px;
    border-top: 1px solid #522008;
}

.pm-grid-5050 .pm-card:first-child {
    border-top: 1px solid #522008;
}

.pm-filters + .pm-grid-5050 .pm-card:first-child {
    padding-top: 0;
}

.pm-grid-5050 .pm-card-image {
    display: block;
    overflow: hidden;
}

.pm-grid-5050 .pm-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.pm-grid-5050 .pm-card-content {
    display: flex;
    flex-direction: column;
    padding: 0 40px;
}

.pm-grid-5050 .pm-card-excerpt {
    flex: 1 1 auto;
}

/* 60/40 layout: content left / image right. */
.pm-grid-6040 {
    display: flex;
    flex-direction: column;
    gap: 40px;
    column-count: auto;
}

.pm-grid-6040 .pm-card {
    display: grid;
    grid-template-columns: 3fr 2fr;
    break-inside: auto;
    margin: 0;
    padding-top: 40px;
    border-top: 1px solid #522008;
}

.pm-grid-6040 .pm-card:first-child {
    border-top: 1px solid #522008;
}

.pm-filters + .pm-grid-6040 .pm-card:first-child {
    padding-top: 0;
}

.pm-grid-6040 .pm-card-content {
    display: flex;
    flex-direction: column;
    padding: 0 40px 0 0;
    order: -1;
}

.pm-grid-6040 .pm-card-image {
    display: block;
    overflow: hidden;
}

.pm-grid-6040 .pm-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.pm-grid-6040 .pm-card-excerpt {
    flex: 1 1 auto;
}

@media (max-width: 980px) {
    .pm-grid,
    .pm-grid-masonry {
        column-count: 2;
    }

    .pm-grid-regular {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .pm-grid,
    .pm-grid-masonry {
        column-count: 1;
    }

    .pm-grid-regular {
        grid-template-columns: minmax(0, 1fr);
    }

    .pm-grid-5050 .pm-card {
        grid-template-columns: 1fr;
    }

    .pm-grid-6040 .pm-card {
        grid-template-columns: 1fr;
    }

    .pm-grid-6040 .pm-card-content {
        padding: 0;
        order: 0;
    }
}

/* Divi Visual Builder: loop configuration summary (module edit view) */
.pm-divi-loop-config {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.02);
    font-size: 12px;
    line-height: 1.45;
    text-align: left;
}

.pm-divi-loop-config-title {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: inherit;
}

.pm-divi-loop-config-section {
    margin-bottom: 12px;
}

.pm-divi-loop-config-section:last-child {
    margin-bottom: 0;
}

.pm-divi-loop-config-section-title {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 600;
    color: inherit;
    opacity: 0.85;
}

.pm-divi-loop-config-dl {
    margin: 0;
    display: grid;
    grid-template-columns: minmax(0, 38%) minmax(0, 62%);
    gap: 4px 10px;
}

.pm-divi-loop-config-dl dt {
    margin: 0;
    font-weight: 600;
    opacity: 0.9;
}

.pm-divi-loop-config-dl dd {
    margin: 0;
}

.pm-divi-loop-config-edit {
    margin: 10px 0 0;
    font-size: 12px;
}

.pm-divi-loop-config-edit a {
    text-decoration: underline;
}

/* [pm_menu] shortcode */
.pm-menu-shortcode {
    margin: 0;
    padding: 0;
}

.pm-menu-list,
.pm-menu-list li {
    list-style: none !important;
    list-style-type: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.pm-menu-list {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
}

@media (max-width: 767px) {
    .pm-menu-list {
        justify-content: center;
    }
}

.pm-menu-list li {
    font-size: inherit;
    font-family: inherit;
    color: inherit;
}

.pm-menu-list li::before,
.pm-menu-list li::after,
.pm-menu-list li::marker {
    content: none !important;
    display: none !important;
}

.pm-menu-list li:last-child {
    font-weight: bold;
}

.pm-menu-list li a {
    text-decoration: none;
    color: inherit;
    font-size: inherit;
    font-family: inherit;
}
