/**
 * LocalRecommend Directory — Plugin Stylesheet
 *
 * Designed to integrate with GeneratePress + Elementor.
 * All rules scoped to .lr-* BEM classes. Fonts and base colors inherited from theme.
 *
 * Theme reference:
 *   Font: Poppins (inherited)
 *   Accent: #D62B23
 *   Text: #222
 *   Light bg: #f7f8f9
 *   Max width: 1240px
 *   Mobile breakpoint: 768px
 */

/* ── Shared ──────────────────────────────────────────────── */

.lr-error {
    padding: 1rem 1.25rem;
    background: #fef2f2;
    border-left: 4px solid #D62B23;
    color: #991b1b;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

/* ── Directory Listing ───────────────────────────────────── */

.lr-directory__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

a.lr-directory__card {
    display: block;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

a.lr-directory__card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
    border-color: #D62B23;
    text-decoration: none;
    color: inherit;
}

.lr-directory__card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.lr-directory__card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #222;
}

.lr-directory__card-arrow {
    font-size: 1.2rem;
    color: #d1d5db;
    transition: color 0.2s ease, transform 0.2s ease;
}

a.lr-directory__card:hover .lr-directory__card-arrow {
    color: #D62B23;
    transform: translateX(3px);
}

.lr-directory__card-details {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0 0 0.75rem;
    line-height: 1.5;
}

.lr-directory__card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.lr-directory__badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    background: #f3f4f6;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #4b5563;
    line-height: 1.4;
}

/* ── Chapter Detail ──────────────────────────────────────── */

.lr-chapter__header {
    margin-bottom: 2rem;
}

.lr-chapter__info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.lr-chapter__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.9rem;
    background: #f3f4f6;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
    line-height: 1.4;
}

/* Section headings */
.lr-chapter__meeting-details h3,
.lr-chapter__quick-links h3,
.lr-chapter__leadership h3,
.lr-chapter__members h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #D62B23;
}

/* Meeting details card */
.lr-chapter__meeting-details {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.lr-chapter__meeting-details h3 {
    margin-top: 0;
}

/* Chapter map */
.lr-chapter__map {
    margin-bottom: 2rem;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    margin-top: -2rem;
}

/* Quick links */
.lr-chapter__quick-links {
    margin-bottom: 2rem;
}

/* Leadership section */
.lr-chapter__leadership {
    margin-bottom: 2rem;
}

/* Members section */
.lr-chapter__members {
    margin-bottom: 2rem;
}

/* ── Meeting Details (granular) ──────────────────────────── */

.lr-meeting-details__day {
    margin: 0 0 0.5rem;
}

.lr-meeting-details__info {
    line-height: 1.6;
}

/* ── Member Count (granular) ─────────────────────────────── */

.lr-member-count {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
}

.lr-member-count__number {
    font-size: 1.75rem;
    font-weight: 700;
    color: #D62B23;
    line-height: 1;
}

.lr-member-count__label {
    font-size: 0.9rem;
    color: #6b7280;
}

/* ── Leadership Grid ─────────────────────────────────────── */

.lr-leadership__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.lr-leadership__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.5rem 1rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

a.lr-leadership__card:hover,
.lr-leadership__card--linked:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.lr-leadership__photo {
    margin-bottom: 0.75rem;
}

.lr-leadership__photo-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.lr-leadership__photo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #D62B23;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1;
}

/* Gold Foundation card treatment */
.lr-leadership__card--gold {
    border-color: #c5991e;
    border-width: 2px;
    position: relative;
    overflow: hidden;
}

.lr-leadership__ribbon {
    position: absolute;
    top: 12px;
    right: -28px;
    background: linear-gradient(135deg, #d4a528, #a07c1c);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.2rem 2rem;
    transform: rotate(45deg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    z-index: 1;
}

.lr-leadership__name {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
}

.lr-leadership__role {
    font-size: 0.85rem;
    color: #D62B23;
    font-weight: 500;
    margin: 0 0 0.35rem;
    text-transform: capitalize;
}

.lr-leadership__company {
    font-size: 0.85rem;
    color: #4b5563;
    margin: 0 0 0.15rem;
}

.lr-leadership__profession {
    font-size: 0.8rem;
    color: #9ca3af;
    margin: 0;
}

/* ── Members Table ───────────────────────────────────────── */

.lr-members-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.lr-members-table__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.lr-members-table__table thead th {
    background: #D62B23;
    color: #fff;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.lr-members-table__table thead th:first-child {
    border-radius: 6px 0 0 0;
}

.lr-members-table__table thead th:last-child {
    border-radius: 0 6px 0 0;
}

.lr-members-table__table tbody td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.lr-members-table__row--even {
    background: #fff;
}

.lr-members-table__row--odd {
    background: #f9fafb;
}

.lr-members-table__table tbody tr:hover {
    background: #fef2f2;
}

.lr-members-table__table tbody td a {
    color: #D62B23;
    text-decoration: none;
    font-weight: 500;
}

.lr-members-table__table tbody td a:hover {
    text-decoration: underline;
}

/* ── Member Profile ──────────────────────────────────────── */

/* Hero card */
.lr-profile-hero {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

/* Leader card treatment */
.lr-profile-hero--leader {
    border-width: 2px;
    position: relative;
}

/* Color tiers — banner + left border */
.lr-profile-hero--gold   { border-color: #c5991e; }
.lr-profile-hero--silver { border-color: #8a8f96; }
.lr-profile-hero--bronze { border-color: #a0724a; }
.lr-profile-hero--blue   { border-color: #2563eb; }
.lr-profile-hero--teal   { border-color: #0d9488; }
.lr-profile-hero--purple { border-color: #7c3aed; }
.lr-profile-hero--green  { border-color: #16a34a; }
.lr-profile-hero--red    { border-color: #D62B23; }

.lr-profile-hero__banner {
    color: #fff;
    padding: 0.6rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-align: center;
}

/* Banner color per tier */
.lr-profile-hero--gold   .lr-profile-hero__banner { background: linear-gradient(135deg, #d4a528, #a07c1c); }
.lr-profile-hero--silver .lr-profile-hero__banner { background: linear-gradient(135deg, #8a8f96, #5f636a); }
.lr-profile-hero--bronze .lr-profile-hero__banner { background: linear-gradient(135deg, #b07d50, #7a5430); }
.lr-profile-hero--blue   .lr-profile-hero__banner { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
.lr-profile-hero--teal   .lr-profile-hero__banner { background: linear-gradient(135deg, #0d9488, #0f766e); }
.lr-profile-hero--purple .lr-profile-hero__banner { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.lr-profile-hero--green  .lr-profile-hero__banner { background: linear-gradient(135deg, #16a34a, #15803d); }
.lr-profile-hero--red    .lr-profile-hero__banner { background: linear-gradient(135deg, #D62B23, #a21f1a); }

/* Default banner for non-tiered */
.lr-profile-hero:not([class*="lr-profile-hero--"]) .lr-profile-hero__banner {
    background: linear-gradient(135deg, #D62B23 0%, #a21f1a 100%);
}

/* Shield badge */
.lr-profile-shield {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.4rem;
}

.lr-profile-shield__icon {
    width: 20px;
    height: 24px;
    flex-shrink: 0;
}

/* Shield icon color per tier */
.lr-profile-hero--gold   .lr-profile-shield__icon { color: #c5991e; }
.lr-profile-hero--silver .lr-profile-shield__icon { color: #8a8f96; }
.lr-profile-hero--bronze .lr-profile-shield__icon { color: #a0724a; }
.lr-profile-hero--blue   .lr-profile-shield__icon { color: #2563eb; }
.lr-profile-hero--teal   .lr-profile-shield__icon { color: #0d9488; }
.lr-profile-hero--purple .lr-profile-shield__icon { color: #7c3aed; }
.lr-profile-hero--green  .lr-profile-shield__icon { color: #16a34a; }
.lr-profile-hero--red    .lr-profile-shield__icon { color: #D62B23; }

.lr-profile-shield__label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lr-profile-hero--gold   .lr-profile-shield__label { color: #a07c1c; }
.lr-profile-hero--silver .lr-profile-shield__label { color: #5f636a; }
.lr-profile-hero--bronze .lr-profile-shield__label { color: #7a5430; }
.lr-profile-hero--blue   .lr-profile-shield__label { color: #1d4ed8; }
.lr-profile-hero--teal   .lr-profile-shield__label { color: #0f766e; }
.lr-profile-hero--purple .lr-profile-shield__label { color: #6d28d9; }
.lr-profile-hero--green  .lr-profile-shield__label { color: #15803d; }
.lr-profile-hero--red    .lr-profile-shield__label { color: #D62B23; }

.lr-profile-hero__body {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem 0.75rem;
}

.lr-profile-hero__photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e5e7eb;
    flex-shrink: 0;
}

.lr-profile-hero__info {
    min-width: 0;
}

.lr-profile-hero__role {
    font-size: 1.1rem;
    font-weight: 600;
    color: #D62B23;
    margin-bottom: 0.1rem;
}

.lr-profile-hero__company {
    font-size: 0.95rem;
    color: #374151;
    margin-bottom: 0.1rem;
}

.lr-profile-hero__chapter {
    font-size: 0.85rem;
    color: #6b7280;
}

.lr-profile-hero__chapter a {
    color: #D62B23;
    text-decoration: none;
    font-weight: 500;
}

.lr-profile-hero__chapter a:hover {
    text-decoration: underline;
}

/* Action buttons row */
.lr-profile-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem 1.25rem;
}

.lr-profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.lr-profile-btn--primary {
    background: #D62B23;
    color: #fff;
    border-color: #D62B23;
}

.lr-profile-btn--primary:hover {
    background: #b82420;
    color: #fff;
    text-decoration: none;
}

.lr-profile-btn--outline {
    background: #fff;
    color: #D62B23;
    border-color: #D62B23;
}

.lr-profile-btn--outline:hover {
    background: #fef2f2;
    color: #D62B23;
    text-decoration: none;
}

.lr-profile-btn--muted {
    background: #f3f4f6;
    color: #6b7280;
    border-color: #e5e7eb;
    cursor: default;
}

/* Body: sidebar + main */
.lr-profile-body {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* Sidebar — stacked metadata */
.lr-profile-sidebar {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.lr-profile-sidebar__item {
    padding: 0.75rem 1.1rem;
    border-bottom: 1px solid #f0f0f0;
}

.lr-profile-sidebar__item:last-child {
    border-bottom: none;
}

.lr-profile-sidebar__label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.lr-profile-sidebar__value {
    font-size: 0.9rem;
    color: #222;
    font-weight: 500;
}

/* Main — content sections */
.lr-profile-main {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lr-profile-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 1.1rem 1.35rem;
}

.lr-profile-section__title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #D62B23;
    font-weight: 700;
    margin: 0 0 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #fde8e8;
}

.lr-profile-section__content {
    font-size: 0.9rem;
    line-height: 1.65;
    color: #374151;
}

.lr-profile-section__content p {
    margin: 0 0 0.5rem;
}

.lr-profile-section__content p:last-child {
    margin-bottom: 0;
}

/* ── Member Profile Map ─────────────────────────────────── */

.lr-profile-map {
    margin-top: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.lr-profile-map__iframe {
    display: block;
    width: 100%;
    height: 350px;
    border: 0;
}

/* ── Leadership Tag (members table) ─────────────────────── */

.lr-members-table__leadership-tag {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.15rem 0.5rem;
    background: #fef3c7;
    color: #92400e;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: capitalize;
    vertical-align: middle;
    line-height: 1.4;
}

/* ── Gold Foundation Badge ───────────────────────────────── */

/* Standalone gold shield treatment (used outside leadership tier context) */
.lr-profile-shield--gold .lr-profile-shield__icon {
    color: #c5991e;
}

.lr-profile-shield--gold .lr-profile-shield__label {
    color: #a07c1c;
}

/* Top Performer shield variant */
.lr-profile-shield--performer .lr-profile-shield__icon {
    color: #d97706;
}

.lr-profile-shield--performer .lr-profile-shield__label {
    color: #b45309;
}

/* Inline gold badge icon in members table */
.lr-gold-badge-icon {
    display: inline-block;
    width: 14px;
    height: 16px;
    vertical-align: middle;
    margin-left: 0.3rem;
    flex-shrink: 0;
}

/* Top Performer pill badge */
.lr-top-performer-badge {
    display: inline-block;
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.15em 0.5em;
    border-radius: 9999px;
    vertical-align: middle;
    margin-left: 0.4rem;
    line-height: 1.4;
    white-space: nowrap;
}


/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 768px) {
    /* Directory grid: 1 column */
    .lr-directory__grid {
        grid-template-columns: 1fr;
    }

    /* Leadership grid: 2 columns */
    .lr-leadership__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    /* Members table: card layout */
    .lr-members-table__table,
    .lr-members-table__table thead,
    .lr-members-table__table tbody,
    .lr-members-table__table th,
    .lr-members-table__table td,
    .lr-members-table__table tr {
        display: block;
    }

    .lr-members-table__table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        border: 0;
    }

    .lr-members-table__table tbody tr {
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 0.75rem 1rem;
        margin-bottom: 0.75rem;
    }

    .lr-members-table__table tbody td {
        padding: 0.3rem 0;
        border-bottom: none;
        text-align: left;
    }

    .lr-members-table__table tbody td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: #9ca3af;
    }

    /* Member profile */
    .lr-profile-hero__body {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .lr-profile-hero__actions {
        justify-content: center;
    }

    .lr-profile-body {
        grid-template-columns: 1fr;
    }

    .lr-profile-sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .lr-profile-sidebar__item {
        border-bottom: none;
        border-right: 1px solid #f0f0f0;
    }

    .lr-profile-sidebar__item:nth-child(2n) {
        border-right: none;
    }
}

@media (max-width: 480px) {
    /* Leadership grid: 1 column on small phones */
    .lr-leadership__grid {
        grid-template-columns: 1fr;
    }

    .lr-profile-hero__actions {
        flex-direction: column;
    }

    .lr-profile-btn {
        justify-content: center;
    }

    .lr-profile-sidebar {
        grid-template-columns: 1fr;
    }

    .lr-profile-sidebar__item {
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
    }

    .lr-profile-sidebar__item:last-child {
        border-bottom: none;
    }
}
