/**
 * NSDS Board & Resources — Frontend Styles
 * Developed by Next Step Digital Solutions
 * https://www.trynextstep.com
 *
 * All themed colors come from CSS variables emitted by class-nsds-assets.php:
 *   --nsds-primary, --nsds-primary-hover, --nsds-secondary, --nsds-secondary-hover,
 *   --nsds-text, --nsds-bg, --nsds-btn-radius, --nsds-card-radius
 */

/* =========================================================================
   Base wrappers + accessibility utility
   ========================================================================= */
.nsds-board-wrapper,
.nsds-resources-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--nsds-text, #1a2332);
    box-sizing: border-box;
    margin: 24px 0;
}

.nsds-board-wrapper *,
.nsds-resources-wrapper *,
.nsds-modal * {
    box-sizing: border-box;
}

/* Visually hidden but readable to screen readers */
.nsds-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* =========================================================================
   Grid system
   ========================================================================= */
.nsds-board-grid,
.nsds-resources-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(1, 1fr);
}

@media (min-width: 600px) {
    .nsds-cols-2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 780px) {
    .nsds-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .nsds-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .nsds-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* In carousel mode the grid layout is replaced by Swiper */
.nsds-style-carousel .nsds-board-grid {
    display: block;
}

/* =========================================================================
   Shared button
   ========================================================================= */
.nsds-btn {
    display: inline-block;
    background: var(--nsds-primary, #2787b7);
    color: #ffffff !important;
    border: none;
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border-radius: var(--nsds-btn-radius, 8px);
    transition: background-color 0.2s, transform 0.15s, box-shadow 0.2s;
    line-height: 1.3;
    font-family: inherit;
}

.nsds-btn:hover,
.nsds-btn:focus {
    background: var(--nsds-primary-hover, #1f6e96);
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    text-decoration: none;
}

.nsds-btn:active { transform: translateY(0); }

/* JS hook — bio buttons also have .nsds-btn; this selector exists so themes
   can target them independently of resource buttons if needed. */
.nsds-bio-btn { /* visually styled via .nsds-btn */ }

/* Empty + credit + filter count */
.nsds-empty {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    background: #f8f9fa;
    border-radius: var(--nsds-card-radius, 12px);
}

.nsds-credit {
    text-align: center;
    margin-top: 24px;
    font-size: 12px;
    color: #999;
}
.nsds-credit a {
    color: var(--nsds-primary, #2787b7);
    text-decoration: none;
    font-weight: 500;
}
.nsds-credit a:hover { text-decoration: underline; }

/* =========================================================================
   Board card — shared
   ========================================================================= */
.nsds-board-card {
    position: relative;
    background: var(--nsds-bg, #ffffff);
    border-radius: var(--nsds-card-radius, 12px);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transition: transform 0.25s, box-shadow 0.25s;
    display: flex;
    flex-direction: column;
}
.nsds-board-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

.nsds-board-card[hidden] { display: none !important; }

/* Featured badge — star in top-right */
.nsds-featured-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--nsds-secondary, #e0890b);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.nsds-featured-badge svg { width: 16px; height: 16px; }

/* =========================================================================
   Board: Classic Card style
   ========================================================================= */
.nsds-classic-card .nsds-photo-wrap.nsds-square {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f0f0f0;
}
.nsds-classic-card .nsds-photo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.nsds-board-card:hover .nsds-classic-card .nsds-photo-wrap img {
    transform: scale(1.05);
}
.nsds-classic-card .nsds-card-body {
    padding: 24px 20px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.nsds-classic-card .nsds-name {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    color: var(--nsds-text, #1a2332);
    line-height: 1.3;
}
.nsds-classic-card .nsds-position {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--nsds-primary, #2787b7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.nsds-classic-card .nsds-title {
    margin: 0 0 18px;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}
.nsds-classic-card .nsds-btn {
    margin-top: auto;
    align-self: center;
}

/* =========================================================================
   Board: Minimal style
   ========================================================================= */
.nsds-style-minimal .nsds-board-card {
    background: transparent;
    box-shadow: none;
}
.nsds-style-minimal .nsds-board-card:hover {
    transform: none;
    box-shadow: none;
}
.nsds-minimal {
    text-align: center;
    padding: 20px 16px;
}
.nsds-minimal .nsds-photo-wrap.nsds-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 20px;
    background: #f0f0f0;
    border: 4px solid var(--nsds-bg, #ffffff);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}
.nsds-style-minimal .nsds-board-card:hover .nsds-circle {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(39, 135, 183, 0.25);
}
.nsds-minimal .nsds-photo-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.nsds-minimal .nsds-name {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    color: var(--nsds-text, #1a2332);
}
.nsds-minimal .nsds-position {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--nsds-primary, #2787b7);
}
.nsds-minimal .nsds-title {
    margin: 0 0 16px;
    font-size: 13px;
    color: #777;
}
.nsds-minimal .nsds-btn {
    font-size: 14px;
    padding: 10px 22px;
    background: transparent;
    color: var(--nsds-primary, #2787b7) !important;
    border: 2px solid var(--nsds-primary, #2787b7);
}
.nsds-minimal .nsds-btn:hover {
    background: var(--nsds-primary, #2787b7);
    color: #ffffff !important;
}

/* =========================================================================
   Board: Overlay style
   ========================================================================= */
.nsds-style-overlay .nsds-overlay-card {
    position: relative;
    border-radius: var(--nsds-card-radius, 12px);
    overflow: hidden;
    aspect-ratio: 3 / 4;
    background: #1a2332;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s, transform 0.3s;
}
.nsds-style-overlay .nsds-overlay-card:hover {
    box-shadow: 0 12px 36px rgba(0,0,0,0.2);
    transform: translateY(-4px);
}
.nsds-style-overlay .nsds-overlay-photo {
    position: relative;
    width: 100%;
    height: 100%;
}
.nsds-style-overlay .nsds-overlay-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s;
}
.nsds-style-overlay .nsds-overlay-card:hover .nsds-overlay-photo img {
    transform: scale(1.08);
}
.nsds-style-overlay .nsds-overlay-content {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 24px 20px;
    background: linear-gradient(to top,
        rgba(0,0,0,0.92) 0%,
        rgba(0,0,0,0.7) 60%,
        rgba(0,0,0,0) 100%);
    color: #fff;
}
.nsds-style-overlay .nsds-name {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}
.nsds-style-overlay .nsds-position {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--nsds-secondary, #e0890b);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.nsds-style-overlay .nsds-title {
    margin: 0 0 14px;
    font-size: 13px;
    color: rgba(255,255,255,0.85);
}
.nsds-style-overlay .nsds-btn-overlay {
    background: var(--nsds-secondary, #e0890b);
    padding: 8px 18px;
    font-size: 13px;
}
.nsds-style-overlay .nsds-btn-overlay:hover {
    background: var(--nsds-secondary-hover, #c47707);
}

/* =========================================================================
   Board: Carousel style (Swiper)
   ========================================================================= */
.nsds-style-carousel { padding: 0 0 50px; /* room for pagination */ }

.nsds-carousel.swiper {
    padding: 8px 0 32px;
    overflow: hidden;
}
.nsds-style-carousel .swiper-slide {
    height: auto;
    display: flex;
}
.nsds-style-carousel .swiper-slide .nsds-board-card {
    width: 100%;
}

/* Pagination dots */
.nsds-style-carousel .swiper-pagination {
    position: relative;
    bottom: 0;
    margin-top: 16px;
}
.nsds-style-carousel .swiper-pagination-bullet {
    background: var(--nsds-primary, #2787b7);
    opacity: 0.35;
    transition: opacity 0.2s, transform 0.2s;
}
.nsds-style-carousel .swiper-pagination-bullet-active {
    opacity: 1;
    transform: scale(1.2);
}

/* Navigation arrows — restyled to brand color */
.nsds-style-carousel .swiper-button-prev,
.nsds-style-carousel .swiper-button-next {
    width: 44px;
    height: 44px;
    background: var(--nsds-bg, #ffffff);
    border-radius: 50%;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    color: var(--nsds-primary, #2787b7);
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.nsds-style-carousel .swiper-button-prev:hover,
.nsds-style-carousel .swiper-button-next:hover {
    background: var(--nsds-primary, #2787b7);
    color: #fff;
    transform: scale(1.05);
}
.nsds-style-carousel .swiper-button-prev:after,
.nsds-style-carousel .swiper-button-next:after {
    font-size: 18px;
    font-weight: 700;
}
.nsds-style-carousel .swiper-button-disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* =========================================================================
   Resource cards
   ========================================================================= */
.nsds-resource-card {
    background: var(--nsds-bg, #ffffff);
    border: 1px solid #ececec;
    border-radius: var(--nsds-card-radius, 12px);
    padding: 40px 28px;
    text-align: center;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.nsds-resource-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
    border-color: transparent;
}
.nsds-resource-card[hidden] { display: none !important; }

.nsds-resource-icon {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: var(--nsds-primary, #2787b7);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    transition: transform 0.3s, background-color 0.25s;
}
.nsds-resource-card:hover .nsds-resource-icon {
    transform: scale(1.08) rotate(-6deg);
    background: var(--nsds-secondary, #e0890b);
}
.nsds-resource-icon svg { width: 32px; height: 32px; }

.nsds-resource-title {
    margin: 0 0 12px;
    font-size: 26px;
    font-weight: 700;
    color: var(--nsds-text, #1a2332);
    line-height: 1.3;
}
.nsds-resource-desc {
    margin: 0 0 28px;
    font-size: 16px;
    color: #555;
    line-height: 1.5;
    flex: 1;
}
.nsds-resource-btn {
    background: var(--nsds-primary, #2787b7);
    padding: 14px 36px;
    font-size: 16px;
    min-width: 160px;
}

/* File info row — shown when resource has an attached file */
.nsds-resource-file-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 13px;
    color: #777;
    font-weight: 500;
}
.nsds-file-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--nsds-primary, #2787b7);
}
.nsds-file-icon svg { display: block; }
.nsds-resource-file-info .nsds-file-name {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nsds-resource-file-info .nsds-file-size {
    color: #999;
    font-size: 12px;
}

/* =========================================================================
   Board member filter bar
   ========================================================================= */
.nsds-board-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    align-items: stretch;
    padding: 16px;
    background: #f8f9fa;
    border-radius: var(--nsds-card-radius, 12px);
}

.nsds-filter-search-wrap {
    flex: 1 1 240px;
    min-width: 200px;
}
.nsds-filter-search {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d8dee6;
    border-radius: var(--nsds-btn-radius, 8px);
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--nsds-text, #1a2332);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.nsds-filter-search:focus {
    outline: none;
    border-color: var(--nsds-primary, #2787b7);
    box-shadow: 0 0 0 3px rgba(39, 135, 183, 0.15);
}

.nsds-filter-select {
    flex: 0 1 auto;
    padding: 10px 32px 10px 14px;
    border: 1px solid #d8dee6;
    border-radius: var(--nsds-btn-radius, 8px);
    font-size: 14px;
    font-family: inherit;
    background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat right 10px center;
    background-size: 12px;
    color: var(--nsds-text, #1a2332);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    min-width: 140px;
}
.nsds-filter-select:focus {
    outline: none;
    border-color: var(--nsds-primary, #2787b7);
    box-shadow: 0 0 0 3px rgba(39, 135, 183, 0.15);
}

/* JS-selector-only classes — no additional visual rules needed,
   but kept here so future styling overrides have a hook. */
.nsds-filter-group,
.nsds-filter-tier { /* identical to .nsds-filter-select */ }

/* aria-live announcement region — relies on .nsds-sr-only co-class to hide visually */
.nsds-board-filter-count { /* no visual rules needed; visually hidden via .nsds-sr-only */ }

.nsds-filter-reset {
    padding: 10px 16px;
    background: transparent;
    border: 1px solid #d8dee6;
    border-radius: var(--nsds-btn-radius, 8px);
    color: #666;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.nsds-filter-reset:hover {
    background: var(--nsds-primary, #2787b7);
    color: #fff;
    border-color: var(--nsds-primary, #2787b7);
}

/* =========================================================================
   Resource category filter
   ========================================================================= */
.nsds-resource-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    justify-content: center;
}
.nsds-filter-btn {
    padding: 8px 18px;
    background: transparent;
    border: 1.5px solid #d8dee6;
    border-radius: 999px; /* pill default */
    color: #555;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.nsds-filter-btn:hover {
    border-color: var(--nsds-primary, #2787b7);
    color: var(--nsds-primary, #2787b7);
}
.nsds-filter-btn.is-active {
    background: var(--nsds-primary, #2787b7);
    border-color: var(--nsds-primary, #2787b7);
    color: #fff;
}

/* Variant: pills (default — explicit selector for theme overrides) */
.nsds-filters-pill .nsds-filter-btn {
    border-radius: 999px;
}

/* Variant: tabs (underlined) */
.nsds-filters-tab .nsds-filter-btn {
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    padding: 8px 14px;
    background: transparent;
}
.nsds-filters-tab .nsds-filter-btn.is-active {
    background: transparent;
    color: var(--nsds-primary, #2787b7);
    border-bottom-color: var(--nsds-primary, #2787b7);
}

/* Variant: outline buttons (square corners) */
.nsds-filters-outline .nsds-filter-btn {
    border-radius: var(--nsds-btn-radius, 8px);
}

/* =========================================================================
   Modal popup
   ========================================================================= */
.nsds-modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.25s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.nsds-modal.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}
.nsds-modal-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
}
.nsds-modal-dialog {
    position: relative;
    background: #ffffff;
    border-radius: var(--nsds-card-radius, 12px);
    max-width: 640px;
    width: calc(100% - 32px);
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0,0,0,0.3);
    transform: scale(0.96);
    transition: transform 0.25s ease;
    margin: 30px auto;
}
.nsds-modal.is-open .nsds-modal-dialog {
    transform: scale(1);
}
.nsds-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.05);
    color: #444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 2;
}
.nsds-modal-close:hover {
    background: rgba(0,0,0,0.12);
    transform: rotate(90deg);
}
.nsds-modal-header {
    display: flex;
    gap: 20px;
    padding: 32px 32px 20px;
    align-items: flex-start;
    border-bottom: 1px solid #f0f0f0;
}
.nsds-modal-photo {
    flex: 0 0 110px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    overflow: hidden;
    background: #f0f0f0;
    border: 3px solid var(--nsds-primary, #2787b7);
}
.nsds-modal-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.nsds-modal-meta { flex: 1; min-width: 0; }
.nsds-modal-meta h2 {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 700;
    color: var(--nsds-text, #1a2332);
    line-height: 1.2;
}
.nsds-modal-position {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--nsds-primary, #2787b7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.nsds-modal-title {
    margin: 0;
    font-size: 15px;
    color: #666;
}
.nsds-modal-contact {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.nsds-modal-contact a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--nsds-primary, #2787b7);
    text-decoration: none;
    padding: 5px 10px;
    background: rgba(39, 135, 183, 0.08);
    border-radius: 6px;
    transition: background 0.2s;
}
.nsds-modal-contact a:hover {
    background: rgba(39, 135, 183, 0.18);
}
.nsds-modal-contact svg {
    width: 14px;
    height: 14px;
}
.nsds-modal-body {
    padding: 24px 32px 32px;
    font-size: 15px;
    line-height: 1.7;
    color: #333;
}
.nsds-modal-body p { margin: 0 0 14px; }
.nsds-modal-body p:last-child { margin-bottom: 0; }
.nsds-modal-body a { color: var(--nsds-primary, #2787b7); }

/* Lock body scroll when modal open */
body.nsds-modal-active { overflow: hidden; }

/* =========================================================================
   Mobile adjustments
   ========================================================================= */
@media (max-width: 600px) {
    .nsds-modal-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 32px 20px 20px;
    }
    .nsds-modal-photo {
        flex: 0 0 100px;
        width: 100px;
        height: 100px;
    }
    .nsds-modal-body { padding: 20px; }
    .nsds-modal-meta h2 { font-size: 22px; }

    .nsds-resource-card { padding: 32px 20px; }
    .nsds-resource-title { font-size: 22px; }

    .nsds-board-filter-bar {
        flex-direction: column;
        padding: 12px;
    }
    .nsds-filter-select,
    .nsds-filter-reset { width: 100%; }
}

/* =========================================================================
   Reduced motion
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
    .nsds-board-card,
    .nsds-resource-card,
    .nsds-modal-dialog,
    .nsds-modal-close,
    .nsds-resource-icon,
    .nsds-photo-wrap img,
    .nsds-overlay-photo img,
    .nsds-style-carousel .swiper-button-prev,
    .nsds-style-carousel .swiper-button-next,
    .nsds-style-carousel .swiper-pagination-bullet {
        transition: none !important;
        animation: none !important;
    }
    .nsds-board-card:hover,
    .nsds-resource-card:hover {
        transform: none;
    }
}
