/* Screen Reader Visually Hidden Helper (WCAG) */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

/* Outer Container Wrapper */
.pm-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 0;
    box-sizing: border-box;
}

/* Accessible Search Field */
.pm-search-container {
    margin-bottom: 30px;
    width: 100%;
}

#pm-search-input {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
    color: #333333;
    background-color: #ffffff;
    border: 2px solid #cccccc;
    border-radius: 30px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#pm-search-input:focus-visible {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.25);
}

/* Grid Layout - Enforces Equal Row Heights */
.pm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
    margin-bottom: 35px;
    align-items: stretch;
}

/* Individual Card Structure */
.pm-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pm-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

/* Fixed-Height Image Container */
.pm-image-wrapper {
    width: 100%;
    height: 220px;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #f0f0f0;
    padding: 10px;
    box-sizing: border-box;
}

.pm-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.pm-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #888888;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Card Information Body */
.pm-details {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.pm-name {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #222222;
    line-height: 1.3;
}

/* 50-Year Member Distinction Badge */
.pm-badge-50yr {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    background-color: #fffdf0;
    color: #8a6d3b;
    border: 1px solid #e0cf87;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.pm-years-container {
    font-size: 0.95rem;
    color: #444444;
    margin-bottom: 6px;
}

.pm-years-text {
    font-weight: 600;
    color: #0073aa;
}

/* Military Service Details */
.pm-military-info {
    font-size: 0.85rem;
    color: #444444;
    margin: 0 0 6px 0;
    line-height: 1.4;
}

.pm-military-info strong {
    color: #222222;
}

.pm-dates {
    margin: 0 0 12px 0;
    color: #666666;
    font-size: 0.85rem;
}

/* Biography & View More Button */
.pm-bio-wrapper {
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
    margin-top: auto;
}

.pm-bio {
    margin: 0 0 6px 0;
    font-size: 0.9rem;
    color: #555555;
    line-height: 1.5;
}

.pm-toggle-bio {
    background: none;
    border: none;
    color: #0073aa;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
}

.pm-toggle-bio:hover {
    color: #005177;
}

.pm-toggle-bio:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Pagination Control Buttons */
.pm-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.pm-pagination button {
    background-color: #ffffff;
    border: 1px solid #cccccc;
    color: #333333;
    padding: 8px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.pm-pagination button:hover:not(:disabled) {
    background-color: #0073aa;
    border-color: #0073aa;
    color: #ffffff;
}

.pm-pagination button.active {
    background-color: #0073aa;
    border-color: #0073aa;
    color: #ffffff;
    cursor: default;
}

.pm-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pm-pagination button:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .pm-grid {
        grid-template-columns: 1fr;
    }
}