/* File: all-terrain-blocks/src/blocks/directory/index.css */

.wp-block-at-blocks-staff .directory-list {
    list-style-type: none;
    padding: 0;
}

.wp-block-at-blocks-staff .directoryf-member {
    margin-bottom: 10px;
}

.wp-block-at-blocks-staff .directory-name {
    font-weight: bold;
    margin-right: 10px;
}

.wp-block-at-blocks-staff .designation {
    font-style: italic;
}

.directory-list {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(var(--columns-smartphone), 1fr);
    }

@media (min-width: 768px) {
    .directory-list {
        grid-template-columns: repeat(var(--columns-tablet), 1fr);
    }
}

@media (min-width: 1024px) {
    .directory-list {
        grid-template-columns: repeat(var(--columns-laptop), 1fr);
    }
}

@media (min-width: 1200px) {
    .directory-list {
        grid-template-columns: repeat(var(--columns-desktop), 1fr);
    }
}


.directory-member {
    text-align: center;
    list-style: none;
    margin-bottom: 25px;
    display: grid;
    }
    
.directory-name {
    font-size: 1.25em;
    line-height: 1.25em;
    font-family: "titillium_bold";
    margin-bottom: 5px;
    color: #2d2727;
    /* display: block; */
    }

.designation {
    font-size: 1.25em;
    line-height: 1.25em;
    }


/* ── Card mode (Use Images toggle) ────────────────────────────────────────────
 * Applied when .directory-list--cards is present on the <ul>.
 * Card styles mirror the single-entry page for visual consistency.
 * ─────────────────────────────────────────────────────────────────────────── */

.directory-list--cards {
    gap: 1.5rem;
    /* Override the default column gap from the grid so cards have breathing room */
    column-gap: 1.5rem;
    row-gap: 1.5rem;
}

.directory-list--cards .directory-member.directory-card {
    /* Reset defaults from the base .directory-member rule */
    display: flex;
    flex-direction: column;
    text-align: left;
    margin-bottom: 0;

    /* Card treatment — matches .atb-dir-entry__detail-group on the single page */
    background-color: rgba( 0, 0, 0, 0.03 );
    border: 1px solid rgba( 0, 0, 0, 0.08 );
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.06 );
}

/* ── Card photo ──────────────────────────────────────────────────────────── */

.directory-card__photo {
    margin: 0;
    /* Fixed aspect ratio keeps all cards the same height regardless of image
       dimensions. 4/3 works for both portrait (people) and landscape (property). */
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: rgba( 0, 0, 0, 0.06 ); /* placeholder tint when no image */
}

.directory-card__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Subtle scale on hover — respects prefers-reduced-motion (WCAG 2.3.3) */
    transition: transform 0.25s ease;
}

@media ( prefers-reduced-motion: no-preference ) {
    .directory-list--cards .directory-card:hover .directory-card__img {
        transform: scale( 1.03 );
    }
}

/* ── Card body: name + designation ──────────────────────────────────────── */

.directory-card__body {
    padding: 1rem 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1; /* stretch body to equal height when cards are in a row */
    text-align: center;
    transition: all .5s;
}

/* Name inside a card — slightly larger, give it visual weight */
.directory-list--cards .directory-card .directory-name {
    font-size: 1.15em;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0;
}

/* Link variant — underline on hover, ring on focus (WCAG 1.4.1 + 2.4.7) */
.directory-list--cards .directory-card a.directory-name {
    text-decoration: none;
}

.directory-list--cards .directory-card a.directory-name:hover {
    text-decoration: underline;
}

.directory-list--cards .directory-card a.directory-name:focus-visible {
    outline: 2px dotted currentColor;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Designation inside a card */
.directory-list--cards .directory-card .designation {
    font-size: 0.9em;
    line-height: 1.3;
    opacity: 0.75;
}
