.tg-gallery {
    display: grid;
    gap: 28px;
    grid-template-columns: repeat(3, 1fr);
    margin: 0 0 1em;
    align-items: start;
}
.tg-columns-2 { grid-template-columns: repeat(2, 1fr); }
.tg-columns-3 { grid-template-columns: repeat(3, 1fr); }
.tg-columns-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
    .tg-gallery { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 560px) {
    .tg-gallery { grid-template-columns: 1fr !important; }
}

.tg-card {
    background: #fff;
    border: 1px solid var(--assoc-line, #e4e6e2);
    border-radius: 8px;
    padding: 24px 20px;
    text-align: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tg-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.08);
}

.tg-card-clickable { cursor: pointer; }
.tg-card-clickable:focus-visible { outline: 2px solid var(--assoc-primary, #008751); outline-offset: 3px; }
.tg-timeline-row.tg-card-clickable:hover { background: #fafbfa; }

.tg-photo {
    width: 180px;
    height: 180px;
    margin: 0 auto 18px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--assoc-primary, #008751);
}
.tg-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.tg-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2.4rem;
    font-weight: 700;
}

/* "President" cards render 25% bigger than the rest - photo, padding, and
   type all scaled up together, with a subtle accent border to reinforce
   prominence. "Vice-President" and "President Elect" cards get the same
   accent border but stay normal size. Other cards in the same row are
   unaffected (see align-items: start above / flex-start on the carousel
   track below). */
.tg-card-featured,
.tg-card-vp {
    border-color: var(--assoc-primary, #008751);
    border-width: 2px;
}
.tg-card-featured {
    padding: 30px 25px;
}
.tg-card-featured .tg-photo {
    width: 225px;
    height: 225px;
    border-radius: 20px;
    margin-bottom: 22px;
}
.tg-card-featured .tg-name { font-size: 1.375rem; margin-bottom: 3px; }
.tg-card-featured .tg-position { font-size: 1.025rem; margin-bottom: 15px; }
.tg-card-featured .tg-bio { font-size: 1.15rem; margin-bottom: 20px; }

@media (max-width: 560px) {
    .tg-photo { width: 150px; height: 150px; }
    .tg-card-featured .tg-photo { width: 190px; height: 190px; }
}

.tg-name {
    margin: 0 0 2px;
    font-size: 1.1rem;
    color: var(--assoc-text, #1c1c1a);
}
.tg-position {
    margin: 0 0 12px;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--assoc-primary, #008751);
    font-weight: 600;
}
.tg-bio {
    font-size: 0.92rem;
    color: var(--assoc-text-muted, #6e7573);
    margin: 0 0 16px;
}

.tg-social {
    display: flex;
    justify-content: center;
    gap: 12px;
}
.tg-social a {
    color: var(--assoc-text-muted, #6e7573);
    display: inline-flex;
    transition: color 0.15s ease;
}
.tg-social a:hover {
    color: var(--assoc-primary, #008751);
}

.tg-empty {
    text-align: center;
    color: var(--assoc-text-muted, #6e7573);
}

/* ---------------- Carousel layout ---------------- */
.tg-carousel { position: relative; }
.tg-carousel-track {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 4px 4px 16px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    align-items: flex-start;
}
.tg-carousel-track::-webkit-scrollbar { display: none; }

.tg-carousel-item {
    flex: 0 0 auto;
    width: 260px;
    scroll-snap-align: start;
}
.tg-carousel-item-featured { width: 325px; }
.tg-carousel-item .tg-card { height: 100%; }

.tg-carousel-arrow {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #ffffff;
    color: var(--assoc-primary, #008751);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.tg-carousel-arrow:hover { background: var(--assoc-primary, #008751); color: #fff; }
.tg-carousel-prev { left: -6px; }
.tg-carousel-next { right: -6px; }

@media (max-width: 600px) {
    .tg-carousel-item { width: 220px; }
    .tg-carousel-item-featured { width: 275px; }
    .tg-carousel-arrow { width: 32px; height: 32px; font-size: 1.1rem; }
}

/* ---------------- Timeline layout (e.g. Past Chairpersons) ---------------- */
.tg-timeline { display: flex; flex-direction: column; }

.tg-timeline-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 36px;
    padding: 32px 0;
    border-bottom: 1px solid var(--assoc-line, #e4e6e2);
    align-items: start;
}
.tg-timeline-row:first-child { padding-top: 0; }
.tg-timeline-row:last-child { border-bottom: none; }

.tg-timeline-photo {
    width: 200px;
    height: 200px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--assoc-primary, #008751);
    border: 2px solid var(--assoc-primary, #008751);
    box-sizing: border-box;
}
.tg-timeline-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

.tg-timeline-body .tg-name { margin: 0 0 6px; }
.tg-timeline-tenure {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--assoc-primary, #008751);
    background: var(--assoc-paper-deep, #f2f3ef);
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 10px;
}
.tg-timeline-body .tg-position { margin: 2px 0 10px; }
.tg-timeline-body .tg-bio { margin: 0; }

@media (max-width: 560px) {
    .tg-timeline-row { grid-template-columns: 133px 1fr; gap: 20px; padding: 24px 0; }
    .tg-timeline-photo { width: 133px; height: 133px; border-radius: 12px; }
}

/* =========================================================================
   Full detail modal - opens when a team member card is clicked
   ========================================================================= */
body.tg-modal-open { overflow: hidden; }

.tg-detail-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(6,10,8,0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
    padding: 20px;
    box-sizing: border-box;
}
.tg-detail-modal.is-open { opacity: 1; visibility: visible; }

.tg-detail-modal-inner {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 640px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    padding: 40px;
    box-sizing: border-box;
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
}

.tg-detail-modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: none;
    border: none;
    font-size: 1.8rem;
    font-weight: 300;
    line-height: 1;
    color: var(--assoc-text-muted, #5b6058);
    cursor: pointer;
}
.tg-detail-modal-close:hover { color: var(--assoc-text, #1c1c1a); }

.tg-detail-modal-photo {
    flex: 0 0 auto;
    width: 140px;
    height: 140px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--assoc-primary, #008751);
    display: flex;
    align-items: center;
    justify-content: center;
}
.tg-detail-modal-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tg-detail-modal-photo .tg-photo-placeholder { color: #fff; font-size: 2.4rem; font-weight: 700; }

.tg-detail-modal-body { flex: 1; min-width: 220px; }
.tg-detail-modal-name { margin: 0 0 4px; font-size: 1.3rem; color: var(--assoc-text, #1c1c1a); }
.tg-detail-modal-position { margin: 0 0 4px; color: var(--assoc-primary, #008751); font-weight: 600; font-size: 0.95rem; }
.tg-detail-modal-tenure { display: block; margin-bottom: 14px; font-size: 0.8rem; color: var(--assoc-text-muted, #5b6058); text-transform: uppercase; letter-spacing: 0.05em; }
.tg-detail-modal-bio { color: var(--assoc-text, #1c1c1a); line-height: 1.7; font-size: 0.95rem; }
.tg-detail-modal-bio p { margin: 0 0 12px; }
.tg-detail-modal-bio p:last-child { margin-bottom: 0; }

.tg-detail-modal-contact { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--assoc-line, #e4e6e2); display: flex; gap: 16px; flex-wrap: wrap; }
.tg-detail-modal-contact a { color: var(--assoc-primary, #008751); font-weight: 600; font-size: 0.9rem; text-decoration: none; }
.tg-detail-modal-contact a:hover { text-decoration: underline; }
.tg-detail-modal-contact:empty { display: none; }

@media (max-width: 560px) {
    .tg-detail-modal-inner { flex-direction: column; align-items: center; text-align: center; padding: 32px 24px; }
    .tg-detail-modal-contact { justify-content: center; }
}
