/* Publications page grid — replaces Bootstrap col-md-3 col-sm-6 */

/* ── Sort bar ── */
.pub-sort-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 32px;
    margin-bottom: 20px;
    padding: 0 4px;
}

/* <label> element — WCAG 1.3.1 / 4.1.2: programmatically associated with the select */
.pub-sort-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #111;
    cursor: default;
}

/* Wrapper needed so the custom SVG arrow overlays the select */
.pub-sort-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Custom chevron arrow — positioned via wrapper so it never gets clipped */
.pub-sort-wrapper::after {
    content: '';
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 6px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23111111' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
}

.pub-sort-select {
    /* Reset browser default arrow */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* Sizing — min 44px height meets WCAG 2.5.5 touch target */
    min-height: 44px;
    padding: 0 40px 0 14px;

    /* Typography matching site style */
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #111;

    /* Border — 1.5px on white gives >7:1 contrast (WCAG 1.4.3 AAA) */
    background-color: #fff;
    border: 1.5px solid #111;
    border-radius: 0;

    cursor: pointer;
    transition: background-color 0.15s ease;
}

.pub-sort-select:hover {
    background-color: #f2f2f2;
}

/* WCAG 2.4.7 Focus Visible — 3px offset outline, high contrast */
.pub-sort-select:focus-visible {
    outline: 3px solid #111;
    outline-offset: 3px;
}

/* Fallback for browsers without :focus-visible */
.pub-sort-select:focus {
    outline: 3px solid #111;
    outline-offset: 3px;
}

/* ── Grid container ── */
.pub-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    width: 100%;
    margin: 0 0 40px 0 !important;
}

/* ── Grid item ── */
.pub-item {
    box-sizing: border-box;
}

/* Override the global .prt-item3 margin inside this grid */
.pub-grid .prt-item3 {
    margin: 12px;
}

/* Fixed-height image frame — all thumbnails uniform */
.pub-grid .prt-item3 a {
    display: block;
    width: 100%;
    /* height: 410px; */
    overflow: hidden;
}

.pub-grid .prt-item3 a img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

/* ── Responsive ── */
@media (max-width: 1199px) {
    .pub-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .pub-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pub-grid .prt-item3 {
        margin: 8px;
    }

    .pub-grid .prt-item3 a {
        height: 220px;
    }
}

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

    .pub-sort-bar,
    .pub-grid {
        padding-left: 5%;
        padding-right: 5%;
    }
}
