/* ==========================================================================
   Team Members Block — team-members.css
   File: /blocks/team-members/team-members.css
   ========================================================================== */

/* ── CSS Custom Properties (override in your theme as needed) ── */
:root {
    --tm-accent:        #1a3a5c;   /* Primary brand color */
    --tm-accent-light:  #2563a8;   /* Hover / lighter accent */
    --tm-text:          #1e1e1e;
    --tm-text-muted:    #5a6472;
    --tm-bg-card:       #ffffff;
    --tm-border:        #e4e8ed;
    --tm-photo-bg:      #dce3ec;
    --tm-modal-overlay: rgba(10, 20, 35, 0.72);
    --tm-radius:        25px;
    --tm-shadow-card:   0 2px 12px rgba(0,0,0,.07);
    --tm-shadow-modal:  0 20px 60px rgba(0,0,0,.22);
    --tm-transition:    200ms ease;
    --tm-font-head:     inherit;
    --tm-font-body:     inherit;
}

/* ── Section wrapper ────────────────────────────────────────────── */
.tm-section {
    padding: /* 4rem */ 0;
}

/* ── Section header ─────────────────────────────────────────────── */
.tm-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tm-heading {
    font-family: var(--tm-font-head);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    color: var(--tm-accent);
    margin: 0 0 .75rem;
    font-weight: 700;
}

.tm-subheading {
    font-family: var(--tm-font-body);
    font-size: 1.05rem;
    color: var(--tm-text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.65;
}

/* ── Grid ───────────────────────────────────────────────────────── */
.tm-grid {
    display: grid;
    gap: 2rem;
}

.tm-cols-2 { grid-template-columns: repeat(2, 1fr); }
.tm-cols-3 { grid-template-columns: repeat(3, 1fr); }
.tm-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
    .tm-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
    .tm-cols-3,
    .tm-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .tm-cols-2,
    .tm-cols-3,
    .tm-cols-4 { grid-template-columns: 1fr; }
}

/* ── Card ───────────────────────────────────────────────────────── */
.tm-card {
    background: var(--tm-bg-card);
    border: 1px solid var(--tm-border);
    border-radius: var(--tm-radius);
    box-shadow: var(--tm-shadow-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow var(--tm-transition), transform var(--tm-transition);
}

.tm-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.12);
    transform: translateY(-3px);
}


/* Photo wrap — position context for pseudo-element */
.tm-card__photo-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    position: relative; /* needed for ::before positioning */
}
/* Background image on pseudo-element so filter doesn't affect the photo */
.tm-card__photo-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background-attachment: scroll;
    background-image: url('./images/fondo-img-maAluHbu.jpg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    filter: grayscale(100%);
    z-index: 0;
}
/* Photo sits above the pseudo-element */
.tm-card__photo {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 400ms ease;
}

.tm-card:hover .tm-card__photo {
    transform: scale(1.03);
}

.tm-card__photo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b0bac8;
}

.tm-card__photo--placeholder svg {
    width: 60px;
    height: 60px;
}

/* Body */
.tm-card__body {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tm-card__name {
    font-family: var(--tm-font-head);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--tm-text);
    margin: 0 0 .2rem;
}

.tm-card__title {
    font-size: .875rem;
    color: var(--tm-accent-light);
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    margin: 0 0 .75rem;
}

.tm-card__teaser {
    font-size: .9rem;
    color: var(--tm-text-muted);
    line-height: 1.6;
    margin: 0 0 1rem;
    flex: 1;
}

/* Read More button */
.tm-card__btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-top: auto;
    padding: .55rem 1.25rem;
    background: transparent;
    border: 2px solid var(--tm-accent);
    border-radius: 3px;
    color: var(--tm-accent);
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    align-self: flex-start;
    transition:
        background var(--tm-transition),
        color var(--tm-transition);
    letter-spacing: .04em;
    text-transform: uppercase;
}

.tm-card__btn:hover,
.tm-card__btn:focus-visible {
    background: var(--tm-accent);
    color: #fff;
    outline: none;
}

.tm-card__btn:focus-visible {
    outline: 3px solid var(--tm-accent-light);
    outline-offset: 2px;
}

/* ── Modal ───────────────────────────────────────────────────────── */
.tm-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.tm-modal[hidden] {
    display: none;
}

/* Overlay */
.tm-modal__overlay {
    position: absolute;
    inset: 0;
    background: var(--tm-modal-overlay);
    cursor: pointer;
    animation: tm-fade-in 200ms ease both;
}

/* Panel */
.tm-modal__panel {
    position: relative;
    background: #fff;
    border-radius: var(--tm-radius);
    box-shadow: var(--tm-shadow-modal);
    width: min(900px, 100%);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    animation: tm-slide-up 260ms cubic-bezier(.22,.68,0,1.2) both;
    overscroll-behavior: contain;
}

@keyframes tm-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes tm-slide-up {
    from { opacity: 0; transform: translateY(28px) scale(.97); }
    to   { opacity: 1; transform: none; }
}

/* Close button */
.tm-modal__close {
    position: sticky;
    top: 1rem;
    float: right;
    margin: 1rem 1rem 0 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f0f2f5;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--tm-transition);
    z-index: 1;
    flex-shrink: 0;
}
/* Close Button changes that allow .tm-modal__photo-col to span full width */
.tm-modal__close {
	top: .25rem;
	margin: 1rem 1rem;
	display: block;
	z-index: 40;
	position: absolute;
}

.tm-modal__close:hover { background: #e2e6ea; }
.tm-modal__close:focus-visible {
    outline: 3px solid var(--tm-accent-light);
    outline-offset: 2px;
}

.tm-modal__close svg {
    width: 18px;
    height: 18px;
    color: #444;
}

/* Inner two-column layout */
.tm-modal__inner {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;

}
@media (max-width: 680px) {
    .tm-modal__inner { grid-template-columns: 1fr; }
}

/* Photo column */
.tm-modal__photo-col {
    /* background: var(--tm-photo-bg); */
    background-attachment: scroll;
    background-image: url('./images/fondo-img-maAluHbu.jpg');
    background-position: center left;
    background-repeat: no-repeat;
    background-size: cover;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.tm-modal__photo {
    width: 100%;
    border-radius: var(--tm-radius);
    display: block;
    object-fit: cover;
    object-position: center top;
    aspect-ratio: 3 / 4;
}

@media (max-width: 680px) {
    .tm-modal__photo {
        aspect-ratio: 1 / 1;
        max-width: 240px;
    }
}

/* Social links */
.tm-modal__links {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    width: 100%;
}

.tm-modal__link {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--tm-accent);
    text-decoration: none;
    padding: .5rem .75rem;
    border-radius: 3px;
    background: rgba(255,255,255,.7);
    transition: background var(--tm-transition), color var(--tm-transition);
}

.tm-modal__link:hover { background: var(--tm-accent); color: #fff; }

.tm-modal__link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Bio column */
.tm-modal__bio-col {
    padding: 2.5rem 2.5rem 2.5rem 2rem;
}

.tm-modal__job-title {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--tm-accent-light);
    margin: 0 0 .4rem;
}

.tm-modal__name {
    font-family: var(--tm-font-head);
    font-size: clamp(1.4rem, 2.5vw, 1.9rem);
    font-weight: 700;
    color: var(--tm-accent);
    margin: 0 0 1.25rem;
    line-height: 1.2;
}

.tm-modal__bio {
    font-size: .95rem;
    line-height: 1.75;
    color: var(--tm-text);
}

.tm-modal__bio p { margin: 0 0 1em; }
.tm-modal__bio p:last-child { margin-bottom: 0; }

.tm-modal__bio a { color: #de642e;}

.tm-modal__bio a::after {
	color: #DE642E;
	content: "\f345";
	display: inline-block;
	font-family: dashicons;
	font-size: 15px;
	font-weight: bold;
	padding-left: 5px;
	position: relative;
	top: 2px;
	-webkit-font-smoothing: antialiased;
}

/* ── Focus trap helper (set by JS) ─────────────────────────────── */
.tm-modal-no-scroll { overflow: hidden; }
