/* ==============================================
   Soronko Trailblazers v1.3
   ============================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=DM+Sans:wght@400;500;600&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css');

:root {
    --stb-accent:    #c0392b;
    --stb-accent-lt: #f5e8e7;
    --stb-dark:      #111110;
    --stb-mid:       #888888;
    --stb-light:     #f2f0ec;
    --stb-border:    #e5e1db;
    --stb-white:     #ffffff;
    --stb-ease:      cubic-bezier(.4,0,.2,1);
}

.stb-wrapper {
    font-family: 'DM Sans', sans-serif;
    color: var(--stb-dark);
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 16px 64px;
    box-sizing: border-box;
}
.stb-wrapper *, .stb-wrapper *::before, .stb-wrapper *::after {
    box-sizing: border-box;
}

/* ── Search + Filter Bar ── */
.stb-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 36px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--stb-border);
    flex-wrap: wrap;
}

.stb-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}
.stb-search-wrap i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--stb-mid);
    font-size: 13px;
    pointer-events: none;
}
.stb-search-input {
    width: 100%;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: var(--stb-dark);
    background: var(--stb-white);
    border: 1.5px solid var(--stb-border);
    border-radius: 100px;
    padding: 9px 16px 9px 36px;
    outline: none;
    transition: border-color .2s ease;
}
.stb-search-input::placeholder { color: var(--stb-mid); }
.stb-search-input:focus { border-color: var(--stb-dark); }

.stb-year-select-wrap {
    position: relative;
    flex-shrink: 0;
}
.stb-year-select-wrap i {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--stb-mid);
    font-size: 11px;
    pointer-events: none;
}
.stb-year-select {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--stb-dark);
    background: var(--stb-white);
    border: 1.5px solid var(--stb-border);
    border-radius: 100px;
    padding: 9px 36px 9px 18px;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    cursor: pointer;
    transition: border-color .2s ease;
    min-width: 140px;
}
.stb-year-select:focus { border-color: var(--stb-dark); }

/* ── Loading / Empty ── */
.stb-loading, .stb-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    color: var(--stb-mid);
    font-size: 13px;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.stb-loading::before {
    content: '';
    display: block;
    width: 20px; height: 20px;
    border: 2px solid var(--stb-border);
    border-top-color: var(--stb-accent);
    border-radius: 50%;
    animation: stb-spin .75s linear infinite;
    margin-bottom: 12px;
}
@keyframes stb-spin { to { transform: rotate(360deg); } }
.stb-empty-icon { font-size: 36px; margin-bottom: 12px; opacity: .3; }

/* ── Grid ── */
.stb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 40px 20px;
}

/* ── Card ── */
.stb-card {
    cursor: pointer;
    animation: stb-up .4s var(--stb-ease) both;
    transition: transform .28s var(--stb-ease);
}
.stb-card:hover { transform: translateY(-6px); }
@keyframes stb-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.stb-card:nth-child(1){ animation-delay:.05s }
.stb-card:nth-child(2){ animation-delay:.10s }
.stb-card:nth-child(3){ animation-delay:.15s }
.stb-card:nth-child(4){ animation-delay:.20s }
.stb-card:nth-child(5){ animation-delay:.25s }
.stb-card:nth-child(6){ animation-delay:.30s }
.stb-card:nth-child(7){ animation-delay:.35s }
.stb-card:nth-child(8){ animation-delay:.40s }

/* ── Portrait Photo — always fills, no gaps ── */
.stb-card-photo-wrap {
    position: relative;
    width: 100%;
    /* Use aspect-ratio for modern browsers, padding-bottom fallback */
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--stb-light);
    border-radius: 6px;
    display: block;
}
/* Fallback for browsers without aspect-ratio */
@supports not (aspect-ratio: 3/4) {
    .stb-card-photo-wrap {
        padding-bottom: 133.33%;
        height: 0;
    }
}

.stb-card-photo {
    position: absolute;
    top: 0; left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: top center;
    display: block !important;
    transition: transform .55s var(--stb-ease), filter .4s ease;
    filter: grayscale(8%);
    /* Kill any theme interference */
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
}
.stb-card:hover .stb-card-photo {
    transform: scale(1.07);
    filter: grayscale(0%);
}

.stb-card-no-photo {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 48px; color: var(--stb-mid); opacity: .2;
}

/* Year badge */
.stb-card-year {
    position: absolute; top: 10px; left: 10px; z-index: 2;
    background: var(--stb-accent); color: #fff;
    font-size: 9px; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase;
    padding: 3px 9px; border-radius: 100px;
}

/* Hover pill */
.stb-card-hint {
    position: absolute; bottom: 12px; left: 50%;
    transform: translateX(-50%) translateY(4px);
    z-index: 3;
    background: rgba(17,17,16,.8); color: #fff;
    font-size: 10px; font-weight: 500;
    letter-spacing: .12em; text-transform: uppercase;
    padding: 5px 14px; border-radius: 100px;
    white-space: nowrap; opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease;
}
.stb-card:hover .stb-card-hint {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Card Body ── */
.stb-card-body { padding: 10px 2px 0; }
.stb-card-name {
    font-size: 14px; font-weight: 600;
    line-height: 1.3; margin: 0 0 2px;
    color: var(--stb-dark); letter-spacing: -.01em;
}
.stb-card-position {
    font-size: 11.5px; color: var(--stb-mid);
    margin: 0 0 8px; line-height: 1.4;
}

/* ── Social Icons ── */
.stb-socials { display: flex; gap: 5px; flex-wrap: wrap; }
.stb-social-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 6px;
    background: var(--stb-light); border: 1px solid var(--stb-border);
    color: var(--stb-mid); text-decoration: none;
    font-size: 12px;
    transition: all .2s var(--stb-ease); flex-shrink: 0;
}
.stb-social-link:hover { transform: translateY(-2px); border-color: transparent; }
.stb-social-link.fb:hover  { background: #1877F2; color: #fff; }
.stb-social-link.li:hover  { background: #0A66C2; color: #fff; }
.stb-social-link.ig:hover  { background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); color: #fff; }
.stb-social-link.tw:hover  { background: #111; color: #fff; }
.stb-social-link.web:hover { background: var(--stb-accent); color: #fff; }

/* ── Pagination ── */
.stb-pagination {
    display: flex; justify-content: center;
    gap: 5px; margin-top: 52px; flex-wrap: wrap;
}
.stb-page-btn {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px; font-weight: 500;
    min-width: 36px; height: 36px; padding: 0 10px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1.5px solid var(--stb-border); border-radius: 7px;
    background: transparent; color: var(--stb-mid);
    cursor: pointer; transition: all .2s var(--stb-ease);
}
.stb-page-btn:hover:not(:disabled) { border-color: var(--stb-dark); color: var(--stb-dark); }
.stb-page-btn.active { background: var(--stb-dark); border-color: var(--stb-dark); color: #fff; }
.stb-page-btn:disabled { opacity: .3; cursor: default; }

/* ══════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════ */
.stb-modal-overlay {
    position: fixed; inset: 0; z-index: 999999;
    background: rgba(17,17,16,.5);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    opacity: 0; visibility: hidden;
    transition: opacity .28s ease, visibility .28s ease;
}
.stb-modal-overlay.is-open { opacity: 1; visibility: visible; }

.stb-modal-box {
    position: relative; background: #fff;
    border-radius: 16px; width: 100%; max-width: 660px;
    max-height: 90vh; overflow-y: auto;
    box-shadow: 0 28px 70px rgba(0,0,0,.22);
    transform: scale(.94) translateY(14px);
    transition: transform .32s cubic-bezier(.34,1.56,.64,1);
}
.stb-modal-overlay.is-open .stb-modal-box { transform: scale(1) translateY(0); }

.stb-modal-close {
    position: absolute; top: 14px; right: 16px; z-index: 10;
    width: 32px; height: 32px; border-radius: 50%;
    border: 1.5px solid var(--stb-border);
    background: #fff; color: var(--stb-mid);
    font-size: 16px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s ease;
}
.stb-modal-close:hover { background: var(--stb-dark); border-color: var(--stb-dark); color: #fff; }

.stb-modal-inner { display: flex; }

.stb-modal-photo-wrap {
    width: 200px; flex-shrink: 0;
    background: var(--stb-light);
    border-radius: 16px 0 0 16px;
    overflow: hidden;
    display: flex; flex-direction: column;
}
.stb-modal-photo {
    width: 100% !important;
    height: 270px !important;
    object-fit: cover !important;
    object-position: top center;
    display: block !important;
    flex-shrink: 0;
    max-width: none !important;
    margin: 0 !important;
}
.stb-modal-no-photo {
    width: 100%; height: 270px;
    display: flex; align-items: center; justify-content: center;
    font-size: 60px; opacity: .2; flex-shrink: 0;
}
.stb-modal-socials {
    flex: 1; padding: 14px 12px;
    display: flex; flex-wrap: wrap; gap: 6px;
    justify-content: center; align-content: flex-start;
    background: var(--stb-light);
    font-size: 14px;
}
.stb-modal-socials .stb-social-link {
    width: 32px; height: 32px; font-size: 14px;
}

.stb-modal-content {
    flex: 1; min-width: 0;
    padding: 28px 26px 26px 24px;
    display: flex; flex-direction: column;
}
.stb-modal-year-badge {
    display: inline-block;
    background: var(--stb-accent-lt); color: var(--stb-accent);
    font-size: 9px; font-weight: 700;
    letter-spacing: .14em; text-transform: uppercase;
    padding: 3px 11px; border-radius: 100px;
    margin: 0 0 14px; width: fit-content;
}
.stb-modal-name {
    font-family: 'Playfair Display', serif;
    font-size: 22px; font-weight: 700;
    margin: 0 0 5px; line-height: 1.2;
}
.stb-modal-position { font-size: 13px; color: var(--stb-mid); margin: 0 0 3px; }
.stb-modal-location { font-size: 12px; color: var(--stb-mid); opacity: .65; margin: 0 0 20px; }
.stb-modal-location::before { content: '📍 '; }
.stb-modal-divider { height: 1px; background: var(--stb-border); margin: 0 0 18px; }
.stb-modal-bio { font-size: 13.5px; line-height: 1.8; color: #555; }
.stb-modal-bio p { margin: 0 0 10px; }
.stb-modal-bio p:last-child { margin-bottom: 0; }

@media (max-width: 560px) {
    .stb-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 14px; }
    .stb-controls { flex-direction: column; align-items: stretch; }
    .stb-modal-inner { flex-direction: column; }
    .stb-modal-photo-wrap { width: 100%; border-radius: 16px 16px 0 0; }
    .stb-modal-photo, .stb-modal-no-photo { height: 200px !important; }
    .stb-modal-content { padding: 20px; }
}
