/* ============================================
   ATCHISON CHAMBER — SHARED MEMBER CARDS
   Tier-grouped grid + button-style cards used
   on the homepage Featured Members section and
   the /members directory page. Same DOM, same
   click target, same spotlight drawer.
   ============================================ */

/* ----- Tier groups ----- */

.members-grid--tiered {
    display: flex;
    flex-direction: column;
    gap: var(--space-10);
}

.featured-tier {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

/* Tier section divider — the heading content (icon + chip + count) sits on a
   full-width horizontal rule whose color matches the tier. Reads as a clean
   "chapter break" between sections instead of a small floating badge. */
.featured-tier__heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
    padding: var(--space-2) 0;

    /* Default line color — overridden per tier below. */
    --tier-line: var(--chamber-teal);
}

.featured-tier--diamond  .featured-tier__heading { --tier-line: #2193b0; }
.featured-tier--platinum .featured-tier__heading { --tier-line: #555a60; }
.featured-tier--gold     .featured-tier__heading { --tier-line: #b88a2c; }
.featured-tier--silver   .featured-tier__heading { --tier-line: #8a929a; }
.featured-tier--bronze   .featured-tier__heading { --tier-line: #8b5a2b; }

.featured-tier__heading::before,
.featured-tier__heading::after {
    content: '';
    flex: 1 1 0;
    height: 2px;
    min-width: 32px;
    border-radius: 2px;
    background: var(--tier-line);
    opacity: 0.32;
}

.featured-tier__heading::before {
    background: linear-gradient(to right,
        rgba(0, 0, 0, 0) 0%,
        var(--tier-line) 100%);
}

.featured-tier__heading::after {
    background: linear-gradient(to left,
        rgba(0, 0, 0, 0) 0%,
        var(--tier-line) 100%);
}

.featured-tier__icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 6px 14px rgba(51, 79, 93, 0.22));
}

.featured-tier__chip-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    text-align: center;
}

/* Mobile: keep the divider visible but tighten things up so the chip + count
   stay readable next to the icon without forcing the line off-screen. */
@media (max-width: 599px) {
    .featured-tier__heading {
        gap: var(--space-3);
    }
    .featured-tier__heading::before,
    .featured-tier__heading::after {
        min-width: 16px;
    }
    .featured-tier__icon {
        width: 48px;
        height: 48px;
    }
}

.featured-tier__chip {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-family: var(--font-display, 'Poppins', sans-serif);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #fff;
    background: linear-gradient(135deg, var(--chamber-teal) 0%, var(--chamber-teal-dark, #1a8a82) 100%);
    width: max-content;
}

/* Tier chips on the members directory.
   Each gradient runs LIGHT → DARK, so white text on the light end fails AA
   contrast. For light-end tiers we use a dark on-tier color; for dark-end
   tiers (slate, navy) white stays legible. text-shadow gives an extra half-
   stop of legibility on the mid-gradient stripe. */
.featured-tier--diamond .featured-tier__chip {
    background: linear-gradient(135deg, #6fc7e3 0%, #2193b0 100%);
    color: #0a2630;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}
.featured-tier--platinum .featured-tier__chip {
    background: linear-gradient(135deg, #c0c4c9 0%, #555a60 100%);
    color: #1c2024;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}
.featured-tier--gold .featured-tier__chip {
    background: linear-gradient(135deg, #f5d27a 0%, #b88a2c 100%);
    color: #3a2a07;
}
.featured-tier--silver .featured-tier__chip {
    background: linear-gradient(135deg, #d8dde1 0%, #8a929a 100%);
    color: #2b3137;
}
.featured-tier--bronze .featured-tier__chip {
    background: linear-gradient(135deg, #d4a373 0%, #8b5a2b 100%);
    color: #2a1a05;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.featured-tier__count {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--medium-gray);
    font-weight: 600;
}

/* Smart-centering grid:
   - Cards stay the same size on every row, regardless of how many appear.
   - The last (partial) row is auto-centered by flex's justify-content: center.
   - --cols controls how many cards fit per row (overridden per breakpoint). */
.featured-tier__grid {
    --cols: 4;
    --gap: var(--space-5);

    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--gap);
}

.featured-tier__grid > .member-card {
    flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
    max-width: calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
    box-sizing: border-box;
}

/* Diamond gets a slightly bigger 3-up layout (top of page, biggest investment). */
.featured-tier--diamond .featured-tier__grid { --cols: 3; }

@media (max-width: 1023px) {
    .featured-tier__grid { --cols: 3; }
    .featured-tier--diamond .featured-tier__grid { --cols: 2; }
}

@media (max-width: 767px) {
    .featured-tier__grid { --cols: 2; }
    .featured-tier--diamond .featured-tier__grid { --cols: 2; }
}

@media (max-width: 479px) {
    .featured-tier__grid { --cols: 1; }
    .featured-tier--diamond .featured-tier__grid { --cols: 1; }
}

/* ----- The Card itself ----- */

.member-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-6) var(--space-5) var(--space-5);
    text-align: center;
    border: 1px solid var(--light-gray);
    transition: transform 250ms cubic-bezier(.2,.8,.2,1),
                box-shadow 250ms ease,
                border-color 250ms ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
    font: inherit;
    appearance: none;
    width: 100%;
    overflow: hidden;
}

button.member-card { background: var(--white); }

.member-card:hover,
.member-card:focus-visible {
    border-color: var(--chamber-teal);
    box-shadow: 0 16px 40px -16px rgba(51, 79, 93, 0.32);
    transform: translateY(-3px);
    outline: none;
}

.member-card:focus-visible {
    box-shadow: 0 0 0 3px rgba(39, 175, 165, 0.4),
                0 16px 40px -16px rgba(51, 79, 93, 0.32);
}

.member-card--diamond { border-color: rgba(33, 147, 176, 0.4); border-top: 4px solid #2193b0; }
.member-card--platinum { border-top: 4px solid #555a60; }
.member-card--gold { border-top: 4px solid #b88a2c; }
.member-card--silver { border-top: 4px solid #8a929a; }
.member-card--bronze { border-top: 4px solid #8b5a2b; }

.member-card__corner {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    pointer-events: none;
    filter: drop-shadow(0 4px 8px rgba(51, 79, 93, 0.18));
    transition: transform 250ms cubic-bezier(.2,.8,.2,1);
}

.member-card:hover .member-card__corner,
.member-card:focus-visible .member-card__corner {
    transform: rotate(-6deg) scale(1.06);
}

.member-card__corner img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.member-card__logo {
    width: 140px;
    height: 90px;
    margin: 0 auto var(--space-4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.member-card--diamond .member-card__logo {
    width: 170px;
    height: 110px;
}

.member-card__logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
/* Dark chip for white/light logos (per-business logoBackground = 'dark'). */
.member-card__logo--dark {
    background: #16242f;
    border-radius: 12px;
    padding: 10px;
    box-sizing: border-box;
}

.member-card__name {
    font-size: var(--text-base);
    font-weight: var(--font-semibold);
    color: var(--dark-gray);
    margin-bottom: var(--space-1);
    line-height: 1.3;
}

.member-card--diamond .member-card__name {
    font-size: var(--text-lg);
}

.member-card__category {
    font-size: var(--text-sm);
    color: var(--medium-gray);
    margin: 0;
}

.member-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: var(--space-3);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--chamber-teal);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 220ms ease, transform 220ms ease;
}

.member-card:hover .member-card__cta,
.member-card:focus-visible .member-card__cta {
    opacity: 1;
    transform: translateY(0);
}

.member-card__cta svg {
    width: 12px;
    height: 12px;
}
